'FM_CIRC_COUNT_RETRIEVE_VIA_USER' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.checked_out.count', 'cacheable' : true, 'ttl' : 60000 },
'FM_CIRC_COUNT_RETRIEVE_VIA_USER.authoritative' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.checked_out.count.authoritative', 'cacheable' : true, 'ttl' : 60000 },
'FM_CIRC_COUNT_RETRIEVE_VIA_COPY' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.circulation.count' },
+ 'FM_CIRC_IMPROVED_COUNT_VIA_COPY' : { 'app' : 'open-ils.pcrud', 'method' : 'open-ils.pcrud.search.circbyyr.atomic' },
'FM_CIRC_EDIT_DUE_DATE' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.circulation.due_date.update' },
'FM_CIRC_BACKDATE' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.post_checkin_backdate' },
'FM_CIT_RETRIEVE' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.ident_types.retrieve', 'secure' : false },
}
}
+function set_tooltip(name,value) {
+ var nodes = document.getElementsByAttribute('name',name);
+ for (var i = 0; i < nodes.length; i++) {
+ nodes[i].setAttribute('tooltiptext',value);
+ }
+}
+
function load_item() {
try {
if (! xulG.barcode) return;
set("stat_cat_entry_copy_maps", '');
set("circulations", '');
set("total_circ_count", '');
+ set_tooltip("total_circ_count", '');
set("holds", '');
if (details.copy) {
set("notes", details.copy.notes());
set("stat_cat_entry_copy_maps", details.copy.stat_cat_entry_copy_maps());
set("circulations", details.copy.circulations());
- set("total_circ_count", details.copy.total_circ_count());
set("holds", details.copy.holds());
+
+ network.simple_request('FM_CIRC_IMPROVED_COUNT_VIA_COPY', [ses(), { 'copy' : details.copy.id() } ], function(req) {
+ var r = req.getResultObject();
+ var total = 0; var tooltip = ''; var year = {};
+ for (var i = 0; i < r.length; i++) {
+ total += Number( r[i].count() );
+ if (typeof year[ r[i].year() ] == 'undefined') year[ r[i].year() ] = 0;
+ year[ r[i].year() ] += r[i].count(); // Add original circs and renewals together
+ }
+ set( 'total_circ_count', total );
+ var keys = []; for (var i in year) { keys.push( i ); }; keys.sort();
+ for (var i = 0; i < keys.length; i++) {
+ tooltip += document.getElementById('circStrings').getFormattedString(
+ 'staff.circ.copy_details.circ_count_by_year', [
+ keys[i] == -1 ? document.getElementById('circStrings').getString('staff.circ.copy_details.circ_count_by_year.legacy_label') : keys[i],
+ year[keys[i]]
+ ]
+ ) + '\n';
+ }
+ set_tooltip( 'total_circ_count', tooltip );
+ } );
}
set("copies", '');
<script type="text/javascript" src="/xul/server/main/JSAN.js"/>
<script type="text/javascript" src="alternate_copy_summary.js"/>
+ <messagecatalog id="circStrings" src="/xul/server/locale/<!--#echo var='locale'-->/circ.properties"/>
+
<groupbox flex="1">
<caption label="Alternate View" />
<label value="Holdable" />
<textbox name="holdable" readonly="true" context="clipboard"/>
<label value="Total Circs" />
- <textbox name="total_circs" readonly="true" context="clipboard"/>
+ <textbox name="total_circ_count" readonly="true" context="clipboard"/>
<label value="Checkin Scan Time" />
<textbox name="checkin_scan_time" readonly="true" context="clipboard"/>
</row>
staff.circ.copy_details.user_details=%1$s, %2$s : %3$s
staff.circ.copy_details.bad_hold_status=This item is not captured for a hold, however its status is incorrectly set to "On Holds Shelf". Please check this item in to correct the status.
staff.circ.copy_details.no_hold=This item is not captured for a hold.
+staff.circ.copy_details.circ_count_by_year=%1$s : %2$s
+staff.circ.copy_details.circ_count_by_year.legacy_label=Legacy/Not Dated
staff.circ.copy_status.tab_name=Item Status
staff.circ.copy_status.action.complete=Action complete.
staff.circ.copy_status.sel_checkin.error=Checkin did not likely happen.