1 (function(angular
, $, _
) {
4 angular
.module('crmSearchActions').controller('crmSearchActionDelete', function($scope
, dialogService
) {
5 var ts
= $scope
.ts
= CRM
.ts(),
7 ctrl
= $scope
.$ctrl
= this;
9 this.entityTitle
= model
.ids
.length
=== 1 ? model
.entityInfo
.title
: model
.entityInfo
.title_plural
;
11 this.cancel = function() {
12 dialogService
.cancel('crmSearchAction');
15 this.delete = function() {
16 $('.ui-dialog-titlebar button').hide();
20 this.onSuccess = function() {
21 CRM
.alert(ts('Successfully deleted %1 %2.', {1: model
.ids
.length
, 2: ctrl
.entityTitle
}), ts('Deleted'), 'success');
22 dialogService
.close('crmSearchAction');
25 this.onError = function() {
26 CRM
.alert(ts('An error occurred while attempting to delete %1 %2.', {1: model
.ids
.length
, 2: ctrl
.entityTitle
}), ts('Error'), 'error');
27 dialogService
.close('crmSearchAction');
31 })(angular
, CRM
.$, CRM
._
);