Suppression fichiers inutilisés
This commit is contained in:
parent
553cbdf978
commit
9a11e55ad7
6 changed files with 0 additions and 560 deletions
|
|
@ -1,87 +0,0 @@
|
|||
{{:admin_header title="Supprimer une sortie" current="module_equipment"}}
|
||||
|
||||
{{* récupérer les infos du mouvement à supprimer et du matériel associé *}}
|
||||
{{#load key=$_GET.key assign="mvt_suppr"}}
|
||||
{{else}}
|
||||
{{:error message="Aucune sortie avec la clé « %s »"|args:$_GET.key}}
|
||||
{{/load}}
|
||||
|
||||
{{:assign amount_suppr=$mvt_suppr.amount}}
|
||||
{{:assign date_suppr=$mvt_suppr.date|date_short}}
|
||||
{{:assign key_eqpmt_suppr=$mvt_suppr.equipment}}
|
||||
|
||||
{{#load key=$key_eqpmt_suppr assign="eqpmt_suppr"}}
|
||||
{{else}}
|
||||
{{:error message="Aucun matériel avec la clé « %s »"|args:$key_eqpmt_suppr}}
|
||||
{{/load}}
|
||||
|
||||
{{#form on="delete"}}
|
||||
|
||||
{{* récupérer la config des entrées/sorties *}}
|
||||
{{:include file="../../_get_config.html" keep="config"}}
|
||||
|
||||
{{* déterminer s'il s'agit d'une sortie temporaire *}}
|
||||
{{:assign temporaire=false}}
|
||||
{{:assign var="output_nature" from="config.output_nature.%s"|args:$mvt_suppr.output_nature}}
|
||||
|
||||
{{if $output_nature == 'temporaire'}}
|
||||
{{:assign temporaire=true}}
|
||||
{{/if}}
|
||||
|
||||
{{* dans le cas d'une sortie temporaire, vérifier s'il est possible de la supprimer *}}
|
||||
{{if $temporaire}}
|
||||
{{:assign exterieur=0}}
|
||||
{{#load
|
||||
type="movement"
|
||||
where="$$.equipment = :key" :key=$key_eqpmt_suppr
|
||||
assign="mvt"
|
||||
order="$$.date"}}
|
||||
|
||||
{{* déterminer le type de mouvement *}}
|
||||
{{:assign var="mvt_nature" from="mvt.%s_nature"|args:$mvt.direction}}
|
||||
{{:assign var="type_mvt" from="config.%s_nature.%s"|args:$mvt.direction:$mvt_nature}}
|
||||
|
||||
{{if $key != $_GET.key}}
|
||||
{{* ce n'est pas le mouvement à supprimer : cumuler les entrées/sorties *}}
|
||||
{{if $mvt.direction == 'input'}}
|
||||
{{if $type_mvt == 'retour'}}
|
||||
{{:assign exterieur="%d-%d"|math:$exterieur:$mvt.amount}}
|
||||
{{/if}}
|
||||
{{elseif $mvt.direction == 'output'}}
|
||||
{{if $type_mvt == 'temporaire'}}
|
||||
{{:assign exterieur="%d+%d"|math:$exterieur:$mvt.amount}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
{{* problème ? *}}
|
||||
{{if $exterieur < 0}}
|
||||
{{:redirect force="./index.html?err=1&msg=suppression"}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{/load}}
|
||||
{{/if}}
|
||||
|
||||
{{* vérification réussie : supprimer la sortie *}}
|
||||
{{:delete key=$_GET.key}}
|
||||
{{:assign var="msg" value="suppression"}}
|
||||
|
||||
{{* voir s'il reste des mouvements pour le matériel concerné par le mouvement supprimé *}}
|
||||
{{#load type="movement" where="$$.equipment = :eqpmt_key" :eqpmt_key=$key_eqpmt_suppr}}
|
||||
{{else}}
|
||||
{{* supprimer le matériel *}}
|
||||
{{:delete key=$key_eqpmt_suppr}}
|
||||
{{:assign var="msg" value="%s - matériel"|args:$msg}}
|
||||
{{/load}}
|
||||
|
||||
{{:redirect force="./index.html?ok=1&msg=%s"|args:$msg}}
|
||||
{{/form}}
|
||||
|
||||
{{:delete_form
|
||||
legend="Supprimer cette sortie ?"
|
||||
warning="Supprimer la sortie « %s %s (%d) en date du %s » ?"|args:$mvt_suppr.output_nature:$eqpmt_suppr.designation:$amount_suppr:$date_suppr
|
||||
info="S'il ne reste aucun mouvement pour ce matériel, le matériel sera supprimé"
|
||||
}}
|
||||
|
||||
{{:form_errors}}
|
||||
|
||||
{{:admin_footer}}
|
||||
|
|
@ -1,101 +0,0 @@
|
|||
{{:admin_header title="Gestion des matériels" current="module_equipment"}}
|
||||
|
||||
{{* barre de navigation *}}
|
||||
{{:include file="../../_nav.html" current="sorties"}}
|
||||
|
||||
{{if $_GET.ok}}
|
||||
{{if $_GET.msg|match:"suppression"}}
|
||||
{{:assign msg="Sortie supprimée"}}
|
||||
{{if $_GET.msg|match:"matériel"}}
|
||||
{{:assign var="msg" value="%s - Matériel supprimé"|args:$msg}}
|
||||
{{/if}}
|
||||
{{elseif $_GET.msg == "sortie"}}
|
||||
{{:assign msg="Sortie enregistrée"}}
|
||||
{{elseif $_GET.msg == "modification"}}
|
||||
{{:assign msg="Sortie modifiée"}}
|
||||
{{/if}}
|
||||
<p class="block confirm">{{$msg}}</p>
|
||||
{{elseif $_GET.err}}
|
||||
{{if $_GET.msg == "suppression"}}
|
||||
<p class="block error">Impossible de supprimer la sortie</p>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
{{* 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}}
|
||||
|
||||
{{if $categories_exist}}
|
||||
|
||||
{{* vérifier s'il y a eu des entrées de matériel *}}
|
||||
{{#load type="equipment"}}
|
||||
{{:assign disabled=false}}
|
||||
{{else}}
|
||||
{{: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}}
|
||||
Loading…
Add table
Add a link
Reference in a new issue