diff --git a/archives.html b/archives.html index 4e2f97f..087ac1c 100644 --- a/archives.html +++ b/archives.html @@ -1,7 +1,5 @@ {{* -*- 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 0fe45c8..20691ae 100644 --- a/categories/add_category.html +++ b/categories/add_category.html @@ -1,6 +1,9 @@ {{* -*- brindille -*- *}} -{{#restrict block=true section="accounting" level="write"}}{{/restrict}} +{{* barre de navigation *}} +{{if ! $dialog}} + {{:include file="../_nav.html" current="config" subcurrent="categories"}} +{{/if}} {{* Traiter l'envoi du formulaire *}} {{#form on="save"}} @@ -22,11 +25,6 @@ {{/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 7838f41..7430344 100644 --- a/categories/delete_category.html +++ b/categories/delete_category.html @@ -1,7 +1,5 @@ {{* -*- 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 d021953..0eb43d0 100644 --- a/categories/index.html +++ b/categories/index.html @@ -1,7 +1,5 @@ {{* -*- 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 0819a78..9d2d315 100644 --- a/categories/modify_category.html +++ b/categories/modify_category.html @@ -1,7 +1,5 @@ {{* -*- 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 9927c5e..d7661ab 100644 --- a/config.html +++ b/config.html @@ -1,7 +1,5 @@ {{* -*- 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 06881dc..226311f 100644 --- a/config/add_movement_type.html +++ b/config/add_movement_type.html @@ -1,12 +1,15 @@ {{* -*- 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 *}} @@ -48,11 +51,6 @@ {{/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 4f0ddaa..9e889ab 100644 --- a/config/delete_movement_type.html +++ b/config/delete_movement_type.html @@ -1,13 +1,15 @@ {{* -*- 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"}} @@ -35,10 +37,6 @@ {{/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 d49ef65..6c36be2 100644 --- a/config/misc.html +++ b/config/misc.html @@ -1,7 +1,5 @@ {{* -*- 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 89d9970..b5210c3 100644 --- a/config/modify_movement_type.html +++ b/config/modify_movement_type.html @@ -1,13 +1,16 @@ {{* -*- 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"}} @@ -40,12 +43,7 @@ {{/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 786adbe..f96010d 100644 --- a/equipment_history.html +++ b/equipment_history.html @@ -1,7 +1,5 @@ {{* -*- 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 0864eb1..5eb69c1 100644 --- a/global_history.html +++ b/global_history.html @@ -1,7 +1,5 @@ {{* -*- 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 6420b90..92538c8 100644 --- a/index.html +++ b/index.html @@ -1,7 +1,5 @@ {{* -*- 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 0d1fe81..9fc1924 100644 --- a/loan_history.html +++ b/loan_history.html @@ -1,7 +1,5 @@ {{* -*- 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"}} @@ -108,11 +106,11 @@ {{if $nb_jours < -1}}{{:assign jour="jours"}}{{/if}} {{"Reste %s %s"|args:$delai:$jour}} {{else}} - {{:tag color="darkgreen" label="À rendre aujourd'hui"}} + {{:tag color="darkgreen" label="À rendre aujourdh'ui"}} {{/if}} {{/if}} - + {{:linkbutton label="Retour" href="movements/output_return.html?key=%s&prop=1"|args:$mvt_key diff --git a/member_history.html b/member_history.html deleted file mode 100644 index 38f610c..0000000 --- a/member_history.html +++ /dev/null @@ -1,126 +0,0 @@ -{{* -*- brindille -*- *}} - -{{* - Afficher l'historique des mouvements d'un matériel pour un membre - paramètres - - key : clé du matériel - - 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) *}} -{{:include file="./_get_config.html" keep="config, directions"}} - -{{#foreach from=$directions key="direction"}} - {{:assign var="nature" from="config.%s_nature"|args:$direction}} - {{#foreach from=$nature key=key}} - {{:assign var="types.%s.%s."|args:$direction:$type value=$key|quote_sql}} - {{/foreach}} - {{:assign var="io_types" from="types.%s"|args:$direction}} - {{#foreach from=$io_types key=key}} - {{:assign var=elem from="io_types.%s"|args:$key}} - {{:assign elem=$elem|implode:","}} - {{:assign elem="("|cat:$elem|cat:")"}} - {{:assign var="%s_types.%s"|args:$direction:$key value=$elem}} - {{/foreach}} -{{/foreach}} - -{{#users id=$_GET.id}} - {{:assign user_name=$nom}} -{{else}} - {{:error message="Il n'existe aucun membre avec l'identifiant %s !"|args:$_GET.id}} -{{/users}} - -{{#load key=$_GET.key|trim}} - {{:assign eqpmt_name=$name}} -{{else}} - {{:error message="Il n'existe aucun matériel avec la clé %s !"|args:$_GET.key|trim}} -{{/load}} - -

Historique des mouvements de « {{$eqpmt_name}} » du membre « {{$user_name}} »

- -{{:assign otk=null}} -{{#select - mvt.key AS mvt_key, - json_extract(mvt.document, '$.direction') as direction, - json_extract(mvt.document, '$.operation') as operation, - json_extract(mvt.document, '$.date') as date, - json_extract(mvt.document, '$.amount') as amount, - COALESCE((SELECT - json_extract(links.document, '$.temp_key') - FROM {!$module.table} AS links - WHERE json_extract(links.document, '$.temp_key') = mvt.key - OR json_extract(links.document, '$.return') = mvt.key), mvt.key) - AS out_temp_key - FROM {!$module.table} AS mvt - INNER JOIN users ON json_extract(mvt.document, '$.user') = users.id - INNER JOIN {!$module.table} AS eqpmt - ON json_extract(mvt.document, '$.equipment') = eqpmt.key - WHERE users.id = :user - AND eqpmt.key = :eqpmt_key - AND (json_extract(mvt.document, '$.operation') IN !output_types - OR json_extract(mvt.document, '$.operation') IN !input_types) - ORDER BY out_temp_key, date - ; - :user = $_GET.id - :eqpmt_key = $_GET.key|trim - !output_types=$output_types.temporaire - !input_types=$input_types.retour -}} - - {{:assign var="type_mvt" from="config.%s_nature.%s.type"|args:$direction:$operation}} - {{:assign var="op_label" from="config.%s_nature.%s.label"|args:$direction:$operation}} - {{:assign var="total" from="reste.%s"|args:$out_temp_key}} - {{if $total == null}} - {{:assign total=0}} - {{/if}} - - {{if $otk != null && $otk != $out_temp_key}} - - - {{/if}} - {{if $otk == null || $otk != $out_temp_key}} - - - - - - - - - - - - {{:assign otk=$out_temp_key}} - {{/if}} - - {{if $direction == 'input' && $type_mvt == 'retour'}} - {{:assign var="reste.%s"|args:$out_temp_key value="%d-%d"|math:$total:$amount}} - {{elseif $direction == 'output' && $type_mvt == 'temporaire'}} - {{:assign var="reste.%s"|args:$out_temp_key value="%d+%d"|math:$total:$amount}} - {{/if}} - {{:assign var="total" from="reste.%s"|args:$out_temp_key}} - - - - - - - - -{{/select}} - -
DateOpérationQuantitéTotal
{{$date|date_short}}{{$op_label}}{{$amount}}{{$total}} - {{#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}} - {{/restrict}} -
diff --git a/modify_equipment.html b/modify_equipment.html index 6236ef7..d36c78b 100644 --- a/modify_equipment.html +++ b/modify_equipment.html @@ -1,7 +1,5 @@ {{* -*- 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 9a24cc3..28ffd9e 100644 --- a/module.ini +++ b/module.ini @@ -4,7 +4,5 @@ author="Jean-Christophe Engel" author_url="https://gitea.zaclys.com/lesanges" home_button=true menu=true -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 +restrict_section="accounting" +restrict_level="write" diff --git a/movements/add_new_equipment.html b/movements/add_new_equipment.html index 74a5f67..af91337 100644 --- a/movements/add_new_equipment.html +++ b/movements/add_new_equipment.html @@ -1,6 +1,9 @@ {{* -*- brindille -*- *}} -{{#restrict block=true section="accounting" level="write"}}{{/restrict}} +{{* barre de navigation *}} +{{if ! $dialog}} + {{:include file="../_nav.html" current="entrees"}} +{{/if}} {{* récupérer la config des entrées/sorties *}} {{:include file="../_get_config.html" keep="config"}} @@ -117,10 +120,6 @@ {{/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 84c0e2e..4c68f63 100644 --- a/movements/copy_movement.html +++ b/movements/copy_movement.html @@ -1,7 +1,5 @@ {{* -*- 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 506ebe4..0561692 100644 --- a/movements/delete_movement.html +++ b/movements/delete_movement.html @@ -1,6 +1,4 @@ -{{* -*- brindille -*- *}} - -{{#restrict block=true section="accounting" level="write"}}{{/restrict}} +{{* -*- brindille -*-}} {{* paramètres GET : diff --git a/movements/input_equipment.html b/movements/input_equipment.html index 287d430..f98294a 100644 --- a/movements/input_equipment.html +++ b/movements/input_equipment.html @@ -1,7 +1,5 @@ {{* -*- 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 598b501..4683205 100644 --- a/movements/input_return.html +++ b/movements/input_return.html @@ -1,7 +1,5 @@ {{* -*- 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 542267f..ce5eebd 100644 --- a/movements/modify_movement.html +++ b/movements/modify_movement.html @@ -1,7 +1,5 @@ {{* -*- 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 ac2bb5a..55eeb5a 100644 --- a/movements/movement_details.html +++ b/movements/movement_details.html @@ -1,7 +1,5 @@ {{* -*- brindille -*- *}} -{{#restrict block=true section="accounting" level="write"}}{{/restrict}} - {{* Afficher les détails d'un mouvement et donner la possibilité : - d'associer des fichiers @@ -65,9 +63,9 @@
Opération
{{$op_label}}
Matériel
-
{{:link href="../equipment_history.html?key=%s&prop=%s"|args:$equipment.key:$_GET.prop label=$equipment.name}}
+
{{$equipment.name}}
Catégorie
-
{{:link href="../index.html?cat_key=%s&prop=1"|args:$category.key label=$category.name}}
+
{{$category.name}}
Date
{{$mvt.date|date_short}}
Quantité
@@ -76,7 +74,7 @@
Membre destinataire
{{if $mvt.user != null}} - {{:link href="/admin/users/details.php?id=%s"|args:$mvt.user label=$user_name}} + {{$user_name}} {{else}}— {{/if}}
@@ -97,21 +95,16 @@ {{else}}— {{/foreach}} - {{if $mvt.direction == "output" && $type_mvt != "retour"}} -
Date de retour
-
- {{if $mvt.return_date != null}} - {{$mvt.return_date|date_short}} - {{else}}— - {{/if}} -
- {{/if}}
Remarques
{{if $mvt.comment != null}} {{$mvt.comment}} {{else}}— {{/if}}
+ {{if $mvt.return_date != null}} +
Date de retour
+
{{$mvt.return_date|date_short}}
+ {{/if}} diff --git a/movements/output_equipment.html b/movements/output_equipment.html index b2ae27e..38be7d5 100644 --- a/movements/output_equipment.html +++ b/movements/output_equipment.html @@ -1,7 +1,5 @@ {{* -*- 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 6b14bb6..7f5b0af 100644 --- a/movements/output_return.html +++ b/movements/output_return.html @@ -1,7 +1,5 @@ {{* -*- brindille -*- *}} -{{#restrict block=true section="accounting" level="write"}}{{/restrict}} - {{* Enregistrer un retour de sortie temporaire paramètres : diff --git a/snippets/user_details.html b/snippets/user_details.html index 0eca2a2..0908759 100644 --- a/snippets/user_details.html +++ b/snippets/user_details.html @@ -69,7 +69,6 @@ {{:assign nb_jours=0}} {{:assign old_eqpmt_key=$eqpmt_key}} {{:assign var="ligne.date" value=$date}} - {{:assign var="ligne.eqpmt_key" value=$eqpmt_key}} {{:assign var="ligne.materiel" value=$eqpmt_name}} {{:assign var="ligne.return_date" value=$return_date}} {{:assign var="ligne.retard" value="0"}} @@ -89,7 +88,6 @@ {{:assign nb_jours=0}} {{:assign old_eqpmt_key=$eqpmt_key}} {{:assign var="ligne.date" value=$date}} - {{:assign var="ligne.eqpmt_key" value=$eqpmt_key}} {{:assign var="ligne.materiel" value=$eqpmt_name}} {{:assign var="ligne.return_date" value=$return_date}} {{:assign var="ligne.retard" value="0"}} @@ -122,7 +120,6 @@ Quantité Date de retour Remarque - @@ -142,14 +139,6 @@ {{:tag color="darkgreen" label="À rendre aujourdh'ui"}} {{/if}} - - {{:linkbutton - label="Historique" - href="%smember_history.html?key=%s&id=%s"|args:$module.url:$eqpmt_key:$user.id - shape="table" - target="_dialog" - }} - {{/foreach}} diff --git a/storage/add_storage.html b/storage/add_storage.html index 628ae44..71e6464 100644 --- a/storage/add_storage.html +++ b/storage/add_storage.html @@ -1,8 +1,6 @@ {{* -*- 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 eb031e8..03facb6 100644 --- a/storage/delete_storage.html +++ b/storage/delete_storage.html @@ -1,7 +1,5 @@ {{* -*- 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 0464432..62ae527 100644 --- a/storage/index.html +++ b/storage/index.html @@ -1,7 +1,5 @@ {{* -*- 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 e647c4a..8d6878b 100644 --- a/storage/modify_storage.html +++ b/storage/modify_storage.html @@ -1,7 +1,5 @@ {{* -*- 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 bdea710..4b86bcd 100644 --- a/unarchive_equipment.html +++ b/unarchive_equipment.html @@ -1,7 +1,5 @@ {{* -*- brindille -*- *}} -{{#restrict block=true section="accounting" level="write"}}{{/restrict}} - {{* Remettre le matériel en service Paramètres :