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