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();
     }
 }
 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);
     }
 }