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: Czas rozmów & Sprzedaż '; 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); $ss->assign('year', $optionsArray['year']); $_SESSION['EcmCharts_6_year']=$optionsArray['year']; $_SESSION['EcmCharts_6_category']=$category; $_SESSION['EcmCharts_6_account']=$optionsArray['account_id']; if(!isset($_SESSION['EcmCharts_6_year']))$_SESSION['EcmCharts_6_year']=(int)date("Y"); if(!isset($_SESSION['EcmCharts_6_category']))$_SESSION['EcmCharts_6_category']=''; if(!isset($_SESSION['EcmCharts_6_account']))$_SESSION['EcmCharts_6_account']=''; //$_SESSION['EcmCharts_6_mmm']=$mmm; $str = $ss->fetch('modules/EcmCharts/Dashlets/MyChartsProductsDashlet/MyChartsProductsDashlet.tpl'); return parent::display('') . $str . '
'; // return parent::display for title and such } function displayOptions() { global $app_strings,$current_user; $ss = new Sugar_Smarty(); $ss->assign('year',$_SESSION['EcmCharts_6_year']); $ss->assign('id', $this->id); //The id must be assigned in all dashlet options pages return parent::displayOptions() . $ss->fetch('modules/EcmCharts/Dashlets/MyChartsProductsDashlet/MyChartsProductsDashletOptions.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['category']=$_REQUEST['category']; return $options; } } ?>