From: Cesar Velez Date: Fri, 15 Sep 2017 21:02:31 +0000 (-0400) Subject: LP#1700635-enable eg-marc-editor for queued records in MARC Batch Import/Export X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=refs%2Fheads%2Fuser%2Fcesardv%2Flp1700635-vandelay_bib_queue_edit_marc_redo;p=working%2FEvergreen.git LP#1700635-enable eg-marc-editor for queued records in MARC Batch Import/Export This enables the angular modal marc-editor to be called from the vandelay dojo UI in the iFrame. Signed-off by: Cesar Velez --- diff --git a/Open-ILS/src/templates/staff/cat/catalog/t_edit_marc_modal.tt2 b/Open-ILS/src/templates/staff/cat/catalog/t_edit_marc_modal.tt2 new file mode 100644 index 0000000000..1bc890412a --- /dev/null +++ b/Open-ILS/src/templates/staff/cat/catalog/t_edit_marc_modal.tt2 @@ -0,0 +1,16 @@ +
+ + + +
diff --git a/Open-ILS/src/templates/staff/cat/catalog/t_vandelay.tt2 b/Open-ILS/src/templates/staff/cat/catalog/t_vandelay.tt2 index 634c7bcf2d..96780ad49b 100644 --- a/Open-ILS/src/templates/staff/cat/catalog/t_vandelay.tt2 +++ b/Open-ILS/src/templates/staff/cat/catalog/t_vandelay.tt2 @@ -1 +1 @@ - + diff --git a/Open-ILS/web/js/ui/default/staff/cat/catalog/app.js b/Open-ILS/web/js/ui/default/staff/cat/catalog/app.js index faa0954b5c..a080ec84e9 100644 --- a/Open-ILS/web/js/ui/default/staff/cat/catalog/app.js +++ b/Open-ILS/web/js/ui/default/staff/cat/catalog/app.js @@ -1825,9 +1825,34 @@ function($scope , $location) { }]) .controller('VandelayCtrl', - ['$scope','$location', -function($scope , $location) { + ['$scope','$location', 'egCore', '$uibModal', +function($scope , $location, egCore, $uibModal) { $scope.vandelay_url = $location.absUrl().replace(/\/staff\/cat\/catalog\/vandelay/, '/vandelay/vandelay'); + $scope.funcs = {}; + $scope.funcs.edit_marc_modal = function(bre, callback){ + var marcArgs = { 'marc_xml': bre.marc() }; + var vqbibrecId = bre.id(); + $uibModal.open({ + templateUrl: './cat/catalog/t_edit_marc_modal', + size: 'lg', + controller: ['$scope', '$uibModalInstance', function($scope, $uibModalInstance) { + $scope.focusMe = true; + $scope.recordId = vqbibrecId; + $scope.args = marcArgs; + $scope.dirty_flag = false; + $scope.ok = function(marg){ + $uibModalInstance.close(marg); + }; + $scope.cancel = function(){ $uibModalInstance.dismiss() } + }] + }).result.then(function(res){ + var new_xml = res.marc_xml; + egCore.pcrud.retrieve('vqbr', vqbibrecId).then(function(vqbib){ + vqbib.marc(new_xml); + egCore.pcrud.update(vqbib).then( function(){ callback(vqbibrecId); }); + }); + }); + }; }]) .controller('ManageAuthoritiesCtrl', diff --git a/Open-ILS/web/js/ui/default/vandelay/vandelay.js b/Open-ILS/web/js/ui/default/vandelay/vandelay.js index 928ef05821..87261537d0 100644 --- a/Open-ILS/web/js/ui/default/vandelay/vandelay.js +++ b/Open-ILS/web/js/ui/default/vandelay/vandelay.js @@ -1725,6 +1725,11 @@ function vlOpenMarcEditWindow(rec, postReloadHTMLHandler) { To run in Firefox directly, must set signed.applets.codebase_principal_support to true in about:config */ + if(window.IAMBROWSER){ + xulG.edit_marc_modal(rec, function(breId){ vlLoadMARCHtml(breId, false, postReloadHTMLHandler); }); + return; + } + win = window.open('/xul/server/cat/marcedit.xul','','chrome'); // XXX version? var type;