Compare commits

..

No commits in common. "c98e31b7c61e259e67ac2441997daa9f6b7f6606" and "341f555e0c1bcf9a48f3ee79e1618958338851fa" have entirely different histories.

10 changed files with 21 additions and 284 deletions

View file

@ -9,7 +9,7 @@ tests:bullseye:
stage: tests
rules:
- changes:
- src/**/*.php
- src/*
script:
- rm -fr vendor
- composer install
@ -35,7 +35,7 @@ tests:buster:
stage: tests
rules:
- changes:
- src/**/*.php
- src/*
script:
- rm -fr vendor
- composer install
@ -76,22 +76,10 @@ tests:jessie:
stage: tests
rules:
- changes:
- src/**/*.php
- src/*
script:
- cd /tmp/
- composer require overtrue/phplint --dev
- cd -
- rm -f .phplint-cache
- /tmp/vendor/bin/phplint src
tests:doc:
image: registry.gitlab.com/pipeline-components/xmllint:latest
stage: tests
rules:
- changes:
- doc/*.docbook
- doc/*.xml
- doc/**/*.docbook
- doc/**/*.xml
script:
- xmllint --valid --noout doc/LdapSaisie.docbook

View file

@ -69,7 +69,6 @@
), // fin LSsearch
'globalSearch' => [booleen],
'globalSearch_extraDisplayedColumns' => [booleen],
// ioFormat
'ioFormat' => array (
@ -275,16 +274,6 @@
</listitem>
</varlistentry>
<varlistentry>
<term>globalSearch_extraDisplayedColumns</term>
<listitem>
<simpara>Afficher ou non les colonnes supplémentaires pour ce type d'objet dans le résultat des
recherches globales (Par défaut : <literal>True</literal>). Pour plus de détails les colonnes
supplémentaires, <link linkend="config-LSobject-LSsearch">voir la section dédiée</link>.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>ioFormat</term>
<listitem>

View file

@ -356,7 +356,7 @@ body, input, select, textarea, #status, th.LSobject-list, table.LStable th, th.L
}
/* ---- Contrasted grey ---- */
tr.LSobject-list:hover, tr.LSobject-list:hover th, table.LStable tr:hover, table.LStable tr:hover th, tr.LSobject-list:hover a.LSobject-list, table.LStable tbody tr:hover a, .LSform input[type=submit], input[type='submit'].LSview_search, button, li.LSform_layout_current, tr.LSobject-list:hover a {
tr.LSobject-list:hover, tr.LSobject-list:hover th, table.LStable tr:hover, table.LStable tr:hover th, tr.LSobject-list:hover a.LSobject-list, table.LStable tbody tr:hover a, .LSform input[type=submit], input[type='submit'].LSview_search, button, li.LSform_layout_current {
color: var(--contrasted-text-color);
}

BIN
src/images/default/ASC.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 224 B

View file

@ -1,74 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="9"
height="16"
viewBox="0 0 2.3812499 4.2333335"
version="1.1"
id="svg8"
inkscape:version="1.0.2 (e86c870879, 2021-01-15)"
sodipodi:docname="ASC.svg">
<defs
id="defs2" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="44.8"
inkscape:cx="4.7483255"
inkscape:cy="6.8589809"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
inkscape:document-rotation="0"
showgrid="false"
units="px"
inkscape:window-width="1920"
inkscape:window-height="1016"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1" />
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Calque 1"
inkscape:groupmode="layer"
id="layer1">
<path
sodipodi:type="star"
style="fill:#aaaaaa;fill-opacity:1;stroke:none;stroke-width:0.939523;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path833"
sodipodi:sides="3"
sodipodi:cx="1.068243"
sodipodi:cy="1.2323078"
sodipodi:r1="0.29255828"
sodipodi:r2="0.14627914"
sodipodi:arg1="-1.5691195"
sodipodi:arg2="-0.52192198"
inkscape:flatsided="false"
inkscape:rounded="0"
inkscape:randomized="0"
d="M 1.0687336,0.93974992 1.1950469,1.1593807 1.3213603,1.3790116 1.0679977,1.3785867 0.81463519,1.3781619 0.94168439,1.1589559 Z"
inkscape:transform-center-x="0.0011530484"
inkscape:transform-center-y="-0.30748628"
transform="matrix(4.6992936,0,0,4.2163556,-3.82821,-2.7716948)" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 2.3 KiB

BIN
src/images/default/DESC.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 267 B

View file

@ -1,74 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="9"
height="16"
viewBox="0 0 2.3812499 4.2333335"
version="1.1"
id="svg8"
inkscape:version="1.0.2 (e86c870879, 2021-01-15)"
sodipodi:docname="DESC.svg">
<defs
id="defs2" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="44.8"
inkscape:cx="4.7483255"
inkscape:cy="6.8589809"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
inkscape:document-rotation="0"
showgrid="false"
units="px"
inkscape:window-width="1920"
inkscape:window-height="1016"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1" />
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Calque 1"
inkscape:groupmode="layer"
id="layer1">
<path
sodipodi:type="star"
style="fill:#aaaaaa;fill-opacity:1;stroke:none;stroke-width:0.939523;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path833"
sodipodi:sides="3"
sodipodi:cx="1.068243"
sodipodi:cy="1.2323078"
sodipodi:r1="0.29255828"
sodipodi:r2="0.14627914"
sodipodi:arg1="-1.5691195"
sodipodi:arg2="-0.52192198"
inkscape:flatsided="false"
inkscape:rounded="0"
inkscape:randomized="0"
d="M 1.0687336,0.93974992 1.1950469,1.1593807 1.3213603,1.3790116 1.0679977,1.3785867 0.81463519,1.3781619 0.94168439,1.1589559 Z"
inkscape:transform-center-x="0.0011530484"
inkscape:transform-center-y="0.30748629"
transform="matrix(4.6992936,0,0,-4.2163556,-3.82821,7.0050282)" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 2.3 KiB

View file

@ -156,7 +156,7 @@ class LSsearch extends LSlog_staticLoggerClass {
}
}
else {
$this -> purgeParams($LSobject, $context);
$this -> purgeParams($LSobject);
$this -> loadDefaultParameters();
}
@ -214,14 +214,7 @@ class LSsearch extends LSlog_staticLoggerClass {
* @return boolean True if params has been loaded from session or False
*/
private function loadParamsFromSession() {
if (
isset($_SESSION['LSsession'])
&& isset($_SESSION['LSsession']['LSsearch'])
&& isset($_SESSION['LSsession']['LSsearch'][$this -> LSobject])
&& isset($_SESSION['LSsession']['LSsearch'][$this -> LSobject]['params'])
&& isset($_SESSION['LSsession']['LSsearch'][$this -> LSobject]['params'][$this -> context])
&& is_array($_SESSION['LSsession']['LSsearch'][$this -> LSobject]['params'][$this -> context])
) {
if (isset($_SESSION['LSsession']['LSsearch'][$this -> LSobject]['params'][$this -> context]) && is_array($_SESSION['LSsession']['LSsearch'][$this -> LSobject]['params'][$this -> context])) {
self :: log_debug('Load params from session for context '.$this -> context);
$params = $_SESSION['LSsession']['LSsearch'][$this -> LSobject]['params'][$this -> context];
@ -243,28 +236,15 @@ class LSsearch extends LSlog_staticLoggerClass {
* @return void
*/
private function saveParamsInSession() {
self :: log_debug(
'saveParamsInSession(".$this -> LSobject."): Save context params session '.$this -> context);
self :: log_debug('Save context params session '.$this -> context);
$params = $this -> params;
if ($params['filter'] instanceof Net_LDAP2_Filter) {
$params['filter'] = $params['filter'] -> asString();
}
if (!isset($_SESSION['LSsession']))
$_SESSION['LSsession'] = array();
if (!isset($_SESSION['LSsession']['LSsearch']))
$_SESSION['LSsession']['LSsearch'] = array();
if (!isset($_SESSION['LSsession']['LSsearch'][$this -> LSobject]))
$_SESSION['LSsession']['LSsearch'][$this -> LSobject] = array();
if (!isset($_SESSION['LSsession']['LSsearch'][$this -> LSobject]['params']))
$_SESSION['LSsession']['LSsearch'][$this -> LSobject]['params'] = array();
if (!isset($_SESSION['LSsession']['LSsearch'][$this -> LSobject]['params'][$this -> context]))
$_SESSION['LSsession']['LSsearch'][$this -> LSobject]['params'][$this -> context] = array();
foreach ($params as $param => $value) {
if (
!isset($_SESSION['LSsession']['LSsearch'][$this -> LSobject]['params'][$this -> context][$param])
|| $_SESSION['LSsession']['LSsearch'][$this -> LSobject]['params'][$this -> context][$param] != $value
) {
self :: log_trace("saveParamsInSession(".$this -> LSobject."): $param => ".varDump($value));
if ( !isset($_SESSION['LSsession']['LSsearch'][$this -> LSobject]['params'][$this -> context][$param]) || $_SESSION['LSsession']['LSsearch'][$this -> LSobject]['params'][$this -> context][$param]!=$value) {
self :: log_trace("$param => ".varDump($value));
$_SESSION['LSsession']['LSsearch'][$this -> LSobject]['params'][$this -> context][$param]=$value;
}
}
@ -273,61 +253,30 @@ class LSsearch extends LSlog_staticLoggerClass {
/**
* Purge parameters in session
*
* @param string $LSobject The LdapObject type
* @param string|null $context The context of the search (optional, default: null)
* @param string $LSobject The LSobject type
*
* @return void
*/
public static function purgeParams($LSobject, $context=null) {
if (!isset($_SESSION['LSsession'])) return;
if (!isset($_SESSION['LSsession']['LSsearch'])) return;
if (!isset($_SESSION['LSsession']['LSsearch'][$LSobject])) return;
if (!isset($_SESSION['LSsession']['LSsearch'][$LSobject]['params'])) return;
if ($context) {
if (isset($_SESSION['LSsession']['LSsearch'][$LSobject]['params'][$context]))
unset($_SESSION['LSsession']['LSsearch'][$LSobject]['params'][$context]);
}
else
unset($_SESSION['LSsession']['LSsearch'][$LSobject]['params']);
public static function purgeParams($LSobject) {
unset($_SESSION['LSsession']['LSsearch'][$LSobject]['params']);
}
/**
* Purge cache
*
* @param string $LSobject The LdapObject type
* @param string|null $hash The hash of the search (optional, default: null)
*
* @return void
*/
public static function purgeCache($LSobject, $hash=null) {
if (!isset($_SESSION['LSsession'])) return;
if (!isset($_SESSION['LSsession']['LSsearch'])) return;
if (!isset($_SESSION['LSsession']['LSsearch'][$LSobject])) return;
if (!isset($_SESSION['LSsession']['LSsearch'][$LSobject]['cache'])) return;
if ($hash) {
if (isset($_SESSION['LSsession']['LSsearch'][$LSobject]['cache'][$hash]))
unset($_SESSION['LSsession']['LSsearch'][$LSobject]['cache'][$hash]);
}
else
unset($_SESSION['LSsession']['LSsearch'][$LSobject]['cache']);
public static function purgeCache($LSobject) {
unset($_SESSION['LSsession']['LSsearch'][$LSobject]);
}
/**
* Purge session
*
* @param string $LSobject The LdapObject type
*
* @return void
*/
private function purgeSession($LSobject=null) {
if (!isset($_SESSION['LSsession'])) return;
if (!isset($_SESSION['LSsession']['LSsearch'])) return;
if ($LSobject) {
if (isset($_SESSION['LSsession']['LSsearch'][$LSobject]))
unset($_SESSION['LSsession']['LSsearch'][$LSobject]);
}
else
unset($_SESSION['LSsession']['LSsearch']);
private function purgeSession() {
unset($_SESSION['LSsession']['LSsearch']);
}
/**
@ -1172,15 +1121,7 @@ class LSsearch extends LSlog_staticLoggerClass {
if ($this -> cacheIsEnabled()) {
$hash = $this->getHash();
self :: log_trace("addResultToCache(): Save result in cache with hash '$hash'.");
if (!isset($_SESSION['LSsession']))
$_SESSION['LSsession'] = array();
if (!isset($_SESSION['LSsession']['LSsearch']))
$_SESSION['LSsession']['LSsearch'] = array();
if (!isset($_SESSION['LSsession']['LSsearch'][$this -> LSobject]))
$_SESSION['LSsession']['LSsearch'][$this -> LSobject] = array();
if (!isset($_SESSION['LSsession']['LSsearch'][$this -> LSobject]['cache']))
$_SESSION['LSsession']['LSsearch'][$this -> LSobject]['cache'] = array();
$_SESSION['LSsession']['LSsearch'][$this -> LSobject]['cache'][$hash] = $this->result;
$_SESSION['LSsession']['LSsearch'][$this -> LSobject][$hash]=$this->result;
}
else
self :: log_trace('addResultToCache(): cache is disabled.');
@ -1193,16 +1134,10 @@ class LSsearch extends LSlog_staticLoggerClass {
**/
private function getResultFromCache() {
if ($this -> cacheIsEnabled()) {
$hash = $this->getHash();
if (
isset($_SESSION['LSsession'])
&& isset($_SESSION['LSsession']['LSsearch'])
&& isset($_SESSION['LSsession']['LSsearch'][$this -> LSobject])
&& isset($_SESSION['LSsession']['LSsearch'][$this -> LSobject]['cache'])
&& isset($_SESSION['LSsession']['LSsearch'][$this -> LSobject]['cache'][$hash])
) {
$hash=$this->getHash();
if (isset($_SESSION['LSsession']['LSsearch'][$this -> LSobject][$hash])) {
self :: log_trace('getResultFromCache(): result found in cache.');
return $_SESSION['LSsession']['LSsearch'][$this -> LSobject]['cache'][$hash];
return $_SESSION['LSsession']['LSsearch'][$this -> LSobject][$hash];
}
self :: log_trace('getResultFromCache(): result not found in cache.');
}

View file

@ -177,10 +177,6 @@ function handle_global_search($request) {
LStemplate :: assign('pagetitle', $object -> getLabel());
$LSsearch = new LSsearch($LSobject, 'LSview');
$LSsearch -> setParam(
'extraDisplayedColumns',
LSconfig::get("LSobjects.$LSobject.globalSearch_extraDisplayedColumns", true, 'bool')
);
$LSsearch -> setParamsFromRequest();
$LSsearch -> run();

View file

@ -34,35 +34,12 @@
{/if}
</th>
{/if}
{if $LSsearch->extraDisplayedColumns}
{foreach from=$LSsearch->visibleExtraDisplayedColumns item=conf key=cid}
<th class='LSobject-list'{if isset($conf.cssStyle) && $conf.cssStyle} style='{$conf.cssStyle|escape:"htmlall"}'{/if}>
{if $LSsearch->sort}
<a href='object/{$LSsearch->LSobject|escape:"url"}?sortBy={$cid|escape:"url"}&amp;nocache={$smarty.now}'>
{if $LSsearch->sortBy == $cid}
<strong>{tr msg=$conf.label|escape:"htmlall"}</strong>
<img src='{img name=$LSsearch->sortDirection}' class='LSobject-list-ordersense' alt='{$LSsearch->sortDirection}'/>
{else}
{tr msg=$conf.label}
{/if}
</a>
{else}
{tr msg=$conf.label}
{/if}
</th>
{/foreach}
{/if}
<th class='LSobject-list'>{$LSsearch->label_actions}</th>
</tr>
{foreach from=$page.list item=object}
<tr class='{cycle values="LSobject-list,LSobject-list LSobject-list-bis"}'>
<td class='LSobject-list LSobject-list-names'><a href='object/{$LSsearch->LSobject|escape:'url'}/{$object->dn|escape:'url'}' class='LSobject-list'>{$object->displayName|escape:'htmlall'}</a> </td>
{if $LSsearch->displaySubDn}<td class='LSobject-list'>{$object->subDn|escape:'htmlall'}</td>{/if}
{if $LSsearch->extraDisplayedColumns}
{foreach from=$LSsearch->visibleExtraDisplayedColumns item=conf key=cid}
<td class='LSobject-list'{if isset($conf.cssStyle) && $conf.cssStyle} style='{$conf.cssStyle|escape:"htmlall"}'{/if}>{if !isset($conf.escape) || $conf.escape}{$object->$cid|escape:"htmlall"}{else}{$object->$cid}{/if}</td>
{/foreach}
{/if}
<td class='LSobject-list LSobject-list-actions'>
{foreach from=$object->actions item=item}
<a href='{$item.url|escape:'quotes'}' class='LSobject-list-actions'><img src='{img name=$item.action|escape:'url'}' alt='{$item.label|escape:'quotes'}' title='{$item.label|escape:'quotes'}'/></a>