/**
  * @see ReportPlugin::display()
  */
 function display(&$args, &$request)
 {
     parent::display($args, $request);
     $journal =& $request->getJournal();
     if (!Validation::isSiteAdmin()) {
         Validation::redirectLogin();
     }
     $this->setBreadcrumbs();
     if ($request->getUserVar('type')) {
         $oldStats = (bool) $request->getUserVar('useOldCounterStats');
         $year = (string) $request->getUserVar('year');
         $type = (string) $request->getUserVar('type');
         switch ($type) {
             case 'report':
                 $this->_report($request, $year, $oldStats);
                 break;
             case 'reportxml':
                 $this->_reportXml($request, $year, $oldStats);
                 break;
             case 'sushixml':
                 $this->_sushiXML($oldStats);
                 break;
         }
     } else {
         $years = $this->_getYears();
         $legacyYears = $this->_getYears(true);
         $templateManager =& TemplateManager::getManager();
         $templateManager->assign('years', $years);
         if (!empty($legacyYears)) {
             $templateManager->assign('legacyYears', $legacyYears);
         }
         $templateManager->display($this->getTemplatePath() . 'index.tpl');
     }
 }
 /**
  * @see ReportPlugin::display()
  */
 function display(&$args)
 {
     parent::display($args);
     $journal =& Request::getJournal();
     $reportArgs = array('metricType' => OJS_METRIC_TYPE_COUNTER, 'columns' => array(STATISTICS_DIMENSION_ASSOC_ID, STATISTICS_DIMENSION_ASSOC_TYPE, STATISTICS_DIMENSION_CONTEXT_ID, STATISTICS_DIMENSION_ISSUE_ID, STATISTICS_DIMENSION_MONTH, STATISTICS_DIMENSION_COUNTRY), 'filters' => serialize(array(STATISTICS_DIMENSION_CONTEXT_ID => $journal->getId())), 'orderBy' => serialize(array(STATISTICS_DIMENSION_MONTH => STATISTICS_ORDER_ASC)));
     Request::redirect(null, null, 'generateReport', null, $reportArgs);
 }
 /**
  * @see ReportPlugin::display()
  */
 function display($args, $request)
 {
     parent::display($args);
     $router = $request->getRouter();
     $context = $router->getContext($request);
     $metricType = $this->getMetricTypes();
     import('classes.statistics.StatisticsHelper');
     $statsHelper = new StatisticsHelper();
     $columns = array_keys($statsHelper->getColumnNames());
     $reportArgs = array('metricType' => $metricType, 'columns' => $columns, 'filters' => serialize(array(STATISTICS_DIMENSION_CONTEXT_ID => $context->getId())), 'orderBy' => serialize(array(STATISTICS_DIMENSION_MONTH => STATISTICS_ORDER_ASC)));
     Request::redirect(null, null, 'tools', 'generateReport', $reportArgs);
 }
 function display(&$args, $request)
 {
     parent::display($args);
     $form = new TimedViewReportForm($this);
     if ($request->getUserVar('generate')) {
         $form->readInputData();
         if ($form->validate()) {
             $form->execute();
         } else {
             $form->display($request);
         }
     } elseif ($request->getUserVar('clearLogs')) {
         $dateClear = (int) $request->getUserVar('dateClearYear') . '-' . (int) $request->getUserVar('dateClearMonth') . '-' . (int) $request->getUserVar('dateClearDay') . ' 00:00:00';
         $timedViewReportDao = DAORegistry::getDAO('TimedViewReportDAO');
         $journal = $request->getJournal();
         $timedViewReportDao->clearLogs($dateClear, $journal->getId());
         $form->display($request);
     } else {
         $form->initData();
         $form->display($request);
     }
 }
 function display(&$args, $request)
 {
     parent::display($args);
     $this->setBreadcrumbs();
     $form = new TimedViewReportForm($this);
     if ($request->getUserVar('generate')) {
         $form->readInputData();
         if ($form->validate()) {
             $form->execute($request);
         } else {
             $form->display();
         }
     } elseif ($request->getUserVar('clearLogs')) {
         $dateClear = date('Ymd', mktime(0, 0, 0, $request->getUserVar('dateClearMonth'), $request->getUserVar('dateClearDay'), $request->getUserVar('dateClearYear')));
         $journal =& $request->getJournal();
         $metricsDao =& DAORegistry::getDAO('MetricsDAO');
         /* @var $metricsDao MetricsDAO */
         $metricsDao->purgeRecords(OJS_METRIC_TYPE_TIMED_VIEWS, $dateClear);
         $form->display();
     } else {
         $form->initData();
         $form->display();
     }
 }
 /**
  * @see ReportPlugin::display()
  */
 function display(&$args)
 {
     return parent::display($args);
 }