From de4f44136d6cd199bfa573a4fe588a4fb959ba81 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Thu, 2 May 2002 18:04:23 +0000 Subject: [PATCH] . --- htdocs/comm/facture.php3 | 4 ++- htdocs/comm/people.php3 | 57 +++++++++++++++++++++++++++++++++++++- htdocs/comm/pre.inc.php3 | 11 ++++---- htdocs/comm/propal.php3 | 38 +++++++++++++++++-------- htdocs/comm/socnote.php3 | 4 +-- htdocs/compta/facture.php3 | 2 +- htdocs/compta/pre.inc.php3 | 4 +-- htdocs/pre.inc.php3 | 19 +++++++------ 8 files changed, 107 insertions(+), 32 deletions(-) diff --git a/htdocs/comm/facture.php3 b/htdocs/comm/facture.php3 index 24ad3b65897..0a512463579 100644 --- a/htdocs/comm/facture.php3 +++ b/htdocs/comm/facture.php3 @@ -74,7 +74,7 @@ if ($action == 'add') { } elseif ($action == 'create') { - $sql = "SELECT s.nom, s.prefix_comm, s.idp, p.price, p.remise, p.tva, p.total, p.ref, ".$db->pdate("p.datep")." as dp, c.id as statut, c.label as lst, p.author"; + $sql = "SELECT s.nom, s.prefix_comm, s.idp, p.price, p.remise, p.tva, p.total, p.ref, ".$db->pdate("p.datep")." as dp, c.id as statut, c.label as lst"; $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 .= " AND p.rowid = $propalid"; @@ -154,6 +154,8 @@ if ($action == 'add') { print ""; } + } else { + print $db->error(); } diff --git a/htdocs/comm/people.php3 b/htdocs/comm/people.php3 index 28f7b66a573..781fbc7b0e4 100644 --- a/htdocs/comm/people.php3 +++ b/htdocs/comm/people.php3 @@ -152,7 +152,13 @@ if ($socid > 0) { print "PosteTel"; print "FaxEmail"; - $sql = "SELECT p.name, p.firstname, p.poste, p.phone, p.fax, p.email FROM socpeople as p WHERE p.fk_soc = $objsoc->idp ORDER by p.datec"; + $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"; + + if ($contactid) { + $sql .= " AND p.idp = $contactid"; + } + $sql .= " ORDER by p.datec"; $result = $db->query($sql); $i = 0 ; $num = $db->num_rows(); $tag = True; while ($i < $num) { @@ -219,6 +225,55 @@ if ($socid > 0) { print ""; } + /* + * + * + */ + print "

"; + + print ""; + 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 .= " WHERE a.fk_soc = $objsoc->idp "; + $sql .= " AND u.rowid = a.fk_user_author"; + $sql .= " AND c.id=a.fk_action "; + + if ($contactid) { + $sql .= " AND fk_contact = $contactid"; + } + $sql .= " ORDER BY a.datea DESC, a.id DESC"; + + if ( $db->query($sql) ) { + $i = 0 ; $num = $db->num_rows(); $tag = True; + while ($i < $num) { + $obj = $db->fetch_object( $i); + if ($tag) { + print ""; + } else { + print ""; + } + print ""; + if ($obj->propalrowid) { + print ""; + } else { + print ""; + } + + print ""; + print "\n"; + $i++; + $tag = !$tag; + } + } else { + print ''; + } + print "
ActionFaxEmail
". strftime("%d %b %Y %H:%M", $obj->da) ."propalrowid\">$obj->libelle$obj->libelle$obj->code 
' . $db->error() . '
"; + + + } else { print "Error"; diff --git a/htdocs/comm/pre.inc.php3 b/htdocs/comm/pre.inc.php3 index 62c954c2d4d..e4d8be0d4c9 100644 --- a/htdocs/comm/pre.inc.php3 +++ b/htdocs/comm/pre.inc.php3 @@ -22,7 +22,7 @@ require("../main.inc.php3"); function llxHeader($head = "", $urlp = "") { - global $PREFIX, $user; + global $PREFIX, $user, $conf; print "\n$head\n\n"; ?> @@ -44,7 +44,7 @@ function llxHeader($head = "", $urlp = "") { print ""; print ""; @@ -58,15 +58,14 @@ function llxHeader($head = "", $urlp = "") { print ""; /* * */ - print ""; /* * diff --git a/htdocs/comm/propal.php3 b/htdocs/comm/propal.php3 index 252865d862d..afc1c544245 100644 --- a/htdocs/comm/propal.php3 +++ b/htdocs/comm/propal.php3 @@ -27,6 +27,7 @@ require("../lib/CMailFile.class.php3"); */ require("projet/project.class.php3"); require("./propal.class.php3"); +require("./actioncomm.class.php3"); /* * */ @@ -291,7 +292,7 @@ if ($propalid) { print ""; } if ($obj->statut == 1) { - $file = $GLOBALS["GLJ_ROOT"] . "/www-sys/doc/propal/$obj->ref/$obj->ref.pdf"; + $file = $conf->propal->outputdir. "/$obj->ref/$obj->ref.pdf"; if (file_exists($file)) { print ""; @@ -347,9 +348,15 @@ if ($propalid) { print "!! erreur d'envoi"; } } + /* + * Enregistre l'action + * + * Ne fonctionne pas, a corriger ! + */ if ( $db->query($sql) ) { - $sql = "INSERT INTO actioncomm (datea,fk_action,fk_soc,author,propalrowid,note) VALUES (now(), 3, $obj->idp,'$author', $propalid, 'Envoyée à $sendto');"; + $sql = "INSERT INTO actioncomm (datea,fk_action,fk_soc, propalrowid,note, fk_user_author) "; + $sql .= " VALUES (now(), 3, $obj->idp, $propalid, 'Envoyée à $sendto',$user->id);"; if (! $db->query($sql) ) { print $db->error(); print "

$sql

"; @@ -392,7 +399,7 @@ if ($propalid) { /* * */ - $sql = "SELECT ".$db->pdate("a.datea"). " as da, author, note" ; + $sql = "SELECT ".$db->pdate("a.datea"). " as da, note, fk_user_author" ; $sql .= " FROM actioncomm as a WHERE a.fk_soc = $obj->idp AND a.propalrowid = $propalid "; if ( $db->query($sql) ) { @@ -404,7 +411,10 @@ if ($propalid) { while ($i < $num) { $objp = $db->fetch_object( $i); print "
\n"; - print "\n"; + $authoract = new User($db); + $authoract->id = $objp->fk_user_author; + $authoract->fetch(''); + print "\n"; print ""; $i++; } @@ -423,8 +433,12 @@ if ($propalid) { */ if ($action == 'presend') { $sendto = "rq@lolix.org"; - $replytoname = "Service commercial Lolix"; $ from_name = $replytoname; - $replytomail = "commercial@lolix.org"; $from_mail = $replytomail; + + $replytoname = $conf->propal->replytoname; + $replytomail = $conf->propal->replytomail; + + $from_name = $user->fullname ; //$conf->propal->fromtoname; + $from_mail = $user->email; //conf->propal->fromtomail; print "
\n"; print "\n"; @@ -482,7 +496,7 @@ if ($propalid) { /* * * - * Liste des propals + * Liste des propales * * */ @@ -491,16 +505,18 @@ if ($propalid) { $sql = "SELECT s.nom, s.idp, p.rowid as propalid, p.price - p.remise as price, p.ref,".$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"; - if ($socidp) { $sql .= " AND s.idp = $socidp"; } + if ($socidp) { + $sql .= " AND s.idp = $socidp"; + } - if ($viewstatut) { $sql .= " AND c.id = $viewstatut"; } + if ($viewstatut <> '') { + $sql .= " AND c.id = $viewstatut"; + } if ($month > 0) { - // $sql .= " AND date_part('month', date(p.datep)) = $month"; $sql .= " AND date_format(p.datep, '%Y-%m') = '$year-$month'"; } if ($year > 0) { - // $sql .= " AND date_part('year', date(p.datep)) = $year"; $sql .= " AND date_format(p.datep, '%Y') = $year"; } diff --git a/htdocs/comm/socnote.php3 b/htdocs/comm/socnote.php3 index 8df43c9a6e4..8652fc49d16 100644 --- a/htdocs/comm/socnote.php3 +++ b/htdocs/comm/socnote.php3 @@ -20,8 +20,8 @@ * */ require("./pre.inc.php3"); -require("../lib/functions.inc.php3"); -require("../../www/lib/company.class.php3"); + +//require("../../www/lib/company.class.php3"); /* * */ diff --git a/htdocs/compta/facture.php3 b/htdocs/compta/facture.php3 index 3c7fa6642a3..79edc9775f0 100644 --- a/htdocs/compta/facture.php3 +++ b/htdocs/compta/facture.php3 @@ -267,7 +267,7 @@ if ($facid > 0) { $sql .= " AND date_part('month', date(f.datef)) = $month"; } if ($year > 0) { - $sql .= " AND date_part('year', date(f.datef)) = $year"; + $sql .= " AND date_format(f.datef, '%Y') = $year"; } $sql .= " ORDER BY f.datef DESC "; diff --git a/htdocs/compta/pre.inc.php3 b/htdocs/compta/pre.inc.php3 index fcccfda8340..4db432de50d 100644 --- a/htdocs/compta/pre.inc.php3 +++ b/htdocs/compta/pre.inc.php3 @@ -22,7 +22,7 @@ require("../main.inc.php3"); function llxHeader($head = "") { - global $PREFIX; + global $PREFIX, $user, $conf; print "\n$head\n\n"; ?> @@ -44,7 +44,7 @@ function llxHeader($head = "") { print "
"; - print "
" . $GLOBALS["dbname"] . " - " . $user->code ."
"; + print "
" . $conf->db->name . " - " . $user->code ."
"; print "Accueil
"; print "Bookmark"; print "
"; print "\n"; - print "Factures
\n"; - print "Propal FE
\n"; - print "Clôture

\n"; print "

"; + print '
'; print ''; + print 'Brouillon
'; + print 'Ouvertes'; print "
-"; print "[Envoyer la propale par mail]
".strftime("%d %B %Y %H:%M:%S",$objp->da)."$objp->author
$authoract->code
$objp->note
"; print ""; diff --git a/htdocs/pre.inc.php3 b/htdocs/pre.inc.php3 index da947b8e7b5..131a2692e35 100644 --- a/htdocs/pre.inc.php3 +++ b/htdocs/pre.inc.php3 @@ -23,7 +23,7 @@ require ("./main.inc.php3"); function llxHeader($head = "") { - global $PREFIX, $user; + global $PREFIX, $user, $conf; print "\n$head\n\n"; ?> @@ -33,7 +33,8 @@ function llxHeader($head = "") { print "
"; - print "
" . $GLOBALS["dbname"] . " - " . $GLOBALS["REMOTE_USER"] ."
"; + print "
" . $conf->db->name . " - " . $user->code ."
"; print "Accueil"; print "
\n"; print ""; print ""; - print ""; + + print ""; print '"; - print ""; + print ""; print "
" . $GLOBALS["MAIN_TITLE"] . "Technique-'; if ($user->comm > 0) { @@ -41,9 +42,11 @@ function llxHeader($head = "") { } else { print 'Commercial'; } + + print "ComptaStats-
\n"; print ""; @@ -55,13 +58,9 @@ function llxHeader($head = "") { print "
"; print "'; print "'; + print "'; + print "
"; - print "
" . $GLOBALS["DB_NAME"] . " - " . $user->code ."
"; + print "
" . $conf->db->name . " - " . $user->code ."
"; print "Accueil
"; - print "Stat. quantitatives
\n"; - print "Stat. qualitatives
\n"; - print "Dictionnaires\n"; - print '
"; @@ -78,9 +77,13 @@ function llxHeader($head = "") { print "
Services
\n"; print '
"; + print ''; + print '
"; print "Configuration
"; print '
'; /*