LP#1615845 In House Uses on Item Status user/khuckins/lp1615845-in-house-use-item-status
authorKyle Huckins <khuckins@catalystdevworks.com>
Mon, 9 Jan 2017 21:15:54 +0000 (13:15 -0800)
committerKyle Huckins <khuckins@catalystdevworks.com>
Thu, 19 Jan 2017 20:14:33 +0000 (12:14 -0800)
Display number of in-house uses in quick summary of item
status interface.

Signed-off-by: Kyle Huckins <khuckins@catalystdevworks.com>
 Changes to be committed:
modified:   Open-ILS/src/templates/staff/cat/item/t_list.tt2
modified:   Open-ILS/src/templates/staff/cat/item/t_summary_pane.tt2
modified:   Open-ILS/web/js/ui/default/staff/cat/item/app.js

Open-ILS/src/templates/staff/cat/item/t_summary_pane.tt2
Open-ILS/web/js/ui/default/staff/cat/item/app.js

index 1ab16a5..5935f87 100644 (file)
     <div class="flex-cell">[% l('Holdable') %]</div>
     <div class="flex-cell well">{{copy.opac_visible()}}</div>
 
-    <div class="flex-cell">[% l('Renewal Workstation') %]</div>
-    <div class="flex-cell well">{{circ_summary.last_renewal_workstation()}}</div>
+    <div class="flex-cell">[% l('In-House Uses') %]</div>
+    <div class="flex-cell well">{{copy._inHouseUseCount}}</div>
 
     <div class="flex-cell">[% l('Checkin Time') %]</div>
     <div class="flex-cell well">
     <div class="flex-cell">[% l('Circulate') %]</div>
     <div class="flex-cell well">{{copy.circulate()}}</div>
 
+    <div class="flex-cell">[% l('Renewal Workstation') %]</div>
+    <div class="flex-cell well">{{circ_summary.last_renewal_workstation()}}</div>
+
     <div class="flex-cell">[% l('Remaining Renewals') %]</div>
     <div class="flex-cell well">{{circ.renewal_remaining()}}</div>
 
index 7a26635..fe1d42d 100644 (file)
@@ -90,6 +90,11 @@ function(egCore) {
             function(copy) {
 
                 var flatCopy;
+
+                copy._inHouseUseCount = 0;
+                egCore.pcrud.search('aihu', {item : copy.id()})
+                    .then(null, null, function() { copy._inHouseUseCount++});
+
                 if (noListDupes) {
                     // use the existing copy if possible
                     flatCopy = service.copies.filter(