From fc802e74496bd4862bb485ab09b5d4a0f838c8a5 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Engel Date: Wed, 11 Feb 2026 17:00:10 +0100 Subject: [PATCH 1/2] =?UTF-8?q?Diff=C3=A9rencier=20filtres=20par=20membre?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _inventory.html | 33 +++++++++++++++++++++------------ equipment_history.html | 18 ++++++++++++------ global_history.html | 33 +++++++++++++++++++++------------ loan_history.html | 26 ++++++++++++-------------- loan_movements.html | 25 +++++++++++-------------- 5 files changed, 77 insertions(+), 58 deletions(-) diff --git a/_inventory.html b/_inventory.html index 53e9566..213bcc9 100644 --- a/_inventory.html +++ b/_inventory.html @@ -5,14 +5,20 @@ *}} {{* filtrer selon la catégorie *}} +{{:assign saved_filters=$module.config.filters}} +{{:assign var="user_filters" from="saved_filters.%s"|args:$logged_user.id}} + {{if $_GET.cat_key == null}} - {{:assign selected_category=$module.config.stock_cat_key}} -{{elseif $_GET.cat_key == -1}} - {{:assign selected_category=null}} - {{:save key="config" stock_cat_key=null}} + {{:assign selected_category=$user_filters.stock_cat_key}} {{else}} - {{:assign selected_category=$_GET.cat_key}} - {{:save key="config" stock_cat_key=$selected_category}} + {{if $_GET.cat_key == -1}} + {{:assign selected_category=null}} + {{else}} + {{:assign selected_category=$_GET.cat_key}} + {{/if}} + {{:assign var="user_filters.stock_cat_key" value=$selected_category}} + {{:assign var="saved_filters.%s"|args:$logged_user.id value=$user_filters}} + {{:save key="config" filters=$saved_filters}} {{/if}} {{* condition de filtrage *}} @@ -25,13 +31,16 @@ {{* filtrer selon appartenance *}} {{if $_GET.prop == null}} - {{:assign selected_prop=$module.config.stock_prop}} -{{elseif $_GET.prop == -1}} - {{:assign selected_prop=null}} - {{:save key="config" stock_prop=null}} + {{:assign selected_prop=$user_filters.stock_prop}} {{else}} - {{:assign selected_prop=$_GET.prop}} - {{:save key="config" stock_prop=$_GET.prop}} + {{if $_GET.prop == -1}} + {{:assign selected_prop=null}} + {{else}} + {{:assign selected_prop=$_GET.prop}} + {{/if}} + {{:assign var="user_filters.stock_prop" value=$selected_prop}} + {{:assign var="saved_filters.%s"|args:$logged_user.id value=$user_filters}} + {{:save key="config" filters=$saved_filters}} {{/if}} {{if $selected_prop == null}} diff --git a/equipment_history.html b/equipment_history.html index 26a3ead..6cc3bf7 100644 --- a/equipment_history.html +++ b/equipment_history.html @@ -55,14 +55,20 @@ {{:include file="./_get_config.html" keep="config"}} {{* filtrer selon appartenance *}} +{{:assign saved_filters=$module.config.filters}} +{{:assign var="user_filters" from="saved_filters.%s"|args:$logged_user.id}} + {{if $_GET.prop == null}} - {{:assign selected_prop=$module.config.eqpmt_hist_prop}} -{{elseif $_GET.prop == -1}} - {{:assign selected_prop=null}} - {{:save key="config" eqpmt_hist_prop=null}} + {{:assign selected_prop=$user_filters.eqpmt_hist_prop}} {{else}} - {{:assign selected_prop=$_GET.prop}} - {{:save key="config" eqpmt_hist_prop=$_GET.prop}} + {{if $_GET.prop == -1}} + {{:assign selected_prop=null}} + {{else}} + {{:assign selected_prop=$_GET.prop}} + {{/if}} + {{:assign var="user_filters.eqpmt_hist_prop value=$selected_prop}} + {{:assign var="saved_filters.%s"|args:$logged_user.id value=$user_filters}} + {{:save key="config" filters=$saved_filters}} {{/if}} {{* déterminer les types de mouvements selon l'appartenance du matériel *}} diff --git a/global_history.html b/global_history.html index 6038924..47a01ba 100644 --- a/global_history.html +++ b/global_history.html @@ -14,14 +14,20 @@ {{:include file="./_get_config.html" keep="config"}} {{* filtrer selon la catégorie *}} +{{:assign saved_filters=$module.config.filters}} +{{:assign var="user_filters" from="saved_filters.%s"|args:$logged_user.id}} + {{if $_GET.cat_key == null}} - {{:assign selected_category=$module.config.hist_cat_key}} -{{elseif $_GET.cat_key == -1}} - {{:assign selected_category=null}} - {{:save key="config" hist_cat_key=null}} + {{:assign selected_category=$user_filters.hist_cat_key}} {{else}} - {{:assign selected_category=$_GET.cat_key}} - {{:save key="config" hist_cat_key=$selected_category}} + {{if $_GET.cat_key == -1}} + {{:assign selected_category=null}} + {{else}} + {{:assign selected_category=$_GET.cat_key}} + {{/if}} + {{:assign var="user_filters.hist_cat_key" value=$selected_category}} + {{:assign var="saved_filters.%s"|args:$logged_user.id value=$user_filters}} + {{:save key="config" filters=$saved_filters}} {{/if}} {{* condition de filtrage *}} @@ -37,13 +43,16 @@ {{* filtrer selon appartenance *}} {{if $_GET.prop == null}} - {{:assign selected_prop=$module.config.hist_prop}} -{{elseif $_GET.prop == -1}} - {{:assign selected_prop=null}} - {{:save key="config" hist_prop=null}} + {{:assign selected_prop=$user_filters.hist_prop}} {{else}} - {{:assign selected_prop=$_GET.prop}} - {{:save key="config" hist_prop=$_GET.prop}} + {{if $_GET.prop == -1}} + {{:assign selected_prop=null}} + {{else}} + {{:assign selected_prop=$_GET.prop}} + {{/if}} + {{:assign var="user_filters.hist_prop" value=$selected_prop}} + {{:assign var="saved_filters.%s"|args:$logged_user.id value=$user_filters}} + {{:save key="config" filters=$saved_filters}} {{/if}} {{* déterminer les types de mouvements selon l'appartenance du matériel *}} diff --git a/loan_history.html b/loan_history.html index f825528..a7ff7de 100644 --- a/loan_history.html +++ b/loan_history.html @@ -38,26 +38,24 @@ {{/if}} {{/if}} -{{* lecture config (défaut ou enregistrée) *}} +{{* lecture config *}} {{:include file="./_get_config.html" keep="config"}} {{* filtrer selon la catégorie *}} +{{:assign saved_filters=$module.config.filters}} +{{:assign var="user_filters" from="saved_filters.%s"|args:$logged_user.id}} + {{if $_GET.cat_key == null}} - {{:assign var="selected_category" from="module.config.%s_hist_cat_key"|args:$_GET.output_type}} -{{elseif $_GET.cat_key == -1}} - {{:assign selected_category=null}} - {{if $_GET.output_type == "loan"}} - {{:save key="config" loan_hist_cat_key=null}} - {{elseif $_GET.output_type == "rent"}} - {{:save key="config" rent_hist_cat_key=null}} - {{/if}} + {{:assign var="selected_category" from="user_filters.%s_hist_cat_key"|args:$_GET.output_type}} {{else}} - {{:assign selected_category=$_GET.cat_key}} - {{if $_GET.output_type == "loan"}} - {{:save key="config" loan_hist_cat_key=$selected_category}} - {{elseif $_GET.output_type == "rent"}} - {{:save key="config" rent_hist_cat_key=$selected_category}} + {{if $_GET.cat_key == -1}} + {{:assign selected_category=null}} + {{else}} + {{:assign selected_category=$_GET.cat_key}} {{/if}} + {{:assign var="user_filters.%s_hist_cat_key"|args:$_GET.output_type value=$selected_category}} + {{:assign var="saved_filters.%s"|args:$logged_user.id value=$user_filters}} + {{:save key="config" filters=$saved_filters}} {{/if}} {{* condition de filtrage *}} diff --git a/loan_movements.html b/loan_movements.html index 55d74f7..4b56e9e 100644 --- a/loan_movements.html +++ b/loan_movements.html @@ -15,7 +15,6 @@ {{/if}} {{:admin_header title="Historique des %ss"|args:$label custom_css="./style.css" current="module_equipment"}} - {{:include file="./_nav.html" current="%s"|args:$label subcurrent="historique"}} {{* @@ -47,22 +46,20 @@ {{:include file="./_get_config.html" keep="config"}} {{* filtrer selon la catégorie *}} +{{:assign saved_filters=$module.config.filters}} +{{:assign var="user_filters" from="saved_filters.%s"|args:$logged_user.id}} + {{if $_GET.cat_key == null}} - {{:assign var="selected_category" from="module.config.%s_cat_key"|args:$_GET.output_type}} -{{elseif $_GET.cat_key == -1}} - {{:assign selected_category=null}} - {{if $_GET.output_type == "loan"}} - {{:save key="config" loan_cat_key=null}} - {{elseif $_GET.output_type == "rent"}} - {{:save key="config" rent_cat_key=null}} - {{/if}} + {{:assign var="selected_category" from="user_filters.%s_cat_key"|args:$_GET.output_type}} {{else}} - {{:assign selected_category=$_GET.cat_key}} - {{if $_GET.output_type == "loan"}} - {{:save key="config" loan_cat_key=$selected_category}} - {{elseif $_GET.output_type == "rent"}} - {{:save key="config" rent_cat_key=$selected_category}} + {{if $_GET.cat_key == -1}} + {{:assign selected_category=null}} + {{else}} + {{:assign selected_category=$_GET.cat_key}} {{/if}} + {{:assign var="user_filters.%s_cat_key"|args:$_GET.output_type value=$selected_category}} + {{:assign var="saved_filters.%s"|args:$logged_user.id value=$user_filters}} + {{:save key="config" filters=$saved_filters}} {{/if}} {{* condition de filtrage *}} From ca7b21bdeaa54f36caa69fe682fd8dadcd2d6f45 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Engel Date: Wed, 11 Feb 2026 17:53:47 +0100 Subject: [PATCH 2/2] =?UTF-8?q?Ajout=20onglets=20pr=C3=AAts/locations=20au?= =?UTF-8?q?x=20membres?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _nav.html | 2 + member_loan.html | 101 +++++++++++++++++++++++++++++++++++++++++++++++ style.css | 4 ++ 3 files changed, 107 insertions(+) create mode 100644 member_loan.html diff --git a/_nav.html b/_nav.html index e2e6170..84b5a0f 100644 --- a/_nav.html +++ b/_nav.html @@ -30,11 +30,13 @@ {{elseif $current == 'location'}} {{elseif $current == 'archives'}} {{if $subsubcurrent == 'historique'}} diff --git a/member_loan.html b/member_loan.html new file mode 100644 index 0000000..63e71a8 --- /dev/null +++ b/member_loan.html @@ -0,0 +1,101 @@ +{{* -*- brindille -*- *}} + +{{#restrict block=true section="accounting" level="write"}}{{/restrict}} + +{{* + paramètres : + - id : id membre +*}} + +{{if $_GET.output_type == "loan"}} + {{:assign label="prêt"}} +{{elseif $_GET.output_type == "rent"}} + {{:assign label="location"}} +{{else}} + {{:error message="Cette page n'existe pas !"}} +{{/if}} + +{{:admin_header title="%ss aux membres"|args:$label|ucfirst custom_css="./style.css" current="module_equipment"}} +{{:include file="./_nav.html" current="%s"|args:$label subcurrent="membres"}} + +{{* vérifier l'existence de la table du module *}} +{{#load limit="1"}} + {{:assign table_presente=true}} +{{else}} + {{:assign table_presente=false}} +{{/load}} + +{{if $table_presente}} +{{:include file="./_get_config.html" keep="config"}} + +{{* déterminer les types de mouvements *}} +{{#foreach from=$config.output_nature key="key"}} + {{if $type != 'temporaire'}} + {{:continue}} + {{/if}} + {{if $_GET.output_type == "loan" && $fee != 'payant'}} + {{:assign var="out_keys." value=$key|quote_sql}} + {{elseif $_GET.output_type == "rent" && $fee == 'payant'}} + {{:assign var="out_keys." value=$key|quote_sql}} + {{/if}} +{{/foreach}} +{{:assign out_keys=$out_keys|implode:","}} +{{:assign out_keys="("|cat:$out_keys|cat:")"}} + +
+

{{$label|ucfirst}}s aux membres

+
+ +{{:assign premier=true}} +{{#select + nom, user, GROUP_CONCAT(mat_name) AS materiel, SUM(remain) AS quantite + FROM + (SELECT users.nom AS nom, + users.id AS user, + json_extract(mat.document, '$.name') AS mat_name, + json_extract(mvt.document, '$.amount') - IFNULL(SUM(json_extract(retour.document, '$.amount')), 0) AS remain + FROM !table AS mvt + INNER JOIN users ON json_extract(mvt.document, '$.user') = users.id + LEFT JOIN !table AS links ON mvt.key = json_extract(links.document, '$.temp_key') + LEFT JOIN !table AS retour ON retour.key = json_extract(links.document, '$.return') + INNER JOIN !table AS mat ON mat.key = json_extract(mvt.document, '$.equipment') + WHERE json_extract(mvt.document, '$.type') = 'movement' + AND json_extract(mvt.document, '$.operation') IN !op + GROUP BY mvt.key + HAVING remain != 0 + ) + GROUP BY user + ORDER BY nom + ; + !table=$module.table + !op = $out_keys + }} + + {{if $premier}} + + + + + + + + + + {{:assign premier=false}} + {{/if}} + + + + + + +{{else}} +

Aucun mouvement.

+{{/select}} + +
MembreQuantitéMatériels
{{:link href="/admin/users/details.php?id=%s"|args:$user label="%s"|args:$nom}}{{$quantite}}{{$materiel}}
+{{else}} +

Aucun mouvement.

+{{/if}} + +{{:admin_footer}} diff --git a/style.css b/style.css index 39ae075..9b112b6 100644 --- a/style.css +++ b/style.css @@ -24,3 +24,7 @@ table.list > thead th[class~=nosort] a:hover { background-color : rgba(var(--gSecondColor), 0.); } + +.nombre { + text-align: right !important; +}