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',
15 windowClass: 'eg-wide-modal',
17 ['$scope', '$uibModalInstance', function($scope, $uibModalInstance) {
19 $scope.patron_ids = patron_ids;
20 $scope.ok = function() {
21 $uibModalInstance.close({ lead_id : $scope.lead_id });
23 $scope.cancel = function () { $uibModalInstance.dismiss() }
25 }).result.then(function (args) {
26 if (args.lead_id == 0) return;
27 var sub_id = (args.lead_id == patron_ids[0]) ?
32 'open-ils.actor.user.merge',
36 ).then(function(resp) {
37 var evt = egCore.evt.parse(resp);
47 return deferred.promise;
54 .directive('egPatronSummary', ['egUser','patronSvc', function(egUser, patronSvc) {
58 templateUrl : './circ/patron/t_summary',
64 function($scope , egCore) {
67 egUser.get($scope.patronId).then(function(u) {
69 patronSvc.localFlesh(user);
71 patronSvc.getUserStats($scope.patronId).then(function(s) {
74 $scope.patron = function() {
77 $scope.patron_stats = function() {
81 // needed because this directive shares a template with
82 // the patron summary in circ app, but the circ app
83 // displays the patron name elsewhere.
84 $scope.show_name = function() {