mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-14 08:54:21 +01:00
FIX creation of tasks must hide closed project
This commit is contained in:
@@ -687,13 +687,13 @@ class Task extends CommonObject
|
||||
* @param int $socid Third party id
|
||||
* @param int $mode 0=Return list of tasks and their projects, 1=Return projects and tasks if exists
|
||||
* @param string $filteronproj Filter on project ref or label
|
||||
* @param string $filteronprojstatus Filter on project status
|
||||
* @param string $filteronprojstatus Filter on project status ('-1'=no filter, '0,1'=Draft+Validated only)
|
||||
* @param string $morewherefilter Add more filter into where SQL request (must start with ' AND ...')
|
||||
* @param string $filteronprojuser Filter on user that is a contact of project
|
||||
* @param string $filterontaskuser Filter on user assigned to task
|
||||
* @return array Array of tasks
|
||||
*/
|
||||
function getTasksArray($usert=null, $userp=null, $projectid=0, $socid=0, $mode=0, $filteronproj='', $filteronprojstatus=-1, $morewherefilter='',$filteronprojuser=0,$filterontaskuser=0)
|
||||
function getTasksArray($usert=null, $userp=null, $projectid=0, $socid=0, $mode=0, $filteronproj='', $filteronprojstatus='-1', $morewherefilter='',$filteronprojuser=0,$filterontaskuser=0)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
@@ -769,7 +769,7 @@ class Task extends CommonObject
|
||||
if ($socid) $sql.= " AND p.fk_soc = ".$socid;
|
||||
if ($projectid) $sql.= " AND p.rowid in (".$projectid.")";
|
||||
if ($filteronproj) $sql.= natural_search(array("p.ref", "p.title"), $filteronproj);
|
||||
if ($filteronprojstatus > -1) $sql.= " AND p.fk_statut IN (".$filteronprojstatus.")";
|
||||
if ($filteronprojstatus && $filteronprojstatus != '-1') $sql.= " AND p.fk_statut IN (".$filteronprojstatus.")";
|
||||
if ($morewherefilter) $sql.=$morewherefilter;
|
||||
$sql.= " ORDER BY p.ref, t.rang, t.dateo";
|
||||
|
||||
@@ -1828,10 +1828,10 @@ class Task extends CommonObject
|
||||
|
||||
// For external user, no check is done on company because readability is managed by public status of project and assignement.
|
||||
//$socid=$user->societe_id;
|
||||
|
||||
|
||||
$projectstatic = new Project($this->db);
|
||||
$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,0,1,$socid);
|
||||
|
||||
|
||||
// List of tasks (does not care about permissions. Filtering will be done later)
|
||||
$sql = "SELECT p.rowid as projectid, p.fk_statut as projectstatus,";
|
||||
$sql.= " t.rowid as taskid, t.progress as progress, t.fk_statut as status,";
|
||||
@@ -1850,7 +1850,7 @@ class Task extends CommonObject
|
||||
if ($socid) $sql.= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".$socid.")";
|
||||
// No need to check company, as filtering of projects must be done by getProjectsAuthorizedForUser
|
||||
// if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND ((s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id.") OR (s.rowid IS NULL))";
|
||||
|
||||
|
||||
//print $sql;
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
|
||||
Reference in New Issue
Block a user