Swap out fatal for statusBounce for disabled or unpermittted forms
[civicrm-core.git] / CRM / Dashlet / Page / CaseDashboard.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 Case Dashboard dashlet
22 *
23 */
24 class CRM_Dashlet_Page_CaseDashboard extends CRM_Core_Page {
25
26 /**
27 * Case dashboard as dashlet.
28 *
29 * @return void
30 */
31 public function run() {
32 //check for civicase access.
33 if (!CRM_Case_BAO_Case::accessCiviCase()) {
34 CRM_Core_Error::statusBounce(ts('You are not authorized to access this page.'));
35 }
36
37 $summary = CRM_Case_BAO_Case::getCasesSummary(TRUE);
38
39 if (!empty($summary)) {
40 $this->assign('casesSummary', $summary);
41 }
42
43 return parent::run();
44 }
45
46 }