LP1937299: Collections Exempt User Setting Repair
authorJason Boyer <JBoyer@equinoxOLI.org>
Thu, 22 Jul 2021 17:50:53 +0000 (13:50 -0400)
committerGalen Charlton <gmc@equinoxOLI.org>
Thu, 12 Aug 2021 13:57:59 +0000 (09:57 -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>
Signed-off-by: Galen Charlton <gmc@equinoxOLI.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 0c22e85..9549b5d 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 5112adf..4b4925d 100644 (file)
@@ -773,12 +773,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">