mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-31 01:34:12 +02:00
SyncRule: do not allow to sync unless some...
...properties have been defined. fixes #383
This commit is contained in:
parent
f91dd5fa0e
commit
2237272b6b
@ -4,6 +4,16 @@
|
||||
</div>
|
||||
|
||||
<div class="content">
|
||||
<?php if (! $rule->hasSyncProperties()): ?>
|
||||
<p class="warning">
|
||||
<?= sprintf(
|
||||
$this->translate('You need must define some %s before you can run this Sync rule'),
|
||||
$this->qlink('Sync Properties', 'director/syncrule/property', array('rule_id' => $rule->id))
|
||||
)
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
<?php return; endif ?>
|
||||
<?php if (! $this->run): ?>
|
||||
<p class="warning">
|
||||
<?= $this->translate('This Sync Rule has never been run before.') ?>
|
||||
|
@ -345,6 +345,12 @@ class SyncRule extends DbObject
|
||||
return $this->hasCombinedKey;
|
||||
}
|
||||
|
||||
public function hasSyncProperties()
|
||||
{
|
||||
$properties = $this->getSyncProperties();
|
||||
return ! empty($properties);
|
||||
}
|
||||
|
||||
public function getSyncProperties()
|
||||
{
|
||||
if (! $this->hasBeenLoadedFromDb()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user