INFRA-132 - CRM/Activity - 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:25 +0000 (15:04 -0800)
14 files changed:
CRM/Activity/Form/Activity.php
CRM/Activity/Form/ActivityLinks.php
CRM/Activity/Form/ActivityView.php
CRM/Activity/Form/Search.php
CRM/Activity/Form/Task.php
CRM/Activity/Form/Task/Batch.php
CRM/Activity/Form/Task/FileOnCase.php
CRM/Activity/Import/Form/MapField.php
CRM/Activity/Import/Parser.php
CRM/Activity/Import/Parser/Activity.php
CRM/Activity/Page/AJAX.php
CRM/Activity/Page/Tab.php
CRM/Activity/Selector/Activity.php
CRM/Activity/Selector/Search.php

index 56a02c74da68ab09adc640259eabd20c927131e9..be1039b2c21426a32fc990b0901324b0dca232c1 100644 (file)
@@ -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'
index d039c7a8526adf9dfc5ec1a01d3f942e1955d0e7..21ef6a4c87bbb896885b9d8882601618ea8aa392 100644 (file)
@@ -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
index 8ea14959280fe95915feec5df3c6bae2425a8fb7..2f85b0dce92ef8492c09dd72e06689056e09ccc4 100644 (file)
@@ -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) {
index f444589d6a0d47d6b72cc20748face3b00b6f469..5c5b42ee5b8bf0fa52f1fcb31f85fc32bf097dcd 100644 (file)
@@ -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));
index f9aea5225d750b73bb3e89d06aa8c96d781b7605..cc3efb0e7f91a14d94815605ab459e72c7c6595e 100644 (file)
@@ -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) . ' ) ';
index e28a5acd3f3296fc613f6cf16605969b23076239..0a3f41f1cbda7f2fb2bbc8b32a0586b4acfd30cb 100755 (executable)
@@ -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;
index dc1b4e391698c4e4c95c83cbc3fced04bf369105..7d712d593b5606b64424e43682e975d0a2ae22b2 100644 (file)
@@ -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
index e8b38d7128e880b4caa0581bfc2f0289fb30ca56..3916e36a9c659cba363f47e23695fe62c50f90a4 100644 (file)
@@ -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
index c7af7217c996a621d1f002a9db5a92992c58b473..bc16b760b5763adcbb2c3fb1caa0faa4bebc8068 100644 (file)
@@ -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;
 
index 4aa252125a4e3fc6b4acd86bddfd12a8c1270d11..9748f71f1de41639cfda6c38ba9f3dedad36d2fa 100644 (file)
@@ -397,6 +397,7 @@ class CRM_Activity_Import_Parser_Activity extends CRM_Activity_Import_Parser {
    *
    * @return void
    */
-  public function fini() {}
+  public function fini() {
+  }
 
 }
index 10cdf197871264a6ec676f3dd8428e30361ac983..423b72fed7dcee150484e6207e60bed1f053d261 100644 (file)
@@ -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'] =
             '<a href="#editCaseRoleDialog" title="'. ts('Reassign %1', array(1 => $typeLabel)) .'" class="crm-hover-button case-miniform" data-contact_type="' . $contactType . '" data-rel_type="'. $row['relation_type'] .'" data-rel_id="'. $row['rel_id'] .'"data-key="'. CRM_Core_Key::get('civicrm/ajax/relation') .'">'.
               '<span class="icon edit-icon"></span>'.
             '</a>'.
             '<a href="#deleteCaseRoleDialog" title="'. ts('Remove %1', array(1 => $typeLabel)) .'" class="crm-hover-button case-miniform" data-contact_type="' . $contactType . '" data-rel_type="'.$row['relation_type'].'" data-key="'. CRM_Core_Key::get('civicrm/ajax/delcaserole') .'">'.
               '<span class="icon delete-icon"></span>'.
             '</a>';
-          break;
+            break;
 
-        case 'caseRoles':
-          $row['actions'] =
+          case 'caseRoles':
+            $row['actions'] =
             '<a href="#editCaseRoleDialog" title="'. ts('Assign %1', array(1 => $typeLabel)) .'" class="crm-hover-button case-miniform" data-contact_type="' . $contactType . '" data-rel_type="'. $row['relation_type'] .'" data-key="'. CRM_Core_Key::get('civicrm/ajax/relation') .'">'.
               '<span class="icon edit-icon"></span>'.
             '</a>';
-          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);
index 4917cafa4efcf0bf94b774808aaadc1808e48062..c0b9075768c8e403991daa59f0b3c869df487303 100644 (file)
@@ -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);
index 75ee5126f261d925b03b858e6ff36f91c646431e..596c7357b00cf017db554228d4e2d72c9faf79ae 100644 (file)
@@ -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,
         ),
index ba9911087760ff7f6cac8a745d4b4224c1bc3a8d..c46c439b4678dc5332eec44c346c9a9be35f5556 100644 (file)
@@ -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'];