X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Femails.combobox.inc.php;h=7626b33fc4beab0358fcd79deed170737c5e2fc8;hb=b270577e919c58455a3629a4d9d61bd38ea49e11;hp=546063bbe64640a409e03481dacaa9f3a55242c2;hpb=5660032ac785d410f90e3f5b0d6948dc90b0cfea;p=platal.git diff --git a/include/emails.combobox.inc.php b/include/emails.combobox.inc.php index 546063b..7626b33 100644 --- a/include/emails.combobox.inc.php +++ b/include/emails.combobox.inc.php @@ -1,6 +1,6 @@ id()); - $email_directory = $res->fetchOneCell(); + $email_directory = $profile->email_directory; if ($email_directory) { $page->assign('email_directory', $email_directory); list($alias, $domain) = explode('@', $email_directory); @@ -43,6 +39,22 @@ function fill_email_combobox(PlPage& $page, $user = null, $profile = null) $email_type = NULL; $alias = $domain = ''; } + + $res = XDB::query( + "SELECT email + FROM profile_job + WHERE pid = {?}", $profile->id()); + $res = $res->fetchAllAssoc(); + $pro = array(); + foreach ($res as $res_it) { + if ($res_it['email'] != '') { + $pro[] = $res_it['email']; + if ($email_directory == $res_it['email']) { + $email_type = "pro"; + } + } + } + $page->assign('list_email_pro', $pro); } if ($user) { @@ -58,7 +70,7 @@ function fill_email_combobox(PlPage& $page, $user = null, $profile = null) $res = XDB::query( "SELECT alias FROM aliases - WHERE id={?} AND (type='a_vie' OR type='alias')", $user->id()); + WHERE uid={?} AND (type='a_vie' OR type='alias')", $user->id()); $res = $res->fetchAllAssoc(); $page->assign('list_email_X', $res); if (($domain == $globals->mail->domain) || ($domain == $globals->mail->domain2)) { @@ -81,24 +93,7 @@ function fill_email_combobox(PlPage& $page, $user = null, $profile = null) } } $page->assign('list_email_redir', $redir); - - $res = XDB::query( - "SELECT email - FROM profile_job - WHERE uid = {?}", $user->id()); - $res = $res->fetchAllAssoc(); - $pro = array(); - foreach ($res as $res_it) { - if ($res_it['email'] != '') { - $pro[] = $res_it['email']; - if ($email_directory == $res_it['email']) { - $email_type = "pro"; - } - } - } - $page->assign('list_email_pro', $pro); $page->assign('email_type', $email_type); - } else { $page->assign('list_email_X', array()); $page->assign('list_email_redir', array());