From 36270bc2d372bc68fa519710cf996286ac995f6c Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Jacob?= Date: Sat, 3 Jul 2010 18:32:23 +0200 Subject: [PATCH] Allows empty fields and fixes for entreprise validation. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Jacob --- include/validations/entreprises.inc.php | 45 ++++++++++++++--------- templates/include/form.valid.edit-entreprises.tpl | 4 +- templates/include/form.valid.entreprises.tpl | 2 +- upgrade/1.0.1/00_job.sql | 6 +++ 4 files changed, 37 insertions(+), 20 deletions(-) create mode 100644 upgrade/1.0.1/00_job.sql 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: -- 2.1.4