From 8c7b2520fc5dfde7d24236f13c627e4af0f540ad Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Tue, 23 May 2017 17:58:44 -0400 Subject: [PATCH] webstaff: global services for managing MFHDs + create MFHD dialog Signed-off-by: Galen Charlton --- .../templates/staff/share/t_mfhd_create_dialog.tt2 | 25 +++++++++++++ Open-ILS/web/js/ui/default/staff/services/mfhd.js | 41 ++++++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 Open-ILS/src/templates/staff/share/t_mfhd_create_dialog.tt2 create mode 100644 Open-ILS/web/js/ui/default/staff/services/mfhd.js diff --git a/Open-ILS/src/templates/staff/share/t_mfhd_create_dialog.tt2 b/Open-ILS/src/templates/staff/share/t_mfhd_create_dialog.tt2 new file mode 100644 index 0000000000..c04d958616 --- /dev/null +++ b/Open-ILS/src/templates/staff/share/t_mfhd_create_dialog.tt2 @@ -0,0 +1,25 @@ + +
+ + + +
diff --git a/Open-ILS/web/js/ui/default/staff/services/mfhd.js b/Open-ILS/web/js/ui/default/staff/services/mfhd.js new file mode 100644 index 0000000000..488b7cf570 --- /dev/null +++ b/Open-ILS/web/js/ui/default/staff/services/mfhd.js @@ -0,0 +1,41 @@ +/** + * MFHD tools and directives. + */ +angular.module('egMfhdMod', ['egCoreMod', 'ui.bootstrap']) + +.factory('egMfhdCreateDialog', + ['$uibModal','egCore', +function($uibModal , egCore) { + var service = {}; + + service.open = function(bibId, orgId) { + return $uibModal.open({ + templateUrl: './share/t_mfhd_create_dialog', + controller: ['$scope', '$uibModalInstance', + function($scope, $uibModalInstance) { + $scope.mfhd_lib = orgId ? + egCore.org.get(orgId) : + null; + $scope.ok = function() { + egCore.net.request( + 'open-ils.cat', + 'open-ils.cat.serial.record.xml.create', + egCore.auth.token(), + 1, // source + $scope.mfhd_lib.id(), + bibId + ).then(function() { + $uibModalInstance.close() + }); + } + $scope.cancel = function() { + $uibModalInstance.dismiss(); + } + } + ] + }) + } + + return service; +} +]) -- 2.11.0