'jobid' => '',
'pub' => 'private',
'name' => '',
- 'hq_acronym' => '',
- 'hq_url' => '',
- 'hq_email' => '',
- 'hq_address' => $address->toFormArray(),
- 'hq_fixed' => '',
- 'hq_fax' => '',
- 'subSubSectorName' => null,
- 'sector' => '0',
- 'subSector' => '0',
- 'subSubSector' => '0',
'description' => '',
'w_url' => '',
'w_address' => $address->toFormArray(),
}
}
}
- if (!$job['subSubSectorName']) {
- $res = XDB::query("SELECT name
- FROM profile_job_subsubsector_enum
- WHERE id = {?}",
- $job['subSubSector']);
- $job['subSubSectorName'] = $res->fetchOneCell();
- } else {
- $res = XDB::query("SELECT sectorid, subsectorid, id
- FROM profile_job_subsubsector_enum
- WHERE name = {?}",
- $job['subSubSectorName']);
- if ($res->numRows() != 1) {
- $success = false;
- $job['sector_error'] = true;
- } else {
- list($job['sector'], $job['subSector'], $job['subSubSector']) = $res->fetchOneRow();
- }
- }
if (count($job['terms'])) {
$termsid = array();
foreach ($job['terms'] as $term) {
$job['tmp_name'] = $entreprise[$entr_val]->name;
++$entr_val;
} else if ($job['name'] == '') {
- if ($job['subSubSectorName'] == '' && $job['description'] == '' && $job['w_url'] == ''
+ if ($job['description'] == '' && $job['w_url'] == ''
&& $job['w_address']['text'] == '' && $job['w_email'] == ''
&& count($job['w_phone']) == 1 && $job['w_phone']['tel'] == '') {
array_splice($value, $key, 1);
}
array_splice($value, $key, 1);
}
- foreach (array('sectorid', 'subsectorid', 'subsubsectorid') as $key) {
- if ($job[$key] == 0) {
- $job[$key] = null;
- }
- }
}
foreach ($value as $key => &$job) {
$address = new Address($job['w_address']);
foreach ($value as $id => &$job) {
if (isset($job['name']) && $job['name']) {
if (isset($job['jobid']) && $job['jobid']) {
- XDB::execute("INSERT INTO profile_job (pid, id, description, sectorid, subsectorid,
- subsubsectorid, email, url, pub, email_pub, jobid)
- VALUES ({?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?})",
- $page->pid(), $id, $job['description'], $job['sector'], $job['subSector'],
- $job['subSubSector'], $job['w_email'], $job['w_url'], $job['pub'], $job['w_email_pub'], $job['jobid']);
+ XDB::execute('INSERT INTO profile_job (pid, id, description, email, url, pub, email_pub, jobid)
+ VALUES ({?}, {?}, {?}, {?}, {?}, {?}, {?}, {?})',
+ $page->pid(), $id, $job['description'], $job['w_email'], $job['w_url'], $job['pub'], $job['w_email_pub'], $job['jobid']);
} else {
- XDB::execute("INSERT INTO profile_job (pid, id, description, sectorid, subsectorid,
- subsubsectorid, email, url, pub, email_pub)
- VALUES ({?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?})",
- $page->pid(), $id, $job['description'], $job['sector'], $job['subSector'],
- $job['subSubSector'], $job['w_email'], $job['w_url'], $job['pub'], $job['w_email_pub']);
+ XDB::execute('INSERT INTO profile_job (pid, id, description, email, url, pub, email_pub)
+ VALUES ({?}, {?}, {?}, {?}, {?}, {?}, {?})',
+ $page->pid(), $id, $job['description'], $job['w_email'], $job['w_url'], $job['pub'], $job['w_email_pub']);
}
$address = new Address(array_merge($job['w_address'], array('pid' => $page->pid(), 'id' => $id, 'type' => Address::LINK_JOB)));
$address->save();
foreach ($value as $id => $job) {
$address = Address::formArrayToString($job['w_address']);
$phones = Phone::formArrayToString($job['w_phone']);
- $jobs[] = 'Entreprise : ' . $job['name'] . ', secteur : ' . $job['subSubSectorName']
+ // TODO: add jobterms here.
+ $jobs[] = 'Entreprise : ' . $job['name']
. ', description : ' . $job['description'] . ', web : ' . $job['w_url']
. ', email : ' . $job['w_email']
. ($phones ? ', ' . $phones : '') . ($address ? ', ' . $address : '');
}
// Build the jobs tree
- $res = XDB::iterRow("SELECT j.id, j.jobid, je.name, j.sectorid, j.subsectorid, j.subsubsectorid,
- s.name, j.description, j.email, j.email_pub, j.url, j.pub,
- je.acronym, je.url, je.email
- FROM profile_job AS j
- LEFT JOIN profile_job_enum AS je ON (j.jobid = je.id)
- LEFT JOIN profile_job_subsubsector_enum AS s ON (s.id = j.subsubsectorid)
+ $res = XDB::iterRow('SELECT j.id, j.jobid, je.name, j.description, j.email, j.email_pub,
+ j.url, j.pub
+ FROM profile_job AS j
+ LEFT JOIN profile_job_enum AS je ON (j.jobid = je.id)
WHERE j.pid = {?}
- ORDER BY j.id",
+ ORDER BY j.id',
$this->pid());
$this->values['jobs'] = array();
$compagnies = array();
if ($res->numRows() > 0) {
- while (list($id, $jobid, $name, $sector, $subSector, $subSubSector,
- $subSubSectorName, $description, $w_email, $w_emailPub, $w_url, $pub,
- $hq_acronym, $hq_url, $hq_email,
- $w_subAdministrativeAreaId, $w_administrativeAreaId, $w_countryId,
- ) = $res->next()) {
+ while (list($id, $jobid, $name, $description, $w_email, $w_emailPub, $w_url, $pub) = $res->next()) {
$compagnies[] = $jobid;
$this->values['jobs'][] = array(
'id' => $id,
'jobid' => $jobid,
'name' => $name,
- 'sector' => $sector,
- 'subSector' => $subSector,
- 'subSubSector' => $subSubSector,
- 'subSubSectorName' => $subSubSectorName,
'description' => $description,
'pub' => $pub,
'w_email' => $w_email,
'w_email_pub' => $w_emailPub,
'w_url' => $w_url,
- 'hq_acronym' => $hq_acronym,
- 'hq_url' => $hq_url,
- 'hq_email' => $hq_email,
);
}
while ($address = $it->next()) {
$this->values['jobs'][$address->jobid]['w_address'] = $address->toFormArray();
}
- $it = Address::iterate(array(), array(Address::LINK_COMPANY), $companies);
- while ($address = $it->next()) {
- $this->values['jobs'][$address->jobId()]['h_address'] = $address->toFormArray();
- }
$it = Phone::iterate(array($this->pid()), array(Phone::LINK_JOB));
while ($phone = $it->next()) {
$this->values['jobs'][$phone->linkId()]['w_phone'][$phone->id()] = $phone->toFormArray();
$job['terms'][] = $term;
}
+ $phone = new Phone();
+ $address = new Address();
foreach ($this->values['jobs'] as $id => &$job) {
- $phone = new Phone();
- $address = new Address();
if (!isset($job['w_phone'])) {
$job['w_phone'] = array(0 => $phone->toFormArray());
}
if (!isset($job['w_address'])) {
$job['w_address'] = $address->toFormArray();
}
- if (!isset($job['h_address'])) {
- $job['h_address'] = $address->toFormArray();
- }
}
$job['w_email_new'] = '';
- if (!isset($job['hq_fixed'])) {
- $job['hq_fixed'] = '';
- }
- if (!isset($job['hq_fax'])) {
- $job['hq_fax'] = '';
- }
if (!isset($job['w_email_pub'])) {
$job['w_email_pub'] = 'private';
}
require_once 'emails.combobox.inc.php';
fill_email_combobox($page, $this->owner);
- $res = XDB::query("SELECT id, name AS label
- FROM profile_job_sector_enum");
- $page->assign('sectors', $res->fetchAllAssoc());
-
$res = XDB::iterator("SELECT id, name
FROM profile_corps_enum
ORDER BY id = 1 DESC, name");
<a href="javascript:addEntreprise({$i})">clique ici</a> et complète les informations la concernant.</small>
</td>
</tr>
- {/if}
<tr class="{$entreprise}" style="display: none">
<td class="titre">Acronyme</td>
<td>
- <input type="text" size="35" maxlength="255" {if $job.acronym_error}class="error"{/if}
- name="{$jobpref}[hq_acronym]" value="{$job.hq_acronym}" />
+ <input type="text" size="35" maxlength="255" name="{$jobpref}[hq_acronym]" />
</td>
</tr>
<tr class="{$entreprise}" style="display: none">
<td class="titre">Page web</td>
<td>
- <input type="text" size="35" maxlength="255" {if $job.hq_url}class="error"{/if}
- name="{$jobpref}[hq_url]" value="{$job.hq_url}" />
+ <input type="text" size="35" maxlength="255" name="{$jobpref}[hq_url]" />
</td>
</tr>
<tr class="{$entreprise}" style="display: none">
<td class="titre">Email de contact</td>
<td>
- <input type="text" maxlength="60" {if $job.hq_email_error}class="error"{/if}
- name="{$jobpref}[hq_email]" value="{$job.hq_email}" />
+ <input type="text" maxlength="60" name="{$jobpref}[hq_email]" />
</td>
</tr>
<tr class="{$entreprise}" style="display: none">
- <td colspan="2">
- <div style="float: left">
- <div class="titre">Adresse du siège</div>
- <div style="margin-top: 20px; clear: both">
- {include file="geoloc/form.address.tpl" prefname="`$jobpref`[hq_address]"
- prefid="`$jobid`_address" address=$job.hq_address}
- </div>
- </div>
+ <td class="titre">Adresse du siège</td>
+ <td>
+ <textarea name="{$jobpref}[hq_address]" cols="30" rows="4"></textarea>
</td>
</tr>
<tr class="{$entreprise}" style="display: none">
<td class="titre">Téléphone</td>
<td>
- <input type="text" maxlength="28" {if $job.hq_tel_error}class="error"{/if}
- name="{$jobpref}[hq_fixed]" value="{$job.hq_fixed}" />
+ <input type="text" maxlength="28" name="{$jobpref}[hq_fixed]" />
</td>
</tr>
<tr class="{$entreprise}" style="display: none">
<td class="titre">Fax</td>
<td>
- <input type="text" maxlength="28" {if $job.hq_fax_error}class="error"{/if}
- name="{$jobpref}[hq_fax]" value="{$job.hq_fax}" />
+ <input type="text" maxlength="28" name="{$jobpref}[hq_fax]" />
</td>
</tr>
+ {/if}
<tr class="pair">
<td colspan="2" class="center" style="font-style: italic">Ta place dans l'entreprise</td>
<td colspan="2" class="term_tree">
</td>
</tr>
- <tr class="pair {$sector}" style="display: none">
- <td class="titre" rowspan="4">Secteur d'activité</td>
- <td>
- <select name="{$jobpref}[sector]" onchange="updateJobSector({$i}, ''); emptyJobSubSector({$i}); emptyJobAlternates({$i});">
- <option value="0"> </option>
- {foreach from=$sectors item=item}
- <option value="{$item.id}" {if $item.id eq $job.sector}selected="selected"{/if}>
- {$item.label}
- </option>
- {/foreach}
- </select>
- </td>
- </tr>
- <tr class="pair {$sector}" style="display: none">
- <td id="{$jobid}_subSector">
- <input type="hidden" name="{$jobpref}[subSector]" value="{$job.subSector|default:0}" />
- </td>
- </tr>
- <tr class="pair {$sector}" style="display: none">
- <td id="{$jobid}_subSubSector">
- <input type="hidden" name="{$jobpref}[subSubSector]" value="{$job.subSubSector|default:0}" />
- </td>
- </tr>
- <tr class="pair {$sector}" style="display: none">
- <td id="{$jobid}_alternates">
- </td>
- </tr>
<tr class="pair">
<td class="titre">Description</td>
<td>
ALTER TABLE profile_education_degree MODIFY COLUMN eduid INT(11) UNSIGNED DEFAULT 0;
ALTER TABLE profile_education_degree MODIFY COLUMN degreeid INT(11) UNSIGNED DEFAULT 0;
ALTER TABLE profile_job MODIFY COLUMN jobid INT(6) UNSIGNED DEFAULT NULL;
-ALTER TABLE profile_job MODIFY COLUMN sectorid TINYINT(2) UNSIGNED DEFAULT NULL;
-ALTER TABLE profile_job MODIFY COLUMN subsectorid SMALLINT(3) UNSIGNED DEFAULT NULL;
-ALTER TABLE profile_job MODIFY COLUMN subsubsectorid SMALLINT(3) UNSIGNED DEFAULT NULL;
-- Prepares table having ids set to 0.
DELETE FROM profile_mentor_country WHERE country = 'YU' OR country = '00';
UPDATE profile_education SET fieldid = NULL WHERE fieldid = 0;
UPDATE profile_education_enum SET country = NULL WHERE country = '';
UPDATE profile_job SET jobid = NULL WHERE jobid = 0;
-UPDATE profile_job SET sectorid = NULL WHERE sectorid = 0;
-UPDATE profile_job SET subsectorid = NULL WHERE subsectorid = 0;
-UPDATE profile_job SET subsubsectorid = NULL WHERE subsubsectorid = 0;
UPDATE profile_job_enum SET holdingid = NULL WHERE holdingid = 0;
-- Adds missing data in foreign tables.
ALTER TABLE profile_education_degree ADD FOREIGN KEY (eduid) REFERENCES profile_education_enum (id) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE profile_education_degree ADD FOREIGN KEY (degreeid) REFERENCES profile_education_degree_enum (id) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE profile_job ADD FOREIGN KEY (jobid) REFERENCES profile_job_enum (id) ON DELETE CASCADE ON UPDATE CASCADE;
-ALTER TABLE profile_job ADD FOREIGN KEY (sectorid) REFERENCES profile_job_sector_enum (id) ON DELETE CASCADE ON UPDATE CASCADE;
-ALTER TABLE profile_job ADD FOREIGN KEY (subsectorid) REFERENCES profile_job_subsector_enum (id) ON DELETE CASCADE ON UPDATE CASCADE;
-ALTER TABLE profile_job ADD FOREIGN KEY (subsubsectorid) REFERENCES profile_job_subsubsector_enum (id) ON DELETE CASCADE ON UPDATE CASCADE;
-ALTER TABLE profile_job_alternates ADD FOREIGN KEY (subsubsectorid) REFERENCES profile_job_subsubsector_enum (id) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE profile_job_enum ADD FOREIGN KEY (holdingid) REFERENCES profile_job_enum (id) ON DELETE CASCADE ON UPDATE CASCADE;
-ALTER TABLE profile_job_subsector_enum ADD FOREIGN KEY (sectorid) REFERENCES profile_job_sector_enum (id) ON DELETE CASCADE ON UPDATE CASCADE;
-ALTER TABLE profile_job_subsubsector_enum ADD FOREIGN KEY (sectorid) REFERENCES profile_job_sector_enum (id) ON DELETE CASCADE ON UPDATE CASCADE;
-ALTER TABLE profile_job_subsubsector_enum ADD FOREIGN KEY (subsectorid) REFERENCES profile_job_subsector_enum (id) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE profile_langskills ADD FOREIGN KEY (lid) REFERENCES profile_langskill_enum (id) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE profile_medal_grade_enum ADD FOREIGN KEY (mid) REFERENCES profile_medal_enum (id) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE profile_mentor_country ADD FOREIGN KEY (country) REFERENCES geoloc_countries (iso_3166_1_a2) ON DELETE CASCADE ON UPDATE CASCADE;
-ALTER TABLE profile_mentor_sector ADD FOREIGN KEY (sectorid) REFERENCES profile_job_sector_enum (id) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE profile_skills ADD FOREIGN KEY (cid) REFERENCES profile_skill_enum (id) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE profile_name ADD FOREIGN KEY (typeid) REFERENCES profile_name_enum (id) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE profile_networking ADD FOREIGN KEY (nwid) REFERENCES profile_networking_enum (nwid) ON DELETE CASCADE ON UPDATE CASCADE;