X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fvalidations%2Fentreprises.inc.php;h=47e6a023f4ad03bf17f44d632154702a4d2ae693;hb=7c4ae1c3d38d458ac3b6dea25ca76ebdd2c0ecd8;hp=cff4801a2c05a4606fa6a0eb93a18358e2ce838d;hpb=98d7a2d3ee35bbd3cf9891d4db60a6b262e8d798;p=platal.git diff --git a/include/validations/entreprises.inc.php b/include/validations/entreprises.inc.php index cff4801..47e6a02 100644 --- a/include/validations/entreprises.inc.php +++ b/include/validations/entreprises.inc.php @@ -68,12 +68,14 @@ class EntrReq extends ProfileValidate $where .= "name LIKE '%" . $name_array[$i] . "%'"; } } - $res = XDB::iterator('SELECT name - FROM profile_job_enum - WHERE ' . $where); - $this->suggestions = "| "; - while ($sug = $res->next()) { - $this->suggestions .= $sug['name'] . " | "; + if ($where != '') { + $res = XDB::iterator('SELECT name + FROM profile_job_enum + WHERE ' . $where); + $this->suggestions = "| "; + while ($sug = $res->next()) { + $this->suggestions .= $sug['name'] . " | "; + } } } @@ -98,26 +100,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; } // }}}