Merge pull request #16348 from eileenmcnaughton/ev_online
[civicrm-core.git] / CRM / Dashlet / Page / AllCases.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 * $Id$
17 *
18 */
19
20 /**
21 * Main page for Cases dashlet
22 *
23 */
24 class CRM_Dashlet_Page_AllCases extends CRM_Core_Page {
25
26 /**
27 * List activities as dashlet.
28 *
29 * @return void
30 */
31 public function run() {
32 $context = CRM_Utils_Request::retrieve('context', 'Alphanumeric', $this, FALSE, 'dashlet');
33 $this->assign('context', $context);
34
35 //check for civicase access.
36 if (!CRM_Case_BAO_Case::accessCiviCase()) {
37 CRM_Core_Error::statusBounce(ts('You are not authorized to access this page.'));
38 }
39
40 $controller = new CRM_Core_Controller_Simple('CRM_Case_Form_Search',
41 ts('Case'), CRM_Core_Action::BROWSE,
42 NULL,
43 FALSE, FALSE, TRUE
44 );
45 $controller->setEmbedded(TRUE);
46 $controller->process();
47 $controller->run();
48
49 if (CRM_Case_BAO_Case::getCases(TRUE, ['type' => 'any'], 'dashboard', TRUE)) {
50 $this->assign('casePresent', TRUE);
51 }
52 return parent::run();
53 }
54
55 }