Désactivation boutons entrées/sorties

This commit is contained in:
Jean-Christophe Engel 2023-12-19 12:13:51 +01:00
parent cb79af5157
commit e52a4e6329
6 changed files with 175 additions and 119 deletions

View file

@ -21,56 +21,81 @@
{{/if}}
{{/if}}
<form method="post" action="">
<fieldset class="sortie">
<legend>Ajouter une sortie </legend>
<dl>
{{:linkbutton label="Matériel en stock disponible" shape="plus" href="stock_disponible.html" target="_dialog"}}
{{:linkbutton label="Matériel emprunté" shape="plus" href="emprunte.html" target="_dialog"}}
</dl>
</fieldset>
</form>
{{* vérifier s'il existe des catégories *}}
{{#load type="category"}}
{{:assign categories_exist=true}}
{{else}}
<p class="block alert">Il n'y a aucune catégorie : vous devez en ajouter.</p>
{{/load}}
{{* lister les sorties *}}
<section class="liste_sorties">
<h2>Liste des sorties</h2>
{{if $categories_exist}}
{{#list
select="
$$.date AS 'Date' ;
$$.output_nature AS 'Type' ;
$$.amount AS 'Nombre' ;
(SELECT $$.designation
FROM @TABLE AS b
WHERE b.key = @TABLE.$$.equipment) AS 'Matériel' ;
$$.comment AS 'Remarques'"
type="movement"
direction="output"
order=1}}
{{:assign var='mvt_key' value=$key}}
<tr>
<td>{{$date|date_short}}</td>
<td>{{$output_nature}}</td>
<td>{{$amount}}</td>
<td>{{$col4}}</td>
<td>{{$comment}}</td>
<td class="actions">
{{:linkbutton
label="Supprimer"
href="delete_sortie.html?key=%s"|args:$mvt_key
shape="delete"
target="_dialog"}}
{{:linkbutton
label="Modifier"
href="../modifier_mouvement.html?key=%s&direction=output"|args:$mvt_key
shape="edit"
target="_dialog"}}
</td>
</tr>
{{* vérifier s'il y a eu des entrées de matériel *}}
{{#load type="equipment"}}
{{:assign disabled=false}}
{{else}}
<p class="block alert">Il n'y a aucune sortie.</p>
{{/list}}
</section>
{{:assign disabled=true}}
{{/load}}
{{* vérifier s'il y a des entrées temporaires *}}
{{if ! $disabled}}
{{:include file="../../_calcul_dispo.html" keep="cumul_mvt"}}
{{:include file="_temporaire.html" keep="temporaire"}}
<form method="post" action="">
<fieldset class="sortie">
<legend>Ajouter une sortie </legend>
<dl>
{{:linkbutton label="Matériel en stock disponible" shape="plus" href="stock_disponible.html" target="_dialog"}}
{{if $temporaire != null}}
{{:linkbutton label="Matériel emprunté" shape="plus" href="emprunte.html" target="_dialog"}}
{{/if}}
</dl>
</fieldset>
</form>
{{/if}}
{{* lister les sorties *}}
<section class="liste_sorties">
<h2>Liste des sorties</h2>
{{#list
select="
$$.date AS 'Date' ;
$$.output_nature AS 'Type' ;
$$.amount AS 'Nombre' ;
(SELECT $$.designation
FROM @TABLE AS b
WHERE b.key = @TABLE.$$.equipment) AS 'Matériel' ;
$$.comment AS 'Remarques'"
type="movement"
direction="output"
order=1}}
{{:assign var='mvt_key' value=$key}}
<tr>
<td>{{$date|date_short}}</td>
<td>{{$output_nature}}</td>
<td>{{$amount}}</td>
<td>{{$col4}}</td>
<td>{{$comment}}</td>
<td class="actions">
{{:linkbutton
label="Supprimer"
href="delete_sortie.html?key=%s"|args:$mvt_key
shape="delete"
target="_dialog"}}
{{:linkbutton
label="Modifier"
href="../modifier_mouvement.html?key=%s&direction=output"|args:$mvt_key
shape="edit"
target="_dialog"}}
</td>
</tr>
{{else}}
<p class="block alert">Il n'y a aucune sortie.</p>
{{/list}}
</section>
{{/if}}
{{:admin_footer}}