Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
centreon
centreon
Commits
1da3ecfa
Commit
1da3ecfa
authored
Feb 24, 2021
by
Kevin Duret
Browse files
fix(select2): avoid error 400 in hg & connector forms (#9508)
Refs: MON-6633
parent
f6aa032f
Changes
2
Hide whitespace changes
Inline
Side-by-side
www/include/configuration/configObject/connector/formConnector.php
View file @
1da3ecfa
...
...
@@ -105,8 +105,8 @@ try {
'datasourceOrigin'
=>
'ajax'
,
'multiple'
=>
true
,
'defaultDatasetRoute'
=>
'./include/common/webServices/rest/internal.php?'
.
'object=centreon_configuration_command&action=defaultValues&target=connector&field=command_id'
.
(
isset
(
$connector_id
)
?
"&id=
{
$connector_id
}
"
:
''
),
.
'object=centreon_configuration_command&action=defaultValues&target=connector&field=command_id
&id=
'
.
(
isset
(
$connector_id
)
?
$connector_id
:
''
),
'availableDatasetRoute'
=>
'./include/common/webServices/rest/internal.php?'
.
'object=centreon_configuration_command&action=list'
,
'linkedObject'
=>
'centreonCommand'
...
...
www/include/configuration/configObject/hostgroup/formHostGroup.php
View file @
1da3ecfa
...
...
@@ -78,20 +78,14 @@ $attrsAdvSelect = array("style" => "width: 300px; height: 220px;");
$attrsTextarea
=
array
(
"rows"
=>
"4"
,
"cols"
=>
"60"
);
$eTemplate
=
'<table><tr><td><div class="ams">{label_2}</div>{unselected}</td><td align="center">{add}<br /><br />'
.
'<br />{remove}</td><td><div class="ams">{label_3}</div>{selected}</td></tr></table>'
;
$hostRoute
=
'./
include/common/webServices/rest
/internal.php?object=centreon_configuration_host&action=list'
;
$hostRoute
=
'./
api
/internal.php?object=centreon_configuration_host&action=list'
;
$attrHosts
=
array
(
'datasourceOrigin'
=>
'ajax'
,
'availableDatasetRoute'
=>
$hostRoute
,
'multiple'
=>
true
,
'linkedObject'
=>
'centreonHost'
);
$hostGrRoute
=
'./include/common/webServices/rest/internal.php?object=centreon_configuration_hostgroup&action=list'
;
$attrHostgroups
=
array
(
'datasourceOrigin'
=>
'ajax'
,
'availableDatasetRoute'
=>
$hostGrRoute
,
'multiple'
=>
true
,
'linkedObject'
=>
'centreonHostgroups'
);
$hostGrRoute
=
'./api/internal.php?object=centreon_configuration_hostgroup&action=list'
;
/*
* Create formulary
...
...
@@ -116,21 +110,13 @@ $form->addElement('text', 'hg_alias', _("Alias"), $attrsText);
* Hosts Selection
*/
$hostRoute
=
'./include/common/webServices/rest/internal.php?object=centreon_configuration_host'
.
'&action=defaultValues&target=hostgroups&field=hg_hosts&id='
.
$hg_id
;
.
'&action=defaultValues&target=hostgroups&field=hg_hosts&id='
.
(
$hg_id
>
0
?
$hg_id
:
''
)
;
$attrHost1
=
array_merge
(
$attrHosts
,
array
(
'defaultDatasetRoute'
=>
$hostRoute
)
);
$form
->
addElement
(
'select2'
,
'hg_hosts'
,
_
(
"Linked Hosts"
),
array
(),
$attrHost1
);
$hostGrRoute
=
'./include/common/webServices/rest/internal.php?object=centreon_configuration_hostgroup'
.
'&action=defaultValues&target=hostgroups&field=hg_hg&id='
.
$hg_id
;
$attrHostgroup1
=
array_merge
(
$attrHostgroups
,
array
(
'defaultDatasetRoute'
=>
$hostGrRoute
)
);
$form
->
addElement
(
'select2'
,
'hg_hg'
,
_
(
"Linked Host Groups"
),
array
(),
$attrHostgroup1
);
/*
* Extended information
*/
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment