Signed-off-by: Stéphane Jacob <sj@m4x.org>
}
$this->company = CompanyList::get($this->jobid);
if (is_null($this->company)) {
- $entreprise = ProfileValidate::get_typed_requests($this->pid, 'entreprise');
- $this->company = new Company(array('name' => $entreprise[$this->id]->name));
+ $entreprises = ProfileValidate::get_typed_requests($this->pid, 'entreprise');
+ foreach ($entreprises as $entreprise) {
+ if ($entreprise->id == $this->id) {
+ $this->company = new Company(array('name' => $entreprise->name));
+ }
+ }
}
}
{
$res = XDB::iterRow('SELECT data
FROM requests
- WHERE pid = {?} and type = {?}',
+ WHERE pid = {?} and type = {?}
+ ORDER BY stamp',
$pid, $type);
$array = array();
while (list($data) = $res->next()) {
$success = true;
foreach ($value as $key => $job) {
$job['name'] = trim($job['name']);
- if ($job['name'] == '' && $entreprise) {
+ if ($job['name'] == '' && $entreprise[$entr_val]->id == $key) {
$job['tmp_name'] = $entreprise[$entr_val]->name;
++$entr_val;
} else if ($job['name'] == '') {