Interdire date dans le futur
This commit is contained in:
parent
92b79b75dc
commit
9ac71344fb
7 changed files with 36 additions and 1 deletions
|
|
@ -29,7 +29,10 @@
|
|||
{{:error message="La quantité (%s) doit être strictement positive !!"|args:$_POST.quantite}}
|
||||
{{/if}}
|
||||
|
||||
{{:assign post_mat=$_POST.designation|trim|tolower|ucfirst}}
|
||||
{{* interdire date dans le futur *}}
|
||||
{{if $_POST.date|parse_date|strtotime > $now}}
|
||||
{{:error message="Impossible de saisir une date dans le futur (%s)"|args:$_POST.date}}
|
||||
{{/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}}}}
|
||||
|
|
@ -39,6 +42,7 @@
|
|||
{{/load}}
|
||||
{{:assign var=post_cat from="categories.%s"|args:$_POST.category}}
|
||||
|
||||
{{:assign post_mat=$_POST.designation|trim|tolower|ucfirst}}
|
||||
{{if $present}}
|
||||
{{* voir si le matériel existe dans une autre catégorie *}}
|
||||
{{if $nom_cat != $post_cat}}
|
||||
|
|
@ -82,6 +86,7 @@
|
|||
{{:assign prop=1}}
|
||||
{{/if}}
|
||||
{{:redirect force="../index.html?prop=%s&ok=1&msg=%s"|args:$prop:$msg}}
|
||||
|
||||
{{/form}}
|
||||
|
||||
{{:admin_header title="Entrée de matériel" current="module_equipment"}}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue