webstaff: teach record summary how to display the bib call number
authorGalen Charlton <gmc@esilibrary.com>
Wed, 7 Oct 2015 14:59:09 +0000 (14:59 +0000)
committerKathy Lussier <klussier@masslnc.org>
Tue, 2 Feb 2016 19:58:49 +0000 (14:58 -0500)
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 6f9f030..29f0bb8 100644 (file)
@@ -91,7 +91,7 @@
 
   <div class="flex-row">
     <div class="flex-cell strong-text">[% l('Bib Call #:') %]</div>
-    <div class="flex-cell flex-2"><!-- FIXME: no bib call no on simple rec --></div>
+    <div class="flex-cell flex-2"><span tooltip-html-unsafe="{{bib_cn_tooltip}}">{{bib_cn}}<span></div>
 
     <div class="flex-cell strong-text"></div>
     <div class="flex-cell"></div>
index c54bc95..9e1cecd 100644 (file)
@@ -143,8 +143,8 @@ angular.module('egCoreMod')
         },
         templateUrl : './cat/share/t_record_summary',
         controller : 
-                   ['$scope','egCore',
-            function($scope , egCore) {
+                   ['$scope','egCore','$sce',
+            function($scope , egCore , $sce) {
 
                 function loadRecord() {
                     egCore.pcrud.retrieve('bre', $scope.recordId, {
@@ -156,6 +156,29 @@ angular.module('egCoreMod')
                         rec.owner(egCore.org.get(rec.owner()));
                         $scope.record = rec;
                     });
+                    $scope.bib_cn = null;
+                    $scope.bib_cn_tooltip = '';
+                    var label_class = egCore.env.aous['cat.default_classification_scheme'] || 1;
+                    egCore.net.request(
+                        'open-ils.cat',
+                        'open-ils.cat.biblio.record.marc_cn.retrieve',
+                        $scope.recordId,
+                        label_class
+                    ).then(function(cn_array) {
+                        var tooltip = '';
+                        if (cn_array.length > 0) {
+                            for (var field in cn_array[0]) {
+                                $scope.bib_cn = cn_array[0][field];
+                            }
+                            for (var i in cn_array) {
+                                for (var field in cn_array[i]) {
+                                    tooltip += 
+                                        field + ' : ' + cn_array[i][field] + '<br>';
+                                }
+                            }
+                            $scope.bib_cn_tooltip = $sce.trustAsHtml(tooltip);
+                        }
+                    });
                 }
 
                 $scope.$watch('recordId',