LP#1761222: Add four columns available in XUL client
authorRemington Steed <rjs7@calvin.edu>
Wed, 7 Nov 2018 16:02:48 +0000 (11:02 -0500)
committerChris Sharp <csharp@georgialibraries.org>
Fri, 21 Feb 2020 18:35:32 +0000 (13:35 -0500)
The XUL client had these columns but they hadn't been added to the web client
yet. This commit adds them:

  - Classification
  - Due Date
  - OPAC visible?
  - Quality

Signed-off-by: Remington Steed <rjs7@calvin.edu>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Tiffany Little <tlittle@georgialibraries.org>
Signed-off-by: Chris Sharp <csharp@georgialibraries.org>

Open-ILS/src/templates/staff/cat/catalog/t_holdings.tt2
Open-ILS/web/js/ui/default/staff/cat/services/holdings.js

index 128a590..3d827dd 100644 (file)
     <eg-grid-field label="[% l('Fine Level') %]"              path="fine_level" hidden>
       <span>{{item['fine_level'] | string_pick:'[% l('Low') %]':'[% l('Normal') %]':'[% l('High') %]'}}</span>
     </eg-grid-field>
+    <eg-grid-field label="[% l('Classification') %]"          path="call_number.label_class.name" hidden></eg-grid-field>
+    <eg-grid-field label="[% l('Due Date') %]"                path="_circ.due_date" datecontext="_circ_lib" dateonlyinterval="_duration" datatype="timestamp" visible></eg-grid-field>
+    <eg-grid-field label="[% l('OPAC Visible?') %]"           datatype="bool" path="opac_visible" hidden></eg-grid-field>
+    <eg-grid-field label="[% l('Quality') %]"                 path="call_number.record.simple_record.quality" hidden></eg-grid-field>
   
   </eg-grid>
 </div>
index 0354667..78055cf 100644 (file)
@@ -16,7 +16,8 @@ function(egCore , $q) {
         flesh : 3,
         flesh_fields : {
             acp : ['status','location','circ_lib','parts','age_protect','copy_alerts', 'latest_inventory'],
-            acn : ['prefix','suffix','copies'],
+            acn : ['prefix','suffix','copies','label_class','record'],
+            bre : ['simple_record'],
             alci : ['inventory_workstation']
         }
     }
@@ -130,12 +131,26 @@ function(egCore , $q) {
                     }
                 );
 
-                // create virtual field for copy alert count
+                // create virtual fields for copy alert count and most recent circ
                 angular.forEach(svc.copies, function (cp) {
                     if (cp.copy_alerts) {
                         cp.copy_alert_count = cp.copy_alerts.filter(function(aca) { return aca.ack_time == null ;}).length;
                     }
                     else cp.copy_alert_count = 0;
+
+                    var copy_circ = egCore.pcrud.search('combcirc', { target_copy : cp.id },
+                        {
+                            order_by : {combcirc : 'xact_start desc'},
+                            limit :  1
+                        }
+                    ).then(function(copy_circ) {
+                        if (copy_circ) {
+                            cp._circ = egCore.idl.toHash(copy_circ, true);
+                            cp._circ_lib = copy_circ.circ_lib();
+                            cp._duration = copy_circ.duration();
+                        }
+                        return copy_circ;
+                    });
                 });
 
                 // create a label using just the unique part of the owner list