init
This commit is contained in:
44
modules/Home/Dashlets/ChartsDashlet/ChartsDashlet.en_us.lang.php
Executable file
44
modules/Home/Dashlets/ChartsDashlet/ChartsDashlet.en_us.lang.php
Executable file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/**
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004 - 2009 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU 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 General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU 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 General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
$dashletStrings['ChartsDashlet'] = array('LBL_TITLE' => 'Charts',
|
||||
'LBL_DESCRIPTION' => 'A dashlet to display charts',
|
||||
'LBL_CONFIGURE_TITLE' => 'Title', );
|
||||
?>
|
||||
44
modules/Home/Dashlets/ChartsDashlet/ChartsDashlet.ge_ge.lang.php
Executable file
44
modules/Home/Dashlets/ChartsDashlet/ChartsDashlet.ge_ge.lang.php
Executable file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/**
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004 - 2009 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU 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 General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU 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 General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
$dashletStrings['ChartsDashlet'] = array('LBL_TITLE' => 'Diagramme',
|
||||
'LBL_DESCRIPTION' => 'Ein Dashlet um Diagramme anzuzeigen',
|
||||
'LBL_CONFIGURE_TITLE' => 'Titel', );
|
||||
?>
|
||||
47
modules/Home/Dashlets/ChartsDashlet/ChartsDashlet.meta.php
Executable file
47
modules/Home/Dashlets/ChartsDashlet/ChartsDashlet.meta.php
Executable file
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/**
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004 - 2009 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU 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 General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU 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 General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
*/
|
||||
|
||||
|
||||
|
||||
global $app_strings, $current_language;
|
||||
|
||||
$dashletMeta['ChartsDashlet'] = array('title' => 'LBL_TITLE', // array index in language pack
|
||||
'description' => 'LBL_DESCRIPTION', // array index in language pack
|
||||
'category' => 'Charts',
|
||||
'hidden' => true,
|
||||
);
|
||||
?>
|
||||
187
modules/Home/Dashlets/ChartsDashlet/ChartsDashlet.php
Executable file
187
modules/Home/Dashlets/ChartsDashlet/ChartsDashlet.php
Executable file
@@ -0,0 +1,187 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004 - 2009 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU 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 General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU 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 General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
********************************************************************************/
|
||||
|
||||
require_once('include/Dashlets/Dashlet.php');
|
||||
require_once('include/Sugar_Smarty.php');
|
||||
|
||||
class ChartsDashlet extends Dashlet {
|
||||
var $width = '400';
|
||||
var $height = '480';
|
||||
var $report_id;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @global string current language
|
||||
* @param guid $id id for the current dashlet (assigned from Home module)
|
||||
* @param report_id $report_id id of the saved report
|
||||
* @param array $def options saved for this dashlet
|
||||
*/
|
||||
function ChartsDashlet($id, $report_id, $def) {
|
||||
$this->report_id = $report_id;
|
||||
|
||||
$this->loadLanguage('ChartsDashlet'); // load the language strings here
|
||||
|
||||
parent::Dashlet($id); // call parent constructor
|
||||
|
||||
$this->searchFields = array();
|
||||
$this->isConfigurable = true; // dashlet is configurable
|
||||
$this->hasScript = true; // dashlet has javascript attached to it
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays the dashlet
|
||||
*
|
||||
* @return string html to display dashlet
|
||||
*/
|
||||
function display() {
|
||||
require_once("modules/Reports/Report.php");
|
||||
require_once("modules/Reports/SavedReport.php");
|
||||
|
||||
ajaxInit();
|
||||
|
||||
$chartReport = new SavedReport();
|
||||
$chartExists = $chartReport->retrieve($this->report_id, false);
|
||||
|
||||
if (!is_null($chartExists)){
|
||||
$this->title = $chartReport->name;
|
||||
|
||||
$reporter = new Report($chartReport->content);
|
||||
$reporter->is_saved_report = true;
|
||||
$reporter->saved_report_id = $chartReport->id;
|
||||
$reporter->run_chart_queries();
|
||||
|
||||
require_once("modules/Reports/templates/templates_chart.php");
|
||||
|
||||
ob_start();
|
||||
template_chart($reporter, true, true, $this->id);
|
||||
$str = ob_get_contents();
|
||||
ob_end_clean();
|
||||
|
||||
$xmlFile = get_cache_file_name($reporter);
|
||||
|
||||
$html = parent::display() . "<div align='center'>" . $str . "</div>" . "<br />"; // return parent::display for title and such
|
||||
|
||||
$ss = new Sugar_Smarty();
|
||||
$ss->assign('chartName', $this->id);
|
||||
$ss->assign('chartXMLFile', $xmlFile);
|
||||
$script = $ss->fetch('modules/Home/Dashlets/ChartsDashlet/ChartsDashletScript.tpl');
|
||||
$json = getJSONobj();
|
||||
|
||||
return parent::display() . "<div align='center'>" . $str . "</div>" . "<br />"; // return parent::display for title and such
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays the javascript for the dashlet
|
||||
*
|
||||
* @return string javascript to use with this dashlet
|
||||
*/
|
||||
function displayScript() {
|
||||
require_once("modules/Reports/Report.php");
|
||||
require_once("modules/Reports/SavedReport.php");
|
||||
|
||||
$chartReport = new SavedReport();
|
||||
$chartExists = $chartReport->retrieve($this->report_id, false);
|
||||
|
||||
if (!is_null($chartExists)){
|
||||
$this->title = $chartReport->name;
|
||||
|
||||
require_once("modules/Reports/templates/templates_chart.php");
|
||||
|
||||
$reporter = new Report($chartReport->content);
|
||||
$reporter->is_saved_report = true;
|
||||
$reporter->saved_report_id = $chartReport->id;
|
||||
$xmlFile = get_cache_file_name($reporter);
|
||||
|
||||
$ss = new Sugar_Smarty();
|
||||
$ss->assign('chartName', $this->id);
|
||||
$ss->assign('chartXMLFile', $xmlFile);
|
||||
|
||||
$ss->assign('chartStyleCSS', chartStyle());
|
||||
$ss->assign('chartColorsXML', chartColors());
|
||||
$ss->assign('chartLangFile', $GLOBALS['sugar_config']['tmp_dir'].'chart_strings.' . $GLOBALS['current_language'] .'.lang.xml');
|
||||
|
||||
$str = $ss->fetch('modules/Home/Dashlets/ChartsDashlet/ChartsDashletScript.tpl');
|
||||
return $str;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays the configuration form for the dashlet
|
||||
*
|
||||
* @return string html to display form
|
||||
*/
|
||||
function displayOptions() {
|
||||
}
|
||||
|
||||
/**
|
||||
* called to filter out $_REQUEST object when the user submits the configure dropdown
|
||||
*
|
||||
* @param array $req $_REQUEST
|
||||
* @return array filtered options to save
|
||||
*/
|
||||
function saveOptions($req) {
|
||||
}
|
||||
|
||||
function setConfigureIcon(){
|
||||
global $image_path;
|
||||
|
||||
if($this->isConfigurable)
|
||||
$additionalTitle = '<td nowrap width="1%"><div style="width: 100%;text-align:right"><a href="index.php?module=Reports&record=' . $this->report_id . '&action=ReportCriteriaResults&page=report" class="chartToolsLink">'
|
||||
. get_image($image_path.'edit','title="' . translate('LBL_DASHLET_EDIT', 'Home') . '" alt="' . translate('LBL_DASHLET_EDIT', 'Home') . '" border="0" align="absmiddle"').'</a> '
|
||||
. '';
|
||||
else
|
||||
$additionalTitle = '<td nowrap width="1%"><div style="width: 100%;text-align:right">';
|
||||
|
||||
return $additionalTitle;
|
||||
}
|
||||
|
||||
function setRefreshIcon(){
|
||||
global $image_path;
|
||||
|
||||
$additionalTitle = '';
|
||||
if($this->isRefreshable)
|
||||
$additionalTitle .= '<a href="#" onclick="SUGAR.mySugar.retrieveDashlet(\''
|
||||
. $this->id . '\', \'chart\'); return false;"><img width="13" height="13" border="0" align="absmiddle" title="' . translate('LBL_DASHLET_REFRESH', 'Home') . '" alt="' . translate('LBL_DASHLET_REFRESH', 'Home') . '" src="'
|
||||
. $image_path . 'refresh.gif"/></a> ';
|
||||
return $additionalTitle;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
36
modules/Home/Dashlets/ChartsDashlet/ChartsDashlet.pl_pl.lang.php
Executable file
36
modules/Home/Dashlets/ChartsDashlet/ChartsDashlet.pl_pl.lang.php
Executable file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/**
|
||||
* The contents of this file are subject to the SugarCRM Professional Subscription
|
||||
* Agreement ("License") which can be viewed at
|
||||
* http://www.sugarcrm.com/crm/products/sugar-professional-eula.html
|
||||
* By installing or using this file, You have unconditionally agreed to the
|
||||
* terms and conditions of the License, and You may not use this file except in
|
||||
* compliance with the License. Under the terms of the license, You shall not,
|
||||
* among other things: 1) sublicense, resell, rent, lease, redistribute, assign
|
||||
* or otherwise transfer Your rights to the Software, and 2) use the Software
|
||||
* for timesharing or service bureau purposes such as hosting the Software for
|
||||
* commercial gain and/or for the benefit of a third party. Use of the Software
|
||||
* may be subject to applicable fees and any use of the Software without first
|
||||
* paying applicable fees is strictly prohibited. You do not have the right to
|
||||
* remove SugarCRM copyrights from the source code or user interface.
|
||||
*
|
||||
* All copies of the Covered Code must include on each user interface screen:
|
||||
* (i) the "Powered by SugarCRM" logo and
|
||||
* (ii) the SugarCRM copyright notice
|
||||
* in the same form as they appear in the distribution. See full license for
|
||||
* requirements.
|
||||
*
|
||||
* Your Warranty, Limitations of liability and Indemnity are expressly stated
|
||||
* in the License. Please refer to the License for the specific language
|
||||
* governing these rights and limitations under the License. Portions created
|
||||
* by SugarCRM are Copyright (C) 2004-2007 SugarCRM, Inc.; All Rights Reserved.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
$dashletStrings['ChartsDashlet'] = array('LBL_TITLE' => 'Wykresy',
|
||||
'LBL_DESCRIPTION' => 'Zakładka Wyświetlająca Wykresy',
|
||||
'LBL_CONFIGURE_TITLE' => 'Tytuł', );
|
||||
?>
|
||||
44
modules/Home/Dashlets/ChartsDashlet/ChartsDashletScript.tpl
Executable file
44
modules/Home/Dashlets/ChartsDashlet/ChartsDashletScript.tpl
Executable file
@@ -0,0 +1,44 @@
|
||||
{*
|
||||
|
||||
/**
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004 - 2009 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU 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 General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU 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 General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
*/
|
||||
|
||||
// $Id$
|
||||
|
||||
*}
|
||||
|
||||
<script>
|
||||
SUGAR.mySugar.addToChartsArray('{$chartName}', '{$chartXMLFile}', '100%', '480', '{$chartStyleCSS}', '{$chartColorsXML}', '{$chartLangFile}');
|
||||
</script>
|
||||
Reference in New Issue
Block a user