Indicators for the Checkin Modifiers (since the checkboxes are now hidden from view...
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 30 Sep 2009 16:18:03 +0000 (16:18 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 30 Sep 2009 16:18:03 +0000 (16:18 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@14224 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/chrome/content/OpenILS/global_util.js
Open-ILS/xul/staff_client/server/circ/checkin.xul
Open-ILS/xul/staff_client/server/circ/checkin_overlay.xul

index c524f63..734f424 100644 (file)
@@ -51,7 +51,7 @@
                     dump('persist_helper: retrieving key = ' + key + ' value = ' + value + ' for ' + nodes[i].nodeName + '\n');
                     if (value) nodes[i].setAttribute( attribute_list[j], value );
                 }
-                if (nodes[i].nodeName == 'checkbox' && attribute_list.indexOf('checked') > -1) {
+                if ( (nodes[i].nodeName == 'checkbox' || nodes[i].nodeName == 'menuitem') && attribute_list.indexOf('checked') > -1) {
                     if (nodes[i].disabled == false && nodes[i].hidden == false) {
                         var no_poke = nodes[i].getAttribute('oils_persist_no_poke');
                         if (no_poke && no_poke == 'true') {
                                 try {
                                     netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
                                     var key = bk + 'checked';
-                                    var value = ev.target.checked;
+                                    var value;
+                                    if (ev.target.nodeName == 'checkbox') {
+                                        value = ev.target.checked;
+                                    } else {
+                                        value = ev.target.getAttribute('checked'); // menuitem with type="checkbox"
+                                    }
                                     ev.target.setAttribute( 'checked', value );
                                     prefs.setCharPref( key, value );
-                                    dump('persist_helper: setting key = ' +  key + ' value = ' + value + ' for checkbox\n');
+                                    dump('persist_helper: setting key = ' +  key + ' value = ' + value + ' for checkbox/menuitem\n');
                                 } catch(E) {
-                                    alert('Error in persist_helper(), checkbox command event listener: ' + E);
+                                    alert('Error in persist_helper(), checkbox/menuitem command event listener: ' + E);
                                 }
                             };
                         }(base_key), 
index 1ad1663..892670d 100644 (file)
@@ -20,7 +20,7 @@
 <?xul-overlay href="/xul/server/circ/checkin_overlay.xul"?>
 
 <window id="checkin_win" 
-       onload="try { my_init(); font_helper(); persist_helper(); } catch(E) { alert(E); }"
+       onload="try { my_init(); font_helper(); persist_helper(); document.getElementById('checkin_modifiers_popup').hidePopup(); } catch(E) { alert(E); }"
        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
        <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
index 8c78a4f..7c02fb3 100644 (file)
        <hbox id="background" style="background-color: green;">
                <spacer flex="1"/>
                <vbox>
-                       <label id="background-text" value="&staff.circ.checkin_overlay.background_text;" style="font-size: x-large; font-weight: bold;"/>
-                       <label id="hold_capture_blurb" hidden="true" value="&staff.circ.checkin_overlay.background_text.hold_capture;" style="font-size: large; font-weight: bold;"/>
+                       <hbox align="center"><label id="background-text" value="&staff.circ.checkin_overlay.background_text;" style="font-size: x-large; font-weight: bold;"/></hbox>
+                       <hbox align="center"><label id="hold_capture_blurb" hidden="true" value="&staff.circ.checkin_overlay.background_text.hold_capture;" style="font-size: large; font-weight: bold;"/></hbox>
+            <vbox align="center">
+                <description id="do_not_alert_on_precat_indicator" hidden="true" style="font-size: large; font-weight: bold;">&staff.circ.checkin_overlay.do_not_alert_on_precat.label;</description>
+                <description id="suppress_holds_and_transits_indicator" hidden="true" style="font-size: large; font-weight: bold;">&staff.circ.checkin_overlay.suppress_holds_and_transits.label;</description>
+                <description id="amnesty_mode_indicator" hidden="true" style="font-size: large; font-weight: bold;">&staff.circ.checkin_overlay.amnesty_mode.label;</description>
+                <description id="checkin_auto_indicator" hidden="true" style="font-size: large; font-weight: bold;">&staff.circ.checkin_overlay.checkin_auto.label;</description>
+            </vbox>
                </vbox>
                <spacer flex="1"/>
        </hbox>
     <button id="checkin_modifiers" oncommand="this.firstChild.showPopup();"
         label="&staff.circ.checkin_overlay.checkin_modifiers_btn.label;"
         accesskey="&staff.circ.checkin_overlay.checkin_modifiers_btn.accesskey;"
-        type="menu" allowevents="true">
+        type="menu" allowevents="false">
         <menupopup id="checkin_modifiers_popup">
-            <menuitem type="checkbox" id="do_not_alert_on_precat" oils_persist="checked"
+            <menuitem type="checkbox" id="do_not_alert_on_precat" oils_persist="checked" 
+                oncommand="document.getElementById('do_not_alert_on_precat_indicator').hidden = this.getAttribute('checked') != 'true'; document.getElementById('checkin_barcode_entry_textbox').focus();"
                 label="&staff.circ.checkin_overlay.do_not_alert_on_precat.label;" accesskey="&staff.circ.checkin_overlay.do_not_alert_on_precat.accesskey;"/>
-            <menuitem type="checkbox" id="suppress_holds_and_transits" oils_persist="checked"
+            <menuitem type="checkbox" id="suppress_holds_and_transits" oils_persist="checked" 
+                oncommand="document.getElementById('suppress_holds_and_transits_indicator').hidden = this.getAttribute('checked') != 'true'; document.getElementById('checkin_barcode_entry_textbox').focus();"
                 label="&staff.circ.checkin_overlay.suppress_holds_and_transits.label;" accesskey="&staff.circ.checkin_overlay.suppress_holds_and_transits.accesskey;"/>
-            <menuitem type="checkbox" id="amnesty_mode" oils_persist="checked"
+            <menuitem type="checkbox" id="amnesty_mode" oils_persist="checked" 
+                oncommand="document.getElementById('amnesty_mode_indicator').hidden = this.getAttribute('checked') != 'true'; document.getElementById('checkin_barcode_entry_textbox').focus();"
                 label="&staff.circ.checkin_overlay.amnesty_mode.label;" accesskey="&staff.circ.checkin_overlay.amnesty_mode.accesskey;"/>
-            <menuitem type="checkbox" id="checkin_auto" oils_persist="checked"
+            <menuitem type="checkbox" id="checkin_auto" oils_persist="checked" 
+                oncommand="document.getElementById('checkin_auto_indicator').hidden = this.getAttribute('checked') != 'true'; document.getElementById('checkin_barcode_entry_textbox').focus();"
                 label="&staff.circ.checkin_overlay.checkin_auto.label;" accesskey="&staff.circ.checkin_overlay.checkin_auto.accesskey;"/>
         </menupopup>
     </button>