INFRA-132 - CRM/Campaign - phpcbf
authorTim Otten <totten@civicrm.org>
Tue, 6 Jan 2015 21:09:19 +0000 (13:09 -0800)
committerTim Otten <totten@civicrm.org>
Tue, 6 Jan 2015 23:04:26 +0000 (15:04 -0800)
13 files changed:
CRM/Campaign/Form/SurveyType.php
CRM/Campaign/Form/Task/Interview.php
CRM/Campaign/Form/Task/Reserve.php
CRM/Campaign/Form/Task/Result.php
CRM/Campaign/Info.php
CRM/Campaign/Page/AJAX.php
CRM/Campaign/Page/DashBoard.php
CRM/Campaign/Page/Petition/Confirm.php
CRM/Campaign/Page/Petition/ThankYou.php
CRM/Campaign/Page/Vote.php
CRM/Campaign/PseudoConstant.php
CRM/Campaign/Selector/Search.php
CRM/Campaign/Task.php

index 36a1409b1d9a68d9de8a4d89528082d4bacd884d..48c116e2a16198f772afde47536c29192ebddf1a 100644 (file)
@@ -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 &&
index c081d195554c067c5f2f1c3e6ebba7dfd707fa8b..664c6d5a2b70319b678cfb4e8b72c4534011e122 100755 (executable)
@@ -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);
     }
   }
index 7326c554e43af53000260945498be1e8263655d4..1775bac2d4b51e652709e1bcea0aa2824b190469 100644 (file)
@@ -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,
index 3572d757c09539b9a99ef7b3a61e95d7fb30ce72..4a70eeeaea34de2c8b9013b3f23d1a1786e775c3 100755 (executable)
@@ -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
index cb34e25281c06855d19a00efb80f1b54d01d9860..2f1162f4841a5294327b4ce84bfbf24f61b56d26 100644 (file)
@@ -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'),
index b57a43431c071c060befa87b37f2d6b7ae10752b..449610aed4cca3b71936e7765439bb3afc5bcda7 100644 (file)
@@ -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,
       ),
index 46b0c41a78ba0964a66172bcb8ff2a8f51c601bb..ac5f28598398a9379d30a1521b33b4c74d83803a 100644 (file)
@@ -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'] = "<a href='{$url}' title='View Survey Report'>{$surveysData[$sid]['title']}</a>";
         }
       }
@@ -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')),
       )));
   }
index d356dca8ceead3b376945791babcd31382ae0a7a..d42b8e0fad77a049c3ef63f34cd9b5d56c6204e2 100644 (file)
@@ -39,7 +39,7 @@ class CRM_Campaign_Page_Petition_Confirm extends CRM_Core_Page {
    */
   public function run() {
     CRM_Utils_System::addHTMLHead('<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">');
-    
+
     $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);
index c209c0ece1d1c9dd4a8a769a4323a6b6ad689ed2..1c4b1a0dbeced4753deb186fa81a9b18c74a5daf 100644 (file)
@@ -59,7 +59,6 @@ class CRM_Campaign_Page_Petition_ThankYou extends CRM_Core_Page {
        * 2 = send a confirmation request email
        */
 
-
     return parent::run();
   }
 }
index 712bb816df640e39638fd365c5c9c0aca6c19323..9550d2b1a90014f722c1112ab08b231c28685429 100644 (file)
@@ -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')),
       )));
   }
index f0076e40df84f66b1002b0bb87648882015b8024..d3ac40c872d97e8db6434f1c89acee3ca1d354ec 100755 (executable)
@@ -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;
-    }
+   }
   }
 }
index e967a56a2848e8959796c8b9573193d36f06f379..1c0a1120dfd14d09095880cdc2456fd6ca53b755 100755 (executable)
@@ -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')),
index db4f7f563587154f7ed7d97a5f4536bc53f41ac0..a8a46b6cef4bba281b1fc4f073ee37958c3eda8b 100755 (executable)
@@ -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',