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