From 78a5a3bfe8116b0c10b11b8c725301a0eaf102ae Mon Sep 17 00:00:00 2001 From: Jorge Rincon Date: Tue, 14 Nov 2023 17:12:22 +0100 Subject: [PATCH] #12168 Hierarchy is added to the title of services --- .../include/class/TreeService.class.php | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/pandora_console/include/class/TreeService.class.php b/pandora_console/include/class/TreeService.class.php index a627794f0e..177a45a54f 100644 --- a/pandora_console/include/class/TreeService.class.php +++ b/pandora_console/include/class/TreeService.class.php @@ -333,6 +333,7 @@ class TreeService extends Tree $services[$service['id']]['id'] = $service['id']; $services[$service['id']]['description'] = $service['description']; $services[$service['id']]['serviceDetail'] = 'index.php?sec=network&sec2=enterprise/operation/services/services&tab=service_map&id_service='.(int) $service['id']; + $services[$service['id']]['title'] = services_get_parents_title((int) $service['id']); } return $services; @@ -732,20 +733,8 @@ class TreeService extends Tree if (isset($this->filter['searchService']) === true && empty($this->filter['searchService']) === false ) { - $sqlFilter = 'SELECT ts.id FROM tservice ts - where ts.name LIKE "%'.$this->filter['searchService'].'%" - OR ts.description LIKE "%'.$this->filter['searchService'].'%"'; - - $filterResult = db_get_all_rows_sql($sqlFilter); - - $services = []; - foreach ($filterResult as $key => $result) { - $services_ancestors = services_get_services_ancestors($result['id']); - $services[] = array_pop($services_ancestors); - } - - $services_list = array_unique($services, SORT_NUMERIC); - $whereAncestors = ' AND tse.id_service IN ('.implode(',', $services_list).')'; + $whereAncestors = ' AND ts.name LIKE "%'.$this->filter['searchService'].'%" + OR ts.description LIKE "%'.$this->filter['searchService'].'%"'; return $whereAncestors; }