diff --git a/htdocs/comm/action/index.php3 b/htdocs/comm/action/index.php3 index ac874682520..8ee42565e53 100644 --- a/htdocs/comm/action/index.php3 +++ b/htdocs/comm/action/index.php3 @@ -125,7 +125,7 @@ if ($socid) { print_barre_liste("Liste des actions commerciales effectuées sur " . $societe->nom,$page, $PHP_SELF); $sql = "SELECT a.id,".$db->pdate("a.datea")." as da, c.libelle, u.code, a.note, u.name, u.firstname "; - $sql .= " FROM actioncomm as a, c_actioncomm as c, llx_user as u"; + $sql .= " FROM llx_actioncomm as a, c_actioncomm as c, llx_user as u"; $sql .= " WHERE a.fk_soc = $socid AND c.id=a.fk_action AND a.fk_user_author = u.rowid"; if ($type) { @@ -167,8 +167,8 @@ else print_barre_liste("Liste des actions commerciales effectuées",$page, $PHP_SELF); - $sql = "SELECT s.nom as societe, s.idp as socidp,a.id,".$db->pdate("a.datea")." as da, a.datea, c.libelle, u.code, a.fk_contact "; - $sql .= " FROM actioncomm as a, c_actioncomm as c, societe as s, llx_user as u"; + $sql = "SELECT s.nom as llx_societe, s.idp as socidp,a.id,".$db->pdate("a.datea")." as da, a.datea, c.libelle, u.code, a.fk_contact "; + $sql .= " FROM llx_actioncomm as a, c_actioncomm as c, llx_societe as s, llx_user as u"; $sql .= " WHERE a.fk_soc = s.idp AND c.id=a.fk_action AND a.fk_user_author = u.rowid"; if ($type) { diff --git a/htdocs/comm/contact.php3 b/htdocs/comm/contact.php3 index a77a88e1d2b..3d8b72e1bb9 100644 --- a/htdocs/comm/contact.php3 +++ b/htdocs/comm/contact.php3 @@ -58,7 +58,7 @@ print_barre_liste("Liste des contacts",$page, $PHP_SELF,"",$sortfield,$sortorder $sql = "SELECT s.idp, s.nom, st.libelle as stcomm, p.idp as cidp, p.name, p.firstname, p.email, p.phone "; -$sql .= "FROM societe as s, socpeople as p, c_stcomm as st WHERE s.fk_stcomm = st.id AND s.idp = p.fk_soc"; +$sql .= "FROM llx_societe as s, llx_socpeople as p, c_stcomm as st WHERE s.fk_stcomm = st.id AND s.idp = p.fk_soc"; if (strlen($stcomm)) // statut commercial { diff --git a/htdocs/comm/fiche.php3 b/htdocs/comm/fiche.php3 index ce1469ff986..eab65498613 100644 --- a/htdocs/comm/fiche.php3 +++ b/htdocs/comm/fiche.php3 @@ -50,7 +50,7 @@ if ($action == 'recontact') { } if ($action == 'note') { - $sql = "UPDATE societe SET note='$note' WHERE idp=$socid"; + $sql = "UPDATE llx_societe SET note='$note' WHERE idp=$socid"; $result = $db->query($sql); } @@ -61,7 +61,7 @@ if ($action == 'stcomm') { $result = @$db->query($sql); if ($result) { - $sql = "UPDATE societe SET fk_stcomm=$stcommid WHERE idp=$socid"; + $sql = "UPDATE llx_societe SET fk_stcomm=$stcommid WHERE idp=$socid"; $result = $db->query($sql); } else { $errmesg = "ERREUR DE DATE !"; @@ -69,7 +69,7 @@ if ($action == 'stcomm') { } if ($actioncommid) { - $sql = "INSERT INTO actioncomm (datea, fk_action, fk_soc, fk_user_author) VALUES ('$dateaction',$actioncommid,$socid,'" . $user->id . "')"; + $sql = "INSERT INTO llx_actioncomm (datea, fk_action, fk_soc, fk_user_author) VALUES ('$dateaction',$actioncommid,$socid,'" . $user->id . "')"; $result = @$db->query($sql); if (!$result) { @@ -85,7 +85,7 @@ if ($action == 'stcomm') { */ if ($mode == 'search') { if ($mode-search == 'soc') { - $sql = "SELECT s.idp FROM societe as s "; + $sql = "SELECT s.idp FROM llx_societe as s "; $sql .= " WHERE lower(s.nom) like '%".strtolower($socname)."%'"; } @@ -114,7 +114,7 @@ if ($socid > 0) { $societe = new Societe($db, $socid); - $sql = "SELECT s.idp, s.nom, ".$db->pdate("s.datec")." as dc, s.tel, s.fax, st.libelle as stcomm, s.fk_stcomm, s.url,s.address,s.cp,s.ville, s.note, t.libelle as typent, e.libelle as effectif, s.siren, s.prefix_comm, s.services,s.parent, s.description FROM societe as s, c_stcomm as st, c_typent as t, c_effectif as e "; + $sql = "SELECT s.idp, s.nom, ".$db->pdate("s.datec")." as dc, s.tel, s.fax, st.libelle as stcomm, s.fk_stcomm, s.url,s.address,s.cp,s.ville, s.note, t.libelle as typent, e.libelle as effectif, s.siren, s.prefix_comm, s.services,s.parent, s.description FROM llx_societe as s, c_stcomm as st, c_typent as t, c_effectif as e "; $sql .= " WHERE s.fk_stcomm=st.id AND s.fk_typent = t.id AND s.fk_effectif = e.id"; if ($to == 'next') { @@ -201,7 +201,7 @@ if ($socid > 0) { print ''; $sql = "SELECT s.nom, s.idp, p.rowid as propalid, p.price, p.ref, p.remise, ".$db->pdate("p.datep")." as dp, c.label as statut, c.id as statutid"; - $sql .= " FROM societe as s, llx_propal as p, c_propalst as c WHERE p.fk_soc = s.idp AND p.fk_statut = c.id"; + $sql .= " FROM llx_societe as s, llx_propal as p, c_propalst as c WHERE p.fk_soc = s.idp AND p.fk_statut = c.id"; $sql .= " AND s.idp = $objsoc->idp ORDER BY p.datep DESC"; if ( $db->query($sql) ) { @@ -292,7 +292,7 @@ if ($socid > 0) { print ""; print ""; - $sql = "SELECT p.idp, p.name, p.firstname, p.poste, p.phone, p.fax, p.email, p.note FROM socpeople as p WHERE p.fk_soc = $objsoc->idp ORDER by p.datec"; + $sql = "SELECT p.idp, p.name, p.firstname, p.poste, p.phone, p.fax, p.email, p.note FROM llx_socpeople as p WHERE p.fk_soc = $objsoc->idp ORDER by p.datec"; $result = $db->query($sql); $i = 0 ; $num = $db->num_rows(); $tag = True; while ($i < $num) @@ -334,7 +334,7 @@ if ($socid > 0) { print '"; print "\n"; $sql = "SELECT count(*) FROM llx_propal WHERE fk_statut = 0"; -if (valeur($sql)) { +if (valeur($sql)) +{ $var=!$var; print ""; } $sql = "SELECT count(*) FROM llx_propal WHERE fk_statut = 1"; -if (valeur($sql)) { +if (valeur($sql)) +{ $var=!$var; print ""; } @@ -88,11 +92,12 @@ print "
FaxEmailidp&action=addcontact\">Ajouter
'; $sql = "SELECT a.id, ".$db->pdate("a.datea")." as da, c.libelle, u.code, a.propalrowid, a.fk_user_author, fk_contact, u.rowid "; - $sql .= " FROM actioncomm as a, c_actioncomm as c, llx_user as u "; + $sql .= " FROM llx_actioncomm as a, c_actioncomm as c, llx_user as u "; $sql .= " WHERE a.fk_soc = $objsoc->idp "; $sql .= " AND u.rowid = a.fk_user_author"; $sql .= " AND c.id=a.fk_action AND a.percent < 100"; @@ -410,7 +410,7 @@ if ($socid > 0) { print ''; $sql = "SELECT a.id, ".$db->pdate("a.datea")." as da, c.libelle, u.code, a.propalrowid, a.fk_user_author, fk_contact, u.rowid "; - $sql .= " FROM actioncomm as a, c_actioncomm as c, llx_user as u "; + $sql .= " FROM llx_actioncomm as a, c_actioncomm as c, llx_user as u "; $sql .= " WHERE a.fk_soc = $objsoc->idp "; $sql .= " AND u.rowid = a.fk_user_author"; $sql .= " AND c.id=a.fk_action AND a.percent = 100"; diff --git a/htdocs/comm/index.php3 b/htdocs/comm/index.php3 index ac27e7475f2..e498f0c87d4 100644 --- a/htdocs/comm/index.php3 +++ b/htdocs/comm/index.php3 @@ -1,5 +1,5 @@ +/* Copyright (C) 2001-2003 Rodolphe Quiedeville * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -44,14 +44,16 @@ function valeur($sql) $db = new Db(); -if ($action == 'add_bookmark') { +if ($action == 'add_bookmark') +{ $sql = "INSERT INTO llx_bookmark (fk_soc, dateb, fk_user) VALUES ($socidp, now(),".$user->id.");"; if (! $db->query($sql) ) { print $db->error(); } } -if ($action == 'del_bookmark') { +if ($action == 'del_bookmark') +{ $sql = "DELETE FROM llx_bookmark WHERE rowid=$bid"; $result = $db->query($sql); } @@ -69,13 +71,15 @@ print "Propositions commerciales
Brouillons".valeur($sql)."
Ouvertes".valeur($sql)."

"; */ $sql = "SELECT s.idp, s.nom,b.rowid as bid"; -$sql .= " FROM societe as s, llx_bookmark as b"; +$sql .= " FROM llx_societe as s, llx_bookmark as b"; $sql .= " WHERE b.fk_soc = s.idp AND b.fk_user = ".$user->id; $sql .= " ORDER BY lower(s.nom) ASC"; -if ( $db->query($sql) ) { +if ( $db->query($sql) ) +{ $num = $db->num_rows(); $i = 0; @@ -101,16 +106,17 @@ if ( $db->query($sql) ) { print "Bookmark"; print "\n"; - while ($i < $num) { - $obj = $db->fetch_object( $i); - $var = !$var; - print ""; - print ''.$obj->nom.''; - print ''; - print ''; - print ''; - $i++; - } + while ($i < $num) + { + $obj = $db->fetch_object( $i); + $var = !$var; + print ""; + print ''.$obj->nom.''; + print ''; + print ''; + print ''; + $i++; + } print ''; } /* @@ -121,7 +127,7 @@ if ( $db->query($sql) ) { print ''; $sql = "SELECT a.id, ".$db->pdate("a.datea")." as da, c.libelle, a.fk_user_author, a.fk_contact, p.name, s.nom as sname"; -$sql .= " FROM actioncomm as a, c_actioncomm as c, socpeople as p, societe as s"; +$sql .= " FROM llx_actioncomm as a, c_actioncomm as c, llx_socpeople as p, llx_societe as s"; $sql .= " WHERE c.id=a.fk_action AND a.percent < 100 AND a.fk_user_action = $user->id AND a.fk_contact = p.idp AND p.fk_soc = s.idp"; $sql .= " ORDER BY a.datea DESC"; diff --git a/htdocs/comm/people.php3 b/htdocs/comm/people.php3 index 7958c8df3a8..31e1cd61fde 100644 --- a/htdocs/comm/people.php3 +++ b/htdocs/comm/people.php3 @@ -1,5 +1,5 @@ +/* Copyright (C) 2001-2003 Rodolphe Quiedeville * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -36,7 +36,7 @@ if ($action == 'add') if (strlen(trim($name)) + strlen(trim($firstname)) > 0) { - $sql = "INSERT INTO socpeople (datec, fk_soc,name, firstname, poste, phone,fax,email) "; + $sql = "INSERT INTO llx_socpeople (datec, fk_soc,name, firstname, poste, phone,fax,email) "; $sql .= " VALUES (now(),$socid,'$name','$firstname','$poste','$phone','$fax','$email')"; $result = $db->query($sql); if ($result) @@ -69,18 +69,17 @@ if ($action == 'update') } } -llxHeader(); +/* + * + * + */ -if ($page == -1) { $page = 0 ; } -$limit = 26; -$offset = $limit * $page ; -$pageprev = $page - 1; -$pagenext = $page + 1; +llxHeader(); if ($socid > 0) { - $sql = "SELECT s.idp, s.nom, ".$db->pdate("s.datec")." as dc, s.tel, s.fax, st.libelle as stcomm, s.fk_stcomm, s.url,s.cp,s.ville, s.note FROM societe as s, c_stcomm as st "; + $sql = "SELECT s.idp, s.nom, ".$db->pdate("s.datec")." as dc, s.tel, s.fax, st.libelle as stcomm, s.fk_stcomm, s.url,s.cp,s.ville, s.note FROM llx_societe as s, c_stcomm as st "; $sql .= " WHERE s.fk_stcomm=st.id"; if ($to == 'next') @@ -134,7 +133,7 @@ if ($socid > 0) print "FaxEmail"; $sql = "SELECT p.name, p.firstname, p.poste, p.phone, p.fax, p.email "; - $sql .= " FROM socpeople as p WHERE p.fk_soc = $objsoc->idp"; + $sql .= " FROM llx_socpeople as p WHERE p.fk_soc = $objsoc->idp"; if ($contactid) { @@ -190,7 +189,7 @@ if ($socid > 0) if ($action == 'editcontact') { $sql = "SELECT p.idp, p.name, p.firstname, p.poste, p.phone, p.fax, p.email, p.note"; - $sql .= " FROM socpeople as p WHERE p.idp = $contactid"; + $sql .= " FROM llx_socpeople as p WHERE p.idp = $contactid"; $result = $db->query($sql); $num = $db->num_rows(); @@ -226,7 +225,7 @@ if ($socid > 0) print "FaxEmail"; $sql = "SELECT a.id, ".$db->pdate("a.datea")." as da, c.libelle, u.code, a.propalrowid, a.fk_user_author, fk_contact, u.rowid "; - $sql .= " FROM actioncomm as a, c_actioncomm as c, llx_user as u "; + $sql .= " FROM llx_actioncomm as a, c_actioncomm as c, llx_user as u "; $sql .= " WHERE a.fk_soc = $objsoc->idp "; $sql .= " AND u.rowid = a.fk_user_author"; $sql .= " AND c.id=a.fk_action "; diff --git a/htdocs/contact.class.php3 b/htdocs/contact.class.php3 index a9500a69951..e2ab336fa08 100644 --- a/htdocs/contact.class.php3 +++ b/htdocs/contact.class.php3 @@ -51,7 +51,7 @@ class Contact { $sql = "SELECT c.idp, c.idp, c.name, c.firstname"; - $sql .= " FROM socpeople as c"; + $sql .= " FROM llx_socpeople as c"; $sql .= " WHERE c.idp = $id"; $result = $this->db->query($sql); @@ -81,12 +81,17 @@ class Contact } } + /* + * + * + */ + Function update($id) { $this->email = trim($this->email); - $sql = "UPDATE socpeople set name='$this->name', firstname='$this->firstname', poste='$this->poste', phone='$this->phone',fax='$this->fax',email='$this->email', note='$this->note'"; + $sql = "UPDATE llx_socpeople set name='$this->name', firstname='$this->firstname', poste='$this->poste', phone='$this->phone',fax='$this->fax',email='$this->email', note='$this->note'"; $sql .= " WHERE idp=$id"; $result = $this->db->query($sql);