public function testBuildReport() { $conf = ['user' => ["", 1, 0, 1, 1], 'date' => ["", 1, 0, 1, 1], 'record_id' => ["", 1, 1, 1, 1], 'file' => ["", 1, 0, 1, 1], 'mime' => ["", 1, 0, 1, 1], 'size' => ["", 1, 0, 1, 1]]; foreach ($this->ret as $sbasid => $colllist) { $report = new module_report_activity(self::$DI['app'], $this->dmin, $this->dmax, $sbasid, $colllist); $report->setUser_id(self::$DI['user']->getId()); $this->activerPerHours($report); $this->ConnexionBase($report); $this->activiteAddedDocument($report, $sbasid, $colllist); $this->activiteAddedTopTenUser($report, $sbasid, $colllist); $this->activiteEditedDocument($report, $sbasid, $colllist); $this->activiteTopTenSiteView($report, $sbasid, $colllist); $this->activity($report, $sbasid, $colllist); $this->activityDay($report, $sbasid, $colllist); $this->activityQuestion($report, $sbasid, $colllist); $this->detailDownload($report); $this->downloadByBaseByDay($report); $this->otherTest($report); $this->topQuestion($report); $this->topTenUser($report, $sbasid, $colllist); } }
/** * Display an overview of downloaded document grouped by day * * @param Application $app * @param Request $request * @return JsonResponse */ public function doReportSiteActiviyPerDays(Application $app, Request $request) { $conf = ['ddate' => [$app->trans('report:: jour'), 0, 0, 0, 0], 'total' => [$app->trans('report:: total des telechargements'), 0, 0, 0, 0], 'preview' => [$app->trans('report:: preview'), 0, 0, 0, 0], 'document' => [$app->trans('report:: document original'), 0, 0, 0, 0]]; $activity = new \module_report_activity($app, $request->request->get('dmin'), $request->request->get('dmax'), $request->request->get('sbasid'), $request->request->get('collection')); //set Limit if ($activity->getEnableLimit() && '' !== ($page = $request->request->get('page', '')) && '' !== ($limit = $request->request->get('limit', ''))) { $activity->setLimit($page, $limit); } else { $activity->setLimit(false, false); } $activity->setConfig(false); if ($request->request->get('printcsv') == 'on') { $activity->setHasLimit(false); $activity->setPrettyString(false); $activity->getDownloadByBaseByDay($conf); return $this->getCSVResponse($app, $activity, 'activity_db_by_base_by_day'); } $report = $activity->getDownloadByBaseByDay($conf); return $app->json(['rs' => $app['twig']->render('report/ajax_data_content.html.twig', ['result' => isset($report['report']) ? $report['report'] : $report, 'is_infouser' => false, 'is_nav' => false, 'is_groupby' => false, 'is_plot' => false, 'is_doc' => false]), 'display_nav' => false, 'title' => false]); }
/** * @desc fill the dash results for the current sbas * @return <void> */ public function process() { try { //Get number of DLs $this->report['nb_dl'] = module_report_download::getNbDl($this->app, $this->dminsql, $this->dmaxsql, $this->sbasid, $this->collection); //Get Number of connexions $this->report['nb_conn'] = module_report_connexion::getNbConn($this->app, $this->dminsql, $this->dmaxsql, $this->sbasid, $this->collection); if ($this->app['conf']->get(['registry', 'modules', 'anonymous-report']) == false) { /** * get Top ten user of * number of dl doc, prev * number of weight dl by doc, prev */ $top = module_report_activity::topTenUser($this->app, $this->dminsql, $this->dmaxsql, $this->sbasid, $this->collection); $this->report['top_ten_user_doc'] = $top['top_ten_doc']; $this->report['top_ten_user_prev'] = $top['top_ten_prev']; $this->report['top_ten_user_poiddoc'] = $top['top_ten_poiddoc']; $this->report['top_ten_user_poidprev'] = $top['top_ten_poidprev']; } /** * get avtivity by hour */ $this->report['activity'] = module_report_activity::activity($this->app, $this->dminsql, $this->dmaxsql, $this->sbasid, $this->collection); // get activty by day $this->report['activity_day'] = module_report_activity::activityDay($this->app, $this->dminsql, $this->dmaxsql, $this->sbasid, $this->collection); // get Most document and preview DL $topdl = module_report_download::getTopDl($this->app, $this->dminsql, $this->dmaxsql, $this->sbasid, $this->collection); $this->report['top_dl_preview'] = $topdl['preview']; $this->report['top_dl_document'] = $topdl['document']; if ($this->app['conf']->get(['registry', 'modules', 'anonymous-report']) == false) { // get users that ask the most questions $this->report['ask'] = module_report_activity::activityQuestion($this->app, $this->dminsql, $this->dmaxsql, $this->sbasid, $this->collection); } //get the refferer $this->report['top_ten_site'] = module_report_activity::activiteTopTenSiteView($this->app, $this->dminsql, $this->dmaxsql, $this->sbasid, $this->collection); //Get the most asked questions $this->report['top_ten_question'] = module_report_activity::activiteTopQuestion($this->app, $this->dminsql, $this->dmaxsql, $this->sbasid, $this->collection); //get the number of added docuùments $this->report['activity_added'] = module_report_activity::activiteAddedDocument($this->app, $this->dminsql, $this->dmaxsql, $this->sbasid, $this->collection); //get number of edited document $this->report['activity_edited'] = module_report_activity::activiteEditedDocument($this->app, $this->dminsql, $this->dmaxsql, $this->sbasid, $this->collection); if ($this->app['conf']->get(['registry', 'modules', 'anonymous-report']) == false) { //get users that add the most documents $this->report['top_ten_added'] = module_report_activity::activiteAddedTopTenUser($this->app, $this->dminsql, $this->dmaxsql, $this->sbasid, $this->collection); } } catch (DBALException $e) { } return; }