From 23546577489bbc5f167673f8d9cca28857ccba9e Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Thu, 9 Jan 2014 16:34:40 -0800 Subject: [PATCH] Task.php - code cleanup --- CRM/Activity/Task.php | 21 ++++++++++++++------- CRM/Campaign/Task.php | 12 ++++++++---- CRM/Case/Task.php | 12 ++++++++---- CRM/Contribute/Task.php | 24 ++++++++++++++++-------- CRM/Event/Task.php | 30 ++++++++++++++++++++---------- CRM/Grant/Task.php | 12 ++++++++---- CRM/Mailing/Task.php | 3 ++- CRM/Member/Task.php | 21 ++++++++++++++------- CRM/Pledge/Task.php | 9 ++++++--- 9 files changed, 96 insertions(+), 48 deletions(-) diff --git a/CRM/Activity/Task.php b/CRM/Activity/Task.php index c26fc4c16b..fc4b395673 100644 --- a/CRM/Activity/Task.php +++ b/CRM/Activity/Task.php @@ -73,36 +73,42 @@ class CRM_Activity_Task { static function &tasks() { if (!(self::$_tasks)) { self::$_tasks = array( - 1 => array('title' => ts('Delete Activities'), + 1 => array( + 'title' => ts('Delete Activities'), 'class' => 'CRM_Activity_Form_Task_Delete', 'result' => FALSE, ), - 2 => array('title' => ts('Print Selected Rows'), + 2 => array( + 'title' => ts('Print Selected Rows'), 'class' => 'CRM_Activity_Form_Task_Print', 'result' => FALSE, ), - 3 => array('title' => ts('Export Activities'), + 3 => array( + 'title' => ts('Export Activities'), 'class' => array( 'CRM_Export_Form_Select', 'CRM_Export_Form_Map', ), 'result' => FALSE, ), - 4 => array('title' => ts('Batch Update Activities Via Profile'), + 4 => array( + 'title' => ts('Batch Update Activities Via Profile'), 'class' => array( 'CRM_Activity_Form_Task_PickProfile', 'CRM_Activity_Form_Task_Batch', ), 'result' => FALSE, ), - 5 => array('title' => ts('Send Email to Contacts'), + 5 => array( + 'title' => ts('Send Email to Contacts'), 'class' => array( 'CRM_Activity_Form_Task_PickOption', 'CRM_Activity_Form_Task_Email', ), 'result' => FALSE, ), - 6 => array('title' => ts('Send Reply SMS To Contacts'), + 6 => array( + 'title' => ts('Send Reply SMS To Contacts'), 'class' => 'CRM_Activity_Form_Task_SMS', 'result' => FALSE, ), @@ -122,7 +128,8 @@ class CRM_Activity_Task { if (in_array('CiviCase', $config->enableComponents)) { if ( CRM_Core_Permission::check('access all cases and activities') || CRM_Core_Permission::check('access my cases and activities') ) { - self::$_tasks[6] = array('title' => ts('File on Case'), + self::$_tasks[6] = array( + 'title' => ts('File on Case'), 'class' => 'CRM_Activity_Form_Task_FileOnCase', 'result' => FALSE, ); diff --git a/CRM/Campaign/Task.php b/CRM/Campaign/Task.php index 4e78a38980..b9a9ae9193 100755 --- a/CRM/Campaign/Task.php +++ b/CRM/Campaign/Task.php @@ -68,14 +68,16 @@ class CRM_Campaign_Task { */ static function &tasks() { if (!(self::$_tasks)) { - self::$_tasks = array(1 => array('title' => ts('Record Respondents Interview'), + self::$_tasks = array(1 => array( + 'title' => ts('Record Respondents Interview'), 'class' => array( 'CRM_Campaign_Form_Task_Interview', 'CRM_Campaign_Form_Task_Release', ), 'result' => FALSE, ), - 2 => array('title' => ts('Reserve Respondents'), + 2 => array( + 'title' => ts('Reserve Respondents'), 'class' => array( 'CRM_Campaign_Form_Task_Reserve', 'CRM_Campaign_Form_Task_Interview', @@ -83,11 +85,13 @@ class CRM_Campaign_Task { ), 'result' => FALSE, ), - 3 => array('title' => ts('Release Respondents'), + 3 => array( + 'title' => ts('Release Respondents'), 'class' => 'CRM_Campaign_Form_Task_Release', 'result' => FALSE, ), - 4 => array('title' => ts('Print Respondents'), + 4 => array( + 'title' => ts('Print Respondents'), 'class' => 'CRM_Campaign_Form_Task_Print', 'result' => FALSE, ), diff --git a/CRM/Case/Task.php b/CRM/Case/Task.php index a455910e5e..02a61634fa 100644 --- a/CRM/Case/Task.php +++ b/CRM/Case/Task.php @@ -68,22 +68,26 @@ class CRM_Case_Task { static function &tasks() { if (!self::$_tasks) { self::$_tasks = array( - 1 => array('title' => ts('Delete Cases'), + 1 => array( + 'title' => ts('Delete Cases'), 'class' => 'CRM_Case_Form_Task_Delete', 'result' => FALSE, ), - 2 => array('title' => ts('Print Selected Rows'), + 2 => array( + 'title' => ts('Print Selected Rows'), 'class' => 'CRM_Case_Form_Task_Print', 'result' => FALSE, ), - 3 => array('title' => ts('Export Cases'), + 3 => array( + 'title' => ts('Export Cases'), 'class' => array( 'CRM_Export_Form_Select', 'CRM_Export_Form_Map', ), 'result' => FALSE, ), - 4 => array('title' => ts('Restore Cases'), + 4 => array( + 'title' => ts('Restore Cases'), 'class' => 'CRM_Case_Form_Task_Restore', 'result' => FALSE, ), diff --git a/CRM/Contribute/Task.php b/CRM/Contribute/Task.php index 7b7c23164c..57526b738f 100644 --- a/CRM/Contribute/Task.php +++ b/CRM/Contribute/Task.php @@ -68,41 +68,49 @@ class CRM_Contribute_Task { static function &tasks() { if (!(self::$_tasks)) { self::$_tasks = array( - 1 => array('title' => ts('Delete Contributions'), + 1 => array( + 'title' => ts('Delete Contributions'), 'class' => 'CRM_Contribute_Form_Task_Delete', 'result' => FALSE, ), - 2 => array('title' => ts('Print Selected Rows'), + 2 => array( + 'title' => ts('Print Selected Rows'), 'class' => 'CRM_Contribute_Form_Task_Print', 'result' => FALSE, ), - 3 => array('title' => ts('Export Contributions'), + 3 => array( + 'title' => ts('Export Contributions'), 'class' => array( 'CRM_Export_Form_Select', 'CRM_Export_Form_Map', ), 'result' => FALSE, ), - 4 => array('title' => ts('Batch Update Contributions Via Profile'), + 4 => array( + 'title' => ts('Batch Update Contributions Via Profile'), 'class' => array( 'CRM_Contribute_Form_Task_PickProfile', 'CRM_Contribute_Form_Task_Batch', ), 'result' => TRUE, ), - 5 => array('title' => ts('Send Email to Contacts'), + 5 => array( + 'title' => ts('Send Email to Contacts'), 'class' => 'CRM_Contribute_Form_Task_Email', 'result' => TRUE, ), - 6 => array('title' => ts('Update Pending Contribution Status'), + 6 => array( + 'title' => ts('Update Pending Contribution Status'), 'class' => 'CRM_Contribute_Form_Task_Status', 'result' => TRUE, ), - 7 => array('title' => ts('Print or Email Contribution Receipts'), + 7 => array( + 'title' => ts('Print or Email Contribution Receipts'), 'class' => 'CRM_Contribute_Form_Task_PDF', 'result' => FALSE, ), - 8 => array('title' => ts('Thank-you Letters for Contributions'), + 8 => array( + 'title' => ts('Thank-you Letters for Contributions'), 'class' => 'CRM_Contribute_Form_Task_PDFLetter', 'result' => FALSE, ), diff --git a/CRM/Event/Task.php b/CRM/Event/Task.php index 447ac2238b..5b40379a5f 100644 --- a/CRM/Event/Task.php +++ b/CRM/Event/Task.php @@ -71,49 +71,59 @@ class CRM_Event_Task { */ static function &tasks() { if (!(self::$_tasks)) { - self::$_tasks = array(1 => array('title' => ts('Delete Participants'), + self::$_tasks = array(1 => array( + 'title' => ts('Delete Participants'), 'class' => 'CRM_Event_Form_Task_Delete', 'result' => FALSE, ), - 2 => array('title' => ts('Print Selected Rows'), + 2 => array( + 'title' => ts('Print Selected Rows'), 'class' => 'CRM_Event_Form_Task_Print', 'result' => FALSE, ), - 3 => array('title' => ts('Export Participants'), + 3 => array( + 'title' => ts('Export Participants'), 'class' => array( 'CRM_Export_Form_Select', 'CRM_Export_Form_Map', ), 'result' => FALSE, ), - 4 => array('title' => ts('Batch Update Participants Via Profile'), + 4 => array( + 'title' => ts('Batch Update Participants Via Profile'), 'class' => array( 'CRM_Event_Form_Task_PickProfile', 'CRM_Event_Form_Task_Batch', ), 'result' => TRUE, ), - 5 => array('title' => ts('Cancel Registration'), + 5 => array( + 'title' => ts('Cancel Registration'), 'class' => 'CRM_Event_Form_Task_Cancel', 'result' => FALSE, ), - 6 => array('title' => ts('Send Email to Contacts'), + 6 => array( + 'title' => ts('Send Email to Contacts'), 'class' => 'CRM_Event_Form_Task_Email', 'result' => TRUE, ), - 13 => array('title' => ts('New Smart Group'), + 13 => array( + 'title' => ts('New Smart Group'), 'class' => 'CRM_Event_Form_Task_SaveSearch', 'result' => TRUE, ), - 14 => array('title' => ts('Update Smart Group'), + 14 => array( + 'title' => ts('Update Smart Group'), 'class' => 'CRM_Event_Form_Task_SaveSearch_Update', 'result' => TRUE, ), - 15 => array('title' => ts('Change Participant Status'), + 15 => array( + 'title' => ts('Change Participant Status'), 'class' => 'CRM_Event_Form_Task_ParticipantStatus', 'result' => TRUE, ), - 16 => array('title' => ts('Print Event Name Badges'), + 16 => array( + 'title' => ts('Print Event Name Badges'), 'class' => 'CRM_Event_Form_Task_Badge', 'result' => FALSE, ), diff --git a/CRM/Grant/Task.php b/CRM/Grant/Task.php index 551199aae5..a37d65edf1 100644 --- a/CRM/Grant/Task.php +++ b/CRM/Grant/Task.php @@ -67,22 +67,26 @@ class CRM_Grant_Task { */ static function &tasks() { if (!(self::$_tasks)) { - self::$_tasks = array(1 => array('title' => ts('Delete Grants'), + self::$_tasks = array(1 => array( + 'title' => ts('Delete Grants'), 'class' => 'CRM_Grant_Form_Task_Delete', 'result' => FALSE, ), - 2 => array('title' => ts('Print Selected Rows'), + 2 => array( + 'title' => ts('Print Selected Rows'), 'class' => 'CRM_Grant_Form_Task_Print', 'result' => FALSE, ), - 3 => array('title' => ts('Export Grants'), + 3 => array( + 'title' => ts('Export Grants'), 'class' => array( 'CRM_Export_Form_Select', 'CRM_Export_Form_Map', ), 'result' => FALSE, ), - 4 => array('title' => ts('Update Grants'), + 4 => array( + 'title' => ts('Update Grants'), 'class' => 'CRM_Grant_Form_Task_Update', 'result' => FALSE, ), diff --git a/CRM/Mailing/Task.php b/CRM/Mailing/Task.php index 1ff5f827ac..e6d6ed4600 100644 --- a/CRM/Mailing/Task.php +++ b/CRM/Mailing/Task.php @@ -66,7 +66,8 @@ class CRM_Mailing_Task { static function &tasks() { if (!(self::$_tasks)) { self::$_tasks = array( - 1 => array('title' => ts('Print Mailing Recipients'), + 1 => array( + 'title' => ts('Print Mailing Recipients'), 'class' => 'CRM_Mailing_Form_Task_Print', 'result' => FALSE, ), diff --git a/CRM/Member/Task.php b/CRM/Member/Task.php index 0e0ef5ab23..0de7fcf08f 100644 --- a/CRM/Member/Task.php +++ b/CRM/Member/Task.php @@ -69,39 +69,46 @@ class CRM_Member_Task { static function &tasks() { if (!(self::$_tasks)) { self::$_tasks = array( - 1 => array('title' => ts('Delete Members'), + 1 => array( + 'title' => ts('Delete Members'), 'class' => 'CRM_Member_Form_Task_Delete', 'result' => FALSE, ), - 2 => array('title' => ts('Print Selected Rows'), + 2 => array( + 'title' => ts('Print Selected Rows'), 'class' => 'CRM_Member_Form_Task_Print', 'result' => FALSE, ), - 3 => array('title' => ts('Export Members'), + 3 => array( + 'title' => ts('Export Members'), 'class' => array( 'CRM_Export_Form_Select', 'CRM_Export_Form_Map', ), 'result' => FALSE, ), - 4 => array('title' => ts('Send Email to Contacts'), + 4 => array( + 'title' => ts('Send Email to Contacts'), 'class' => 'CRM_Member_Form_Task_Email', 'result' => TRUE, ), - 5 => array('title' => ts('Batch Update Members Via Profile'), + 5 => array( + 'title' => ts('Batch Update Members Via Profile'), 'class' => array( 'CRM_Member_Form_Task_PickProfile', 'CRM_Member_Form_Task_Batch', ), 'result' => TRUE, ), - 6 => array('title' => ts('Mailing Labels'), + 6 => array( + 'title' => ts('Mailing Labels'), 'class' => array( 'CRM_Member_Form_Task_Label', ), 'result' => TRUE, ), - 7 => array('title' => ts('Print PDF Letters for Memberships'), + 7 => array( + 'title' => ts('Print PDF Letters for Memberships'), 'class' => 'CRM_Member_Form_Task_PDFLetter', 'result' => FALSE, ), diff --git a/CRM/Pledge/Task.php b/CRM/Pledge/Task.php index 65e72f2086..6434ca80e2 100644 --- a/CRM/Pledge/Task.php +++ b/CRM/Pledge/Task.php @@ -67,15 +67,18 @@ class CRM_Pledge_Task { */ static function &tasks() { if (!self::$_tasks) { - self::$_tasks = array(1 => array('title' => ts('Delete Pledges'), + self::$_tasks = array(1 => array( + 'title' => ts('Delete Pledges'), 'class' => 'CRM_Pledge_Form_Task_Delete', 'result' => FALSE, ), - 2 => array('title' => ts('Print Selected Rows'), + 2 => array( + 'title' => ts('Print Selected Rows'), 'class' => 'CRM_Pledge_Form_Task_Print', 'result' => FALSE, ), - 3 => array('title' => ts('Export Pledges'), + 3 => array( + 'title' => ts('Export Pledges'), 'class' => array( 'CRM_Export_Form_Select', 'CRM_Export_Form_Map', -- 2.25.1