Merge pull request #15975 from eileenmcnaughton/setting
[civicrm-core.git] / CRM / Activity / Page / UserDashboard.php
CommitLineData
6a488035
TO
1<?php
2/*
3 +--------------------------------------------------------------------+
bc77d7c0 4 | Copyright CiviCRM LLC. All rights reserved. |
6a488035 5 | |
bc77d7c0
TO
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 |
6a488035 9 +--------------------------------------------------------------------+
d25dd0ee 10 */
6a488035
TO
11
12/**
13 *
14 * @package CRM
ca5cec67 15 * @copyright CiviCRM LLC https://civicrm.org/licensing
6a488035
TO
16 */
17
18/**
b6c94f42 19 * This class is for building event(participation) block on user dashboard.
6a488035
TO
20 */
21class CRM_Activity_Page_UserDashboard extends CRM_Contact_Page_View_UserDashBoard {
22
23 /**
fe482240 24 * List participations for the UF user.
6a488035 25 *
79d7553f 26 * @return bool
6a488035 27 */
00be9182 28 public function listActivities() {
6a488035 29
79d7553f 30 $controller
31 = new CRM_Core_Controller_Simple(
27c7a314
DL
32 'CRM_Activity_Form_Search', ts('Activities'),
33 NULL,
34 FALSE, FALSE, TRUE, FALSE
35 );
6a488035
TO
36 $controller->setEmbedded(TRUE);
37 $controller->reset();
38 $controller->set('context', 'user');
39 $controller->set('cid', $this->_contactId);
97b002d7 40 // Limit to status "Scheduled" and "Available"
be2fb01f 41 $controller->set('status', ['IN' => [1, 7]]);
6a488035 42 $controller->set('activity_role', 2);
6a488035
TO
43 $controller->set('force', 1);
44 $controller->process();
45 $controller->run();
46
79d7553f 47 return FALSE;
6a488035
TO
48 }
49
50 /**
b6c94f42 51 * The main function that is called when the page loads.
6a488035 52 *
b6c94f42 53 * It decides the which action has to be taken for the page.
6a488035 54 */
00be9182 55 public function run() {
6a488035
TO
56 parent::preProcess();
57 $this->listActivities();
58 }
96025800 59
6a488035 60}