+--------------------------------------------------------------------+
| CiviCRM version 5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2018 |
+ | Copyright CiviCRM LLC (c) 2004-2020 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
*/
public function __construct() {
parent::__construct('event', array_merge(
- array(
+ [
'event_type' => ts('Event Type'),
'title' => ts('Event Title'),
'event_id' => ts('Event ID'),
'contact_email' => ts('Event Contact (Email)'),
'contact_phone' => ts('Event Contact (Phone)'),
'balance' => ts('Event Balance'),
- ),
+ ],
CRM_Utils_Token::getCustomFieldTokens('Event')
));
}
*/
public function checkActive(\Civi\Token\TokenProcessor $processor) {
// Extracted from scheduled-reminders code. See the class description.
- return
- !empty($processor->context['actionMapping'])
+ return !empty($processor->context['actionMapping'])
&& $processor->context['actionMapping']->getEntity() === 'civicrm_participant';
}
return;
}
- $e->query->select('e.*'); // FIXME: seems too broad.
+ // FIXME: seems too broad.
+ $e->query->select('e.*');
$e->query->select('ov.label as event_type, ev.title, ev.id as event_id, ev.start_date, ev.end_date, ev.summary, ev.description, address.street_address, address.city, address.state_province_id, address.postal_code, email.email as contact_email, phone.phone as contact_phone');
$e->query->join('participant_stuff', "
!casMailingJoinType civicrm_event ev ON e.event_id = ev.id
$actionSearchResult = $row->context['actionSearchResult'];
if ($field == 'location') {
- $loc = array();
+ $loc = [];
$stateProvince = \CRM_Core_PseudoConstant::stateProvince();
$loc['street_address'] = $actionSearchResult->street_address;
$loc['city'] = $actionSearchResult->city;
$row
->tokens($entity, $field, \CRM_Utils_System::url('civicrm/event/register', 'reset=1&id=' . $actionSearchResult->event_id, TRUE, NULL, FALSE));
}
- elseif (in_array($field, array('start_date', 'end_date'))) {
+ elseif (in_array($field, ['start_date', 'end_date'])) {
$row->tokens($entity, $field, \CRM_Utils_Date::customFormat($actionSearchResult->$field));
}
elseif ($field == 'balance') {