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
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 });
}
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) {
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);
};
}
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) {
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');
);
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 ] );
}
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;
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">
<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" />
</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) -->
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(
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(
<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" />
</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;' />
<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>
'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,
'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,
'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,
<!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'>
@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; }