]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/sql/Pg/upgrade/0557.schema.in-db_unapi_copy_related_visibility-1.sql
LP#1117808: release notes for New Access points for MARC Overlay
[Evergreen.git] / Open-ILS / src / sql / Pg / upgrade / 0557.schema.in-db_unapi_copy_related_visibility-1.sql
1 -- Evergreen DB patch 0557.schmea.in-db_unapi_copy_related_visibility-1.sql
2 --
3 -- Bring in-db unAPI opac visibility info up to date with (and a little beyond) ea3b8857d08b8a9050e763f8084c841e8df9a473
4 --
5 BEGIN;
6
7
8 -- check whether patch can be applied
9 SELECT evergreen.upgrade_deps_block_check('0557', :eg_version);
10
11 CREATE OR REPLACE FUNCTION unapi.acl ( obj_id BIGINT, format TEXT,  ename TEXT, includes TEXT[], org TEXT, depth INT DEFAULT NULL, slimit INT DEFAULT NULL, soffset INT DEFAULT NULL, include_xmlns BOOL DEFAULT TRUE ) RETURNS XML AS $F$
12     SELECT  XMLELEMENT(
13                 name location,
14                 XMLATTRIBUTES(
15                     CASE WHEN $9 THEN 'http://open-ils.org/spec/holdings/v1' ELSE NULL END AS xmlns,
16                     id AS ident,
17                     holdable,
18                     opac_visible,
19                     label_prefix AS prefix,
20                     label_suffix AS suffix
21                 ),
22                 name
23             )
24       FROM  asset.copy_location
25       WHERE id = $1;
26 $F$ LANGUAGE SQL;
27
28 COMMIT;