<div class="row">
- <div class="col-md-offset-4 col-xs-9 col-md-8"><label>Items Checked Out</label></div>
+ <div class="col-md-offset-2 col-xs-9 col-md-8">
+ <label>Items Checked Out</label>
+ <span style='padding-left: 10px'><b>Now: </b>
+ <span id='oils-selfck-circ-session-total'></span></span>
+ <span style='padding-left: 10px'><b>All: </b>
+ <span id='oils-selfck-circ-account-total'></span></span>
</div>
+</div>
<div class="row">
<div class="col-md-offset-1 col-md-5 pad-vert-btn">
<a href="javascript:;" onclick="selfCheckMgr.printList('items_out');" class="btn btn-success scko-action-btn">
dojo.byId('scko-renewal-alerts').innerHTML = '';
// Reset items checked out in case it changed
- this.circSummary = undefined;
- this.updateCircSummary();
+ this.updateCircSummary(false, true);
if(!this.outTemplate)
this.outTemplate = this.itemsOutTbody.removeChild(dojo.byId('oils-selfck-circ-out-row'));
}
-SelfCheckManager.prototype.updateCircSummary = function(increment) {
- if(!this.circSummary) {
+SelfCheckManager.prototype.updateCircSummary = function(increment, force) {
+
+ if (!this.circSummary || force) {
+
+ // Avoid clobbering the session counts so for on a force refresh
+ var sessionCount = this.circSummary ? this.circSummary.session : 0;
var summary = fieldmapper.standardRequest(
['open-ils.actor', 'open-ils.actor.user.checked_out.count'],
this.circSummary = {
total : Number(summary.out) + Number(summary.overdue),
overdue : Number(summary.overdue),
- session : 0
+ session : sessionCount
};
}
- if(increment) {
+ if (increment) {
// local checkout occurred. Add to the total and the session.
this.circSummary.total += 1;
this.circSummary.session += 1;
+
+ console.log('incrementing circ totals total='+
+ this.circSummary.total+'; session=' + this.circSummary.session);
}
+
+ dojo.byId('oils-selfck-circ-account-total')
+ .innerHTML = this.circSummary.total;
+
+ dojo.byId('oils-selfck-circ-session-total')
+ .innerHTML = this.circSummary.session;
}