LP1786971 z39.50 add TCN to overlay popups as well
authorTerran McCanna <tmccanna@georgialibraries.org>
Thu, 15 Jul 2021 20:27:21 +0000 (16:27 -0400)
committerBill Erickson <berickxx@gmail.com>
Mon, 20 Sep 2021 15:28:27 +0000 (11:28 -0400)
Displays TCN on the Overlay modal and on the confirmation popup
that displays if the live overlay target has changed.

Signed-off-by: Terran McCanna <tmccanna@georgialibraries.org>
Signed-off-by: Mary Llewellyn <mllewell@biblio.org>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/templates/staff/cat/share/z3950_strings.tt2
Open-ILS/src/templates/staff/cat/z3950/t_overlay.tt2
Open-ILS/web/js/ui/default/staff/cat/z3950/app.js

index a043b31..fffa195 100644 (file)
@@ -11,7 +11,7 @@ angular.module('egCoreMod').run(['egStrings', function(s) {
     s.IMPORT_BUTTON_LABEL               = "[% l('Import') %]";
     s.SAVE_BUTTON_LABEL                 = "[% l('Save') %]";
     s.OVERLAY_CHANGED_TITLE             = "[% l('Overlay target changed') %]";
-    s.OVERLAY_CHANGED                   = "[% l('The overlay target has changed from [_1] to [_2].  Continue with overlay of record [_2]?', '{{id}}', '{{live_id}}') %]";
+    s.OVERLAY_CHANGED                   = "[% l('The overlay target has changed from [_1] (TCN [_2]) to [_3] (TCN [_4]).  Continue with overlay of record [_3]?', '{{id}}', '{{tcn}}', '{{live_id}}', '{{live_tcn}}') %]";
     s.OVERLAY_REMOVED_TITLE             = "[% l('Overlay target removed') %]";
     s.OVERLAY_REMOVED                   = "[% l('The overlay target has been removed.  The previous target was record [_1].  Continue with overlay of record [_1]?', '{{id}}') %]";
 }]);
index b892bf1..c67918b 100644 (file)
       </div>
       <div class="row">
           <div class="col-xs-6">
-              <div>[% l('Replace record [_1] ', '{{overlay_target.id}}') %]...</div>
+              <div>
+                [% l('Replace record [_1]', '{{overlay_target.id}}') %]<span ng-if="overlay_target.id != overlay_target_tcn">
+                    ([% l('TCN [_1]', '{{overlay_target_tcn}}') %])
+                </span>...</div>
               <eg-record-breaker marc-xml="overlay_target.orig_marc_xml"></eg-record-breaker>
           </div>
           <div class="col-xs-6">
index 6a4c250..a43401c 100644 (file)
@@ -197,6 +197,7 @@ function($scope , $q , $location , $timeout , $window,  egCore , egGridDataProvi
     };
 
     $scope.local_overlay_target = egCore.hatch.getLocalItem('eg.cat.marked_overlay_record') || 0;
+    $scope.local_overlay_target_tcn = egCore.hatch.getLocalItem('eg.cat.marked_overlay_tcn') || 0;
     if($scope.local_overlay_target) {
         var currTarget = $scope.local_overlay_target;
         get_tcn(currTarget);
@@ -212,6 +213,7 @@ function($scope , $q , $location , $timeout , $window,  egCore , egGridDataProvi
             get_tcn(currTarget);
         }
         egCore.hatch.setLocalItem('eg.cat.marked_overlay_record',$scope.local_overlay_target);
+        egCore.hatch.setLocalItem('eg.cat.marked_overlay_tcn',$scope.local_overlay_target_tcn);
     }
 
     function get_tcn(currTarget) {
@@ -366,7 +368,9 @@ function($scope , $q , $location , $timeout , $window,  egCore , egGridDataProvi
     $scope.overlay_record = function() {
         var items = $scope.gridControls.selectedItems();
         var overlay_target = $scope.local_overlay_target;
+        var overlay_target_tcn = $scope.local_overlay_target_tcn;
         var live_overlay_target = egCore.hatch.getLocalItem('eg.cat.marked_overlay_record') || 0;
+        var live_overlay_target_tcn = egCore.hatch.getLocalItem('eg.cat.marked_overlay_tcn') || 0;
         var args = {
             'marc_xml' : items[0]['marcxml'],
             'bib_source' : null
@@ -385,6 +389,7 @@ function($scope , $q , $location , $timeout , $window,  egCore , egGridDataProvi
                     .then(function(rec) {
                         $scope.overlay_target.orig_marc_xml = rec.marc();
                         $scope.merge_marc(); // in case a sticky value was already set
+                        $scope.overlay_target_tcn = overlay_target_tcn;
                     });
                 }
 
@@ -455,7 +460,8 @@ function($scope , $q , $location , $timeout , $window,  egCore , egGridDataProvi
                     egConfirmDialog.open(
                         confirm_title,
                         confirm_msg,
-                        { id : overlay_target, live_id : live_overlay_target }
+                        { id : overlay_target, live_id : live_overlay_target,
+                            tcn : overlay_target_tcn, live_tcn: live_overlay_target_tcn}
                     ).result.then(
                         function () { // proceed -- but check live overlay for unset-ness
                             if (live_overlay_target != 0) {
@@ -487,7 +493,9 @@ function($scope , $q , $location , $timeout , $window,  egCore , egGridDataProvi
             ).then(
                 function(result) {
                     $scope.local_overlay_target = 0;
+                    $scope.local_overlay_target_tcn = 0;
                     egCore.hatch.removeLocalItem('eg.cat.marked_overlay_record');
+                    egCore.hatch.removeLocalItem('eg.cat.marked_overlay_tcn');
                     console.debug('overlay complete, target removed');
                     $window.open('/eg2/staff/catalog/record/' + overlay_target);
                 }