Compare commits
No commits in common. "79a37198920beb6a99c74aaeaa20b0633ee4f3cf" and "4d0bcc1bddc4902f32a7c336bbec01c5b40892fd" have entirely different histories.
79a3719892
...
4d0bcc1bdd
13
_nav.html
13
_nav.html
@ -6,16 +6,15 @@
|
||||
{{/if}}
|
||||
|
||||
<ul>
|
||||
<li {{if $current == 'inventaire'}} class="current"{{/if}}><a href="{{$module.url}}index.html?prop=1">Inventaire</a></li>
|
||||
<li {{if $current == 'inventaire'}} class="current"{{/if}}><a href="{{$module.url}}index.html">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?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>
|
||||
<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>
|
||||
</ul>
|
||||
|
||||
{{if $subsubcurrent == 'mouvements'}}
|
||||
<ul class="sub">
|
||||
<li class="title"><strong>{{$eqpmt}} ({{$category}})</strong></li>
|
||||
@ -23,12 +22,6 @@
|
||||
</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,12 +3,7 @@
|
||||
{{:admin_header title="Gestion des matériels" custom_css=$custom_css current="module_equipment"}}
|
||||
|
||||
{{* barre de navigation *}}
|
||||
{{if $_GET.prop == null || $_GET.prop}}
|
||||
{{:assign proprio="proprio"}}
|
||||
{{else}}
|
||||
{{:assign proprio="nonproprio"}}
|
||||
{{/if}}
|
||||
{{:include file="_nav.html" current="inventaire" subcurrent="%s"|args:$proprio}}
|
||||
{{:include file="_nav.html" current="inventaire" subcurrent="proprio"}}
|
||||
|
||||
{{if $_GET.ok}}
|
||||
{{if $_GET.msg == "ajout" }}
|
||||
@ -29,11 +24,12 @@
|
||||
{{if $category_keys|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}}
|
||||
{{:include file="./inventaire.html"}}
|
||||
{{else}}
|
||||
{{:include file="./inventaire_nonprop.html"}}
|
||||
{{/if}}
|
||||
{{*
|
||||
<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}}
|
||||
|
||||
{{:admin_footer}}
|
||||
|
@ -7,18 +7,18 @@
|
||||
*}}
|
||||
|
||||
{{* Extraire et compiler les infos de la base *}}
|
||||
{{:include file="./_calcul_dispo.html" keep="cumul_mvt,equipments"}}
|
||||
{{:include file="./_calcul_dispo.html" keep="cumul_mvt,category_keys,equipments"}}
|
||||
|
||||
{{* Vérifier s'il y a au moins un matériel propriété de l'asso *}}
|
||||
{{:assign mat_present=false}}
|
||||
{{:assign mat_prop=false}}
|
||||
{{#foreach from=$equipments key=key item=eqpmt}}
|
||||
{{if $eqpmt|has_key:"stock"}}
|
||||
{{:assign mat_present=true}}
|
||||
{{:assign mat_prop=true}}
|
||||
{{:break}}
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
|
||||
{{if $mat_present}}
|
||||
{{if $mat_prop}}
|
||||
|
||||
{{* 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="?prop=1">Toutes les catégories</a></li>
|
||||
{{#load type="category" assign="category" order="$$.name"}}
|
||||
<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 == $key}}class="selected"{{/if}}>
|
||||
<a href="?cat_key={{$key}}&prop=1">
|
||||
<a href="?cat_key={{$key}}">
|
||||
<strong>{{$category.name}}</strong>
|
||||
</a>
|
||||
</li>
|
||||
@ -39,7 +39,6 @@
|
||||
</fieldset>
|
||||
|
||||
<h2>Matériels propriété de l'association</h2>
|
||||
|
||||
{{#list
|
||||
select="
|
||||
$$.date AS 'Date' ;
|
||||
|
@ -6,19 +6,24 @@
|
||||
- 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,equipments"}}
|
||||
{{:include file="./_calcul_dispo.html" keep="cumul_mvt,category_keys,equipments"}}
|
||||
|
||||
{{* Vérifier s'il y a au moins un matériel non propriété de l'asso *}}
|
||||
{{:assign mat_present=false}}
|
||||
{{:assign mat_non_prop=false}}
|
||||
{{#foreach from=$equipments key=key item=eqpmt}}
|
||||
{{if $eqpmt|has_key:"nonproprio"}}
|
||||
{{:assign mat_present=true}}
|
||||
{{:assign mat_non_prop=true}}
|
||||
{{:break}}
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
|
||||
{{if $mat_present}}
|
||||
{{if $mat_non_prop}}
|
||||
|
||||
{{* Sélecteur catégories *}}
|
||||
<fieldset class="shortForm" style="width: 30%;">
|
||||
@ -26,10 +31,10 @@
|
||||
<nav class="dropdown">
|
||||
<ul>
|
||||
<li><a></a></li>
|
||||
<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 == null}} class="selected"{{/if}}><a href="?">Toutes les catégories</a></li>
|
||||
{{#load type="category" assign="category"}}
|
||||
<li {{if $_GET.cat_key == $key}}class="selected"{{/if}}>
|
||||
<a href="?cat_key={{$key}}&prop=0">
|
||||
<a href="?cat_key={{$key}}">
|
||||
<strong>{{$category.name}}</strong>
|
||||
</a>
|
||||
</li>
|
||||
@ -90,7 +95,7 @@
|
||||
shape="table"}}
|
||||
{{:linkbutton
|
||||
label="Modifier"
|
||||
href="%smodifier_materiel.html?key=%s&prop=0"|args:$module.url:$equipment
|
||||
href="modifier_materiel.html?key=%s&prop=0"|args:$equipment
|
||||
shape="edit"
|
||||
target="_dialog"}}
|
||||
</td>
|
||||
|
@ -19,8 +19,11 @@
|
||||
|
||||
{{* 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 *}}
|
||||
@ -31,19 +34,21 @@
|
||||
{{:error message="La quantité (%s) doit être strictement positive !!"|args:$_POST.quantite}}
|
||||
{{/if}}
|
||||
|
||||
{{:assign post_mat=$_POST.designation|trim|tolower|ucfirst}}
|
||||
{{:assign var=post_cat from="categories.%s"|args:$_POST.category}}
|
||||
|
||||
{{* vérifier l'existence d'un matériel de même nom *}}
|
||||
{{#load type="equipment"}}
|
||||
{{if $_POST.designation|trim|tolower == $designation|tolower}}
|
||||
{{: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 var=nom_cat from="categories.%s"|args:$category}}
|
||||
{{:assign present=true}}
|
||||
{{:break}}
|
||||
{{/if}}
|
||||
{{/load}}
|
||||
{{:assign var=post_cat from="categories.%s"|args:$_POST.category}}
|
||||
|
||||
{{/foreach}}
|
||||
{{if $present}}{{:break}}{{/if}}
|
||||
{{/foreach}}
|
||||
{{if $present}}
|
||||
{{* voir si le matériel existe dans une autre catégorie *}}
|
||||
{{if $nom_cat != $post_cat}}
|
||||
@ -59,7 +64,7 @@
|
||||
key=$equipment_key
|
||||
validate_schema="../equipment.schema.json"
|
||||
type="equipment"
|
||||
category=$_POST.category
|
||||
category=$category.key
|
||||
designation=$post_mat
|
||||
}}
|
||||
{{/if}}
|
||||
@ -81,13 +86,7 @@
|
||||
}}
|
||||
|
||||
{{:assign msg="Ajout de l'entrée « %s (%d) en date du %s » effectué"|args:$post_mat:$_POST.quantite:$_POST.date}}
|
||||
{{: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}}
|
||||
{{:redirect force="../index.html?ok=1&msg=%s"|args:$msg}}
|
||||
{{else}}
|
||||
{{:form_errors}}
|
||||
{{/form}}
|
||||
|
Loading…
Reference in New Issue
Block a user