Updated so that the history shows the org-unit shortname rather than the id.
authorJoseph Lewis <joehms22@gmail.com>
Tue, 14 Jun 2011 21:46:59 +0000 (15:46 -0600)
committerJason Etheridge <jason@esilibrary.com>
Thu, 15 Sep 2011 16:17:31 +0000 (12:17 -0400)
Signed-off-by: Joseph Lewis <joehms22@gmail.com>
Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Open-ILS/xul/staff_client/server/admin/org_unit_settings.js
Open-ILS/xul/staff_client/server/admin/org_unit_settings.xhtml

index 60f0e48..cbfb8c2 100644 (file)
@@ -20,11 +20,13 @@ dojo.require('openils.widget.ProgressDialog');
 dojo.require('dijit.Toolbar');
 
 var authtoken;
+var query;
 var contextOrg;
 var user;
 var osSettings = {};
 var ouSettingValues = {};
 var ouSettingNames = {};
+var ouNames = {};
 var osEditAutoWidget;
 var perm_codes = {};
 var osGroups = {};
@@ -35,6 +37,7 @@ function osInit(data) {
     showProcessingDialog(true);
     
     authtoken = new openils.CGI().param('ses') || dojo.cookie('ses');
+    query = new openils.CGI().param('filter');
     user = new openils.User({authtoken:authtoken});
     contextOrg = user.user.ws_ou();
     openils.User.authtoken = authtoken;
@@ -55,6 +58,7 @@ function osInit(data) {
                 dojo.removeClass('no-perms', 'hide_me');
             }
         });
+        
     };
 
     new openils.User().buildPermOrgSelector('VIEW_ORG_SETTINGS', osContextSelector, null, connect);
@@ -73,6 +77,9 @@ function osInit(data) {
         }
     );
     
+    var aous = pcrud.retrieveAll('aou');
+    dojo.forEach(aous, function(ou) { ouNames[ou.id()] = ou.shortname(); });
+    
     showProcessingDialog(false);
 }
 dojo.addOnLoad(osInit);
@@ -348,7 +355,7 @@ function osGetEditLink(rowIdx) {
 }
 
 function osFormatEditLink(name) {
-    return this.value.replace(/SETTING/, name);
+    return this.value.replace(/SETTING/g, name);
 }
 
 function osLaunchEditor(name) {
@@ -489,7 +496,7 @@ function osLaunchHistory(name) {
     var thisHist = pcrud.search('coustl', {'field_name':name});
     for(var i in thisHist) {
          data += "<tr><td>" + thisHist[i].date_applied() + "</td><td>" + 
-         thisHist[i].org() + "</td><td>" + thisHist[i].original_value() +
+         ouNames[thisHist[i].org()] + "</td><td>" + thisHist[i].original_value() +
          "</td><td>" + thisHist[i].new_value() + "</td></tr>";
     }
         
@@ -508,9 +515,7 @@ function showAlert(message, timeout) {
     
     dojo.byId('msgInner').innerHTML = message;
     
-    var fadeArgs = {
-        node: "msgCont"
-    };
+    var fadeArgs = { node: "msgCont" };
     dojo.fadeIn(fadeArgs).play();
     
     window.setTimeout('hideAlert()', timeout);
@@ -518,9 +523,7 @@ function showAlert(message, timeout) {
 }
 
 function hideAlert() {
-    var fadeArgs = {
-        node: "msgCont"
-    };
+    var fadeArgs = { node: "msgCont" };
     dojo.fadeOut(fadeArgs).play();
     dojo.addClass('msgCont', 'hidden');
 }
index 58ba5cc..988ad21 100644 (file)
@@ -29,7 +29,7 @@
         <script type="text/javascript" src='org_unit_settings.js' />
         <script type="text/javascript" src="/xul/server/util/clipboard.js" />
         <style type="text/css">
-            h1 {
+            h2 {
                 display:inline;
                 padding:5px;
             } 
@@ -77,7 +77,7 @@
         <div dojoType='dijit.layout.LayoutContainer' orientation='vertical' class='tall'>
             <div dojoType='dijit.layout.ContentPane' layoutAlign='top'>
                 <div id="toolbar1" dojoType="dijit.Toolbar">
-                    <strong>&staff.server.admin.org_unit_settings.title;</strong>
+                    <h2>&staff.server.admin.org_unit_settings.title;</h2>
                     
                     <span dojoType="dijit.ToolbarSeparator" />
                     
                             {name: '&staff.server.admin.org_unit_settings.group;', get: osGetGridData, field:'grp'},
                             {name: '&staff.server.admin.org_unit_settings.setting;', get: osGetGridData, field:'label', width:'auto', styles:'text-align:left;'},
                             {name: '&staff.server.admin.org_unit_settings.context;', get: osGetGridData, field:'context'},
-                            {name: '&staff.server.admin.org_unit_settings.value;', get: osGetGridData, field:'value', width:'auto'},
+                            {name: '&staff.server.admin.org_unit_settings.value;', get: osGetGridData, field:'value'},
                         ]]
                     }];
                 </script>