Commit | Line | Data |
---|---|---|
25523059 CW |
1 | (function(angular, $, _) { |
2 | "use strict"; | |
3 | ||
493f83d4 | 4 | angular.module('crmSearchActions').controller('crmSearchActionDelete', function($scope, crmApi4, dialogService) { |
25523059 CW |
5 | var ts = $scope.ts = CRM.ts(), |
6 | model = $scope.model, | |
7 | ctrl = $scope.$ctrl = this; | |
8 | ||
493f83d4 | 9 | this.entityTitle = model.ids.length === 1 ? model.entityInfo.title : model.entityInfo.title_plural; |
25523059 CW |
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._); |