From 53b70bf549b67038b79270611e29e0d6dee16fd2 Mon Sep 17 00:00:00 2001 From: Joseph Lewis Date: Tue, 14 Jun 2011 15:46:59 -0600 Subject: [PATCH] Updated so that the history shows the org-unit shortname rather than the id. Signed-off-by: Joseph Lewis Signed-off-by: Thomas Berezansky Signed-off-by: Jason Etheridge --- .../staff_client/server/admin/org_unit_settings.js | 19 +++++++++++-------- .../staff_client/server/admin/org_unit_settings.xhtml | 6 +++--- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/Open-ILS/xul/staff_client/server/admin/org_unit_settings.js b/Open-ILS/xul/staff_client/server/admin/org_unit_settings.js index 60f0e48d2e..cbfb8c2657 100644 --- a/Open-ILS/xul/staff_client/server/admin/org_unit_settings.js +++ b/Open-ILS/xul/staff_client/server/admin/org_unit_settings.js @@ -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 += "" + thisHist[i].date_applied() + "" + - thisHist[i].org() + "" + thisHist[i].original_value() + + ouNames[thisHist[i].org()] + "" + thisHist[i].original_value() + "" + thisHist[i].new_value() + ""; } @@ -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'); } diff --git a/Open-ILS/xul/staff_client/server/admin/org_unit_settings.xhtml b/Open-ILS/xul/staff_client/server/admin/org_unit_settings.xhtml index 58ba5cc3c8..988ad21ea7 100644 --- a/Open-ILS/xul/staff_client/server/admin/org_unit_settings.xhtml +++ b/Open-ILS/xul/staff_client/server/admin/org_unit_settings.xhtml @@ -29,7 +29,7 @@ -- 2.11.0