This commit is contained in:
Rodolphe Quiedeville 2002-05-02 18:04:23 +00:00
parent d21f78be97
commit de4f44136d
8 changed files with 107 additions and 32 deletions

View File

@ -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 "</table>";
}
} else {
print $db->error();
}

View File

@ -152,7 +152,13 @@ if ($socid > 0) {
print "<td><b>Poste</b></td><td><b>Tel</b></td>";
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 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 "</form>";
}
/*
*
*
*/
print "<P><table width=\"100%\" cellspacing=0 border=1 cellpadding=2>";
print "<tr><td><b>Action</b></td>";
print "<td><b>Fax</b></td><td><b>Email</b></td>";
$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 "<tr bgcolor=\"e0e0e0\">";
} else {
print "<tr>";
}
print "<td>". strftime("%d %b %Y %H:%M", $obj->da) ."</td>";
if ($obj->propalrowid) {
print "<td><a href=\"propal.php3?propalid=$obj->propalrowid\">$obj->libelle</a></td>";
} else {
print "<td>$obj->libelle</td>";
}
print "<td>$obj->code&nbsp;</td>";
print "</tr>\n";
$i++;
$tag = !$tag;
}
} else {
print '<tr><td>' . $db->error() . '</td></tr>';
}
print "</table>";
} else {
print "Error";

View File

@ -22,7 +22,7 @@
require("../main.inc.php3");
function llxHeader($head = "", $urlp = "") {
global $PREFIX, $user;
global $PREFIX, $user, $conf;
print "<HTML>\n<HEAD>$head\n</HEAD>\n";
?>
@ -44,7 +44,7 @@ function llxHeader($head = "", $urlp = "") {
print "<TABLE border=\"1\" cellspacing=\"0\" width=\"100%\" cellpadding=\"3\">";
print "<TR><TD valign=\"top\" align=\"right\">";
print "<center><b>" . $GLOBALS["dbname"] . " - " . $user->code ."</B></center>";
print "<center><b>" . $conf->db->name . " - " . $user->code ."</B></center>";
print "<A href=\"".$urlp."../\">Accueil</A><br>";
print "<A href=\"".$urlp."bookmark.php3\">Bookmark</A>";
print "</td></tr>";
@ -58,15 +58,14 @@ function llxHeader($head = "", $urlp = "") {
print "<TR><TD valign=\"top\" align=\"right\">";
print "<div align=\"center\"><A href=\"".$urlp."actioncomm.php3\">Actions</A></div>\n";
print "<A href=\"".$urlp."actioncomm.php3?type=9\">Factures</A><BR>\n";
print "<A href=\"".$urlp."actioncomm.php3?type=5\">Propal FE</A><BR>\n";
print "<A href=\"".$urlp."actioncomm.php3?type=11\">Cl&ocirc;ture</A><p>\n";
print "</TD></TR>";
/*
*
*/
print "<TR><TD valign=\"top\" align=\"right\">";
print '<TR><TD valign="top" align="right" bgcolor="#e0e0e0">';
print '<div align="center"><A href="'.$urlp.'propal.php3">Propal</A></div>';
print '<A href="'.$urlp.'propal.php3?viewstatut=0">Brouillon</A><br>';
print '<A href="'.$urlp.'propal.php3?viewstatut=1">Ouvertes</A>';
print "</TD></TR>";
/*
*

View File

@ -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 "<td align=\"center\" width=\"25%\">-</td>";
}
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 "<td bgcolor=\"#e0e0e0\" align=\"center\" width=\"25%\">";
print "[<a href=\"$PHP_SELF?propalid=$propalid&action=presend\">Envoyer la propale par mail</a>]</td>";
@ -347,9 +348,15 @@ if ($propalid) {
print "<b>!! 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 "<p>$sql</p>";
@ -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 "<TR><TD>".strftime("%d %B %Y %H:%M:%S",$objp->da)."</TD>\n";
print "<TD>$objp->author</TD></tr>\n";
$authoract = new User($db);
$authoract->id = $objp->fk_user_author;
$authoract->fetch('');
print "<TD>$authoract->code</TD></tr>\n";
print "<tr><td colspan=\"2\">$objp->note</td></tr>";
$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 "<form method=\"post\" action=\"$PHP_SELF?propalid=$propalid&action=send\">\n";
print "<input type=\"hidden\" name=\"sendto\" value=\"$sendto\">\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";
}

View File

@ -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");
/*
*
*/

View File

@ -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 ";

View File

@ -22,7 +22,7 @@
require("../main.inc.php3");
function llxHeader($head = "") {
global $PREFIX;
global $PREFIX, $user, $conf;
print "<HTML>\n<HEAD>$head\n</HEAD>\n";
?>
@ -44,7 +44,7 @@ function llxHeader($head = "") {
print "<TABLE border=\"1\" cellspacing=\"0\" width=\"100%\" cellpadding=\"3\">";
print "<TR><TD valign=\"top\" align=\"right\">";
print "<center><b>" . $GLOBALS["dbname"] . " - " . $GLOBALS["REMOTE_USER"] ."</B></center>";
print "<center><b>" . $conf->db->name . " - " . $user->code ."</B></center>";
print "<A href=\"/\">Accueil</A>";
print "</td></tr>";

View File

@ -23,7 +23,7 @@
require ("./main.inc.php3");
function llxHeader($head = "") {
global $PREFIX, $user;
global $PREFIX, $user, $conf;
print "<HTML>\n<HEAD>$head\n</HEAD>\n";
?>
@ -33,7 +33,8 @@ function llxHeader($head = "") {
print "<TABLE border=\"0\" width=\"100%\">\n";
print "<TR bgcolor=\"".$GLOBALS["SYS_TOPBAR_BGCOLOR"]."\">";
print "<TD width=\"20%\" bgcolor=\"#e0e0e0\"><B>" . $GLOBALS["MAIN_TITLE"] . "</B></TD>";
print "<TD width=\"20%\" bgcolor=\"#e0e0e0\" align=\"center\"><A href=\"".$urlp."../tech/\">Technique</A></TD>";
print "<TD width=\"20%\" bgcolor=\"#e0e0e0\" align=\"center\">-</TD>";
print '<TD width="20%" bgcolor="#e0e0e0" align="center">';
if ($user->comm > 0) {
@ -41,9 +42,11 @@ function llxHeader($head = "") {
} else {
print 'Commercial';
}
print "<TD width=\"20%\" bgcolor=\"#e0e0e0\" align=\"center\"><A href=\"../compta/\">Compta</A></TD>";
print "<TD width=\"20%\" bgcolor=\"#e0e0e0\" align=\"center\"><A href=\"../stats/\">Stats</A></TD>";
print "<TD width=\"20%\" bgcolor=\"#e0e0e0\" align=\"center\">-</TD>";
print "</TR></TABLE>\n";
print "<TABLE border=\"1\" width=\"100%\">";
@ -55,13 +58,9 @@ function llxHeader($head = "") {
print "<TABLE border=\"1\" cellspacing=\"0\" width=\"100%\" cellpadding=\"3\">";
print "<TR><TD valign=\"top\" align=\"right\">";
print "<center><b>" . $GLOBALS["DB_NAME"] . " - " . $user->code ."</B></center>";
print "<center><b>" . $conf->db->name . " - " . $user->code ."</B></center>";
print "<A href=\"/\">Accueil</A><br>";
print "<A href=\"/graph/\">Stat. quantitatives</A><br>\n";
print "<A href=\"/stats/\">Stat. qualitatives</A><br>\n";
print "<A href=\"/dict/\">Dictionnaires</A>\n";
print '</td></tr>';
print "<TR><TD valign=\"top\" align=\"right\">";
@ -78,9 +77,13 @@ function llxHeader($head = "") {
print "<center><A href=\"/service/\">Services</center></A>\n";
print '</td></tr>';
print "<TR><TD valign=\"top\" align=\"right\">";
print '<div align="center"><A href="user.php3">Utilisateurs</div></A>';
print '</td></tr>';
print "<TR><TD valign=\"top\" align=\"right\">";
print "<A href=\"info.php3\">Configuration</A><br>";
print '</td></tr></table>';
/*