diff --git a/index.html b/index.html index 6420b90..dce00cb 100644 --- a/index.html +++ b/index.html @@ -1,41 +1,51 @@ {{* -*- 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"}} -{{* barre de navigation *}} -{{if $_GET.prop == null || $_GET.prop}} - {{:assign proprio="proprio"}} +{{if ! $is_admin}} + {{:assign var="user.id" value=$logged_user.id}} + {{:include file="snippets/my_details.html"}} {{else}} - {{:assign proprio="nonproprio"}} -{{/if}} + {{#restrict block=true section="accounting" level="write"}}{{/restrict}} -{{#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" }} -
Ajout effectué
- {{elseif $_GET.msg == "modification" }} -Modification effectuée
- {{elseif $_GET.msg == "suppression" }} -Suppression effectuée
- {{elseif $_GET.msg == "supprmvtmat" }} -Mouvement supprimé - Matériel supprimé
- {{/if}} -{{elseif $_GET.err}} -Modification refusée
-{{/if}} - -{{if $result.count == 0}} -Il n'y a aucune catégorie : vous devez en ajouter.
-{{else}} - {{if $_GET.prop == null || $_GET.prop == "1"}} - {{:include file="./_inventory.html"}} + {{if $_GET.prop == null || $_GET.prop}} + {{:assign proprio="proprio"}} {{else}} - {{:include file="./_temp_inventory.html"}} + {{:assign proprio="nonproprio"}} {{/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" }} +Ajout effectué
+ {{elseif $_GET.msg == "modification" }} +Modification effectuée
+ {{elseif $_GET.msg == "suppression" }} +Suppression effectuée
+ {{elseif $_GET.msg == "supprmvtmat" }} +Mouvement supprimé - Matériel supprimé
+ {{/if}} + {{elseif $_GET.err}} +Modification refusée
+ {{/if}} + + {{if $result.count == 0}} +Il n'y a aucune catégorie : vous devez en ajouter.
+ {{else}} + {{if $_GET.prop == null || $_GET.prop == "1"}} + {{:include file="./_inventory.html"}} + {{else}} + {{:include file="./_temp_inventory.html"}} + {{/if}} + {{/if}} + + {{:admin_footer}} +{{/if}} diff --git a/snippets/_details.html b/snippets/_details.html index 0eca2a2..00a6e0b 100644 --- a/snippets/_details.html +++ b/snippets/_details.html @@ -1,7 +1,5 @@ {{* -*- brindille -*- *}} -{{#restrict section="users" level="read"}}{{/restrict}} - {{* lecture config (défaut ou enregistrée) *}} {{:include file="../_get_config.html" keep="config, directions"}}