mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-26 23:34:10 +02:00
parent
cb16733420
commit
6786cc768f
@ -47,8 +47,8 @@ class CoreApi implements DeploymentApiInterface
|
||||
{
|
||||
$version = $this->getVersion();
|
||||
|
||||
if (version_compare($version, '2.8.2', '>=')
|
||||
&& version_compare($version, '2.10.2', '<')
|
||||
if ($version === null || (version_compare($version, '2.8.2', '>=')
|
||||
&& version_compare($version, '2.10.2', '<'))
|
||||
) {
|
||||
$this->client->disconnect();
|
||||
$this->client->setKeepAlive(false);
|
||||
|
@ -8,7 +8,11 @@ class Json
|
||||
{
|
||||
public static function encode($mixed, $flags = null)
|
||||
{
|
||||
$result = \json_encode($mixed, $flags);
|
||||
if ($flags === null) {
|
||||
$result = \json_encode($mixed);
|
||||
} else {
|
||||
$result = \json_encode($mixed, $flags);
|
||||
}
|
||||
|
||||
if ($result === false && json_last_error() !== JSON_ERROR_NONE) {
|
||||
throw JsonEncodeException::forLastJsonError();
|
||||
|
@ -89,6 +89,7 @@ class CustomVariableDictionary extends CustomVariable implements Countable
|
||||
return $keys;
|
||||
}
|
||||
|
||||
#[\ReturnTypeWillChange]
|
||||
public function count()
|
||||
{
|
||||
return count($this->value);
|
||||
|
@ -69,6 +69,7 @@ class CustomVariables implements Iterator, Countable, IcingaConfigRenderer
|
||||
}
|
||||
}
|
||||
|
||||
#[\ReturnTypeWillChange]
|
||||
public function count()
|
||||
{
|
||||
$count = 0;
|
||||
@ -81,11 +82,13 @@ class CustomVariables implements Iterator, Countable, IcingaConfigRenderer
|
||||
return $count;
|
||||
}
|
||||
|
||||
#[\ReturnTypeWillChange]
|
||||
public function rewind()
|
||||
{
|
||||
$this->position = 0;
|
||||
}
|
||||
|
||||
#[\ReturnTypeWillChange]
|
||||
public function current()
|
||||
{
|
||||
if (! $this->valid()) {
|
||||
@ -95,16 +98,19 @@ class CustomVariables implements Iterator, Countable, IcingaConfigRenderer
|
||||
return $this->vars[$this->idx[$this->position]];
|
||||
}
|
||||
|
||||
#[\ReturnTypeWillChange]
|
||||
public function key()
|
||||
{
|
||||
return $this->idx[$this->position];
|
||||
}
|
||||
|
||||
#[\ReturnTypeWillChange]
|
||||
public function next()
|
||||
{
|
||||
++$this->position;
|
||||
}
|
||||
|
||||
#[\ReturnTypeWillChange]
|
||||
public function valid()
|
||||
{
|
||||
return array_key_exists($this->position, $this->idx);
|
||||
|
@ -60,7 +60,7 @@ class DaemonProcessState
|
||||
protected function refreshMessage()
|
||||
{
|
||||
$messageParts = [];
|
||||
if (\strlen($this->state)) {
|
||||
if ($this->state !== null && \strlen($this->state)) {
|
||||
$messageParts[] = $this->state;
|
||||
}
|
||||
foreach ($this->components as $component => $message) {
|
||||
|
@ -782,7 +782,7 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer
|
||||
|
||||
private function setUnresolvedRelation($key, $value)
|
||||
{
|
||||
if (strlen($value) === 0) {
|
||||
if ($value === null || strlen($value) === 0) {
|
||||
unset($this->unresolvedRelatedProperties[$key . '_id']);
|
||||
return parent::set($key . '_id', null);
|
||||
}
|
||||
|
@ -37,11 +37,13 @@ class IcingaObjectGroups implements Iterator, Countable, IcingaConfigRenderer
|
||||
}
|
||||
}
|
||||
|
||||
#[\ReturnTypeWillChange]
|
||||
public function count()
|
||||
{
|
||||
return count($this->groups);
|
||||
}
|
||||
|
||||
#[\ReturnTypeWillChange]
|
||||
public function rewind()
|
||||
{
|
||||
$this->position = 0;
|
||||
@ -52,6 +54,7 @@ class IcingaObjectGroups implements Iterator, Countable, IcingaConfigRenderer
|
||||
return $this->modified;
|
||||
}
|
||||
|
||||
#[\ReturnTypeWillChange]
|
||||
public function current()
|
||||
{
|
||||
if (! $this->valid()) {
|
||||
@ -61,16 +64,19 @@ class IcingaObjectGroups implements Iterator, Countable, IcingaConfigRenderer
|
||||
return $this->groups[$this->idx[$this->position]];
|
||||
}
|
||||
|
||||
#[\ReturnTypeWillChange]
|
||||
public function key()
|
||||
{
|
||||
return $this->idx[$this->position];
|
||||
}
|
||||
|
||||
#[\ReturnTypeWillChange]
|
||||
public function next()
|
||||
{
|
||||
++$this->position;
|
||||
}
|
||||
|
||||
#[\ReturnTypeWillChange]
|
||||
public function valid()
|
||||
{
|
||||
return array_key_exists($this->position, $this->idx);
|
||||
|
@ -36,11 +36,13 @@ class IcingaObjectImports implements Iterator, Countable, IcingaConfigRenderer
|
||||
$this->object = $object;
|
||||
}
|
||||
|
||||
#[\ReturnTypeWillChange]
|
||||
public function count()
|
||||
{
|
||||
return count($this->imports);
|
||||
}
|
||||
|
||||
#[\ReturnTypeWillChange]
|
||||
public function rewind()
|
||||
{
|
||||
$this->position = 0;
|
||||
@ -61,6 +63,7 @@ class IcingaObjectImports implements Iterator, Countable, IcingaConfigRenderer
|
||||
* @return IcingaObject|null
|
||||
* @throws \Icinga\Exception\NotFoundError
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function current()
|
||||
{
|
||||
if (! $this->valid()) {
|
||||
@ -72,16 +75,19 @@ class IcingaObjectImports implements Iterator, Countable, IcingaConfigRenderer
|
||||
);
|
||||
}
|
||||
|
||||
#[\ReturnTypeWillChange]
|
||||
public function key()
|
||||
{
|
||||
return $this->idx[$this->position];
|
||||
}
|
||||
|
||||
#[\ReturnTypeWillChange]
|
||||
public function next()
|
||||
{
|
||||
++$this->position;
|
||||
}
|
||||
|
||||
#[\ReturnTypeWillChange]
|
||||
public function valid()
|
||||
{
|
||||
return array_key_exists($this->position, $this->idx);
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
namespace Icinga\Module\Director\Web\Controller;
|
||||
|
||||
use gipfl\Translation\StaticTranslator;
|
||||
use Icinga\Application\Benchmark;
|
||||
use Icinga\Data\Paginatable;
|
||||
use Icinga\Exception\NotFoundError;
|
||||
@ -17,7 +18,6 @@ use Icinga\Web\UrlParams;
|
||||
use InvalidArgumentException;
|
||||
use gipfl\IcingaWeb2\Translator;
|
||||
use gipfl\IcingaWeb2\Link;
|
||||
use gipfl\Translation\TranslationHelper;
|
||||
use gipfl\IcingaWeb2\Widget\ControlsAndContent;
|
||||
use gipfl\IcingaWeb2\Controller\Extension\ControlsAndContentHelper;
|
||||
use gipfl\IcingaWeb2\Zf1\SimpleViewRenderer;
|
||||
@ -60,7 +60,7 @@ abstract class ActionController extends Controller implements ControlsAndContent
|
||||
|
||||
protected function initializeTranslator()
|
||||
{
|
||||
TranslationHelper::setTranslator(new Translator('director'));
|
||||
StaticTranslator::set(new Translator('director'));
|
||||
}
|
||||
|
||||
public function getAuth()
|
||||
|
@ -155,6 +155,10 @@ abstract class QuickBaseForm extends Zend_Form implements ValidHtml
|
||||
|
||||
protected function valueIsEmpty($value)
|
||||
{
|
||||
if ($value === null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (is_array($value)) {
|
||||
return empty($value);
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ class ActivityLogTable extends ZfQueryBasedTable
|
||||
|
||||
return $this::tr([
|
||||
$this::td($this->makeLink($row))->setSeparator(' '),
|
||||
$this::td(strftime('%H:%M:%S', $row->ts_change_time))
|
||||
$this::td(date('H:i:s', $row->ts_change_time))
|
||||
])->addAttributes(['class' => $action]);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user