X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Fprofile%2Fjobs.inc.php;h=4f0d4288a3790284952bd5591532bc1cf4fcf10a;hb=b715c1e1641250d75c3bf2d3bd951519ad3e1dcd;hp=33690c4abef66888535f52d2b65d970e7f70c3f6;hpb=08fa70684fd1332178cddb6b318151335fb4506c;p=platal.git diff --git a/modules/profile/jobs.inc.php b/modules/profile/jobs.inc.php index 33690c4..4f0d428 100644 --- a/modules/profile/jobs.inc.php +++ b/modules/profile/jobs.inc.php @@ -22,6 +22,7 @@ class ProfileJob extends ProfileGeoloc { private $pub; + private $mail_new; private $mail; private $web; private $tel; @@ -31,11 +32,14 @@ class ProfileJob extends ProfileGeoloc public function __construct() { $this->pub = new ProfilePub(); - $this->mail = new ProfileEmail(); + $this->mail + = $this->mail_new + = new ProfileEmail(); $this->web = new ProfileWeb(); $this->tel = new ProfileTel(); $this->bool = new ProfileBool(); $this->checks = array('web' => array('web'), + 'mail_new' => array('email_new'), 'mail' => array('email'), 'tel' => array('tel', 'fax', 'mobile'), 'pub' => array('pub', 'tel_pub', 'email_pub')); @@ -47,6 +51,12 @@ class ProfileJob extends ProfileGeoloc foreach ($this->checks as $obj=>&$fields) { $chk =& $this->$obj; foreach ($fields as $field) { + if ($field == "email_new") { + if ($job['email'] == "new@new.new") { + $job['email'] = $job[$field]; + } + continue; + } $job[$field] = $chk->value($page, $field, $job[$field], $s); if (!$s) { $success = false; @@ -96,6 +106,10 @@ class ProfileJob extends ProfileGeoloc S::i('uid')); $i = 0; foreach ($value as &$job) { + if ($job['email'] == "new@new.new") { + $job['email'] = $job['email_new']; + } + XDB::execute("INSERT INTO entreprises (uid, entrid, entreprise, secteur, ss_secteur, fonction, poste, adr1, adr2, adr3, postcode, city, cityid, country, region, regiontxt, @@ -204,6 +218,9 @@ class ProfileJobs extends ProfilePage public function _prepare(PlatalPage &$page, $id) { + require_once "emails.combobox.inc.php"; + fill_email_combobox($page); + $page->assign('secteurs', XDB::iterator("SELECT id, label FROM emploi_secteur")); $page->assign('fonctions', XDB::iterator("SELECT id, fonction_fr, FIND_IN_SET('titre', flags) AS title