Reduces copy & paste - there are some more places like this to sort out after ....
}
$form->_activityHolderIds = $form->_componentIds = $ids;
-
- // Set the context for redirection for any task actions.
- $qfKey = CRM_Utils_Request::retrieve('qfKey', 'String', $form);
- $urlParams = 'force=1';
- if (CRM_Utils_Rule::qfKey($qfKey)) {
- $urlParams .= "&qfKey=$qfKey";
- }
-
- $session = CRM_Core_Session::singleton();
- $searchFormName = strtolower($form->get('searchFormName'));
- if ($searchFormName == 'search') {
- $session->replaceUserContext(CRM_Utils_System::url('civicrm/activity/search', $urlParams));
- }
- else {
- $session->replaceUserContext(CRM_Utils_System::url("civicrm/contact/search/$searchFormName",
- $urlParams
- ));
- }
+ $form->setNextUrl('activity');
}
/**
$form->_contributionIds = $form->_componentIds = $ids;
$form->set('contributionIds', $form->_contributionIds);
-
- //set the context for redirection for any task actions
- $session = CRM_Core_Session::singleton();
-
- $qfKey = CRM_Utils_Request::retrieve('qfKey', 'String', $form);
- $urlParams = 'force=1';
- if (CRM_Utils_Rule::qfKey($qfKey)) {
- $urlParams .= "&qfKey=$qfKey";
- }
-
- $searchFormName = strtolower($form->get('searchFormName'));
- if ($searchFormName == 'search') {
- $session->replaceUserContext(CRM_Utils_System::url('civicrm/contribute/search', $urlParams));
- }
- else {
- $session->replaceUserContext(CRM_Utils_System::url("civicrm/contact/search/$searchFormName",
- $urlParams
- ));
- }
+ $form->setNextUrl('contribute');
}
/**
*
* @throws \CRM_Core_Exception
*/
- protected function setNextUrl(string $pathPart) {
+ public function setNextUrl(string $pathPart) {
//set the context for redirection for any task actions
$qfKey = CRM_Utils_Request::retrieve('qfKey', 'String', $this);
$urlParams = 'force=1';