From: Joseph Lewis Date: Tue, 14 Jun 2011 19:35:33 +0000 (-0600) Subject: Convert buttons to toobar cleaning up page a lot. Added new notification X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=96af8f5182acf5c04b6cc85d5ef0a3ff93aae6a3;p=evergreen%2Fmasslnc.git Convert buttons to toobar cleaning up page a lot. Added new notification system. Signed-off-by: Joseph Lewis Signed-off-by: Thomas Berezansky Signed-off-by: Jason Etheridge --- diff --git a/Open-ILS/web/opac/locale/en-US/lang.dtd b/Open-ILS/web/opac/locale/en-US/lang.dtd index 84952d452d..0af38c262d 100644 --- a/Open-ILS/web/opac/locale/en-US/lang.dtd +++ b/Open-ILS/web/opac/locale/en-US/lang.dtd @@ -1817,6 +1817,11 @@ + + + + + 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 e7435340b5..60f0e48d2e 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 @@ -17,20 +17,23 @@ dojo.require('openils.widget.OrgUnitFilteringSelect'); dojo.require('openils.PermaCrud'); dojo.require('openils.widget.AutoFieldWidget'); dojo.require('openils.widget.ProgressDialog'); +dojo.require('dijit.Toolbar'); var authtoken; var contextOrg; var user; var osSettings = {}; var ouSettingValues = {}; +var ouSettingNames = {}; var osEditAutoWidget; var perm_codes = {}; var osGroups = {}; var searchAssist = []; var pcrud; -var osHistory = {}; function osInit(data) { + showProcessingDialog(true); + authtoken = new openils.CGI().param('ses') || dojo.cookie('ses'); user = new openils.User({authtoken:authtoken}); contextOrg = user.user.ws_ou(); @@ -41,8 +44,6 @@ function osInit(data) { var grps = pcrud.retrieveAll('csg'); dojo.forEach(grps, function(grp) { osGroups[grp.name()] = grp.label(); }); - //osHistory = pcrud.retrieveAll('coustl'); - var connect = function() { dojo.connect(contextOrg, 'onChange', osChangeContext); @@ -71,6 +72,8 @@ function osInit(data) { } } ); + + showProcessingDialog(false); } dojo.addOnLoad(osInit); @@ -148,27 +151,27 @@ function osLimitSeen(text) { //Don't update on an empty list as this causes bizarre errors. if(names.length == 0) { showProcessingDialog(false); - - var noresults = dojo.byId('noresults').innerHTML; - myDialog = new dijit.Dialog({ content: noresults}); - myDialog.show(); + showAlert(dojo.byId('noresults').innerHTML); return; } ouSettingValues = {}; // Clear the values. - osDrawNames(names); + osDrawNames(names); // Repopulate setting values with the ones we want. } function doSearch() { - var query = dojo.byId("searchBox").value; + var query = dojo.byId('searchBox').value; + osLimitSeen(query); return false; //Keep form from submitting } function clearSearch() { - dojo.byId("searchBox").value = ""; - osDraw(); + if(dojo.byId('searchBox').value != '') { // Don't refresh on blank. + dojo.byId('searchBox').value = ''; + doSearch(); + } } function osToJson() { @@ -185,11 +188,13 @@ function osToJson() { osJSONOutDialog.show(); } +// Copies the text from the json output to the clipboard. function osJsonOutputCopy() { document.popupNode = dojo.byId('jsonOutput'); - document.getElementById('jsonOutput').focus(); - document.getElementById('jsonOutput').select(); + dojo.byId('jsonOutput').focus(); + dojo.byId('jsonOutput').select(); util.clipboard.copy(); + showAlert(dojo.byId('os-copy').innerHTML); } function osJsonInputPaste() { @@ -451,8 +456,6 @@ function osEditSetting(deleteMe) { } function osUpdateSetting(obj, context, name) { - - fieldmapper.standardRequest( ['open-ils.actor', 'open-ils.actor.org_unit.settings.update'], { async: true, @@ -466,3 +469,58 @@ function osUpdateSetting(obj, context, name) { } ); } + +function osGetHistoryLink(rowIdx) { + var data = this.grid.model.getRow(rowIdx); + if(!data) return ''; + return data.name; +} + +function osFormatHistoryLink(name) { + return this.value.replace(/SETTING/, name); +} + +function osLaunchHistory(name) { + showProcessingDialog(true); + + dojo.byId('osHistName').innerHTML = osSettings[name].label; + + var data = dojo.byId('histTitle').innerHTML; + 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() + + "" + thisHist[i].new_value() + ""; + } + + dojo.byId('historyData').innerHTML = data; + + showProcessingDialog(false); + osHistDialog.show(); + +} + +function showAlert(message, timeout) { + if(timeout == null) + timeout = 3000; + + dojo.removeClass('msgCont', 'hidden'); + + dojo.byId('msgInner').innerHTML = message; + + var fadeArgs = { + node: "msgCont" + }; + dojo.fadeIn(fadeArgs).play(); + + window.setTimeout('hideAlert()', timeout); + +} + +function hideAlert() { + 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 96a463af6b..58ba5cc3c8 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,31 +29,76 @@