d.appendChild( t );
}
+ // Append options specific to the Claims Returned dialog when requested.
+ // XXX: shoving this UI-specific code into this utility function
+ // is pretty hacky, but this code will be deprecated soon enough.
+ if (xul_param('claims_returned_ops')){
+ var newDiv = document.createElement("div");
+ var newGroup = document.createElement("radiogroup");
+ var newRadio1 = document.createElement("radio");
+ var newRadio2 = document.createElement("radio");
+ newGroup.appendChild(newRadio1);
+ newRadio1.setAttribute('label', "Use Default Date");
+ newRadio1.setAttribute('id', 'newRadio1');
+ newGroup.appendChild(newRadio2);
+ newRadio2.setAttribute('label', "Enter a claimed return date");
+ newRadio2.setAttribute('id', 'newRadio2');
+ newDiv.appendChild(newGroup);
+ x.appendChild(newDiv);
+ }
+
if (xul_param('allow_unset')) { $('remove_btn').hidden = false; }
/* set widget behavior */
var dp = $('datepicker');
var tp = $('timepicker');
+ var radio1On = document.getElementById("newRadio1").getAttribute("selected");
var check = check_date( dp.value );
if ( ! check.allowed ) { alert( check.reason ); $('apply_btn').disabled = true; return; }
dp_date.setHours( tp_date.getHours() );
dp_date.setMinutes( tp_date.getMinutes() );
+ xulG.radio1 = radio1On;
xulG.timestamp = util.date.formatted_date(dp_date,'%{iso8601}');
xulG.complete = 1;
window.close();
}
};
}
+
'disallow_future_dates' : true,
'disallow_past_dates' : false,
'disallow_today' : false,
- 'time_readonly' : false
+ 'time_readonly' : false,
+ 'claims_returned_ops' : true
}
);
-
if (my_xulG.complete) {
+ var radio1On = my_xulG.radio1;
var barcodes = util.functional.map_list(retrieve_ids,function(o){return o.barcode;});
var do_not_move_these = {};
var force_reload = {};
for (var i = 0; i < barcodes.length; i++) {
var robj = obj.network.simple_request(
'MARK_ITEM_CLAIM_RETURNED',
- [ ses(), { barcode: barcodes[i], backdate: my_xulG.timestamp } ],
+ [ ses(), { barcode: barcodes[i], backdate: my_xulG.timestamp, use_due_date: radio1On} ],
null,
{
'title' : $("patronStrings").getString('staff.patron.items.set_claim_returned_failure'),