/** * Initialize complex static variables * @static */ public static function staticInit() { self::$logger = Logger::getLogger(__CLASS__); self::$domains = array(self::DOMAIN_USER, self::DOMAIN_TEAM, self::DOMAIN_COMMAND, self::DOMAIN_COMMAND_SET, self::DOMAIN_SERVICE_CONTRACT); self::$categories = array(self::CATEGORY_ACTIVITY); }
$teamid = isset($_SESSION['teamid']) ? $_SESSION['teamid'] : 0; $logger = Logger::getLogger("LoadPerProjectIndicator_ajax"); $action = Tools::getSecureGETStringValue('action', ''); if (!empty($action)) { $smartyHelper = new SmartyHelper(); if ($action == 'getLoadPerProjectIndicator') { if (isset($_SESSION[PluginDataProviderInterface::SESSION_ID])) { $pluginDataProvider = unserialize($_SESSION[PluginDataProviderInterface::SESSION_ID]); if (FALSE != $pluginDataProvider) { // TODO do not log exception if date = 01-01-1970 $startTimestamp = Tools::date2timestamp(Tools::getSecureGETStringValue("loadPerProject_startdate")); $endTimestamp = Tools::date2timestamp(Tools::getSecureGETStringValue("loadPerProject_enddate")); // update dataProvider $pluginDataProvider->setParam(PluginDataProviderInterface::PARAM_START_TIMESTAMP, $startTimestamp); $pluginDataProvider->setParam(PluginDataProviderInterface::PARAM_END_TIMESTAMP, $endTimestamp); $indicator = new LoadPerProjectIndicator($pluginDataProvider); $indicator->execute(); $data = $indicator->getSmartyVariablesForAjax(); // construct the html table foreach ($data as $smartyKey => $smartyVariable) { $smartyHelper->assign($smartyKey, $smartyVariable); #$logger->debug("key $smartyKey = ".var_export($smartyVariable, true)); } $html = $smartyHelper->fetch(LoadPerProjectIndicator::getSmartySubFilename()); $data['loadPerProject_htmlContent'] = $html; // return html & chart data $jsonData = json_encode($data); echo $jsonData; } else { Tools::sendBadRequest("PluginDataProvider unserialize error"); }