From 50c13e259438986de0b37da354e96d08c3c59147 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Mon, 3 Nov 2003 08:44:04 +0000 Subject: [PATCH] Mises aux normes, debut d'implementation des commandes, travail dans le train retour JDLL2003 :) --- htdocs/comm/propal.php | 4 ---- htdocs/compta/index.php | 18 ++++++++---------- htdocs/compta/pre.inc.php | 18 +++++++++--------- htdocs/compta/propal.php | 10 ++++++++-- htdocs/compta/stats/comp.php | 4 ++-- htdocs/compta/stats/exercices.php | 10 +++++----- htdocs/contrat/fiche.php | 16 +++++++++++++--- htdocs/contrat/index.php | 13 ++++++++++++- htdocs/includes/boxes/box_services_vendus.php | 5 ++++- htdocs/propal.class.php | 11 +---------- htdocs/theme/yellow/yellow.css | 8 ++++++++ 11 files changed, 70 insertions(+), 47 deletions(-) diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 8c5f3a986ea..a29ed9424ef 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -40,10 +40,6 @@ require("../propal.class.php"); require("../actioncomm.class.php"); require("../lib/CMailFile.class.php"); -/* - * - */ - /* * Sécurité accés client */ diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index 72c3fd6b865..edc2077c03f 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -62,15 +62,15 @@ if ($action == 'del_bookmark') */ print_titre(translate("Espace comptabilité")); -print ''; +print '
'; print '
'; /* * */ print '
'; -print ''; -print ""; +print '
'; +print ""; print ''; print "'; @@ -198,7 +198,6 @@ if ( $db->query($sql) ) print '
Rechercher une facture
"; print 'Num. :  
'; } /* - * Actions a faire * * */ @@ -222,16 +221,15 @@ if ($user->comm > 0 && $conf->commercial ) if ($num) { $i = 0; - print ''; - print ""; - print ''; - print "\n"; + print '
'.translate("Propositions comm. à facturer").'
'; + print ""; + print ''; while ($i < $num) { $var=!$var; $obj = $db->fetch_object($i); - print ""; + print ""; print ''; $i++; } @@ -266,7 +264,7 @@ if ( $db->query($sql) ) { $obj = $db->fetch_object( $i); $var=!$var; - print ''; + print ''; print ''; print ''; $i++; diff --git a/htdocs/compta/pre.inc.php b/htdocs/compta/pre.inc.php index 45dd496fc33..2fc3b863571 100644 --- a/htdocs/compta/pre.inc.php +++ b/htdocs/compta/pre.inc.php @@ -58,15 +58,12 @@ function llxHeader($head = "", $title="") { $menu->add("tva/index.php","TVA"); } - $menu->add(DOL_URL_ROOT."/compta/caisse/index.php","Caisse"); + if ($user->societe_id == 0) + { + $menu->add(DOL_URL_ROOT."/compta/caisse/index.php","Caisse"); - $menu->add(DOL_URL_ROOT."/fourn/index.php", "Fournisseurs"); - - /* - * $menu->add("ligne.php","Compta"); - * $menu->add_submenu("ligne.php","Lignes"); - * $menu->add_submenu("config.php","Configuration"); - */ + $menu->add(DOL_URL_ROOT."/fourn/index.php", "Fournisseurs"); + } if ($user->compta > 0) { @@ -78,7 +75,10 @@ function llxHeader($head = "", $title="") { $menu->add(DOL_URL_ROOT."/","Accueil"); } - $menu->add(DOL_URL_ROOT."/compta/deplacement/", "Déplacement"); + if ($user->societe_id == 0) + { + $menu->add(DOL_URL_ROOT."/compta/deplacement/", "Déplacement"); + } left_menu($menu->liste); diff --git a/htdocs/compta/propal.php b/htdocs/compta/propal.php index 8ca5ae308b9..dae3072717f 100644 --- a/htdocs/compta/propal.php +++ b/htdocs/compta/propal.php @@ -34,9 +34,15 @@ require("../lib/CMailFile.class.php"); require("../project.class.php"); require("../propal.class.php"); require("../actioncomm.class.php"); + /* - * + * Sécurité accés client */ +if ($user->societe_id > 0) +{ + $action = ''; + $socidp = $user->societe_id; +} llxHeader(); @@ -127,7 +133,7 @@ if ($propalid) $projet = new Project($db); $projet->fetch($obj->fk_projet); print ''; } print ""; diff --git a/htdocs/compta/stats/comp.php b/htdocs/compta/stats/comp.php index be54187b50d..1b15d4ec1d3 100644 --- a/htdocs/compta/stats/comp.php +++ b/htdocs/compta/stats/comp.php @@ -167,7 +167,7 @@ function pt ($db, $sql, $year) { if ($result) { $num = $db->num_rows(); $i = 0; $total = 0 ; - print "
'.translate("Propositions commerciales à facturer").'
rowid\">$obj->ref
rowid\">$obj->ref'.$obj->nom.'
'.$obj->facnumber.'
'.$obj->facnumber.''.$obj->nom.''.price($obj->total_ttc).'
Projet'; - print ''; + print ''; print $projet->title.'
Destinataire$obj->firstname $obj->name <$obj->email>
"; + print '
'; print ""; print ""; print "\n"; @@ -269,7 +269,7 @@ function ppt ($db, $year, $socidp) print "
MoisMontant
"; - print ""; + print '
'; print ""; print ""; print ""; diff --git a/htdocs/compta/stats/exercices.php b/htdocs/compta/stats/exercices.php index b576d8dd072..d58ab2a3366 100644 --- a/htdocs/compta/stats/exercices.php +++ b/htdocs/compta/stats/exercices.php @@ -37,7 +37,7 @@ function propals ($db, $year, $month) { $result = $db->query($sql); $num = $db->num_rows(); $i = 0; - print "

MoisMontant
"; + print '

'; print ""; $oldstatut = -1; @@ -87,7 +87,7 @@ function propals ($db, $year, $month) { print ""; print ""; print ""; - print "
Propal
Total : ".price($total)."Euros HT
"; + print "
"; $db->free(); } @@ -157,7 +157,7 @@ function pt ($db, $sql, $year) { if ($result) { $num = $db->num_rows(); $i = 0; $total = 0 ; - print "

"; + print '

'; print ""; print ""; print "\n"; @@ -229,7 +229,7 @@ function ppt ($db, $year, $socidp) print "CA ".($year - 1); print ""; - print ""; + print ''; print "
MoisMontant
CA $yearDelta
Delta
"; $sql = "SELECT sum(f.total) as sum, round(date_format(f.datef, '%m')) as dm"; @@ -259,7 +259,7 @@ function ppt ($db, $year, $socidp) print ""; - print "

"; + print '

'; print ""; print ""; print ""; diff --git a/htdocs/contrat/fiche.php b/htdocs/contrat/fiche.php index 0e94ed8a011..a012820a743 100644 --- a/htdocs/contrat/fiche.php +++ b/htdocs/contrat/fiche.php @@ -28,6 +28,16 @@ llxHeader(); $mesg = ''; +/* + * Sécurité accés client + */ +if ($user->societe_id > 0) +{ + $action = ''; + $socid = $user->societe_id; +} + + if ($action == 'add') { $contrat = new Contrat($db); @@ -97,7 +107,7 @@ if ($action == 'create') print ''."\n"; print '
Nouveau '.$types[$type].'

'."\n"; - print '
MoisMontant
'; + print '
'; print ""; print ''; print ''; @@ -133,7 +143,7 @@ else { print_fiche_titre('Fiche contrat : '.$contrat->id, $mesg); - print '
Référence
Libellé
'; + print '
'; print ""; print ''; print '
Service'.$contrat->product->label_url.''; @@ -202,7 +212,7 @@ else /* */ /* ************************************************************************** */ -print '
'; +print '
'; print ''; if ($contrat->enservice) diff --git a/htdocs/contrat/index.php b/htdocs/contrat/index.php index f4b9f9f76cf..5cf403955a9 100644 --- a/htdocs/contrat/index.php +++ b/htdocs/contrat/index.php @@ -21,12 +21,19 @@ */ require("./pre.inc.php"); - llxHeader(); if ($page == -1) { $page = 0 ; } +/* + * Sécurité accés client + */ +if ($user->societe_id > 0) +{ + $action = ''; + $socid = $user->societe_id; +} $limit = $conf->liste_limit; $offset = $limit * $page ; @@ -44,6 +51,10 @@ if ($sortorder == "") $sql = "SELECT s.nom, c.rowid as cid, c.enservice, p.label, p.rowid, s.idp as sidp"; $sql .= " FROM llx_contrat as c, llx_societe as s, llx_product as p"; $sql .= " WHERE c.fk_soc = s.idp AND c.fk_product = p.rowid"; +if ($socid > 0) +{ + $sql .= " AND s.idp = $socid"; +} $sql .= " ORDER BY $sortfield $sortorder "; $sql .= $db->plimit($limit + 1 ,$offset); diff --git a/htdocs/includes/boxes/box_services_vendus.php b/htdocs/includes/boxes/box_services_vendus.php index 6bbc272e764..efd61dac608 100644 --- a/htdocs/includes/boxes/box_services_vendus.php +++ b/htdocs/includes/boxes/box_services_vendus.php @@ -27,9 +27,12 @@ $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"; +if($user->societe_id) +{ + $sql .= " AND s.idp = $user->societe_id"; +} $sql .= " ORDER BY c.tms DESC "; /* - * Il faudrait ajouter un datec à cette table * */ $sql .= $db->plimit(5, 0); diff --git a/htdocs/propal.class.php b/htdocs/propal.class.php index 63f21bdbde4..4ed45feef6c 100644 --- a/htdocs/propal.class.php +++ b/htdocs/propal.class.php @@ -87,8 +87,7 @@ class Propal $sql .= " (".$this->id.",". $idproduct.",". $qty.",". $price.",".$prod->tva_tx.",'".addslashes($prod->label)."',$remise_percent, $subprice)"; if ($this->db->query($sql) ) - { - + { $this->update_price(); return 1; @@ -159,7 +158,6 @@ class Propal $client = new Societe($this->db); $client->fetch($this->socidp); $this->client = $client; - } /* * @@ -173,7 +171,6 @@ class Propal if ($this->db->query($sql) ) { - $this->update_price(); return 1; @@ -219,9 +216,6 @@ class Propal $prod = new Product($this->db, $this->products[$i]); $prod->fetch($this->products[$i]); - //$sql = "INSERT INTO llx_propaldet (fk_propal, fk_product, qty, price, tva_tx) VALUES "; - //$sql .= " ($propalid,".$this->products[$i].",".$this->products_qty[$i].",$prod->price,$prod->tva_tx);"; - $this->insert_product($this->products[$i], $this->products_qty[$i], $this->products_remise_percent[$i]); @@ -422,8 +416,6 @@ class Propal { print $this->db->error(); } - - } return 1; } @@ -440,7 +432,6 @@ class Propal */ Function valid($user) { - if ($user->rights->propale->valider) { diff --git a/htdocs/theme/yellow/yellow.css b/htdocs/theme/yellow/yellow.css index eeccd81270c..7e86347fa7b 100644 --- a/htdocs/theme/yellow/yellow.css +++ b/htdocs/theme/yellow/yellow.css @@ -49,6 +49,14 @@ table.noborder td { border-collapse: collapse; border: 0px } +table.liste { + border-collapse: collapse; + border: 0px } + +table.liste td { + border-collapse: collapse; + border: 0px } + table#actions { border: 0px; cell-spacing: 1em;
-