LP1937299: Collections Exempt User Setting Repair user/mccanna/lp1937299_collections_exempt_signoff
authorJason Boyer <JBoyer@equinoxOLI.org>
Thu, 22 Jul 2021 17:50:53 +0000 (13:50 -0400)
committerTerran McCanna <tmccanna@georgialibraries.org>
Wed, 11 Aug 2021 18:54:12 +0000 (14:54 -0400)
The collections exempt user setting was never added to the seed data
meaning that depending on the age of your database it may or may not
be there. Additionally, correct the label for this setting in the
user editor.

Signed-off-by: Jason Boyer <JBoyer@equinoxOLI.org>
Signed-off-by: Terran McCanna <tmccanna@georgialibraries.org>
Open-ILS/src/sql/Pg/950.data.seed-values.sql
Open-ILS/src/sql/Pg/upgrade/XXXX.data.patron_collections_exempt.sql [new file with mode: 0644]
Open-ILS/src/templates/staff/circ/patron/t_edit.tt2

index 528ed56..8f9c5a2 100644 (file)
@@ -3066,6 +3066,32 @@ INSERT INTO config.usr_setting_type (
     'true'
 );
 
+INSERT INTO config.usr_setting_type (
+    name,
+    opac_visible,
+    label,
+    description,
+    datatype,
+    reg_default
+) VALUES (
+    'circ.collections.exempt',
+    FALSE,
+    oils_i18n_gettext(
+        'circ.collections.exempt',
+        'Collections: Exempt',
+        'cust',
+        'label'
+    ),
+    oils_i18n_gettext(
+        'circ.collections.exempt',
+        'User is exempt from collections tracking/processing',
+        'cust',
+        'description'
+    ),
+    'bool',
+    'false'
+);
+
 -- Add groups for org_unit settings
 INSERT INTO config.settings_group (name, label) VALUES
 ('acq', oils_i18n_gettext('acq', 'Acquisitions', 'csg', 'label')),
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.patron_collections_exempt.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.patron_collections_exempt.sql
new file mode 100644 (file)
index 0000000..1e7c407
--- /dev/null
@@ -0,0 +1,43 @@
+BEGIN;
+
+SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+
+DO $$
+BEGIN
+
+  PERFORM FROM config.usr_setting_type WHERE name = 'circ.collections.exempt';
+
+  IF NOT FOUND THEN
+
+    INSERT INTO config.usr_setting_type (
+      name,
+      opac_visible,
+      label,
+      description,
+      datatype,
+      reg_default
+    ) VALUES (
+      'circ.collections.exempt',
+      FALSE,
+      oils_i18n_gettext(
+        'circ.collections.exempt',
+        'Collections: Exempt',
+        'cust',
+        'label'
+      ),
+      oils_i18n_gettext(
+        'circ.collections.exempt',
+        'User is exempt from collections tracking/processing',
+        'cust',
+        'description'
+      ),
+      'bool',
+      'false'
+    );
+
+  END IF;
+
+END
+$$;
+
+COMMIT;
index c92edb8..19cc2a8 100644 (file)
@@ -770,12 +770,11 @@ within the "form" by name for validation.
   </div>
 </div>
 
-<!-- TODO: Add circ.collections.exempt to master SQL seed data -->
 <div class="row reg-field-row" 
   ng-if="user_setting_types['circ.collections.exempt']">
   <div class="col-md-3 reg-field-label">
     <label id="exempt">
-      {{user_setting_types['circ.collections.exempt']}}
+      {{user_setting_types['circ.collections.exempt'].label()}}
     </label>
   </div>
   <div class="col-md-3 reg-field-input">