+--------------------------------------------------------------------+
| CiviCRM version 4.7 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2016 |
+ | Copyright CiviCRM LLC (c) 2004-2017 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2016
+ * @copyright CiviCRM LLC (c) 2004-2017
*/
/**
}
/**
+ * @deprecated - use the api instead.
+ *
* Get the Activities of a target contact.
*
* @param int $contactId
* array of activity fields
*/
public static function getContactActivity($contactId) {
+ // @todo remove this function entirely.
$activities = array();
$activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
$sourceID = CRM_Utils_Array::key('Activity Source', $activityContacts);
'type' => CRM_Utils_Type::T_STRING,
'searchByLabel' => TRUE,
),
+ 'activity_priority' => array(
+ 'title' => ts('Activity Priority'),
+ 'name' => 'activity_priority',
+ 'type' => CRM_Utils_Type::T_STRING,
+ 'searchByLabel' => TRUE,
+ ),
);
$fields = array_merge($Activityfields, $exportableFields);
}
$params['caseId'] = NULL;
$context = CRM_Utils_Array::value('context', $params);
$showContactOverlay = !CRM_Utils_String::startsWith($context, "dashlet");
+ $activityTypeInfo = civicrm_api3('OptionValue', 'get', array(
+ 'option_group_id' => "activity_type",
+ 'options' => array('limit' => 0),
+ ));
+ $activityIcons = array();
+ foreach ($activityTypeInfo['values'] as $type) {
+ if (!empty($type['icon'])) {
+ $activityIcons[$type['value']] = $type['icon'];
+ }
+ }
// Get contact activities.
$activities = CRM_Activity_BAO_Activity::getActivities($params);
$activity = array();
$activity['DT_RowId'] = $activityId;
// Add class to this row if overdue.
- $activity['DT_RowClass'] = 'crm-entity';
+ $activity['DT_RowClass'] = "crm-entity status-id-{$values['status_id']}";
if (CRM_Utils_Date::overdue(CRM_Utils_Array::value('activity_date_time', $values))
&& CRM_Utils_Array::value('status_id', $values) == 1
) {
$activity['DT_RowAttr']['data-entity'] = 'activity';
$activity['DT_RowAttr']['data-id'] = $activityId;
- $activity['activity_type'] = $values['activity_type'];
+ $activity['activity_type'] = (!empty($activityIcons[$values['activity_type_id']]) ? '<span class="crm-i ' . $activityIcons[$values['activity_type_id']] . '"></span> ' : '') . $values['activity_type'];
$activity['subject'] = $values['subject'];
$activity['source_contact_name'] = '';