From 4736cce759366c7d1fe0355e5c70ae808f8f8592 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Engel Date: Thu, 24 Apr 2025 10:15:30 +0200 Subject: [PATCH] =?UTF-8?q?Am=C3=A9lioration=20condition=20filtrage=20comp?= =?UTF-8?q?atible=20pagination?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- global_history.html | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/global_history.html b/global_history.html index a6ef606..726075e 100644 --- a/global_history.html +++ b/global_history.html @@ -32,6 +32,17 @@ }} +{{* condition de filtrage *}} +{{if $_GET.cat_key != null}} + {{:assign condition="(SELECT key + FROM @TABLE AS cat + WHERE cat.key = (SELECT $$.category + FROM @TABLE AS mat + WHERE mat.key = @TABLE.$$.equipment)) = '%s'"|args:$_GET.cat_key}} +{{else}} + {{:assign condition=1}} +{{/if}} + {{* lister tous les mouvements *}} {{#list type="movement" @@ -52,17 +63,11 @@ END as 'Stockage'; $$.comment AS 'Commentaire' "|args:$config.user_fields.name_sql + where="%s"|args:$condition order=1 + max=50 desc=true }} - {{* filtrer selon la catégorie *}} - {{#load key=$equipment}} - {{:assign cat_key=$category}} - {{/load}} - {{if $_GET.cat_key != null && $cat_key != $_GET.cat_key}} - {{:continue}} - {{/if}} - {{:assign var="op_label" from="config.%s_nature.%s.label"|args:$direction:$operation}} {{$date|date_short}}