diff --git a/htdocs/accountancy/class/accountancycategory.class.php b/htdocs/accountancy/class/accountancycategory.class.php index 27254ef31d1..5700400db5d 100644 --- a/htdocs/accountancy/class/accountancycategory.class.php +++ b/htdocs/accountancy/class/accountancycategory.class.php @@ -688,7 +688,7 @@ class AccountancyCategory // extends CommonObject * Return list of personalized groups that are active * * @param int $categorytype -1=All, 0=Only non computed groups, 1=Only computed groups - * @return array Array of groups + * @return array|int Array of groups or -1 if error */ public function getCats($categorytype=-1) { @@ -745,7 +745,7 @@ class AccountancyCategory // extends CommonObject * * @param int $cat_id Id if personalized accounting group/category * @param string $predefinedgroupwhere Sql criteria filter to select accounting accounts - * @return array Array of accounting accounts + * @return array|int Array of accounting accounts or -1 if error */ public function getCptsCat($cat_id, $predefinedgroupwhere='') { diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 22eba559d10..f8a57abc769 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1151,8 +1151,8 @@ abstract class CommonObject $sql.= " ".MAIN_DB_PREFIX."c_type_contact as tc"; $sql.= " WHERE ec.element_id = ".$id; $sql.= " AND ec.fk_socpeople = c.rowid"; - if ($source == 'internal') $sql.= " AND c.entity IN (0,".$conf->entity.")"; - if ($source == 'external') $sql.= " AND c.entity IN (".getEntity('socpeople').")"; + if ($source == 'internal') $sql.= " AND c.entity IN (".getEntity('user').")"; + if ($source == 'external') $sql.= " AND c.entity IN (".getEntity('societe').")"; $sql.= " AND ec.fk_c_type_contact = tc.rowid"; $sql.= " AND tc.element = '".$element."'"; $sql.= " AND tc.source = '".$source."'"; diff --git a/htdocs/core/modules/modAgenda.class.php b/htdocs/core/modules/modAgenda.class.php index 8ff98acc8c8..30a606bb7c9 100644 --- a/htdocs/core/modules/modAgenda.class.php +++ b/htdocs/core/modules/modAgenda.class.php @@ -89,7 +89,7 @@ class modAgenda extends DolibarrModules $resql = $this->db->query($sqlreadactions); if ($resql) { - while ($obj = $this->db->fetch_object($sqlreadactions)) + while ($obj = $this->db->fetch_object($resql)) { //if (preg_match('/_CREATE$/',$obj->code) && (! in_array($obj->code, array('COMPANY_CREATE','PRODUCT_CREATE','TASK_CREATE')))) continue; // We don't track such events (*_CREATE) by default, we prefer validation (except thirdparty/product/task creation because there is no validation). if (preg_match('/^TASK_/',$obj->code)) continue; // We don't track such events by default.