/** * Eens in de zoveel tijd moet de volledige personenlijst geŸpdatet worden * @return bool */ protected function getCompetionListUpdateNeeded() { $oLastLog = RetrieveLog::getLast(array('type' => 'COMPETITION', 'finished' => 1, 'successfully' => 1)); if ($oLastLog) { if ($oLastLog->getAgeInDays() < $this->competition_retrieve_frequency) { // het zou niet hoeven, maar wel als er te weinig competities of poules zijn $countCompetitions = Database::select_count('Competition'); if ($countCompetitions < 7) { return true; } $countPoules = Database::select_count('Poule'); if ($countPoules < 10) { return true; } return false; } return true; } return true; }
/** * (non-PHPdoc) * @see Renderer::showOutput() */ public function showOutput() { $fullDir = $this->getFullRenderDirectory(); $fullPath = $this->getFullRenderPath(); // If render is set to be cleared, we need to parse the template to an html file if ($this->getClearRender()) { $this->assignSettings(); $this->assign('subject', $this->subject); $this->assign('oCurrentSeason', Season::getInstance()); $this->assign('nefubRoot', NEFUB_ROOT); $this->assign('host', HOST); $oLastRetrieved = RetrieveLog::getLast(); $this->assign('lastRetrieved', $oLastRetrieved->finish_time); $this->assign('downloadFileTypes', array('pdf' => 'PDF', 'csv' => 'Excel')); //, 'docx' => 'Word')); $output = $this->smarty->fetch('templates' . $this->template); // We need to create the directory recursively if it doesn't exist if (!file_exists($fullDir)) { mkdir($fullDir, 0777, true); } $r = fopen($fullPath, 'w+'); fwrite($r, $output); fclose($r); // need to be able to edit without being apache chmod($fullPath, 0777); } // Open the html file for output to screen require_once $fullPath; exit; }
protected function showRetrieveLogs() { switch ($this->mode) { case 'bewerken': $oRetrieveLog = new RetrieveLog($this->editId); //$this->assign('backUrl', '/beheer/instellingen/'); $this->editObject($oRetrieveLog); break; default: $aRetrieveLogs = RetrieveLog::getAll(array(), 'start_time', 'desc'); $this->assign('aRetrieveLogs', $aRetrieveLogs); $this->template = '/retrievelogs.tpl'; $this->showOutput(); } }