Merge branch '3.7' of git@github.com:Dolibarr/dolibarr.git into 3.7

This commit is contained in:
Laurent Destailleur 2015-03-28 17:18:10 +01:00
commit 3f5fe432e7
2 changed files with 6 additions and 3 deletions

View File

@ -413,7 +413,8 @@ class ActionComm extends CommonObject
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
if ($resql) if ($resql)
{ {
if ($this->db->num_rows($resql)) $num=$this->db->num_rows($resql);
if ($num)
{ {
$obj = $this->db->fetch_object($resql); $obj = $this->db->fetch_object($resql);
@ -469,13 +470,15 @@ class ActionComm extends CommonObject
$this->elementtype = $obj->elementtype; $this->elementtype = $obj->elementtype;
} }
$this->db->free($resql); $this->db->free($resql);
return 1;
} }
else else
{ {
$this->error=$this->db->lasterror(); $this->error=$this->db->lasterror();
return -1; return -1;
} }
return $num;
} }

View File

@ -766,7 +766,7 @@ class ExtraFields
$sqlwhere.= ' WHERE 1'; $sqlwhere.= ' WHERE 1';
} }
if (in_array($InfoFieldList[0],array('tablewithentity'))) $sqlwhere.= ' AND entity = '.$conf->entity; // Some tables may have field, some other not. For the moment we disable it. if (in_array($InfoFieldList[0],array('tablewithentity'))) $sqlwhere.= ' AND entity = '.$conf->entity; // Some tables may have field, some other not. For the moment we disable it.
//$sql.=preg_replace('/^ AND /','',$sqlwhere); $sql.=$sqlwhere;
//print $sql; //print $sql;
dol_syslog(get_class($this).'::showInputField type=sellist', LOG_DEBUG); dol_syslog(get_class($this).'::showInputField type=sellist', LOG_DEBUG);