Tools::sendBadRequest("PluginDataProvider not set"); } $pluginDataProvider = unserialize($_SESSION[PluginDataProviderInterface::SESSION_ID . $dashboardId]); if (FALSE == $pluginDataProvider) { $logger->error("PluginDataProvider unserialize error (dashboardId = {$dashboardId}"); Tools::sendBadRequest("PluginDataProvider unserialize error"); } $smartyHelper = new SmartyHelper(); if ('getTimetrackDetailsIndicator' == $action) { $startTimestamp = Tools::date2timestamp(Tools::getSecureGETStringValue("timetrackDetails_startdate")); $endTimestamp = Tools::date2timestamp(Tools::getSecureGETStringValue("timetrackDetails_enddate")); $displayedTeam = Tools::getSecureGETIntValue("timetrackDetails_displayedTeam", 0); // update dataProvider $pluginDataProvider->setParam(PluginDataProviderInterface::PARAM_START_TIMESTAMP, $startTimestamp); $pluginDataProvider->setParam(PluginDataProviderInterface::PARAM_END_TIMESTAMP, $endTimestamp); $indicator = new TimetrackDetailsIndicator($pluginDataProvider); // override plugin settings with current attributes $indicator->setPluginSettings(array(TimetrackDetailsIndicator::OPTION_DISPLAYED_TEAM => $displayedTeam)); $indicator->execute(); $data = $indicator->getSmartyVariablesForAjax(); // construct the html table foreach ($data as $smartyKey => $smartyVariable) { $smartyHelper->assign($smartyKey, $smartyVariable); } $html = $smartyHelper->fetch(TimetrackDetailsIndicator::getSmartySubFilename()); $data['timetrackDetails_htmlContent'] = $html; // set JS libraries that must be load $data['timetrackDetails_jsFiles'] = TimetrackDetailsIndicator::getJsFiles(); $data['timetrackDetails_cssFiles'] = TimetrackDetailsIndicator::getCssFiles(); // return html & chart data $jsonData = json_encode($data);
/** * Initialize static variables * @static */ public static function staticInit() { self::$logger = Logger::getLogger(__CLASS__); self::$domains = array(self::DOMAIN_ADMIN); self::$categories = array(self::CATEGORY_ADMIN); }