Merge pull request #4893 from colemanw/INFRA-132
[civicrm-core.git] / CRM / Campaign / Form / Task / Interview.php
index e8880a9c5cc53e533472bebdb0610a9cefe10cf2..617b887863d8061139b6e9e5900f3aca6ebc3825 100755 (executable)
@@ -47,7 +47,6 @@ class CRM_Campaign_Form_Task_Interview extends CRM_Campaign_Form_Task {
 
   /**
    * Variable to store redirect path
-   *
    */
   private $_userContext;
 
@@ -95,17 +94,17 @@ class CRM_Campaign_Form_Task_Interview extends CRM_Campaign_Form_Task {
       $this->_interviewerId = CRM_Utils_Array::value('survey_interviewer_id', $this->get('formValues'));
     }
 
-    if ( $this->_surveyId ) {
+    if ($this->_surveyId) {
       $params = array('id' => $this->_surveyId);
       CRM_Campaign_BAO_Survey::retrieve($params, $this->_surveyDetails);
     }
 
     $orderClause = FALSE;
     $buttonName  = $this->controller->getButtonName();
-    if ( $buttonName == '_qf_Interview_submit_orderBy' && !empty($_POST['order_bys'])) {
+    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(
@@ -128,13 +127,13 @@ class CRM_Campaign_Form_Task_Interview extends CRM_Campaign_Form_Task {
     }
 
     $orderBy = array();
-    if ( !empty($orderByParams) ) {
-      foreach ( $orderByParams as $key => $val ) {
+    if (!empty($orderByParams)) {
+      foreach ($orderByParams as $key => $val) {
         if (!empty($val['column'])) {
           $orderBy[] = "{$val['column']} {$val['order']}";
         }
       }
-      if ( !empty($orderBy) ) {
+      if (!empty($orderBy)) {
         $orderClause = "ORDER BY " . implode(', ', $orderBy);
       }
     }
@@ -400,7 +399,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(
@@ -553,7 +552,7 @@ WHERE {$clause}
       'source_contact_id' => 'source_contact',
       'location' => 'activity_location',
       'campaign_id' => 'activity_campaign_id',
-      'duration' => 'activity_duration'
+      'duration' => 'activity_duration',
     );
     foreach ($activityParams as $key => $field) {
       if (!empty($params[$field])) {