From 0bd63e583da386fdaa53216a38a237547d36337e Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Thu, 9 Feb 2017 10:48:20 -0500 Subject: [PATCH] webstaff: implement Edit MARC Order Record Signed-off-by: Galen Charlton Signed-off-by: Kathy Lussier --- Open-ILS/src/templates/staff/acq/index.tt2 | 5 +++ .../staff/acq/t_edit_marc_order_record.tt2 | 16 ++++++++ .../web/js/ui/default/acq/common/li_table.js | 8 +++- Open-ILS/web/js/ui/default/staff/acq/app.js | 37 +++++++++++++++++-- 4 files changed, 60 insertions(+), 6 deletions(-) create mode 100644 Open-ILS/src/templates/staff/acq/t_edit_marc_order_record.tt2 diff --git a/Open-ILS/src/templates/staff/acq/index.tt2 b/Open-ILS/src/templates/staff/acq/index.tt2 index b3a17d1ceb..060c4b3963 100644 --- a/Open-ILS/src/templates/staff/acq/index.tt2 +++ b/Open-ILS/src/templates/staff/acq/index.tt2 @@ -12,6 +12,11 @@ + + + +[% INCLUDE 'staff/cat/share/marcedit_strings.tt2' %] + [% END %] diff --git a/Open-ILS/src/templates/staff/acq/t_edit_marc_order_record.tt2 b/Open-ILS/src/templates/staff/acq/t_edit_marc_order_record.tt2 new file mode 100644 index 0000000000..1deeb5b314 --- /dev/null +++ b/Open-ILS/src/templates/staff/acq/t_edit_marc_order_record.tt2 @@ -0,0 +1,16 @@ +
+ + + +
diff --git a/Open-ILS/web/js/ui/default/acq/common/li_table.js b/Open-ILS/web/js/ui/default/acq/common/li_table.js index 89578536fc..44e7b974c5 100644 --- a/Open-ILS/web/js/ui/default/acq/common/li_table.js +++ b/Open-ILS/web/js/ui/default/acq/common/li_table.js @@ -3506,15 +3506,19 @@ function AcqLiTable() { this.editOrderMarc = function(li) { + var self = this; + if(window.IAMBROWSER) { + xulG.edit_marc_order_record(li, function(li) { self.drawInfo(li.id()) }); + return; + } + /* To run in Firefox directly, must set signed.applets.codebase_principal_support to true in about:config */ - if(openils.XUL.isXUL()) { win = window.open('/xul/' + openils.XUL.buildId() + '/server/cat/marcedit.xul','','chrome'); } else { win = window.open('/xul/server/cat/marcedit.xul','','chrome'); } - var self = this; win.xulG = { record : {marc : li.marc(), "rtype": "bre"}, save : { diff --git a/Open-ILS/web/js/ui/default/staff/acq/app.js b/Open-ILS/web/js/ui/default/staff/acq/app.js index 6f302e8d35..c9ce2f0be6 100644 --- a/Open-ILS/web/js/ui/default/staff/acq/app.js +++ b/Open-ILS/web/js/ui/default/staff/acq/app.js @@ -1,5 +1,5 @@ angular.module('egAcquisitions', - ['ngRoute', 'ui.bootstrap', 'egCoreMod','egUiMod']) + ['ngRoute', 'ui.bootstrap', 'egCoreMod','egUiMod','egMarcMod']) .config(['$routeProvider','$locationProvider','$compileProvider', function($routeProvider , $locationProvider , $compileProvider) { @@ -31,8 +31,8 @@ angular.module('egAcquisitions', }]) .controller('EmbedAcqCtl', - ['$scope','$routeParams','$location','$window','$timeout','egCore', -function($scope , $routeParams , $location , $window , $timeout , egCore) { + ['$scope','$routeParams','$location','$window','$timeout','egCore','$uibModal', +function($scope , $routeParams , $location , $window , $timeout , egCore , $uibModal) { var relay_url = function(url) { if (url.match(/\/eg\/acq/)) { @@ -67,10 +67,39 @@ function($scope , $routeParams , $location , $window , $timeout , egCore) { }); } + var edit_marc_order_record = function(li, callback) { + var args = { + 'marc_xml' : li.marc() + }; + $uibModal.open({ + templateUrl: './acq/t_edit_marc_order_record', + size: 'lg', + controller: + ['$scope', '$uibModalInstance', function($scope, $uibModalInstance) { + $scope.focusMe = true; + $scope.args = args; + $scope.dirty_flag = false; + $scope.ok = function(args) { $uibModalInstance.close(args) } + $scope.cancel = function () { $uibModalInstance.dismiss() } + }] + }).result.then(function (args) { + li.marc(args.marc_xml); + egCore.net.request( + 'open-ils.acq', + 'open-ils.acq.lineitem.update', + egCore.auth.token(), + li + ).then(function() { + callback(li); + }); + }); + } + $scope.funcs = { ses : egCore.auth.token(), relay_url : relay_url, - volume_item_creator : volume_item_creator + volume_item_creator : volume_item_creator, + edit_marc_order_record : edit_marc_order_record } var acq_path = '/eg/acq/' + -- 2.43.2