Commit 32864ccf authored by totten's avatar totten

INFRA-132 - CRM/Activity - phpcbf

parent 100b0ec6
......@@ -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'
......
......@@ -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
......
......@@ -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) {
......
......@@ -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));
......
......@@ -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) . ' ) ';
......
......@@ -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;
......
......@@ -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
......
......@@ -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
......
......@@ -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;
......
......@@ -397,6 +397,7 @@ class CRM_Activity_Import_Parser_Activity extends CRM_Activity_Import_Parser {
*
* @return void
*/
public function fini() {}
public function fini() {
}
}
......@@ -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);
......
......@@ -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);
......
......@@ -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,
),
......
......@@ -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'];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment