Merge pull request #17361 from jaapjansma/dev-1767
[civicrm-core.git] / CRM / Campaign / Page / Petition / ThankYou.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 class CRM_Campaign_Page_Petition_ThankYou extends CRM_Core_Page {
18
19 /**
20 * Run page.
21 *
22 * @return string
23 */
24 public function run() {
25 $id = CRM_Utils_Request::retrieve('id', 'Positive', $this);
26 $petition_id = CRM_Utils_Request::retrieve('pid', 'Positive', $this);
27 $params['id'] = $petition_id;
28 $this->petition = [];
29 CRM_Campaign_BAO_Survey::retrieve($params, $this->petition);
30 $this->assign('petitionTitle', $this->petition['title']);
31 $this->assign('thankyou_title', CRM_Utils_Array::value('thankyou_title', $this->petition));
32 $this->assign('thankyou_text', CRM_Utils_Array::value('thankyou_text', $this->petition));
33 $this->assign('survey_id', $petition_id);
34 $this->assign('status_id', $id);
35 $this->assign('is_share', CRM_Utils_Array::value('is_share', $this->petition));
36 CRM_Utils_System::setTitle(CRM_Utils_Array::value('thankyou_title', $this->petition));
37
38 // send thank you or email verification emails
39 /*
40 * sendEmailMode
41 * 1 = connected user via login/pwd - thank you
42 * or dedupe contact matched who doesn't have a tag CIVICRM_TAG_UNCONFIRMED - thank you
43 * login using fb connect - thank you + click to add msg to fb wall
44 * 2 = send a confirmation request email
45 */
46
47 return parent::run();
48 }
49
50 }