3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.5 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2014 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
31 * @copyright CiviCRM LLC (c) 2004-2014
40 class CRM_Contact_Page_DashBoard
extends CRM_Core_Page
{
49 // Add dashboard js and css
50 $resources = CRM_Core_Resources
::singleton();
51 $resources->addScriptFile('civicrm', 'js/jquery/jquery.dashboard.js', 0, 'html-header', FALSE);
52 $resources->addStyleFile('civicrm', 'css/dashboard.css');
54 $config = CRM_Core_Config
::singleton();
56 $resetCache = CRM_Utils_Request
::retrieve('resetCache', 'Positive', CRM_Core_DAO
::$_nullObject);
58 CRM_Utils_System
::setTitle(ts('CiviCRM Home'));
59 $session = CRM_Core_Session
::singleton();
60 $contactID = $session->get('userID');
63 CRM_Core_BAO_Dashboard
::resetDashletCache($contactID);
66 // call hook to get html from other modules
67 // ignored but needed to prevent warnings
68 $contentPlacement = CRM_Utils_Hook
::DASHBOARD_BELOW
;
69 $html = CRM_Utils_Hook
::dashboard($contactID, $contentPlacement);
70 if (is_array($html)) {
71 $this->assign_by_ref('hookContent', $html);
72 $this->assign('hookContentPlacement', $contentPlacement);
75 //check that default FROM email address, owner (domain) organization name and default mailbox are configured.
78 $defaultMailboxOK = TRUE;
80 // Don't put up notices if user doesn't have administer CiviCRM permission
81 if (CRM_Core_Permission
::check('administer CiviCRM')) {
82 $destination = CRM_Utils_System
::url(
88 $destination = urlencode($destination);
90 list($domainEmailName, $domainEmailAddress) = CRM_Core_BAO_Domain
::getNameAndEmail(TRUE);
92 if (!$domainEmailAddress ||
$domainEmailAddress == 'info@EXAMPLE.ORG') {
93 $fixEmailUrl = CRM_Utils_System
::url("civicrm/admin/domain", "action=update&reset=1&civicrmDestination={$destination}");
94 $this->assign('fixEmailUrl', $fixEmailUrl);
98 $domain = CRM_Core_BAO_Domain
::getDomain();
99 $domainName = $domain->name
;
100 if (!$domainName ||
$domainName == 'Default Domain Name') {
101 $fixOrgUrl = CRM_Utils_System
::url("civicrm/admin/domain", "action=update&reset=1&civicrmDestination={$destination}");
102 $this->assign('fixOrgUrl', $fixOrgUrl);
106 if (in_array('CiviMail', $config->enableComponents
) &&
107 CRM_Core_BAO_MailSettings
::defaultDomain() == "EXAMPLE.ORG"
109 $fixDefaultMailbox = CRM_Utils_System
::url('civicrm/admin/mailSettings', "reset=1&civicrmDestination={$destination}");
110 $this->assign('fixDefaultMailbox', $fixDefaultMailbox);
111 $defaultMailboxOK = FALSE;
115 $this->assign('fromEmailOK', $fromEmailOK);
116 $this->assign('ownerOrgOK', $ownerOrgOK);
117 $this->assign('defaultMailboxOK', $defaultMailboxOK);
119 $communityMessages = CRM_Core_CommunityMessages
::create();
120 if ($communityMessages->isEnabled()) {
121 $message = $communityMessages->pick();
123 $this->assign('communityMessages', $communityMessages->evalMarkup($message['markup']));
127 return parent
::run();