LP1786971 z39.50 using TCN instead of ID
authorJessica Woolford <jwoolford@biblio.org>
Wed, 17 Mar 2021 20:31:30 +0000 (16:31 -0400)
committerJessica Woolford <jwoolford@biblio.org>
Wed, 17 Mar 2021 20:31:30 +0000 (16:31 -0400)
This patch switches the target to overlays to the bib ID instead of the
TCN. This allows overlays to work for sites where TCN and bib ID are not
the same.

Signed-off-by: Jessica Woolford <jwoolford@biblio.org>
Open-ILS/src/templates/staff/cat/z3950/t_list.tt2
Open-ILS/src/templates/staff/cat/z3950/t_overlay.tt2
Open-ILS/web/js/ui/default/staff/cat/z3950/app.js

index 9d7ef21..14f02a9 100644 (file)
@@ -73,7 +73,7 @@
         [% l('Total hits: [_1]', '{{total_hits}}') %]
     </div>
     <div class="col-md-6 text-right" ng-if="local_overlay_target">
-        [% l('Record with TCN [_1] marked for overlay.', '{{local_overlay_target}}') %]
+        [% l('Record [_1] marked for overlay.', '{{local_overlay_target}}') %]
     </div>
     <div class="col-md-6 text-right" ng-if="!local_overlay_target">
         [% l('No record marked for overlay.') %]
index e471e20..89a36f9 100644 (file)
@@ -16,7 +16,7 @@
       </div>
       <div class="row">
           <div class="col-xs-6">
-              <div>[% l('Replace TCN [_1] ...', '{{overlay_target.id}}') %]</div>
+              <div>[% l('Replace [_1] ...', '{{overlay_target.id}}') %]</div>
               <eg-record-breaker marc-xml="overlay_target.orig_marc_xml"></eg-record-breaker>
           </div>
           <div class="col-xs-6">
index e2c363c..88f5a24 100644 (file)
@@ -116,6 +116,7 @@ function($scope , $q , $location , $timeout , $window,  egCore , egGridDataProvi
                 // case, result.count is not supplied.
                 $scope.total_hits += (result.count || 0);
                 for (var i in result.records) {
+                    result.records[i].mvr['bibid'] = result.records[i].bibid;
                     result.records[i].mvr['service'] = result.service;
                     result.records[i].mvr['index'] = resultIndex++;
                     result.records[i].mvr['marcxml'] = result.records[i].marcxml;
@@ -185,7 +186,7 @@ function($scope , $q , $location , $timeout , $window,  egCore , egGridDataProvi
     $scope.showInCatalog = function() {
         var items = $scope.gridControls.selectedItems();
         // relying on cant_showInCatalog to protect us
-        var url = '/eg2/staff/catalog/record/' + items[0].tcn();
+        var url = '/eg2/staff/catalog/record/' + items[0]['bibid'];
         $timeout(function() { $window.open(url, '_blank') });        
     };
     $scope.cant_showInCatalog = function() {
@@ -198,10 +199,10 @@ function($scope , $q , $location , $timeout , $window,  egCore , egGridDataProvi
     $scope.local_overlay_target = egCore.hatch.getLocalItem('eg.cat.marked_overlay_record') || 0;
     $scope.mark_as_overlay_target = function() {
         var items = $scope.gridControls.selectedItems();
-        if ($scope.local_overlay_target == items[0].tcn()) {
+        if ($scope.local_overlay_target == items[0]['bibid']) {
             $scope.local_overlay_target = 0;
         } else {
-            $scope.local_overlay_target = items[0].tcn();
+            $scope.local_overlay_target = items[0]['bibid'];
         }
         egCore.hatch.setLocalItem('eg.cat.marked_overlay_record',$scope.local_overlay_target);
     }
@@ -211,7 +212,7 @@ function($scope , $q , $location , $timeout , $window,  egCore , egGridDataProvi
         if (items.length != 1) return true;
         if (
                 items[0]['service'] == 'native-evergreen-catalog' &&
-                items[0].tcn() == $scope.local_overlay_target
+                items[0]['bibid'] == $scope.local_overlay_target
            ) return true;
         return false;
     }
@@ -342,7 +343,7 @@ function($scope , $q , $location , $timeout , $window,  egCore , egGridDataProvi
             }]
         }).result.then(function (args) {
             if (!args || !args.name) return;
-        });
+
     }
 
     $scope.overlay_record = function() {