translate('Jobs'); } public function listCssClasses() { try { return $this->fetchStateClass(); } catch (Exception $e) { return 'state-critical'; } } public function getSummary() { return $this->translate( 'Schedule and automate Import, Syncronization, Config Deployment,' . ' Housekeeping and more' ); } protected function fetchStateClass() { /** @var DirectorJob[] $jobs */ $jobs = DirectorJob::loadAll($this->db); if (count($jobs) > 0) { $state = 'state-ok'; } else { $state = null; } foreach ($jobs as $job) { if ($job->isPending()) { $state = 'state-pending'; } elseif (! $job->lastAttemptSucceeded()) { $state = 'state-critical'; break; } } return $state; } public function getUrl() { return 'director/jobs'; } }