Collapse the search form at the top of the main page when displaying a list of objects (drill down from a chart...), except when the page is the result of filling this form and pressing search.

SVN:trunk[4279]
This commit is contained in:
Denis Flaven
2016-07-05 09:32:56 +00:00
parent a2eab87b7b
commit db47b2d05c

View File

@@ -1,4 +1,5 @@
<?php
// Copyright (C) 2010-2016 Combodo SARL
//
// This file is part of iTop.
@@ -174,12 +175,14 @@ function DisplayMessages($sMessageKey, WebPage $oPage)
* @param $bSearchForm boolean Whether or not to display the search form at the top the page
* @param $sBaseClass string The base class for the search (can be different from the actual class of the results)
* @param $sFormat string The format to use for the output: csv or html
* @param $bDoSearch bool True to display the search results below the search form
* @param $bSearchFormOpen bool True to display the search form fully expanded (only if $bSearchForm of course)
*/
function DisplaySearchSet($oP, $oFilter, $bSearchForm = true, $sBaseClass = '', $sFormat = '', $bDoSearch = true)
function DisplaySearchSet($oP, $oFilter, $bSearchForm = true, $sBaseClass = '', $sFormat = '', $bDoSearch = true, $bSearchFormOpen = false)
{
if ($bSearchForm)
{
$aParams = array('open' => true);
$aParams = array('open' => $bSearchFormOpen);
if (!empty($sBaseClass))
{
$aParams['baseClass'] = $sBaseClass;
@@ -472,7 +475,7 @@ try
}
$oP->set_title(Dict::S('UI:SearchResultsPageTitle'));
$oFilter = new DBObjectSearch($sClass);
DisplaySearchSet($oP, $oFilter, $bSearchForm, '' /* sBaseClass */, $sFormat, $bDoSearch);
DisplaySearchSet($oP, $oFilter, $bSearchForm, '' /* sBaseClass */, $sFormat, $bDoSearch, true /* Search Form Expanded */);
break;
///////////////////////////////////////////////////////////////////////////////////////////