From: Mike Rylander Date: Tue, 13 Oct 2015 16:24:29 +0000 (-0400) Subject: webstaff: inform on record save failure, and mark the page clean on successful save X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=954e4df49590eaa4087e2fc883e78227d71e3612;p=evergreen%2Fmasslnc.git webstaff: inform on record save failure, and mark the page clean on successful save Signed-off-by: Mike Rylander Signed-off-by: Galen Charlton Signed-off-by: Kathy Lussier --- diff --git a/Open-ILS/web/js/ui/default/staff/cat/services/marcedit.js b/Open-ILS/web/js/ui/default/staff/cat/services/marcedit.js index 412c02e96e..0086d41add 100644 --- a/Open-ILS/web/js/ui/default/staff/cat/services/marcedit.js +++ b/Open-ILS/web/js/ui/default/staff/cat/services/marcedit.js @@ -1083,6 +1083,7 @@ angular.module('egMarcMod', ['egCoreMod', 'ui.bootstrap']) $scope.controlfields = $scope.record.fields.filter(function(f){ return f.isControlfield() }); $scope.datafields = $scope.record.fields.filter(function(f){ return !f.isControlfield() }); $scope.save_stack_depth = $scope.record_undo_stack.length; + $scope.dirtyFlag = false; $scope.flat_text_marc = $scope.record.toBreaker(); if ($scope.record_type == 'bre') { @@ -1275,7 +1276,9 @@ angular.module('egMarcMod', ['egCoreMod', 'ui.bootstrap']) if ($scope.recordId) { return egCore.pcrud.update( $scope.Record() - ).then(function() { + ).then(function() { // success + $scope.save_stack_depth = $scope.record_undo_stack.length; + $scope.dirtyFlag = false; if ($scope.enable_fast_add) { egCore.net.request( 'open-ils.actor', @@ -1299,6 +1302,8 @@ angular.module('egMarcMod', ['egCoreMod', 'ui.bootstrap']) } }); } + }, function() { // failure + alert('Could not save the record!'); }).then(loadRecord).then(processOnSaveCallbacks); } else { $scope.Record().creator(egCore.auth.user().id());