Merge pull request #6950 from defrance/patch-13

Additionnal filter on getProjectsAuthorizedForUser
This commit is contained in:
Laurent Destailleur 2017-06-06 11:10:05 +02:00 committed by GitHub
commit 6a82d9e656

View File

@ -1095,9 +1095,10 @@ class Project extends CommonObject
* @param int $mode 0=All project I have permission on (assigned to me and public), 1=Projects assigned 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
* @param string $filter additionnal filter on project (statut, ref, ...)
* @return array or string Array of projects id, or string with projects id separated with ","
*/
function getProjectsAuthorizedForUser($user, $mode=0, $list=0, $socid=0)
function getProjectsAuthorizedForUser($user, $mode=0, $list=0, $socid=0, $filter='')
{
$projects = array();
$temp = array();
@ -1149,6 +1150,8 @@ class Project extends CommonObject
{
// No filter. Use this if user has permission to see all project
}
$sql.= $filter;
//print $sql;
$resql = $this->db->query($sql);