From: eileen Date: Tue, 6 Oct 2020 04:52:19 +0000 (+1300) Subject: Remove caching that messes with tests without any time saving X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=14abd3ea6cd04189989bf0b934b88927b9eea7d4;p=civicrm-core.git Remove caching that messes with tests without any time saving --- diff --git a/CRM/Member/Task.php b/CRM/Member/Task.php index ade20080e1..5b298c1d1c 100644 --- a/CRM/Member/Task.php +++ b/CRM/Member/Task.php @@ -40,78 +40,76 @@ class CRM_Member_Task extends CRM_Core_Task { * the set of tasks for a group of contacts */ public static function tasks() { - if (!self::$_tasks) { - self::$_tasks = [ - self::TASK_DELETE => [ - 'title' => ts('Delete memberships'), - 'class' => 'CRM_Member_Form_Task_Delete', - 'result' => FALSE, + self::$_tasks = [ + self::TASK_DELETE => [ + 'title' => ts('Delete memberships'), + 'class' => 'CRM_Member_Form_Task_Delete', + 'result' => FALSE, + ], + self::TASK_PRINT => [ + 'title' => ts('Print selected rows'), + 'class' => 'CRM_Member_Form_Task_Print', + 'result' => FALSE, + ], + self::TASK_EXPORT => [ + 'title' => ts('Export members'), + 'class' => [ + 'CRM_Member_Export_Form_Select', + 'CRM_Member_Export_Form_Map', ], - self::TASK_PRINT => [ - 'title' => ts('Print selected rows'), - 'class' => 'CRM_Member_Form_Task_Print', - 'result' => FALSE, + 'result' => FALSE, + ], + self::TASK_EMAIL => [ + 'title' => ts('Email - send now (to %1 or less)', [ + 1 => Civi::settings() + ->get('simple_mail_limit'), + ]), + 'class' => 'CRM_Member_Form_Task_Email', + 'result' => TRUE, + ], + self::BATCH_UPDATE => [ + 'title' => ts('Update multiple memberships'), + 'class' => [ + 'CRM_Member_Form_Task_PickProfile', + 'CRM_Member_Form_Task_Batch', ], - self::TASK_EXPORT => [ - 'title' => ts('Export members'), - 'class' => [ - 'CRM_Member_Export_Form_Select', - 'CRM_Member_Export_Form_Map', - ], - 'result' => FALSE, + 'result' => TRUE, + ], + self::LABEL_MEMBERS => [ + 'title' => ts('Mailing labels - print'), + 'class' => [ + 'CRM_Member_Form_Task_Label', ], - self::TASK_EMAIL => [ - 'title' => ts('Email - send now (to %1 or less)', [ - 1 => Civi::settings() - ->get('simple_mail_limit'), - ]), - 'class' => 'CRM_Member_Form_Task_Email', - 'result' => TRUE, - ], - self::BATCH_UPDATE => [ - 'title' => ts('Update multiple memberships'), - 'class' => [ - 'CRM_Member_Form_Task_PickProfile', - 'CRM_Member_Form_Task_Batch', - ], - 'result' => TRUE, - ], - self::LABEL_MEMBERS => [ - 'title' => ts('Mailing labels - print'), - 'class' => [ - 'CRM_Member_Form_Task_Label', - ], - 'result' => TRUE, - ], - self::PDF_LETTER => [ - 'title' => ts('Print/merge document for memberships'), - 'class' => 'CRM_Member_Form_Task_PDFLetter', - 'result' => FALSE, - ], - self::SAVE_SEARCH => [ - 'title' => ts('Group - create smart group'), - 'class' => 'CRM_Contact_Form_Task_SaveSearch', - 'result' => TRUE, - ], - self::SAVE_SEARCH_UPDATE => [ - 'title' => ts('Group - update smart group'), - 'class' => 'CRM_Contact_Form_Task_SaveSearch_Update', - 'result' => TRUE, - ], - ]; - - //CRM-4418, check for delete - if (!CRM_Core_Permission::check('delete in CiviMember')) { - unset(self::$_tasks[self::TASK_DELETE]); - } - //CRM-12920 - check for edit permission - if (!CRM_Core_Permission::check('edit memberships')) { - unset(self::$_tasks[self::BATCH_UPDATE]); - } + 'result' => TRUE, + ], + self::PDF_LETTER => [ + 'title' => ts('Print/merge document for memberships'), + 'class' => 'CRM_Member_Form_Task_PDFLetter', + 'result' => FALSE, + ], + self::SAVE_SEARCH => [ + 'title' => ts('Group - create smart group'), + 'class' => 'CRM_Contact_Form_Task_SaveSearch', + 'result' => TRUE, + ], + self::SAVE_SEARCH_UPDATE => [ + 'title' => ts('Group - update smart group'), + 'class' => 'CRM_Contact_Form_Task_SaveSearch_Update', + 'result' => TRUE, + ], + ]; - parent::tasks(); + //CRM-4418, check for delete + if (!CRM_Core_Permission::check('delete in CiviMember')) { + unset(self::$_tasks[self::TASK_DELETE]); + } + //CRM-12920 - check for edit permission + if (!CRM_Core_Permission::check('edit memberships')) { + unset(self::$_tasks[self::BATCH_UPDATE]); } + parent::tasks(); + return self::$_tasks; }