Fix: Bad test onto project list id

This commit is contained in:
Laurent Destailleur 2013-01-02 15:12:46 +01:00
parent cd6e3464db
commit 380d036d5c
2 changed files with 3 additions and 3 deletions

View File

@ -183,7 +183,7 @@ function select_projects($socid=-1, $selected='', $htmlname='projectid', $maxlen
$sql = 'SELECT p.rowid, p.ref, p.title, p.fk_soc, p.fk_statut, p.public';
$sql.= ' FROM '.MAIN_DB_PREFIX .'projet as p';
$sql.= " WHERE p.entity = ".$conf->entity;
if ($projectsListId) $sql.= " AND p.rowid IN (".$projectsListId.")";
if ($projectsListId !== false) $sql.= " AND p.rowid IN (".$projectsListId.")";
if ($socid == 0) $sql.= " AND (p.fk_soc=0 OR p.fk_soc IS NULL)";
$sql.= " ORDER BY p.title ASC";

View File

@ -847,7 +847,7 @@ class Project extends CommonObject
* @param int $mode 0=All project I have permission on, 1=Projects affected to me only, 2=Will return list of all projects with no test on contacts
* @param int $list 0=Return array,1=Return string list
* @param int $socid 0=No filter on third party, id of third party
* @return array Array of projects
* @return array or string Array of projects id, or string with projects id separated with ","
*/
function getProjectsAuthorizedForUser($user, $mode=0, $list=0, $socid=0)
{
@ -910,7 +910,7 @@ class Project extends CommonObject
if ($list)
{
if (empty($temp)) return 0;
if (empty($temp)) return '0';
$result = implode(',', $temp);
return $result;
}