Add support for an initial type_filter param to org_unit_settings.xhtml to load only...
authormiker <miker@c09e901b-359b-4c48-93b1-c7450cb1b5b7>
Wed, 16 May 2012 13:37:55 +0000 (13:37 +0000)
committerBill Erickson <berick@esilibrary.com>
Fri, 30 May 2014 15:08:28 +0000 (11:08 -0400)
git-svn-id: svn://fulfillment-ill.org/FulfILLment/trunk@384 c09e901b-359b-4c48-93b1-c7450cb1b5b7

Signed-off-by: Bill Erickson <berick@esilibrary.com>

Open-ILS/xul/staff_client/chrome/content/main/menu.js
Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties
Open-ILS/xul/staff_client/server/admin/index.xhtml
Open-ILS/xul/staff_client/server/admin/org_unit_settings.js

index 4d923c2..86fd9a7 100644 (file)
@@ -162,15 +162,32 @@ main.menu.prototype = {
             );
         }
 
-        function open_admin_page(path, labelKey, addSes, event) {
+        function open_admin_page(path, labelKey, addSes, event, params) {
 
             // tab label
             labelKey = labelKey || 'menu.cmd_open_conify.tab';
             label = offlineStrings.getString(labelKey);
 
             // URL
+                       var has_params = false;
             var loc = urls.XUL_BROWSER + '?url=' + window.escape( obj.url_prefix('XUL_LOCAL_ADMIN_BASE/') + path);
-            if(addSes) loc += window.escape('?ses=' + ses());
+            if(addSes) {
+                               loc += window.escape('?ses=' + ses());
+                               has_params = true;
+                       }
+
+                       if (params) {
+                               for (var i in params) {
+                                       if (!params[i]) continue;
+                                       if (!has_params) {
+                                               loc += window.escape('?');
+                                               has_params = true;
+                                       } else {
+                                               loc += window.escape('&');
+                                       }
+                                       loc += window.escape(i + '=' + params[i]);
+                               }
+                       }
 
             obj.command_tab( 
                 event,
@@ -728,6 +745,10 @@ main.menu.prototype = {
                 ['oncommand'],
                 function(event) { open_admin_page('org_unit_settings.xhtml', 'menu.cmd_local_admin_lib_settings.tab', true, event); }
             ],
+            'cmd_local_admin_connector_settings' : [
+                ['oncommand'],
+                function() { open_admin_page('org_unit_settings.xhtml', 'menu.cmd_local_admin_connector_settings.tab', true, event, { type_filter : 'ff%' }); }
+            ],
             'cmd_local_admin_non_cat_types' : [
                 ['oncommand'],
                 function(event) { open_admin_page('non_cat_types.xhtml', 'menu.cmd_local_admin_non_cat_types.tab', true, event); }
index c4639ec..487a336 100644 (file)
@@ -234,6 +234,7 @@ menu.cmd_local_admin_do_not_auto_attempt_print_setting.tab='Do Not Attempt Auto-
 menu.cmd_local_admin_closed_dates.tab=Closed Dates Editor
 menu.cmd_local_admin_copy_locations.tab=Copy Locations Editor
 menu.cmd_local_admin_lib_settings.tab=Library Settings Editor
+menu.cmd_local_admin_connector_settings.tab=Connector Settings Editor
 menu.cmd_local_admin_non_cat_types.tab=Non-cataloged Types Editor
 menu.cmd_local_admin_stat_cats.tab=Statistical Categories Editor
 menu.cmd_local_admin_reports.tab=Reports
index ea4a3f1..353097e 100644 (file)
@@ -69,6 +69,9 @@
                                 <a href='javascript:_l("org_unit_settings.xhtml");'>&staff.server.admin.index.library_settings;</a>
                             </div>
                             <div style='padding: 8px;'>
+                                <a href='javascript:_l("org_unit_settings.xhtml?type_filter=ff%25");'>Connector Settings Editor</a>
+                            </div>
+                            <div style='padding: 8px;'>
                                 <a href='javascript:_l("non_cat_types.xhtml");'>&staff.server.admin.index.non_cataloged_types;</a>
                             </div>
                             <div style='padding: 8px;'>
index 92bf2ea..5530e29 100644 (file)
@@ -24,6 +24,7 @@ var authtoken;
 var query;
 var contextOrg;
 var user;
+var type_filter;
 var osSettings = {};
 var ouSettingValues = {};
 var ouSettingNames = {};
@@ -37,6 +38,7 @@ var pcrud;
 function osInit(data) {
     showProcessingDialog(true);
     
+    var tf = new openils.CGI().param('type_filter');
     authtoken = new openils.CGI().param('ses') || dojo.cookie('ses');
     if(!authtoken && openils.XUL.isXUL()) {
         var stash = openils.XUL.getStash();
@@ -47,6 +49,9 @@ function osInit(data) {
     contextOrg = user.user.ws_ou();
     openils.User.authtoken = authtoken;
     
+    if (tf) type_filter = { name : { like : type_filter } };
+    else type_filter = { name : { '!=' : null } };
+
     pcrud = new openils.PermaCrud({authtoken:authtoken});
     
     var grps = pcrud.retrieveAll('csg');
@@ -107,7 +112,7 @@ function osDraw(specific_setting) {
             names.push(key);
 
     } else {
-        var types = new openils.PermaCrud({authtoken:authtoken}).retrieveAll('coust');
+        var types = new openils.PermaCrud({authtoken:authtoken}).search('coust', type_filter);
 
         searchAssist =  [];
         
@@ -298,6 +303,7 @@ function osChangeContext() {
 function osLoadGrid(data) {
     var gridData = {items:[]}
     for(var key in data) {
+        if (!osSettings[key]) continue;
         var setting = osSettings[key];
         setting.context = null;
         setting.value = null;