<?php
/***************************************************************************
- * Copyright (C) 2003-2007 Polytechnique.org *
+ * Copyright (C) 2003-2008 Polytechnique.org *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
class ProfileJob extends ProfileGeoloc
{
private $pub;
+ private $mail_new;
private $mail;
private $web;
private $tel;
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'));
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;
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,
parent::__construct($wiz);
$this->settings['cv'] = null;
$this->settings['jobs'] = new ProfileJob();
+ $this->watched['cv'] = $this->watched['jobs'] = true;
}
protected function _fetchData()
e.adr_pub, e.tel_pub, e.email_pub,
e.glat AS precise_lat, e.glng AS precise_lon
FROM entreprises AS e
- INNER JOIN geoloc_pays AS gp ON(gp.a2 = e.country)
+ LEFT JOIN geoloc_pays AS gp ON(gp.a2 = e.country)
WHERE uid = {?} AND entreprise != ''
ORDER BY entrid", S::i('uid'));
$this->values['jobs'] = array();
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