var backdate = checkinBackdateInput.attr('value') || null;
if (backdate) backdate = dojo.date.stamp.toISOString(backdate);
+ var row = this.checkinTemplate.cloneNode(true);
+ // put new circs at the top of the list
+ var tbody = this.checkinTbody;
+ tbody.insertBefore(row, tbody.getElementsByTagName('tr')[0]);
+
this.checkinCopy({
barcode : barcode,
void_overdues : dojo.byId('oils-selfchk-amnesty-mode').checked,
if (!evts.length) evts = [evts];
dojo.forEach(evts,
function(evt) {
- self.handleCheckinResult(barcode, evt);
+ self.handleCheckinResult(row, barcode, evt);
}
);
}
}
}
-SelfCheckManager.prototype.displayCheckin = function(result, outcomeText) {
+SelfCheckManager.prototype.displayCheckin = function(row, result, outcomeText) {
console.log('display checkin results ' + result);
var copy = result.payload.copy;
var record = result.payload.record;
var circ = result.payload.circ;
- var row = this.checkinTemplate.cloneNode(true);
if(record.isbn()) {
this.byName(row, 'jacket').setAttribute('src',
if (this.patron && this.patron.id() == circ.usr())
this.updateCircSummary(-1);
}
-
-
- // put new circs at the top of the list
- var tbody = this.checkinTbody;
- tbody.insertBefore(row, tbody.getElementsByTagName('tr')[0]);
}
-SelfCheckManager.prototype.handleCheckinResult = function(item, result) {
+SelfCheckManager.prototype.handleCheckinResult = function(row, item, result) {
var displayText = '';
var popup = false;
var sound = ''; // sound file reference
displayText = dojo.string.substitute(
localeStrings.CHECKIN_SUCCESS, [item]);
- this.displayCheckin(result);
+ this.displayCheckin(row, result);
} else if (tc == 'NO_CHANGE') {
displayText = dojo.string.substitute(
localeStrings.CHECKIN_NO_CHANGE, [item]);
- this.displayCheckin(result);
+ this.displayCheckin(row, result);
} else if (tc == 'ROUTE_ITEM') {
outcomeText = tc + ' => ' + sn;
}
- this.displayCheckin(result, outcomeText);
+ this.displayCheckin(row, result, outcomeText);
} else if (tc == 'ASSET_COPY_NOT_FOUND') {
+ // remove the in-progress row
+ row.parentNode.removeChild(row);
+
displayText = dojo.string.substitute(
localeStrings.ITEM_NOT_CATALOGED, [item]);
} else {
+ // remove the in-progress row
+ row.parentNode.removeChild(row);
+
displayText = dojo.string.substitute(
localeStrings.UNKNOWN_ERROR, [tc]);
}