Skip to content
Snippets Groups Projects
Commit 0ded40ad authored by Regis Houssin's avatar Regis Houssin
Browse files

Fix: add function to sort project authorized for a user

parent a3c0f439
No related branches found
No related tags found
No related merge requests found
......@@ -107,8 +107,13 @@ else
print "</table>";
print '</td><td width="70%" valign="top" class="notopnoleft">';
//$result = $projectstatic->getProjectsAuthorizedForUser($user);
//var_dump($result);
$projectsIdArray=array();
$projectsListArray = $projectstatic->getProjectsAuthorizedForUser($user);
foreach ($projectsListArray as $key => $value)
{
$projectsIdArray[] = $key;
}
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
......@@ -121,6 +126,7 @@ $sql.= ", s.nom, s.rowid as socid";
$sql.= " FROM ".MAIN_DB_PREFIX."projet as p";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on p.fk_soc = s.rowid";
$sql.= " WHERE p.entity = ".$conf->entity;
$sql.= " AND p.rowid IN (".implode(',',$projectsIdArray).")";
if ($socid) $sql.= " AND s.rowid = ".$socid;
$sql.= " GROUP BY s.nom, s.rowid";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment