diff --git a/doc/api/api.docbook b/doc/api/api.docbook index 77881793..d953207d 100644 --- a/doc/api/api.docbook +++ b/doc/api/api.docbook @@ -221,6 +221,13 @@ Booléen permettant de désactiver l'utilisation du cache. Les valeurs acceptées sont 1 ou 0. + + + keepParamsBetweenSearches + Booléen permettant d'activer/désactiver le stockage en session des paramètres de + recherche (optionel, par défaut : Faux). Les valeurs acceptées sont + 1 ou 0. + diff --git a/src/includes/class/class.LSsearch.php b/src/includes/class/class.LSsearch.php index 7ff462fe..8f21c0e1 100644 --- a/src/includes/class/class.LSsearch.php +++ b/src/includes/class/class.LSsearch.php @@ -781,7 +781,7 @@ class LSsearch extends LSlog_staticLoggerClass { if(in_array($key,array_keys($this -> params))) { if ($key == 'nbObjectsByPageChoices' && !is_array($this -> params['nbObjectsByPageChoices'])) { return (isset($GLOBALS['NB_LSOBJECT_LIST_CHOICES']) && is_array($GLOBALS['NB_LSOBJECT_LIST_CHOICES'])?$GLOBALS['NB_LSOBJECT_LIST_CHOICES']:range(NB_LSOBJECT_LIST, NB_LSOBJECT_LIST*4, NB_LSOBJECT_LIST)); -} + } return $this -> params[$key]; } return NULL; diff --git a/src/includes/routes.php b/src/includes/routes.php index c435917d..6d09e2fc 100644 --- a/src/includes/routes.php +++ b/src/includes/routes.php @@ -1569,7 +1569,17 @@ function handle_api_LSobject_search($request) { } // Instanciate a LSsearch - $search = new LSsearch($LSobject, 'api', null, isset($_REQUEST['reset'])); + $keepParamsBetweenSearches = ( + isset($_REQUEST['keepParamsBetweenSearches'])? + boolval($_REQUEST['keepParamsBetweenSearches']): + false + ); + $search = new LSsearch( + $LSobject, + 'api', + null, + !$keepParamsBetweenSearches + ); $search -> setParam('onlyAccessible', True); if (!$search -> setParamsFromRequest()) { LSsession :: displayAjaxReturn();