Début réorganisation après consultation bohwaz
This commit is contained in:
parent
a99f263196
commit
ea0fd3b1a2
20
_nav.html
20
_nav.html
@ -1,8 +1,24 @@
|
||||
<nav class="tabs">
|
||||
{{if $current == 'index'}}
|
||||
<aside>
|
||||
{{:linkbutton label="Ajouter un nouveau matériel" shape="plus" href="mouvements/ajouter_entree.html" target="_dialog"}}
|
||||
</aside>
|
||||
{{/if}}
|
||||
|
||||
<ul>
|
||||
<li {{if $current == 'index'}} class="current"{{/if}}><a href="{{$module.url}}index.html">Inventaire</a></li>
|
||||
{{if $current == 'mouvements'}}<li class="current"><a>Mouvements</a></li>{{/if}}
|
||||
<li {{if $current == 'categories'}} class="current"{{/if}}><a href="{{$module.url}}categories/index.html">Catégories</a></li>
|
||||
<li {{if $current == 'config'}} class="current"{{/if}}><a href="{{$module.url}}config.html">Configuration</a></li>
|
||||
<li {{if $current == 'config'}} class="current"{{/if}}><a href="{{$module.url}}categories/index.html">Configuration</a></li>
|
||||
</ul>
|
||||
{{if $current == 'index'}}
|
||||
<ul class="sub">
|
||||
<li {{if $subcurrent == 'proprio'}} class="current"{{/if}}><a href="{{$module.url}}index.html">Matériel permanent</a></li>
|
||||
<li {{if $subcurrent == 'nonproprio'}} class="current"{{/if}}><a href="{{$module.url}}inventaire_nonprop.html">Matériel temporaire</a></li>
|
||||
</ul>
|
||||
{{elseif $current == 'config'}}
|
||||
<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>
|
||||
</ul>
|
||||
{{/if}}
|
||||
</nav>
|
||||
|
@ -3,7 +3,7 @@
|
||||
{{:admin_header title="Gestion des matériels" current="module_equipment"}}
|
||||
|
||||
{{* barre de navigation *}}
|
||||
{{:include file="../_nav.html" current="categories"}}
|
||||
{{:include file="../_nav.html" current="config" subcurrent="categories"}}
|
||||
|
||||
{{if $_GET.ok}}
|
||||
{{if $_GET.msg == "modification"}}
|
||||
@ -34,9 +34,6 @@
|
||||
<tr>
|
||||
<th>{{$name}}</th>
|
||||
<td class="actions">
|
||||
{{if $materiel_present}}
|
||||
{{:linkbutton label="Liste des matériels" href="list_equipment.html?key=%s&dialog"|args:$key shape="search" target="_dialog"}}
|
||||
{{/if}}
|
||||
{{:linkbutton label="Modifier" href="modify_category.html?key=%s"|args:$key shape="edit" target="_dialog"}}
|
||||
{{:linkbutton label="Supprimer" href="delete_category.html?key=%s"|args:$key shape="delete" target="_dialog"}}
|
||||
</td>
|
||||
|
@ -1,7 +1,9 @@
|
||||
{{* -*- brindille -*- *}}
|
||||
|
||||
{{:admin_header title="Configuration" current="module_equipment"}}
|
||||
|
||||
{{* barre de navigation *}}
|
||||
{{:include file="_nav.html" current="config"}}
|
||||
{{:include file="_nav.html" current="config" subcurrent="typesES"}}
|
||||
|
||||
{{if $_GET.ok}}
|
||||
<p class="block confirm">Configuration enregistrée.</p>
|
||||
|
@ -83,8 +83,8 @@
|
||||
type="movement"
|
||||
select="$$.date AS 'Date';
|
||||
CASE $$.direction WHEN 'input' THEN 'Entrée' WHEN 'output' THEN 'Sortie' END AS 'Mvt';
|
||||
CASE $$.direction WHEN 'input' THEN $$.input_nature WHEN 'output' THEN $$.output_nature END AS 'operation';
|
||||
$$.amount AS 'Nombre';
|
||||
CASE $$.direction WHEN 'input' THEN $$.input_nature WHEN 'output' THEN $$.output_nature END AS 'Opération';
|
||||
$$.amount AS 'Quantité';
|
||||
$$.comment AS 'Commentaire'"
|
||||
equipment=$equipment_key
|
||||
order=1
|
||||
|
@ -3,7 +3,7 @@
|
||||
{{:admin_header title="Gestion des matériels" custom_css=$custom_css current="module_equipment"}}
|
||||
|
||||
{{* barre de navigation *}}
|
||||
{{:include file="_nav.html" current="index"}}
|
||||
{{:include file="_nav.html" current="index" subcurrent="proprio"}}
|
||||
|
||||
{{if $_GET.ok}}
|
||||
{{if $_GET.msg == "ajout" }}
|
||||
@ -24,9 +24,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}}
|
||||
|
||||
|
263
inventaire.html
263
inventaire.html
@ -1,6 +1,10 @@
|
||||
{{* -*- brindille -*- *}}
|
||||
|
||||
{{* inventaire des entrées/sorties des matériels des catégories de la variable category_keys *}}
|
||||
{{*
|
||||
inventaire des entrées/sorties des matériels permanants de l'association
|
||||
paramètres
|
||||
- category_keys
|
||||
*}}
|
||||
|
||||
{{* Extraire et compiler les infos de la base *}}
|
||||
{{:include file="./_calcul_dispo.html" keep="cumul_mvt,category_keys,equipments"}}
|
||||
@ -9,200 +13,115 @@
|
||||
{{if $equipments === null}}
|
||||
<p class="block alert">Aucun matériel.</p>
|
||||
{{else}}
|
||||
{{* Vérifier s'il y a au moins un matériel propriété ou non de l'asso *}}
|
||||
{{* Vérifier s'il y a au moins un matériel propriété de l'asso *}}
|
||||
{{:assign mat_prop=false}}
|
||||
{{:assign mat_non_prop=false}}
|
||||
{{#foreach from=$equipments key=key item=eqpmt}}
|
||||
{{if $eqpmt|has_key:"stock"}}
|
||||
{{:assign mat_prop=true}}
|
||||
{{/if}}
|
||||
{{if $eqpmt|has_key:"nonproprio"}}
|
||||
{{:assign mat_non_prop=true}}
|
||||
{{:break}}
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
|
||||
{{* TODO Sélecteur catégories *}}
|
||||
<fieldset class="shortFormRight">
|
||||
<legend>Filtrer par catégorie</legend>
|
||||
<nav class="dropdown">
|
||||
<ul>
|
||||
<li><a></a></li>
|
||||
<li><a href=""><strong>Audiovisuel</strong></a></li>
|
||||
<li><a href=""><strong>Informatique</strong></a></li>
|
||||
<li><a href=""><strong>Mobilier</strong></a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
</fieldset>
|
||||
|
||||
{{if $mat_prop}}
|
||||
<details class="inventaire" open="open">
|
||||
<summary>
|
||||
<h2>Matériels dont l'association est propriétaire</h2>
|
||||
</summary>
|
||||
<h2>Matériels dont l'association est propriétaire</h2>
|
||||
<fieldset>
|
||||
{{* itérer sur les catégories *}}
|
||||
{{#foreach from=$cumul_mvt key="cat_key" item="cat_elem"}}
|
||||
|
||||
<fieldset>
|
||||
{{* itérer sur les catégories *}}
|
||||
{{#foreach from=$cumul_mvt key="cat_key" item="cat_elem"}}
|
||||
{{* vérifier s'il y a des matériels dans cette catégorie *}}
|
||||
{{:assign present=false}}
|
||||
{{if $cat_elem|keys|has:"eqpmt"}}
|
||||
{{#foreach from=$cat_elem.eqpmt key="eqpmt_key" item="eqpmt"}}
|
||||
{{if $eqpmt.stock !== null && $eqpmt.stock !== 0}}
|
||||
{{:assign present=true}}
|
||||
{{:break}}
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
{{/if}}
|
||||
|
||||
{{* vérifier s'il y a des matériels dans cette catégorie *}}
|
||||
{{:assign present=false}}
|
||||
{{if $cat_elem|keys|has:"eqpmt"}}
|
||||
{{#foreach from=$cat_elem.eqpmt key="eqpmt_key" item="eqpmt"}}
|
||||
{{if $eqpmt.stock !== null && $eqpmt.stock !== 0}}
|
||||
{{:assign present=true}}
|
||||
{{:break}}
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
{{/if}}
|
||||
{{if $present}}
|
||||
<h3>{{$cat_elem.name}}</h3>
|
||||
|
||||
{{if $present}}
|
||||
{{*if $print_cat_name*}}
|
||||
<details class="inventaire" open="open">
|
||||
<summary>
|
||||
<h3>{{$cat_elem.name}}</h3>
|
||||
{{*/if*}}
|
||||
</summary>
|
||||
<table class="list">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Désignation</th>
|
||||
<th>Stock</th>
|
||||
<th>Sortie</th>
|
||||
<th>Disponible</th>
|
||||
<th class="actions"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<table class="list">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Désignation</th>
|
||||
<th>Stock</th>
|
||||
<th>Sortie</th>
|
||||
<th>Disponible</th>
|
||||
<th class="actions"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
{{* itérer sur les matériels de la catégorie *}}
|
||||
{{#foreach from=$cat_elem.eqpmt key="eqpmt_key" item="eqpmt"}}
|
||||
{{:assign keys=$eqpmt|keys}}
|
||||
{{if "stock"|in:$keys}} {{* && $eqpmt.stock !== 0}}*}}
|
||||
{{if "exterieur"|in:$keys}}
|
||||
{{:assign dispo="%d-%d"|math:$eqpmt.stock:$eqpmt.exterieur}}
|
||||
{{:assign exterieur=$eqpmt.exterieur}}
|
||||
{{else}}
|
||||
{{:assign dispo=$eqpmt.stock}}
|
||||
{{:assign exterieur=0}}
|
||||
{{/if}}
|
||||
<tr>
|
||||
<td>{{$eqpmt.designation}}</td>
|
||||
<td>{{$eqpmt.stock}}</td>
|
||||
<td>{{$exterieur}}</td>
|
||||
<td>{{$dispo}}</td>
|
||||
<td class="actions">
|
||||
{{if $exterieur > 0}}
|
||||
{{* itérer sur les matériels de la catégorie *}}
|
||||
{{#foreach from=$cat_elem.eqpmt key="eqpmt_key" item="eqpmt"}}
|
||||
{{:assign keys=$eqpmt|keys}}
|
||||
{{if "stock"|in:$keys}} {{* && $eqpmt.stock !== 0}}*}}
|
||||
{{if "exterieur"|in:$keys}}
|
||||
{{:assign dispo="%d-%d"|math:$eqpmt.stock:$eqpmt.exterieur}}
|
||||
{{:assign exterieur=$eqpmt.exterieur}}
|
||||
{{else}}
|
||||
{{:assign dispo=$eqpmt.stock}}
|
||||
{{:assign exterieur=0}}
|
||||
{{/if}}
|
||||
<tr>
|
||||
<td>{{$eqpmt.designation}}</td>
|
||||
<td>{{$eqpmt.stock}}</td>
|
||||
<td>{{$exterieur}}</td>
|
||||
<td>{{$dispo}}</td>
|
||||
<td class="actions">
|
||||
{{if $exterieur > 0}}
|
||||
{{:linkbutton
|
||||
label="Retour"
|
||||
href="mouvements/entrees/retour.html?key=%s&prop=1"|args:$eqpmt_key
|
||||
shape="history"
|
||||
target="_dialog"}}
|
||||
{{/if}}
|
||||
{{if $dispo > 0}}
|
||||
{{:linkbutton
|
||||
label="Sortie"
|
||||
shape="plus"
|
||||
href="mouvements/sorties/stock_disponible.html?key=%s&prop=1"|args:$eqpmt_key
|
||||
target="_dialog"}}
|
||||
{{/if}}
|
||||
{{:linkbutton
|
||||
label="Retour"
|
||||
href="mouvements/entrees/retour.html?key=%s&prop=1"|args:$eqpmt_key
|
||||
shape="history"
|
||||
target="_dialog"}}
|
||||
{{/if}}
|
||||
{{if $dispo > 0}}
|
||||
{{:linkbutton
|
||||
label="Sortie"
|
||||
shape="plus"
|
||||
href="mouvements/sorties/stock_disponible.html?key=%s&prop=1"|args:$eqpmt_key
|
||||
target="_dialog"}}
|
||||
{{/if}}
|
||||
{{:linkbutton
|
||||
label="Entrée"
|
||||
shape="plus"
|
||||
href="mouvements/entrees/repertorie.html?key=%s&prop=1"|args:$eqpmt_key
|
||||
target="_dialog"}}
|
||||
{{:linkbutton
|
||||
{{:linkbutton
|
||||
label="Mouvements"
|
||||
href="%shistorique.html?key=%s&prop=1"|args:$module.url:$eqpmt_key
|
||||
shape="table"}}
|
||||
{{:linkbutton
|
||||
{{:linkbutton
|
||||
label="Modifier"
|
||||
href="%smodifier_materiel.html?key=%s&prop=1"|args:$module.url:$eqpmt_key
|
||||
shape="edit"
|
||||
target="_dialog"}}
|
||||
</td>
|
||||
</tr>
|
||||
{{/if}}
|
||||
{{else}}
|
||||
<p class="block alert">Il n'y a aucun matériel dans cette catégorie.</p>
|
||||
{{/foreach}}
|
||||
</tbody>
|
||||
</table>
|
||||
</details>
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
</fieldset>
|
||||
</details>
|
||||
{{/if}}
|
||||
|
||||
{{if $mat_non_prop}}
|
||||
<details class="inventaire" open="open">
|
||||
<summary>
|
||||
<h2>Matériels dont l'association n'est pas propriétaire</h2>
|
||||
</summary>
|
||||
|
||||
<fieldset>
|
||||
{{* itérer sur les catégories *}}
|
||||
{{#foreach from=$cumul_mvt key="cat_key" item="cat_elem"}}
|
||||
|
||||
{{* vérifier s'il y a des matériels dans cette catégorie *}}
|
||||
{{:assign present=false}}
|
||||
{{if $cat_elem|keys|has:"eqpmt"}}
|
||||
{{#foreach from=$cat_elem.eqpmt key="eqpmt_key" item="eqpmt"}}
|
||||
{{if $eqpmt.nonproprio !== null && $eqpmt.nonproprio !== 0}}
|
||||
{{:assign present=true}}
|
||||
{{:break}}
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
{{/if}}
|
||||
|
||||
{{if $present}}
|
||||
{{*if $print_cat_name*}}
|
||||
<details class="inventaire" open="open">
|
||||
<summary>
|
||||
<h3>{{$cat_elem.name}}</h3>
|
||||
{{*/if*}}
|
||||
</summary>
|
||||
|
||||
<table class="list">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Désignation</th>
|
||||
<th>Quantité</th>
|
||||
<th class="actions"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
{{* itérer sur les matériels de la catégorie *}}
|
||||
{{#foreach from=$cat_elem.eqpmt key="eqpmt_key" item="eqpmt"}}
|
||||
{{:assign keys=$eqpmt|keys}}
|
||||
{{if "nonproprio"|in:$keys && $eqpmt.nonproprio !== 0}}
|
||||
{{:assign dispo="%d-%d"|math:$eqpmt.stock:$eqpmt.exterieur}}
|
||||
<tr>
|
||||
<td>{{$eqpmt.designation}}</td>
|
||||
<td>{{$eqpmt.nonproprio}}</td>
|
||||
<td class="actions">
|
||||
{{if $eqpmt.nonproprio > 0}}
|
||||
{{:linkbutton
|
||||
label="Retour"
|
||||
href="mouvements/sorties/emprunte.html?key=%s&prop=0"|args:$eqpmt_key
|
||||
shape="history"
|
||||
target="_dialog"}}
|
||||
{{/if}}
|
||||
{{:linkbutton
|
||||
label="Entrée"
|
||||
shape="plus"
|
||||
href="mouvements/entrees/repertorie.html?key=%s&prop=0"|args:$eqpmt_key
|
||||
target="_dialog"}}
|
||||
{{:linkbutton
|
||||
label="Mouvements"
|
||||
href="%shistorique.html?key=%s&prop=0"|args:$module.url:$eqpmt_key
|
||||
shape="table"}}
|
||||
{{:linkbutton
|
||||
label="Modifier"
|
||||
href="modifier_materiel.html?key=%s&prop=0"|args:$eqpmt_key
|
||||
shape="edit"
|
||||
target="_dialog"}}
|
||||
</td>
|
||||
</tr>
|
||||
{{/if}}
|
||||
{{else}}
|
||||
<p class="block alert">Il n'y a aucun matériel dans cette catégorie.</p>
|
||||
{{/foreach}}
|
||||
</tbody>
|
||||
</table>
|
||||
</details>
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
</fieldset>
|
||||
</details>
|
||||
</td>
|
||||
</tr>
|
||||
{{/if}}
|
||||
{{else}}
|
||||
<p class="block alert">Il n'y a aucun matériel dans cette catégorie.</p>
|
||||
{{/foreach}}
|
||||
</tbody>
|
||||
</table>
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
</fieldset>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
103
inventaire_nonprop.html
Normal file
103
inventaire_nonprop.html
Normal file
@ -0,0 +1,103 @@
|
||||
{{* -*- brindille -*- *}}
|
||||
|
||||
{{*
|
||||
inventaire des entrées/sorties des matériels temporaires
|
||||
paramètres
|
||||
- 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="index" subcurrent="nonproprio"}}
|
||||
|
||||
{{* Extraire et compiler les infos de la base *}}
|
||||
{{:include file="./_calcul_dispo.html" keep="cumul_mvt,category_keys,equipments"}}
|
||||
|
||||
{{* Afficher les résultats *}}
|
||||
{{if $equipments === null}}
|
||||
<p class="block alert">Aucun matériel.</p>
|
||||
{{else}}
|
||||
{{* Vérifier s'il y a au moins un matériel non propriété de l'asso *}}
|
||||
{{:assign mat_non_prop=false}}
|
||||
{{#foreach from=$equipments key=key item=eqpmt}}
|
||||
{{if $eqpmt|has_key:"nonproprio"}}
|
||||
{{:assign mat_non_prop=true}}
|
||||
{{:break}}
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
|
||||
{{if $mat_non_prop}}
|
||||
<h2>Matériels dont l'association n'est pas propriétaire</h2>
|
||||
|
||||
<fieldset>
|
||||
{{* itérer sur les catégories *}}
|
||||
{{#foreach from=$cumul_mvt key="cat_key" item="cat_elem"}}
|
||||
|
||||
{{* vérifier s'il y a des matériels dans cette catégorie *}}
|
||||
{{:assign present=false}}
|
||||
{{if $cat_elem|keys|has:"eqpmt"}}
|
||||
{{#foreach from=$cat_elem.eqpmt key="eqpmt_key" item="eqpmt"}}
|
||||
{{if $eqpmt.nonproprio !== null && $eqpmt.nonproprio !== 0}}
|
||||
{{:assign present=true}}
|
||||
{{:break}}
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
{{/if}}
|
||||
|
||||
{{if $present}}
|
||||
<h3>{{$cat_elem.name}}</h3>
|
||||
|
||||
<table class="list">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Désignation</th>
|
||||
<th>Quantité</th>
|
||||
<th class="actions"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
{{* itérer sur les matériels de la catégorie *}}
|
||||
{{#foreach from=$cat_elem.eqpmt key="eqpmt_key" item="eqpmt"}}
|
||||
{{:assign keys=$eqpmt|keys}}
|
||||
{{if "nonproprio"|in:$keys && $eqpmt.nonproprio !== 0}}
|
||||
{{:assign dispo="%d-%d"|math:$eqpmt.stock:$eqpmt.exterieur}}
|
||||
<tr>
|
||||
<td>{{$eqpmt.designation}}</td>
|
||||
<td>{{$eqpmt.nonproprio}}</td>
|
||||
<td class="actions">
|
||||
{{if $eqpmt.nonproprio > 0}}
|
||||
{{:linkbutton
|
||||
label="Retour"
|
||||
href="mouvements/sorties/emprunte.html?key=%s&prop=0"|args:$eqpmt_key
|
||||
shape="history"
|
||||
target="_dialog"}}
|
||||
{{/if}}
|
||||
{{:linkbutton
|
||||
label="Entrée"
|
||||
shape="plus"
|
||||
href="mouvements/entrees/repertorie.html?key=%s&prop=0"|args:$eqpmt_key
|
||||
target="_dialog"}}
|
||||
{{:linkbutton
|
||||
label="Mouvements"
|
||||
href="%shistorique.html?key=%s&prop=0"|args:$module.url:$eqpmt_key
|
||||
shape="table"}}
|
||||
{{:linkbutton
|
||||
label="Modifier"
|
||||
href="modifier_materiel.html?key=%s&prop=0"|args:$eqpmt_key
|
||||
shape="edit"
|
||||
target="_dialog"}}
|
||||
</td>
|
||||
</tr>
|
||||
{{/if}}
|
||||
{{else}}
|
||||
<p class="block alert">Il n'y a aucun matériel dans cette catégorie.</p>
|
||||
{{/foreach}}
|
||||
</tbody>
|
||||
</table>
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
</fieldset>
|
||||
{{/if}}
|
||||
{{/if}}
|
Loading…
Reference in New Issue
Block a user