DirectorJob: fix timeperiod handling

This commit is contained in:
Thomas Gelf 2016-06-17 14:23:03 +02:00
parent df631f506e
commit 8ac5d954e9

View File

@ -89,9 +89,7 @@ class DirectorJob extends DbObjectWithSettings
public function isWithinTimeperiod() public function isWithinTimeperiod()
{ {
if ($this->hasTimeperiod()) { if ($this->hasTimeperiod()) {
if (! $this->timeperiod()->isActive()) { return $this->timeperiod()->isActive();
return false;
}
} else { } else {
return true; return true;
} }
@ -109,6 +107,6 @@ class DirectorJob extends DbObjectWithSettings
protected function timeperiod() protected function timeperiod()
{ {
return IcingaTimeperiod::load($this->timeperiod_id, $this->db); return IcingaTimePeriod::loadWithAutoIncId($this->timeperiod_id, $this->connection);
} }
} }