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 | */ |
17 | class CRM_Pledge_Page_UserDashboard extends CRM_Contact_Page_View_UserDashBoard { | |
18 | ||
19 | /** | |
fe482240 | 20 | * called when action is browse. |
6a488035 | 21 | */ |
00be9182 | 22 | public function listPledges() { |
9f6f062c DL |
23 | $controller = new CRM_Core_Controller_Simple( |
24 | 'CRM_Pledge_Form_Search', | |
25 | ts('Pledges'), | |
26 | NULL, | |
27 | FALSE, FALSE, TRUE, FALSE | |
28 | ); | |
6a488035 TO |
29 | $controller->setEmbedded(TRUE); |
30 | $controller->reset(); | |
31 | $controller->set('limit', 12); | |
32 | $controller->set('cid', $this->_contactId); | |
33 | $controller->set('context', 'user'); | |
34 | $controller->set('force', 1); | |
35 | $controller->process(); | |
36 | $controller->run(); | |
37 | ||
cc28438b | 38 | // add honor block. |
be2fb01f | 39 | $honorParams = []; |
6a488035 TO |
40 | $honorParams = CRM_Pledge_BAO_Pledge::getHonorContacts($this->_contactId); |
41 | if (!empty($honorParams)) { | |
42 | // assign vars to templates | |
43 | $this->assign('pledgeHonorRows', $honorParams); | |
44 | $this->assign('pledgeHonor', TRUE); | |
45 | } | |
46 | $session = CRM_Core_Session::singleton(); | |
47 | $loggedUserID = $session->get('userID'); | |
48 | $this->assign('loggedUserID', $loggedUserID); | |
49 | } | |
50 | ||
51 | /** | |
dc195289 | 52 | * the main function that is called when the page |
6a488035 | 53 | * loads, it decides the which action has to be taken for the page. |
6a488035 | 54 | */ |
00be9182 | 55 | public function run() { |
6a488035 TO |
56 | parent::preProcess(); |
57 | $this->listPledges(); | |
58 | } | |
96025800 | 59 | |
6a488035 | 60 | } |