From: Coleman Watts Date: Wed, 5 Nov 2014 22:26:44 +0000 (-0500) Subject: CRM-15562 - Remove 'save and new' button for users without 'add contacts' perm X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=1870cae95cde57af8ebb55dd119bbb954fe16884;p=civicrm-core.git CRM-15562 - Remove 'save and new' button for users without 'add contacts' perm --- diff --git a/CRM/Contact/Form/Contact.php b/CRM/Contact/Form/Contact.php index 2842a8015b..056d50ff05 100644 --- a/CRM/Contact/Form/Contact.php +++ b/CRM/Contact/Form/Contact.php @@ -822,16 +822,18 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form { 'subName' => 'view', 'isDefault' => TRUE, ), - array( + ); + if (CRM_Core_Permission::check('add contacts')) { + $buttons[] = array( 'type' => 'upload', 'name' => ts('Save and New'), 'spacing' => '                 ', 'subName' => 'new', - ), - array( - 'type' => 'cancel', - 'name' => ts('Cancel'), - ), + ); + } + $buttons[] = array( + 'type' => 'cancel', + 'name' => ts('Cancel'), ); if (!empty($this->_values['contact_sub_type'])) {