[open-ils-commits] r11357 - trunk/Open-ILS/xul/staff_client/server/admin
svn at svn.open-ils.org
svn at svn.open-ils.org
Wed Nov 26 10:16:07 EST 2008
Author: erickson
Date: 2008-11-26 10:16:05 -0500 (Wed, 26 Nov 2008)
New Revision: 11357
Removed:
trunk/Open-ILS/xul/staff_client/server/admin/org_settings.js
trunk/Open-ILS/xul/staff_client/server/admin/org_settings.xhtml
Log:
removing deprecated org setting editor
Deleted: trunk/Open-ILS/xul/staff_client/server/admin/org_settings.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/admin/org_settings.js 2008-11-26 14:42:34 UTC (rev 11356)
+++ trunk/Open-ILS/xul/staff_client/server/admin/org_settings.js 2008-11-26 15:16:05 UTC (rev 11357)
@@ -1,158 +0,0 @@
-var ORG_SETTING_UPDATE = 'open-ils.actor:open-ils.actor.org_unit.settings.update';
-var ORG_SETTING_RETRIEVE = 'open-ils.actor:open-ils.actor.org_unit.settings.retrieve';
-var ORG_SETTING_DELETE = 'open-ils.actor:open-ils.actor.org_setting.delete';
-
-var myPerms = [ 'UPDATE_ORG_SETTING' ];
-
-
-var ORG_SETTINGS = {
- 'circ.lost_materials_processing_fee' : null,
- 'cat.default_item_price' : null,
- 'auth.opac_timeout' : null,
- 'auth.staff_timeout' : null,
- 'org.bounced_emails' : null,
-};
-
-function osEditorInit() {
- fetchUser();
- $('user').appendChild(text(USER.usrname()));
-
- for( var i in ORG_SETTINGS ) ORG_SETTINGS[i] = $(i);
-
- setTimeout(
- function() {
- fetchHighestPermOrgs( SESSION, USER.id(), myPerms );
- osBuildOrgs();
- osDrawRange();
- },
- 20
- );
-}
-
-function osCurrentOrg() {
- var selector = $('os_orgs');
- return getSelectorVal(selector);
-}
-
-function osBuildOrgs() {
- var org = findOrgUnit(PERMS['UPDATE_ORG_SETTING']);
-
- if( !org || org == -1 ) {
- org = findOrgUnit(USER.ws_ou());
- for( var i in ORG_SETTINGS )
- $(i+'.apply').disabled = true;
- }
-
- var type = findOrgType(org.ou_type()) ;
-
- var selector = $('os_orgs');
- buildOrgSel(selector, org, type.depth());
- if(!isTrue(type.can_have_users()))
- selector.options[0].disabled = true;
-
- selector.onchange = osDrawRange;
-
- osBaseOrg = org;
-
- if( ! osBaseOrg.children() )
- for( var i in ORG_SETTINGS )
- $(i+'.apply_all').disabled = true;
-
- var gotoOrg = USER.ws_ou();
- if( ! setSelector( selector, gotoOrg ) ) {
- gotoOrg = USER.home_ou();
- setSelector( selector, gotoOrg );
- }
-
- for( var i in ORG_SETTINGS )
- osSetCallback(i);
-
- return gotoOrg;
-}
-
-function osSetCallback(setting) {
- $(setting+'.apply_all').onclick = function() { osUpdate(setting, true); };
- $(setting+'.apply').onclick = function() { osUpdate(setting, false); };
-}
-
-
-
-function osDrawRange() {
- var org = osCurrentOrg();
- appendClear($('osCurrentOrg'), text(findOrgUnit(org).name()));
- var req = new Request(ORG_SETTING_RETRIEVE, org);
- req.callback(osDraw);
- req.send();
-}
-
-
-function osDraw( r ) {
- var org = osCurrentOrg();
- var settings = r.getResultObject();
-
- for( var i in ORG_SETTINGS ) {
- var node = ORG_SETTINGS[i];
- var val = settings[i];
- node.value =
- (node.getAttribute('ismoney')) ?
- _formatMoney(val) : (val != null) ? val : "";
- }
-}
-
-function _formatMoney(m) {
- if(!m || m == 0) return '0.00';
- m = m + '';
- if( m.match(/\d+\.\d+/) ) return m;
- if( !m.match(/\./) ) return m + '.00';
- if( m.match(/^\.\d+/) ) return '0' + m;
- return m;
-}
-
-function osUpdate( setting, allOrgs ) {
- var val = ORG_SETTINGS[setting].value;
- var org = osCurrentOrg();
-
- if(allOrgs) {
- if(!confirmId('os_confirm_all')) return;
- var sel = $('os_orgs');
- var stop = false;
- iterate( sel.options,
- function(item) {
- if(stop) return;
- var o_unit = findOrgUnit(item.value);
- var type = findOrgType(o_unit.ou_type()) ;
- if( type.can_have_users() ) {
- if(!osUpdateOrg(setting, val, o_unit.id()))
- stop = true;
- }
- }
- );
- if(!stop) alertId('os_success');
-
- } else {
-
- if(osUpdateOrg(setting, val, org))
- alertId('os_success');
- }
-
- osDrawRange();
-}
-
-function osUpdateOrg( setting, value, org ) {
- var s = {};
- s[setting] = (value.match(/^\s*$/) == null) ? value : null;
- var req = new Request(ORG_SETTING_UPDATE, SESSION, org, s);
- req.request.alertEvent = false;
- req.send(true);
- var resp = req.result();
-
- if( checkILSEvent(resp) ) {
- alertILSEvent(resp, "Error updating " + findOrgUnit(org).name() );
- return false;
- }
-
- return true;
-}
-
-
-
Deleted: trunk/Open-ILS/xul/staff_client/server/admin/org_settings.xhtml
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/admin/org_settings.xhtml 2008-11-26 14:42:34 UTC (rev 11356)
+++ trunk/Open-ILS/xul/staff_client/server/admin/org_settings.xhtml 2008-11-26 15:16:05 UTC (rev 11357)
@@ -1,100 +0,0 @@
-<?xml version='1.0' encoding="UTF-8"?>
-
-<!DOCTYPE html PUBLIC
- "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" [
- <!--#include virtual="/opac/locale/${locale}/lang.dtd"-->
-]>
-
-<html xmlns="http://www.w3.org/1999/xhtml" xmlns:xi="http://www.w3.org/2001/XInclude">
-
- <head>
- <title>&staff.server.admin.org_settings.title;</title>
- <script language='javascript' src='/opac/common/js/utils.js'> </script>
- <script language='javascript' src='/opac/common/js//config.js'> </script>
- <script language='javascript' src='/opac/common/js/CGI.js'> </script>
- <script language='javascript' src='/opac/common/js/Cookie.js'> </script>
-
- <script language='javascript' src='/opac/common/js/JSON_v1.js'> </script>
- <script language='javascript' src='/opac/common/js/fmall.js'> </script>
- <script language='javascript' src='/opac/common/js/fmgen.js'> </script>
- <script language='javascript' src='/opac/common/js/Cookies.js'> </script>
- <script language='javascript' src='/opac/common/js/opac_utils.js'> </script>
- <script language='javascript' src='/opac/common/js/OrgTree.js'> </script>
- <script language='javascript' src='/opac/common/js/org_utils.js'> </script>
- <script language='javascript' src='/opac/common/js/init.js'> </script>
- <script language='javascript' src='/opac/common/js/RemoteRequest.js'> </script>
- <script language='javascript' src='adminlib.js'> </script>
- <script language='javascript' src='org_settings.js'> </script>
-
- <link type='text/css' rel='stylesheet' href='admin.css' />
- </head>
-
- <body onload='osEditorInit();'>
-
- <div class='welcome_box'>
- <span>&staff.server.admin.org_settings.greeting;</span><b><span id='user'/></b>
- </div>
-
- <center>
- <div class='title'>&staff.server.admin.org_settings.header;</div>
-
- <br/><br/>
- &staff.server.admin.org_settings.select_library;<select id='os_orgs' style='width:auto;'/>
- <br/><br/>
-
- <table class='data_grid data_grid_center' width='85%'>
- <thead>
- <tr><td colspan='4' style='padding: 8px;'>&staff.server.admin.org_settings.selected_library;<b id='osCurrentOrg'/></td></tr>
- </thead>
- <tbody id='os_tbody'>
- <tr>
- <td>&staff.server.admin.org_settings.opac_timeout;</td>
- <td><input type='text' id='auth.opac_timeout' size='5'/></td>
- <td><button id='auth.opac_timeout.apply'>&staff.server.admin.org_settings.apply;</button></td>
- <td><button id='auth.opac_timeout.apply_all'>&staff.server.admin.org_settings.apply_all;</button></td>
- </tr>
- <tr>
- <td>&staff.server.admin.org_settings.staff_timeout;</td>
- <td><input type='text' id='auth.staff_timeout' size='5'/></td>
- <td><button id='auth.staff_timeout.apply'>&staff.server.admin.org_settings.apply;</button></td>
- <td><button id='auth.staff_timeout.apply_all'>&staff.server.admin.org_settings.apply_all;</button></td>
- </tr>
- <tr>
- <td>&staff.server.admin.org_settings.lost_fee;</td>
- <td>$<input ismoney='1' type='text' id='circ.lost_materials_processing_fee' size='5'/></td>
- <td><button id='circ.lost_materials_processing_fee.apply'>&staff.server.admin.org_settings.apply;</button></td>
- <td><button id='circ.lost_materials_processing_fee.apply_all'>&staff.server.admin.org_settings.apply_all;</button></td>
- </tr>
- <tr>
- <td>&staff.server.admin.org_settings.default_price;</td>
- <td>$<input ismoney='1' type='text' id='cat.default_item_price' size='5'/></td>
- <td><button id='cat.default_item_price.apply'>&staff.server.admin.org_settings.apply;</button></td>
- <td><button id='cat.default_item_price.apply_all'>&staff.server.admin.org_settings.apply_all;</button></td>
- </tr>
- <tr>
- <td>&staff.server.admin.org_settings.from_address;<br/>&staff.server.admin.org_settings.bounce_note;</td>
- <td><input type='text' id='org.bounced_emails' size='25'/></td>
- <td><button id='org.bounced_emails.apply'>&staff.server.admin.org_settings.apply;</button></td>
- <td><button id='org.bounced_emails.apply_all'>&staff.server.admin.org_settings.apply_all;</button></td>
- </tr>
- </tbody>
- </table>
- <br/>
- <div style='font-size: 9pt;'>
- <div>
- &staff.server.admin.org_settings.apply_all.note;
- </div>
- </div>
- </center>
- <span id='os_success' class='hide_me'>
- &staff.server.admin.org_settings.update_success;
- </span>
- <span id='os_confirm_all' class='hide_me'>
- &staff.server.admin.org_settings.apply_all.confirm;
- </span>
- </body>
-</html>
-
-
-
More information about the open-ils-commits
mailing list