3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.3 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2013 |
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-2013
40 class CRM_Contact_Page_DashBoard
extends CRM_Core_Page
{
49 // Add dashboard js and css
50 CRM_Core_Resources
::singleton()
51 ->addScriptFile('civicrm', 'packages/jquery/plugins/jquery.dashboard.js', 0, 'html-header', FALSE)
52 ->addStyleFile('civicrm', 'packages/jquery/css/dashboard.css');
54 $resetCache = CRM_Utils_Request
::retrieve('resetCache', 'Positive', CRM_Core_DAO
::$_nullObject);
56 CRM_Utils_System
::setTitle(ts('CiviCRM Home'));
57 $session = CRM_Core_Session
::singleton();
58 $contactID = $session->get('userID');
61 CRM_Core_BAO_Dashboard
::resetDashletCache($contactID);
64 // call hook to get html from other modules
65 // ignored but needed to prevent warnings
66 $contentPlacement = CRM_Utils_Hook
::DASHBOARD_BELOW
;
67 $html = CRM_Utils_Hook
::dashboard($contactID, $contentPlacement);
68 if (is_array($html)) {
69 $this->assign_by_ref('hookContent', $html);
70 $this->assign('hookContentPlacement', $contentPlacement);
73 //check that default FROM email address, owner (domain) organization name and default mailbox are configured.
76 $defaultMailboxOK = TRUE;
78 // Don't put up notices if user doesn't have administer CiviCRM permission
79 if (CRM_Core_Permission
::check('administer CiviCRM')) {
80 $destination = CRM_Utils_System
::url(
86 $destination = urlencode($destination);
88 list($domainEmailName, $domainEmailAddress) = CRM_Core_BAO_Domain
::getNameAndEmail(TRUE);
90 if (!$domainEmailAddress ||
$domainEmailAddress == 'info@EXAMPLE.ORG') {
91 $fixEmailUrl = CRM_Utils_System
::url("civicrm/admin/domain", "action=update&reset=1&civicrmDestination={$destination}");
92 $this->assign('fixEmailUrl', $fixEmailUrl);
96 $domain = CRM_Core_BAO_Domain
::getDomain();
97 $domainName = $domain->name
;
98 if (!$domainName ||
$domainName == 'Default Domain Name') {
99 $fixOrgUrl = CRM_Utils_System
::url("civicrm/admin/domain", "action=update&reset=1&civicrmDestination={$destination}");
100 $this->assign('fixOrgUrl', $fixOrgUrl);
104 $config = CRM_Core_Config
::singleton();
105 if (in_array('CiviMail', $config->enableComponents
) &&
106 CRM_Core_BAO_MailSettings
::defaultDomain() == "EXAMPLE.ORG"
108 $fixDefaultMailbox = CRM_Utils_System
::url('civicrm/admin/mailSettings', "reset=1&civicrmDestination={$destination}");
109 $this->assign('fixDefaultMailbox', $fixDefaultMailbox);
110 $defaultMailboxOK = FALSE;
114 $this->assign('fromEmailOK', $fromEmailOK);
115 $this->assign('ownerOrgOK', $ownerOrgOK);
116 $this->assign('defaultMailboxOK', $defaultMailboxOK);
118 return parent
::run();