Update permission name to match existing ones
[transitory.git] / Open-ILS / src / sql / Pg / 950.data.seed-values.sql
index 0c0744c..41eb5fe 100644 (file)
@@ -20,13 +20,13 @@ INSERT INTO config.standing (id, value) VALUES (2, oils_i18n_gettext(2, 'Barred'
 SELECT SETVAL('config.standing_id_seq'::TEXT, 100);
 
 INSERT INTO config.standing_penalty (id,name,label,block_list,staff_alert)
-       VALUES (1,'PATRON_EXCEEDS_FINES',oils_i18n_gettext(1, 'Patron exceeds fine threshold', 'csp', 'label'),'CIRC|HOLD|CAPTURE|FULFILL|RENEW', TRUE);
+       VALUES (1,'PATRON_EXCEEDS_FINES',oils_i18n_gettext(1, 'Patron exceeds fine threshold', 'csp', 'label'),'CIRC|FULFILL|HOLD|CAPTURE|RENEW', TRUE);
 INSERT INTO config.standing_penalty (id,name,label,block_list,staff_alert)
-       VALUES (2,'PATRON_EXCEEDS_OVERDUE_COUNT',oils_i18n_gettext(2, 'Patron exceeds max overdue item threshold', 'csp', 'label'),'CIRC|HOLD|CAPTURE|FULFILL|RENEW', TRUE);
+       VALUES (2,'PATRON_EXCEEDS_OVERDUE_COUNT',oils_i18n_gettext(2, 'Patron exceeds max overdue item threshold', 'csp', 'label'),'CIRC|FULFILL|HOLD|CAPTURE|RENEW', TRUE);
 INSERT INTO config.standing_penalty (id,name,label,block_list,staff_alert)
-       VALUES (3,'PATRON_EXCEEDS_CHECKOUT_COUNT',oils_i18n_gettext(3, 'Patron exceeds max checked out item threshold', 'csp', 'label'),'CIRC', TRUE);
+       VALUES (3,'PATRON_EXCEEDS_CHECKOUT_COUNT',oils_i18n_gettext(3, 'Patron exceeds max checked out item threshold', 'csp', 'label'),'CIRC|FULFILL', TRUE);
 INSERT INTO config.standing_penalty (id,name,label,block_list,staff_alert)
-       VALUES (4,'PATRON_EXCEEDS_COLLECTIONS_WARNING',oils_i18n_gettext(4, 'Patron exceeds pre-collections warning fine threshold', 'csp', 'label'),'CIRC|HOLD|CAPTURE|FULFILL|RENEW', TRUE);
+       VALUES (4,'PATRON_EXCEEDS_COLLECTIONS_WARNING',oils_i18n_gettext(4, 'Patron exceeds pre-collections warning fine threshold', 'csp', 'label'),'CIRC|FULFILL|HOLD|CAPTURE|RENEW', TRUE);
 
 INSERT INTO config.standing_penalty (id,name,label,staff_alert) VALUES (20,'ALERT_NOTE',oils_i18n_gettext(20, 'Alerting Note, no blocks', 'csp', 'label'),TRUE);
 INSERT INTO config.standing_penalty (id,name,label) VALUES (21,'SILENT_NOTE',oils_i18n_gettext(21, 'Note, no blocks', 'csp', 'label'));
@@ -1559,7 +1559,15 @@ INSERT INTO permission.perm_list ( id, code, description ) VALUES
  ( 534, 'ADMIN_USER_ACTIVITY_TYPE', oils_i18n_gettext( 534,
     'Allows a user to create/retrieve/update/delete user activity types', 'ppl', 'description' )),
 ( 535, 'VIEW_TRIGGER_EVENT', oils_i18n_gettext( 535,
-    'Allows a user to view circ- and hold-related action/trigger events', 'ppl', 'description'))
+    'Allows a user to view circ- and hold-related action/trigger events', 'ppl', 'description')),
+( 536, 'IMPORT_OVERLAY_COPY', oils_i18n_gettext( 536,
+    'Allows a user to overlay copy data in MARC import', 'ppl', 'description')),
+ ( 537, 'ADMIN_SEARCH_FILTER_GROUP', oils_i18n_gettext( 537,
+    'Allows staff to manage search filter groups and entries', 'ppl', 'description' )),
+ ( 538, 'VIEW_SEARCH_FILTER_GROUP', oils_i18n_gettext( 538,
+    'Allows staff to view search filter groups and entries', 'ppl', 'description' )),
+ ( 539, 'UPDATE_ORG_UNIT_SETTING.ui.hide_copy_editor_fields', oils_i18n_gettext( 539,
+    'Allows staff to edit displayed copy editor fields', 'ppl', 'description' ))
 ;
 
 
