Sync rule: allow zones and endpoints

This commit is contained in:
Thomas Gelf 2015-12-03 16:13:49 +01:00
parent 389fcf2fa6
commit ef49666ee3
3 changed files with 17 additions and 13 deletions

View File

@ -9,6 +9,19 @@ class SyncRuleForm extends DirectorObjectForm
{
public function setup()
{
$availableTypes = array(
'endpoint' => $this->translate('Endpoint'),
'host' => $this->translate('Host'),
'service' => $this->translate('Service'),
'user' => $this->translate('User'),
'hostgroup' => $this->translate('Hostgroup'),
'servicegroup' => $this->translate('Servicegroup'),
'usergroup' => $this->translate('Usergroup'),
'datalistEntry' => $this->translate('Datalist entry'),
'zone' => $this->translate('Zone'),
);
asort($availableTypes);
$this->addElement('text', 'rule_name', array(
'label' => $this->translate('Rule name'),
'description' => $this->translate('Please provide a rule name'),
@ -19,18 +32,7 @@ class SyncRuleForm extends DirectorObjectForm
'label' => $this->translate('Object Type'),
'description' => $this->translate('Choose a object type'),
'required' => true,
'multiOptions' => $this->optionalEnum(array(
'host' => $this->translate('Host'),
'host_template' => $this->translate('Host Template'),
'service' => $this->translate('Service'),
'service_template' => $this->translate('Service Template'),
'user' => $this->translate('User'),
'user_template' => $this->translate('User Template'),
'hostgroup' => $this->translate('Hostgroup'),
'servicegroup' => $this->translate('Servicegroup'),
'usergroup' => $this->translate('Usergroup'),
'datalistEntry' => $this->translate('Datalist entry'),
))
'multiOptions' => $this->optionalEnum($availableTypes)
));
$this->addElement('select', 'update_policy', array(

View File

@ -0,0 +1,2 @@
ALTER TABLE sync_rule MODIFY object_type enum('host', 'host_template', 'service', 'service_template', 'command', 'command_template', 'user', 'user_template', 'hostgroup', 'servicegroup', 'usergroup', 'datalistEntry', 'endpoint', 'zone') NOT NULL;

View File

@ -948,7 +948,7 @@ CREATE TABLE imported_row_property (
CREATE TABLE sync_rule (
id INT(10) UNSIGNED AUTO_INCREMENT NOT NULL,
rule_name VARCHAR(255) NOT NULL,
object_type enum('host', 'host_template', 'service', 'service_template', 'command', 'command_template', 'user', 'user_template', 'hostgroup', 'servicegroup', 'usergroup', 'datalistEntry') NOT NULL,
object_type enum('host', 'host_template', 'service', 'service_template', 'command', 'command_template', 'user', 'user_template', 'hostgroup', 'servicegroup', 'usergroup', 'datalistEntry', 'endpoint', 'zone') NOT NULL,
update_policy ENUM('merge', 'override', 'ignore') NOT NULL,
purge_existing ENUM('y', 'n') NOT NULL DEFAULT 'n',
filter_expression TEXT DEFAULT NULL,