/**
  * @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);
 }
Пример #3
0
 /**
  * Called as a plugin is registered to the registry
  * @param $category String Name of category plugin was registered to
  * @return boolean True if plugin initialized successfully; if false,
  * 	the plugin will not be registered.
  */
 function register($category, $path)
 {
     $success = parent::register($category, $path);
     if ($success) {
         $this->import('ArticleReportDAO');
         $articleReportDAO = new ArticleReportDAO();
         DAORegistry::registerDAO('ArticleReportDAO', $articleReportDAO);
     }
     $this->addLocaleData();
     return $success;
 }
 /**
  * Called as a plugin is registered to the registry
  * @param $category String Name of category plugin was registered to
  * @return boolean True if plugin initialized successfully; if false,
  * 	the plugin will not be registered.
  */
 function register($category, $path)
 {
     $success = parent::register($category, $path);
     if ($success && Config::getVar('general', 'installed')) {
         $this->import('ArticleReportDAO');
         $articleReportDAO = new ArticleReportDAO();
         DAORegistry::registerDAO('ArticleReportDAO', $articleReportDAO);
     }
     $this->addLocaleData();
     return $success;
 }
Пример #5
0
 /**
  * Called as a plugin is registered to the registry
  * @param $category String Name of category plugin was registered to
  * @return boolean True if plugin initialized successfully; if false,
  * 	the plugin will not be registered.
  */
 function register($category, $path)
 {
     $success = parent::register($category, $path);
     if ($success) {
         $this->import('ReportClass.MultiPaperReportDAO');
         $PaperReportDAO = new MultiPaperReportDAO();
         DAORegistry::registerDAO('MultiPaperReportDAO', $PaperReportDAO);
     }
     $this->addLocaleData();
     return $success;
 }
 /**
  * @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 PKPPlugin::register()
  */
 function register($category, $path)
 {
     $success = parent::register($category, $path);
     $this->addLocaleData();
     return $success;
 }
 /**
  * @see ReportPlugin::display()
  */
 function display(&$args)
 {
     return parent::display($args);
 }