| 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 | * $Id$ |
| 17 | * |
| 18 | */ |
| 19 | |
| 20 | /** |
| 21 | * This class is for building event(participation) block on user dashboard |
| 22 | */ |
| 23 | class CRM_Event_Page_UserDashboard extends CRM_Contact_Page_View_UserDashBoard { |
| 24 | |
| 25 | /** |
| 26 | * List participations for the UF user. |
| 27 | * |
| 28 | */ |
| 29 | public function listParticipations() { |
| 30 | $controller = new CRM_Core_Controller_Simple( |
| 31 | 'CRM_Event_Form_Search', |
| 32 | ts('Events'), |
| 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 | $controller->set('force', 1); |
| 41 | $controller->process(); |
| 42 | $controller->run(); |
| 43 | } |
| 44 | |
| 45 | /** |
| 46 | * the main function that is called when the page |
| 47 | * loads, it decides the which action has to be taken for the page. |
| 48 | * |
| 49 | */ |
| 50 | public function run() { |
| 51 | parent::preProcess(); |
| 52 | $this->listParticipations(); |
| 53 | } |
| 54 | |
| 55 | } |