Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

Commit

Permalink
Separation to not interfer with host template
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume28 authored and kduret committed Nov 9, 2017
1 parent 7e4c416 commit d64db9d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion www/class/centreon-clapi/centreonHost.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ class CentreonHost extends CentreonObject
*/
protected $timezoneObject;

protected $register;

public static $aDepends = array(
'CMD',
'TP',
Expand Down Expand Up @@ -953,7 +955,7 @@ public function export($filters = null)
$tpObj = new \Centreon_Object_Timeperiod($this->dependencyInjector);
$macroObj = new \Centreon_Object_Host_Macro_Custom($this->dependencyInjector);
$instanceRel = new \Centreon_Object_Relation_Instance_Host($this->dependencyInjector);
$parentShip = $this->getHostListByParent($elements);
$parentShip = array();

if ($this->register) {
$instElements = $instanceRel->getMergedParameters(
Expand Down Expand Up @@ -1019,6 +1021,9 @@ public function export($filters = null)
}

// Set parentship
if ($this->register == 1) {
$parentShip = $this->getHostListByParent($elements);
}
if (isset($parentShip[$element[$this->object->getPrimaryKey()]])) {
foreach ($parentShip[$element[$this->object->getPrimaryKey()]] as $parentId) {
echo $this->action . $this->delim
Expand Down

0 comments on commit d64db9d

Please sign in to comment.