Sécurisation paramètres
This commit is contained in:
parent
5794d2c84a
commit
bbc88f57f5
10 changed files with 37 additions and 16 deletions
|
|
@ -6,9 +6,13 @@
|
|||
Dupliquer un mouvement
|
||||
paramètres :
|
||||
- key : clé du mouvement à dupliquer
|
||||
- prop = 1 si matériel appartient à l'asso
|
||||
- prop = 1 si matériel appartient à l'asso, 0 sinon
|
||||
*}}
|
||||
|
||||
{{if $_GET.prop == null || $_GET.prop|intval != 0 && $_GET.prop|intval != 1}}
|
||||
{{:error message="Opération interdite"}}
|
||||
{{/if}}
|
||||
|
||||
{{* récupérer les infos du mouvement à dupliquer *}}
|
||||
{{#load key=$_GET.key assign="mvt_new"}}
|
||||
{{else}}
|
||||
|
|
@ -49,8 +53,8 @@
|
|||
{{if $mvt_new.direction == "input"}}
|
||||
{{* types d'entrées *}}
|
||||
{{#foreach from=$config.input_nature key=key}}
|
||||
{{if $_GET.prop && $type == "définitif" ||
|
||||
! $_GET.prop && $type == "temporaire"
|
||||
{{if $_GET.prop|intval == 1 && $type == "définitif" ||
|
||||
$_GET.prop|intval == 0 && $type == "temporaire"
|
||||
}}
|
||||
{{:assign var="input_labels.%s"|args:$key value=$label}}
|
||||
{{/if}}
|
||||
|
|
@ -58,7 +62,7 @@
|
|||
{{else}}
|
||||
{{* types de sorties *}}
|
||||
{{#foreach from=$config.output_nature key=key}}
|
||||
{{if $_GET.prop && $type != "retour"}}
|
||||
{{if $_GET.prop|intval == 1 && $type != "retour"}}
|
||||
{{:assign var="output_labels.%s"|args:$key value=$label}}
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
|
|
|
|||
|
|
@ -20,6 +20,8 @@
|
|||
|
||||
{{* récupérer les informations du matériel et de sa catégorie *}}
|
||||
{{#load key=$_GET.key assign="equipment"}}
|
||||
{{else}}
|
||||
{{:error message="Aucun matériel avec la clé « %s »"|args:$_GET.key}}
|
||||
{{/load}}
|
||||
{{#load where="key = :key" :key=$equipment.category assign="category"}}
|
||||
{{/load}}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
{{*
|
||||
paramètres :
|
||||
- key : clé du matériel à sortir
|
||||
- output_type : loan (prêt), rent (location), rien (cas général)
|
||||
- output_type : (OBSOLÈTE ?) loan (prêt), rent (location), rien (cas général)
|
||||
*}}
|
||||
|
||||
{{* récupérer la config des entrées/sorties *}}
|
||||
|
|
@ -25,11 +25,16 @@
|
|||
{{:assign var="output_labels.%s"|args:$key value=$label}}
|
||||
{{elseif $type == 'temporaire' && $_GET.output_type == "rent" && $fee == 'payant'}}
|
||||
{{:assign var="output_labels.%s"|args:$key value=$label}}
|
||||
{{else}}
|
||||
{{:error message="Opération interdite"}}
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
|
||||
{{* récupérer les infos du matériel *}}
|
||||
{{#load key=$_GET.key assign="equipment"}}{{/load}}
|
||||
{{#load key=$_GET.key assign="equipment"}}
|
||||
{{else}}
|
||||
{{:error message="Aucun matériel avec la clé %s"|args:$_GET.key}}
|
||||
{{/load}}
|
||||
|
||||
{{* Traiter l'envoi du formulaire *}}
|
||||
{{#form on="save"}}
|
||||
|
|
@ -72,7 +77,7 @@
|
|||
{{:assign insere=false}}
|
||||
|
||||
{{* lister tous les mouvements du matériel *}}
|
||||
{{#load type="movement" where="$$.equipment = '%s'"|args:$_GET.key assign="mvt" order="$$.date ASC"}}
|
||||
{{#load type="movement" where="$$.equipment = :eqpmt_key" :eqpmt_key=$_GET.key assign="mvt" order="$$.date ASC"}}
|
||||
{{* traiter le nouveau mouvement *}}
|
||||
{{if ! $insere && $mvt.date > $_POST.date|parse_date}}
|
||||
{{:assign insere=true}}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue