1 angular.module('egCoreMod')
3 .factory('egPatronMerge',
4 ['$uibModal','$q','egCore',
5 function($uibModal , $q , egCore) {
9 service.do_merge = function(patron_ids) {
10 var deferred = $q.defer();
12 templateUrl: './circ/share/t_merge_patrons',
14 windowClass: 'eg-wide-modal',
16 ['$scope', '$uibModalInstance', function($scope, $uibModalInstance) {
18 $scope.patron_ids = patron_ids;
19 $scope.ok = function() {
20 $uibModalInstance.close({ lead_id : $scope.lead_id });
22 $scope.cancel = function () { $uibModalInstance.dismiss() }
24 }).result.then(function (args) {
25 if (args.lead_id == 0) return;
26 var sub_id = (args.lead_id == patron_ids[0]) ?
31 'open-ils.actor.user.merge',
35 ).then(function(resp) {
36 var evt = egCore.evt.parse(resp);
46 return deferred.promise;
53 .directive('egPatronSummary', ['egUser','patronSvc', function(egUser, patronSvc) {
57 templateUrl : './circ/patron/t_summary',
63 function($scope , egCore) {
66 egUser.get($scope.patronId).then(function(u) {
68 patronSvc.localFlesh(user);
70 patronSvc.getUserStats($scope.patronId).then(function(s) {
73 $scope.patron = function() {
76 $scope.patron_stats = function() {
80 // needed because this directive shares a template with
81 // the patron summary in circ app, but the circ app
82 // displays the patron name elsewhere.
83 $scope.show_name = function() {