Commit | Line | Data |
---|---|---|
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 | 11 | |
6a488035 TO |
12 | /** |
13 | * This is page is for Event Dashboard | |
14 | */ | |
15 | class CRM_Event_Page_DashBoard extends CRM_Core_Page { | |
16 | ||
17 | /** | |
18 | * Heart of the viewing process. The runner gets all the meta data for | |
19 | * the contact and calls the appropriate type of page to view. | |
20 | * | |
21 | * @return void | |
6a488035 | 22 | */ |
00be9182 | 23 | public function preProcess() { |
6a488035 TO |
24 | CRM_Utils_System::setTitle(ts('CiviEvent')); |
25 | ||
26 | $eventSummary = CRM_Event_BAO_Event::getEventSummary(); | |
7fffa5fa | 27 | $eventSummary['tab'] = CRM_Event_Page_ManageEvent::tabs(); |
6a488035 TO |
28 | |
29 | $actionColumn = FALSE; | |
30 | if (!empty($eventSummary) && | |
31 | isset($eventSummary['events']) && | |
32 | is_array($eventSummary['events']) | |
33 | ) { | |
34 | foreach ($eventSummary['events'] as $e) { | |
35 | if (isset($e['isMap']) || isset($e['configure'])) { | |
36 | $actionColumn = TRUE; | |
37 | break; | |
38 | } | |
39 | } | |
40 | } | |
41 | ||
42 | $this->assign('actionColumn', $actionColumn); | |
43 | $this->assign('eventSummary', $eventSummary); | |
679bd095 | 44 | $this->assign('iCal', CRM_Event_BAO_Event::getICalLinks()); |
6a488035 TO |
45 | } |
46 | ||
47 | /** | |
dc195289 | 48 | * the main function that is called when the page loads, |
6a488035 TO |
49 | * it decides the which action has to be taken for the page. |
50 | * | |
76e7a76c | 51 | * @return null |
6a488035 | 52 | */ |
00be9182 | 53 | public function run() { |
6a488035 TO |
54 | $this->preProcess(); |
55 | ||
56 | $controller = new CRM_Core_Controller_Simple('CRM_Event_Form_Search', ts('events'), NULL); | |
57 | $controller->setEmbedded(TRUE); | |
58 | $controller->reset(); | |
59 | $controller->set('limit', 10); | |
60 | $controller->set('force', 1); | |
61 | $controller->set('context', 'dashboard'); | |
62 | $controller->process(); | |
63 | $controller->run(); | |
64 | ||
65 | return parent::run(); | |
66 | } | |
96025800 | 67 | |
6a488035 | 68 | } |