made progress with basic updating
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 25 Jul 2006 02:39:35 +0000 (02:39 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 25 Jul 2006 02:39:35 +0000 (02:39 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@5107 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/server/admin/org_settings.js
Open-ILS/xul/staff_client/server/admin/org_settings.xhtml

index cfb0fec..bd12425 100644 (file)
@@ -6,9 +6,10 @@ var myPerms = [ 'UPDATE_ORG_SETTING' ];
 
 
 var ORG_SETTINGS = {
-       'circ.lost_materials_processing_fee' : null,
-       'cat.default_item_price' : null,
-       'circ.collections_fee' : null
+       'circ.lost_materials_processing_fee'    : null,
+       'cat.default_item_price'                                        : null,
+       'circ.collections_fee'                                          : null,
+       'auth.opac_timeout'                                                     : null,
 };
 
 function osEditorInit() {
@@ -62,9 +63,17 @@ function osBuildOrgs() {
                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() {
@@ -98,4 +107,35 @@ function _formatMoney(m) {
        return m;
 }
 
+function osUpdate( setting, allOrgs ) {
+       var val = ORG_SETTINGS[setting].value;
+       var org = osCurrentOrg();
+
+       if(allOrgs) {
+
+       } else {
+               osUpdateOrg(setting, val, org);
+       }
+
+       osDrawRange();
+}
+
+function osUpdateOrg( setting, value, org ) {
+       var s = {};
+       s[setting] = value;
+       var req = new Request(ORG_SETTING_UPDATE, SESSION, org, s);
+       req.send(true);
+       var resp = req.result();
+
+       alert(js2JSON(resp));
+
+       if( checkILSEvent(resp) ) {
+               alertILSEvent(resp);
+               return false;
+       }
+
+       return true;
+}
+
+
 
index 210b928..6ee9427 100644 (file)
                                </thead>
                                <tbody id='os_tbody'>
                                        <tr>
+                                               <td>OPAC Inactivity Timeout (in seconds)</td>
+                                               <td><input type='text' id='auth.opac_timeout' size='5'/></td>
+                                               <td><button id='auth.opac_timeout.apply'>Apply</button></td>
+                                               <td><button id='auth.opac_timeout.apply_all'>Apply to all Locations</button></td>
+                                       </tr>
+                                       <tr>
                                                <td>Lost Materials Processing Fee</td>
-                                               <td>&#036;<input ismoney='1' type='text' id='circ.lost_materials_processing_fee' value='0.00'/></td>
+                                               <td>&#036;<input ismoney='1' type='text' id='circ.lost_materials_processing_fee' size='5'/></td>
                                                <td><button id='circ.lost_materials_processing_fee.apply'>Apply</button></td>
                                                <td><button id='circ.lost_materials_processing_fee.apply_all'>Apply to all Locations</button></td>
                                        </tr>
                                        <tr>
                                                <td>Default Item Price</td>
-                                               <td>&#036;<input ismoney='1' type='text' id='cat.default_item_price' value='0.00'/></td>
+                                               <td>&#036;<input ismoney='1' type='text' id='cat.default_item_price' size='5'/></td>
                                                <td><button id='cat.default_item_price.apply'>Apply</button></td>
                                                <td><button id='cat.default_item_price.apply_all'>Apply to all Locations</button></td>
                                        </tr>
                                        <tr>
                                                <td>Collections Fee</td>
-                                               <td>&#036;<input ismoney='1' type='text' id='circ.collections_fee' value='0.00'/></td>
+                                               <td>&#036;<input ismoney='1' type='text' id='circ.collections_fee' size='5'/></td>
                                                <td><button id='circ.collections_fee.apply'>Apply</button></td>
                                                <td><button id='circ.collections_fee.apply_all'>Apply to all Locations</button></td>
                                        </tr>
                                </tbody>
                        </table>
+                       <br/>
+                       <div style='font-size: 9pt;'>
+                               <div>
+                                       I. "Apply to all Locations" will force the new setting 
+                                       to be applied to all locations in the location dropdown.
+                               </div>
+                       </div>
                </center>
        </body>
 </html>