function statistics_on_show(&$api) { include dirname(__FILE__) . '/statistics_controller.class.php'; $api->breadcrumbs()->add_text(_('Statistics')); $controller = new StatisticsController($api); $controller->show(); }
// echo json_encode(array('type' => $type, 'id' => $id), JSON_NUMERIC_CHECK); // Band-Controller instanziieren $ctrlCD = new CDController(); // CD-Info aus Datenbank holen // Mögliche Typen (type): // - songs // - ... $ctrlCD->GetCdInfo((object) array('type' => $type, 'id' => $id)); }); /** * (GET) * Gruppiert CDs nach Erscheinungsjahr */ $app->get('/statistics/group-cds-by-year', function () use($app) { // CD-Controller instanziieren $ctrlCD = new StatisticsController(); // Alle CDs aus Datenbank holen $ctrlCD->GetStats("group-cds-by-year"); }); /** * (POST) * Speichert eine CD in der Datenbank */ $app->post('/cd', function () use($app) { // $req = $app->request(); // $body = $req->getBody(); // $_request = json_decode($body); // Band-Controller instanziieren $ctrlCD = new CDController(); echo json_encode($_REQUEST, JSON_NUMERIC_CHECK); // echo json_encode(array('type' => $_REQUEST['type'], 'id' => $_REQUEST['id']), JSON_NUMERIC_CHECK);
} $values = array(); $legend = array(); foreach ($formattedTimetracks as $date => $value) { $values[Tools::formatDate("%Y-%m-01", $date)] = $value; $legend[Tools::formatDate("%B %Y", $date)] = round($value, 1); } $this->smartyHelper->assign('workload_jqplotData', Tools::array2plot($values)); $timestamp = Tools::getStartEndKeys($values); $start = Tools::formatDate("%Y-%m-01", Tools::date2timestamp($timestamp[0])); $end = Tools::formatDate("%Y-%m-01", strtotime($timestamp[1] . " +1 month")); $this->smartyHelper->assign('workload_plotMinDate', $start); $this->smartyHelper->assign('workload_plotMaxDate', $end); $this->smartyHelper->assign('workload_Legend', $legend); } // --- BEGIN FDJ SPECIFIC --- private function generateEffortEstimReliabilityGraph($teamid, $timeTrackingTable) { $prodRateIndic = new EffortEstimReliabilityIndicator(); $params = array('teamid' => $teamid, 'timeTrackingTable' => $timeTrackingTable); $prodRateIndic->execute(new IssueSelection('FAKE_UNUSED'), $params); $smartyObj = $prodRateIndic->getSmartyObject(); foreach ($smartyObj as $smartyKey => $smartyVariable) { $this->smartyHelper->assign($smartyKey, $smartyVariable); } } } // ========== MAIN =========== StatisticsController::staticInit(); $controller = new StatisticsController('../', 'History', 'ProdReports'); $controller->execute();