Merge pull request #17879 from colemanw/relCacheApi
[civicrm-core.git] / CRM / Grant / Page / DashBoard.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 * This is page is for Grant Dashboard
20 */
21class CRM_Grant_Page_DashBoard extends CRM_Core_Page {
22
23 /**
24 * Heart of the viewing process. The runner gets all the meta data for
25 * the contact and calls the appropriate type of page to view.
26 *
27 * @return void
6a488035 28 */
00be9182 29 public function preProcess() {
6a488035
TO
30 $admin = CRM_Core_Permission::check('administer CiviCRM');
31
32 $grantSummary = CRM_Grant_BAO_Grant::getGrantSummary($admin);
33
34 $this->assign('grantAdmin', $admin);
35 $this->assign('grantSummary', $grantSummary);
36 }
37
38 /**
dc195289 39 * the main function that is called when the page loads,
6a488035
TO
40 * it decides the which action has to be taken for the page.
41 *
76e7a76c 42 * @return null
6a488035 43 */
00be9182 44 public function run() {
6a488035
TO
45 $this->preProcess();
46
47 $controller = new CRM_Core_Controller_Simple('CRM_Grant_Form_Search', ts('grants'), NULL);
48 $controller->setEmbedded(TRUE);
49 $controller->reset();
50 $controller->set('limit', 10);
51 $controller->set('force', 1);
52 $controller->set('context', 'dashboard');
53 $controller->process();
54 $controller->run();
55
56 return parent::run();
57 }
96025800 58
6a488035 59}