</tbody>
</table>
</div>
-
- <div id="step3e" style="display:none;">
+ <div id="step3f" style="display:none;">
<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td align="center" style="font-weight:bold;font-size:20px;">Items Ready for Pick-Up</td></tr></table><br />
- <a href="javascript:;"><img src="[% ctx.media_prefix %]/images/selfcheck/printlist.jpg" alt='print' /></a><br /><br />
+ <a href="javascript:;"onclick="selfCheckMgr.printList('rdyHolds')"><img src="[% ctx.media_prefix %]/images/selfcheck/printlist.jpg" alt='print' /></a><br /><br />
<table cellpadding="5" cellspacing="0" border="0" class="item_table" width="100%">
<tbody id='oils-selfck-rdy-tbody'>
<tr id='oils-selfck-rdy-row'><td>
</td></tr>
</tbody>
</table>
- </div>
-
- <div id="step3f" style="display:none;">
+ <br /br>
<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td align="center" style="font-weight:bold;font-size:20px;">Holds</td></tr></table><br />
<a href="javascript:;" onclick="selfCheckMgr.printList('holds')"><img alt='print' src="[% ctx.media_prefix %]/images/selfcheck/printlist.jpg" /></a><br /><br />
<table cellpadding="5" cellspacing="0" border="0" class="item_table" width="100%">
<h3>Your Account</h3>
<p id="sidebar_step3c" style="display:none;">Fines: <span id="acct_fines"></span><br /><a href="javascript:;" id='oils-selfck-view-fines-link'>View Details</a></p>
<p id="sidebar_step3d">(<span id="oils-selfck-circ-account-total">0) Items</span> Checked Out<br /><a href="javascript:;" id='oils-selfck-items-out-details-link'>View Details</a></p>
- <p id="sidebar_step3e">(<span id="oils-selfck-holds-ready">0) Items</span> Ready for Pick-Up<br /><a href="javascript:;" onclick="selfCheckMgr.drawHoldsPage();">View Details</a></p>
<p id="sidebar_step3f">(<span id="oils-selfck-holds-total">0) Items</span> on Hold<br /><a href="javascript:;" id='oils-selfck-hold-details-link'>View Details</a></p>
<div style="padding-left:40px;padding-top:10px;">
var itemsOutCirc = [];
var itemsOutMod = [];
var itemsOutCopy = [];
+var readyHolds = false;
+var holdsCounter = 0
const SET_BARCODE_REGEX = 'opac.barcode_regex';
const SET_PATRON_TIMEOUT = 'circ.selfcheck.patron_login_timeout';
this.checkouts = [];
this.itemsOut = [];
+ this.holdsArray = [];
// During renewals, keep track of the ID of the previous circulation.
// Previous circ is used for tracking failed renewals (for receipts).
var self = this;
// connect onclick handlers to the various navigation links
var linkHandlers = {
- 'oils-selfck-hold-details-link' : function() { self.drawHoldsPage(true); },
+ 'oils-selfck-hold-details-link' : function() { self.drawHoldsPage(); },
'oils-selfck-view-fines-link' : function() { self.drawFinesPage(); openils.Util.show('oils-selfck-fines-tbody'); openils.Util.hide('pay_fines'); },
'oils-selfck-pay-fines-link' : function() {
switchTo('step3','step3c');
case 'holds':
this.printHoldsReceipt();
break;
+ case 'rdyHolds':
+ readyHolds = true;
+ this.printHoldsReceipt();
+ readyHolds = false;
+ break;
case 'fines':
this.printFinesReceipt();
break;
}
dojo.byId('oils-selfck-holds-total').innerHTML =dojo.string.substitute("${0}) Item"+(this.holdsSummary.total==1?"":"s"),[this.holdsSummary.total]);
- dojo.byId('oils-selfck-holds-ready').innerHTML =dojo.string.substitute("${0}) Item"+(this.holdsSummary.ready==1?"":"s"),[this.holdsSummary.ready]);
}
}
-SelfCheckManager.prototype.drawHoldsPage = function(bool) {
- if(bool) switchTo('step3','step3f'); else switchTo('step3','step3e');
-
+SelfCheckManager.prototype.drawHoldsPage = function() {
+ switchTo('step3','step3f');
this.holdTbody = dojo.byId('oils-selfck-hold-tbody');
- this.readyTbody = dojo.byId('oils-selfck-rdy-tbody');
- if(!this.readyTemplate)
+ this.readyTbody = dojo.byId('oils-selfck-rdy-tbody');
+ if(!this.readyTemplate)
this.readyTemplate = this.readyTbody.removeChild(dojo.byId('oils-selfck-rdy-row'));
if(!this.holdTemplate)
this.holdTemplate = this.holdTbody.removeChild(dojo.byId('oils-selfck-hold-row'));
while(this.holdTbody.childNodes[0])
this.holdTbody.removeChild(this.holdTbody.childNodes[0]);
- while(this.readyTbody.childNodes[0])
+ while(this.readyTbody.childNodes[0])
this.readyTbody.removeChild(this.readyTbody.childNodes[0]);
progressDialog.show(true);
var self = this;
+ self.holdsArray = [];
fieldmapper.standardRequest( // fetch the hold IDs
['open-ils.circ', 'open-ils.circ.holds.id_list.retrieve'],
onresponse : function(rr) {
progressDialog.hide();
- self.drawHolds(openils.Util.readResponse(rr));
+ self.holdsArray.push(openils.Util.readResponse(rr));
+ self.drawHolds(self.holdsArray[holdsCounter]);
+ holdsCounter++;
}
}
);
}
}
);
+ holdsCounter = 0;
}
/**
if(!data) return;
var row = this.holdTemplate.cloneNode(true);
var row2 = this.readyTemplate.cloneNode(true);
-
//if(data.mvr.isbn()) {
// this.byName(row, 'jacket').setAttribute('src', '/opac/extras/ac/jacket/small/' + data.mvr.isbn());
//}
* Print a receipt for this user's items out
*/
SelfCheckManager.prototype.printHoldsReceipt = function(callback) {
- if(!this.holds.length) return;
+ if(!this.holdsArray.length) return;
progressDialog.show(true);
var holdIds = [];
var holdData = [];
+ var rdyForPickup = false;
+
+ if(readyHolds){
+ dojo.forEach(this.holdsArray,
+ function(data) {
+ if(data.status == 4) {
+ holdIds.push(data.hold.id());
+ holdData.push({ready : true});
+ rdyForPickup = true;
+ }
+ }
- dojo.forEach(this.holds,
+ );
+ if (!rdyForPickup){
+ progressDialog.hide();
+ return};
+ } else {
+ dojo.forEach(this.holdsArray,
function(data) {
holdIds.push(data.hold.id());
if(data.status == 4) {
});
}
}
- );
-
+ );
+ };
var params = [
this.authtoken,
this.staff.ws_ou(),
var resp = openils.Util.readResponse(r);
var output = resp.template_output();
if(output) {
- self.printData(output.data(), self.holds.length, callback);
+ self.printData(output.data(), self.holdsArray.length, callback);
} else {
var error = resp.error_output();
if(error) {