misc tweaks
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sat, 16 Jul 2005 01:44:55 +0000 (01:44 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sat, 16 Jul 2005 01:44:55 +0000 (01:44 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@1229 dcc99617-32d9-48b4-a31d-7c20da2025e4

Evergreen/staff_client/chrome/content/evergreen/patron/patron_display.js
Evergreen/staff_client/chrome/content/evergreen/patron/patron_display.xul
Evergreen/staff_client/chrome/content/evergreen/patron/patron_display_overlay.xul
Evergreen/staff_client/chrome/content/evergreen/patron/patron_search.js
Evergreen/staff_client/chrome/content/evergreen/patron/patron_search.xul
Evergreen/staff_client/chrome/content/evergreen/patron/patron_search_form_overlay.xul
Evergreen/staff_client/chrome/content/evergreen/patron/patron_search_overlay.xul
Evergreen/staff_client/chrome/content/evergreen/util/error.js
Evergreen/staff_client/chrome/locale/en-US/evergreen/patron_display.dtd
Evergreen/staff_client/chrome/skin/evergreen/evergreen.css

index 4a42364..390d7e4 100755 (executable)
@@ -5,7 +5,7 @@ function patron_display_init(p) {
        sdump('D_CONSTRUCTOR',arg_dump(arguments));
 
 
-       // gives: p.clamshell, p.right_panel, p.left_panel, p.inner_left_clamshell, p.inner_top_panel, p.inner_bottom_panel
+       // gives: p.clamshell, p.right_panel, p.left_panel
        patron_display_clamshell_init(p);
 
        // gives: p.patron_items, p.redraw_patron_items
@@ -21,6 +21,7 @@ function patron_display_init(p) {
        p.display_patron = function (au) {
                if (au) p.set_patron(au);
                p.redraw_patron_items();
+               p.redraw_patron_checkout_items();
                return render_fm(p.w.document, { 'au' : p._patron });
        }
 
@@ -39,6 +40,21 @@ function patron_display_init(p) {
                if (p._patron) p.retrieve_patron_via_id( p._patron.id() );
        }
 
+       set_patron_display_widgets(p);
+
+       if (p.patron) {
+               if (typeof(p.patron) == 'object') {
+                       p._patron = p.patron;
+                       p.display_patron();
+               } else
+                       p.retrieve_patron_via_barcode( p.patron );
+       }
+
+       sdump('D_TRACE_EXIT',arg_dump(arguments));
+       return p;
+}
+
+function set_patron_display_widgets(p) {
        p.commandset_node.getElementsByAttribute('id','cmd_patron_refresh')[0].addEventListener(
                'command',
                function (ev) {
@@ -50,7 +66,6 @@ function patron_display_init(p) {
        function gen_func(i) {
                // because otherwise i would be 5 for each closure
                return function(ev) {
-                       dump('i = ' + i + '\n');
                        p.clamshell.set_second_deck(i);
                };
        }
@@ -63,27 +78,21 @@ function patron_display_init(p) {
                        false
                );
        }
+       p.commandset_node.getElementsByAttribute('id','cmd_patron_checkout')[0].addEventListener(
+               'command',
+               function () {
+                       focus_widget( p.w.document, 'patron_checkout_barcode_entry_textbox' );
+               },
+               false
+       );
 
-       if (p.patron) {
-               if (typeof(p.patron) == 'object') {
-                       p._patron = p.patron;
-                       p.display_patron();
-               } else
-                       p.retrieve_patron_via_barcode( p.patron );
-       }
-
-       sdump('D_TRACE_EXIT',arg_dump(arguments));
-       return p;
 }
 
+
 function patron_display_clamshell_init(p) {
        p.clamshell = clam_shell_init( { 'w' : p.w, 'node' : p.clamshell_node, 'debug' : p.app } );
        p.left_panel = p.clamshell.first_deck;
        p.right_panel = p.clamshell.second_deck;
-
-       p.inner_left_clamshell = clam_shell_init( { 'w' : p.w, 'node' : p.left_panel.firstChild, 'debug' : p.app } );
-       p.inner_top_panel = p.inner_left_clamshell.first_deck;
-       p.inner_bottom_panel = p.inner_left_clamshell.second_deck;
 }
 
 function patron_display_patron_items_init(p) {
@@ -210,6 +219,13 @@ function patron_display_patron_checkout_items_init(p) {
 
        var checkouts = [];
 
+       p.w.document.getElementById('checkout_done').addEventListener(
+               'command',
+               function () {
+                       checkouts = []; p.refresh(); tb.focus();
+               },
+               false
+       );
        p.attempt_checkout = function(barcode) {
                try {
                        //if (! is_barcode_valid(barcode) ) throw('Invalid Barcode');
@@ -247,7 +263,7 @@ function patron_display_patron_checkout_items_init(p) {
        );
 
        p.redraw_patron_checkout_items = function() {
-               p.patron_checkout_items.clear_patron_checkout_items();
+               p.patron_checkout_items.clear_checkout_items();
                for (var i = 0; i < checkouts.length; i++) {
                        p.patron_checkout_items.add_checkout_items( [ i ] );
                }
@@ -289,7 +305,7 @@ function patron_display_patron_checkout_items_init(p) {
                                                        var idx = patron_checkout_items[i].getAttribute('record_id'); 
                                                        var copy = checkouts[ idx ].copy;
                                                        var status = checkin_by_copy_barcode( copy.barcode() );
-                                                       if (!status) { // change this to whatever it takes
+                                                       if (status == null) { // change this to whatever it takes
                                                                keep_these.push( checkouts[ idx ] );    
                                                        }
                                                        checkouts = keep_these;
index 04bbfe3..61f7fd2 100755 (executable)
@@ -13,7 +13,7 @@
                params.patron_items_node = document.getElementById('PatronItems_main');
                params.patron_checkout_items_node = document.getElementById('PatronCheckoutItems_main');
                params.commandset_node = document.getElementById('universal_cmds');
-               mw.focus_widget( document, 'PatronNavBar_refresh' );
+               mw.focus_widget( document, 'patron_checkout_barcode_entry_textbox' );
                mw.OpenILS_init(params);"
        onunload="mw.OpenILS_exit(params);"
        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
@@ -36,7 +36,7 @@
        <keyset id="PatronDisplay_keys" />
 
        <!-- Layout to be filled in by overlays and javascript -->
-       <box id="PatronDisplay_main" />
+       <box id="PatronDisplay_main" class="my_overflow" />
 
        <popupset id="universal_popupset" />
 
index 4d66829..5a1c19e 100755 (executable)
        </groupbox>
 </box>
 
-<deck id="ClamShell_first_deck">
-       <vbox id="inner_left_clamshell" flex="1">
-               <deck id="csfdvbd1" style="overflow: auto;">
-                       <groupbox id="PatronDisplayStatus_groupbox" />
-               </deck>
-               <splitter id="csfdvbs" />
-               <deck id="csfdvbd2" style="overflow: auto;">
-                       <groupbox id="PatronDisplayContact_groupbox" />
-               </deck>
+<deck id="ClamShell_first_deck" flex="0">
+       <vbox id="csfdvb1" flex="1">
+               <groupbox id="PatronDisplayStatus_groupbox" flex="0"/>
+               <groupbox id="PatronDisplayContact_groupbox" flex="1"/>
        </vbox>
 </deck>
 
-<deck id="ClamShell_second_deck">
-       <box id="PatronCheckoutItems_main"/>
+<deck id="ClamShell_second_deck" flex="1">
+       <groupbox id="cssdgb1">
+               <caption id="cssdgb1c" label="&patron_navbar.checkout;"/>
+               <box id="PatronCheckoutItems_main"/>
+       </groupbox>
        <box id="PatronItems_main" />
        <box id="PatronHolds_main"><label value="holds" /></box>
        <box id="PatronBills_main"><label value="bills" /></box>
 <hbox id="PatronCheckoutItems_insert1">
        <label id="patron_checkout_scan_barcode_label" value="&patron_display.checkout.scan_label;" accesskey="&patron_display.checkout.scan_label.accesskey;" control="patron_checkout_scan_textbox"/>
        <textbox id="patron_checkout_barcode_entry_textbox"/>
-       <button id="patron_checkout_submit_barcode_button" value="&patron_display.checkout.submit_label;" accesskey="&patron_display.checkout.submit_label.accesskey;"/>
-</hbox>
-
-<hbox id="PatronCheckoutItems_insert2">
+       <button id="patron_checkout_submit_barcode_button" label="&patron_display.checkout.submit_label;" accesskey="&patron_display.checkout.submit_label.accesskey;"/>
 </hbox>
 
 <hbox id="PatronCheckoutItems_insert3">
+       <button id="checkout_print" label="&patron_display.checkout.print_receipt_label;" accesskey="&patron_display.checkout.print_receipt_label.accesskey;"/>
+       <button id="checkout_reprint" label="&patron_display.checkout.reprint_receipt_label;" accesskey="&patron_display.checkout.reprint_receipt_label.accesskey;"/>
+       <spacer id="pcii3s" flex="1"/>
+       <checkbox id="checkout_auto" label="&patron_display.checkout.auto_print_label;" accesskey="&patron_display.checkout.auto_print_label.accesskey;"/> 
+       <button id="checkout_done" label="&patron_display.checkout.done_label;" accesskey="&patron_display.checkout.done_label.accesskey;"/>
 </hbox>
 
 <!-- Accelerator Keys (Accessor Keys are in DTD's) -->
index 4870593..92c5363 100644 (file)
@@ -19,7 +19,8 @@ function patron_search_init(p) {
                return patron_search( crazy_search_hash );
        };
 
-       p.w.document.getElementById('PatronSearch_retrieve_button').addEventListener(
+       p.retrieve_button = p.w.document.getElementById('PatronSearch_retrieve_button');
+       p.retrieve_button.addEventListener(
                'command',
                function (ev) {
                        spawn_patron_display(
@@ -76,6 +77,7 @@ function patron_search_patron_search_results_init(p) {
                        var patrons = get_list_from_tree_selection( p.search_results.paged_tree.tree );
                        p._patron = retrieve_patron_by_id( patrons[ patrons.length - 1 ].getAttribute('record_id') )
                        render_fm( p.w.document, { 'au' : p._patron } );
+                       p.retrieve_button.disabled = false;
                }
        );
        p.search_results.register_flesh_patron_function(
index 8f5b016..ebd86f9 100644 (file)
@@ -35,7 +35,7 @@
        <keyset id="PatronSearch_keys" />
 
        <!-- Layout to be filled in by overlays and javascript -->
-       <box id="PatronSearch_main" />
+       <box id="PatronSearch_main" class="my_overflow" />
 
        <popupset id="universal_popupset" />
 
index b1efde2..99065fe 100644 (file)
@@ -13,7 +13,7 @@
 </commandset>
 
 <!-- main widget for patron_search_form -->
-<box id="PatronSearchForm_main" flex="1" orient="vertical">
+<box id="PatronSearchForm_main" orient="vertical">
        <box id="PatronSearchForm_insert1"/>
        <groupbox id="psgf_gb">
                <caption id="psgf_gbc" label='&patron_search_form.caption;' />
index 529db13..d361521 100644 (file)
        <box id="ClamShell_main" />
 </box>
 
-<deck id="ClamShell_first_deck">
-       <vbox id="psm_left">
-               <box id="PatronSearchForm_main"/>
-               <box id="PatronDisplayStatus_main"/>
+<deck id="ClamShell_first_deck" flex="0">
+       <vbox id="psm_left" flex="1">
+               <box id="PatronSearchForm_main" flex="0"/>
+               <box id="PatronDisplayStatus_main" flex="0"/>
+               <spacer id="psm_left_s1" flex="1"/>
        </vbox>
 </deck>
 
-<deck id="ClamShell_second_deck">
+<deck id="ClamShell_second_deck" flex="1">
        <box id="PatronSearchResults_main"/>
 </deck>
 
index d2d8955..f592ee7 100644 (file)
@@ -16,10 +16,10 @@ var sdump_levels = {
        'D_TRACE_EXIT' :  false,
        'D_TIMEOUT' :  false,
        'D_FILTER' : false,
-       'D_CONSTRUCTOR' : true,
+       'D_CONSTRUCTOR' : false,
 
        'D_CLAM' : false,
-       'D_PAGED_TREE' : true,
+       'D_PAGED_TREE' : false,
        'D_TAB' : false,
 
        'D_AUTH' : false,
@@ -30,15 +30,15 @@ var sdump_levels = {
        'D_PATRON_SEARCH_FORM' : false,
        'D_PATRON_SEARCH_RESULTS' : false,
 
-       'D_PATRON_DISPLAY' : true,
-       'D_PATRON_DISPLAY_STATUS' : true,
-       'D_PATRON_DISPLAY_CONTACT' : true,
+       'D_PATRON_DISPLAY' : false,
+       'D_PATRON_DISPLAY_STATUS' : false,
+       'D_PATRON_DISPLAY_CONTACT' : false,
 
-       'D_PATRON_ITEMS' : true,
-       'D_PATRON_CHECKOUT_ITEMS' : true,
+       'D_PATRON_ITEMS' : false,
+       'D_PATRON_CHECKOUT_ITEMS' : false,
 
-       'D_CHECKIN' : true,
-       'D_CHECKIN_ITEMS' : true,
+       'D_CHECKIN' : false,
+       'D_CHECKIN_ITEMS' : false,
 
        'D_PATRON_UTILS' : false,
        'D_CIRC_UTILS' : false,
@@ -46,7 +46,7 @@ var sdump_levels = {
        'D_EXPLODE' : false,
        'D_FM_UTILS' : false,
        'D_PRINT' : false,
-       'D_SES' : false,
+       'D_SES' : true,
        'D_SPAWN' : false,
        'D_STRING' : false,
        'D_UTIL' : false,
index 87f6a06..1c2a85d 100755 (executable)
@@ -6,6 +6,14 @@
 <!ENTITY patron_display.checkout.scan_label.accesskey 'E'>
 <!ENTITY patron_display.checkout.submit_label 'Submit'>
 <!ENTITY patron_display.checkout.submit_label.accesskey 'S'>
+<!ENTITY patron_display.checkout.print_receipt_label 'Print Receipt'>
+<!ENTITY patron_display.checkout.print_receipt_label.accesskey ''>
+<!ENTITY patron_display.checkout.reprint_receipt_label 'Re-Print Last Receipt'>
+<!ENTITY patron_display.checkout.reprint_receipt_label.accesskey 'L'>
+<!ENTITY patron_display.checkout.auto_print_label 'Auto-Print'>
+<!ENTITY patron_display.checkout.auto_print_label.accesskey 'A'>
+<!ENTITY patron_display.checkout.done_label 'Done'>
+<!ENTITY patron_display.checkout.done_label.accesskey 'D'>
 
 <!ENTITY patron_navbar.retrieve 'Retrieve Patron'>
 <!ENTITY patron_navbar.retrieve.accesskey 'R'>
index 3e7d790..5adece6 100644 (file)
@@ -2,6 +2,7 @@
 @namespace html url("http://www.w3.org/TR/REC-html40"); 
 
 tabpanel { border: 2px groove black; }
+.my_overflow { overflow: auto; }
 
 .text_left { text-align: left; }
 .text_right { text-align: right; }