From e1e872b72bb07a974d32d5b1402ce81f1633e8e8 Mon Sep 17 00:00:00 2001
From: Guillaume28 <gbaldo@centreon.com>
Date: Tue, 6 Mar 2018 10:32:44 +0100
Subject: [PATCH] fix(export): Wrong parameters for several exports

---
 .../centreonCentbrokerCfg.class.php            |  9 +--------
 .../centreonContactGroup.class.php             | 10 +---------
 .../centreon-clapi/centreonEngineCfg.class.php |  9 +--------
 .../centreon-clapi/centreonInstance.class.php  | 18 ------------------
 4 files changed, 3 insertions(+), 43 deletions(-)

diff --git a/www/class/centreon-clapi/centreonCentbrokerCfg.class.php b/www/class/centreon-clapi/centreonCentbrokerCfg.class.php
index 8a9f332a9b..e5fd407980 100644
--- a/www/class/centreon-clapi/centreonCentbrokerCfg.class.php
+++ b/www/class/centreon-clapi/centreonCentbrokerCfg.class.php
@@ -693,15 +693,8 @@ class CentreonCentbrokerCfg extends CentreonObject
      *
      * @return void
      */
-    public function export($filter_id = null, $filter_name = null)
+    public function export($filters = null)
     {
-        $filters = null;
-        if (!is_null($filter_id)) {
-            $filters = array(
-                $this->object->getPrimaryKey() => $filter_id
-            );
-        }
-
         $elements = $this->object->getList("*", -1, 0, null, null, $filters, "AND");
         foreach ($elements as $element) {
             $addStr = $this->action . $this->delim . "ADD" .
diff --git a/www/class/centreon-clapi/centreonContactGroup.class.php b/www/class/centreon-clapi/centreonContactGroup.class.php
index 4e51f38429..d8747fd85e 100644
--- a/www/class/centreon-clapi/centreonContactGroup.class.php
+++ b/www/class/centreon-clapi/centreonContactGroup.class.php
@@ -216,16 +216,8 @@ class CentreonContactGroup extends CentreonObject
      *
      * @return void
      */
-    public function export($filter_id = null, $filter_name = null)
+    public function export($filters = null)
     {
-        $filters = array();
-        if (!is_null($filter_id) && $filter_id !== 0) {
-            $filters['cg_id'] = $filter_id;
-        }
-        if (!is_null($filter_name)) {
-            $filters['cg_name'] = $filter_name;
-        }
-
         parent::export($filters);
         $relObj = new \Centreon_Object_Relation_Contact_Group_Contact($this->dependencyInjector);
         $contactObj = new \Centreon_Object_Contact($this->dependencyInjector);
diff --git a/www/class/centreon-clapi/centreonEngineCfg.class.php b/www/class/centreon-clapi/centreonEngineCfg.class.php
index fb1ab7d2e8..ed746ad7e8 100644
--- a/www/class/centreon-clapi/centreonEngineCfg.class.php
+++ b/www/class/centreon-clapi/centreonEngineCfg.class.php
@@ -284,15 +284,8 @@ class CentreonEngineCfg extends CentreonObject
      *
      * @return void
      */
-    public function export($filter_id = null, $filter_name = null)
+    public function export($filters = null)
     {
-        $filters = null;
-        if (!is_null($filter_id)) {
-            $filters = array(
-                $this->object->getPrimaryKey() => $filter_id
-                );
-        }
-
         $elements = $this->object->getList("*", -1, 0, null, null, $filters, "AND");
         $tpObj = new \Centreon_Object_Timeperiod($this->dependencyInjector);
         foreach ($elements as $element) {
diff --git a/www/class/centreon-clapi/centreonInstance.class.php b/www/class/centreon-clapi/centreonInstance.class.php
index 518eea4aca..b8d05ddb91 100644
--- a/www/class/centreon-clapi/centreonInstance.class.php
+++ b/www/class/centreon-clapi/centreonInstance.class.php
@@ -232,22 +232,4 @@ class CentreonInstance extends CentreonObject
             }
         }
     }
-
-    /**
-         * 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);
-    }
 }
-- 
GitLab