webstaff: fetch MVR to help build record summary
authorGalen Charlton <gmc@esilibrary.com>
Wed, 7 Oct 2015 15:22:34 +0000 (15:22 +0000)
committerKathy Lussier <klussier@masslnc.org>
Tue, 2 Feb 2016 19:58:49 +0000 (14:58 -0500)
Although this adds another OpenSRF request, using the
MVR rather than fleshing simple_record() gives us
two benefits:

* getting access to the edition
* fields like title and author are now displayed in
  their proper case, rather than the normalized lowercase
  supplied by simple_record().

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Open-ILS/src/templates/staff/cat/share/t_record_summary.tt2
Open-ILS/web/js/ui/default/staff/cat/services/record.js

index 29f0bb8..045bd93 100644 (file)
     <div class="flex-cell flex-2">
       <a target="_self" 
         href="[% ctx.base_path %]/staff/cat/catalog/record/{{record.id()}}">
     <div class="flex-cell flex-2">
       <a target="_self" 
         href="[% ctx.base_path %]/staff/cat/catalog/record/{{record.id()}}">
-        {{record.simple_record().title()}}
+        {{mvr.title()}}
       </a>
     </div>
 
     <div class="flex-cell strong-text">[% l('Author:') %]</div>
       </a>
     </div>
 
     <div class="flex-cell strong-text">[% l('Author:') %]</div>
-    <div class="flex-cell flex-2">{{record.simple_record().author()}}</div>
+    <div class="flex-cell flex-2">{{mvr.author()}}</div>
 
     <div class="flex-cell strong-text">[% l('Pub Date:') %]</div>
     <div class="flex-cell">
 
     <div class="flex-cell strong-text">[% l('Pub Date:') %]</div>
     <div class="flex-cell">
-      {{record.simple_record().pubdate()}}
+      {{mvr.pubdate()}}
     </div>
 
     <div class="flex-cell strong-text">[% l('Database ID:') %]</div>
     </div>
 
     <div class="flex-cell strong-text">[% l('Database ID:') %]</div>
     <div class="flex-cell flex-2">
       <a target="_self" 
         href="[% ctx.base_path %]/staff/cat/catalog/record/{{record.id()}}">
     <div class="flex-cell flex-2">
       <a target="_self" 
         href="[% ctx.base_path %]/staff/cat/catalog/record/{{record.id()}}">
-        {{record.simple_record().title()}}
+        {{mvr.title()}}
       </a>
     </div>
 
     <div class="flex-cell strong-text">[% l('Edition:') %]</div>
       </a>
     </div>
 
     <div class="flex-cell strong-text">[% l('Edition:') %]</div>
-    <div class="flex-cell"><!-- FIXME: no edition field on simple record --></div>
+    <div class="flex-cell">{{mvr.edition()}}</div>
 
     <div class="flex-cell strong-text">[% l('TCN:') %]</div>
     <div class="flex-cell">{{record.tcn_value()}}</div>
 
     <div class="flex-cell strong-text">[% l('TCN:') %]</div>
     <div class="flex-cell">{{record.tcn_value()}}</div>
 
   <div class="flex-row">
     <div class="flex-cell strong-text">[% l('Author:') %]</div>
 
   <div class="flex-row">
     <div class="flex-cell strong-text">[% l('Author:') %]</div>
-    <div class="flex-cell flex-2">{{record.simple_record().author()}}</div>
+    <div class="flex-cell flex-2">{{mvr.author()}}</div>
 
     <div class="flex-cell strong-text">[% l('Pub Date:') %]</div>
     <div class="flex-cell">
 
     <div class="flex-cell strong-text">[% l('Pub Date:') %]</div>
     <div class="flex-cell">
-      {{record.simple_record().pubdate()}}
+      {{mvr.pubdate()}}
     </div>
 
     <div class="flex-cell strong-text">[% l('Database ID:') %]</div>
     </div>
 
     <div class="flex-cell strong-text">[% l('Database ID:') %]</div>
index 9e1cecd..853a046 100644 (file)
@@ -150,12 +150,19 @@ angular.module('egCoreMod')
                     egCore.pcrud.retrieve('bre', $scope.recordId, {
                         flesh : 1,
                         flesh_fields : {
                     egCore.pcrud.retrieve('bre', $scope.recordId, {
                         flesh : 1,
                         flesh_fields : {
-                            bre : ['simple_record','creator','editor']
+                            bre : ['creator','editor']
                         }
                     }).then(function(rec) {
                         rec.owner(egCore.org.get(rec.owner()));
                         $scope.record = rec;
                     });
                         }
                     }).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.bib_cn = null;
                     $scope.bib_cn_tooltip = '';
                     var label_class = egCore.env.aous['cat.default_classification_scheme'] || 1;
                     $scope.bib_cn = null;
                     $scope.bib_cn_tooltip = '';
                     var label_class = egCore.env.aous['cat.default_classification_scheme'] || 1;