LP#1961534 Setting to hide the "Clear These Holds" button user/dbriem/lp1961534_hide_clear_these_holds_button
authorDan Briem <dbriem@wlsmail.org>
Sun, 20 Feb 2022 20:05:02 +0000 (15:05 -0500)
committerDan Briem <dbriem@wlsmail.org>
Sun, 20 Feb 2022 20:05:02 +0000 (15:05 -0500)
New org unit setting to hide the Clear These Holds button from
the Holds Shelf interface.

Signed-off-by: Dan Briem <dbriem@wlsmail.org>
Open-ILS/src/sql/Pg/950.data.seed-values.sql
Open-ILS/src/sql/Pg/upgrade/xxxx.data.hide_clear_these_holds_button.sql [new file with mode: 0644]
Open-ILS/src/templates/staff/circ/holds/t_shelf_list.tt2
Open-ILS/web/js/ui/default/staff/circ/holds/app.js

index 58f4a18..1a2a74b 100644 (file)
@@ -22049,3 +22049,23 @@ VALUES (
         'cwst', 'label'
     )
 );
+
+INSERT INTO config.org_unit_setting_type (
+    name, grp, label, description, datatype
+) VALUES (
+    'ui.hide_clear_these_holds_button',
+    'gui',
+    oils_i18n_gettext(
+        'ui.hide_clear_these_holds_button',
+        'Hide the Clear These Holds button',
+        'coust',
+        'label'
+    ),
+    oils_i18n_gettext(
+        'ui.hide_clear_these_holds_button',
+        'Hide the Clear These Holds button from the Holds Shelf interface.',
+        'coust',
+        'description'
+    ),
+    'bool'
+);
diff --git a/Open-ILS/src/sql/Pg/upgrade/xxxx.data.hide_clear_these_holds_button.sql b/Open-ILS/src/sql/Pg/upgrade/xxxx.data.hide_clear_these_holds_button.sql
new file mode 100644 (file)
index 0000000..7c442f5
--- /dev/null
@@ -0,0 +1,25 @@
+BEGIN;
+
+SELECT evergreen.upgrade_deps_block_check('xxxx', :eg_version);
+
+INSERT INTO config.org_unit_setting_type (
+name, grp, label, description, datatype
+) VALUES (
+  'ui.hide_clear_these_holds_button',
+  'gui',
+  oils_i18n_gettext(
+    'ui.hide_clear_these_holds_button',
+    'Hide the Clear These Holds button',
+    'coust',
+    'label'
+  ),
+  oils_i18n_gettext(
+    'ui.hide_clear_these_holds_button',
+    'Hide the Clear These Holds button from the Holds Shelf interface.',
+    'coust',
+    'description'
+  ),
+  'bool'
+);
+
+COMMIT;
\ No newline at end of file
index c89823c..c3d0b27 100644 (file)
@@ -17,7 +17,8 @@
     hidden="active_mode" disabled="is_clearing"
     label="[% l('Show All Holds') %]"></eg-grid-menu-item>
 
-  <eg-grid-menu-item handler="clear_holds" disabled="disable_clear"
+  <eg-grid-menu-item handler="clear_holds"
+    hidden="hide_clear_holds" disabled="disable_clear"
     label="[% l('Clear These Holds') %]"></eg-grid-menu-item>
 
   <eg-grid-menu-item handler="print_shelf_list"
index cc13f30..7af37c5 100644 (file)
@@ -209,6 +209,12 @@ function($scope , $q , $routeParams , $window , $location , egCore , egHolds , e
     $scope.show_clearable = function() { clear_mode = true; provider.refresh() }
     $scope.show_active = function() { clear_mode = false; provider.refresh() }
     $scope.disable_clear = function() { return clearing || !clear_mode }
+    egCore.org.settings(
+        'ui.hide_clear_these_holds_button'
+    ).then(function(settings) {
+        if (settings['ui.hide_clear_these_holds_button'])
+            $scope.hide_clear_holds = true;
+    });
 
     // udpate the in-grid hold with the clear-shelf cached response info.
     function handle_clear_cache_resp(resp) {