{{#restrict section="config" level="admin" block=true}}{{/restrict}} {{:admin_header title="Gestion des matériels" current="module_equipment"}} {{* barre de navigation *}} {{:include file="/%s/_nav.html"|args:$module.name current="entrees"}} {{* types d'entrées *}} {{* TODO : stocker dans la configuration du module *}} {{:assign var='types_entrees.' value='Achat'}} {{:assign var='types_entrees.' value='Don'}} {{:assign var='types_entrees.' value='Récupération'}} {{:assign var='types_entrees.' value='Location / Prêt'}} {{:assign maintenant=$now|date_short}} {{* lister les catégories disponibles *}} {{#load type="category" assign="category"}} {{* order="$$.name" debug *}} {{:assign var="categories." value=$category.name}} {{/load}} {{* TODO Traiter l'envoi du formulaire *}} {{#form on="save"}} {{:assign key=""|uuid}} {{:save key=$key validate_schema="./category.schema.json" type="category" name=$_POST.name|trim }} {{:redirect to="./index.html?ok=1"}} {{/form}} {{* /TODO *}} {{:form_errors}} {{* formulaire d'ajout de matériel *}}
Ajouter une entrée d'un matériel non répertorié {{:input type="select" name="type_materiel" label="Type" required=true options=$types_entrees}} {{:input type="date" name="date" label="Date" required=true default=$maintenant}} {{:input type="number" name="quantite" label="Quantité" required=true default=1}}
Matériel {{:input type="select" name="category" label="Catégorie" required=true options=$categories}} {{:input type="text" name="designation" label="Désignation" required=true}} {{:input type="textarea" name="remarques" label="Remarques" cols="40", rows="3" required=false}}

{{:button type="submit" name="save" label="Enregistrer" shape="right" class="main"}} {{:button type="submit" name="cancel" label="Annuler" shape="delete" class="main"}}

{{:admin_footer}}