Private GIT

Skip to content
Snippets Groups Projects
Commit d5a512f9 authored by loiclau's avatar loiclau
Browse files

* duplicate host dependency #5531

parent 8b7f3817
No related branches found
No related tags found
No related merge requests found
......@@ -120,6 +120,18 @@ function multipleServiceDependencyInDB($dependencies = array(), $nbrDup = array(
$DBRESULT = $pearDB->query("SELECT MAX(dep_id) FROM dependency");
$maxId = $DBRESULT->fetchRow();
if (isset($maxId["MAX(dep_id)"])) {
$query = "SELECT * FROM dependency_hostChild_relation WHERE dependency_dep_id = '".$key."'";
$dbResult = $pearDB->query($query);
$fields["dep_hostPar"] = "";
while ($host = $dbResult->fetchRow()) {
$query = "INSERT INTO dependency_hostChild_relation VALUES ('', '".$maxId["MAX(dep_id)"].
"', '".$host["host_host_id"]."')";
$pearDB->query($query);
$fields["dep_hostPar"] .= $host["host_host_id"] . ",";
}
$fields["dep_hostPar"] = trim($fields["dep_hostPar"], ",");
$DBRESULT = $pearDB->query("SELECT * FROM dependency_serviceParent_relation WHERE dependency_dep_id = '".$key."'");
$fields["dep_hSvPar"] = "";
while ($service = $DBRESULT->fetchRow()) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment