From: kurund Date: Fri, 30 Aug 2013 11:19:07 +0000 (+0530) Subject: code cleanup X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=4154180f5d6485af8da13d6d7c1f1a3a4bf544fb;p=civicrm-core.git code cleanup --- diff --git a/CRM/Contact/Task.php b/CRM/Contact/Task.php index 323c737ce2..63e5e36cef 100644 --- a/CRM/Contact/Task.php +++ b/CRM/Contact/Task.php @@ -60,71 +60,88 @@ class CRM_Contact_Task { static function initTasks() { if (!self::$_tasks) { self::$_tasks = array( - 1 => array('title' => ts('Add Contacts to Group'), + 1 => array( + 'title' => ts('Add Contacts to Group'), 'class' => 'CRM_Contact_Form_Task_AddToGroup', ), - 2 => array('title' => ts('Remove Contacts from Group'), + 2 => array( + 'title' => ts('Remove Contacts from Group'), 'class' => 'CRM_Contact_Form_Task_RemoveFromGroup', ), - 3 => array('title' => ts('Tag Contacts (assign tags)'), + 3 => array( + 'title' => ts('Tag Contacts (assign tags)'), 'class' => 'CRM_Contact_Form_Task_AddToTag', ), - 4 => array('title' => ts('Untag Contacts (remove tags)'), + 4 => array( + 'title' => ts('Untag Contacts (remove tags)'), 'class' => 'CRM_Contact_Form_Task_RemoveFromTag', ), - 5 => array('title' => ts('Export Contacts'), + 5 => array( + 'title' => ts('Export Contacts'), 'class' => array( 'CRM_Export_Form_Select', 'CRM_Export_Form_Map', ), 'result' => FALSE, ), - 6 => array('title' => ts('Send Email to Contacts'), + 6 => array( + 'title' => ts('Send Email to Contacts'), 'class' => 'CRM_Contact_Form_Task_Email', 'result' => TRUE, ), - 7 => array('title' => ts('Send SMS to Contacts'), + 7 => array( + 'title' => ts('Send SMS to Contacts'), 'class' => 'CRM_Contact_Form_Task_SMS', 'result' => TRUE, ), - 8 => array('title' => ts('Delete Contacts'), + 8 => array( + 'title' => ts('Delete Contacts'), 'class' => 'CRM_Contact_Form_Task_Delete', 'result' => FALSE, ), - 11 => array('title' => ts('Record Activity for Contacts'), + 11 => array( + 'title' => ts('Record Activity for Contacts'), 'class' => 'CRM_Activity_Form_Activity', ), - 13 => array('title' => ts('New Smart Group'), + 13 => array( + 'title' => ts('New Smart Group'), 'class' => 'CRM_Contact_Form_Task_SaveSearch', 'result' => TRUE, ), - 14 => array('title' => ts('Update Smart Group'), + 14 => array( + 'title' => ts('Update Smart Group'), 'class' => 'CRM_Contact_Form_Task_SaveSearch_Update', 'result' => TRUE, ), - 15 => array('title' => ts('Print Contacts'), + 15 => array( + 'title' => ts('Print Contacts'), 'class' => 'CRM_Contact_Form_Task_Print', 'result' => FALSE, ), - 16 => array('title' => ts('Mailing Labels'), + 16 => array( + 'title' => ts('Mailing Labels'), 'class' => 'CRM_Contact_Form_Task_Label', 'result' => TRUE, ), - 17 => array('title' => ts('Batch Update via Profile'), + 17 => array( + 'title' => ts('Batch Update via Profile'), 'class' => array( 'CRM_Contact_Form_Task_PickProfile', 'CRM_Contact_Form_Task_Batch', ), 'result' => TRUE, ), - 19 => array('title' => ts('Print PDF Letter for Contacts'), + 19 => array( + 'title' => ts('Print PDF Letter for Contacts'), 'class' => 'CRM_Contact_Form_Task_PDF', 'result' => TRUE, ), - 22 => array('title' => ts('Unhold Emails'), + 22 => array( + 'title' => ts('Unhold Emails'), 'class' => 'CRM_Contact_Form_Task_Unhold', ), - 25 => array('title' => ts('Alter Contact Communication Preferences'), + 25 => array( + 'title' => ts('Alter Contact Communication Preferences'), 'class' => 'CRM_Contact_Form_Task_AlterPreferences', ), self::RESTORE => array( @@ -160,7 +177,8 @@ class CRM_Contact_Task { } if (CRM_Core_Permission::check('merge duplicate contacts')) { - self::$_tasks[21] = array('title' => ts('Merge Contacts'), + self::$_tasks[21] = array( + 'title' => ts('Merge Contacts'), 'class' => 'CRM_Contact_Form_Task_Merge', 'result' => TRUE, ); @@ -182,20 +200,23 @@ class CRM_Contact_Task { ) ) ) { - self::$_tasks[12] = array('title' => ts('Map Contacts'), + self::$_tasks[12] = array( + 'title' => ts('Map Contacts'), 'class' => 'CRM_Contact_Form_Task_Map', 'result' => FALSE, ); } if (CRM_Core_Permission::access('CiviEvent')) { - self::$_tasks[18] = array('title' => ts('Add Contacts to Event'), + self::$_tasks[18] = array( + 'title' => ts('Add Contacts to Event'), 'class' => 'CRM_Event_Form_Participant', ); } if (CRM_Core_Permission::access('CiviMail')) { - self::$_tasks[20] = array('title' => ts('Schedule/Send a Mass Mailing'), + self::$_tasks[20] = array( + 'title' => ts('Schedule/Send a Mass Mailing'), 'class' => array( 'CRM_Mailing_Form_Group', 'CRM_Mailing_Form_Settings', @@ -209,7 +230,8 @@ class CRM_Contact_Task { elseif (CRM_Mailing_Info::workflowEnabled() && CRM_Core_Permission::check('create mailings') ) { - self::$_tasks[20] = array('title' => ts('Create a Mass Mailing'), + self::$_tasks[20] = array( + 'title' => ts('Create a Mass Mailing'), 'class' => array( 'CRM_Mailing_Form_Group', 'CRM_Mailing_Form_Settings', @@ -279,7 +301,7 @@ class CRM_Contact_Task { * @return array set of tasks that are valid for the user * @access public */ - static function &permissionedTaskTitles($permission, $deletedContacts = false) { + static function &permissionedTaskTitles($permission, $deletedContacts = FALSE) { self::initTasks(); $tasks = array(); if ($deletedContacts) { @@ -336,7 +358,8 @@ class CRM_Contact_Task { // make it the print task by default $value = 15; } - return array(CRM_Utils_Array::value('class', self::$_tasks[$value]), + return array( + CRM_Utils_Array::value('class', self::$_tasks[$value]), CRM_Utils_Array::value('result', self::$_tasks[$value]), ); }