From: Stéphane Jacob Date: Sat, 3 Jul 2010 16:32:23 +0000 (+0200) Subject: Allows empty fields and fixes for entreprise validation. X-Git-Tag: xorg/1.0.1~363 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=36270bc2d372bc68fa519710cf996286ac995f6c;hp=d134ddda91e67ef3e5897e764a6758ba5b2af25d;p=platal.git Allows empty fields and fixes for entreprise validation. Signed-off-by: Stéphane Jacob --- diff --git a/include/validations/entreprises.inc.php b/include/validations/entreprises.inc.php index cff4801..bf60594 100644 --- a/include/validations/entreprises.inc.php +++ b/include/validations/entreprises.inc.php @@ -98,26 +98,37 @@ class EntrReq extends ProfileValidate protected function handle_editor() { - if (Env::has('holdingid')) { - $this->holdingid = Env::t('holdingid'); - } if (Env::has('name')) { $this->name = Env::t('name'); - if (Env::has('acronym')) { - $this->acronym = Env::t('acronym'); - if (Env::has('url')) { - $this->url = Env::t('url'); - if (Env::has('NAF_code')) { - $this->NAF_code = Env::t('NAF_code'); - if (Env::has('AX_code')) { - $this->AX_code = Env::t('AX_code'); - return true; - } - } - } - } } - return false; + if (Env::has('acronym')) { + $this->acronym = Env::t('acronym'); + } + if (Env::has('url')) { + $this->url = Env::t('url'); + } + if (Env::has('email')) { + $this->email = Env::t('email'); + } + if (Env::has('holdingid')) { + $this->holdingid = Env::i('holdingid'); + } + if (Env::has('NAF_code')) { + $this->NAF_code = Env::t('NAF_code'); + } + if (Env::has('AX_code')) { + $this->AX_code = Env::i('AX_code'); + } + if (Env::has('address')) { + $this->address['text'] = Env::t('address'); + } + if (Env::has('tel')) { + $this->tel = Env::t('tel'); + } + if (Env::has('fax')) { + $this->fax = Env::t('fax'); + } + return true; } // }}} diff --git a/templates/include/form.valid.edit-entreprises.tpl b/templates/include/form.valid.edit-entreprises.tpl index 1fce6e7..7b59719 100644 --- a/templates/include/form.valid.edit-entreprises.tpl +++ b/templates/include/form.valid.edit-entreprises.tpl @@ -27,7 +27,7 @@ Site web :
Email : -
+
Holding :
Code NAF : @@ -35,7 +35,7 @@ Code AX :
Adresse : -
+
Téléphone :
Fax : diff --git a/templates/include/form.valid.entreprises.tpl b/templates/include/form.valid.entreprises.tpl index 58112e1..855ade8 100644 --- a/templates/include/form.valid.entreprises.tpl +++ b/templates/include/form.valid.entreprises.tpl @@ -55,7 +55,7 @@ Adresse : - {$valid->address[text]} + {$valid->address.text} Téléphone : diff --git a/upgrade/1.0.1/00_job.sql b/upgrade/1.0.1/00_job.sql new file mode 100644 index 0000000..4b6b5dd --- /dev/null +++ b/upgrade/1.0.1/00_job.sql @@ -0,0 +1,6 @@ +ALTER TABLE profile_job_enum MODIFY COLUMN acronym VARCHAR(255) DEFAULT NULL; +ALTER TABLE profile_job_enum MODIFY COLUMN url VARCHAR(255) DEFAULT NULL; +ALTER TABLE profile_job_enum MODIFY COLUMN email VARCHAR(255) DEFAULT NULL; +ALTER TABLE profile_job_enum MODIFY COLUMN NAF_code CHAR(5) DEFAULT NULL; + +-- vim:set syntax=mysql: