Compare commits
No commits in common. "17052676dfc9de3b3bf2d1bdd71a9425f35f9162" and "3e0f3159ae1b97cca321ebf1259fbac1e27fd092" have entirely different histories.
17052676df
...
3e0f3159ae
@ -25,7 +25,6 @@
|
|||||||
{{#load type="equipment" where="$$.category = :category_key" :category_key=$_GET.cat_key}}
|
{{#load type="equipment" where="$$.category = :category_key" :category_key=$_GET.cat_key}}
|
||||||
{{:assign var="equipments.%s.category"|args:$key value=$category}}
|
{{:assign var="equipments.%s.category"|args:$key value=$category}}
|
||||||
{{:assign var="equipments.%s.name"|args:$key value=$name}}
|
{{:assign var="equipments.%s.name"|args:$key value=$name}}
|
||||||
{{:assign var="equipments.%s.status"|args:$key value=$status}}
|
|
||||||
{{:assign var="in_equipments." value="'%s'"|args:$key}}
|
{{:assign var="in_equipments." value="'%s'"|args:$key}}
|
||||||
{{/load}}
|
{{/load}}
|
||||||
{{else}}
|
{{else}}
|
||||||
@ -33,7 +32,6 @@
|
|||||||
{{#load type="equipment"}}
|
{{#load type="equipment"}}
|
||||||
{{:assign var="equipments.%s.category"|args:$key value=$category}}
|
{{:assign var="equipments.%s.category"|args:$key value=$category}}
|
||||||
{{:assign var="equipments.%s.name"|args:$key value=$name}}
|
{{:assign var="equipments.%s.name"|args:$key value=$name}}
|
||||||
{{:assign var="equipments.%s.status"|args:$key value=$status}}
|
|
||||||
{{:assign var="in_equipments." value="'%s'"|args:$key}}
|
{{:assign var="in_equipments." value="'%s'"|args:$key}}
|
||||||
{{/load}}
|
{{/load}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
@ -14,7 +14,6 @@
|
|||||||
<ul>
|
<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?prop=1">Inventaire</a></li>
|
||||||
<li {{if $current == 'historique'}} class="current"{{/if}}><a href="{{$module.url}}global_history.html">Historique</a></li>
|
<li {{if $current == 'historique'}} class="current"{{/if}}><a href="{{$module.url}}global_history.html">Historique</a></li>
|
||||||
<li {{if $current == 'archives'}} class="current"{{/if}}><a href="{{$module.url}}archives.html">Archives</a></li>
|
|
||||||
<li {{if $current == 'config'}} class="current"{{/if}}><a href="{{$module.url}}categories/index.html">Configuration</a></li>
|
<li {{if $current == 'config'}} class="current"{{/if}}><a href="{{$module.url}}categories/index.html">Configuration</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
@ -24,12 +23,6 @@
|
|||||||
<li {{if $subcurrent == 'nonproprio'}} class="current"{{/if}}><a href="{{$module.url}}index.html?prop=0">Matériels temporaires</a></li>
|
<li {{if $subcurrent == 'nonproprio'}} class="current"{{/if}}><a href="{{$module.url}}index.html?prop=0">Matériels temporaires</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
{{if $subsubcurrent == 'historique'}}
|
|
||||||
<ul class="sub">
|
|
||||||
<li class="title"><strong>Historique — {{$eqpmt}} ({{$category}})</strong></li>
|
|
||||||
</ul>
|
|
||||||
{{/if}}
|
|
||||||
{{elseif $current == 'archives'}}
|
|
||||||
{{if $subsubcurrent == 'historique'}}
|
{{if $subsubcurrent == 'historique'}}
|
||||||
<ul class="sub">
|
<ul class="sub">
|
||||||
<li class="title"><strong>Historique — {{$eqpmt}} ({{$category}})</strong></li>
|
<li class="title"><strong>Historique — {{$eqpmt}} ({{$category}})</strong></li>
|
||||||
|
@ -1,72 +0,0 @@
|
|||||||
{{* -*- brindille -*- *}}
|
|
||||||
|
|
||||||
{{:admin_header title="Matériels archivés" custom_css=$custom_css current="module_equipment"}}
|
|
||||||
{{:include file="_nav.html" current="archives"}}
|
|
||||||
|
|
||||||
{{if $_GET.ok}}
|
|
||||||
<p class="block confirm">Matériel remis en service</p>
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
{{* Sélecteur catégories *}}
|
|
||||||
{{:assign var="options." value="" label="Toutes les catégories" href="?prop=1"}}
|
|
||||||
{{#load type="category" order="$$.name"}}
|
|
||||||
{{:assign
|
|
||||||
var="options."
|
|
||||||
value=$key
|
|
||||||
label=$name
|
|
||||||
href="?cat_key=%s"|args:$key
|
|
||||||
}}
|
|
||||||
{{/load}}
|
|
||||||
|
|
||||||
<fieldset class="shortFormRight">
|
|
||||||
<legend>Filtrer par catégorie</legend>
|
|
||||||
{{:dropdown
|
|
||||||
title="Filtrer par catégorie"
|
|
||||||
options=$options
|
|
||||||
value="%s"|args:$_GET.cat_key
|
|
||||||
}}
|
|
||||||
</fieldset>
|
|
||||||
|
|
||||||
<div class="shortFormLeft">
|
|
||||||
<p class="help">Inventaire des matériels archivés</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{{* filtrer selon la catégorie *}}
|
|
||||||
{{if $_GET.cat_key == null}}
|
|
||||||
{{:assign condition="1"}}
|
|
||||||
{{else}}
|
|
||||||
{{:assign cat_key=$_GET.cat_key|quote_sql}}
|
|
||||||
{{:assign condition="$$.category == %s"|args:$cat_key}}
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
{{* Liste des matériels archivés *}}
|
|
||||||
{{#list
|
|
||||||
select="
|
|
||||||
$$.name AS "Matériel" ;
|
|
||||||
(SELECT $$.name
|
|
||||||
FROM @TABLE as cat
|
|
||||||
WHERE cat.key = @TABLE.$$.category) AS "Catégorie"
|
|
||||||
"
|
|
||||||
type="equipment"
|
|
||||||
where="$$.status='archived' AND %s"|args:$condition
|
|
||||||
order=1
|
|
||||||
}}
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td>{{$name}}</td>
|
|
||||||
<td>{{$col2}}</td>
|
|
||||||
<td class="actions">
|
|
||||||
{{:linkbutton
|
|
||||||
label="Historique"
|
|
||||||
href="historique.html?key=%s&prop=1¤t=archives"|args:$key
|
|
||||||
shape="table"}}
|
|
||||||
{{:linkbutton
|
|
||||||
label="Modifier"
|
|
||||||
href="unarchive_equipment.html?key=%s"|args:$key
|
|
||||||
shape="edit"
|
|
||||||
target="_dialog"}}
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
{{else}}
|
|
||||||
<p class="block alert">Aucun matériel.</p>
|
|
||||||
{{/list}}
|
|
@ -1,6 +1,6 @@
|
|||||||
{{* -*- brindille -*- *}}
|
{{* -*- brindille -*- *}}
|
||||||
|
|
||||||
{{:admin_header title="Configuration" current="module_equipment"}}
|
{{:admin_header title="Gestion des matériels" current="module_equipment"}}
|
||||||
|
|
||||||
{{* barre de navigation *}}
|
{{* barre de navigation *}}
|
||||||
{{:include file="../_nav.html" current="config" subcurrent="categories"}}
|
{{:include file="../_nav.html" current="config" subcurrent="categories"}}
|
||||||
|
@ -13,12 +13,7 @@
|
|||||||
"name": {
|
"name": {
|
||||||
"description": "Désignation du matériel",
|
"description": "Désignation du matériel",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
|
||||||
"status": {
|
|
||||||
"description": "État du matériel",
|
|
||||||
"type": "string",
|
|
||||||
"enum": ["available", "archived"]
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": ["type", "category", "name", "status"]
|
"required": ["type", "category", "name"]
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
*}}
|
*}}
|
||||||
|
|
||||||
|
|
||||||
{{:admin_header title="Historique des mouvements" current="module_equipment"}}
|
{{:admin_header title="Gestion des matériels" current="module_equipment"}}
|
||||||
|
|
||||||
{{:include file="./_nav.html" current="historique"}}
|
{{:include file="./_nav.html" current="historique"}}
|
||||||
|
|
||||||
|
@ -30,12 +30,7 @@
|
|||||||
{{/load}}
|
{{/load}}
|
||||||
{{:admin_header title="Gestion des matériels" current="module_equipment"}}
|
{{:admin_header title="Gestion des matériels" current="module_equipment"}}
|
||||||
|
|
||||||
{{if $_GET.current != null}}
|
{{:include file="./_nav.html" current="inventaire" subcurrent=$proprio subsubcurrent="historique" eqpmt=$equipment.name category=$category.name}}
|
||||||
{{:assign current=$_GET.current}}
|
|
||||||
{{else}}
|
|
||||||
{{:assign current="inventaire"}}
|
|
||||||
{{/if}}
|
|
||||||
{{:include file="./_nav.html" current=$current subcurrent=$proprio subsubcurrent="historique" eqpmt=$equipment.name category=$category.name}}
|
|
||||||
|
|
||||||
{{if $_GET.ok}}
|
{{if $_GET.ok}}
|
||||||
{{if $_GET.msg == "modification"}}
|
{{if $_GET.msg == "modification"}}
|
||||||
@ -153,23 +148,21 @@
|
|||||||
<td class="num">{{$dispo}}</td>
|
<td class="num">{{$dispo}}</td>
|
||||||
<td>{{$comment}}</td>
|
<td>{{$comment}}</td>
|
||||||
<td class="actions">
|
<td class="actions">
|
||||||
{{if $current != "archives"}}
|
{{:linkbutton
|
||||||
{{:linkbutton
|
label="Dupliquer"
|
||||||
label="Dupliquer"
|
href="mouvements/dupliquer_mouvement.html?key=%s&prop=%s"|args:$key:$_GET.prop
|
||||||
href="mouvements/dupliquer_mouvement.html?key=%s&prop=%s"|args:$key:$_GET.prop
|
shape="plus"
|
||||||
shape="plus"
|
target="_dialog"}}
|
||||||
target="_dialog"}}
|
{{:linkbutton
|
||||||
{{:linkbutton
|
label="Modifier"
|
||||||
label="Modifier"
|
href="mouvements/modifier_mouvement.html?key=%s"|args:$key
|
||||||
href="mouvements/modifier_mouvement.html?key=%s"|args:$key
|
shape="edit"
|
||||||
shape="edit"
|
target="_dialog"}}
|
||||||
target="_dialog"}}
|
{{:linkbutton
|
||||||
{{:linkbutton
|
label="Supprimer"
|
||||||
label="Supprimer"
|
href="mouvements/supprimer_mouvement.html?key=%s&prop=%s"|args:$key:$_GET.prop
|
||||||
href="mouvements/supprimer_mouvement.html?key=%s&prop=%s"|args:$key:$_GET.prop
|
shape="delete"
|
||||||
shape="delete"
|
target="_dialog"}}
|
||||||
target="_dialog"}}
|
|
||||||
{{/if}}
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
@ -31,48 +31,40 @@
|
|||||||
<p class="help">Inventaire des matériels propriété de l'association</p>
|
<p class="help">Inventaire des matériels propriété de l'association</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{* Vérifier s'il y a au moins un matériel non archivé propriété de l'asso *}}
|
{{* Vérifier s'il y a au moins un matériel propriété de l'asso *}}
|
||||||
{{:assign mat_present=false}}
|
{{:assign mat_present=false}}
|
||||||
{{#foreach from=$equipments key=key item=eqpmt}}
|
{{#foreach from=$equipments key=key item=eqpmt}}
|
||||||
{{if $eqpmt|has_key:"stock" && $eqpmt.status != "archived"}}
|
{{if $eqpmt|has_key:"stock"}}
|
||||||
{{:assign mat_present=true}}
|
{{:assign mat_present=true}}
|
||||||
{{:break}}
|
{{:break}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/foreach}}
|
{{/foreach}}
|
||||||
|
|
||||||
{{* filtrer selon la catégorie *}}
|
|
||||||
{{if $_GET.cat_key == null}}
|
|
||||||
{{:assign condition="1"}}
|
|
||||||
{{else}}
|
|
||||||
{{:assign cat_key=$_GET.cat_key|quote_sql}}
|
|
||||||
{{:assign condition="$$.category == %s"|args:$cat_key}}
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
{{if $mat_present}}
|
{{if $mat_present}}
|
||||||
{{#list
|
{{#list
|
||||||
select="
|
select="
|
||||||
$$.name AS 'Matériel' ;
|
$$.name AS 'Matériel' ;
|
||||||
(SELECT $$.name
|
"" AS 'Catégorie' ;
|
||||||
FROM @TABLE as cat
|
|
||||||
WHERE cat.key = @TABLE.$$.category) AS "Catégorie" ;
|
|
||||||
"" AS 'Stock' ;
|
"" AS 'Stock' ;
|
||||||
"" AS 'Sorti' ;
|
"" AS 'Sorti' ;
|
||||||
"" AS 'Dispo'
|
"" AS 'Dispo'
|
||||||
"
|
"
|
||||||
type="equipment"
|
type="equipment"
|
||||||
where="$$.status<>'archived' AND %s"|args:$condition
|
|
||||||
order=1
|
order=1
|
||||||
}}
|
}}
|
||||||
|
|
||||||
{{:assign var=eqpmt_key value=$key}}
|
{{:assign var=eqpmt_key value=$key}}
|
||||||
{{:assign var=cat_name from=categories.%s|args:$category}}
|
{{:assign var=cat_key value=$category}}
|
||||||
|
{{:assign var=cat_name from=categories.%s|args:$cat_key}}
|
||||||
|
|
||||||
|
{{if $_GET.cat_key != null && $_GET.cat_key != $cat_key}}
|
||||||
|
{{:continue}}
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
{{:assign var=stock from="equipments.%s.stock"|args:$eqpmt_key}}
|
{{:assign var=stock from="equipments.%s.stock"|args:$eqpmt_key}}
|
||||||
{{:assign var=exterieur from="equipments.%s.exterieur"|args:$eqpmt_key}}
|
{{:assign var=exterieur from="equipments.%s.exterieur"|args:$eqpmt_key}}
|
||||||
{{:assign dispo="%d-%d"|math:$stock:$exterieur}}
|
{{:assign dispo="%d-%d"|math:$stock:$exterieur}}
|
||||||
{{:assign var=eqpmt from="equipments.%s"|args:$eqpmt_key}}
|
|
||||||
|
|
||||||
{{if ! $eqpmt|has_key:"stock"}}
|
{{if $stock == null}}
|
||||||
{{* aucune unité permanente de ce matériel *}}
|
|
||||||
{{:continue}}
|
{{:continue}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
@ -108,7 +100,7 @@
|
|||||||
shape="table"}}
|
shape="table"}}
|
||||||
{{:linkbutton
|
{{:linkbutton
|
||||||
label="Modifier"
|
label="Modifier"
|
||||||
href="modifier_materiel.html?key=%s&prop=1&stock=%s"|args:$eqpmt_key:$stock
|
href="modifier_materiel.html?key=%s&prop=1"|args:$eqpmt_key
|
||||||
shape="edit"
|
shape="edit"
|
||||||
target="_dialog"}}
|
target="_dialog"}}
|
||||||
</td>
|
</td>
|
||||||
|
@ -34,35 +34,30 @@
|
|||||||
{{* Vérifier s'il y a au moins un matériel non propriété de l'asso *}}
|
{{* Vérifier s'il y a au moins un matériel non propriété de l'asso *}}
|
||||||
{{:assign mat_present=false}}
|
{{:assign mat_present=false}}
|
||||||
{{#foreach from=$equipments key=key item=eqpmt}}
|
{{#foreach from=$equipments key=key item=eqpmt}}
|
||||||
{{if $eqpmt|has_key:"nonproprio" && $eqpmt.status != "archived"}}
|
{{if $eqpmt|has_key:"nonproprio"}}
|
||||||
{{:assign mat_present=true}}
|
{{:assign mat_present=true}}
|
||||||
{{:break}}
|
{{:break}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/foreach}}
|
{{/foreach}}
|
||||||
|
|
||||||
{{* filtrer selon la catégorie *}}
|
|
||||||
{{if $_GET.cat_key == null}}
|
|
||||||
{{:assign condition="1"}}
|
|
||||||
{{else}}
|
|
||||||
{{:assign cat_key=$_GET.cat_key|quote_sql}}
|
|
||||||
{{:assign condition="$$.category == %s"|args:$cat_key}}
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
{{if $mat_present}}
|
{{if $mat_present}}
|
||||||
{{#list
|
{{#list
|
||||||
select="
|
select="
|
||||||
$$.name AS 'Matériel' ;
|
$$.name AS 'Matériel' ;
|
||||||
(SELECT $$.name
|
"" AS 'Catégorie' ;
|
||||||
FROM @TABLE as cat
|
|
||||||
WHERE cat.key = @TABLE.$$.category) AS "Catégorie" ;
|
|
||||||
"" AS 'Quantité'
|
"" AS 'Quantité'
|
||||||
"
|
"
|
||||||
type="equipment"
|
type="equipment"
|
||||||
where="%s"|args:$condition
|
|
||||||
order=1
|
order=1
|
||||||
}}
|
}}
|
||||||
{{:assign var=eqpmt_key value=$key}}
|
{{:assign var=eqpmt_key value=$key}}
|
||||||
{{:assign var=cat_name from=categories.%s|args:$category}}
|
{{:assign var=cat_key value=$category}}
|
||||||
|
{{:assign var=cat_name from=categories.%s|args:$cat_key}}
|
||||||
|
|
||||||
|
{{if $_GET.cat_key != null && $_GET.cat_key != $cat_key}}
|
||||||
|
{{:continue}}
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
{{:assign var=qte from="equipments.%s.nonproprio"|args:$eqpmt_key}}
|
{{:assign var=qte from="equipments.%s.nonproprio"|args:$eqpmt_key}}
|
||||||
|
|
||||||
{{if $qte == null}}
|
{{if $qte == null}}
|
||||||
|
@ -8,64 +8,51 @@
|
|||||||
|
|
||||||
{{:assign equipment_key=$_GET.key|trim}}
|
{{:assign equipment_key=$_GET.key|trim}}
|
||||||
{{#load key=$_GET.key assign="equipment"}}
|
{{#load key=$_GET.key assign="equipment"}}
|
||||||
|
{{:assign default_category=$equipment.category}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{:error message="Pas de matériel avec la clé %s"|args:$equipment_key}}
|
{{:error message="Pas de matériel avec la clé %s"|args:$equipment_key}}
|
||||||
{{/load}}
|
{{/load}}
|
||||||
{{:assign default_category=$equipment.category}}
|
|
||||||
|
|
||||||
{{* Traiter l'envoi du formulaire *}}
|
{{* Traiter l'envoi du formulaire *}}
|
||||||
{{#form on="save"}}
|
{{#form on="save"}}
|
||||||
|
|
||||||
{{if $_POST.archive == 1}}
|
{{* récupérer les infos de la catégorie *}}
|
||||||
{{* vérifier si le stock est nul *}}
|
{{#load type="category" key=$_POST.category assign="category"}}
|
||||||
{{if $_GET.stock != 0}}
|
{{/load}}
|
||||||
{{:error message="L'archivage n'est possible que si le stock est nul !"}}
|
|
||||||
{{/if}}
|
{{* vérifier la validité des changements demandés *}}
|
||||||
{{* archiver le matériel *}}
|
{{:assign chgt_ok=true}}
|
||||||
{{:save
|
{{if $_POST.category != $default_category}}
|
||||||
key=$equipment_key
|
|
||||||
status="archived"
|
{{* catégorie change : vérifier le nom *}}
|
||||||
}}
|
{{#load key=$equipment_key}}
|
||||||
|
{{if $name|trim|tolower != $_POST.name|trim|tolower}}
|
||||||
|
{{* le nom change => vérifier l'existence d'un matériel du même nom *}}
|
||||||
|
{{#load type="equipment" where="$$.name = :name" :name=$_POST.name|trim|tolower|ucfirst limit=1}}
|
||||||
|
{{:assign chgt_ok=false}}
|
||||||
|
{{/load}}
|
||||||
|
{{else}}
|
||||||
|
{* le nom ne change pas : ok *}}
|
||||||
|
{{/if}}
|
||||||
|
{{/load}}
|
||||||
|
|
||||||
{{else}}
|
{{else}}
|
||||||
|
{{* catégorie ne change pas => vérifier le nom *}}
|
||||||
{{* récupérer les infos de la catégorie *}}
|
{{#load type="equipment" where="$$.name = :name" :name=$_POST.name|trim|tolower|ucfirst limit=1}}
|
||||||
{{#load type="category" key=$_POST.category assign="category"}}{{/load}}
|
{{:assign chgt_ok=false}}
|
||||||
|
{{/load}}
|
||||||
{{* vérifier la validité des changements demandés *}}
|
|
||||||
{{:assign chgt_ok=true}}
|
|
||||||
{{if $_POST.category != $default_category}}
|
|
||||||
|
|
||||||
{{* catégorie change : vérifier le nom *}}
|
|
||||||
{{#load key=$equipment_key}}
|
|
||||||
{{if $name|trim|tolower != $_POST.name|trim|tolower}}
|
|
||||||
{{* le nom change => vérifier l'existence d'un matériel du même nom *}}
|
|
||||||
{{#load type="equipment" where="$$.name = :name" :name=$_POST.name|trim|tolower|ucfirst limit=1}}
|
|
||||||
{{:assign chgt_ok=false}}
|
|
||||||
{{/load}}
|
|
||||||
{{else}}
|
|
||||||
{* le nom ne change pas : ok *}}
|
|
||||||
{{/if}}
|
|
||||||
{{/load}}
|
|
||||||
|
|
||||||
{{else}}
|
|
||||||
{{* catégorie ne change pas => vérifier le nom *}}
|
|
||||||
{{#load type="equipment" where="$$.name = :name" :name=$_POST.name|trim|tolower|ucfirst limit=1}}
|
|
||||||
{{:assign chgt_ok=false}}
|
|
||||||
{{/load}}
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
{{if !$chgt_ok}}
|
|
||||||
{{:error message="Erreur : il existe déjà un matériel avec cette désignation"}}
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
{{* enregistrer les modifications *}}
|
|
||||||
{{:save
|
|
||||||
key=$equipment_key
|
|
||||||
category=$category.key
|
|
||||||
name=$_POST.name|trim|tolower|ucfirst
|
|
||||||
}}
|
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
|
{{if !$chgt_ok}}
|
||||||
|
{{:error message="Erreur : il existe déjà un matériel avec cette désignation"}}
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
{{* enregistrer les modifications *}}
|
||||||
|
{{:save
|
||||||
|
key=$equipment_key
|
||||||
|
category=$category.key
|
||||||
|
name=$_POST.name|trim|tolower|ucfirst
|
||||||
|
}}
|
||||||
{{:redirect force="index.html?ok=1&msg=modification&prop=%s"|args:$_GET.prop}}
|
{{:redirect force="index.html?ok=1&msg=modification&prop=%s"|args:$_GET.prop}}
|
||||||
{{/form}}
|
{{/form}}
|
||||||
|
|
||||||
@ -81,9 +68,8 @@
|
|||||||
<fieldset class="modification">
|
<fieldset class="modification">
|
||||||
<legend>Modifier un matériel</legend>
|
<legend>Modifier un matériel</legend>
|
||||||
<dl>
|
<dl>
|
||||||
{{:input type="select" name="category" label="Catégorie" default=$default_category required=true options=$categories}}
|
{{:input type="select" name="category" label="Catégorie" default=$default_category required=true options=$categories}}
|
||||||
{{:input type="text" name="name" label="Désignation" default=$equipment.name required=true}}
|
{{:input type="text" name="name" label="Désignation" default=$equipment.name required=true}}
|
||||||
{{:input type="checkbox" value=1 name="archive" label="Archiver" help="cocher pour archiver le matériel ; possible uniquement si la quantité en stock est nulle"}}
|
|
||||||
</dl>
|
</dl>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
|
@ -60,7 +60,6 @@
|
|||||||
type="equipment"
|
type="equipment"
|
||||||
category=$_POST.category
|
category=$_POST.category
|
||||||
name=$post_mat
|
name=$post_mat
|
||||||
status="available"
|
|
||||||
}}
|
}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
|
@ -1,50 +0,0 @@
|
|||||||
{{* -*- brindille -*- *}}
|
|
||||||
|
|
||||||
{{*
|
|
||||||
Remettre le matériel en service
|
|
||||||
Paramètres :
|
|
||||||
- key : clé du matériel à modifier
|
|
||||||
*}}
|
|
||||||
|
|
||||||
{{:assign equipment_key=$_GET.key|trim}}
|
|
||||||
{{#load key=$_GET.key assign="equipment"}}
|
|
||||||
{{else}}
|
|
||||||
{{:error message="Pas de matériel avec la clé %s"|args:$equipment_key}}
|
|
||||||
{{/load}}
|
|
||||||
|
|
||||||
{{* Traiter l'envoi du formulaire *}}
|
|
||||||
{{#form on="save"}}
|
|
||||||
{{if $_POST.unarchive == 1}}
|
|
||||||
{{:save
|
|
||||||
key=$equipment.key
|
|
||||||
status="available"
|
|
||||||
}}
|
|
||||||
{{/if}}
|
|
||||||
{{:redirect force="archives.html?ok=1&msg=modification"}}
|
|
||||||
{{/form}}
|
|
||||||
|
|
||||||
{{:admin_header title="Modifier matériel" custom_css="./style.css" current="module_equipment"}}
|
|
||||||
{{:form_errors}}
|
|
||||||
|
|
||||||
{{#load key=$equipment.category}}
|
|
||||||
{{:assign cat_name=$name}}
|
|
||||||
{{/load}}
|
|
||||||
|
|
||||||
<form method="post" action="">
|
|
||||||
<fieldset class="informations">
|
|
||||||
<legend>Désarchiver un matériel</legend>
|
|
||||||
<dl class="describe">
|
|
||||||
<dt>Matériel</dt>
|
|
||||||
<dd>{{$equipment.name}}</dd>
|
|
||||||
<dt>Catégorie</dt>
|
|
||||||
<dd>{{$cat_name}}</dd>
|
|
||||||
</dl>
|
|
||||||
<dl>
|
|
||||||
{{:input type="checkbox" value=1 name="unarchive" label="Désarchiver" help="cocher pour remettre le matériel en service"}}
|
|
||||||
</dl>
|
|
||||||
</fieldset>
|
|
||||||
|
|
||||||
<p class="submit">
|
|
||||||
{{:button type="submit" name="save" label="Enregistrer" shape="right" class="main"}}
|
|
||||||
</p>
|
|
||||||
</form>
|
|
Loading…
Reference in New Issue
Block a user