Fix bad signature of fetch. The ref_ext is missing.

This commit is contained in:
Laurent Destailleur 2015-07-20 17:19:44 +02:00
parent f0ed7dac09
commit 2bebb869fb

View File

@ -376,11 +376,12 @@ class ActionComm extends CommonObject
/**
* Load object from database
*
* @param int $id Id of action to get
* @param string $ref Ref of action to get
* @return int <0 if KO, >0 if OK
* @param int $id Id of action to get
* @param string $ref Ref of action to get
* @param string $ref_ext Ref ext to get
* @return int <0 if KO, >0 if OK
*/
function fetch($id, $ref='')
function fetch($id, $ref='',$ref_ext='')
{
global $langs;
@ -404,11 +405,12 @@ class ActionComm extends CommonObject
$sql.= " s.nom as socname,";
$sql.= " u.firstname, u.lastname as lastname";
$sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as a ";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_actioncomm as c ON a.fk_action=c.id ";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_actioncomm as c ON a.fk_action=c.id ";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on u.rowid = a.fk_user_author";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on s.rowid = a.fk_soc";
$sql.= " WHERE ";
if ($ref) $sql.= " a.id=".$ref; // No field ref, we use id
if ($ref) $sql.= " a.id=".$ref; // No field ref, we use id
elseif ($ref_ext) $sql.= " a.ref_ext='".$this->db->escape($ref_ext)."'";
else $sql.= " a.id=".$id;
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);