<?php
/***************************************************************************
- * Copyright (C) 2003-2008 Polytechnique.org *
+ * Copyright (C) 2003-2009 Polytechnique.org *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
{
// Checkout the CV
$res = XDB::query("SELECT cv
- FROM auth_user_md5
- WHERE user_id = {?}",
- S::i('uid'));
+ FROM profiles
+ WHERE pid = {?}",
+ $this->pid());
$this->values['cv'] = $res->fetchOneCell();
// Checkout the corps
rankid AS rank, corps_pub AS pub
FROM profile_corps
WHERE uid = {?}",
- S::i('uid'));
+ $this->pid());
$this->values['corps'] = $res->fetchOneAssoc();
// Build the jobs tree
LEFT JOIN geoloc_pays AS gp ON (gp.a2 = e.country)
LEFT JOIN profile_job_subsubsector_enum AS s ON (s.id = j.subsubsectorid)
WHERE j.uid = {?}
- ORDER BY entrid", S::i('uid'));
+ ORDER BY entrid", $this->pid());
$this->values['jobs'] = array();
while (list($id, $name, $function, $secteur, $ss_secteur, $sss_secteur, $description,
$w_adr1, $w_adr2, $w_adr3, $w_postcode, $w_city, $w_cityid,
FROM profile_phones
WHERE uid = {?} AND link_type = 'pro'
ORDER BY link_id",
- S::i('uid'));
+ $this->pid());
$i = 0;
$jobNb = count($this->values['jobs']);
while ($tel = $res->next()) {
protected function _saveData()
{
if ($this->changed['cv']) {
- XDB::execute("UPDATE auth_user_md5
+ XDB::execute("UPDATE profiles
SET cv = {?}
- WHERE user_id = {?}",
- $this->values['cv'], S::i('uid'));
+ WHERE pid = {?}",
+ $this->values['cv'], $this->pid());
}
if ($this->changed['corps']) {
rankid = {?}, corps_pub = {?}
WHERE uid = {?}",
$this->values['corps']['original'], $this->values['corps']['current'],
- $this->values['corps']['rank'], $this->values['corps']['pub'], S::i('uid'));
+ $this->values['corps']['rank'], $this->values['corps']['pub'], $this->pid());
}
}
public function _prepare(PlPage &$page, $id)
{
require_once "emails.combobox.inc.php";
- fill_email_combobox($page);
+ fill_email_combobox($page, $this->owner, $this->profile);
$res = XDB::query("SELECT id, name AS label
FROM profile_job_sector_enum");