amélioration vérification nom catégorie et matériel
This commit is contained in:
parent
42d85fb528
commit
72cd82d254
4 changed files with 12 additions and 21 deletions
|
|
@ -28,7 +28,7 @@
|
|||
{{#load key=$equipment_key}}
|
||||
{{if $designation|trim|tolower != $_POST.designation|trim|tolower}}
|
||||
{{* le nom change => vérifier l'existence d'un matériel du même nom *}}
|
||||
{{#load type="equipment" where="lower($$.designation) = :name" :name=$_POST.designation|trim|tolower}}
|
||||
{{#load type="equipment" where="$$.designation = :name" :name=$_POST.designation|trim|tolower|ucfirst limit=1}}
|
||||
{{:assign chgt_ok=false}}
|
||||
{{/load}}
|
||||
{{else}}
|
||||
|
|
@ -37,8 +37,8 @@
|
|||
{{/load}}
|
||||
|
||||
{{else}}
|
||||
{{* catégorie ne change pas => vérifier le nom*}}
|
||||
{{#load type="equipment" where="lower($$.designation) = :name" :name=$_POST.designation|trim|tolower}}
|
||||
{{* catégorie ne change pas => vérifier le nom *}}
|
||||
{{#load type="equipment" where="$$.designation = :name" :name=$_POST.designation|trim|tolower|ucfirst limit=1}}
|
||||
{{:assign chgt_ok=false}}
|
||||
{{/load}}
|
||||
{{/if}}
|
||||
|
|
@ -51,7 +51,7 @@
|
|||
{{:save
|
||||
key=$equipment_key
|
||||
category=$category.key
|
||||
designation=$_POST.designation|trim
|
||||
designation=$_POST.designation|trim|tolower|ucfirst
|
||||
}}
|
||||
{{:redirect force="index.html?ok=1&msg=modification&prop=%s"|args:$_GET.prop}}
|
||||
{{/form}}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue