3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
15 * @copyright CiviCRM LLC https://civicrm.org/licensing
19 * Used for displaying results
21 class CRM_Contact_Form_Task_Result
extends CRM_Contact_Form_Task
{
24 * Build all the data structures needed to build the form.
26 public function preProcess() {
27 $session = CRM_Core_Session
::singleton();
29 //this is done to unset searchRows variable assign during AddToHousehold and AddToOrganization
30 $this->set('searchRows', '');
32 $context = $this->get('context');
33 if (in_array($context, [
37 $urlParams = 'reset=1&force=1&context=smog&gid=';
38 $urlParams .= ($context == 'smog') ?
$this->get('gid') : $this->get('amtgID');
39 $session->replaceUserContext(CRM_Utils_System
::url('civicrm/group/search', $urlParams));
43 $ssID = $this->get('ssID');
45 if ($this->_action
== CRM_Core_Action
::BASIC
) {
48 elseif ($this->_action
== CRM_Core_Action
::PROFILE
) {
49 $fragment = 'search/builder';
51 elseif ($this->_action
== CRM_Core_Action
::ADVANCED
) {
52 $fragment = 'search/advanced';
55 $fragment = 'search/custom';
60 $path .= "&reset=1&ssID={$ssID}";
62 if (!CRM_Contact_Form_Search
::isSearchContext($context)) {
65 $path .= "&context=$context";
67 //set the user context for redirection of task actions
68 $qfKey = CRM_Utils_Request
::retrieve('qfKey', 'String', $this);
69 if (CRM_Utils_Rule
::qfKey($qfKey)) {
70 $path .= "&qfKey=$qfKey";
73 $url = CRM_Utils_System
::url('civicrm/contact/' . $fragment, $path);
74 $session->replaceUserContext($url);
78 * Build the form object.
80 public function buildQuickForm() {