Files
equipment_resa/index.html
T

67 lines
2.2 KiB
HTML

{{* -*- brindille -*- *}}
{{#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_%s"|args:$module.name}}
{{if ! $is_admin}}
{{* MEMBER PART *}}
{{:assign var="user.id" value=$logged_user.id}}
{{:include file="snippets/my_details.html"}}
{{* Reservations *}}
{{if $module.config.resa_active == true}}
{{if !$_GET.fonc}}
{{:include file="./_resa_inventory.html" keep="_GET.prop"}}
{{elseif $_GET.fonc=="voir"}}
{{:include file="./_web_calendar.html" title=$page.title|remove_leading_number}}
{{:include file="./_web_view.html" parent=$page.path}}
{{elseif $_GET.fonc=="resa"}}
{{:include file="./_web_resa.html" parent=$page.path}}
{{elseif $_GET.fonc=="confirm_resa"}}
{{if $_GET.ok}}
{{:include file="./_web_contract.html" parent=$page.path}}
{{/if}}
{{elseif $_GET.fonc=="save_resa"}}
{{:include file="./_web_saved_resa.html" parent=$page.path}}
{{*else}}
{{:include file="./_inventory.html" parent=$page.path keep="cat_key,prop"*}}
{{/if}}
{{/if}}
{{else}}
{{* ADMIN PART *}}
{{#restrict block=true section="accounting" level="write"}}{{/restrict}}
{{#load type="category" count=true limit=1 assign="result"}}{{/load}}
{{:include file="_nav.html" current="inventaire" cat="%d"|args:$result.count}}
{{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}}
{{* Reservations *}}
{{if $module.config.resa_active == true}}
{{:include file="./_resa_inventory.html" keep="_GET.prop"}}
{{else}}
{{:include file="./_inventory.html"}}
{{/if}}
{{/if}}
{{:admin_footer}}
{{/if}}