diff --git a/plugins/language/en_GB/en_GB.txt b/plugins/language/en_GB/en_GB.txt index cfa713b76..e7171312d 100755 --- a/plugins/language/en_GB/en_GB.txt +++ b/plugins/language/en_GB/en_GB.txt @@ -1886,6 +1886,7 @@ 9930 DNS 9940 Is allowed to manage saved searches +9941 Ungroup results 9950 Notifications 9951 Please check that the notification configuration has been set correctly, otherwise sending reports through notifications will not work @@ -1920,4 +1921,4 @@ 9990 Download SNMP Subnets List 9991 Generate SNMP files -10000 Failed to update account info fields: quotes are not allowed in administrative values \ No newline at end of file +10000 Failed to update account info fields: quotes are not allowed in administrative values diff --git a/plugins/language/fr_FR/fr_FR.txt b/plugins/language/fr_FR/fr_FR.txt index 9eae7bb4b..8f812494d 100644 --- a/plugins/language/fr_FR/fr_FR.txt +++ b/plugins/language/fr_FR/fr_FR.txt @@ -1881,6 +1881,7 @@ 9930 DNS 9940 Est autorisé à gérer les recherches sauvegardées +9941 Dégrouper le résultat 9950 Notifications 9951 Veuillez vérifier que les notifications ont été correctement configurées pour que l'envoi des rapports fonctionne diff --git a/plugins/main_sections/ms_multi_search/ms_multi_search.php b/plugins/main_sections/ms_multi_search/ms_multi_search.php index 1fd61b8b7..90bb1597a 100644 --- a/plugins/main_sections/ms_multi_search/ms_multi_search.php +++ b/plugins/main_sections/ms_multi_search/ms_multi_search.php @@ -289,11 +289,20 @@ } if(!empty($_SESSION['OCS']['multi_search'])){ + $checked = ""; + + if (isset($protectedPost["groupby_search"])) { + $checked = "checked"; + } + ?>
+
+ >g(9941) ?> +

@@ -322,10 +331,17 @@ if((isset($protectedPost['search_ok']) || isset($protectedGet['prov']) || isset($protectedGet['fields'])) && $isValid && !isset($protectedPost['table_select']) && !isset($protectedPost['columns_select'])){ unset($_SESSION['OCS']['SEARCH_SQL_GROUP']); + + $groupby = true; + + if (isset($protectedPost["groupby_search"])) { + $groupby = false; + } + /** * Generate Search fields */ - $search->generateSearchQuery($_SESSION['OCS']['multi_search']); + $search->generateSearchQuery($_SESSION['OCS']['multi_search'], $groupby); $sql = $search->baseQuery.$search->searchQuery.$search->columnsQueryConditions; $_SESSION['OCS']['multi_search_query'] = $sql; diff --git a/require/search/Search.php b/require/search/Search.php index f44442b7c..4864d342c 100644 --- a/require/search/Search.php +++ b/require/search/Search.php @@ -318,7 +318,7 @@ public function getFieldUniqId($uniqid, $tableName) * @param Array $sessData * @return void */ - public function generateSearchQuery($sessData){ + public function generateSearchQuery($sessData, $groupby = true){ new AccountinfoSearch(); $this->pushBaseQueryForTable("hardware", null); @@ -579,7 +579,10 @@ public function generateSearchQuery($sessData){ $this->columnsQueryConditions .= " AND " . $lockResult; } - $this->columnsQueryConditions .= " GROUP BY hardware.id"; + if ($groupby) { + $this->columnsQueryConditions .= " GROUP BY hardware.id"; + } + $this->baseQuery = substr($this->baseQuery, 0, -1); }