Fix: missing dot
This commit is contained in:
parent
5c5663c5ae
commit
aa780ea33b
@ -223,7 +223,7 @@ class Deplacement extends CommonObject
|
||||
{
|
||||
$sql = "SELECT rowid, fk_user, type, fk_statut, km, fk_soc, dated, note_private, note_public, fk_projet, extraparams";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."deplacement";
|
||||
$sql.= " WHERE entity IN (".getEntity('deplacement', false)")";
|
||||
$sql.= " WHERE entity IN (".getEntity('deplacement', false).")";
|
||||
if ($ref) $sql.= " AND ref ='".$this->db->escape($ref)."'";
|
||||
else $sql.= " AND rowid = ".$id;
|
||||
|
||||
|
||||
@ -3964,7 +3964,7 @@ class Facture extends CommonInvoice
|
||||
function newCycle()
|
||||
{
|
||||
$sql = 'SELECT max(situation_cycle_ref) FROM ' . MAIN_DB_PREFIX . 'facture as f';
|
||||
$sql.= " WHERE f.entity in (".getEntity('facture', false)")";
|
||||
$sql.= " WHERE f.entity in (".getEntity('facture', false).")";
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
if ($resql->num_rows > 0)
|
||||
|
||||
@ -504,7 +504,7 @@ class Contrat extends CommonObject
|
||||
if ($ref)
|
||||
{
|
||||
$sql.= " WHERE ref='".$this->db->escape($ref)."'";
|
||||
$sql.= " AND entity IN (".getEntity('contract', false)")";
|
||||
$sql.= " AND entity IN (".getEntity('contract', false).")";
|
||||
}
|
||||
else $sql.= " WHERE rowid=".$id;
|
||||
|
||||
|
||||
@ -107,7 +107,7 @@ $sql.= ", ".MAIN_DB_PREFIX."contratdet as cd, ".MAIN_DB_PREFIX."contrat as c";
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= " WHERE cd.fk_contrat = c.rowid AND c.fk_soc = s.rowid";
|
||||
$sql.= " AND (cd.statut != 4 OR (cd.statut = 4 AND (cd.date_fin_validite is null or cd.date_fin_validite >= '".$db->idate($now)."')))";
|
||||
$sql.= " AND c.entity IN (".getEntity('contract', false)")";
|
||||
$sql.= " AND c.entity IN (".getEntity('contract', false).")";
|
||||
if ($user->societe_id) $sql.=' AND c.fk_soc = '.$user->societe_id;
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
$sql.= " GROUP BY cd.statut";
|
||||
@ -144,7 +144,7 @@ $sql.= ", ".MAIN_DB_PREFIX."contratdet as cd, ".MAIN_DB_PREFIX."contrat as c";
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= " WHERE cd.fk_contrat = c.rowid AND c.fk_soc = s.rowid";
|
||||
$sql.= " AND (cd.statut = 4 AND cd.date_fin_validite < '".$db->idate($now)."')";
|
||||
$sql.= " AND c.entity IN (".getEntity('contract', false)")";
|
||||
$sql.= " AND c.entity IN (".getEntity('contract', false).")";
|
||||
if ($user->societe_id) $sql.=' AND c.fk_soc = '.$user->societe_id;
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
$sql.= " GROUP BY cd.statut";
|
||||
@ -230,7 +230,7 @@ if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire)
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."contrat as c, ".MAIN_DB_PREFIX."societe as s";
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= " WHERE s.rowid = c.fk_soc";
|
||||
$sql.= " AND c.entity IN (".getEntity('contract', false)")";
|
||||
$sql.= " AND c.entity IN (".getEntity('contract', false).")";
|
||||
$sql.= " AND c.statut = 0";
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
if ($socid) $sql.= " AND c.fk_soc = ".$socid;
|
||||
@ -302,7 +302,7 @@ if (!$user->rights->societe->client->voir && !$socid) $sql.= " ".MAIN_DB_PREFIX.
|
||||
$sql.= " ".MAIN_DB_PREFIX."contrat as c";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."contratdet as cd ON c.rowid = cd.fk_contrat";
|
||||
$sql.= " WHERE c.fk_soc = s.rowid";
|
||||
$sql.= " AND c.entity IN (".getEntity('contract', false)")";
|
||||
$sql.= " AND c.entity IN (".getEntity('contract', false).")";
|
||||
$sql.= " AND c.statut > 0";
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
if ($socid) $sql.= " AND s.rowid = ".$socid;
|
||||
@ -372,7 +372,7 @@ $sql.= ", ".MAIN_DB_PREFIX."societe as s";
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."contratdet as cd";
|
||||
$sql.= ") LEFT JOIN ".MAIN_DB_PREFIX."product as p ON cd.fk_product = p.rowid";
|
||||
$sql.= " WHERE c.entity IN (".getEntity('contract', false)")";
|
||||
$sql.= " WHERE c.entity IN (".getEntity('contract', false).")";
|
||||
$sql.= " AND cd.fk_contrat = c.rowid";
|
||||
$sql.= " AND c.fk_soc = s.rowid";
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
@ -450,7 +450,7 @@ $sql.= ", ".MAIN_DB_PREFIX."societe as s";
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."contratdet as cd";
|
||||
$sql.= " ) LEFT JOIN ".MAIN_DB_PREFIX."product as p ON cd.fk_product = p.rowid";
|
||||
$sql.= " WHERE c.entity IN (".getEntity('contract', false)")";
|
||||
$sql.= " WHERE c.entity IN (".getEntity('contract', false).")";
|
||||
$sql.= " AND c.statut = 1";
|
||||
$sql.= " AND cd.statut = 0";
|
||||
$sql.= " AND cd.fk_contrat = c.rowid";
|
||||
@ -529,7 +529,7 @@ $sql.= ", ".MAIN_DB_PREFIX."societe as s";
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."contratdet as cd";
|
||||
$sql.= " ) LEFT JOIN ".MAIN_DB_PREFIX."product as p ON cd.fk_product = p.rowid";
|
||||
$sql.= " WHERE c.entity IN (".getEntity('contract', false)")";
|
||||
$sql.= " WHERE c.entity IN (".getEntity('contract', false).")";
|
||||
$sql.= " AND c.statut = 1";
|
||||
$sql.= " AND cd.statut = 4";
|
||||
$sql.= " AND cd.date_fin_validite < '".$db->idate($now)."'";
|
||||
|
||||
@ -4352,7 +4352,7 @@ class Form
|
||||
$TCurrency = array();
|
||||
|
||||
$sql = 'SELECT code FROM '.MAIN_DB_PREFIX.'multicurrency';
|
||||
$sql.= " WHERE entity IN ('".getEntity('mutlicurrency', false)"')";
|
||||
$sql.= " WHERE entity IN ('".getEntity('mutlicurrency', false)."')";
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
|
||||
@ -843,7 +843,7 @@ class FormMail extends Form
|
||||
$sql = "SELECT label, topic, content, content_lines, lang";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX.'c_email_templates';
|
||||
$sql.= " WHERE type_template='".$db->escape($type_template)."'";
|
||||
$sql.= " AND entity IN (".getEntity('c_email_templates', false)")";
|
||||
$sql.= " AND entity IN (".getEntity('c_email_templates', false).")";
|
||||
$sql.= " AND (fk_user is NULL or fk_user = 0 or fk_user = ".$user->id.")";
|
||||
if ($active >= 0) $sql.=" AND active = ".$active;
|
||||
if (is_object($outputlangs)) $sql.= " AND (lang = '".$outputlangs->defaultlang."' OR lang IS NULL OR lang = '')";
|
||||
@ -910,7 +910,7 @@ class FormMail extends Form
|
||||
$sql = "SELECT label, topic, content, lang";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX.'c_email_templates';
|
||||
$sql.= " WHERE type_template='".$this->db->escape($type_template)."'";
|
||||
$sql.= " AND entity IN (".getEntity('c_email_templates', false)")";
|
||||
$sql.= " AND entity IN (".getEntity('c_email_templates', false).")";
|
||||
$sql.= " AND (fk_user is NULL or fk_user = 0 or fk_user = ".$user->id.")";
|
||||
if (is_object($outputlangs)) $sql.= " AND (lang = '".$outputlangs->defaultlang."' OR lang IS NULL OR lang = '')";
|
||||
$sql.= $this->db->order("lang,label","ASC");
|
||||
@ -947,7 +947,7 @@ class FormMail extends Form
|
||||
$sql = "SELECT rowid, label, topic, content, content_lines, lang, position";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX.'c_email_templates';
|
||||
$sql.= " WHERE type_template='".$this->db->escape($type_template)."'";
|
||||
$sql.= " AND entity IN (".getEntity('c_email_templates', false)")";
|
||||
$sql.= " AND entity IN (".getEntity('c_email_templates', false).")";
|
||||
$sql.= " AND (fk_user is NULL or fk_user = 0 or fk_user = ".$user->id.")";
|
||||
if ($active >= 0) $sql.=" AND active = ".$active;
|
||||
if (is_object($outputlangs)) $sql.= " AND (lang = '".$outputlangs->defaultlang."' OR lang IS NULL OR lang = '')";
|
||||
|
||||
@ -1681,7 +1681,7 @@ class Project extends CommonObject
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on p.fk_soc = s.rowid";
|
||||
if (! $user->rights->societe->client->voir && ! $socid) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON sc.fk_soc = s.rowid";
|
||||
$sql.= " WHERE p.fk_statut = 1";
|
||||
$sql.= " AND p.entity IN (".getEntity('project', false)')';
|
||||
$sql.= " AND p.entity IN (".getEntity('project', false).')';
|
||||
if ($mine || ! $user->rights->projet->all->lire) $sql.= " AND p.rowid IN (".$projectsListId.")";
|
||||
// No need to check company, as filtering of projects must be done by getProjectsAuthorizedForUser
|
||||
//if ($socid || ! $user->rights->societe->client->voir) $sql.= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".$socid.")";
|
||||
|
||||
@ -1704,7 +1704,7 @@ class Task extends CommonObject
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on p.fk_soc = s.rowid";
|
||||
if (! $user->rights->societe->client->voir && ! $socid) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON sc.fk_soc = s.rowid";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."projet_task as t";
|
||||
$sql.= " WHERE p.entity IN (".getEntity('project', false)')';
|
||||
$sql.= " WHERE p.entity IN (".getEntity('project', false).')';
|
||||
$sql.= " AND p.fk_statut = 1";
|
||||
$sql.= " AND t.fk_projet = p.rowid";
|
||||
$sql.= " AND t.progress < 100"; // tasks to do
|
||||
|
||||
Loading…
Reference in New Issue
Block a user