mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Prefix en dur "llx_" remplac par constante "MAIN_DB_PREFIX".
This commit is contained in:
parent
e49ab26935
commit
9bfd7535e8
|
|
@ -27,7 +27,7 @@ llxHeader();
|
|||
if ($action == 'add') {
|
||||
$author = $GLOBALS["REMOTE_USER"];
|
||||
|
||||
$sql = "INSERT INTO llx_voyage (date_depart, date_arrivee, amount, depart, arrivee, fk_reduc, reduction) ";
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."voyage (date_depart, date_arrivee, amount, depart, arrivee, fk_reduc, reduction) ";
|
||||
$sql .= " VALUES ('$date_depart','$date_arrivee',$amount,'$depart','$arrivee',$reducid, $reduc);";
|
||||
|
||||
$result = $db->query($sql);
|
||||
|
|
@ -41,7 +41,7 @@ if ($action == 'add') {
|
|||
|
||||
}
|
||||
if ($action == 'del') {
|
||||
/* $sql = "DELETE FROM llx_voyage WHERE rowid = $rowid";
|
||||
/* $sql = "DELETE FROM ".MAIN_DB_PREFIX."voyage WHERE rowid = $rowid";
|
||||
*$result = $db->query($sql);
|
||||
*/
|
||||
}
|
||||
|
|
@ -57,7 +57,7 @@ print_titre("Noms de domaines internet");
|
|||
|
||||
|
||||
$sql = "SELECT label ";
|
||||
$sql .= " FROM llx_domain ORDER BY label ASC";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."domain ORDER BY label ASC";
|
||||
|
||||
$result = $db->query($sql);
|
||||
if ($result) {
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ if ($_GET["id"] > 0)
|
|||
echo '<table class="liste" width="100%" cellspacing="0" cellpadding="3">';
|
||||
|
||||
$sql = "SELECT l.fk_product, l.description, l.price, l.qty, l.rowid, l.tva_tx, l.remise_percent, l.subprice";
|
||||
$sql .= " FROM llx_commandedet as l LEFT JOIN llx_product as p ON (p.rowid = l.fk_product) WHERE l.fk_commande = ".$commande->id." AND p.fk_product_type <> 1 ORDER BY l.rowid";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."commandedet as l LEFT JOIN ".MAIN_DB_PREFIX."product as p ON (p.rowid = l.fk_product) WHERE l.fk_commande = ".$commande->id." AND p.fk_product_type <> 1 ORDER BY l.rowid";
|
||||
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
|
|
@ -239,7 +239,7 @@ if ($_GET["id"] > 0)
|
|||
if ($value > 0)
|
||||
{
|
||||
$sql = "SELECT e.label as entrepot, ps.reel, p.label ";
|
||||
$sql .= " FROM llx_entrepot as e, llx_product_stock as ps, llx_product as p";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."entrepot as e, ".MAIN_DB_PREFIX."product_stock as ps, ".MAIN_DB_PREFIX."product as p";
|
||||
$sql .= " WHERE e.rowid = ps.fk_entrepot AND ps.fk_product = p.rowid AND ps.fk_product = $key";
|
||||
$sql .= " AND e.statut = 1 AND reel < $value";
|
||||
|
||||
|
|
@ -294,7 +294,7 @@ if ($_GET["id"] > 0)
|
|||
*
|
||||
*/
|
||||
$sql = "SELECT cd.fk_product, cd.description, cd.rowid, cd.qty as qty_commande, ed.qty as qty_livre, e.ref, e.rowid as expedition_id";
|
||||
$sql .= " FROM llx_commandedet as cd , llx_expeditiondet as ed, llx_expedition as e";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."commandedet as cd , ".MAIN_DB_PREFIX."expeditiondet as ed, ".MAIN_DB_PREFIX."expedition as e";
|
||||
$sql .= " WHERE cd.fk_commande = ".$commande->id." AND cd.rowid = ed.fk_commande_ligne AND ed.fk_expedition = e.rowid";
|
||||
$sql .= " ORDER BY cd.fk_product";
|
||||
$result = $db->query($sql);
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ class Expedition
|
|||
$this->user = $user;
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "INSERT INTO llx_expedition (date_creation, fk_user_author, date_expedition, fk_commande, fk_entrepot) ";
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."expedition (date_creation, fk_user_author, date_expedition, fk_commande, fk_entrepot) ";
|
||||
$sql .= " VALUES (now(), $user->id, ".$this->db->idate($this->date_expedition).",$this->commande_id, $this->entrepot_id)";
|
||||
|
||||
if ( $this->db->query($sql) )
|
||||
|
|
@ -75,7 +75,7 @@ class Expedition
|
|||
*
|
||||
*/
|
||||
|
||||
$sql = "UPDATE llx_expedition SET ref='(PROV".$this->id.")' WHERE rowid=".$this->id;
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."expedition SET ref='(PROV".$this->id.")' WHERE rowid=".$this->id;
|
||||
if ($this->db->query($sql))
|
||||
{
|
||||
|
||||
|
|
@ -98,7 +98,7 @@ class Expedition
|
|||
*
|
||||
*
|
||||
*/
|
||||
$sql = "UPDATE llx_commande SET fk_statut = 2 WHERE rowid=".$this->commande_id;
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."commande SET fk_statut = 2 WHERE rowid=".$this->commande_id;
|
||||
if (! $this->db->query($sql))
|
||||
{
|
||||
$error++;
|
||||
|
|
@ -154,7 +154,7 @@ class Expedition
|
|||
$error++;
|
||||
}
|
||||
|
||||
$sql = "INSERT INTO llx_expeditiondet (fk_expedition, fk_commande_ligne, qty)";
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."expeditiondet (fk_expedition, fk_commande_ligne, qty)";
|
||||
$sql .= " VALUES ($this->id,".$commande_ligne_id.",".$qty.")";
|
||||
|
||||
if (! $this->db->query($sql) )
|
||||
|
|
@ -176,7 +176,7 @@ class Expedition
|
|||
{
|
||||
$sql = "SELECT e.rowid, e.date_creation, e.ref, e.fk_user_author, e.fk_statut, e.fk_commande, e.fk_entrepot";
|
||||
$sql .= ", ".$this->db->pdate("e.date_expedition")." as date_expedition ";
|
||||
$sql .= " FROM llx_expedition as e";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."expedition as e";
|
||||
$sql .= " WHERE e.rowid = $id";
|
||||
|
||||
$result = $this->db->query($sql) ;
|
||||
|
|
@ -217,7 +217,7 @@ class Expedition
|
|||
if ($user->rights->expedition->valider)
|
||||
{
|
||||
|
||||
$sql = "UPDATE llx_expedition SET ref='EXP".$this->id."', fk_statut = 1, date_valid=now(), fk_user_valid=$user->id";
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."expedition SET ref='EXP".$this->id."', fk_statut = 1, date_valid=now(), fk_user_valid=$user->id";
|
||||
$sql .= " WHERE rowid = $this->id AND fk_statut = 0 ;";
|
||||
|
||||
if ($this->db->query($sql) )
|
||||
|
|
@ -256,7 +256,7 @@ class Expedition
|
|||
$price = $p_price - $remise;
|
||||
}
|
||||
|
||||
$sql = "INSERT INTO llx_commandedet (fk_commande, fk_product, qty, price, tva_tx, description, remise_percent, subprice) VALUES ";
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."commandedet (fk_commande, fk_product, qty, price, tva_tx, description, remise_percent, subprice) VALUES ";
|
||||
$sql .= " (".$this->id.", $p_product_id,". $p_qty.",". $price.",".$p_tva_tx.",'". addslashes($p_desc) ."',$remise_percent, $subprice) ; ";
|
||||
|
||||
if ($this->db->query($sql) )
|
||||
|
|
@ -302,7 +302,7 @@ class Expedition
|
|||
{
|
||||
if ($this->statut == 0)
|
||||
{
|
||||
$sql = "DELETE FROM llx_commandedet WHERE rowid = $idligne";
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."commandedet WHERE rowid = $idligne";
|
||||
|
||||
if ($this->db->query($sql) )
|
||||
{
|
||||
|
|
@ -324,10 +324,10 @@ class Expedition
|
|||
{
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "DELETE FROM llx_expeditiondet WHERE fk_expedition = $this->id ;";
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."expeditiondet WHERE fk_expedition = $this->id ;";
|
||||
if ( $this->db->query($sql) )
|
||||
{
|
||||
$sql = "DELETE FROM llx_expedition WHERE rowid = $this->id;";
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."expedition WHERE rowid = $this->id;";
|
||||
if ( $this->db->query($sql) )
|
||||
{
|
||||
$this->db->commit();
|
||||
|
|
@ -352,7 +352,7 @@ class Expedition
|
|||
*/
|
||||
Function classin($cat_id)
|
||||
{
|
||||
$sql = "UPDATE llx_commande SET fk_projet = $cat_id";
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."commande SET fk_projet = $cat_id";
|
||||
$sql .= " WHERE rowid = $this->id;";
|
||||
|
||||
if ($this->db->query($sql) )
|
||||
|
|
|
|||
|
|
@ -345,7 +345,7 @@ else
|
|||
echo '<br><table border="0" width="100%" cellspacing="0" cellpadding="3">';
|
||||
|
||||
$sql = "SELECT cd.fk_product, cd.description, cd.rowid, cd.qty as qty_commande, ed.qty as qty_livre";
|
||||
$sql .= " FROM llx_commandedet as cd , llx_expeditiondet as ed";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."commandedet as cd , ".MAIN_DB_PREFIX."expeditiondet as ed";
|
||||
$sql .= " WHERE ed.fk_expedition = $id AND cd.rowid = ed.fk_commande_ligne ";
|
||||
|
||||
$result = $db->query($sql);
|
||||
|
|
@ -456,7 +456,7 @@ else
|
|||
*
|
||||
*/
|
||||
$sql = "SELECT cd.fk_product, cd.description, cd.rowid, cd.qty as qty_commande, ed.qty as qty_livre, e.ref";
|
||||
$sql .= " FROM llx_commandedet as cd , llx_expeditiondet as ed, llx_expedition as e";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."commandedet as cd , ".MAIN_DB_PREFIX."expeditiondet as ed, ".MAIN_DB_PREFIX."expedition as e";
|
||||
$sql .= " WHERE cd.fk_commande = $expedition->commande_id AND e.rowid <> $expedition->id AND cd.rowid = ed.fk_commande_ligne AND ed.fk_expedition = e.rowid";
|
||||
$sql .= " ORDER BY cd.fk_product";
|
||||
$result = $db->query($sql);
|
||||
|
|
@ -525,7 +525,7 @@ else
|
|||
*
|
||||
*/
|
||||
$sql = "SELECT ".$db->pdate("a.datea")." as da, a.note";
|
||||
$sql .= " FROM llx_actioncomm as a WHERE a.fk_soc = $commande->socidp AND a.fk_action in (9,10) AND a.fk_commande = $id";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a WHERE a.fk_soc = $commande->socidp AND a.fk_action in (9,10) AND a.fk_commande = $id";
|
||||
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ print "</table></form>\n";
|
|||
/*
|
||||
* Expeditions à valider
|
||||
*/
|
||||
$sql = "SELECT e.rowid, e.ref, s.nom, s.idp, c.ref as commande_ref, c.rowid as commande_id FROM llx_expedition as e, llx_societe as s, llx_commande as c";
|
||||
$sql = "SELECT e.rowid, e.ref, s.nom, s.idp, c.ref as commande_ref, c.rowid as commande_id FROM ".MAIN_DB_PREFIX."expedition as e, ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande as c";
|
||||
$sql .= " WHERE e.fk_commande = c.rowid AND c.fk_soc = s.idp AND e.fk_statut = 0";
|
||||
if ($socidp)
|
||||
{
|
||||
|
|
@ -74,7 +74,7 @@ if ( $db->query($sql) )
|
|||
/*
|
||||
* Commandes à traiter
|
||||
*/
|
||||
$sql = "SELECT c.rowid, c.ref, s.nom, s.idp FROM llx_commande as c, llx_societe as s";
|
||||
$sql = "SELECT c.rowid, c.ref, s.nom, s.idp FROM ".MAIN_DB_PREFIX."commande as c, ".MAIN_DB_PREFIX."societe as s";
|
||||
$sql .= " WHERE c.fk_soc = s.idp AND c.fk_statut = 1";
|
||||
if ($socidp)
|
||||
{
|
||||
|
|
@ -113,7 +113,7 @@ print '</td><td valign="top" width="70%">';
|
|||
/*
|
||||
* Commandes en traitement
|
||||
*/
|
||||
$sql = "SELECT c.rowid, c.ref, s.nom, s.idp FROM llx_commande as c, llx_societe as s";
|
||||
$sql = "SELECT c.rowid, c.ref, s.nom, s.idp FROM ".MAIN_DB_PREFIX."commande as c, ".MAIN_DB_PREFIX."societe as s";
|
||||
$sql .= " WHERE c.fk_soc = s.idp AND c.fk_statut = 2";
|
||||
if ($socidp)
|
||||
{
|
||||
|
|
@ -147,7 +147,7 @@ if ( $db->query($sql) )
|
|||
/*
|
||||
* Expeditions à valider
|
||||
*/
|
||||
$sql = "SELECT e.rowid, e.ref, s.nom, s.idp, c.ref as commande_ref, c.rowid as commande_id FROM llx_expedition as e, llx_societe as s, llx_commande as c";
|
||||
$sql = "SELECT e.rowid, e.ref, s.nom, s.idp, c.ref as commande_ref, c.rowid as commande_id FROM ".MAIN_DB_PREFIX."expedition as e, ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande as c";
|
||||
$sql .= " WHERE e.fk_commande = c.rowid AND c.fk_soc = s.idp AND e.fk_statut = 1";
|
||||
if ($socidp)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ $pageprev = $_GET["page"] - 1;
|
|||
$pagenext = $_GET["page"] + 1;
|
||||
|
||||
$sql = "SELECT e.rowid, e.ref,".$db->pdate("e.date_expedition")." as date_expedition, e.fk_statut" ;
|
||||
$sql .= " FROM llx_expedition as e ";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."expedition as e ";
|
||||
$sql_add = " WHERE ";
|
||||
if ($socidp)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ class ExpeditionStats
|
|||
Function getNbExpeditionByYear()
|
||||
{
|
||||
$result = array();
|
||||
$sql = "SELECT date_format(date_expedition,'%Y') as dm, count(*) FROM llx_expedition GROUP BY dm DESC WHERE fk_statut > 0";
|
||||
$sql = "SELECT date_format(date_expedition,'%Y') as dm, count(*) FROM ".MAIN_DB_PREFIX."expedition GROUP BY dm DESC WHERE fk_statut > 0";
|
||||
if ($this->db->query($sql))
|
||||
{
|
||||
$num = $this->db->num_rows();
|
||||
|
|
@ -58,7 +58,7 @@ class ExpeditionStats
|
|||
Function getNbExpeditionByMonth($year)
|
||||
{
|
||||
$result = array();
|
||||
$sql = "SELECT date_format(date_expedition,'%m') as dm, count(*) FROM llx_expedition";
|
||||
$sql = "SELECT date_format(date_expedition,'%m') as dm, count(*) FROM ".MAIN_DB_PREFIX."expedition";
|
||||
$sql .= " WHERE date_format(date_expedition,'%Y') = $year AND fk_statut > 0";
|
||||
$sql .= " GROUP BY dm DESC";
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ print_fiche_titre('Statistiques exp
|
|||
print '<table class="border" width="100%" cellspacing="0" cellpadding="4">';
|
||||
print '<tr><td align="center">Année</td><td width="40%" align="center">Nb d\'expédition</td></tr>';
|
||||
|
||||
$sql = "SELECT count(*), date_format(date_expedition,'%Y') as dm FROM llx_expedition WHERE fk_statut > 0 GROUP BY dm DESC ";
|
||||
$sql = "SELECT count(*), date_format(date_expedition,'%Y') as dm FROM ".MAIN_DB_PREFIX."expedition WHERE fk_statut > 0 GROUP BY dm DESC ";
|
||||
if ($db->query($sql))
|
||||
{
|
||||
$num = $db->num_rows();
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ if ($user->societe_id > 0)
|
|||
|
||||
if ($socidp)
|
||||
{
|
||||
$sql = "SELECT s.nom, s.idp, s.prefix_comm FROM llx_societe as s WHERE s.idp = $socidp;";
|
||||
$sql = "SELECT s.nom, s.idp, s.prefix_comm FROM ".MAIN_DB_PREFIX."societe as s WHERE s.idp = $socidp;";
|
||||
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
|
|
@ -115,7 +115,7 @@ if ($action == 'create')
|
|||
{
|
||||
$numpr = "FI-" . $objsoc->prefix_comm . "-" . strftime("%y%m%d", time());
|
||||
|
||||
$sql = "SELECT count(*) FROM llx_propal WHERE ref like '$numpr%'";
|
||||
$sql = "SELECT count(*) FROM ".MAIN_DB_PREFIX."propal WHERE ref like '$numpr%'";
|
||||
|
||||
if ( $db->query($sql) )
|
||||
{
|
||||
|
|
@ -201,7 +201,7 @@ if ($action == 'create')
|
|||
print '<tr><td valign="top">Projet</td><td><select name="projetidp">';
|
||||
print '<option value="0"></option>';
|
||||
|
||||
$sql = "SELECT p.rowid, p.title FROM llx_projet as p WHERE p.fk_soc = $socidp";
|
||||
$sql = "SELECT p.rowid, p.title FROM ".MAIN_DB_PREFIX."projet as p WHERE p.fk_soc = $socidp";
|
||||
|
||||
if ( $db->query($sql) )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ class Fichinter
|
|||
*/
|
||||
if (!strlen($this->duree)) { $this->duree = 0; }
|
||||
|
||||
$sql = "INSERT INTO llx_fichinter (fk_soc, datei, datec, ref, fk_user_author, note, duree, fk_projet) ";
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."fichinter (fk_soc, datei, datec, ref, fk_user_author, note, duree, fk_projet) ";
|
||||
$sql .= " VALUES ($this->socidp, $this->date, now(), '$this->ref', $this->author, '$this->note', $this->duree, $this->projet_id)";
|
||||
$sqlok = 0;
|
||||
|
||||
|
|
@ -85,7 +85,7 @@ class Fichinter
|
|||
/*
|
||||
* Insertion dans la base
|
||||
*/
|
||||
$sql = "UPDATE llx_fichinter SET ";
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."fichinter SET ";
|
||||
$sql .= " datei = $this->date";
|
||||
$sql .= ", note = '$this->note'";
|
||||
$sql .= ", duree = $this->duree";
|
||||
|
|
@ -107,7 +107,7 @@ class Fichinter
|
|||
Function get_new_num($prefix_comm)
|
||||
{
|
||||
|
||||
$sql = "SELECT max(ref) FROM llx_fichinter WHERE ref like 'FI-".$prefix_comm."-%'";
|
||||
$sql = "SELECT max(ref) FROM ".MAIN_DB_PREFIX."fichinter WHERE ref like 'FI-".$prefix_comm."-%'";
|
||||
|
||||
if ($this->db->query($sql) )
|
||||
{
|
||||
|
|
@ -144,7 +144,7 @@ class Fichinter
|
|||
Function fetch($rowid)
|
||||
{
|
||||
|
||||
$sql = "SELECT ref,note,fk_soc,fk_statut,duree,".$this->db->pdate(datei)."as di, fk_projet FROM llx_fichinter WHERE rowid=$rowid;";
|
||||
$sql = "SELECT ref,note,fk_soc,fk_statut,duree,".$this->db->pdate(datei)."as di, fk_projet FROM ".MAIN_DB_PREFIX."fichinter WHERE rowid=$rowid;";
|
||||
|
||||
if ($this->db->query($sql) )
|
||||
{
|
||||
|
|
@ -182,7 +182,7 @@ class Fichinter
|
|||
|
||||
$this->fetch($this->id);
|
||||
|
||||
$sql = "UPDATE llx_fichinter SET fk_statut = 1, date_valid=now(), fk_user_valid=$userid";
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."fichinter SET fk_statut = 1, date_valid=now(), fk_user_valid=$userid";
|
||||
$sql .= " WHERE rowid = $this->id AND fk_statut = 0 ;";
|
||||
|
||||
if ($this->db->query($sql) )
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ $pageprev = $page - 1;
|
|||
$pagenext = $page + 1;
|
||||
|
||||
$sql = "SELECT s.nom,s.idp, f.ref,".$db->pdate("f.datei")." as dp, f.rowid as fichid, f.fk_statut, f.duree";
|
||||
$sql .= " FROM llx_societe as s, llx_fichinter as f ";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."fichinter as f ";
|
||||
$sql .= " WHERE f.fk_soc = s.idp ";
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ $pageprev = $page - 1;
|
|||
$pagenext = $page + 1;
|
||||
|
||||
$sql = "SELECT s.nom,s.idp, f.note, f.ref,".$db->pdate("f.datei")." as dp, f.rowid as fichid, f.fk_statut, f.duree";
|
||||
$sql .= " FROM llx_societe as s, llx_fichinter as f ";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."fichinter as f ";
|
||||
$sql .= " WHERE f.fk_soc = s.idp";
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ class PaiementFourn
|
|||
//if ($result) {
|
||||
// $this->bankid = $this->db->last_insert_id();
|
||||
//
|
||||
// $sql = "UPDATE llx_paiementfourn SET fk_bank=$this->bankid WHERE rowid=$this->id";
|
||||
// $sql = "UPDATE ".MAIN_DB_PREFIX."paiementfourn SET fk_bank=$this->bankid WHERE rowid=$this->id";
|
||||
// $result = $this->db->query($sql);
|
||||
//}
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ if ($action == 'add') {
|
|||
$email = trim($email);
|
||||
|
||||
if (strlen(trim($name)) + strlen(trim($firstname)) > 0) {
|
||||
$sql = "INSERT INTO llx_socpeople (datec, fk_soc,name, firstname, poste, phone,fax,email) ";
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."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) {
|
||||
|
|
@ -57,7 +57,7 @@ if ($action == 'update') {
|
|||
|
||||
$email = trim($email);
|
||||
|
||||
$sql = "UPDATE llx_socpeople set name='$name', firstname='$firstname', poste='$poste', phone='$phone',fax='$fax',email='$email', note='$note'";
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."socpeople set name='$name', firstname='$firstname', poste='$poste', phone='$phone',fax='$fax',email='$email', note='$note'";
|
||||
$sql .= " WHERE idp=$contactid";
|
||||
$result = $db->query($sql);
|
||||
if ($result) {
|
||||
|
|
@ -76,7 +76,8 @@ $pagenext = $page + 1;
|
|||
|
||||
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 llx_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";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."c_stcomm as st ";
|
||||
$sql .= " WHERE s.fk_stcomm=st.id";
|
||||
|
||||
if ($to == 'next') {
|
||||
|
|
@ -135,7 +136,7 @@ if ($socid > 0) {
|
|||
print "<td><b>Fax</b></td><td><b>Email</b></td>";
|
||||
|
||||
$sql = "SELECT p.name, p.firstname, p.poste, p.phone, p.fax, p.email ";
|
||||
$sql .= " FROM llx_socpeople as p WHERE p.fk_soc = $objsoc->idp";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."socpeople as p WHERE p.fk_soc = $objsoc->idp";
|
||||
|
||||
if ($contactid) {
|
||||
$sql .= " AND p.idp = $contactid";
|
||||
|
|
@ -184,7 +185,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 llx_socpeople as p WHERE p.idp = $contactid";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."socpeople as p WHERE p.idp = $contactid";
|
||||
$result = $db->query($sql);
|
||||
$num = $db->num_rows();
|
||||
if ( $num >0 ) {
|
||||
|
|
@ -219,7 +220,7 @@ if ($socid > 0) {
|
|||
|
||||
|
||||
$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 llx_actioncomm as a, c_actioncomm as c, llx_user as u ";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a, ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."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 ";
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ $info_box_head[] = array('text' => "Les 20 derniers ouvrages");
|
|||
$info_box_contents = array();
|
||||
|
||||
$sql = "SELECT l.ref, l.title, l.rowid";
|
||||
$sql .= " FROM llx_livre as l ";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."livre as l ";
|
||||
$sql .= " ORDER BY l.date_ajout DESC ";
|
||||
$sql .= $db->plimit(20, 0);
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ $info_box_head[] = array('text' => "Les 5 derniers clients enregistr
|
|||
$info_box_contents = array();
|
||||
|
||||
$sql = "SELECT s.nom,s.idp";
|
||||
$sql .= " FROM llx_societe as s WHERE s.client = 1";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s WHERE s.client = 1";
|
||||
if ($user->societe_id > 0)
|
||||
{
|
||||
$sql .= " AND s.idp = $user->societe_id";
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ if ($user->rights->commande->lire)
|
|||
$info_box_contents = array();
|
||||
|
||||
$sql = "SELECT s.nom,s.idp,p.ref,".$db->pdate("p.date_commande")." as dp,p.rowid";
|
||||
$sql .= " FROM llx_societe as s, llx_commande as p WHERE p.fk_soc = s.idp";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande as p WHERE p.fk_soc = s.idp";
|
||||
if($user->societe_id)
|
||||
{
|
||||
$sql .= " AND s.idp = $user->societe_id";
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ if ($user->rights->facture->lire)
|
|||
$info_box_contents = array();
|
||||
|
||||
$sql = "SELECT s.nom,s.idp,f.facnumber,f.amount,".$db->pdate("f.datef")." as df,f.paye,f.rowid as facid";
|
||||
$sql .= " FROM llx_societe as s,llx_facture as f WHERE f.fk_soc = s.idp";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f WHERE f.fk_soc = s.idp";
|
||||
if($user->societe_id)
|
||||
{
|
||||
$sql .= " AND s.idp = $user->societe_id";
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ if ($user->rights->facture->lire)
|
|||
$info_box_contents = array();
|
||||
|
||||
$sql = "SELECT s.nom,s.idp,f.facnumber,f.amount,".$db->pdate("f.datef")." as df,f.paye,f.rowid as facid";
|
||||
$sql .= " FROM llx_societe as s,llx_facture as f WHERE f.fk_soc = s.idp AND f.paye=0 AND fk_statut = 1";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f WHERE f.fk_soc = s.idp AND f.paye=0 AND fk_statut = 1";
|
||||
if($user->societe_id)
|
||||
{
|
||||
$sql .= " AND s.idp = $user->societe_id";
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ $info_box_head[] = array('text' => "Les 5 derniers fournisseurs enregistr
|
|||
$info_box_contents = array();
|
||||
|
||||
$sql = "SELECT s.nom,s.idp";
|
||||
$sql .= " FROM llx_societe as s WHERE s.fournisseur = 1";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s WHERE s.fournisseur = 1";
|
||||
if ($user->societe_id > 0)
|
||||
{
|
||||
$sql .= " AND s.idp = $user->societe_id";
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ if ($user->rights->produit->lire)
|
|||
$info_box_contents = array();
|
||||
|
||||
$sql = "SELECT p.label, p.rowid, p.price";
|
||||
$sql .= " FROM llx_product as p";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."product as p";
|
||||
$sql .= " ORDER BY p.datec DESC";
|
||||
$sql .= $db->plimit(5, 0);
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ if ($user->rights->propale->lire)
|
|||
$info_box_contents = array();
|
||||
|
||||
$sql = "SELECT s.nom,s.idp,p.ref,".$db->pdate("p.datep")." as dp,p.rowid";
|
||||
$sql .= " FROM llx_societe as s,llx_propal as p WHERE p.fk_soc = s.idp";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."propal as p WHERE p.fk_soc = s.idp";
|
||||
if($user->societe_id)
|
||||
{
|
||||
$sql .= " AND s.idp = $user->societe_id";
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ $info_box_head[] = array('text' => "Les 5 derniers produits/services contract
|
|||
$info_box_contents = array();
|
||||
|
||||
$sql = "SELECT s.nom,s.idp, p.label, c.rowid";
|
||||
$sql .= " FROM llx_societe as s, llx_contrat as c, llx_product as p WHERE s.idp = c.fk_soc AND c.fk_product = p.rowid";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as c, ".MAIN_DB_PREFIX."product as p WHERE s.idp = c.fk_soc AND c.fk_product = p.rowid";
|
||||
if($user->societe_id)
|
||||
{
|
||||
$sql .= " AND s.idp = $user->societe_id";
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ class DolibarrModules
|
|||
$err = 0;
|
||||
|
||||
|
||||
$sql = "REPLACE INTO llx_const SET name = '".$this->const_name."', value='1', visible = 0";
|
||||
$sql = "REPLACE INTO ".MAIN_DB_PREFIX."const SET name = '".$this->const_name."', value='1', visible = 0";
|
||||
|
||||
if (!$this->db->query($sql))
|
||||
{
|
||||
|
|
@ -58,14 +58,14 @@ class DolibarrModules
|
|||
$titre = $this->boxes[$key][0];
|
||||
$file = $this->boxes[$key][1];
|
||||
|
||||
$sql = "SELECT count(*) FROM llx_boxes_def WHERE name ='".$titre."'";
|
||||
$sql = "SELECT count(*) FROM ".MAIN_DB_PREFIX."boxes_def WHERE name ='".$titre."'";
|
||||
|
||||
if ( $this->db->query($sql) )
|
||||
{
|
||||
$row = $this->db->fetch_row($sql);
|
||||
if ($row[0] == 0)
|
||||
{
|
||||
$sql = "insert into llx_boxes_def (name, file) values ('".$titre."','".$file."')";
|
||||
$sql = "insert into ".MAIN_DB_PREFIX."boxes_def (name, file) values ('".$titre."','".$file."')";
|
||||
if (! $this->db->query($sql) )
|
||||
{
|
||||
$err++;
|
||||
|
|
@ -85,7 +85,7 @@ class DolibarrModules
|
|||
$val = $this->const[$key][2];
|
||||
$note = $this->const[$key][3];
|
||||
|
||||
$sql = "SELECT count(*) FROM llx_const WHERE name ='".$name."'";
|
||||
$sql = "SELECT count(*) FROM ".MAIN_DB_PREFIX."const WHERE name ='".$name."'";
|
||||
|
||||
if ( $this->db->query($sql) )
|
||||
{
|
||||
|
|
@ -94,14 +94,14 @@ class DolibarrModules
|
|||
if ($row[0] == 0)
|
||||
{
|
||||
if (strlen($note)){
|
||||
$sql = "INSERT INTO llx_const (name,type,value,note) VALUES ('".$name."','".$type."','".$val."','$note')";
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."const (name,type,value,note) VALUES ('".$name."','".$type."','".$val."','$note')";
|
||||
}elseif (strlen($val))
|
||||
{
|
||||
$sql = "INSERT INTO llx_const (name,type,value) VALUES ('".$name."','".$type."','".$val."')";
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."const (name,type,value) VALUES ('".$name."','".$type."','".$val."')";
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql = "INSERT INTO llx_const (name,type) VALUES ('".$name."','".$type."')";
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."const (name,type) VALUES ('".$name."','".$type."')";
|
||||
}
|
||||
|
||||
if (! $this->db->query($sql) )
|
||||
|
|
@ -146,7 +146,7 @@ class DolibarrModules
|
|||
{
|
||||
$err = 0;
|
||||
|
||||
$sql = "DELETE FROM llx_const WHERE name = '".$this->const_name."'";
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."const WHERE name = '".$this->const_name."'";
|
||||
|
||||
if (!$this->db->query($sql))
|
||||
{
|
||||
|
|
@ -170,7 +170,7 @@ class DolibarrModules
|
|||
$titre = $this->boxes[$key][0];
|
||||
$file = $this->boxes[$key][1];
|
||||
|
||||
$sql = "DELETE FROM llx_boxes_def WHERE file = '".$file."'";
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."boxes_def WHERE file = '".$file."'";
|
||||
if (! $this->db->query($sql) )
|
||||
{
|
||||
$err++;
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ Class mod_commande_ivoire
|
|||
{
|
||||
global $db;
|
||||
|
||||
$sql = "SELECT count(*) FROM llx_commande WHERE fk_statut <> 0";
|
||||
$sql = "SELECT count(*) FROM ".MAIN_DB_PREFIX."commande WHERE fk_statut <> 0";
|
||||
|
||||
if ( $db->query($sql) )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ function facture_get_num($objsoc=0)
|
|||
$date = strftime("%Y%m", time());
|
||||
$num=0;
|
||||
|
||||
$sql = "SELECT max(0+substring(facnumber,8)) FROM llx_facture";
|
||||
$sql = "SELECT max(0+substring(facnumber,8)) FROM ".MAIN_DB_PREFIX."facture";
|
||||
$sql .= " WHERE facnumber like '$prefix".$date."%'";
|
||||
|
||||
if ( $db->query($sql) )
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ function facture_get_num($objsoc=0)
|
|||
{
|
||||
global $db;
|
||||
|
||||
$sql = "SELECT count(*) FROM llx_facture WHERE fk_statut > 0";
|
||||
$sql = "SELECT count(*) FROM ".MAIN_DB_PREFIX."facture WHERE fk_statut > 0";
|
||||
|
||||
if ( $db->query($sql) )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ function facture_get_num($objsoc=0)
|
|||
{
|
||||
global $db;
|
||||
|
||||
$sql = "SELECT count(*) FROM llx_facture WHERE fk_statut > 0";
|
||||
$sql = "SELECT count(*) FROM ".MAIN_DB_PREFIX."facture WHERE fk_statut > 0";
|
||||
|
||||
if ( $db->query($sql) )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -128,11 +128,11 @@ class modAdherent extends DolibarrModules
|
|||
* Permissions
|
||||
*/
|
||||
$sql = array(
|
||||
"insert into llx_rights_def values (70,'Tous les droits sur les adherents','adherent','a',0);",
|
||||
"insert into llx_rights_def values (71,'Lire les fiche adherents','adherent','r',1);",
|
||||
"insert into llx_rights_def values (72,'Créer modifier des adherents','adherent','w',0);",
|
||||
"insert into llx_rights_def values (73,'Modifier les adherents','adherent','m',0);",
|
||||
"insert into llx_rights_def values (74,'Supprimer les adherents','adherent','d',0);"
|
||||
"insert into ".MAIN_DB_PREFIX."rights_def values (70,'Tous les droits sur les adherents','adherent','a',0);",
|
||||
"insert into ".MAIN_DB_PREFIX."rights_def values (71,'Lire les fiche adherents','adherent','r',1);",
|
||||
"insert into ".MAIN_DB_PREFIX."rights_def values (72,'Créer modifier des adherents','adherent','w',0);",
|
||||
"insert into ".MAIN_DB_PREFIX."rights_def values (73,'Modifier les adherents','adherent','m',0);",
|
||||
"insert into ".MAIN_DB_PREFIX."rights_def values (74,'Supprimer les adherents','adherent','d',0);"
|
||||
);
|
||||
|
||||
return $this->_init($sql);
|
||||
|
|
@ -144,7 +144,7 @@ class modAdherent extends DolibarrModules
|
|||
Function remove()
|
||||
{
|
||||
$sql = array(
|
||||
"DELETE FROM llx_rights_def WHERE module = 'adherent';"
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."rights_def WHERE module = 'adherent';"
|
||||
);
|
||||
|
||||
return $this->_remove($sql);
|
||||
|
|
|
|||
|
|
@ -57,9 +57,9 @@ class modBanque extends DolibarrModules
|
|||
* Permissions
|
||||
*/
|
||||
$sql = array(
|
||||
"insert into llx_rights_def values (111,'Lire les comptes','banque','a',1);",
|
||||
"insert into llx_rights_def values (112,'Modifier les comptes','banque','a',0);",
|
||||
"insert into llx_rights_def values (113,'Configurer les comptes','banque','a',0);",
|
||||
"insert into ".MAIN_DB_PREFIX."rights_def values (111,'Lire les comptes','banque','a',1);",
|
||||
"insert into ".MAIN_DB_PREFIX."rights_def values (112,'Modifier les comptes','banque','a',0);",
|
||||
"insert into ".MAIN_DB_PREFIX."rights_def values (113,'Configurer les comptes','banque','a',0);",
|
||||
);
|
||||
|
||||
return $this->_init($sql);
|
||||
|
|
@ -70,7 +70,7 @@ class modBanque extends DolibarrModules
|
|||
*/
|
||||
Function remove()
|
||||
{
|
||||
$sql = array("DELETE FROM llx_rights_def WHERE module = 'banque';");
|
||||
$sql = array("DELETE FROM ".MAIN_DB_PREFIX."rights_def WHERE module = 'banque';");
|
||||
|
||||
return $this->_remove($sql);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,12 +57,12 @@ class modCommande extends DolibarrModules
|
|||
* Permissions
|
||||
*/
|
||||
$sql = array(
|
||||
"insert into llx_rights_def values (80,'Tous les droits sur les commandes','commande','a',0);",
|
||||
"insert into llx_rights_def values (81,'Lire les commandes','commande','r',1);",
|
||||
"insert into llx_rights_def values (82,'Créer modifier les commandes','commande','w',0);",
|
||||
//"insert into llx_rights_def values (83,'Modifier les commandes d\'autrui','commande','m',0);",
|
||||
"insert into llx_rights_def values (84,'Valider les commandes','commande','d',0);",
|
||||
"insert into llx_rights_def values (89,'Supprimer les commandes','commande','d',0);",
|
||||
"insert into ".MAIN_DB_PREFIX."rights_def values (80,'Tous les droits sur les commandes','commande','a',0);",
|
||||
"insert into ".MAIN_DB_PREFIX."rights_def values (81,'Lire les commandes','commande','r',1);",
|
||||
"insert into ".MAIN_DB_PREFIX."rights_def values (82,'Créer modifier les commandes','commande','w',0);",
|
||||
//"insert into ".MAIN_DB_PREFIX."rights_def values (83,'Modifier les commandes d\'autrui','commande','m',0);",
|
||||
"insert into ".MAIN_DB_PREFIX."rights_def values (84,'Valider les commandes','commande','d',0);",
|
||||
"insert into ".MAIN_DB_PREFIX."rights_def values (89,'Supprimer les commandes','commande','d',0);",
|
||||
);
|
||||
|
||||
return $this->_init($sql);
|
||||
|
|
|
|||
|
|
@ -57,8 +57,8 @@ class modComptabilite extends DolibarrModules
|
|||
* Permissions
|
||||
*/
|
||||
$sql = array(
|
||||
"insert into llx_rights_def values (92,'Gestion charges','compta','a',1);",
|
||||
"insert into llx_rights_def values (93,'Gestion resultat','compta','a',1);",
|
||||
"insert into ".MAIN_DB_PREFIX."rights_def values (92,'Gestion charges','compta','a',1);",
|
||||
"insert into ".MAIN_DB_PREFIX."rights_def values (93,'Gestion resultat','compta','a',1);",
|
||||
);
|
||||
|
||||
return $this->_init($sql);
|
||||
|
|
@ -69,7 +69,7 @@ class modComptabilite extends DolibarrModules
|
|||
*/
|
||||
Function remove()
|
||||
{
|
||||
$sql = array("DELETE FROM llx_rights_def WHERE module = 'compta';");
|
||||
$sql = array("DELETE FROM ".MAIN_DB_PREFIX."rights_def WHERE module = 'compta';");
|
||||
|
||||
return $this->_remove($sql);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,12 +56,12 @@ class modExpedition extends DolibarrModules
|
|||
* Permissions
|
||||
*/
|
||||
$sql = array(
|
||||
"insert into llx_rights_def values (100,'Tous les droits sur les expeditions','expedition','a',0);",
|
||||
"insert into llx_rights_def values (101,'Lire les expeditions','expedition','r',1);",
|
||||
"insert into llx_rights_def values (102,'Créer modifier les expeditions','expedition','w',0);",
|
||||
//"insert into llx_rights_def values (83,'Modifier les expeditions d\'autrui','expedition','m',0);",
|
||||
"insert into llx_rights_def values (104,'Valider les expeditions','expedition','d',0);",
|
||||
"insert into llx_rights_def values (109,'Supprimer les expeditions','expedition','d',0);",
|
||||
"insert into ".MAIN_DB_PREFIX."rights_def values (100,'Tous les droits sur les expeditions','expedition','a',0);",
|
||||
"insert into ".MAIN_DB_PREFIX."rights_def values (101,'Lire les expeditions','expedition','r',1);",
|
||||
"insert into ".MAIN_DB_PREFIX."rights_def values (102,'Créer modifier les expeditions','expedition','w',0);",
|
||||
//"insert into ".MAIN_DB_PREFIX."rights_def values (83,'Modifier les expeditions d\'autrui','expedition','m',0);",
|
||||
"insert into ".MAIN_DB_PREFIX."rights_def values (104,'Valider les expeditions','expedition','d',0);",
|
||||
"insert into ".MAIN_DB_PREFIX."rights_def values (109,'Supprimer les expeditions','expedition','d',0);",
|
||||
);
|
||||
|
||||
return $this->_init($sql);
|
||||
|
|
|
|||
|
|
@ -96,14 +96,14 @@ class modFacture extends DolibarrModules
|
|||
* Permissions
|
||||
*/
|
||||
$sql = array(
|
||||
"insert into llx_rights_def values (10,'Tous les droits sur les factures','facture','a',0);",
|
||||
"insert into llx_rights_def values (11,'Lire les factures','facture','r',1);",
|
||||
"insert into llx_rights_def values (12,'Créer modifier les factures','facture','w',0);",
|
||||
//"insert into llx_rights_def values (13,'Modifier les factures d\'autrui','facture','m',0);",
|
||||
"insert into llx_rights_def values (14,'Valider les factures','facture','d',0);",
|
||||
"insert into llx_rights_def values (15,'Envoyer les factures aux clients','facture','d',0);",
|
||||
"insert into llx_rights_def values (16,'Emettre des paiements sur les factures','facture','d',0);",
|
||||
"insert into llx_rights_def values (19,'Supprimer les factures','facture','d',0);"
|
||||
"insert into ".MAIN_DB_PREFIX."rights_def values (10,'Tous les droits sur les factures','facture','a',0);",
|
||||
"insert into ".MAIN_DB_PREFIX."rights_def values (11,'Lire les factures','facture','r',1);",
|
||||
"insert into ".MAIN_DB_PREFIX."rights_def values (12,'Créer modifier les factures','facture','w',0);",
|
||||
//"insert into ".MAIN_DB_PREFIX."rights_def values (13,'Modifier les factures d\'autrui','facture','m',0);",
|
||||
"insert into ".MAIN_DB_PREFIX."rights_def values (14,'Valider les factures','facture','d',0);",
|
||||
"insert into ".MAIN_DB_PREFIX."rights_def values (15,'Envoyer les factures aux clients','facture','d',0);",
|
||||
"insert into ".MAIN_DB_PREFIX."rights_def values (16,'Emettre des paiements sur les factures','facture','d',0);",
|
||||
"insert into ".MAIN_DB_PREFIX."rights_def values (19,'Supprimer les factures','facture','d',0);"
|
||||
);
|
||||
|
||||
return $this->_init($sql);
|
||||
|
|
@ -115,7 +115,7 @@ class modFacture extends DolibarrModules
|
|||
Function remove()
|
||||
{
|
||||
$sql = array(
|
||||
"DELETE FROM llx_rights_def WHERE module = 'facture';"
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."rights_def WHERE module = 'facture';"
|
||||
);
|
||||
|
||||
return $this->_remove($sql);
|
||||
|
|
|
|||
|
|
@ -62,10 +62,10 @@ class modFicheinter extends DolibarrModules
|
|||
* Permissions
|
||||
*/
|
||||
$sql = array(
|
||||
"INSERT INTO llx_rights_def VALUES (60,'Tous les droits sur les fiches d\'intervention','ficheinter','a',0);",
|
||||
"INSERT INTO llx_rights_def VALUES (61,'Lire les fiches d\'intervention','ficheinter','r',1);",
|
||||
"INSERT INTO llx_rights_def VALUES (62,'Créer modifier les fiches d\'intervention','ficheinter','w',0);",
|
||||
"INSERT INTO llx_rights_def VALUES (64,'Supprimer les fiches d\'intervention','ficheinter','d',0);"
|
||||
"INSERT INTO ".MAIN_DB_PREFIX."rights_def VALUES (60,'Tous les droits sur les fiches d\'intervention','ficheinter','a',0);",
|
||||
"INSERT INTO ".MAIN_DB_PREFIX."rights_def VALUES (61,'Lire les fiches d\'intervention','ficheinter','r',1);",
|
||||
"INSERT INTO ".MAIN_DB_PREFIX."rights_def VALUES (62,'Créer modifier les fiches d\'intervention','ficheinter','w',0);",
|
||||
"INSERT INTO ".MAIN_DB_PREFIX."rights_def VALUES (64,'Supprimer les fiches d\'intervention','ficheinter','d',0);"
|
||||
);
|
||||
|
||||
return $this->_init($sql);
|
||||
|
|
@ -76,7 +76,7 @@ class modFicheinter extends DolibarrModules
|
|||
*/
|
||||
Function remove()
|
||||
{
|
||||
$sql = array("DELETE FROM llx_rights_def WHERE module = 'ficheinter';");
|
||||
$sql = array("DELETE FROM ".MAIN_DB_PREFIX."rights_def WHERE module = 'ficheinter';");
|
||||
|
||||
return $this->_remove($sql);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,10 +62,10 @@ class modProduit extends DolibarrModules
|
|||
*/
|
||||
|
||||
$sql = array(
|
||||
"insert into llx_rights_def values (30,'Tous les droits sur les produits','produit','a',0);",
|
||||
"insert into llx_rights_def values (31,'Lire les produits','produit','r',1);",
|
||||
"insert into llx_rights_def values (32,'Créer modifier les produits','produit','w',0);",
|
||||
"insert INTO llx_rights_def values (34,'Supprimer les produits','produit','d',0);"
|
||||
"insert into ".MAIN_DB_PREFIX."rights_def values (30,'Tous les droits sur les produits','produit','a',0);",
|
||||
"insert into ".MAIN_DB_PREFIX."rights_def values (31,'Lire les produits','produit','r',1);",
|
||||
"insert into ".MAIN_DB_PREFIX."rights_def values (32,'Créer modifier les produits','produit','w',0);",
|
||||
"insert INTO ".MAIN_DB_PREFIX."rights_def values (34,'Supprimer les produits','produit','d',0);"
|
||||
);
|
||||
|
||||
return $this->_init($sql);
|
||||
|
|
@ -77,9 +77,9 @@ class modProduit extends DolibarrModules
|
|||
Function remove()
|
||||
{
|
||||
$sql = array(
|
||||
"DELETE FROM llx_rights_def WHERE module = 'produit';",
|
||||
"DELETE FROM llx_boxes_def WHERE file = 'box_services_vendus.php';",
|
||||
"DELETE FROM llx_boxes_def WHERE file = 'box_produits.php';"
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."rights_def WHERE module = 'produit';",
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."boxes_def WHERE file = 'box_services_vendus.php';",
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."boxes_def WHERE file = 'box_produits.php';"
|
||||
);
|
||||
|
||||
return $this->_remove($sql);
|
||||
|
|
|
|||
|
|
@ -58,11 +58,11 @@ class modProjet extends DolibarrModules
|
|||
* Permissions
|
||||
*/
|
||||
$sql = array(
|
||||
"insert into llx_rights_def values (40,'Tous les droits sur les projets','projet','a',0);",
|
||||
"insert into llx_rights_def values (41,'Lire les projets','projet','r',1);",
|
||||
"insert into llx_rights_def values (42,'Créer modifier les projets','projet','w',0);",
|
||||
//"insert into llx_rights_def values (43,'Modifier les projets d\'autrui','projet','m',0);",
|
||||
"insert into llx_rights_def values (44,'Supprimer les projets','projet','d',0);"
|
||||
"insert into ".MAIN_DB_PREFIX."rights_def values (40,'Tous les droits sur les projets','projet','a',0);",
|
||||
"insert into ".MAIN_DB_PREFIX."rights_def values (41,'Lire les projets','projet','r',1);",
|
||||
"insert into ".MAIN_DB_PREFIX."rights_def values (42,'Créer modifier les projets','projet','w',0);",
|
||||
//"insert into ".MAIN_DB_PREFIX."rights_def values (43,'Modifier les projets d\'autrui','projet','m',0);",
|
||||
"insert into ".MAIN_DB_PREFIX."rights_def values (44,'Supprimer les projets','projet','d',0);"
|
||||
);
|
||||
|
||||
return $this->_init($sql);
|
||||
|
|
@ -73,7 +73,7 @@ class modProjet extends DolibarrModules
|
|||
*/
|
||||
Function remove()
|
||||
{
|
||||
$sql = array("DELETE FROM llx_rights_def WHERE module = 'projet';");
|
||||
$sql = array("DELETE FROM ".MAIN_DB_PREFIX."rights_def WHERE module = 'projet';");
|
||||
|
||||
return $this->_remove($sql);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -72,16 +72,16 @@ class modPropale extends DolibarrModules
|
|||
* Permissions et valeurs par défaut
|
||||
*/
|
||||
$sql = array(
|
||||
"insert into llx_rights_def values (20,'Tous les droits sur les propositions commerciales','propale','a',0);",
|
||||
"insert into llx_rights_def values (21,'Lire les propositions commerciales','propale','r',1);",
|
||||
"insert into llx_rights_def values (22,'Créer modifier les propositions commerciales','propale','w',0);",
|
||||
"insert into llx_rights_def values (24,'Valider les propositions commerciales','propale','d',0);",
|
||||
"insert into llx_rights_def values (25,'Envoyer les propositions commerciales aux clients','propale','d',0);",
|
||||
"insert into llx_rights_def values (26,'Clôturer les propositions commerciales','propale','d',0);",
|
||||
"insert into llx_rights_def values (27,'Supprimer les propositions commerciales','propale','d',0);",
|
||||
"REPLACE INTO llx_propal_model_pdf SET nom = '".$this->const[0][2]."'",
|
||||
"insert into ".MAIN_DB_PREFIX."rights_def values (20,'Tous les droits sur les propositions commerciales','propale','a',0);",
|
||||
"insert into ".MAIN_DB_PREFIX."rights_def values (21,'Lire les propositions commerciales','propale','r',1);",
|
||||
"insert into ".MAIN_DB_PREFIX."rights_def values (22,'Créer modifier les propositions commerciales','propale','w',0);",
|
||||
"insert into ".MAIN_DB_PREFIX."rights_def values (24,'Valider les propositions commerciales','propale','d',0);",
|
||||
"insert into ".MAIN_DB_PREFIX."rights_def values (25,'Envoyer les propositions commerciales aux clients','propale','d',0);",
|
||||
"insert into ".MAIN_DB_PREFIX."rights_def values (26,'Clôturer les propositions commerciales','propale','d',0);",
|
||||
"insert into ".MAIN_DB_PREFIX."rights_def values (27,'Supprimer les propositions commerciales','propale','d',0);",
|
||||
"REPLACE INTO ".MAIN_DB_PREFIX."propal_model_pdf SET nom = '".$this->const[0][2]."'",
|
||||
);
|
||||
//"insert into llx_rights_def values (23,'Modifier les propositions commerciales d\'autrui','propale','m',0);",
|
||||
//"insert into ".MAIN_DB_PREFIX."rights_def values (23,'Modifier les propositions commerciales d\'autrui','propale','m',0);",
|
||||
|
||||
return $this->_init($sql);
|
||||
|
||||
|
|
@ -93,7 +93,7 @@ class modPropale extends DolibarrModules
|
|||
Function remove()
|
||||
{
|
||||
$sql = array(
|
||||
"DELETE FROM llx_rights_def WHERE module = 'propale';"
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."rights_def WHERE module = 'propale';"
|
||||
);
|
||||
|
||||
return $this->_remove($sql);
|
||||
|
|
|
|||
|
|
@ -63,10 +63,10 @@ class modService extends DolibarrModules
|
|||
*/
|
||||
|
||||
$sql = array(
|
||||
"insert into llx_rights_def values (30,'Tous les droits sur les produits','produit','a',0);",
|
||||
"insert into llx_rights_def values (31,'Lire les produits','produit','r',1);",
|
||||
"insert into llx_rights_def values (32,'Créer modifier les produits','produit','w',0);",
|
||||
"insert INTO llx_rights_def values (34,'Supprimer les produits','produit','d',0);"
|
||||
"insert into ".MAIN_DB_PREFIX."rights_def values (30,'Tous les droits sur les produits','produit','a',0);",
|
||||
"insert into ".MAIN_DB_PREFIX."rights_def values (31,'Lire les produits','produit','r',1);",
|
||||
"insert into ".MAIN_DB_PREFIX."rights_def values (32,'Créer modifier les produits','produit','w',0);",
|
||||
"insert INTO ".MAIN_DB_PREFIX."rights_def values (34,'Supprimer les produits','produit','d',0);"
|
||||
);
|
||||
|
||||
return $this->_init($sql);
|
||||
|
|
@ -78,9 +78,9 @@ class modService extends DolibarrModules
|
|||
Function remove()
|
||||
{
|
||||
$sql = array(
|
||||
"DELETE FROM llx_rights_def WHERE module = 'produit';",
|
||||
"DELETE FROM llx_boxes_def WHERE file = 'box_services_vendus.php';",
|
||||
"DELETE FROM llx_boxes_def WHERE file = 'box_produits.php';"
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."rights_def WHERE module = 'produit';",
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."boxes_def WHERE file = 'box_services_vendus.php';",
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."boxes_def WHERE file = 'box_produits.php';"
|
||||
);
|
||||
|
||||
return $this->_remove($sql);
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ Class mod_propale_ivoire
|
|||
{
|
||||
global $db;
|
||||
|
||||
$sql = "SELECT count(*) FROM llx_propal";
|
||||
$sql = "SELECT count(*) FROM ".MAIN_DB_PREFIX."propal";
|
||||
|
||||
if ( $db->query($sql) )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ Class mod_propale_jade
|
|||
{
|
||||
global $db;
|
||||
|
||||
$sql = "SELECT count(*) FROM llx_propal";
|
||||
$sql = "SELECT count(*) FROM ".MAIN_DB_PREFIX."propal";
|
||||
|
||||
if ( $db->query($sql) )
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user