Gestion accès module par icône et menu pour utilisateur lambda

This commit is contained in:
Jean-Christophe Engel 2026-01-09 15:12:32 +01:00
parent 4c0fa8217e
commit feef51361e
2 changed files with 41 additions and 33 deletions

View file

@ -1,41 +1,51 @@
{{* -*- brindille -*- *}} {{* -*- brindille -*- *}}
{{#restrict block=true section="accounting" level="write"}}{{/restrict}} {{#restrict section="accounting" level="write"}}
{{:assign is_admin=true}}
{{else}}
{{:assign is_admin=false}}
{{/restrict}}
{{:admin_header title="Gestion des matériels" custom_css="./style.css" current="module_equipment"}} {{:admin_header title="Gestion des matériels" custom_css="./style.css" current="module_equipment"}}
{{* barre de navigation *}} {{if ! $is_admin}}
{{if $_GET.prop == null || $_GET.prop}} {{:assign var="user.id" value=$logged_user.id}}
{{:assign proprio="proprio"}} {{:include file="snippets/my_details.html"}}
{{else}} {{else}}
{{:assign proprio="nonproprio"}} {{#restrict block=true section="accounting" level="write"}}{{/restrict}}
{{/if}}
{{#load type="category" count=true assign="result"}}{{/load}} {{if $_GET.prop == null || $_GET.prop}}
{{:include file="_nav.html" current="inventaire" cat="%d"|args:$result.count subcurrent="%s"|args:$proprio}} {{:assign proprio="proprio"}}
{{if $_GET.ok}}
{{if $_GET.msg == "ajout" }}
<p class="block confirm">Ajout effectué</p>
{{elseif $_GET.msg == "modification" }}
<p class="block confirm">Modification effectuée</p>
{{elseif $_GET.msg == "suppression" }}
<p class="block confirm">Suppression effectuée</p>
{{elseif $_GET.msg == "supprmvtmat" }}
<p class="block confirm">Mouvement supprimé - Matériel supprimé</p>
{{/if}}
{{elseif $_GET.err}}
<p class="block error">Modification refusée</p>
{{/if}}
{{if $result.count == 0}}
<p class="block alert">Il n'y a aucune catégorie : vous devez en ajouter.</p>
{{else}}
{{if $_GET.prop == null || $_GET.prop == "1"}}
{{:include file="./_inventory.html"}}
{{else}} {{else}}
{{:include file="./_temp_inventory.html"}} {{:assign proprio="nonproprio"}}
{{/if}} {{/if}}
{{/if}}
{{:admin_footer}} {{#load type="category" count=true assign="result"}}{{/load}}
{{:include file="_nav.html" current="inventaire" cat="%d"|args:$result.count subcurrent="%s"|args:$proprio}}
{{if $_GET.ok}}
{{if $_GET.msg == "ajout" }}
<p class="block confirm">Ajout effectué</p>
{{elseif $_GET.msg == "modification" }}
<p class="block confirm">Modification effectuée</p>
{{elseif $_GET.msg == "suppression" }}
<p class="block confirm">Suppression effectuée</p>
{{elseif $_GET.msg == "supprmvtmat" }}
<p class="block confirm">Mouvement supprimé - Matériel supprimé</p>
{{/if}}
{{elseif $_GET.err}}
<p class="block error">Modification refusée</p>
{{/if}}
{{if $result.count == 0}}
<p class="block alert">Il n'y a aucune catégorie : vous devez en ajouter.</p>
{{else}}
{{if $_GET.prop == null || $_GET.prop == "1"}}
{{:include file="./_inventory.html"}}
{{else}}
{{:include file="./_temp_inventory.html"}}
{{/if}}
{{/if}}
{{:admin_footer}}
{{/if}}

View file

@ -1,7 +1,5 @@
{{* -*- brindille -*- *}} {{* -*- brindille -*- *}}
{{#restrict section="users" level="read"}}{{/restrict}}
{{* lecture config (défaut ou enregistrée) *}} {{* lecture config (défaut ou enregistrée) *}}
{{:include file="../_get_config.html" keep="config, directions"}} {{:include file="../_get_config.html" keep="config, directions"}}