From: Tim Otten Date: Tue, 6 Jan 2015 21:09:19 +0000 (-0800) Subject: INFRA-132 - CRM/Campaign - phpcbf X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=94880218c2e1099b0594862813a0e8ba8fe30469;p=civicrm-core.git INFRA-132 - CRM/Campaign - phpcbf --- diff --git a/CRM/Campaign/Form/SurveyType.php b/CRM/Campaign/Form/SurveyType.php index 36a1409b1d..48c116e2a1 100644 --- a/CRM/Campaign/Form/SurveyType.php +++ b/CRM/Campaign/Form/SurveyType.php @@ -133,7 +133,6 @@ class CRM_Campaign_Form_SurveyType extends CRM_Admin_Form { CRM_Core_DAO::getAttribute('CRM_Core_DAO_OptionValue', 'description') ); - $this->add('checkbox', 'is_active', ts('Enabled?')); if ($this->_action == CRM_Core_Action::UPDATE && diff --git a/CRM/Campaign/Form/Task/Interview.php b/CRM/Campaign/Form/Task/Interview.php index c081d19555..664c6d5a2b 100755 --- a/CRM/Campaign/Form/Task/Interview.php +++ b/CRM/Campaign/Form/Task/Interview.php @@ -100,12 +100,12 @@ class CRM_Campaign_Form_Task_Interview extends CRM_Campaign_Form_Task { CRM_Campaign_BAO_Survey::retrieve($params, $this->_surveyDetails); } - $orderClause = false; + $orderClause = FALSE; $buttonName = $this->controller->getButtonName(); if ( $buttonName == '_qf_Interview_submit_orderBy' && !empty($_POST['order_bys'])) { $orderByParams = CRM_Utils_Array::value('order_bys', $_POST); } - elseif ( CRM_Core_OptionGroup::getValue('activity_type','WalkList') == $this->_surveyDetails['activity_type_id'] ) { + elseif ( CRM_Core_OptionGroup::getValue('activity_type', 'WalkList') == $this->_surveyDetails['activity_type_id'] ) { $orderByParams = array( 1 => array( @@ -156,7 +156,6 @@ WHERE {$clause} } } - //get the contact read only fields to display. $readOnlyFields = array_merge(array( 'contact_type' => '', @@ -229,7 +228,7 @@ WHERE {$clause} $this->assign('surveyValues', $this->_surveyValues); $result = CRM_Campaign_BAO_Survey::getReportID($this->_surveyId); - $this->assign("instanceId",$result); + $this->assign("instanceId", $result); //get the survey result options. $this->_resultOptions = $this->get('resultOptions'); @@ -257,7 +256,8 @@ WHERE {$clause} } public function validateIds() { - $required = array('surveyId' => ts('Could not find Survey.'), + $required = array( + 'surveyId' => ts('Could not find Survey.'), 'interviewerId' => ts('Could not find Interviewer.'), 'contactIds' => ts('No respondents are currently reserved for you to interview.'), 'resultOptions' => ts('Oops. It looks like there is no response option configured.'), @@ -287,7 +287,8 @@ WHERE {$clause} $this->assign('surveyTypeId', $this->_surveyTypeId); $options = - array('' => ' - none - ', + array( + '' => ' - none - ', 'civicrm_address.street_name' => 'Street Name', 'civicrm_address.street_number%2' => 'Odd / Even Street Number', 'civicrm_address.street_number' => 'Street Number', @@ -338,7 +339,8 @@ WHERE {$clause} } $buttons = array( - array('type' => 'cancel', + array( + 'type' => 'cancel', 'name' => ts('Done'), 'subName' => 'interview', 'isDefault' => TRUE, @@ -398,7 +400,7 @@ WHERE {$clause} } } - if ( CRM_Core_OptionGroup::getValue('activity_type','WalkList') == $this->_surveyDetails['activity_type_id'] ) { + if ( CRM_Core_OptionGroup::getValue('activity_type', 'WalkList') == $this->_surveyDetails['activity_type_id'] ) { $defaults['order_bys'] = array( 1 => array( @@ -595,7 +597,8 @@ WHERE {$clause} $statusIds ); $this->_contactIds = array(); - foreach ($surveyActivities as $val) $this->_contactIds[$val['voter_id']] = $val['voter_id']; + foreach ($surveyActivities as $val) { $this->_contactIds[$val['voter_id']] = $val['voter_id']; + } $this->set('contactIds', $this->_contactIds); } } diff --git a/CRM/Campaign/Form/Task/Reserve.php b/CRM/Campaign/Form/Task/Reserve.php index 7326c554e4..1775bac2d4 100644 --- a/CRM/Campaign/Form/Task/Reserve.php +++ b/CRM/Campaign/Form/Task/Reserve.php @@ -173,7 +173,8 @@ class CRM_Campaign_Form_Task_Reserve extends CRM_Campaign_Form_Task { $this->assign('hasExistingGroups', $hasExistingGroups); $buttons = array( - array('type' => 'done', + array( + 'type' => 'done', 'name' => ts('Reserve'), 'subName' => 'reserve', 'isDefault' => TRUE, @@ -217,7 +218,8 @@ class CRM_Campaign_Form_Task_Reserve extends CRM_Campaign_Form_Task { $title = trim($fields['newGroupName']); $name = CRM_Utils_String::titleToVar($title); $query = 'select count(*) from civicrm_group where name like %1 OR title like %2'; - $grpCnt = CRM_Core_DAO::singleValueQuery($query, array(1 => array($name, 'String'), + $grpCnt = CRM_Core_DAO::singleValueQuery($query, array( + 1 => array($name, 'String'), 2 => array($title, 'String'), )); if ($grpCnt) { @@ -247,7 +249,8 @@ class CRM_Campaign_Form_Task_Reserve extends CRM_Campaign_Form_Task { foreach ($this->_contactIds as $cid) { $subject = ts('%1', array(1 => $this->_surveyDetails['title'])) . ' - ' . ts('Respondent Reservation'); $session = CRM_Core_Session::singleton(); - $activityParams = array('source_contact_id' => $session->get('userID'), + $activityParams = array( + 'source_contact_id' => $session->get('userID'), 'assignee_contact_id' => array($this->_interviewerId), 'target_contact_id' => array($cid), 'source_record_id' => $this->_surveyId, diff --git a/CRM/Campaign/Form/Task/Result.php b/CRM/Campaign/Form/Task/Result.php index 3572d757c0..4a70eeeaea 100755 --- a/CRM/Campaign/Form/Task/Result.php +++ b/CRM/Campaign/Form/Task/Result.php @@ -45,7 +45,8 @@ class CRM_Campaign_Form_Task_Result extends CRM_Campaign_Form_Task { * * @return void */ - public function preProcess() {} + public function preProcess() { + } /** * Build the form object diff --git a/CRM/Campaign/Info.php b/CRM/Campaign/Info.php index cb34e25281..2f1162f484 100644 --- a/CRM/Campaign/Info.php +++ b/CRM/Campaign/Info.php @@ -126,7 +126,8 @@ class CRM_Campaign_Info extends CRM_Core_Component_Info { CRM_Core_Permission::check('administer CiviCampaign') ) { $shortCuts = array_merge($shortCuts, array( - array('path' => 'civicrm/campaign/add', + array( + 'path' => 'civicrm/campaign/add', 'query' => "reset=1&action=add", 'ref' => 'new-campaign', 'title' => ts('Campaign'), diff --git a/CRM/Campaign/Page/AJAX.php b/CRM/Campaign/Page/AJAX.php index b57a43431c..449610aed4 100644 --- a/CRM/Campaign/Page/AJAX.php +++ b/CRM/Campaign/Page/AJAX.php @@ -191,7 +191,8 @@ class CRM_Campaign_Page_AJAX { $groups = CRM_Utils_Array::value('group', $params); if ($campaignId && CRM_Utils_System::isNull($groups)) { $campaignGroups = CRM_Campaign_BAO_Campaign::getCampaignGroups($campaignId); - foreach ($campaignGroups as $id => $group) $params['group'][$id] = 1; + foreach ($campaignGroups as $id => $group) { $params['group'][$id] = 1; + } } //apply filter of survey contact type for search. @@ -226,7 +227,8 @@ class CRM_Campaign_Page_AJAX { // get the data table params. $dataTableParams = array( - 'sEcho' => array('name' => 'sEcho', + 'sEcho' => array( + 'name' => 'sEcho', 'type' => 'Integer', 'default' => 0, ), @@ -255,7 +257,8 @@ class CRM_Campaign_Page_AJAX { $$pName = $pValues['default']; if (!empty($_POST[$pValues['name']])) { $$pName = CRM_Utils_Type::escape($_POST[$pValues['name']], $pValues['type']); - if ($pName == 'sort')$$pName = $selectorCols[$$pName]; + if ($pName == 'sort') { $$pName = $selectorCols[$$pName]; + } } } @@ -308,8 +311,7 @@ class CRM_Campaign_Page_AJAX { ); while ($result->fetch()) { $contactID = $result->contact_id; - $typeImage = CRM_Contact_BAO_Contact_Utils::getImage($result->contact_sub_type ? - $result->contact_sub_type : $result->contact_type, + $typeImage = CRM_Contact_BAO_Contact_Utils::getImage($result->contact_sub_type ? $result->contact_sub_type : $result->contact_type, FALSE, $result->contact_id ); @@ -483,7 +485,8 @@ class CRM_Campaign_Page_AJAX { $currentCampaigns = CRM_Campaign_BAO_Campaign::getCampaigns(); $campaigns = CRM_Campaign_BAO_Campaign::getCampaigns(NULL, NULL, TRUE, FALSE, TRUE); $options = array( - array('value' => '', + array( + 'value' => '', 'title' => ts('- select -'), )); foreach ($campaigns as $value => $title) { @@ -528,7 +531,8 @@ class CRM_Campaign_Page_AJAX { $campGroups = CRM_Core_PseudoConstant::group(); } $groups = array( - array('value' => '', + array( + 'value' => '', 'title' => ts('- select -'), )); foreach ($campGroups as $grpId => $title) { @@ -579,7 +583,8 @@ class CRM_Campaign_Page_AJAX { // get the data table params. $dataTableParams = array( - 'sEcho' => array('name' => 'sEcho', + 'sEcho' => array( + 'name' => 'sEcho', 'type' => 'Integer', 'default' => 0, ), @@ -677,7 +682,8 @@ class CRM_Campaign_Page_AJAX { // get the data table params. $dataTableParams = array( - 'sEcho' => array('name' => 'sEcho', + 'sEcho' => array( + 'name' => 'sEcho', 'type' => 'Integer', 'default' => 0, ), @@ -770,7 +776,8 @@ class CRM_Campaign_Page_AJAX { // get the data table params. $dataTableParams = array( - 'sEcho' => array('name' => 'sEcho', + 'sEcho' => array( + 'name' => 'sEcho', 'type' => 'Integer', 'default' => 0, ), diff --git a/CRM/Campaign/Page/DashBoard.php b/CRM/Campaign/Page/DashBoard.php index 46b0c41a78..ac5f285983 100644 --- a/CRM/Campaign/Page/DashBoard.php +++ b/CRM/Campaign/Page/DashBoard.php @@ -356,7 +356,7 @@ class CRM_Campaign_Page_DashBoard extends CRM_Core_Page { } if ($reportID = CRM_Campaign_BAO_Survey::getReportID($sid)) { - $url = CRM_Utils_System::url("civicrm/report/instance/{$reportID}",'reset=1'); + $url = CRM_Utils_System::url("civicrm/report/instance/{$reportID}", 'reset=1'); $surveysData[$sid]['title'] = "{$surveysData[$sid]['title']}"; } } @@ -465,7 +465,8 @@ class CRM_Campaign_Page_DashBoard extends CRM_Core_Page { } CRM_Core_Resources::singleton() ->addScriptFile('civicrm', 'templates/CRM/common/TabHeader.js', 1, 'html-header') - ->addSetting(array('tabSettings' => array( + ->addSetting(array( + 'tabSettings' => array( 'active' => strtolower(CRM_Utils_Array::value('subPage', $_GET, 'campaign')), ))); } diff --git a/CRM/Campaign/Page/Petition/Confirm.php b/CRM/Campaign/Page/Petition/Confirm.php index d356dca8ce..d42b8e0fad 100644 --- a/CRM/Campaign/Page/Petition/Confirm.php +++ b/CRM/Campaign/Page/Petition/Confirm.php @@ -39,7 +39,7 @@ class CRM_Campaign_Page_Petition_Confirm extends CRM_Core_Page { */ public function run() { CRM_Utils_System::addHTMLHead(''); - + $contact_id = CRM_Utils_Request::retrieve('cid', 'Integer', CRM_Core_DAO::$_nullObject); $subscribe_id = CRM_Utils_Request::retrieve('sid', 'Integer', CRM_Core_DAO::$_nullObject); $hash = CRM_Utils_Request::retrieve('h', 'String', CRM_Core_DAO::$_nullObject); diff --git a/CRM/Campaign/Page/Petition/ThankYou.php b/CRM/Campaign/Page/Petition/ThankYou.php index c209c0ece1..1c4b1a0dbe 100644 --- a/CRM/Campaign/Page/Petition/ThankYou.php +++ b/CRM/Campaign/Page/Petition/ThankYou.php @@ -59,7 +59,6 @@ class CRM_Campaign_Page_Petition_ThankYou extends CRM_Core_Page { * 2 = send a confirmation request email */ - return parent::run(); } } diff --git a/CRM/Campaign/Page/Vote.php b/CRM/Campaign/Page/Vote.php index 712bb816df..9550d2b1a9 100644 --- a/CRM/Campaign/Page/Vote.php +++ b/CRM/Campaign/Page/Vote.php @@ -72,7 +72,8 @@ class CRM_Campaign_Page_Vote extends CRM_Core_Page { } public function browse() { - $this->_tabs = array('reserve' => ts('Reserve Respondents'), + $this->_tabs = array( + 'reserve' => ts('Reserve Respondents'), 'interview' => ts('Interview Respondents'), ); @@ -94,7 +95,8 @@ class CRM_Campaign_Page_Vote extends CRM_Core_Page { CRM_Core_Resources::singleton() ->addScriptFile('civicrm', 'templates/CRM/common/TabHeader.js', 1, 'html-header') - ->addSetting(array('tabSettings' => array( + ->addSetting(array( + 'tabSettings' => array( 'active' => strtolower(CRM_Utils_Array::value('subPage', $_GET, 'reserve')), ))); } diff --git a/CRM/Campaign/PseudoConstant.php b/CRM/Campaign/PseudoConstant.php index f0076e40df..d3ac40c872 100755 --- a/CRM/Campaign/PseudoConstant.php +++ b/CRM/Campaign/PseudoConstant.php @@ -157,8 +157,8 @@ class CRM_Campaign_PseudoConstant extends CRM_Core_PseudoConstant { * @param bool|string $name pseudoconstant to be flushed */ public static function flush($name = 'cache') { - if (isset(self::$$name)) { + if (isset(self::$$name)) { self::$$name = NULL; - } + } } } diff --git a/CRM/Campaign/Selector/Search.php b/CRM/Campaign/Selector/Search.php index e967a56a28..1c0a1120df 100755 --- a/CRM/Campaign/Selector/Search.php +++ b/CRM/Campaign/Selector/Search.php @@ -150,11 +150,11 @@ class CRM_Campaign_Selector_Search extends CRM_Core_Selector_Base implements CRM @access public */ function __construct(&$queryParams, - $action = CRM_Core_Action::NONE, + $action = CRM_Core_Action::NONE, $surveyClause = NULL, - $single = FALSE, - $limit = NULL, - $context = 'search' + $single = FALSE, + $limit = NULL, + $context = 'search' ) { // submitted form values $this->_queryParams = &$queryParams; @@ -249,11 +249,10 @@ class CRM_Campaign_Selector_Search extends CRM_Core_Selector_Base implements CRM $this->_campaignFromClause ); - // process the result of the query $rows = array(); - While ($result->fetch()) { + while ($result->fetch()) { $this->_query->convertToPseudoNames($result); $row = array(); // the columns we are interested in @@ -331,24 +330,30 @@ FROM {$from} if (!$this->_single) { $contactDetails = array( - array('name' => ts('Contact Name'), + array( + 'name' => ts('Contact Name'), 'sort' => 'sort_name', 'direction' => CRM_Utils_Sort::ASCENDING, ), - array('name' => ts('Street Number'), + array( + 'name' => ts('Street Number'), 'sort' => 'street_number', ), - array('name' => ts('Street Name'), + array( + 'name' => ts('Street Name'), 'sort' => 'street_name', ), array('name' => ts('Street Address')), - array('name' => ts('City'), + array( + 'name' => ts('City'), 'sort' => 'city', ), - array('name' => ts('Postal Code'), + array( + 'name' => ts('Postal Code'), 'sort' => 'postal_code', ), - array('name' => ts('State'), + array( + 'name' => ts('State'), 'sort' => 'state_province_name', ), array('name' => ts('Country')), diff --git a/CRM/Campaign/Task.php b/CRM/Campaign/Task.php index db4f7f5635..a8a46b6cef 100755 --- a/CRM/Campaign/Task.php +++ b/CRM/Campaign/Task.php @@ -67,7 +67,8 @@ class CRM_Campaign_Task { */ public static function &tasks() { if (!(self::$_tasks)) { - self::$_tasks = array(1 => array( + self::$_tasks = array( + 1 => array( 'title' => ts('Record Respondents Interview'), 'class' => array( 'CRM_Campaign_Form_Task_Interview',