Skip to content

Commit

Permalink
Merge pull request #14522 from colemanw/ActivityForm
Browse files Browse the repository at this point in the history
ActivityForm - Redirect to contact page or activity view in standalone mode
  • Loading branch information
colemanw authored Jun 14, 2019
2 parents 204a280 + 70f3519 commit ba0022f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions CRM/Activity/Form/Activity.php
Original file line number Diff line number Diff line change
Expand Up @@ -992,6 +992,17 @@ public function postProcess($params = NULL) {
$activity = $this->processActivity($params);
}

// Redirect to contact page or activity view in standalone mode
if ($this->_context == 'standalone') {
if (count($params['target_contact_id']) == 1) {
$url = CRM_Utils_System::url('civicrm/contact/view', ['cid' => CRM_Utils_Array::first($params['target_contact_id']), 'selectedChild' => 'activity']);
}
else {
$url = CRM_Utils_System::url('civicrm/activity', ['action' => 'view', 'reset' => 1, 'id' => $this->_activityId]);
}
CRM_Core_Session::singleton()->pushUserContext($url);
}

$activityIds = empty($this->_activityIds) ? [$this->_activityId] : $this->_activityIds;
foreach ($activityIds as $activityId) {
// set params for repeat configuration in create mode
Expand Down

0 comments on commit ba0022f

Please sign in to comment.