LP1731042 z3950 Bib and TCN issues user/mccanna/lp1786971-z3950-bibid-tcn
authorTerran McCanna <tmccanna@georgialibraries.org>
Wed, 19 May 2021 23:36:25 +0000 (19:36 -0400)
committerTerran McCanna <tmccanna@georgialibraries.org>
Wed, 19 May 2021 23:36:25 +0000 (19:36 -0400)
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 <tmccanna@georgialibraries.org>
Open-ILS/src/templates/staff/cat/z3950/t_list.tt2
Open-ILS/web/js/ui/default/staff/cat/z3950/app.js

index 14f02a9..8b07459 100644 (file)
@@ -74,6 +74,9 @@
     </div>
     <div class="col-md-6 text-right" ng-if="local_overlay_target">
         [% l('Record [_1] marked for overlay.', '{{local_overlay_target}}') %]
+        <span ng-if="local_overlay_target != local_overlay_target_tcn">
+            ([% l('TCN [_1]', '{{local_overlay_target_tcn}}') %])
+        </span>
     </div>
     <div class="col-md-6 text-right" ng-if="!local_overlay_target">
         [% l('No record marked for overlay.') %]
     <eg-grid-field label="[% l('Publication Date') %]" path="pubdate" visible></eg-grid-field>
     <eg-grid-field label="[% l('Publisher') %]" path="publisher" visible></eg-grid-field>
     <eg-grid-field label="[% l('Service') %]" path="service" visible></eg-grid-field>
-    <eg-grid-field label="[% l('TCN') %]" path="tcn" visible></eg-grid-field>
+    <eg-grid-field label="[% l('Record') %]" path="tcn" visible></eg-grid-field>
     <eg-grid-field path="*" hidden></eg-grid-field>
 </eg-grid>
index a4b6703..0426170 100644 (file)
@@ -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();