mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-11-22 09:59:06 +01:00
API: add keepParamsBetweenSearches on LSobject search
This commit is contained in:
parent
36eae85bc3
commit
0360ab7951
3 changed files with 19 additions and 2 deletions
|
@ -221,6 +221,13 @@
|
|||
<listitem><simpara>Booléen permettant de désactiver l'utilisation du cache. Les valeurs acceptées
|
||||
sont <literal>1</literal> ou <literal>0</literal>.</simpara></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>keepParamsBetweenSearches</term>
|
||||
<listitem><simpara>Booléen permettant d'activer/désactiver le stockage en session des paramètres de
|
||||
recherche (optionel, par défaut : <literal>Faux</literal>). Les valeurs acceptées sont
|
||||
<literal>1</literal> ou <literal>0</literal>.</simpara></listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
<programlisting linenumbering="unnumbered">
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue