[open-ils-commits] [GIT] Evergreen ILS branch master updated. 000623bb63fbec902f3863f3233a33aad0f24474

Evergreen Git git at git.evergreen-ils.org
Mon Jul 16 09:01:28 EDT 2018


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  000623bb63fbec902f3863f3233a33aad0f24474 (commit)
      from  372508d0b69a6712541e70ffaba9bc6b213be920 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 000623bb63fbec902f3863f3233a33aad0f24474
Author: Mike Rylander <mrylander at gmail.com>
Date:   Thu Jul 12 11:03:44 2018 -0400

    LP#1710401: Z39.50 should notice overlay target change
    
    Currently, we record the overlay target at UI startup and use that going
    forward until the interface is reloaded.  This commit inspects the local
    storage version of the target for changes and offers the user the chance to
    proceed with the new target or cancel the action.  If the target has been
    unset, the user is given the option of proceeding with the load-time target.
    
    Signed-off-by: Mike Rylander <mrylander at gmail.com>
    Signed-off-by: Chris Sharp <csharp at georgialibraries.org>

diff --git a/Open-ILS/src/templates/staff/cat/share/z3950_strings.tt2 b/Open-ILS/src/templates/staff/cat/share/z3950_strings.tt2
index bfecba8..a043b31 100644
--- a/Open-ILS/src/templates/staff/cat/share/z3950_strings.tt2
+++ b/Open-ILS/src/templates/staff/cat/share/z3950_strings.tt2
@@ -10,5 +10,9 @@ angular.module('egCoreMod').run(['egStrings', function(s) {
     s.GO_BACK                           = "[% l('Go back') %]";
     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_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}}') %]";
 }]);
 </script>
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 5e54ee5..b48c4df 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
@@ -332,6 +332,7 @@ 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 live_overlay_target = egCore.hatch.getLocalItem('eg.cat.marked_overlay_record') || 0;
         var args = {
             'marc_xml' : items[0]['marcxml']
         };
@@ -341,19 +342,15 @@ function($scope , $q , $location , $timeout , $window,  egCore , egGridDataProvi
             size: 'lg',
             controller:
                 ['$scope', '$uibModalInstance', function($scope, $uibModalInstance) {
-                $scope.focusMe = true;
-                $scope.merge_profile = null;
-                $scope.overlay_target = {
-                    id : overlay_target,
-                    merged : false
-                };
 
-                $scope.overlay_target.marc_xml = args.marc_xml;
-                egCore.pcrud.retrieve('bre', $scope.overlay_target.id)
-                .then(function(rec) {
-                    $scope.overlay_target.orig_marc_xml = rec.marc();
-                    $scope.merge_marc(); // in case a sticky value was already set
-                });
+                $scope.immediate_merge = function () {
+                    $scope.overlay_target.marc_xml = args.marc_xml;
+                    egCore.pcrud.retrieve('bre', $scope.overlay_target.id)
+                    .then(function(rec) {
+                        $scope.overlay_target.orig_marc_xml = rec.marc();
+                        $scope.merge_marc(); // in case a sticky value was already set
+                    });
+                }
 
                 $scope.merge_marc = function() {
                     if (!$scope.merge_profile) return;
@@ -370,18 +367,8 @@ function($scope , $q , $location , $timeout , $window,  egCore , egGridDataProvi
                         }
                     });
                 }
-                $scope.$watch('merge_profile', function(newVal, oldVal) {
-                    if (newVal && newVal !== oldVal) {
-                        $scope.merge_marc();
-                    }
-                });
 
-                $scope.args = args;
-                args.overlay_target = $scope.overlay_target;
-                $scope.ok = function(args) { $uibModalInstance.close(args) };
-                $scope.cancel = function () { $uibModalInstance.dismiss() };
-                
-		$scope.editOverlayRecord = function() {
+                $scope.editOverlayRecord = function() {
                     $uibModal.open({
                         templateUrl: './cat/z3950/t_edit_overlay_record',
                         backdrop: 'static',
@@ -400,6 +387,55 @@ function($scope , $q , $location , $timeout , $window,  egCore , egGridDataProvi
                         if (!args || !args.name) return;
                     });
                 };
+
+                $scope.focusMe = true;
+                $scope.merge_profile = null;
+                $scope.overlay_target = {
+                    id : overlay_target,
+                    live_id : live_overlay_target,
+                    merged : false
+                };
+
+                $scope.$watch('merge_profile', function(newVal, oldVal) {
+                    if (newVal && newVal !== oldVal) {
+                        $scope.merge_marc();
+                    }
+                });
+
+                $scope.args = args;
+                args.overlay_target = $scope.overlay_target;
+                $scope.ok = function(args) { $uibModalInstance.close(args) };
+                $scope.cancel = function () { $uibModalInstance.dismiss() };
+                
+                if (overlay_target != live_overlay_target) {
+                    var confirm_title = egCore.strings.OVERLAY_CHANGED_TITLE;
+                    var confirm_msg = egCore.strings.OVERLAY_CHANGED;
+
+                    if (live_overlay_target == 0) { // someone unset the target...
+                        confirm_title = egCore.strings.OVERLAY_REMOVED_TITLE;
+                        confirm_msg = egCore.strings.OVERLAY_REMOVED;
+                    }
+
+                    egConfirmDialog.open(
+                        confirm_title,
+                        confirm_msg,
+                        { id : overlay_target, live_id : live_overlay_target }
+                    ).result.then(
+                        function () { // proceed -- but check live overlay for unset-ness
+                            if (live_overlay_target != 0) {
+                                $scope.overlay_target.id = $scope.overlay_target.live_id;
+                                overlay_target = live_overlay_target;
+                            }
+                            $scope.immediate_merge();
+                        },
+                        function () {
+                            $scope.cancel();
+                        }
+                    );
+                } else {
+                    $scope.immediate_merge();
+                }
+
             }]
         }).result.then(function (args) {
             egCore.net.request(

-----------------------------------------------------------------------

Summary of changes:
 .../templates/staff/cat/share/z3950_strings.tt2    |    4 +
 Open-ILS/web/js/ui/default/staff/cat/z3950/app.js  |   82 ++++++++++++++------
 2 files changed, 63 insertions(+), 23 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list