Merge pull request #15841 from mattwire/participant_cleanup_removeparticipantfrominput
[civicrm-core.git] / CRM / Activity / Page / UserDashboard.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 * This class is for building event(participation) block on user dashboard.
20 */
21 class CRM_Activity_Page_UserDashboard extends CRM_Contact_Page_View_UserDashBoard {
22
23 /**
24 * List participations for the UF user.
25 *
26 * @return bool
27 */
28 public function listActivities() {
29
30 $controller
31 = new CRM_Core_Controller_Simple(
32 'CRM_Activity_Form_Search', ts('Activities'),
33 NULL,
34 FALSE, FALSE, TRUE, FALSE
35 );
36 $controller->setEmbedded(TRUE);
37 $controller->reset();
38 $controller->set('context', 'user');
39 $controller->set('cid', $this->_contactId);
40 // Limit to status "Scheduled" and "Available"
41 $controller->set('status', ['IN' => [1, 7]]);
42 $controller->set('activity_role', 2);
43 $controller->set('force', 1);
44 $controller->process();
45 $controller->run();
46
47 return FALSE;
48 }
49
50 /**
51 * The main function that is called when the page loads.
52 *
53 * It decides the which action has to be taken for the page.
54 */
55 public function run() {
56 parent::preProcess();
57 $this->listActivities();
58 }
59
60 }