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: 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('year', $optionsArray['year']); $ss->assign('height', $this->height); $_SESSION['EcmCharts_5_d_year']=$optionsArray['year']; $_SESSION['EcmCharts_5_d_category']=$category; $_SESSION['EcmCharts_5_d_show']=$optionsArray['show']; $_SESSION['EcmCharts_5_d_account']=$optionsArray['account_id']; if(!isset($_SESSION['EcmCharts_5_d_year']))$_SESSION['EcmCharts_5_d_year']=(int)date("Y"); if(!isset($_SESSION['EcmCharts_5_d_category']))$_SESSION['EcmCharts_5_d_category']=''; if(!isset($_SESSION['EcmCharts_5_d_account']))$_SESSION['EcmCharts_5_d_account']=''; if(!isset($_SESSION['EcmCharts_5_d_show']))$_SESSION['EcmCharts_5_d_show']=Array (0=>'sales'); //$_SESSION['EcmCharts_5_d_mmm']=$mmm; //return parent::display("") . $str . '
'; $str = $ss->fetch('modules/EcmCharts/Dashlets/MyChartsAccountsDashlet/MyChartsAccountsDashlet.tpl'); return parent::display($this->dashletStrings['LBL_DBLCLICK_HELP']) . $str . '
'; // return parent::display for title and such } function displayOptions() { global $app_strings,$current_user; $ss = new Sugar_Smarty(); $ss->assign('year',$_SESSION['EcmCharts_5_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/MyChartsAccountsDashlet/MyChartsAccountsDashletOptions.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; } } ?>