Compare commits
3 Commits
4d0bcc1bdd
...
79a3719892
Author | SHA1 | Date | |
---|---|---|---|
79a3719892 | |||
6757757f63 | |||
c20be00ea4 |
13
_nav.html
13
_nav.html
@ -6,15 +6,16 @@
|
||||
{{/if}}
|
||||
|
||||
<ul>
|
||||
<li {{if $current == 'inventaire'}} class="current"{{/if}}><a href="{{$module.url}}index.html">Inventaire</a></li>
|
||||
<li {{if $current == 'inventaire'}} class="current"{{/if}}><a href="{{$module.url}}index.html?prop=1">Inventaire</a></li>
|
||||
<li {{if $current == 'config'}} class="current"{{/if}}><a href="{{$module.url}}categories/index.html">Configuration</a></li>
|
||||
</ul>
|
||||
|
||||
{{if $current == 'inventaire'}}
|
||||
<ul class="sub">
|
||||
<li {{if $subcurrent == 'proprio'}} class="current"{{/if}}><a href="{{$module.url}}index.html">Matériels permanents</a></li>
|
||||
<li {{if $subcurrent == 'nonproprio'}} class="current"{{/if}}><a href="{{$module.url}}inventaire_nonprop.html">Matériels temporaires</a></li>
|
||||
<li {{if $subcurrent == 'proprio'}} class="current"{{/if}}><a href="{{$module.url}}index.html?prop=1">Matériels permanents</a></li>
|
||||
<li {{if $subcurrent == 'nonproprio'}} class="current"{{/if}}><a href="{{$module.url}}index.html?prop=0">Matériels temporaires</a></li>
|
||||
</ul>
|
||||
|
||||
{{if $subsubcurrent == 'mouvements'}}
|
||||
<ul class="sub">
|
||||
<li class="title"><strong>{{$eqpmt}} ({{$category}})</strong></li>
|
||||
@ -22,6 +23,12 @@
|
||||
</ul>
|
||||
{{/if}}
|
||||
{{elseif $current == 'config'}}
|
||||
{{if $subcurrent == 'typesES'}}
|
||||
<aside>
|
||||
{{:linkbutton label="Ajouter un type d'entrée" shape="plus" href="config/ajouter_type_mouvement.html?dir=input" target="_dialog"}}
|
||||
{{:linkbutton label="Ajouter un type de sortie" shape="plus" href="config/ajouter_type_mouvement.html?dir=output" target="_dialog"}}
|
||||
</aside>
|
||||
{{/if}}
|
||||
<ul class="sub" >
|
||||
<li {{if $subcurrent == 'categories'}} class="current"{{/if}}><a href="{{$module.url}}categories/index.html">Catégories</a></li>
|
||||
<li {{if $subcurrent == 'typesES'}} class="current"{{/if}}><a href="{{$module.url}}config.html">Types ES</a></li>
|
||||
|
18
index.html
18
index.html
@ -3,7 +3,12 @@
|
||||
{{:admin_header title="Gestion des matériels" custom_css=$custom_css current="module_equipment"}}
|
||||
|
||||
{{* barre de navigation *}}
|
||||
{{:include file="_nav.html" current="inventaire" subcurrent="proprio"}}
|
||||
{{if $_GET.prop == null || $_GET.prop}}
|
||||
{{:assign proprio="proprio"}}
|
||||
{{else}}
|
||||
{{:assign proprio="nonproprio"}}
|
||||
{{/if}}
|
||||
{{:include file="_nav.html" current="inventaire" subcurrent="%s"|args:$proprio}}
|
||||
|
||||
{{if $_GET.ok}}
|
||||
{{if $_GET.msg == "ajout" }}
|
||||
@ -24,12 +29,11 @@
|
||||
{{if $category_keys|count == 0}}
|
||||
<p class="block alert">Il n'y a aucune catégorie : vous devez en ajouter.</p>
|
||||
{{else}}
|
||||
{{*
|
||||
<fieldset>
|
||||
{{:linkbutton label="Ajouter un nouveau matériel" shape="plus" href="mouvements/ajouter_entree.html" target="_dialog"}}
|
||||
</fieldset>
|
||||
*}}
|
||||
{{:include file="./inventaire.html" print_cat_name=true}}
|
||||
{{if $_GET.prop == null || $_GET.prop}}
|
||||
{{:include file="./inventaire.html"}}
|
||||
{{else}}
|
||||
{{:include file="./inventaire_nonprop.html"}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
{{:admin_footer}}
|
||||
|
@ -7,18 +7,18 @@
|
||||
*}}
|
||||
|
||||
{{* Extraire et compiler les infos de la base *}}
|
||||
{{:include file="./_calcul_dispo.html" keep="cumul_mvt,category_keys,equipments"}}
|
||||
{{:include file="./_calcul_dispo.html" keep="cumul_mvt,equipments"}}
|
||||
|
||||
{{* Vérifier s'il y a au moins un matériel propriété de l'asso *}}
|
||||
{{:assign mat_prop=false}}
|
||||
{{:assign mat_present=false}}
|
||||
{{#foreach from=$equipments key=key item=eqpmt}}
|
||||
{{if $eqpmt|has_key:"stock"}}
|
||||
{{:assign mat_prop=true}}
|
||||
{{:assign mat_present=true}}
|
||||
{{:break}}
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
|
||||
{{if $mat_prop}}
|
||||
{{if $mat_present}}
|
||||
|
||||
{{* Sélecteur catégories *}}
|
||||
<fieldset class="shortForm" style="width: 30%;">
|
||||
@ -26,10 +26,10 @@
|
||||
<nav class="dropdown">
|
||||
<ul>
|
||||
<li><a></a></li>
|
||||
<li{{if $_GET.cat_key == null}} class="selected"{{/if}}><a href="?">Toutes les catégories</a></li>
|
||||
{{#load type="category" assign="category"}}
|
||||
<li{{if $_GET.cat_key == null}} class="selected"{{/if}}><a href="?prop=1">Toutes les catégories</a></li>
|
||||
{{#load type="category" assign="category" order="$$.name"}}
|
||||
<li {{if $_GET.cat_key == $key}}class="selected"{{/if}}>
|
||||
<a href="?cat_key={{$key}}">
|
||||
<a href="?cat_key={{$key}}&prop=1">
|
||||
<strong>{{$category.name}}</strong>
|
||||
</a>
|
||||
</li>
|
||||
@ -39,6 +39,7 @@
|
||||
</fieldset>
|
||||
|
||||
<h2>Matériels propriété de l'association</h2>
|
||||
|
||||
{{#list
|
||||
select="
|
||||
$$.date AS 'Date' ;
|
||||
|
@ -6,24 +6,19 @@
|
||||
- category_keys : catégories dont on veut faire l'inventaire
|
||||
*}}
|
||||
|
||||
{{:admin_header title="Gestion des matériels" custom_css=$custom_css current="module_equipment"}}
|
||||
|
||||
{{* barre de navigation *}}
|
||||
{{:include file="_nav.html" current="inventaire" subcurrent="nonproprio"}}
|
||||
|
||||
{{* Extraire et compiler les infos de la base *}}
|
||||
{{:include file="./_calcul_dispo.html" keep="cumul_mvt,category_keys,equipments"}}
|
||||
{{:include file="./_calcul_dispo.html" keep="cumul_mvt,equipments"}}
|
||||
|
||||
{{* Vérifier s'il y a au moins un matériel non propriété de l'asso *}}
|
||||
{{:assign mat_non_prop=false}}
|
||||
{{:assign mat_present=false}}
|
||||
{{#foreach from=$equipments key=key item=eqpmt}}
|
||||
{{if $eqpmt|has_key:"nonproprio"}}
|
||||
{{:assign mat_non_prop=true}}
|
||||
{{:assign mat_present=true}}
|
||||
{{:break}}
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
|
||||
{{if $mat_non_prop}}
|
||||
{{if $mat_present}}
|
||||
|
||||
{{* Sélecteur catégories *}}
|
||||
<fieldset class="shortForm" style="width: 30%;">
|
||||
@ -31,10 +26,10 @@
|
||||
<nav class="dropdown">
|
||||
<ul>
|
||||
<li><a></a></li>
|
||||
<li{{if $_GET.cat_key == null}} class="selected"{{/if}}><a href="?">Toutes les catégories</a></li>
|
||||
{{#load type="category" assign="category"}}
|
||||
<li{{if $_GET.cat_key == null}} class="selected"{{/if}}><a href="?prop=0">Toutes les catégories</a></li>
|
||||
{{#load type="category" assign="category" order="$$.name"}}
|
||||
<li {{if $_GET.cat_key == $key}}class="selected"{{/if}}>
|
||||
<a href="?cat_key={{$key}}">
|
||||
<a href="?cat_key={{$key}}&prop=0">
|
||||
<strong>{{$category.name}}</strong>
|
||||
</a>
|
||||
</li>
|
||||
@ -95,7 +90,7 @@
|
||||
shape="table"}}
|
||||
{{:linkbutton
|
||||
label="Modifier"
|
||||
href="modifier_materiel.html?key=%s&prop=0"|args:$equipment
|
||||
href="%smodifier_materiel.html?key=%s&prop=0"|args:$module.url:$equipment
|
||||
shape="edit"
|
||||
target="_dialog"}}
|
||||
</td>
|
||||
|
@ -19,11 +19,8 @@
|
||||
|
||||
{{* lister les catégories et les matériels disponibles *}}
|
||||
{{#load type="category" assign="category" order="$$.name"}}
|
||||
{{:assign nom_cat=$category.name}}
|
||||
{{*:assign nom_cat=$category.name*}}
|
||||
{{:assign var="categories.%s"|args:$category.key value=$category.name}}
|
||||
{{#load type="equipment" where="$$.category = :key" :key=$category.key assign="equipment"}}
|
||||
{{:assign var="equipments.%s.%s"|args:$nom_cat:$equipment.key value=$equipment.designation}}
|
||||
{{/load}}
|
||||
{{/load}}
|
||||
|
||||
{{* Traiter l'envoi du formulaire *}}
|
||||
@ -34,21 +31,19 @@
|
||||
{{:error message="La quantité (%s) doit être strictement positive !!"|args:$_POST.quantite}}
|
||||
{{/if}}
|
||||
|
||||
{{:assign var=post_cat from="categories.%s"|args:$_POST.category}}
|
||||
{{:assign post_mat=$_POST.designation|trim|tolower|ucfirst}}
|
||||
|
||||
{{* vérifier l'existence d'un matériel de même nom *}}
|
||||
{{:assign post_mat=$_POST.designation|trim|tolower|ucfirst}}
|
||||
{{:assign present=false}}
|
||||
{{#foreach from=$equipments key=nom_cat item=eqpmt}}
|
||||
{{#foreach from=$eqpmt key=key item=nom}}
|
||||
{{if $_POST.designation|trim|tolower == $nom|tolower}}
|
||||
{{:assign equipment_key=$key}}
|
||||
{{:assign present=true}}
|
||||
{{:break}}
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
{{if $present}}{{:break}}{{/if}}
|
||||
{{/foreach}}
|
||||
{{#load type="equipment"}}
|
||||
{{if $_POST.designation|trim|tolower == $designation|tolower}}
|
||||
{{:assign equipment_key=$key}}
|
||||
{{:assign var=nom_cat from="categories.%s"|args:$category}}
|
||||
{{:assign present=true}}
|
||||
{{:break}}
|
||||
{{/if}}
|
||||
{{/load}}
|
||||
{{:assign var=post_cat from="categories.%s"|args:$_POST.category}}
|
||||
|
||||
{{if $present}}
|
||||
{{* voir si le matériel existe dans une autre catégorie *}}
|
||||
{{if $nom_cat != $post_cat}}
|
||||
@ -64,7 +59,7 @@
|
||||
key=$equipment_key
|
||||
validate_schema="../equipment.schema.json"
|
||||
type="equipment"
|
||||
category=$category.key
|
||||
category=$_POST.category
|
||||
designation=$post_mat
|
||||
}}
|
||||
{{/if}}
|
||||
@ -86,7 +81,13 @@
|
||||
}}
|
||||
|
||||
{{:assign msg="Ajout de l'entrée « %s (%d) en date du %s » effectué"|args:$post_mat:$_POST.quantite:$_POST.date}}
|
||||
{{:redirect force="../index.html?ok=1&msg=%s"|args:$msg}}
|
||||
{{:assign var=type_entree from="config.input_nature.%s"|args:$operation}}
|
||||
{{if $type_entree == "temporaire"}}
|
||||
{{:assign prop=0}}
|
||||
{{else}}
|
||||
{{:assign prop=1}}
|
||||
{{/if}}
|
||||
{{:redirect force="../index.html?prop=%s&ok=1&msg=%s"|args:$prop:$msg}}
|
||||
{{else}}
|
||||
{{:form_errors}}
|
||||
{{/form}}
|
||||
|
Loading…
Reference in New Issue
Block a user