From 1870cae95cde57af8ebb55dd119bbb954fe16884 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Wed, 5 Nov 2014 17:26:44 -0500 Subject: [PATCH] CRM-15562 - Remove 'save and new' button for users without 'add contacts' perm --- CRM/Contact/Form/Contact.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) 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'])) { -- 2.25.1