[open-ils-commits] [GIT] Evergreen ILS branch master updated. 86cef2f89265717ffc5e2665fee7a0adf8a30d4b

Evergreen Git git at git.evergreen-ils.org
Wed Nov 8 10:48:34 EST 2017


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  86cef2f89265717ffc5e2665fee7a0adf8a30d4b (commit)
      from  a3e2da6b4b7cd503a2603043f97674a030020cce (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 86cef2f89265717ffc5e2665fee7a0adf8a30d4b
Author: Chris Sharp <csharp at georgialibraries.org>
Date:   Tue Nov 7 15:41:26 2017 -0500

    LP#1724885 - Alert when TCN value already exists on bib import.
    
    To test
    -------
    [1] Ensure that the global flag 'cat.bib.use_id_for_tcn' is off.
    [2] Import a record via Z39.50 in the web staff client.
    [3] Repeat the Z39.50 search and attempt to import the record again.
        Note that the import will fail silently (with error messages
        in the browser console).
    [4] Apply the patch and repeat step 3. This time, an alert modal
        will appear pointing out that the TCN is already in use.
    
    Signed-off-by: Chris Sharp <csharp at georgialibraries.org>
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.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 7be4638..bfecba8 100644
--- a/Open-ILS/src/templates/staff/cat/share/z3950_strings.tt2
+++ b/Open-ILS/src/templates/staff/cat/share/z3950_strings.tt2
@@ -2,6 +2,8 @@
 
 <script>
 angular.module('egCoreMod').run(['egStrings', function(s) {
+    s.TCN_EXISTS                        = "[% l('A record already exists with the requested TCN value') %]";
+    s.TCN_EXISTS_ERR                    = "[% l('An unexpected error occurred') %]";
     s.IMPORTED_RECORD_FROM_Z3950        = "[% l('Imported record') %]";
     s.IMPORTED_RECORD_FROM_Z3950_AS_ID  = "[% l('Record imported as ID [_1]', '{{id}}') %]";
     s.GO_TO_RECORD                      = "[% l('Go to record') %]";
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 45ad9d5..9ba6927 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
@@ -27,9 +27,9 @@ angular.module('egCatZ3950Search',
  */
 .controller('Z3950SearchCtrl',
        ['$scope','$q','$location','$timeout','$window','egCore','egGridDataProvider','egZ3950TargetSvc','$uibModal',
-        'egConfirmDialog',
+        'egConfirmDialog','egAlertDialog',
 function($scope , $q , $location , $timeout , $window,  egCore , egGridDataProvider,  egZ3950TargetSvc,  $uibModal,
-         egConfirmDialog) {
+         egConfirmDialog, egAlertDialog) {
 
     // get list of targets
     egZ3950TargetSvc.loadTargets();
@@ -228,6 +228,17 @@ function($scope , $q , $location , $timeout , $window,  egCore , egGridDataProvi
             function() { deferred.resolve() },
             null, // onerror
             function(result) {
+                var evt = egCore.evt.parse(result);
+                if (evt) {
+                     if (evt.textcode == 'TCN_EXISTS') {
+                       egAlertDialog.open(
+                            egCore.strings.TCN_EXISTS
+                      );
+                     } else {
+                       // we shouldn't get here
+                       egAlertDialog.open(egCore.strings.TCN_EXISTS_ERR);
+                     }
+                } else {
                 egConfirmDialog.open(
                     egCore.strings.IMPORTED_RECORD_FROM_Z3950,
                     egCore.strings.IMPORTED_RECORD_FROM_Z3950_AS_ID,
@@ -239,6 +250,7 @@ function($scope , $q , $location , $timeout , $window,  egCore , egGridDataProvi
                     // for some reason
                     $window.location.href = egCore.env.basePath + 'cat/catalog/record/' + result.id();
                 });
+              }   
             }
         );
 

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

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


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list