@@ -6352,6 +6360,28 @@ INSERT INTO config.coded_value_map (id, ctype, code, value) VALUES
     (535, 'bib_level', 'm', oils_i18n_gettext('535', 'Monograph/Item', 'ccvm', 'value')),
     (536, 'bib_level', 's', oils_i18n_gettext('536', 'Serial', 'ccvm', 'value'));
 
+INSERT INTO config.coded_value_map(id, ctype, code, value) VALUES
+    (537, 'vr_format', 'a', oils_i18n_gettext('537', 'Beta', 'ccvm', 'value')),
+    (538, 'vr_format', 'b', oils_i18n_gettext('538', 'VHS', 'ccvm', 'value')),
+    (539, 'vr_format', 'c', oils_i18n_gettext('539', 'U-matic', 'ccvm', 'value')),
+    (540, 'vr_format', 'd', oils_i18n_gettext('540', 'EIAJ', 'ccvm', 'value')),
+    (541, 'vr_format', 'e', oils_i18n_gettext('541', 'Type C', 'ccvm', 'value')),
+    (542, 'vr_format', 'f', oils_i18n_gettext('542', 'Quadruplex', 'ccvm', 'value')),
+    (543, 'vr_format', 'g', oils_i18n_gettext('543', 'Laserdisc', 'ccvm', 'value')),
+    (544, 'vr_format', 'h', oils_i18n_gettext('544', 'CED videodisc', 'ccvm', 'value')),
+    (545, 'vr_format', 'i', oils_i18n_gettext('545', 'Betacam', 'ccvm', 'value')),
+    (546, 'vr_format', 'j', oils_i18n_gettext('546', 'Betacam SP', 'ccvm', 'value')),
+    (547, 'vr_format', 'k', oils_i18n_gettext('547', 'Super-VHS', 'ccvm', 'value')),
+    (548, 'vr_format', 'm', oils_i18n_gettext('548', 'M-II', 'ccvm', 'value')),
+    (549, 'vr_format', 'o', oils_i18n_gettext('549', 'D-2', 'ccvm', 'value')),
+    (550, 'vr_format', 'p', oils_i18n_gettext('550', '8 mm.', 'ccvm', 'value')),
+    (551, 'vr_format', 'q', oils_i18n_gettext('551', 'Hi-8 mm.', 'ccvm', 'value')),
+    (552, 'vr_format', 's', oils_i18n_gettext('552', 'Blu-ray disc', 'ccvm', 'value')),
+    (553, 'vr_format', 'u', oils_i18n_gettext('553', 'Unknown', 'ccvm', 'value')),
+    (554, 'vr_format', 'v', oils_i18n_gettext('554', 'DVD', 'ccvm', 'value')),
+    (555, 'vr_format', 'z', oils_i18n_gettext('555', 'Other', 'ccvm', 'value')),
+    (556, 'vr_format', ' ', oils_i18n_gettext('556', 'Unspecified', 'ccvm', 'value'));
+
 SELECT SETVAL('config.coded_value_map_id_seq'::TEXT, (SELECT max(id) FROM config.coded_value_map));
 
 -- Trigger Event Definitions -------------------------------------------------
@@ -8034,7 +8064,32 @@ END;
             "free-text":[ 
                 [% FOR note IN ftx_vals -%] "[% note %]"[% UNLESS loop.last %], [% END %][% END %] 
             ],            
