From: Lebbeous Fogle-Weekley Date: Mon, 11 Jul 2011 22:17:13 +0000 (-0400) Subject: When coming from staff client patron interface, X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=f975280c33a67008ada6cf71f266ef3be73216ef;p=evergreen%2Fequinox.git 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 --- 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 %]