From da1bc239fdefd358173e82b2c13d76a5aa6fd701 Mon Sep 17 00:00:00 2001
From: Bill Erickson <berickxx@gmail.com>
Date: Thu, 26 Oct 2017 15:55:46 -0400
Subject: [PATCH] LP#1727487 Webstaff record summary uses display fields

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Signed-off-by: Dan Wells <dbw2@calvin.edu>
---
 .../src/templates/staff/cat/share/t_record_summary.tt2    | 14 +++++++-------
 Open-ILS/web/js/ui/default/staff/cat/services/record.js   | 15 +++++----------
 2 files changed, 12 insertions(+), 17 deletions(-)

diff --git a/Open-ILS/src/templates/staff/cat/share/t_record_summary.tt2 b/Open-ILS/src/templates/staff/cat/share/t_record_summary.tt2
index e11eead0eb..c98b087034 100644
--- a/Open-ILS/src/templates/staff/cat/share/t_record_summary.tt2
+++ b/Open-ILS/src/templates/staff/cat/share/t_record_summary.tt2
@@ -43,16 +43,16 @@
     <div class="flex-cell flex-2">
       <a target="_self" 
         href="[% ctx.base_path %]/staff/cat/catalog/record/{{record.id()}}">
-        {{mvr.title()}}
+        {{rec_display.title}}
       </a>
     </div>
 
     <div class="flex-cell strong-text">[% l('Author:') %]</div>
-    <div class="flex-cell flex-2">{{mvr.author()}}</div>
+    <div class="flex-cell flex-2">{{rec_display.author}}</div>
 
     <div class="flex-cell strong-text">[% l('Pub Date:') %]</div>
     <div class="flex-cell">
-      {{mvr.pubdate()}}
+      {{rec_display.pubdate}}
     </div>
 
     <div class="flex-cell strong-text">[% l('Database ID:') %]</div>
@@ -66,12 +66,12 @@
     <div class="flex-cell flex-2">
       <a target="_self" 
         href="[% ctx.base_path %]/staff/cat/catalog/record/{{record.id()}}">
-        {{mvr.title()}}
+        {{rec_display.title}}
       </a>
     </div>
 
     <div class="flex-cell strong-text">[% l('Edition:') %]</div>
-    <div class="flex-cell">{{mvr.edition()}}</div>
+    <div class="flex-cell">{{rec_display.edition}}</div>
 
     <div class="flex-cell strong-text">[% l('TCN:') %]</div>
     <div class="flex-cell">{{record.tcn_value()}}</div>
@@ -82,11 +82,11 @@
 
   <div class="flex-row">
     <div class="flex-cell strong-text">[% l('Author:') %]</div>
-    <div class="flex-cell flex-2">{{mvr.author()}}</div>
+    <div class="flex-cell flex-2">{{rec_display.author}}</div>
 
     <div class="flex-cell strong-text">[% l('Pub Date:') %]</div>
     <div class="flex-cell">
-      {{mvr.pubdate()}}
+      {{rec_display.pubdate}}
     </div>
 
     <div class="flex-cell strong-text">[% l('Database ID:') %]</div>
diff --git a/Open-ILS/web/js/ui/default/staff/cat/services/record.js b/Open-ILS/web/js/ui/default/staff/cat/services/record.js
index ba66c0047e..22df857d6b 100644
--- a/Open-ILS/web/js/ui/default/staff/cat/services/record.js
+++ b/Open-ILS/web/js/ui/default/staff/cat/services/record.js
@@ -143,25 +143,20 @@ angular.module('egCoreMod')
         },
         templateUrl : './cat/share/t_record_summary',
         controller : 
-                   ['$scope','egCore','$sce',
-            function($scope , egCore , $sce) {
+                   ['$scope','egCore','$sce','egBibDisplay',
+            function($scope , egCore , $sce , egBibDisplay) {
 
                 function loadRecord() {
                     egCore.pcrud.retrieve('bre', $scope.recordId, {
                         flesh : 1,
                         flesh_fields : {
-                            bre : ['creator','editor']
+                            bre : ['creator','editor','flat_display_entries']
                         }
                     }).then(function(rec) {
                         rec.owner(egCore.org.get(rec.owner()));
                         $scope.record = rec;
-                    });
-                    egCore.net.request(
-                        'open-ils.search',
-                        'open-ils.search.biblio.record.mods_slim.retrieve.authoritative',
-                        $scope.recordId
-                    ).then(function(mvr) {
-                        $scope.mvr = mvr;
+                        $scope.rec_display = 
+                            egBibDisplay.mfdeToHash(rec.flat_display_entries());
                     });
                     $scope.bib_cn = null;
                     $scope.bib_cn_tooltip = '';
-- 
2.11.0