'create mailings',
'schedule mailings',
'approve mailings',
+ 'delete in CiviMail',
));
return $result;
var myAutosave = null;
$scope.crmMailingABCriteria = crmMailingABCriteria;
$scope.crmMailingConst = CRM.crmMailing;
+ $scope.checkPerm = CRM.checkPerm;
$scope.isSubmitted = function isSubmitted() {
return _.size(abtest.mailings.a.jobs) > 0 || _.size(abtest.mailings.b.jobs) > 0;
<button crm-icon="check" ng-disabled="block.check() || crmMailing.$invalid" ng-click="submit()">{{ts('Submit Mailing')}}</button>
<button crm-icon="disk" ng-disabled="block.check()" ng-click="save().then(leave)">{{ts('Save Draft')}}</button>
- <button crm-icon="trash" ng-disabled="block.check()" crm-confirm="{title:ts('Delete Draft'), message:ts('Are you sure you want to permanently delete this mailing?')}" on-yes="delete()">{{ts('Delete Draft')}}</button>
+ <button
+ crm-icon="trash"
+ ng-show="checkPerm('delete in CiviMail')"
+ ng-disabled="block.check()"
+ crm-confirm="{title:ts('Delete Draft'), message:ts('Are you sure you want to permanently delete this mailing?')}"
+ on-yes="delete()">{{ts('Delete Draft')}}</button>
</div>
</form>
<button crm-icon="check" ng-disabled="block.check() || crmMailing.$invalid" ng-click="submit()">{{ts('Submit Mailing')}}</button>
<button crm-icon="disk" ng-disabled="block.check()" ng-click="save().then(leave)">{{ts('Save Draft')}}</button>
- <button crm-icon="trash" ng-disabled="block.check()" crm-confirm="{title:ts('Delete Draft'), message:ts('Are you sure you want to permanently delete this mailing?')}" on-yes="delete()">{{ts('Delete Draft')}}</button>
+ <button
+ crm-icon="trash"
+ ng-show="checkPerm('delete in CiviMail')"
+ ng-disabled="block.check()"
+ crm-confirm="{title:ts('Delete Draft'), message:ts('Are you sure you want to permanently delete this mailing?')}"
+ on-yes="delete()">{{ts('Delete Draft')}}</button>
</div>
</form>
</div>
<span crm-ui-wizard-buttons style="float:right;">
- <button crm-icon="trash" ng-disabled="block.check()" crm-confirm="{title:ts('Delete Draft'), message:ts('Are you sure you want to permanently delete this mailing?')}" on-yes="delete()">{{ts('Delete Draft')}}</button>
+ <button
+ crm-icon="trash"
+ ng-show="checkPerm('delete in CiviMail')"
+ ng-disabled="block.check()"
+ crm-confirm="{title:ts('Delete Draft'), message:ts('Are you sure you want to permanently delete this mailing?')}"
+ on-yes="delete()">{{ts('Delete Draft')}}</button>
<button crm-icon="disk" ng-disabled="block.check()" ng-click="save().then(leave)">{{ts('Save Draft')}}</button>
</span>
</div>
</div>
<span crm-ui-wizard-buttons style="float:right;">
- <button crm-icon="trash" ng-disabled="block.check()" crm-confirm="{title:ts('Delete Draft'), message:ts('Are you sure you want to permanently delete this mailing?')}" on-yes="delete()">{{ts('Delete Draft')}}</button>
+ <button
+ crm-icon="trash"
+ ng-show="checkPerm('delete in CiviMail')"
+ ng-disabled="block.check()"
+ crm-confirm="{title:ts('Delete Draft'), message:ts('Are you sure you want to permanently delete this mailing?')}"
+ on-yes="delete()">{{ts('Delete Draft')}}</button>
<button crm-icon="disk" ng-disabled="block.check()" ng-click="save().then(leave)">{{ts('Save Draft')}}</button>
</span>
</div>
</div>
<span crm-ui-wizard-buttons style="float:right;">
- <button crm-icon="trash" ng-disabled="block.check()" crm-confirm="{title:ts('Delete Draft'), message:ts('Are you sure you want to permanently delete this mailing?')}" on-yes="delete()">{{ts('Delete Draft')}}</button>
+ <button
+ crm-icon="trash"
+ ng-show="checkPerm('delete in CiviMail')"
+ ng-disabled="block.check()"
+ crm-confirm="{title:ts('Delete Draft'), message:ts('Are you sure you want to permanently delete this mailing?')}"
+ on-yes="delete()">{{ts('Delete Draft')}}</button>
<button crm-icon="disk" ng-disabled="block.check()" ng-click="save().then(leave)">{{ts('Save Draft')}}</button>
</span>
</div>
<span crm-ui-wizard-buttons style="float:right;">
<button
crm-icon="trash"
+ ng-show="checkPerm('delete in CiviMail')"
ng-disabled="block.check()"
crm-confirm="{title:ts('Delete Draft'), message:ts('Are you sure you want to permanently delete this mailing?')}"
on-yes="delete()">{{ts('Delete Draft')}}