I’m attempting to create a dashlet for the Projects module. I have created 3 files in /suitecrm/modules/Project/Dashlets/MyProjectsDashlet and I did a quick rebuild/repair and yet mydashlet doesn’t show up on the homepage and SugarDashlets doesn’t show up in the studio for Project. There is nothing in the error log.
MyProjectsDashlet.data.php
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
* SuiteCRM is an extension to SugarCRM Community Edition developed by Salesagility Ltd.
* Copyright (C) 2011 - 2014 Salesagility Ltd.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
********************************************************************************/
global $current_user;
$dashletData['MyProjectsDashlet']['searchFields'] = array('date_entered' => array('default' => ''),
'aa_file_c' => array('default' => ''),
// 'status' => array('default' => 'Draft,proposal_sent,verbally_accepted,proposal_received,schematic_design,design_development,construction_documents,bid_award,construction_administration,system_commissioning,closeout'),
'assigned_user_id' => array('type' => 'assigned_user_name',
'default' => $current_user->name,
'label' => 'LBL_ASSIGNED_TO'));
$dashletData['MyProjectsDashlet']['columns'] = array('actual_project_c' => array('width' => '6',
'label' => 'LBL_ACTUAL_PROJECT',
'link' => false,
'default' => true),
'aa_file_c' => array('width' => '8',
'label' => 'LBL_AA_FILE',
'link' => true,
'default' => true),
'name' => array('width' => '15',
'label' => 'LBL_NAME',
'link' => true,
'default' => true),
'status' => array('width' => '10',
'label' => 'LBL_STATUS',
'default' => true),
'assigned_user_id' => array('width' => '10',
'label' => 'LBL_ASSIGNED_USER_NAME'),
'fee_c' => array('width' => '8',
'label' => 'LBL_FEE'),
'fee_billed_c' => array('width' => '8',
'label' => 'LBL_FEE_BILLED'),
'fee_balance_c' => array('width' => '8',
'label' => 'LBL_FEE_BALANCE'),
'fee_per_hour_c' => array('width' => '8',
'label' => 'LBL_FEE_PER_HOUR'),
);
?>
MyProjectsDashlet.meta.php
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
* SuiteCRM is an extension to SugarCRM Community Edition developed by Salesagility Ltd.
* Copyright (C) 2011 - 2014 Salesagility Ltd.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
********************************************************************************/
global $app_strings;
$dashletMeta['MyProjectsDashlet'] = array('module' => 'Projects',
'title' => translate('LBL_HOMEPAGE_TITLE', 'Projects'),
'description' => 'A customizable view into Projects',
'category' => 'Module Views');
?>
MyProjectsDashlet.php
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
* SuiteCRM is an extension to SugarCRM Community Edition developed by Salesagility Ltd.
* Copyright (C) 2011 - 2014 Salesagility Ltd.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
********************************************************************************/
require_once('include/Dashlets/DashletGeneric.php');
class MyProjectsDashlet extends DashletGeneric {
function MyProjectsDashlet($id, $def = null) {
global $current_user, $app_strings;
require('modules/Project/Dashlets/MyProjectsDashlet/MyAccountsDashlet.data.php');
parent::DashletGeneric($id, $def);
if(empty($def['title'])) $this->title = translate('LBL_HOMEPAGE_TITLE', 'Projects');
$this->searchFields = $dashletData['MyProjectsDashlet']['searchFields'];
$this->columns = $dashletData['MyProjectsDashlet']['columns'];
$this->seedBean = new Project();
}
/** I DON'T FEEL THIS SECTION IS NECESSARY FOR PROJECTS. - ADS 11/18/2014
/**
* Overrides the generic process to include custom logic for email addresses,
* since they are no longer stored in a list view friendly manner.
* (A record may have an undetermined number of email addresses).
*
* @param array $lvsParams
* / (was the end of a comment - ADS 11/18/2014)
function process($lvsParams = array()) {
if (isset($this->displayColumns) && array_search('email1', $this->displayColumns) !== false) {
$lvsParams['custom_select'] = ', email_address as email1';
$lvsParams['custom_from'] = ' LEFT JOIN email_addr_bean_rel eabr ON eabr.deleted = 0 AND bean_module = \'Accounts\''
. ' AND eabr.bean_id = accounts.id AND primary_address = 1'
. ' LEFT JOIN email_addresses ea ON ea.deleted = 0 AND ea.id = eabr.email_address_id';
}
if (isset($this->displayColumns) && array_search('parent_name', $this->displayColumns) !== false) {
$lvsParams['custom_select'] = empty($lvsParams['custom_select']) ? ', a1.name as parent_name ' : $lvsParams['custom_select'] . ', a1.name as parent_name ';
$lvsParams['custom_from'] = empty($lvsParams['custom_from']) ? ' LEFT JOIN accounts a1 on a1.id = accounts.parent_id' : $lvsParams['custom_from'] . ' LEFT JOIN accounts a1 on a1.id = accounts.parent_id';
}
parent::process($lvsParams);
}
*/
}
?>
I applied proper ownership and permissions to the files and directories.
Here is my main source of inspiration: http://support.sugarcrm.com/02_Documentation/04_Sugar_Developer/Sugar_Developer_Guide_6.5/02_Application_Framework/Dashlets/01_Creating_Dashlets/