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...
}
[% IF ctx.is_staff %]
<p class="staff-hold">
<input type="radio" id="hold_usr_is_requestor_not"
- onchange="staff_hold_nicety(this);"
+ onchange="staff_hold_usr_input_disabler(this);"
name="hold_usr_is_requestor" value="0" />
<label for="hold_usr_is_requestor_not">
[% l("Place hold for patron by barcode:") %]
</label>
<input type="text" name="hold_usr" id="hold_usr_input" /><br />
-
- <input type="radio" id="hold_usr_is_requestor"
- onchange="staff_hold_nicety(this);"
- name="hold_usr_is_requestor" value="1" />
- <label for="hold_usr_is_requestor">
- [% l("Place this hold for me ([_1] [_2])",
- ctx.user.first_given_name, ctx.user.family_name) %]
- </label>
+ <span>
+ <input type="radio" id="hold_usr_is_requestor"
+ onchange="staff_hold_usr_input_disabler(this);"
+ name="hold_usr_is_requestor" value="1" />
+ <label for="hold_usr_is_requestor">
+ [% l("Place this hold for me ([_1] [_2])",
+ ctx.user.first_given_name, ctx.user.family_name) %]
+ </label>
+ </span>
</p>
[% END %]
<p>