]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/web/js/ui/default/staff/services/mfhd.js
LP#1706124: Make include inactive patrons checkbox sticky
[working/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             controller: ['$scope', '$uibModalInstance',
15                 function($scope, $uibModalInstance) {
16                     $scope.mfhd_lib = orgId ?
17                         egCore.org.get(orgId) :
18                         null;
19                     $scope.ok = function() {
20                         egCore.net.request(
21                             'open-ils.cat',
22                             'open-ils.cat.serial.record.xml.create',
23                             egCore.auth.token(),
24                             1, // source
25                             $scope.mfhd_lib.id(),
26                             bibId
27                         ).then(function() {
28                             $uibModalInstance.close()
29                         });
30                     }
31                     $scope.cancel = function() {
32                         $uibModalInstance.dismiss();
33                     }
34                 }
35             ]
36         })
37     }
38
39     return service;
40 }
41 ])