forked from Wavyzz/dolibarr
Fix bug reported by scrutinizer
This commit is contained in:
@@ -640,16 +640,16 @@ class AdvanceTargetingMailing extends CommonObject
|
||||
$sqlwhere[]=$this->transformToSQL('t.firstname',$arrayquery['contact_firstname']);
|
||||
}
|
||||
if (!empty($arrayquery['contact_country']) && count($arrayquery['contact_country'])) {
|
||||
$sqlwhere[]= " (t.fk_pays IN (".$db->escape(implode(',',$arrayquery['contact_country']))."))";
|
||||
$sqlwhere[]= " (t.fk_pays IN (".$this->db->escape(implode(',',$arrayquery['contact_country']))."))";
|
||||
}
|
||||
if (!empty($arrayquery['contact_status']) && count($arrayquery['contact_status'])>0) {
|
||||
$sqlwhere[]= " (t.statut IN (".$db->escape(implode(',',$arrayquery['contact_status']))."))";
|
||||
$sqlwhere[]= " (t.statut IN (".$this->db->escape(implode(',',$arrayquery['contact_status']))."))";
|
||||
}
|
||||
if (!empty($arrayquery['contact_civility']) && count($arrayquery['contact_civility'])>0) {
|
||||
$sqlwhere[]= " (t.civility IN ('".$db->escape(implode("','",$arrayquery['contact_civility']))."'))";
|
||||
$sqlwhere[]= " (t.civility IN ('".$this->db->escape(implode("','",$arrayquery['contact_civility']))."'))";
|
||||
}
|
||||
if ($arrayquery['contact_no_email']!='') {
|
||||
$sqlwhere[]= " (t.no_email='".$db->escape($arrayquery['contact_no_email'])."')";
|
||||
$sqlwhere[]= " (t.no_email='".$this->db->escape($arrayquery['contact_no_email'])."')";
|
||||
}
|
||||
if ($arrayquery['contact_update_st_dt']!='') {
|
||||
$sqlwhere[]= " (t.tms >= '".$this->db->idate($arrayquery['contact_update_st_dt'])."' AND t.tms <= '".$this->db->idate($arrayquery['contact_update_end_dt'])."')";
|
||||
|
||||
@@ -115,14 +115,14 @@ class FormProduct
|
||||
$sql.= " WHERE e.entity IN (".getEntity('stock').")";
|
||||
if (count($warehouseStatus))
|
||||
{
|
||||
$sql.= " AND e.statut IN (".$db->escape(implode(',',$warehouseStatus)).")";
|
||||
$sql.= " AND e.statut IN (".$this->db->escape(implode(',',$warehouseStatus)).")";
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql.= " AND e.statut = 1";
|
||||
}
|
||||
|
||||
if(!empty($exclude)) $sql.= ' AND e.rowid NOT IN('.$db->escape(implode(',', $exclude)).')';
|
||||
if(!empty($exclude)) $sql.= ' AND e.rowid NOT IN('.$this->db->escape(implode(',', $exclude)).')';
|
||||
|
||||
if ($sumStock && empty($fk_product)) $sql.= " GROUP BY e.rowid, e.label, e.description, e.fk_parent";
|
||||
$sql.= " ORDER BY e.label";
|
||||
|
||||
@@ -3750,7 +3750,7 @@ class Product extends CommonObject
|
||||
$sql.= " WHERE w.entity IN (".getEntity('stock').")";
|
||||
$sql.= " AND w.rowid = ps.fk_entrepot";
|
||||
$sql.= " AND ps.fk_product = ".$this->id;
|
||||
if ($conf->global->ENTREPOT_EXTRA_STATUS && count($warehouseStatus)) $sql.= " AND w.statut IN (".$db->escape(implode(',',$warehouseStatus)).")";
|
||||
if ($conf->global->ENTREPOT_EXTRA_STATUS && count($warehouseStatus)) $sql.= " AND w.statut IN (".$this->db->escape(implode(',',$warehouseStatus)).")";
|
||||
|
||||
dol_syslog(get_class($this)."::load_stock", LOG_DEBUG);
|
||||
$result = $this->db->query($sql);
|
||||
|
||||
Reference in New Issue
Block a user