LP#1661685 - Adds missing Circulation Modifier column to several grids
authorCesar Velez <cesar.velez@equinoxinitiative.org>
Fri, 9 Jun 2017 21:36:16 +0000 (17:36 -0400)
committerJason Etheridge <jason@equinoxinitiative.org>
Mon, 3 Jul 2017 17:54:24 +0000 (13:54 -0400)
Some views like the Checkout,CheckIn, Holds, And Bills
 did not display the copy's circ_modifier field.
 Also added egCirc.flesh_copy_circ_modifier()

Signed-off by: Cesar Velez <cesar.velez@equinoxinitiative.org>

Signed-off-by: Jason Etheridge <jason@equinoxinitiative.org>
Open-ILS/src/templates/staff/circ/checkin/t_checkin_table.tt2
Open-ILS/src/templates/staff/circ/patron/t_bills_list.tt2
Open-ILS/src/templates/staff/circ/patron/t_checkout.tt2
Open-ILS/src/templates/staff/circ/patron/t_holds_list.tt2
Open-ILS/web/js/ui/default/staff/circ/services/circ.js

index 920ee2b..e14f117 100644 (file)
@@ -78,6 +78,7 @@
   <eg-grid-field label="[% l('Call Number') %]" 
     path="acn.label" hidden></eg-grid-field>
 
+  <eg-grid-field path="acp.circ_modifier.name" label="[% l('Circulation Modifier') %]"></eg-grid-field>
   <eg-grid-field path="circ.*" parent-idl-class="circ" hidden></eg-grid-field>
   <eg-grid-field path="acp.*" parent-idl-class="acp" hidden></eg-grid-field>
   <eg-grid-field path="acn.*" parent-idl-class="acn" hidden></eg-grid-field>
index 6d176be..b83196f 100644 (file)
@@ -78,6 +78,9 @@
     label="[% l('Copy ID') %]" name="copy_id" required hidden>
   </eg-grid-field>
 
+  <eg-grid-field path="circulation.target_copy.circ_modifier" 
+    label="[% l('Circulation Modifier') %]" name="circ_modifier">
+  </eg-grid-field>
   <!-- virtual field -->
   <eg-grid-field datatype="money" label="[% ('Payment Pending') %]" 
     name="payment_pending"></eg-grid-field>
index 3210a53..da17142 100644 (file)
 
   <eg-grid-field label="[% l('Author') %]"      
     path="author" hidden></eg-grid-field>
-
+  <eg-grid-field path="acp.circ_modifier.name" label="[% l('Circulation Modifier') %]"></eg-grid-field>
   <eg-grid-field path="circ.*" parent-idl-class="circ" hidden></eg-grid-field>
   <eg-grid-field path="acp.*" parent-idl-class="acp" hidden></eg-grid-field>
   <eg-grid-field path="acn.*" parent-idl-class="acn" hidden></eg-grid-field>
index 5fa3b96..ec975ae 100644 (file)
@@ -53,6 +53,8 @@
     </a>
   </eg-grid-field>
 
+  <eg-grid-field label="[% l('Circulation Modifier') %]" path="hold.current_copy.circ_modifier">
+    {{item.hold.current_copy().circ_modifier()}}</eg-grid-field>
   <eg-grid-field label="[% l('Patron Barcode') %]" path="patron_barcode" hidden>{{item.patron_barcode}}</eg-grid-field>
   <eg-grid-field label="[% l('Patron alias') %]" path="patron_alias" hidden>{{item.patron_alias}}</eg-grid-field>
   <eg-grid-field label="[% l('Request Date') %]" path='hold.request_time' datatype="timestamp"></eg-grid-field>
index c217f25..baf79c9 100644 (file)
@@ -540,6 +540,7 @@ function($uibModal , $q , egCore , egAlertDialog , egConfirmDialog,
 
         promises.push(service.flesh_copy_location(payload.copy));
         if (payload.copy) {
+            promises.push(service.flesh_copy_circ_modifier(payload.copy));
             promises.push(
                 service.flesh_copy_status(payload.copy)
 
@@ -593,6 +594,19 @@ function($uibModal , $q , egCore , egAlertDialog , egConfirmDialog,
         return $q.all(promises);
     }
 
+    // fetches the full list of circ modifiers
+    service.flesh_copy_circ_modifier = function(copy) {
+        if (!copy) return $q.when();
+        if (egCore.env.ccm)
+            return $q.when(copy.circ_modifier(egCore.env.ccm.map[copy.circ_modifier()]));
+        return egCore.pcrud.retrieveAll('ccm', {}, {atomic : true}).then(
+            function(list) {
+                egCore.env.absorbList(list, 'ccm');
+                copy.circ_modifier(egCore.env.ccm.map[copy.circ_modifier()]);
+            }
+        );
+    }
+
     // fetches the full list of copy statuses
     service.flesh_copy_status = function(copy) {
         if (!copy) return $q.when();