JBAS-1185 Picklist fund selector perm repairs
authorBill Erickson <berickxx@gmail.com>
Tue, 1 Mar 2016 17:23:39 +0000 (12:23 -0500)
committerBill Erickson <berickxx@gmail.com>
Thu, 21 Mar 2019 19:46:23 +0000 (15:46 -0400)
Enusre the fund search filter has a value set for the location org
units, based on picklist access permissions, otherwise zero funds
will be returned.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/web/js/ui/default/acq/picklist/view.js

index 616eb92..af7c6ae 100644 (file)
@@ -12,6 +12,21 @@ var liTable;
 
 
 function load() {
+    // before rendering any fund selectors, limit the funds to 
+    // attempt to retrieve to those the user can actually use.
+    new openils.User().getPermOrgList(
+        ['CREATE_PICKLIST', 'UPDATE_PICKLIST', 'MANAGE_FUND'],
+        function(orgs) { 
+            // fundSearchSelector is defined in li_table.js
+            if (typeof fundSearchFilter != 'undefined')
+              fundSearchFilter.org = orgs;
+            load2();
+        },
+        true, true // descendants, id_list
+    );
+}
+
+function load2() {
     liTable = new AcqLiTable();
     liTable.isPL = plId;
     liTable.initBatchUpdater();