Commit | Line | Data |
---|---|---|
25523059 CW |
1 | (function(angular, $, _) { |
2 | "use strict"; | |
3 | ||
e78d6a2d | 4 | angular.module('searchActions').controller('crmSearchActionDelete', function($scope, crmApi4, dialogService, searchMeta) { |
25523059 CW |
5 | var ts = $scope.ts = CRM.ts(), |
6 | model = $scope.model, | |
7 | ctrl = $scope.$ctrl = this; | |
8 | ||
9 | this.entity = searchMeta.getEntity(model.entity); | |
10 | ||
11 | this.cancel = function() { | |
12 | dialogService.cancel('crmSearchAction'); | |
13 | }; | |
14 | ||
15 | this.delete = function() { | |
16 | crmApi4(model.entity, 'Delete', { | |
17 | where: [['id', 'IN', model.ids]], | |
18 | }).then(function() { | |
19 | dialogService.close('crmSearchAction'); | |
20 | }); | |
21 | }; | |
22 | ||
23 | }); | |
24 | })(angular, CRM.$, CRM._); |