From 63775189dab5d2eef003ecd5c26f09a62d6b9276 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Engel Date: Wed, 3 Dec 2025 10:47:43 +0100 Subject: [PATCH] =?UTF-8?q?Mise=20en=20place=20gestion=20acc=C3=A8s=20aux?= =?UTF-8?q?=20pages?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- archives.html | 2 ++ categories/add_category.html | 10 ++++++---- categories/delete_category.html | 2 ++ categories/index.html | 2 ++ categories/modify_category.html | 2 ++ config.html | 2 ++ config/add_movement_type.html | 12 +++++++----- config/delete_movement_type.html | 10 ++++++---- config/misc.html | 2 ++ config/modify_movement_type.html | 12 +++++++----- equipment_history.html | 2 ++ global_history.html | 2 ++ index.html | 2 ++ loan_history.html | 2 ++ member_history.html | 16 ++++++++++------ modify_equipment.html | 2 ++ module.ini | 6 ++++-- movements/add_new_equipment.html | 9 +++++---- movements/copy_movement.html | 2 ++ movements/delete_movement.html | 4 +++- movements/input_equipment.html | 2 ++ movements/input_return.html | 2 ++ movements/modify_movement.html | 2 ++ movements/movement_details.html | 2 ++ movements/output_equipment.html | 2 ++ movements/output_return.html | 2 ++ storage/add_storage.html | 2 ++ storage/delete_storage.html | 2 ++ storage/index.html | 2 ++ storage/modify_storage.html | 2 ++ unarchive_equipment.html | 2 ++ 31 files changed, 94 insertions(+), 31 deletions(-) diff --git a/archives.html b/archives.html index 087ac1c..4e2f97f 100644 --- a/archives.html +++ b/archives.html @@ -1,5 +1,7 @@ {{* -*- brindille -*- *}} +{{#restrict block=true section="accounting" level="write"}}{{/restrict}} + {{:admin_header title="Matériels archivés" current="module_equipment"}} {{:include file="_nav.html" current="archives"}} diff --git a/categories/add_category.html b/categories/add_category.html index 20691ae..0fe45c8 100644 --- a/categories/add_category.html +++ b/categories/add_category.html @@ -1,9 +1,6 @@ {{* -*- brindille -*- *}} -{{* barre de navigation *}} -{{if ! $dialog}} - {{:include file="../_nav.html" current="config" subcurrent="categories"}} -{{/if}} +{{#restrict block=true section="accounting" level="write"}}{{/restrict}} {{* Traiter l'envoi du formulaire *}} {{#form on="save"}} @@ -25,6 +22,11 @@ {{/form}} {{:admin_header title="Gestion des matériels" current="module_equipment"}} +{{* barre de navigation *}} +{{if ! $dialog}} + {{:include file="../_nav.html" current="config" subcurrent="categories"}} +{{/if}} + {{:form_errors}} {{* formulaire d'ajout de catégorie *}} diff --git a/categories/delete_category.html b/categories/delete_category.html index 7430344..7838f41 100644 --- a/categories/delete_category.html +++ b/categories/delete_category.html @@ -1,5 +1,7 @@ {{* -*- brindille -*- *}} +{{#restrict block=true section="accounting" level="write"}}{{/restrict}} + {{#load key=$_GET.key assign="category"}} {{else}} {{:error message="Catégorie introuvable"}} diff --git a/categories/index.html b/categories/index.html index 0eb43d0..d021953 100644 --- a/categories/index.html +++ b/categories/index.html @@ -1,5 +1,7 @@ {{* -*- brindille -*- *}} +{{#restrict block=true section="accounting" level="write"}}{{/restrict}} + {{:admin_header title="Configuration" current="module_equipment"}} {{* barre de navigation *}} diff --git a/categories/modify_category.html b/categories/modify_category.html index 9d2d315..0819a78 100644 --- a/categories/modify_category.html +++ b/categories/modify_category.html @@ -1,5 +1,7 @@ {{* -*- brindille -*- *}} +{{#restrict block=true section="accounting" level="write"}}{{/restrict}} + {{#load key=$_GET.key assign="category"}} {{else}} {{:error message="Catégorie introuvable"}} diff --git a/config.html b/config.html index d7661ab..9927c5e 100644 --- a/config.html +++ b/config.html @@ -1,5 +1,7 @@ {{* -*- brindille -*- *}} +{{#restrict block=true section="accounting" level="write"}}{{/restrict}} + {{:admin_header title="Configuration" current="module_equipment"}} {{* barre de navigation *}} diff --git a/config/add_movement_type.html b/config/add_movement_type.html index 226311f..06881dc 100644 --- a/config/add_movement_type.html +++ b/config/add_movement_type.html @@ -1,15 +1,12 @@ {{* -*- brindille -*- *}} +{{#restrict block=true section="accounting" level="write"}}{{/restrict}} + {{* paramètres : - dir : input ou output *}} -{{* barre de navigation *}} -{{if ! $dialog}} - {{:include file="../_nav.html" current="config" subcurrent="typesES"}} -{{/if}} - {{* Traiter l'envoi du formulaire *}} {{* lecture config *}} @@ -51,6 +48,11 @@ {{/form}} {{:admin_header title="Gestion des matériels" current="module_equipment"}} +{{* barre de navigation *}} +{{if ! $dialog}} + {{:include file="../_nav.html" current="config" subcurrent="typesES"}} +{{/if}} + {{:form_errors}} {{if $_GET.dir == 'input'}} diff --git a/config/delete_movement_type.html b/config/delete_movement_type.html index 9e889ab..4f0ddaa 100644 --- a/config/delete_movement_type.html +++ b/config/delete_movement_type.html @@ -1,15 +1,13 @@ {{* -*- brindille -*- *}} +{{#restrict block=true section="accounting" level="write"}}{{/restrict}} + {{* paramètres : - dir : input ou output - op_key : clé du type de mouvement à supprimer *}} -{{* barre de navigation *}} -{{if ! $dialog}} - {{:include file="../_nav.html" current="config" subcurrent="typesES"}} -{{/if}} {{* lecture config (défaut ou enregistrée) *}} {{:include file="../_get_config.html" keep="config, directions"}} @@ -37,6 +35,10 @@ {{/form}} {{:admin_header title="Gestion des matériels" current="module_equipment"}} +{{* barre de navigation *}} +{{if ! $dialog}} + {{:include file="../_nav.html" current="config" subcurrent="typesES"}} +{{/if}} {{:form_errors}} {{:assign var="mvt_label" from="config.%s_nature.%s.label"|args:$_GET.dir:$_GET.op_key}} diff --git a/config/misc.html b/config/misc.html index 6c36be2..d49ef65 100644 --- a/config/misc.html +++ b/config/misc.html @@ -1,5 +1,7 @@ {{* -*- brindille -*- *}} +{{#restrict block=true section="accounting" level="write"}}{{/restrict}} + {{:admin_header title="Configuration" current="module_equipment"}} {{#form on="save"}} diff --git a/config/modify_movement_type.html b/config/modify_movement_type.html index b5210c3..89d9970 100644 --- a/config/modify_movement_type.html +++ b/config/modify_movement_type.html @@ -1,16 +1,13 @@ {{* -*- brindille -*- *}} +{{#restrict block=true section="accounting" level="write"}}{{/restrict}} + {{* paramètres : - dir : input ou output - op_key : clé du type de mouvement dont on veut modifier le libellé *}} -{{* barre de navigation *}} -{{if ! $dialog}} - {{:include file="../_nav.html" current="config" subcurrent="typesES"}} -{{/if}} - {{* lecture config (défaut ou enregistrée) *}} {{:include file="../_get_config.html" keep="config, directions"}} @@ -43,7 +40,12 @@ {{/form}} {{:admin_header title="Gestion des matériels" current="module_equipment"}} +{{* barre de navigation *}} +{{if ! $dialog}} + {{:include file="../_nav.html" current="config" subcurrent="typesES"}} +{{/if}} {{:form_errors}} + {{:assign var="default_label" from="config.%s_nature.%s.label"|args:$_GET.dir:$_GET.op_key}}
diff --git a/equipment_history.html b/equipment_history.html index f96010d..786adbe 100644 --- a/equipment_history.html +++ b/equipment_history.html @@ -1,5 +1,7 @@ {{* -*- brindille -*- *}} +{{#restrict block=true section="accounting" level="write"}}{{/restrict}} + {{* Afficher l'historique des mouvements d'un matériel paramètres diff --git a/global_history.html b/global_history.html index 5eb69c1..0864eb1 100644 --- a/global_history.html +++ b/global_history.html @@ -1,5 +1,7 @@ {{* -*- brindille -*- *}} +{{#restrict block=true section="accounting" level="write"}}{{/restrict}} + {{* Afficher l'historique de tous les mouvements *}} diff --git a/index.html b/index.html index 92538c8..6420b90 100644 --- a/index.html +++ b/index.html @@ -1,5 +1,7 @@ {{* -*- brindille -*- *}} +{{#restrict block=true section="accounting" level="write"}}{{/restrict}} + {{:admin_header title="Gestion des matériels" custom_css="./style.css" current="module_equipment"}} {{* barre de navigation *}} diff --git a/loan_history.html b/loan_history.html index 15f542c..0d1fe81 100644 --- a/loan_history.html +++ b/loan_history.html @@ -1,5 +1,7 @@ {{* -*- brindille -*- *}} +{{#restrict block=true section="accounting" level="write"}}{{/restrict}} + {{:admin_header title="Matériels hors de l'asso" custom_css="../style.css" current="module_equipment"}} {{:include file="./_nav.html" current="historique" subcurrent="prêts"}} diff --git a/member_history.html b/member_history.html index 6c4dc83..38f610c 100644 --- a/member_history.html +++ b/member_history.html @@ -7,6 +7,8 @@ - id : id du membre *}} +{{#restrict block=true section="users" level="read"}}{{/restrict}} + {{:admin_header title="Historique membre" custom_css="./style.css" current="module_equipment"}} {{* lecture config (défaut ou enregistrée) *}} @@ -108,13 +110,15 @@ {{$amount}} {{$total}} - {{if $direction == "output" && $type_mvt == "temporaire"}} - {{:linkbutton - label="Retour" - href="%smovements/output_return.html?key=%s&prop=0&user=%s"|args:$module.url:$mvt_key:$_GET.id - shape="history" + {{#restrict section="accounting" level="write"}} + {{if $direction == "output" && $type_mvt == "temporaire"}} + {{:linkbutton + label="Retour" + href="%smovements/output_return.html?key=%s&prop=0&user=%s"|args:$module.url:$mvt_key:$_GET.id + shape="history" target="_dialog"}} - {{/if}} + {{/if}} + {{/restrict}} {{/select}} diff --git a/modify_equipment.html b/modify_equipment.html index d36c78b..6236ef7 100644 --- a/modify_equipment.html +++ b/modify_equipment.html @@ -1,5 +1,7 @@ {{* -*- brindille -*- *}} +{{#restrict block=true section="accounting" level="write"}}{{/restrict}} + {{* Paramètres : - key : clé du matériel à modifier diff --git a/module.ini b/module.ini index 28ffd9e..9a24cc3 100644 --- a/module.ini +++ b/module.ini @@ -4,5 +4,7 @@ author="Jean-Christophe Engel" author_url="https://gitea.zaclys.com/lesanges" home_button=true menu=true -restrict_section="accounting" -restrict_level="write" +restrict_section="users" +restrict_level="read" +restrict_details="... mais uniquement pour consulter l'historique des prêts des membres ; seuls les membres ayant accès en écriture à la comptabilité pourront utiliser l'ensemble des fonctionalités du module." +allow_user_restrict=false diff --git a/movements/add_new_equipment.html b/movements/add_new_equipment.html index af91337..74a5f67 100644 --- a/movements/add_new_equipment.html +++ b/movements/add_new_equipment.html @@ -1,9 +1,6 @@ {{* -*- brindille -*- *}} -{{* barre de navigation *}} -{{if ! $dialog}} - {{:include file="../_nav.html" current="entrees"}} -{{/if}} +{{#restrict block=true section="accounting" level="write"}}{{/restrict}} {{* récupérer la config des entrées/sorties *}} {{:include file="../_get_config.html" keep="config"}} @@ -120,6 +117,10 @@ {{/form}} {{:admin_header title="Entrée de matériel" current="module_equipment"}} +{{* barre de navigation *}} +{{if ! $dialog}} + {{:include file="../_nav.html" current="entrees"}} +{{/if}} {{:form_errors}} {{if $categories != null}} diff --git a/movements/copy_movement.html b/movements/copy_movement.html index 4c68f63..84c0e2e 100644 --- a/movements/copy_movement.html +++ b/movements/copy_movement.html @@ -1,5 +1,7 @@ {{* -*- brindille -*- *}} +{{#restrict block=true section="accounting" level="write"}}{{/restrict}} + {{* Dupliquer un mouvement paramètres : diff --git a/movements/delete_movement.html b/movements/delete_movement.html index 0561692..506ebe4 100644 --- a/movements/delete_movement.html +++ b/movements/delete_movement.html @@ -1,4 +1,6 @@ -{{* -*- brindille -*-}} +{{* -*- brindille -*- *}} + +{{#restrict block=true section="accounting" level="write"}}{{/restrict}} {{* paramètres GET : diff --git a/movements/input_equipment.html b/movements/input_equipment.html index f98294a..287d430 100644 --- a/movements/input_equipment.html +++ b/movements/input_equipment.html @@ -1,5 +1,7 @@ {{* -*- brindille -*- *}} +{{#restrict block=true section="accounting" level="write"}}{{/restrict}} + {{* Enregistrer une entrée de matériel paramètres : diff --git a/movements/input_return.html b/movements/input_return.html index 4683205..598b501 100644 --- a/movements/input_return.html +++ b/movements/input_return.html @@ -1,5 +1,7 @@ {{* -*- brindille -*- *}} +{{#restrict block=true section="accounting" level="write"}}{{/restrict}} + {{* Enregistrer un retour d'entrée temporaire paramètres : diff --git a/movements/modify_movement.html b/movements/modify_movement.html index ce5eebd..542267f 100644 --- a/movements/modify_movement.html +++ b/movements/modify_movement.html @@ -1,5 +1,7 @@ {{* -*- brindille -*- *}} +{{#restrict block=true section="accounting" level="write"}}{{/restrict}} + {{* Modifier un mouvement paramètres : diff --git a/movements/movement_details.html b/movements/movement_details.html index 79f6c65..ac2bb5a 100644 --- a/movements/movement_details.html +++ b/movements/movement_details.html @@ -1,5 +1,7 @@ {{* -*- brindille -*- *}} +{{#restrict block=true section="accounting" level="write"}}{{/restrict}} + {{* Afficher les détails d'un mouvement et donner la possibilité : - d'associer des fichiers diff --git a/movements/output_equipment.html b/movements/output_equipment.html index 38be7d5..b2ae27e 100644 --- a/movements/output_equipment.html +++ b/movements/output_equipment.html @@ -1,5 +1,7 @@ {{* -*- brindille -*- *}} +{{#restrict block=true section="accounting" level="write"}}{{/restrict}} + {{* paramètres : - key : clé du matériel à sortir diff --git a/movements/output_return.html b/movements/output_return.html index 7f5b0af..6b14bb6 100644 --- a/movements/output_return.html +++ b/movements/output_return.html @@ -1,5 +1,7 @@ {{* -*- brindille -*- *}} +{{#restrict block=true section="accounting" level="write"}}{{/restrict}} + {{* Enregistrer un retour de sortie temporaire paramètres : diff --git a/storage/add_storage.html b/storage/add_storage.html index 71e6464..628ae44 100644 --- a/storage/add_storage.html +++ b/storage/add_storage.html @@ -1,6 +1,8 @@ {{* -*- brindille -*- *}} +{{#restrict block=true section="accounting" level="write"}}{{/restrict}} + {{* Traiter l'envoi du formulaire *}} {{#form on="save"}} diff --git a/storage/delete_storage.html b/storage/delete_storage.html index 03facb6..eb031e8 100644 --- a/storage/delete_storage.html +++ b/storage/delete_storage.html @@ -1,5 +1,7 @@ {{* -*- brindille -*- *}} +{{#restrict block=true section="accounting" level="write"}}{{/restrict}} + {{* paramètres : - key : clé du stockage à supprimer diff --git a/storage/index.html b/storage/index.html index 62ae527..0464432 100644 --- a/storage/index.html +++ b/storage/index.html @@ -1,5 +1,7 @@ {{* -*- brindille -*- *}} +{{#restrict block=true section="accounting" level="write"}}{{/restrict}} + {{* Afficher les lieux de stockage *}} diff --git a/storage/modify_storage.html b/storage/modify_storage.html index 8d6878b..e647c4a 100644 --- a/storage/modify_storage.html +++ b/storage/modify_storage.html @@ -1,5 +1,7 @@ {{* -*- brindille -*- *}} +{{#restrict block=true section="accounting" level="write"}}{{/restrict}} + {{* récupérer les infos du lieu de stockage *}} {{#load key=$_GET.key assign="storage"}} {{else}} diff --git a/unarchive_equipment.html b/unarchive_equipment.html index 4b86bcd..bdea710 100644 --- a/unarchive_equipment.html +++ b/unarchive_equipment.html @@ -1,5 +1,7 @@ {{* -*- brindille -*- *}} +{{#restrict block=true section="accounting" level="write"}}{{/restrict}} + {{* Remettre le matériel en service Paramètres :