From 49ced5a27643232e59b4e2374e7a11d6d1747bf6 Mon Sep 17 00:00:00 2001 From: Terran McCanna Date: Wed, 19 May 2021 19:36:25 -0400 Subject: [PATCH] LP1731042 z3950 Bib and TCN issues This builds on the previous work to add the TCN to the interface when it differs from the Bib ID. Signed-off-by: Terran McCanna --- Open-ILS/src/templates/staff/cat/z3950/t_list.tt2 | 5 ++++- Open-ILS/web/js/ui/default/staff/cat/z3950/app.js | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/templates/staff/cat/z3950/t_list.tt2 b/Open-ILS/src/templates/staff/cat/z3950/t_list.tt2 index 14f02a9799..8b07459c1b 100644 --- a/Open-ILS/src/templates/staff/cat/z3950/t_list.tt2 +++ b/Open-ILS/src/templates/staff/cat/z3950/t_list.tt2 @@ -74,6 +74,9 @@
[% l('Record [_1] marked for overlay.', '{{local_overlay_target}}') %] + + ([% l('TCN [_1]', '{{local_overlay_target_tcn}}') %]) +
[% l('No record marked for overlay.') %] @@ -129,6 +132,6 @@ - + diff --git a/Open-ILS/web/js/ui/default/staff/cat/z3950/app.js b/Open-ILS/web/js/ui/default/staff/cat/z3950/app.js index a4b670399b..04261706f2 100644 --- a/Open-ILS/web/js/ui/default/staff/cat/z3950/app.js +++ b/Open-ILS/web/js/ui/default/staff/cat/z3950/app.js @@ -197,15 +197,33 @@ function($scope , $q , $location , $timeout , $window, egCore , egGridDataProvi }; $scope.local_overlay_target = egCore.hatch.getLocalItem('eg.cat.marked_overlay_record') || 0; + if($scope.local_overlay_target){ + var currTarget = $scope.local_overlay_target; + get_tcn(currTarget); + } $scope.mark_as_overlay_target = function() { var items = $scope.gridControls.selectedItems(); if ($scope.local_overlay_target == items[0]['bibid']) { $scope.local_overlay_target = 0; + $scope.local_overlay_target_tcn = 0; } else { $scope.local_overlay_target = items[0]['bibid']; + var currTarget = items[0]['bibid']; + get_tcn(currTarget); } egCore.hatch.setLocalItem('eg.cat.marked_overlay_record',$scope.local_overlay_target); } + + function get_tcn(currTarget) { + egCore.pcrud.retrieve('bre', currTarget, { + flesh : 1, + flesh_fields : {bre : ["tcn_value"]} + }).then(function(rec) { + $scope.local_overlay_target_tcn = rec.tcn_value(); + }); + return; + }; + $scope.cant_overlay = function() { if (!$scope.local_overlay_target) return true; var items = $scope.gridControls.selectedItems(); -- 2.11.0