]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/web/js/ui/default/staff/services/mfhd.js
Docs: incorporating offline circ docs
[Evergreen.git] / Open-ILS / web / js / ui / default / staff / services / mfhd.js
1 /**
2   * MFHD tools and directives.
3   */
4 angular.module('egMfhdMod', ['egCoreMod', 'ui.bootstrap'])
5
6 .factory('egMfhdCreateDialog',
7        ['$uibModal','egCore',
8 function($uibModal , egCore) {
9     var service = {};
10
11     service.open = function(bibId, orgId) {
12         return $uibModal.open({
13             templateUrl: './share/t_mfhd_create_dialog',
14             backdrop: 'static',
15             controller: ['$scope', '$uibModalInstance',
16                 function($scope, $uibModalInstance) {
17                     $scope.mfhd_lib = orgId ?
18                         egCore.org.get(orgId) :
19                         null;
20                     $scope.ok = function() {
21                         egCore.net.request(
22                             'open-ils.cat',
23                             'open-ils.cat.serial.record.xml.create',
24                             egCore.auth.token(),
25                             1, // source
26                             $scope.mfhd_lib.id(),
27                             bibId
28                         ).then(function() {
29                             $uibModalInstance.close()
30                         });
31                     }
32                     $scope.cancel = function() {
33                         $uibModalInstance.dismiss();
34                     }
35                 }
36             ]
37         })
38     }
39
40     return service;
41 }
42 ])