79 lines
2.8 KiB
PHP
Executable File
79 lines
2.8 KiB
PHP
Executable File
<?php
|
|
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
|
|
|
require_once('include/Dashlets/Dashlet.php');
|
|
require_once('include/Sugar_Smarty.php');
|
|
|
|
|
|
class MyChartsCallTimeDashlet extends Dashlet {
|
|
|
|
var $savedText; // users's saved text
|
|
var $height = '300'; // height of the pad
|
|
|
|
function MyChartsCallTimeDashlet($id, $def) {
|
|
|
|
global $current_user;
|
|
|
|
|
|
parent::Dashlet($id); // call parent constructor
|
|
|
|
$this->isConfigurable = true; // dashlet is configurable
|
|
$this->hasScript = false; // dashlet has java ipt attached to it
|
|
|
|
if($current_user->id=='2e72f487-d92b-954e-f50c-528b10ce81c9'){
|
|
|
|
|
|
}
|
|
// if no custom title, use default
|
|
if(empty($def['title'])) $this->title = 'Wykres: Produkty ';
|
|
else $this->title = $def['title'];
|
|
}
|
|
|
|
function display() {
|
|
global $current_user;
|
|
$ss = new Sugar_Smarty();
|
|
$optionsArray = $this->loadOptions();
|
|
//$ss->assign('account_id',$optionsArray['account_id']);
|
|
$ss->assign('id', $this->id);
|
|
$ss->assign('height', $this->height);
|
|
|
|
$_SESSION['EcmCharts_1_d_year']=$optionsArray['year'];
|
|
$_SESSION['EcmCharts_1_d_category']=$category;
|
|
$_SESSION['EcmCharts_1_d_show']=$optionsArray['show'];
|
|
$_SESSION['EcmCharts_1_d_account']=$optionsArray['account_id'];
|
|
if(!isset($_SESSION['EcmCharts_1_d_year']))$_SESSION['EcmCharts_1_d_year']=(int)date("Y");
|
|
if(!isset($_SESSION['EcmCharts_1_d_category']))$_SESSION['EcmCharts_1_d_category']='';
|
|
if(!isset($_SESSION['EcmCharts_1_d_account']))$_SESSION['EcmCharts_1_d_account']='';
|
|
if(!isset($_SESSION['EcmCharts_1_d_show']))$_SESSION['EcmCharts_1_d_show']=Array (0=>'sales');
|
|
//$_SESSION['EcmCharts_1_d_mmm']=$mmm;
|
|
include_once('include/ECM/open_flash_chart/ofc-library/open_flash_chart_object.php');
|
|
$str = $ss->fetch('modules/EcmCharts/Dashlets/MyChartsCallTimeDashlet/MyChartsCallTimeDashlet.tpl');
|
|
return parent::display($this->dashletStrings['LBL_DBLCLICK_HELP']) . $str . '<br />'; // return parent::display for title and such
|
|
}
|
|
|
|
function displayOptions() {
|
|
|
|
global $app_strings,$current_user;
|
|
|
|
$ss = new Sugar_Smarty();
|
|
|
|
$ss->assign('year',$_SESSION['EcmCharts_1_d_year']);
|
|
$ss->assign('id', $this->id); //The id must be assigned in all dashlet options pages
|
|
|
|
return parent::displayOptions() . $ss->fetch('modules/EcmCharts/Dashlets/MyChartsCallTimeDashlet/MyChartsCallTimeDashletOptions.tpl');
|
|
|
|
}
|
|
|
|
function saveOptions($req) {
|
|
global $sugar_config, $timedate, $current_user, $theme;
|
|
$options = array();
|
|
$options['account_name']=$_REQUEST['account_name'];
|
|
$options['account_id']=$_REQUEST['account_id'];
|
|
$options['year']=$_REQUEST['year'];
|
|
$options['show']=$_REQUEST['show'];
|
|
$options['category']=$_REQUEST['category'];
|
|
|
|
return $options;
|
|
}
|
|
}
|
|
?>
|