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

Fix: move sql in dao class

parent 36223de5
No related branches found
No related tags found
No related merge requests found
......@@ -401,15 +401,15 @@ class ActionComm extends CommonObject
$sql = "SELECT a.id";
$sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as a";
$sql.= " WHERE a.entity = ".$conf->entity;
if ($socid) $sql.= " AND a.fk_soc = ".$socid;
if ($elementtype!='')
if (! empty($socid)) $sql.= " AND a.fk_soc = ".$socid;
if (! empty($elementtype))
{
if ($elementtype == 'project') $sql.= ' AND a.fk_project = '.$fk_element;
else $sql.= " AND a.fk_element = ".$fk_element." AND a.elementtype = '".$elementtype."'";
}
if ($filter) $sql.= $filter;
if (! empty($filter)) $sql.= $filter;
dol_syslog("ActionComm::fetchAll sql=".$sql);
dol_syslog("ActionComm::getActions sql=".$sql);
$resql=$this->db->query($sql);
if ($resql)
{
......
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