fixed spelling of address on lines 122 and 247
[civicrm-core.git] / CRM / Contact / Form / Task / Result.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
5 | |
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 +--------------------------------------------------------------------+
10 */
11
12 /**
13 *
14 * @package CRM
15 * @copyright CiviCRM LLC https://civicrm.org/licensing
16 */
17
18 /**
19 * Used for displaying results
20 */
21 class CRM_Contact_Form_Task_Result extends CRM_Contact_Form_Task {
22
23 /**
24 * Build all the data structures needed to build the form.
25 */
26 public function preProcess() {
27 $session = CRM_Core_Session::singleton();
28
29 //this is done to unset searchRows variable assign during AddToHousehold and AddToOrganization
30 $this->set('searchRows', '');
31
32 $context = $this->get('context');
33 if (in_array($context, [
34 'smog',
35 'amtg',
36 ])) {
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));
40 return;
41 }
42
43 $ssID = $this->get('ssID');
44
45 if ($this->_action == CRM_Core_Action::BASIC) {
46 $fragment = 'search';
47 }
48 elseif ($this->_action == CRM_Core_Action::PROFILE) {
49 $fragment = 'search/builder';
50 }
51 elseif ($this->_action == CRM_Core_Action::ADVANCED) {
52 $fragment = 'search/advanced';
53 }
54 else {
55 $fragment = 'search/custom';
56 }
57
58 $path = 'force=1';
59 if (isset($ssID)) {
60 $path .= "&reset=1&ssID={$ssID}";
61 }
62 if (!CRM_Contact_Form_Search::isSearchContext($context)) {
63 $context = 'search';
64 }
65 $path .= "&context=$context";
66
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";
71 }
72
73 $url = CRM_Utils_System::url('civicrm/contact/' . $fragment, $path);
74 $session->replaceUserContext($url);
75 }
76
77 /**
78 * Build the form object.
79 */
80 public function buildQuickForm() {
81 $this->addButtons([
82 [
83 'type' => 'done',
84 'name' => ts('Done'),
85 'isDefault' => TRUE,
86 ],
87 ]);
88 }
89
90 }