[open-ils-commits] r14706 - in trunk/Open-ILS: web/opac/locale/en-US xul/staff_client/server/circ (phasefx)
svn at svn.open-ils.org
svn at svn.open-ils.org
Sun Nov 1 19:41:48 EST 2009
Author: phasefx
Date: 2009-11-01 19:41:47 -0500 (Sun, 01 Nov 2009)
New Revision: 14706
Modified:
trunk/Open-ILS/web/opac/locale/en-US/lang.dtd
trunk/Open-ILS/xul/staff_client/server/circ/renew.js
trunk/Open-ILS/xul/staff_client/server/circ/renew_overlay.xul
Log:
due date entry option for dedicated renewal interface
Modified: trunk/Open-ILS/web/opac/locale/en-US/lang.dtd
===================================================================
--- trunk/Open-ILS/web/opac/locale/en-US/lang.dtd 2009-10-30 18:08:49 UTC (rev 14705)
+++ trunk/Open-ILS/web/opac/locale/en-US/lang.dtd 2009-11-02 00:41:47 UTC (rev 14706)
@@ -1826,6 +1826,8 @@
<!ENTITY staff.circ.renew_overlay.renew_export.label "Export">
<!ENTITY staff.circ.renew_overlay.trim_list.label "Trim List (20 rows)">
<!ENTITY staff.circ.renew_overlay.strict_barcode.label "Strict Barcode">
+<!ENTITY staff.circ.renew_overlay.duedate.label "Specific Due Date">
+<!ENTITY staff.circ.renew_overlay.duedate.accesskey "u">
<!ENTITY staff.circ.checkout_overlay.duedate.label "Specific Due Date">
<!ENTITY staff.circ.checkout_overlay.duedate.accesskey "u">
<!ENTITY staff.circ.checkout_overlay.barcode.accesskey "C">
Modified: trunk/Open-ILS/xul/staff_client/server/circ/renew.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/circ/renew.js 2009-10-30 18:08:49 UTC (rev 14705)
+++ trunk/Open-ILS/xul/staff_client/server/circ/renew.js 2009-11-02 00:41:47 UTC (rev 14706)
@@ -216,7 +216,22 @@
'cmd_csv_to_file' : [ ['command'], function() {
obj.list.dump_csv_to_file( { 'defaultFileName' : 'checked_in.txt' } );
obj.controller.view.renew_barcode_entry_textbox.focus();
- } ]
+ } ],
+ 'renew_duedate_datepicker' : [
+ ['change'],
+ function(ev) {
+ try {
+ if (obj.check_date(ev.target)) {
+ ev.target.parentNode.setAttribute('style','');
+ } else {
+ ev.target.parentNode.setAttribute('style','background-color: red');
+ }
+ } catch(E) {
+ alert('Error in renew.js, renew_duedate_datepicker @change: ' + E);
+ }
+ }
+ ]
+
}
}
);
@@ -249,19 +264,40 @@
}
},
- 'renew' : function() {
+ 'renew' : function(params) {
var obj = this;
try {
+ if (!params) params = {};
+
var barcode = obj.controller.view.renew_barcode_entry_textbox.value;
if (!barcode) return;
if (barcode) {
if ( obj.test_barcode(barcode) ) { /* good */ } else { /* bad */ return; }
}
+ params.barcode = barcode;
+ params.return_patron = true;
+
var auto_print = document.getElementById('renew_auto');
if (auto_print) auto_print = auto_print.checked;
+
+ if (document.getElementById('renew_duedate_checkbox').checked) {
+ if (! obj.check_date(obj.controller.view.renew_duedate_datepicker)) return;
+ var tp = document.getElementById('renew_duedate_timepicker');
+ var dp = obj.controller.view.renew_duedate_datepicker;
+ var tp_date = tp.dateValue;
+ var dp_date = dp.dateValue;
+ tp_date.setFullYear( dp_date.getFullYear() );
+ tp_date.setMonth( dp_date.getMonth() );
+ tp_date.setDate( dp_date.getDate() );
+
+ JSAN.use('util.date');
+ params.due_date = util.date.formatted_date(tp_date,'%{iso8601}');
+ }
+
+
JSAN.use('circ.util');
var renew = circ.util.renew_via_barcode(
- { 'barcode' : barcode, 'return_patron' : true },
+ params,
function( r ) {
obj.renew_followup( r, barcode );
}
@@ -412,6 +448,25 @@
JSAN.use('cat.util'); cat.util.spawn_copy_editor( { 'copy_ids' : list, 'edit' : 1 } );
+ },
+
+ 'check_date' : function(node) {
+ var obj = this;
+ JSAN.use('util.date');
+ try {
+ obj.controller.view.renew_barcode_entry_textbox.setAttribute('disabled','false');
+ obj.controller.view.renew_barcode_entry_textbox.disabled = false;
+ obj.controller.view.cmd_renew_submit_barcode.setAttribute('disabled','false');
+ obj.controller.view.cmd_renew_submit_barcode.disabled = false;
+ if (util.date.check_past('YYYY-MM-DD',node.value) ) {
+ obj.controller.view.renew_barcode_entry_textbox.setAttribute('disabled','true');
+ obj.controller.view.cmd_renew_submit_barcode.setAttribute('disabled','true');
+ return false;
+ }
+ return true;
+ } catch(E) {
+ throw(E);
+ }
}
}
Modified: trunk/Open-ILS/xul/staff_client/server/circ/renew_overlay.xul
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/circ/renew_overlay.xul 2009-10-30 18:08:49 UTC (rev 14705)
+++ trunk/Open-ILS/xul/staff_client/server/circ/renew_overlay.xul 2009-11-02 00:41:47 UTC (rev 14706)
@@ -68,6 +68,11 @@
<label id="no_change_label" value="" style="color: red" hidden="true"/>
</vbox>
<spacer flex="1"/>
+ <hbox id="duedate_hbox">
+ <checkbox id="renew_duedate_checkbox" label="&staff.circ.renew_overlay.duedate.label;" accesskey="&staff.circ.renew_overlay.duedate.accesskey;" oncommand="if (this.checked) { this.nextSibling.focus(); } else { document.getElementById('renew_barcode_entry_textbox').focus(); }"/>
+ <datepicker id="renew_duedate_datepicker" type="popup" />
+ <timepicker id="renew_duedate_timepicker" type="popup" />
+ </hbox>
<vbox>
<hbox>
<menubar>
More information about the open-ils-commits
mailing list