From 32864ccf6ecdf9927f12f57a693ef0f22d9ccfb4 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Tue, 6 Jan 2015 13:09:19 -0800 Subject: [PATCH] INFRA-132 - CRM/Activity - phpcbf --- CRM/Activity/Form/Activity.php | 4 +-- CRM/Activity/Form/ActivityLinks.php | 6 ++-- CRM/Activity/Form/ActivityView.php | 4 +-- CRM/Activity/Form/Search.php | 2 +- CRM/Activity/Form/Task.php | 4 +-- CRM/Activity/Form/Task/Batch.php | 1 - CRM/Activity/Form/Task/FileOnCase.php | 3 +- CRM/Activity/Import/Form/MapField.php | 3 -- CRM/Activity/Import/Parser.php | 1 - CRM/Activity/Import/Parser/Activity.php | 3 +- CRM/Activity/Page/AJAX.php | 43 ++++++++++++++++--------- CRM/Activity/Page/Tab.php | 4 +-- CRM/Activity/Selector/Activity.php | 41 +++++++++++++++-------- CRM/Activity/Selector/Search.php | 13 ++++---- 14 files changed, 75 insertions(+), 57 deletions(-) diff --git a/CRM/Activity/Form/Activity.php b/CRM/Activity/Form/Activity.php index 56a02c74da..be1039b2c2 100644 --- a/CRM/Activity/Form/Activity.php +++ b/CRM/Activity/Form/Activity.php @@ -433,7 +433,7 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task { $urlString = 'civicrm/contact/search/advanced'; } elseif ($path == 'civicrm/group/search' - || $path == 'civicrm/contact/search' + || $path == 'civicrm/contact/search' || $path == 'civicrm/contact/search/advanced' || $path == 'civicrm/contact/search/custom' || $path == 'civicrm/group/search') { @@ -677,7 +677,7 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task { CRM_Campaign_BAO_Campaign::accessCampaign() ) { $buildEngagementLevel = TRUE; - $this->addSelect('engagement_level',array('entity' => 'activity')); + $this->addSelect('engagement_level', array('entity' => 'activity')); $this->addRule('engagement_level', ts('Please enter the engagement index as a number (integers only).'), 'positiveInteger' diff --git a/CRM/Activity/Form/ActivityLinks.php b/CRM/Activity/Form/ActivityLinks.php index d039c7a852..21ef6a4c87 100644 --- a/CRM/Activity/Form/ActivityLinks.php +++ b/CRM/Activity/Form/ActivityLinks.php @@ -81,7 +81,7 @@ class CRM_Activity_Form_ActivityLinks extends CRM_Core_Form { list($name, $phone, $doNotSMS) = CRM_Contact_BAO_Contact_Location::getPhoneDetails($contactId, $mobileTypeID); if (!$doNotSMS && $phone) { - $sendSMS = array($SMSId => ts('Send SMS')); + $sendSMS = array($SMSId => ts('Send SMS')); $activityTypes += $sendSMS; } } @@ -96,11 +96,11 @@ class CRM_Activity_Form_ActivityLinks extends CRM_Core_Form { "{$urlParams}{$typeId}", FALSE, NULL, FALSE ); } - elseif ($typeId == $SMSId) { + elseif ($typeId == $SMSId) { $urls[$typeId] = CRM_Utils_System::url('civicrm/activity/sms/add', "{$urlParams}{$typeId}", FALSE, NULL, FALSE ); - } + } elseif ($typeId == $letterTypeId) { $urls[$typeId] = CRM_Utils_System::url('civicrm/activity/pdf/add', "{$urlParams}{$typeId}", FALSE, NULL, FALSE diff --git a/CRM/Activity/Form/ActivityView.php b/CRM/Activity/Form/ActivityView.php index 8ea1495928..2f85b0dce9 100644 --- a/CRM/Activity/Form/ActivityView.php +++ b/CRM/Activity/Form/ActivityView.php @@ -85,10 +85,10 @@ class CRM_Activity_Form_ActivityView extends CRM_Core_Form { $full_open_report = CRM_Mailing_Event_BAO_Opened::getRows( $this->_mailing_id, NULL, FALSE, NULL, NULL, NULL, $cid); - $this->assign('openreport',$full_open_report); + $this->assign('openreport', $full_open_report); $click_thru_report = CRM_Mailing_Event_BAO_TrackableURLOpen::getRows( $this->_mailing_id, NULL, FALSE, NULL, NULL, NULL, NULL, $cid); - $this->assign('clickreport',$click_thru_report); + $this->assign('clickreport', $click_thru_report); } foreach ($defaults as $key => $value) { diff --git a/CRM/Activity/Form/Search.php b/CRM/Activity/Form/Search.php index f444589d6a..5c5b42ee5b 100644 --- a/CRM/Activity/Form/Search.php +++ b/CRM/Activity/Form/Search.php @@ -370,7 +370,7 @@ class CRM_Activity_Form_Search extends CRM_Core_Form_Search { if ($dateHigh) { // Activity date time assumes midnight at the beginning of the date // This sets it to almost midnight at the end of the date - /* if ($dateHigh <= 99999999) { + /* if ($dateHigh <= 99999999) { $dateHigh = 1000000 * $dateHigh + 235959; } */ $dateHigh = date('m/d/Y', strtotime($dateHigh)); diff --git a/CRM/Activity/Form/Task.php b/CRM/Activity/Form/Task.php index f9aea5225d..cc3efb0e7f 100644 --- a/CRM/Activity/Form/Task.php +++ b/CRM/Activity/Form/Task.php @@ -117,10 +117,10 @@ class CRM_Activity_Form_Task extends CRM_Core_Form { while ($result->fetch()) { if(!empty($result->activity_id)) { - $ids[] = $result->activity_id; + $ids[] = $result->activity_id; + } } } - } if (!empty($ids)) { $form->_componentClause = ' civicrm_activity.id IN ( ' . implode(',', $ids) . ' ) '; diff --git a/CRM/Activity/Form/Task/Batch.php b/CRM/Activity/Form/Task/Batch.php index e28a5acd3f..0a3f41f1cb 100755 --- a/CRM/Activity/Form/Task/Batch.php +++ b/CRM/Activity/Form/Task/Batch.php @@ -148,7 +148,6 @@ class CRM_Activity_Form_Task_Batch extends CRM_Activity_Form_Task { ) ); - $this->assign('profileTitle', $this->_title); $this->assign('componentIds', $this->_activityHolderIds); $fileFieldExists = FALSE; diff --git a/CRM/Activity/Form/Task/FileOnCase.php b/CRM/Activity/Form/Task/FileOnCase.php index dc1b4e3916..7d712d593b 100644 --- a/CRM/Activity/Form/Task/FileOnCase.php +++ b/CRM/Activity/Form/Task/FileOnCase.php @@ -87,7 +87,8 @@ class CRM_Activity_Form_Task_FileOnCase extends CRM_Activity_Form_Task { * * @return void */ - public function addRules() {} + public function addRules() { + } /** * Process the form after the input has been submitted and validated diff --git a/CRM/Activity/Import/Form/MapField.php b/CRM/Activity/Import/Form/MapField.php index e8b38d7128..3916e36a9c 100644 --- a/CRM/Activity/Import/Form/MapField.php +++ b/CRM/Activity/Import/Form/MapField.php @@ -133,7 +133,6 @@ class CRM_Activity_Import_Form_MapField extends CRM_Import_Form_MapField { $dataPatterns = $this->get('dataPatterns'); $hasLocationTypes = $this->get('fieldTypes'); - /* Initialize all field usages to false */ foreach ($mapperKeys as $key) { @@ -150,7 +149,6 @@ class CRM_Activity_Import_Form_MapField extends CRM_Import_Form_MapField { //used to warn for mismatch column count or mismatch mapping $warning = 0; - for ($i = 0; $i < $this->_columnCount; $i++) { $sel = &$this->addElement('hierselect', "mapper[$i]", ts('Mapper for Field %1', array(1 => $i)), NULL); $jsSet = FALSE; @@ -467,7 +465,6 @@ class CRM_Activity_Import_Form_MapField extends CRM_Import_Form_MapField { $this->set('savedMapping', $saveMappingFields->mapping_id); } - $parser = new CRM_Activity_Import_Parser_Activity($mapperKeysMain, $mapperLocType, $mapperPhoneType); $parser->run($fileName, $seperator, $mapper, $skipColumnHeader, CRM_Import_Parser::MODE_PREVIEW diff --git a/CRM/Activity/Import/Parser.php b/CRM/Activity/Import/Parser.php index c7af7217c9..bc16b760b5 100644 --- a/CRM/Activity/Import/Parser.php +++ b/CRM/Activity/Import/Parser.php @@ -229,7 +229,6 @@ abstract class CRM_Activity_Import_Parser extends CRM_Import_Parser { fclose($fd); - if ($mode == self::MODE_PREVIEW || $mode == self::MODE_IMPORT) { $customHeaders = $mapper; diff --git a/CRM/Activity/Import/Parser/Activity.php b/CRM/Activity/Import/Parser/Activity.php index 4aa252125a..9748f71f1d 100644 --- a/CRM/Activity/Import/Parser/Activity.php +++ b/CRM/Activity/Import/Parser/Activity.php @@ -397,6 +397,7 @@ class CRM_Activity_Import_Parser_Activity extends CRM_Activity_Import_Parser { * * @return void */ - public function fini() {} + public function fini() { + } } diff --git a/CRM/Activity/Page/AJAX.php b/CRM/Activity/Page/AJAX.php index 10cdf19787..423b72fed7 100644 --- a/CRM/Activity/Page/AJAX.php +++ b/CRM/Activity/Page/AJAX.php @@ -43,8 +43,12 @@ class CRM_Activity_Page_AJAX { $context = CRM_Utils_Type::escape(CRM_Utils_Array::value('context', $_GET), 'String'); $sortMapper = array( - 0 => 'display_date', 1 => 'ca.subject', 2 => 'ca.activity_type_id', - 3 => 'acc.sort_name', 4 => 'cc.sort_name', 5 => 'ca.status_id', + 0 => 'display_date', + 1 => 'ca.subject', + 2 => 'ca.activity_type_id', + 3 => 'acc.sort_name', + 4 => 'cc.sort_name', + 5 => 'ca.status_id', ); $sEcho = CRM_Utils_Type::escape($_REQUEST['sEcho'], 'Integer'); @@ -73,7 +77,9 @@ class CRM_Activity_Page_AJAX { public static function getCaseGlobalRelationships() { $sortMapper = array( - 0 => 'sort_name', 1 => 'phone', 2 => 'email', + 0 => 'sort_name', + 1 => 'phone', + 2 => 'email', ); $sEcho = CRM_Utils_Type::escape($_REQUEST['sEcho'], 'Integer'); @@ -109,7 +115,10 @@ class CRM_Activity_Page_AJAX { $contactID = CRM_Utils_Type::escape($_GET['cid'], 'Integer'); $sortMapper = array( - 0 => 'relation', 1 => 'name', 2 => 'phone', 3 => 'email' + 0 => 'relation', + 1 => 'name', + 2 => 'phone', + 3 => 'email' ); $sEcho = CRM_Utils_Type::escape($_REQUEST['sEcho'], 'Integer'); @@ -170,7 +179,11 @@ class CRM_Activity_Page_AJAX { $contactID = CRM_Utils_Type::escape($_GET['cid'], 'Integer'); $sortMapper = array( - 0 => 'relation', 1 => 'name', 2 => 'phone', 3 => 'email', 4 => 'actions' + 0 => 'relation', + 1 => 'name', + 2 => 'phone', + 3 => 'email', + 4 => 'actions' ); $sEcho = CRM_Utils_Type::escape($_REQUEST['sEcho'], 'Integer'); @@ -269,22 +282,22 @@ class CRM_Activity_Page_AJAX { $contactType = empty($row['relation_type']) ? '' : (string) CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_RelationshipType', $row['relation_type'], 'contact_type_b'); $contactType = $contactType == 'Contact' ? '' : $contactType; switch($row['source']) { - case 'caseRel': - $row['actions'] = + case 'caseRel': + $row['actions'] = ''. ''. ''. ''. ''. ''; - break; + break; - case 'caseRoles': - $row['actions'] = + case 'caseRoles': + $row['actions'] = ''. ''. ''; - break; + break; } } $idx++; @@ -491,10 +504,8 @@ class CRM_Activity_Page_AJAX { } $activityFilter = array( - 'activity_type_filter_id' => empty($params['activity_type_id']) ? '' : - CRM_Utils_Type::escape($params['activity_type_id'], 'Integer'), - 'activity_type_exclude_filter_id' => empty($params['activity_type_exclude_id']) ? '' : - CRM_Utils_Type::escape($params['activity_type_exclude_id'], 'Integer'), + 'activity_type_filter_id' => empty($params['activity_type_id']) ? '' : CRM_Utils_Type::escape($params['activity_type_id'], 'Integer'), + 'activity_type_exclude_filter_id' => empty($params['activity_type_exclude_id']) ? '' : CRM_Utils_Type::escape($params['activity_type_exclude_id'], 'Integer'), ); CRM_Core_BAO_Setting::setItem( @@ -511,7 +522,7 @@ class CRM_Activity_Page_AJAX { $selectorElements = array( 'activity_type', 'subject', 'source_contact', 'target_contact', 'assignee_contact', - 'activity_date', 'status','links', 'class', + 'activity_date', 'status', 'links', 'class', ); echo CRM_Utils_JSON::encodeDataTableSelector($activities, $sEcho, $iTotal, $iFilteredTotal, $selectorElements); diff --git a/CRM/Activity/Page/Tab.php b/CRM/Activity/Page/Tab.php index 4917cafa4e..c0b9075768 100644 --- a/CRM/Activity/Page/Tab.php +++ b/CRM/Activity/Page/Tab.php @@ -84,7 +84,6 @@ class CRM_Activity_Page_Tab extends CRM_Core_Page { 'name' ); - switch ($activityTypeId) { case $emailTypeValue: $wrapper = new CRM_Utils_Wrapper(); @@ -190,8 +189,7 @@ class CRM_Activity_Page_Tab extends CRM_Core_Page { } // route behaviour of contact/view/activity based on action defined - if ($this->_action & - (CRM_Core_Action::UPDATE | CRM_Core_Action::ADD | CRM_Core_Action::VIEW) + if ($this->_action & (CRM_Core_Action::UPDATE | CRM_Core_Action::ADD | CRM_Core_Action::VIEW) ) { $this->edit(); $activityTypeId = CRM_Utils_Request::retrieve('atype', 'Positive', $this); diff --git a/CRM/Activity/Selector/Activity.php b/CRM/Activity/Selector/Activity.php index 75ee5126f2..596c7357b0 100644 --- a/CRM/Activity/Selector/Activity.php +++ b/CRM/Activity/Selector/Activity.php @@ -79,8 +79,8 @@ class CRM_Activity_Selector_Activity extends CRM_Core_Selector_Base implements C */ function __construct($contactId, $permission, - $admin = FALSE, - $context = 'activity', + $admin = FALSE, + $context = 'activity', $activityTypeIDs = NULL) { $this->_contactId = $contactId; $this->_permission = $permission; @@ -110,11 +110,11 @@ class CRM_Activity_Selector_Activity extends CRM_Core_Selector_Base implements C * @return array */ public static function actionLinks($activityTypeId, - $sourceRecordId = NULL, + $sourceRecordId = NULL, $accessMailingReport = FALSE, - $activityId = NULL, - $key = NULL, - $compContext = NULL) { + $activityId = NULL, + $key = NULL, + $compContext = NULL) { static $activityActTypes = NULL; //CRM-14277 added addtitional param to handle activity search $extraParams = "&searchContext=activity"; @@ -214,7 +214,9 @@ class CRM_Activity_Selector_Activity extends CRM_Core_Selector_Base implements C $actionLinks = array(); if ($showView) { - $actionLinks += array(CRM_Core_Action::VIEW => array('name' => ts('View'), + $actionLinks += array(CRM_Core_Action:: + VIEW => array( + 'name' => ts('View'), 'url' => $url, 'qs' => $qsView, 'title' => ts('View Activity'), @@ -230,7 +232,9 @@ class CRM_Activity_Selector_Activity extends CRM_Core_Selector_Base implements C $updateUrl = 'civicrm/activity/pdf/add'; } if ( CRM_Activity_BAO_Activity::checkPermission($activityId, CRM_Core_Action::UPDATE) ) { - $actionLinks += array(CRM_Core_Action::UPDATE => array('name' => ts('Edit'), + $actionLinks += array(CRM_Core_Action:: + UPDATE => array( + 'name' => ts('Edit'), 'url' => $updateUrl, 'qs' => $qsUpdate, 'title' => ts('Update Activity'), @@ -242,7 +246,9 @@ class CRM_Activity_Selector_Activity extends CRM_Core_Selector_Base implements C $activityTypeName && CRM_Case_BAO_Case::checkPermission($activityId, 'File On Case', $activityTypeId) ) { - $actionLinks += array(CRM_Core_Action::ADD => array('name' => ts('File on Case'), + $actionLinks += array(CRM_Core_Action:: + ADD => array( + 'name' => ts('File on Case'), 'url' => '#', 'extra' => 'onclick="javascript:fileOnCase( \'file\', \'%%id%%\', null, this ); return false;"', 'title' => ts('File on Case'), @@ -253,7 +259,9 @@ class CRM_Activity_Selector_Activity extends CRM_Core_Selector_Base implements C if (!isset($delUrl) || !$delUrl) { $delUrl = $url; } - $actionLinks += array(CRM_Core_Action::DELETE => array('name' => ts('Delete'), + $actionLinks += array(CRM_Core_Action:: + DELETE => array( + 'name' => ts('Delete'), 'url' => $delUrl, 'qs' => $qsDelete, 'title' => ts('Delete Activity'), @@ -261,7 +269,9 @@ class CRM_Activity_Selector_Activity extends CRM_Core_Selector_Base implements C } if ($accessMailingReport) { - $actionLinks += array(CRM_Core_Action::BROWSE => array('name' => ts('Mailing Report'), + $actionLinks += array(CRM_Core_Action:: + BROWSE => array( + 'name' => ts('Mailing Report'), 'url' => 'civicrm/mailing/report', 'qs' => "mid={$sourceRecordId}&reset=1&cid=%%cid%%&context=activitySelector", 'title' => ts('View Mailing Report'), @@ -489,15 +499,18 @@ class CRM_Activity_Selector_Activity extends CRM_Core_Selector_Base implements C private static function &_getColumnHeaders() { if (!isset(self::$_columnHeaders)) { self::$_columnHeaders = array( - array('name' => ts('Type'), + array( + 'name' => ts('Type'), 'sort' => 'activity_type', 'direction' => CRM_Utils_Sort::DONTCARE, ), - array('name' => ts('Subject'), + array( + 'name' => ts('Subject'), 'sort' => 'subject', 'direction' => CRM_Utils_Sort::DONTCARE, ), - array('name' => ts('Added By'), + array( + 'name' => ts('Added By'), 'sort' => 'source_contact_name', 'direction' => CRM_Utils_Sort::DONTCARE, ), diff --git a/CRM/Activity/Selector/Search.php b/CRM/Activity/Selector/Search.php index ba99110877..c46c439b46 100644 --- a/CRM/Activity/Selector/Search.php +++ b/CRM/Activity/Selector/Search.php @@ -158,12 +158,12 @@ class CRM_Activity_Selector_Search extends CRM_Core_Selector_Base implements CRM @access public */ function __construct(&$queryParams, - $action = CRM_Core_Action::NONE, + $action = CRM_Core_Action::NONE, $activityClause = NULL, - $single = FALSE, - $limit = NULL, - $context = 'search', - $compContext = NULL + $single = FALSE, + $limit = NULL, + $context = 'search', + $compContext = NULL ) { // submitted form values $this->_queryParams = &$queryParams; @@ -287,8 +287,7 @@ class CRM_Activity_Selector_Search extends CRM_Core_Selector_Base implements CRM if ($this->_context == 'search') { $row['checkbox'] = CRM_Core_Form::CB_PREFIX . $result->activity_id; } - $row['contact_type'] = CRM_Contact_BAO_Contact_Utils::getImage($result->contact_sub_type ? - $result->contact_sub_type : $result->contact_type, FALSE, $result->contact_id + $row['contact_type'] = CRM_Contact_BAO_Contact_Utils::getImage($result->contact_sub_type ? $result->contact_sub_type : $result->contact_type, FALSE, $result->contact_id ); $accessMailingReport = FALSE; $activityTypeId = $row['activity_type_id']; -- 2.25.1