LP#1251394 Webstaff items out display entry proof of concept
authorBill Erickson <berickxx@gmail.com>
Fri, 12 May 2017 16:14:25 +0000 (12:14 -0400)
committerBill Erickson <berickxx@gmail.com>
Wed, 17 May 2017 18:51:35 +0000 (14:51 -0400)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/templates/staff/circ/patron/t_items_out.tt2
Open-ILS/web/js/ui/default/staff/circ/patron/items_out.js

index a5a1ed7..3b62915 100644 (file)
@@ -86,7 +86,7 @@
   <eg-grid-field label="[% l('Fines Stopped') %]" path='stop_fines'></eg-grid-field>
   <eg-grid-field label="[% l('Title') %]" name="title">
     <a target="_self" href="[% ctx.base_path %]/staff/cat/catalog/record/{{item.target_copy().call_number().record().id()}}">
-      {{item.target_copy().call_number().record().simple_record().title()}}
+      {{item.target_copy().call_number().record().wide_display_entry().title()}}
     </a>
   </eg-grid-field>
   <eg-grid-field path="*" hidden></eg-grid-field>
@@ -96,7 +96,7 @@
   <eg-grid-field path="target_copy.*" hidden></eg-grid-field>
   <eg-grid-field path="target_copy.call_number.*" hidden></eg-grid-field>
   <eg-grid-field path="target_copy.call_number.record.*" hidden></eg-grid-field>
-  <eg-grid-field path="target_copy.call_number.record.simple_record.*" hidden></eg-grid-field>
+  <eg-grid-field path="target_copy.call_number.record.wide_display_entry.*" hidden></eg-grid-field>
 </eg-grid>
 </div>
 
index eaeb4b4..ebba762 100644 (file)
@@ -100,7 +100,7 @@ function($scope,  $q,  $routeParams,  $timeout,  egCore , egUser,  patronSvc , $
                     circ : ['target_copy', 'workstation', 'checkin_workstation'],
                     acp : ['call_number', 'holds_count', 'status'],
                     acn : ['record'],
-                    bre : ['simple_record']
+                    bre : ['wide_display_entry']
                 },
                 // avoid fetching the MARC blob by specifying which 
                 // fields on the bre to select.  More may be needed.
@@ -114,9 +114,17 @@ function($scope,  $q,  $routeParams,  $timeout,  egCore , egUser,  patronSvc , $
         }).then(null, null, function(circ) {
             circ.circ_lib(egCore.org.get(circ.circ_lib())); // local fleshing
 
+            // TODO: move to shared service
+            // Un-JSON-ify display field data
+            var wde = circ.target_copy().call_number().record().wide_display_entry();
+            angular.forEach(egCore.idl.classes.mwde.fields, function(f) {
+                if (f.virtual) return;
+                wde[f.name](JSON.parse(wde[f.name]()));
+            });
+
             if (circ.target_copy().call_number().id() == -1) {
                 // dummy-up a record for precat items
-                circ.target_copy().call_number().record().simple_record({
+                circ.target_copy().call_number().record().wide_display_entry({
                     title : function() {return circ.target_copy().dummy_title()},
                     author : function() {return circ.target_copy().dummy_author()},
                     isbn : function() {return circ.target_copy().dummy_isbn()}
@@ -321,8 +329,8 @@ function($scope,  $q,  $routeParams,  $timeout,  egCore , egUser,  patronSvc , $
                 circ : egCore.idl.toHash(circ),
                 copy : egCore.idl.toHash(circ.target_copy()),
                 call_number : egCore.idl.toHash(circ.target_copy().call_number()),
-                title : circ.target_copy().call_number().record().simple_record().title(),
-                author : circ.target_copy().call_number().record().simple_record().author(),
+                title : circ.target_copy().call_number().record().wide_display_entry().title(),
+                author : circ.target_copy().call_number().record().wide_display_entry().author(),
             })
         });