<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.7 |
+ | CiviCRM version 5 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2018 |
+--------------------------------------------------------------------+
$params = array('id' => $this->_activityId);
CRM_Activity_BAO_Activity::retrieve($params, $this->_values);
}
+
$this->set('values', $this->_values);
}
if ($this->_action & CRM_Core_Action::UPDATE) {
+ // We filter out alternatives, in case this is a stored e-mail, before sending to front-end
+ $this->_values['details'] = CRM_Utils_String::stripAlternatives($this->_values['details']);
+
+ if ($this->_activityTypeName === 'Inbound Email' &&
+ !CRM_Core_Permission::check('edit inbound email basic information and content')
+ ) {
+ $this->_fields['details']['type'] = 'static';
+ }
+
CRM_Core_Form_RecurringEntity::preProcess('civicrm_activity');
}
+
+ if ($this->_action & CRM_Core_Action::VIEW) {
+ $url = CRM_Utils_System::url(implode("/", $this->urlPath), "reset=1&id={$this->_activityId}&action=view&cid={$this->_values['source_contact_id']}");
+ CRM_Utils_Recent::add($this->_values['subject'],
+ $url,
+ $this->_values['id'],
+ 'Activity',
+ $this->_values['source_contact_id'],
+ $this->_values['source_contact']
+ );
+ }
}
/**
$this->addFormRule(array('CRM_Activity_Form_Activity', 'formRule'), $this);
- $doNotNotifyAssigneeFor = Civi::settings()->get('do_not_notify_assignees_for');
+ $doNotNotifyAssigneeFor = (array) Civi::settings()->get('do_not_notify_assignees_for');
if (($this->_activityTypeId && in_array($this->_activityTypeId, $doNotNotifyAssigneeFor)) || !Civi::settings()->get('activity_assignee_notification')) {
$this->assign('activityAssigneeNotification', FALSE);
}