Private GIT

Skip to content
Snippets Groups Projects
Commit 7abc66bb authored by Kevin Duret's avatar Kevin Duret
Browse files

#4868 Fix instance export with filter

parent 2490e0ae
Branches
Tags
No related merge requests found
...@@ -202,8 +202,8 @@ class CentreonContactGroup extends CentreonObject { ...@@ -202,8 +202,8 @@ class CentreonContactGroup extends CentreonObject {
*/ */
public function export($filter_id=null, $filter_name=null) { public function export($filter_id=null, $filter_name=null) {
$filters = null; $filters = null;
if (!is_null($filter)) { if (!is_null($filter_id)) {
$filters['cg_id'] = $filter_id; $filters = array('cg_id' => $filter_id);
} }
$obj = new Centreon_Object_Relation_Contact_Group_Contact(); $obj = new Centreon_Object_Relation_Contact_Group_Contact();
$elements = $obj->getMergedParameters(array("cg_name"), array("contact_name", "contact_id"), -1, 0, "cg_name"); $elements = $obj->getMergedParameters(array("cg_name"), array("contact_name", "contact_id"), -1, 0, "cg_name");
......
...@@ -194,4 +194,22 @@ class CentreonInstance extends CentreonObject ...@@ -194,4 +194,22 @@ class CentreonInstance extends CentreonObject
echo $elem['host_id'].$this->delim.$elem['host_name'].$this->delim.$elem['host_address']."\n"; echo $elem['host_id'].$this->delim.$elem['host_name'].$this->delim.$elem['host_address']."\n";
} }
} }
/**
* Export data
*
* @param null $filter_id
* @param null $filter_name
*/
public function export($filter_id = null, $filter_name = null)
{
$filters = null;
if (!is_null($filter_id)) {
$filters = array(
$this->object->getPrimaryKey() => $filter_id
);
}
parent::export($filters);
}
} }
...@@ -339,7 +339,7 @@ abstract class CentreonObject ...@@ -339,7 +339,7 @@ abstract class CentreonObject
/** /**
* Export data * Export data
* *
* @param string $parameters * @param string $filters
* @return void * @return void
*/ */
public function export($filters = null) public function export($filters = null)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment