From 282e0d477322670e67b65792d15aaa2e9d3b1ad0 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Wed, 7 Oct 2015 14:59:09 +0000 Subject: [PATCH] webstaff: teach record summary how to display the bib call number Signed-off-by: Galen Charlton Signed-off-by: Kathy Lussier --- .../staff/cat/share/t_record_summary.tt2 | 2 +- .../ui/default/staff/cat/services/record.js | 27 +++++++++++++++++-- 2 files changed, 26 insertions(+), 3 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 6f9f030592..29f0bb8862 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 @@ -91,7 +91,7 @@
[% l('Bib Call #:') %]
-
+
{{bib_cn}}
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 c54bc951d2..9e1cecd3e5 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,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] + '
'; + } + } + $scope.bib_cn_tooltip = $sce.trustAsHtml(tooltip); + } + }); } $scope.$watch('recordId', -- 2.43.2