From: Galen Charlton Date: Tue, 28 Jul 2015 15:00:16 +0000 (+0000) Subject: webstaff: web staff: teach MARC editor how to work in-place X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=4095bc2b49baf1bcf3538790f73df23ac356a3d4;p=evergreen%2Fmasslnc.git webstaff: web staff: teach MARC editor how to work in-place This patch adds an "in-place" mode to the MARC editor for cases where client-side MARC munging is needed without immediately saving the results to the database. To use, include in-place-mode="true" in the eg-marc-edit-record directive. Signed-off-by: Galen Charlton Signed-off-by: Jason Stephenson --- 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 ddd469cd37..8f52306fd0 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 @@ -428,7 +428,11 @@ angular.module('egMarcMod', ['egCoreMod', 'ui.bootstrap']) scope: { dirtyFlag : '=', recordId : '=', - marcXml : '@', + marcXml : '=', + // in-place mode means that the editor is being + // used just to munge some MARCXML client-side, rather + // than to (immediately) update the database + inPlaceMode : '@', recordType : '@', maxUndo : '@' }, @@ -931,6 +935,10 @@ angular.module('egMarcMod', ['egCoreMod', 'ui.bootstrap']) }; $scope.saveRecord = function () { + if ($scope.inPlaceMode) { + $scope.marcXml = $scope.record.toXmlString(); + return; + } $scope.mangle_005(); $scope.Record().editor(egCore.auth.user().id()); $scope.Record().edit_date('now');