From 936ab552ec7f46ed491fe1761532358d5a0d9512 Mon Sep 17 00:00:00 2001 From: Lebbeous Fogle-Weekley Date: Mon, 11 Jul 2011 18:17:13 -0400 Subject: [PATCH] When coming from staff client patron interface, pre-populate the patron barcode text box by which staff places a hold for a patron. Signed-off-by: Lebbeous Fogle-Weekley --- Open-ILS/web/js/ui/default/opac/staff.js | 19 +++++++++++++++++-- .../web/templates/default/opac/parts/place_hold.tt2 | 19 ++++++++++--------- 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/Open-ILS/web/js/ui/default/opac/staff.js b/Open-ILS/web/js/ui/default/opac/staff.js index 533258cb6a..b5ef7f5285 100644 --- a/Open-ILS/web/js/ui/default/opac/staff.js +++ b/Open-ILS/web/js/ui/default/opac/staff.js @@ -14,13 +14,28 @@ function runEvt(scope, name) { for(var i in evt) {evt[i].apply(evt[i], args);} } } -function staff_hold_nicety(thing) { +function staff_hold_usr_input_disabler(input) { document.getElementById("hold_usr_input").disabled = - Boolean(Number(thing.value)); + Boolean(Number(input.value)); +} +function staff_hold_usr_prepop() { + if (xulG && xulG.patron_barcode) { + document.getElementById("hold_usr_input").value = xulG.patron_barcode; + document.getElementById("hold_usr_input").disabled = false; + document.getElementById("hold_usr_is_requestor_not").checked = true; + + var kill_this = + document.getElementById("hold_usr_is_requestor").parentNode; + kill_this.parentNode.removeChild(kill_this); + } } window.onload = function() { // record details page events var rec = location.href.match(/\/opac\/record\/(\d+)/); if(rec && rec[1]) { runEvt('rdetail', 'recordRetrieved', rec[1]); } + + if (document.getElementById("hold_usr_input")) + staff_hold_usr_prepop(); + // fire other events the staff client is expecting... } diff --git a/Open-ILS/web/templates/default/opac/parts/place_hold.tt2 b/Open-ILS/web/templates/default/opac/parts/place_hold.tt2 index 3e372446e8..9e90c7ac1e 100644 --- a/Open-ILS/web/templates/default/opac/parts/place_hold.tt2 +++ b/Open-ILS/web/templates/default/opac/parts/place_hold.tt2 @@ -39,20 +39,21 @@ [% IF ctx.is_staff %]


- - - + + + +

[% END %]

-- 2.11.0