renommage champ designation => name

This commit is contained in:
Jean-Christophe Engel 2025-02-18 14:13:11 +01:00
parent 9ac71344fb
commit dbbff606f6
16 changed files with 35 additions and 35 deletions

View file

@ -35,14 +35,14 @@
{{/if}}
{{* vérifier l'existence d'un matériel de même nom *}}
{{#load type="equipment" where="$$.designation = :name COLLATE U_NOCASE" :name=$_POST.designation|trim limit=1}}}}
{{#load type="equipment" where="$$.name = :name COLLATE U_NOCASE" :name=$_POST.name|trim limit=1}}}}
{{:assign equipment_key=$key}}
{{:assign var=nom_cat from="categories.%s"|args:$category}}
{{:assign present=true}}
{{/load}}
{{:assign var=post_cat from="categories.%s"|args:$_POST.category}}
{{:assign post_mat=$_POST.designation|trim|tolower|ucfirst}}
{{:assign post_mat=$_POST.name|trim|tolower|ucfirst}}
{{if $present}}
{{* voir si le matériel existe dans une autre catégorie *}}
{{if $nom_cat != $post_cat}}
@ -59,7 +59,7 @@
validate_schema="../equipment.schema.json"
type="equipment"
category=$_POST.category
designation=$post_mat
name=$post_mat
}}
{{/if}}
@ -109,7 +109,7 @@
<legend>Sélectionner une catégorie et indiquer le nom du nouveau matériel</legend>
<dl>
{{:input type="select" name="category" label="Catégorie" options=$categories required=true}}
{{:input type="text" name="designation" label="Désignation" required=true}}
{{:input type="text" name="name" label="Désignation" required=true}}
{{:input type="textarea" name="remarques" label="Remarques" cols="40", rows="3" required=false}}
</dl>
</fieldset>