quick patron barcode entry
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 25 Jul 2005 12:04:15 +0000 (12:04 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 25 Jul 2005 12:04:15 +0000 (12:04 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@1408 dcc99617-32d9-48b4-a31d-7c20da2025e4

Evergreen/staff_client/chrome/content/evergreen/main/app_shell_overlay.xul
Evergreen/staff_client/chrome/content/evergreen/patron/patron_barcode_entry.xul [new file with mode: 0644]
Evergreen/staff_client/chrome/content/evergreen/util/spawn_win.js
Evergreen/staff_client/chrome/locale/en-US/evergreen/OpenILS.properties

index ec474ff..5199cb6 100644 (file)
                mw.spawn_opac_navigator(document,'replace_tab','main_tabbox',{}); "/>   
 
        <command id="cmd_circ_checkout" oncommand="
-               mw.spawn_check_out(document,'replace_tab','main_tabbox',{}); "/>        
+               mw.spawn_patron_barcode_entry(document,'replace_tab','main_tabbox',{}); "/>     
 
        <command id="cmd_circ_search" oncommand="
                mw.spawn_patron_search(document,'replace_tab','main_tabbox',{}); "/>    
 
        <command id="cmd_circ_display" oncommand="
-               mw.spawn_circ_display(document,'replace_tab','main_tabbox',{}); "/>
+               mw.spawn_patron_barcode_entry(document,'replace_tab','main_tabbox',{}); "/>
 
        <command id="cmd_circ_checkin" oncommand="
                mw.spawn_checkin(document,'replace_tab','main_tabbox',{}); "/>  
 
        <key id="circ-patron-status-key" keycode="VK_F11" command="cmd_circ_display"/>
        <key id="circ-copy-status-key" keycode="VK_F9" command=""/>
-       <key id="circ-check-out-key" keycode="VK_F1" command="cmd_circ_checkout"/>
        <key id="circ-check-in-key" keycode="VK_F2" command="cmd_circ_checkin"/>
        <key id="circ-renew-key" keycode="VK_F3" command=""/>
        <key id="circ-mark-used-key" keycode="VK_F4" command=""/>
        <key id="circ-place-hold-key" keycode="VK_F5" command=""/>
        <key id="circ-patron-registration-key" keycode="VK_F12" command=""/>
        -->
-       <key id="file-key" keycode="VK_F1" oncommand="get_widget('main.menu.file').focus();" />
+       <key id="circ-check-out-key" keycode="VK_F1" command="cmd_circ_checkout"/>
 </keyset>
 
 </overlay>
diff --git a/Evergreen/staff_client/chrome/content/evergreen/patron/patron_barcode_entry.xul b/Evergreen/staff_client/chrome/content/evergreen/patron/patron_barcode_entry.xul
new file mode 100644 (file)
index 0000000..4abdc08
--- /dev/null
@@ -0,0 +1,67 @@
+<?xml version="1.0"?>
+<!-- Application: Evergreen Staff Client -->
+<!-- Screen: About -->
+
+<!-- Stylesheets -->
+<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
+<?xml-stylesheet href="chrome://evergreen/skin/evergreen.css" type="text/css"?>
+
+<window id="patron_barcode_entry_win" 
+       onload="try { my_init(); } catch(E) { alert(E); }"
+       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+
+       <script>mw.sdump('D_TRACE','Loading patron_barcode_entry.xul\n');</script>
+
+       <script>
+       <![CDATA[
+
+               function my_init() {
+                       var tb = document.getElementById('barcode_tb');
+                       tb.addEventListener(
+                               'keypress',
+                               function(ev) {
+                                       if (ev.keyCode == 13 || ev.keyCode == 77) {
+                                               spawn();
+                                       }
+                               },
+                               false
+                       );
+                       tb.focus();
+               }
+
+               function spawn() {
+                       var tb = document.getElementById('barcode_tb');
+                       var barcode = tb.value;
+                       var patron = mw.retrieve_patron_by_barcode( barcode );
+                       if (mw.instanceOf(patron,mw.au)) {
+                               mw.spawn_patron_display(
+                                       parent.document, 
+                                       'replace_tab', 'main_tabbox', { 'patron' : patron }
+                               );
+                       } else {
+                               mw.snd_bad();
+                               var label = document.getElementById('status');
+                               label.value = 'Patron not found.';
+                               tb.select(); tb.focus();
+                       }
+               }
+
+       ]]>
+       </script>
+
+       <vbox flex="1" class="my_overflow">
+               <groupbox orient="vertical" flex="1">
+                       <caption label="Enter Patron Barcode" />
+                       <hbox>
+                               <label value="Patron Barcode" accesskey="B" control="barcode_tb"/>
+                               <textbox id="barcode_tb" />
+                               <button label="Submit" accesskey="S" oncommand="spawn();"/>
+                       </hbox>
+                       <hbox>
+                               <label id="status"/>
+                       </hbox>
+               </groupbox>
+       </vbox>
+
+</window>
+
index 7db30e9..27f98a6 100644 (file)
@@ -109,6 +109,11 @@ function spawn_opac_navigator(d,placement,place,passthru_params,clone) {
        return spawn_interface(d,placement,place,chrome,getString('opac_navigator_interface_label'),passthru_params,clone);
 }
 
+function spawn_patron_barcode_entry(d,placement,place,passthru_params,clone) {
+       var chrome = 'chrome://evergreen/content/patron/patron_barcode_entry.xul';
+       return spawn_interface(d,placement,place,chrome,getString('patron_barcode_entry_interface_label'),passthru_params,clone);
+}
+
 function spawn_patron_display(d,placement,place,passthru_params,clone) {
        var chrome = 'chrome://evergreen/content/patron/patron_display.xul';
        return spawn_interface(d,placement,place,chrome,getString('patron_display_interface_label'),passthru_params,clone);
index 97823ce..5bd3bc3 100644 (file)
@@ -8,6 +8,7 @@ display_patron_interface_label=DISPLAY PATRON
 items_out_interface_label=ITEMS OUT
 marc_editor_interface_label=MARC
 opac_navigator_interface_label=CATALOG NAVIGATOR
+patron_barcode_entry_interface_label=PATRON
 patron_display_interface_label=PATRON
 patron_editor_interface_label=PATRON EDIT
 patron_search_interface_label=PATRON SEARCH