-            "quantity":[% li.lineitem_details.size %]
+            "quantity":[% li.lineitem_details.size %],
+            "copies" : [
+                [%- IF 1 -%]
+                [%- FOR lid IN li.lineitem_details;
+                        fund = lid.fund.code;
+                        item_type = lid.circ_modifier;
+                        callnumber = lid.cn_label;
+                        owning_lib = lid.owning_lib.shortname;
+                        location = lid.location;
+    
+                        # when we have real copy data, treat it as authoritative for some fields
+                        acp = lid.eg_copy_id;
+                        IF acp;
+                            item_type = acp.circ_modifier;
+                            callnumber = acp.call_number.label;
+                            location = acp.location.name;
+                        END -%]
+                {   [%- IF fund %] "fund" : "[% fund %]",[% END -%]
+                    [%- IF callnumber %] "call_number" : "[% callnumber %]", [% END -%]
+                    [%- IF item_type %] "item_type" : "[% item_type %]", [% END -%]
+                    [%- IF location %] "copy_location" : "[% location %]", [% END -%]
+                    [%- IF owning_lib %] "owning_lib" : "[% owning_lib %]", [% END -%]
+                    [%- #chomp %]"copy_id" : "[% lid.id %]" }[% ',' UNLESS loop.last %]
+                [% END -%]
+                [%- END -%]
+             ]
         }[% UNLESS loop.last %],[% END %]
         [%-# TODO: lineitem details (later) -%]
         [% END %]
@@ -8050,7 +8105,11 @@ $$
 
 INSERT INTO action_trigger.environment (event_def, path) VALUES 
   (23, 'lineitems.attributes'), 
-  (23, 'lineitems.lineitem_details'), 
+  (23, 'lineitems.lineitem_details.owning_lib'),
+  (23, 'lineitems.lineitem_details.location'),
+  (23, 'lineitems.lineitem_details.fund'),
+  (23, 'lineitems.lineitem_details.eg_copy_id.location'),
+  (23, 'lineitems.lineitem_details.eg_copy_id.call_number'),
   (23, 'lineitems.lineitem_notes'), 
   (23, 'ordering_agency.mailing_address'), 
   (23, 'provider'),
@@ -11611,7 +11670,7 @@ INSERT INTO config.global_flag (name, enabled, label)
         )
     );
 
-INSERT INTO config.org_unit_setting_type ( name, label, description, datatype, grp )
+INSERT INTO config.org_unit_setting_type ( name, label, description, datatype, grp, update_perm )
     VALUES (
         'ui.hide_copy_editor_fields',
         oils_i18n_gettext(
@@ -11629,7 +11688,8 @@ INSERT INTO config.org_unit_setting_type ( name, label, description, datatype, g
             'description'
         ),
         'array',
-        'gui'
+        'gui',
+        539
     );
 
 INSERT into config.org_unit_setting_type 
@@ -11726,3 +11786,53 @@ INSERT INTO config.org_unit_setting_type (
     'interval'
 );
 
+-- kid's opac main search filter
+
+INSERT INTO actor.search_filter_group (owner, code, label) 
+    VALUES (1, 'kpac_main', 'Kid''s OPAC Search Filter');
+
+INSERT INTO actor.search_query (label, query_text) 
+    VALUES ('Children''s Materials', 'audience(a,b,c)');
+INSERT INTO actor.search_query (label, query_text) 
+    VALUES ('Young Adult Materials', 'audience(j,d)');
+INSERT INTO actor.search_query (label, query_text) 
+    VALUES ('General/Adult Materials',  'audience(e,f,g, )');
+
+INSERT INTO actor.search_filter_group_entry (grp, query, pos)
+    VALUES (
+        (SELECT id FROM actor.search_filter_group WHERE code = 'kpac_main'),
+        (SELECT id FROM actor.search_query WHERE label = 'Children''s Materials'),
+        0
+    );
+INSERT INTO actor.search_filter_group_entry (grp, query, pos) 
+    VALUES (
+        (SELECT id FROM actor.search_filter_group WHERE code = 'kpac_main'),
+        (SELECT id FROM actor.search_query WHERE label = 'Young Adult Materials'),
+        1
+    );
+INSERT INTO actor.search_filter_group_entry (grp, query, pos) 
+    VALUES (
+        (SELECT id FROM actor.search_filter_group WHERE code = 'kpac_main'),
+        (SELECT id FROM actor.search_query WHERE label = 'General/Adult Materials'),
+        2
+    );
+INSERT into config.org_unit_setting_type
+    (name, grp, label, description, datatype)
+    VALUES (
+        'acq.fund.allow_rollover_without_money',
+        'acq',
+        oils_i18n_gettext(
+            'acq.fund.allow_rollover_without_money',
+            'Allow funds to be rolled over without bringing the money along',
+            'coust',
+            'label'
+        ),
+        oils_i18n_gettext(
+            'acq.fund.allow_rollover_without_money',
+            'Allow funds to be rolled over without bringing the money along.  This makes money left in the old fund disappear, modeling its return to some outside entity.',
+            'coust',
+            'description'
+        ),
+        'bool'
+    );
+