LP#1661685 - Adds circ library column to staff webclient grids
authorCesar Velez <cesar.velez@equinoxinitiative.org>
Wed, 14 Jun 2017 21:14:14 +0000 (17:14 -0400)
committerJason Etheridge <jason@equinoxinitiative.org>
Mon, 3 Jul 2017 17:54:31 +0000 (13:54 -0400)
Circulation Library was missing as an option from several grids
Added also function to flesh out circ_lib.shortname to display name.

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/patron/holds.js
Open-ILS/web/js/ui/default/staff/circ/services/circ.js

index e14f117..0ccf9e4 100644 (file)
@@ -79,6 +79,7 @@
     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="acp.circ_lib.shortname" label="[% l('Circulation Library') %]"></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 b83196f..db1d85c 100644 (file)
   <eg-grid-field path="circulation.target_copy.circ_modifier" 
     label="[% l('Circulation Modifier') %]" name="circ_modifier">
   </eg-grid-field>
+
+  <eg-grid-field path="circulation.target_copy.circ_lib.shortname"
+    label="[% l('Circulation Library') %]" name="circ_lib">
+  </eg-grid-field>
+
   <!-- virtual field -->
   <eg-grid-field datatype="money" label="[% ('Payment Pending') %]" 
     name="payment_pending"></eg-grid-field>
index da17142..c9c59bb 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="acp.circ_lib.shortname" label="[% l('Circulation Library') %]"></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 ec975ae..c59c43e 100644 (file)
@@ -55,6 +55,8 @@
 
   <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('Circulation Library') %]" path="hold.current_copy.circ_lib">
+    {{item.hold.current_copy().circ_lib().shortname()}}</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 1e51cde..41e0223 100644 (file)
@@ -58,6 +58,7 @@ function($scope,  $q,  $routeParams,  egCore,  egUser,  patronSvc,
         //var ids = patronSvc.hold_ids.slice(offset, offset + count); 
         return egHolds.fetch_holds(patronSvc.hold_ids).then(null, null,
             function(hold_data) { 
+                egCirc.flesh_copy_circ_library(hold_data.copy);
                 patronSvc.holds.push(hold_data);
                 return hold_data;
             }
index baf79c9..00dc293 100644 (file)
@@ -121,7 +121,6 @@ function($uibModal , $q , egCore , egAlertDialog , egConfirmDialog,
     // options : non-parameter controls.  e.g. "override", "check_barcode"
     service.checkout = function(params, options) {
         if (!options) options = {};
-
         console.debug('egCirc.checkout() : ' 
             + js2JSON(params) + ' : ' + js2JSON(options));
 
@@ -540,6 +539,7 @@ function($uibModal , $q , egCore , egAlertDialog , egConfirmDialog,
 
         promises.push(service.flesh_copy_location(payload.copy));
         if (payload.copy) {
+            promises.push(service.flesh_copy_circ_library(payload.copy));
             promises.push(service.flesh_copy_circ_modifier(payload.copy));
             promises.push(
                 service.flesh_copy_status(payload.copy)
@@ -594,6 +594,12 @@ function($uibModal , $q , egCore , egAlertDialog , egConfirmDialog,
         return $q.all(promises);
     }
 
+    service.flesh_copy_circ_library = function(copy) {
+        if (!copy) return $q.when();
+        
+        return $q.when(copy.circ_lib(egCore.org.get( copy.circ_lib() )));
+    }
+
     // fetches the full list of circ modifiers
     service.flesh_copy_circ_modifier = function(copy) {
         if (!copy) return $q.when();