Skip to content

Commit

Permalink
FIX missing entity filter
Browse files Browse the repository at this point in the history
  • Loading branch information
hregis committed Oct 29, 2018
1 parent 04f80f0 commit 31497e8
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions htdocs/projet/class/project.class.php
Expand Up @@ -529,11 +529,11 @@ function get_element_list($type, $tablename, $datefieldname='', $dates='', $date

if ($type == 'agenda')
{
$sql = "SELECT id as rowid FROM " . MAIN_DB_PREFIX . "actioncomm WHERE fk_project IN (". $ids .")";
$sql = "SELECT id as rowid FROM " . MAIN_DB_PREFIX . "actioncomm WHERE fk_project IN (". $ids .") AND entity IN (".getEntity('agenda').")";
}
elseif ($type == 'expensereport')
{
$sql = "SELECT ed.rowid FROM " . MAIN_DB_PREFIX . "expensereport as e, " . MAIN_DB_PREFIX . "expensereport_det as ed WHERE e.rowid = ed.fk_expensereport AND ed.fk_projet IN (". $ids .")";
$sql = "SELECT ed.rowid FROM " . MAIN_DB_PREFIX . "expensereport as e, " . MAIN_DB_PREFIX . "expensereport_det as ed WHERE e.rowid = ed.fk_expensereport AND ed.fk_projet IN (". $ids .") AND entity IN (".getEntity('expensereport').")";
}
elseif ($type == 'project_task')
{
Expand All @@ -545,11 +545,11 @@ function get_element_list($type, $tablename, $datefieldname='', $dates='', $date
}
elseif ($type == 'stock_mouvement')
{
$sql = 'SELECT ms.rowid, ms.fk_user_author as fk_user FROM ' . MAIN_DB_PREFIX . "stock_mouvement as ms WHERE ms.origintype = 'project' AND ms.fk_origin IN (". $ids .") AND ms.type_mouvement = 1";
$sql = 'SELECT ms.rowid, ms.fk_user_author as fk_user FROM ' . MAIN_DB_PREFIX . "stock_mouvement as ms WHERE ms.origintype = 'project' AND ms.fk_origin IN (". $ids .") AND ms.type_mouvement = 1";
}
else
{
$sql = "SELECT rowid FROM " . MAIN_DB_PREFIX . $tablename." WHERE fk_projet IN (". $ids .")";
$sql = "SELECT rowid FROM " . MAIN_DB_PREFIX . $tablename." WHERE fk_projet IN (". $ids .") AND entity IN (".getEntity($type).")";
}

if ($dates > 0)
Expand Down Expand Up @@ -723,10 +723,10 @@ function delete($user, $notrigger=0)
return -1;
}
}

/**
* Delete tasks with no children first, then task with children recursively
*
*
* @param User $user User
* @return int <0 if KO, 1 if OK
*/
Expand Down Expand Up @@ -754,7 +754,7 @@ function deleteTasks($user)
{
if (count($this->lines)) $this->deleteTasks($this->lines);
}

return 1;
}

Expand Down

0 comments on commit 31497e8

Please sign in to comment.