4 * Copyright © 2014 Free Software Foundation, Inc.
6 * This file is a part of FSF Member Dashboard.
8 * FSF Member Dashboard is free software; you can copy, modify, and
9 * distribute it under the terms of the GNU Affero General Public
10 * License Version 3, 19 November 2007 and the CiviCRM Licensing
13 * FSF Member Dashboard is distributed in the hope that it will be
14 * useful, but WITHOUT ANY WARRANTY; without even the implied warranty
15 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Affero General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with FSF Member Dashboard. If not, see
20 * <http://www.gnu.org/licenses/>.
23 require_once 'CRM/Core/Page.php';
25 class CRM_Memberdashboard_Page_MemberDashboard
extends CRM_Memberdashboard_Page
{
27 * Return the personalized title for the page.
29 * @return Title string
31 function pageTitle() {
32 return ts('Welcome, ') . $this->contact
['first_name'] . '!';
36 * There isn't a function that does this simple task in the PCP BAO,
39 function campaignPages() {
40 $dao = CRM_Core_DAO
::executeQuery(
41 'SELECT id, title, is_active, is_honor_roll FROM civicrm_pcp WHERE contact_id=%1',
42 array( 1 => array($this->contact
['id'], 'Integer') )
47 while($dao->fetch()) {
50 'title' => $dao->title
,
51 'is_active' => $dao->is_active
,
52 'is_honor_roll' => $dao->is_honor_roll
61 function makeChecksum() {
62 return CRM_Contact_BAO_Contact_Utils
::generateChecksum($this->contact
['id']);
66 $helper = new CRM_Memberdashboard_Page_ComponentHelper(array(
72 $this->assign('dashboardElements', $helper->buildDashboardElements());
73 $this->assign('campaignPages', $this->campaignPages());
74 // Checksum for editing recurring contributions.
75 $this->assign('contributionChecksum', $this->makeChecksum());
76 $this->assign('contactId', $this->contact
['id']);
80 CRM_Utils_System
::setTitle($this->pageTitle());