2
0
forked from Wavyzz/dolibarr
This commit is contained in:
Rodolphe Quiedeville
2002-05-04 21:28:42 +00:00
parent ae1327ea57
commit 632b4662d5
24 changed files with 388 additions and 203 deletions

View File

@@ -7,6 +7,8 @@ Paquets Debian requis :
- apache
- libdbd-mysql-perl
- libapache-mod-auth-mysql
- recode
- libtext-unaccent-perl
Configuration :
- dans le repertoire dolibarr/htdocs/conf recopier le fichier

View File

@@ -82,6 +82,9 @@ if ($action=='create' && $actionid && $contactid) {
print '<input type="hidden" name="socid" value="'.$socid.'">';
print '<table width="100%" border="1" cellspacing="0" cellpadding="3">';
print '<tr><td colspan="2" bgcolor="#e0e0e0"><div class="titre">Action effectu<74>e</div></td></tr>';
print '<tr><td width="10%">Action</td><td bgcolor="#e0e0e0"><b>'.$caction->libelle.'</td></tr>';
print '<tr><td width="10%">Soci<63>t<EFBFBD></td><td width="40%"bgcolor="#e0e0e0"><b><a href="index.php3?socid='.$socid.'">'.$societe->nom.'</a></td></tr>';
print '<tr><td width="10%">Contact</td><td width="40%"bgcolor="#e0e0e0"><b>'.$contact->fullname.'</td></tr>';
@@ -89,9 +92,17 @@ if ($action=='create' && $actionid && $contactid) {
print '<tr><td valign="top">Commentaire</td><td>';
print '<textarea cols="60" rows="6" name="note"></textarea></td></tr>';
print '<tr><td width="10%">A recontacter le</td><td width="40%"bgcolor="#e0e0e0"><b>'.$contact->fullname.'</td></tr>';
print '<tr><td colspan="2" bgcolor="#e0e0e0"><div class="titre">Prochaine Action <20> faire</div></td></tr>';
print '<tr><td colspan="2" align="center"><input type="submit"></td></tr>';
print '<tr><td width="10%">Date</td><td width="40%">';
print_date_select();
print '</td></tr>';
print '<tr><td valign="top">Commentaire</td><td>';
print '<textarea cols="60" rows="6" name="next_note"></textarea></td></tr>';
print '<tr><td colspan="2" align="center"><input type="submit" value="Enregistrer"></td></tr>';
print '</form></table>';
$limit = 10;
@@ -162,10 +173,10 @@ $sql .= " WHERE a.fk_soc = s.idp AND c.id=a.fk_action AND a.fk_user_author = u.r
$bc=$bc2;
}
print "<TR $bc>";
print "<TD>" .strftime("%d %b %Y %H:%M",$obj->da)."</TD>\n";
print "<TD>" .strftime("%Y %b %d %H:%M",$obj->da)."</TD>\n";
print "<TD width=\"30%\"><a href=\"index.php3?socid=$obj->socidp\">$obj->societe</A></TD>\n";
print '<TD align="left" valign="top" rowspan="2">'.nl2br($obj->note).'</TD>';
print '<TD align="left" valign="top" rowspan="2">'.nl2br($obj->note).'&nbsp;</TD>';
print "</TR>\n";
print "<TR $bc>";
@@ -181,6 +192,7 @@ $sql .= " WHERE a.fk_soc = s.idp AND c.id=a.fk_action AND a.fk_user_author = u.r
} else {
print '<div class="titre">Liste des actions commerciales effectu<74>es</div>';
$sql = "SELECT s.nom as societe, s.idp as socidp,a.id,".$db->pdate("a.datea")." as da, a.datea, c.libelle, u.code ";
$sql .= " FROM actioncomm as a, c_actioncomm as c, societe as s, llx_user as u";
@@ -198,10 +210,10 @@ if ( $db->query($sql) ) {
$num = $db->num_rows();
$i = 0;
print "<p><TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
print "<TR bgcolor=\"orange\">";
print "<TR>";
print '<TD colspan="4">Date</TD>';
print '<TD><a href="'.$PHP_SELF.'?sortfield=lower(s.nom)&sortorder=ASC">Societe</a></td>';
print '<TD><a href="'.$PHP_SELF.'?sortfield=c.libelle">Action</a></TD>';
print '<TD>Soci<EFBFBD>t<EFBFBD></a></td>';
print '<TD>Action</a></TD>';
print "<TD>Auteur</TD>";
print "</TR>\n";
$var=True;
@@ -216,9 +228,22 @@ if ( $db->query($sql) ) {
$bc=$bc2;
}
print "<TR $bc>";
print "<TD>" .strftime("%d",$obj->da)."</TD>\n";
print "<TD>" .strftime("%b",$obj->da)."</TD>\n";
if ($oldyear == strftime("%Y",$obj->da) ) {
print '<td align="center">|</td>';
} else {
print "<TD>" .strftime("%Y",$obj->da)."</TD>\n";
$oldyear = strftime("%Y",$obj->da);
}
if ($oldmonth == strftime("%Y%b",$obj->da) ) {
print '<td align="center">|</td>';
} else {
print "<TD>" .strftime("%b",$obj->da)."</TD>\n";
$oldmonth = strftime("%Y%b",$obj->da);
}
print "<TD>" .strftime("%d",$obj->da)."</TD>\n";
print "<TD>" .strftime("%H:%M",$obj->da)."</TD>\n";
print "<TD width=\"50%\"><a href=\"index.php3?socid=$obj->socidp\">$obj->societe</A></TD>\n";
@@ -237,5 +262,5 @@ if ( $db->query($sql) ) {
$db->close();
llxFooter();
llxFooter("<em>Derni&egrave;re modification $Date$ r&eacute;vision $Revision$</em>");
?>

View File

@@ -424,7 +424,7 @@ if ($socid > 0) {
print "</td>";
print "<td>$obj->poste&nbsp;</td>";
print '<td><a href="actioncomm.php3?action=create&actionid=1&contactid='.$obj->idp.'&socid='.$objsoc->idp.'">'.$obj->phone.'</a>&nbsp;</td>';
print "<td>$obj->fax&nbsp;</td>";
print '<td><a href="actioncomm.php3?action=create&actionid=2&contactid='.$obj->idp.'&socid='.$objsoc->idp.'">'.$obj->fax.'</a>&nbsp;</td>';
print '<td><a href="actioncomm.php3?action=create&actionid=4&contactid='.$obj->idp.'&socid='.$objsoc->idp.'">'.$obj->email.'</a>&nbsp;</td>';
print "<td><a href=\"people.php3?socid=$objsoc->idp&action=editcontact&contactid=$obj->idp\">Modifier</a></td>";
print "</tr>\n";
@@ -464,12 +464,28 @@ if ($socid > 0) {
} else {
print "<tr>";
}
print "<td>". strftime("%d %b %Y %H:%M", $obj->da) ."</td>";
if ($oldyear == strftime("%Y",$obj->da) ) {
print '<td align="center">|</td>';
} else {
print "<TD align=\"center\">" .strftime("%Y",$obj->da)."</TD>\n";
$oldyear = strftime("%Y",$obj->da);
}
if ($oldmonth == strftime("%Y%b",$obj->da) ) {
print '<td align="center">|</td>';
} else {
print "<TD align=\"center\">" .strftime("%b",$obj->da)."</TD>\n";
$oldmonth = strftime("%Y%b",$obj->da);
}
print "<TD>" .strftime("%d",$obj->da)."</TD>\n";
print "<TD>" .strftime("%H:%M",$obj->da)."</TD>\n";
if ($obj->propalrowid) {
print "<td><a href=\"propal.php3?propalid=$obj->propalrowid\">$obj->libelle</a></td>";
print '<td width="40%"><a href="propal.php3?propalid='.$obj->propalrowid.'">'.$obj->libelle.'</a></td>';
} else {
print "<td>$obj->libelle</td>";
print '<td width="40%">'.$obj->libelle.'</td>';
}
/*
* Contact pour cette action
@@ -478,13 +494,13 @@ if ($socid > 0) {
if ($obj->fk_contact) {
$contact = new Contact($db);
$contact->fetch($obj->fk_contact);
print '<td><a href="people.php3?socid='.$objsoc->idp.'&contactid='.$contact->id.'">'.$contact->fullname.'</a></td>';
print '<td width="40%"><a href="people.php3?socid='.$objsoc->idp.'&contactid='.$contact->id.'">'.$contact->fullname.'</a></td>';
} else {
print '<td>&nbsp;</td>';
print '<td width="40%">&nbsp;</td>';
}
/*
*/
print '<td><a href="../user.php3">'.$obj->code.'</a></td>';
print '<td width="20%"><a href="../user.php3">'.$obj->code.'</a></td>';
print "</tr>\n";
$i++;
$tag = !$tag;
@@ -651,7 +667,7 @@ if ($socid > 0) {
print "<TD><a href=\"index.php3?sortfield=lower(s.nom)&sortorder=$sortorder&begin=$begin\">Societe</a></td>";
print "<TD>Contact</TD>";
print "<TD>email</TD>";
print "<TD align=\"center\">Statut</TD><td>&nbsp;</td><td>&nbsp;</td>";
print "<TD align=\"center\">Statut</TD><td>&nbsp;</td><td colspan=\"2\">&nbsp;</td>";
print "</TR>\n";
$var=True;
while ($i < $num) {
@@ -666,7 +682,12 @@ if ($socid > 0) {
print "<TD>&nbsp;</TD>\n";
print "<TD align=\"center\">$obj->stcomm</TD>\n";
print "<TD align=\"center\">$obj->prefix_comm&nbsp;</TD>\n";
print "<TD><a href=\"addpropal.php3?socidp=$obj->idp&action=create\">[Propal]</A></td>\n";
print "<TD align=\"center\"><a href=\"addpropal.php3?socidp=$obj->idp&action=create\">[Propal]</A></td>\n";
if ($conf->fichinter->enabled) {
print "<TD align=\"center\"><a href=\"../fichinter/fiche.php3?socidp=$obj->idp&action=create\">[Fiche Inter]</A></td>\n";
} else {
print "<TD>&nbsp;</TD>\n";
}
print "</TR>\n";
$i++;
}

View File

@@ -41,22 +41,22 @@ function llxHeader($head = "", $urlp = "") {
print "<A href=\"".$urlp."../\">Accueil</A><br>";
print "<A href=\"".$urlp."bookmark.php3\">Bookmark</A>";
print "</td></tr>";
print "<tr><td valign=\"top\" align=\"right\">";
print "<CENTER><A href=\"".$urlp."index.php3\">Clients</A></CENTER>\n";
print '<TR><TD class="barre" valign="top" align="right">';
print "<div align=\"center\"><A href=\"".$urlp."index.php3\">Clients</A></div>\n";
print "<A href=\"".$urlp."../soc.php3?&action=create\">Nouvelle soci<63>t<EFBFBD></A><BR>\n";
print "<A href=\"".$urlp."contact.php3\">Contacts</A><BR><br>\n";
print "<A href=\"".$urlp."recontact.php3\">A Recontacter</A><BR>\n";
print "</TD></TR>";
print "<TR><TD valign=\"top\" align=\"right\">";
print '<TR><TD class="barre" valign="top" align="right">';
print "<div align=\"center\"><A href=\"".$urlp."actioncomm.php3\">Actions</A></div>\n";
print "</TD></TR>";
/*
*
*/
print '<TR><TD valign="top" align="right" bgcolor="#e0e0e0">';
print '<TR><TD class="barre_select" valign="top" align="right">';
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>';
@@ -64,26 +64,26 @@ function llxHeader($head = "", $urlp = "") {
/*
*
*/
print "<TR><TD valign=\"top\" align=\"right\">";
print '<TR><TD class="barre" valign="top" align="right">';
print '<div align="center"><A href="'.$urlp.'../compta/">Factures</A></div>';
print "</TD></TR>";
/*
*
*/
print "<TR><TD valign=\"top\" align=\"right\">";
print '<TR><TD class="barre" valign="top" align="right">';
print '<div align="center"><A href="'.$urlp.'../product/">Produits</A></div>';
print '<div align="center"><A href="'.$urlp.'../service/">Services</A></div>';
print "</td></tr>";
/*
*
*/
print "<tr><td align=\"right\" valign=\"top\">";
print "<A href=\"projet/\">Projets</A><BR>\n";
print '<TR><TD class="barre" valign="top" align="right">';
print '<div align="center"><A href="projet/">Projets</A></div>';
print "</td></tr>";
/*
*
*/
print "<tr><td align=\"right\" valign=\"top\">";
print '<TR><TD class="barre" valign="top" align="right">';
print "<CENTER><A href=\"".$urlp."index.php3\">Societes</A></CENTER>\n";
print "<form action=\"index.php3\">";
print '<input type="hidden" name="mode" value="search">';

View File

@@ -163,14 +163,10 @@ if ($propalid) {
/*
*
*/
print "<tr bgcolor=\"#f0f0f0\"><td>Statut :</td><td colspan=1 align=center><b>$obj->lst</b></td>";
if ($obj->statut == 0) {
print "<td colspan=3 align=center>[<a href=\"$PHP_SELF?propalid=$propalid&valid=1\">Valider</a>]</td>";
} elseif ($obj->statut == 1) {
print "<td colspan=3 align=center>[<a href=\"$PHP_SELF?propalid=$propalid&action=statut\">Changer</a>]</td>";
} else {
print "<td colspan=3>&nbsp;</td>";
}
print "<tr bgcolor=\"#f0f0f0\"><td>Statut :</td><td colspan=2 align=center><b>$obj->lst</b></td>";
print '</tr>';
print "</table>";
@@ -269,9 +265,13 @@ if ($propalid) {
if ($obj->statut == 0) {
print "<td bgcolor=\"#e0e0e0\" align=\"center\" width=\"25%\">[<a href=\"$PHP_SELF?propalid=$propalid&action=delete\">Supprimer</a>]</td>";
} else {
if ($obj->statut == 1) {
print "<td bgcolor=\"#e0e0e0\" align=center>[<a href=\"$PHP_SELF?propalid=$propalid&action=statut\">Cloturer</a>]</td>";
} else {
print "<td align=\"center\" width=\"25%\">-</td>";
}
}
if ($obj->statut == 2) {
print "<td bgcolor=\"#e0e0e0\" align=\"center\" width=\"25%\"><a href=\"facture.php3?propalid=$propalid&action=create\">Emettre une facture</td>";
} else {
@@ -460,6 +460,7 @@ if ($propalid) {
$cloturor = new User($db, $obj->fk_user_cloture);
$cloturor->fetch('');
print 'Suivi des actions<br>';
print '<table cellspacing=0 border=1 cellpadding=3>';
print '<tr><td>&nbsp;</td><td>Nom</td><td>Date</td></tr>';
print '<tr><td>Cr<43>ation</td><td>'.$author->fullname.'</td>';

View File

@@ -19,6 +19,11 @@
*
*/
TD.barre_select { background: #d9dcc2 }
TD.barre { background: #e0e0e0 }
TD.menu { background: #d9dcc2; font-family: Helvetica, Verdana; font-size: 14px; font-weight: bold; color: #FFFFFF; text-decoration: none }
DIV.titre { font-family: Helvetica, Verdana; font-size: 16px; font-weight: bold; color: #000000; text-decoration: none }

View File

@@ -64,12 +64,13 @@ if ($action == 'add') {
$fichinter->ref = $ref;
$id = $fichinter->create();
}
/*
*
* Generation
*
*/
if ($action == 'generate') {
if ($id) {
print "<hr><b>G<>n<EFBFBD>ration du PDF</b><p>";
@@ -77,12 +78,15 @@ if ($action == 'add') {
$gljroot = "/home/www/dolibarr/dolibarr/htdocs";
$command = "export DBI_DSN=\"dbi:mysql:dbname=".$conf->db->name.":host=localhost\" ";
$command .= " ; ./propal-tex.pl --propal=".$id ." --pdf --output=".$conf->propal->outputdir;
$command .= " --templates=".$conf->propal->templatesdir;
$command = 'export DBI_DSN="dbi:'.$conf->db->type.':dbname='.$conf->db->name.':host='.$conf->db->host.'"';
$command .= " ; ./tex-fichinter.pl --fichinter=".$id ;
$command .= " --pdf --ps";
$command .= " --output=" .$conf->fichinter->outputdir;
$command .= " --templates=" .$conf->fichinter->templatesdir;
$output = system($command);
print "<p>command : $command<br>";
print "<p>command : <b>$command<br>";
print $output;
} else {
print $db->error();
@@ -236,6 +240,24 @@ if ($id) {
}
print '<tr><td valign="top">Action</td><td><a href="fiche.php3?id='.$id.'&action=generate">G<>n<EFBFBD>ration du pdf</a></td></tr>';
print '<tr><td>Documents</td><td><a href="'.$conf->fichinter->outputurl.'/'.$fichinter->ref.'">liste...</a>';
$file = $conf->fichinter->outputdir . "/$fichinter->ref/$fichinter->ref.pdf";
if (file_exists($file)) {
print '<br>PDF : <a href="'.$conf->fichinter->outputurl.'/'.$fichinter->ref.'/'.$fichinter->ref.'.pdf">'.$fichinter->ref.'.pdf</a>';
}
$file = $conf->fichinter->outputdir . "/$fichinter->ref/$fichinter->ref.ps";
if (file_exists($file)) {
print '<br>PS : <a href="'.$conf->fichinter->outputurl.'/'.$fichinter->ref.'/'.$fichinter->ref.'.ps">'.$fichinter->ref.'.ps</a><br>';
}
print '</td></tr>';
print "</table>";
}

View File

@@ -43,7 +43,7 @@ function llxHeader($head = "", $urlp = "") {
print "</td></tr>";
print "<tr><td valign=\"top\" align=\"right\">";
print "<CENTER><A href=\"".$urlp."index.php3\">Clients</A></CENTER>\n";
print "<CENTER><A href=\"".$urlp."../comm/index.php3\">Clients</A></CENTER>\n";
print "<A href=\"".$urlp."../soc.php3?&action=create\">Nouvelle soci<63>t<EFBFBD></A><BR>\n";
print "<A href=\"".$urlp."contact.php3\">Contacts</A><BR><br>\n";
print "</TD></TR>";

View File

@@ -25,6 +25,7 @@ llxHeader();
print '<table border="1" cellpadding="3" cellspacing="0">';
print '<tr><td bgcolor="#e0e0e0" colspan="2">Database</td></tr>';
print '<tr><td>type</td><td>' . $conf->db->type . '</td></tr>';
print '<tr><td>host</td><td>' . $conf->db->host . '</td></tr>';
print '<tr><td>user</td><td>' . $conf->db->user . '&nbsp;</td></tr>';
print '<tr><td>pass</td><td>' . $conf->db->pass . '&nbsp;</td></tr>';
@@ -36,7 +37,12 @@ print '<tr><td>templates</td><td>' . $conf->propal->templatesdir . '</td></tr>';
print '<tr><td>output dir</td><td>' . $conf->propal->outputdir . '</td></tr>';
print '<tr><td>output url</td><td>' . $conf->propal->outputurl . '</td></tr>';
if ($conf->fichinter->enabled) {
print '<tr><td bgcolor="#e0e0e0" colspan="2">Fiche d\'intervention</td></tr>';
print '<tr><td>templates</td><td>' . $conf->fichinter->templatesdir . '</td></tr>';
print '<tr><td>output dir</td><td>' . $conf->fichinter->outputdir . '</td></tr>';
print '<tr><td>output url</td><td>' . $conf->fichinter->outputurl . '</td></tr>';
}
print '</table>';

View File

@@ -25,6 +25,48 @@
*
*/
function print_date_select() {
$strmonth[1] = "Janvier";
$strmonth[2] = "F&eacute;vrier";
$strmonth[3] = "Mars";
$strmonth[4] = "Avril";
$strmonth[5] = "Mai";
$strmonth[6] = "Juin";
$strmonth[7] = "Juillet";
$strmonth[8] = "Ao&ucirc;t";
$strmonth[9] = "Septembre";
$strmonth[10] = "Octobre";
$strmonth[11] = "Novembre";
$strmonth[12] = "D&eacute;cembre";
$smonth = 1;
$syear = date("Y", time());
print "<select name=\"reday\">";
for ($day = 1 ; $day < $sday + 32 ; $day++) {
print "<option value=\"$day\">$day";
}
print "</select>";
$cmonth = date("n", time());
print "<select name=\"remonth\">";
for ($month = $smonth ; $month < $smonth + 12 ; $month++) {
if ($month == $cmonth) {
print "<option value=\"$month\" SELECTED>" . $strmonth[$month];
} else {
print "<option value=\"$month\">" . $strmonth[$month];
}
}
print "</select>";
print "<select name=\"reyear\">";
for ($year = $syear ; $year < $syear + 5 ; $year++) {
print "<option value=\"$year\">$year";
}
print "</select>";
}
function price($amount) {
return number_format($amount, 2, '.', ' ');

View File

@@ -51,6 +51,7 @@ class Product {
$this->description = $result["description"];
$this->price = $result["price"];
}
$this->db->free();
return $result;
}

View File

@@ -53,7 +53,7 @@ function top_menu($head) {
print "<HTML><HEAD>";
print $head;
print "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=iso-8859-1\">\n";
print '<LINK REL="stylesheet" TYPE="text/css" HREF="/dolibarr.css">';
print '<LINK REL="stylesheet" TYPE="text/css" HREF="/'.$conf->css.'">';
print "</HEAD>\n";
print '<BODY BGCOLOR="#c0c0c0" TOPMARGIN="0" BOTTOMMARGIN="0" LEFTMARGIN="0" RIGHTMARGIN="0" MARGINHEIGHT="0" MARGINWIDTH="0">';

View File

@@ -54,7 +54,7 @@ function llxHeader($head = "") {
print "<center><A href=\"/compta/\">Factures</center></A>\n";
print '</td></tr>';
if ($conf->fichinter) {
if ($conf->fichinter->enabled) {
print "<TR><TD valign=\"top\" align=\"right\">";
print "<center><A href=\"/fichinter/\">Fiches d'intervention</center></A>\n";

83
htdocs/product/fiche.php3 Normal file
View File

@@ -0,0 +1,83 @@
<?PHP
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
*
* $Id$
* $Source$
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
require("./pre.inc.php3");
llxHeader();
$db = new Db();
if ($action == 'update') {
$sql = "UPDATE llx_product SET description='$desc' where rowid = $rowid";
$db->query($sql);
}
if ($id) {
$product = new Product($db);
$result = $product->fetch($id);
if ( $result ) {
print '<div class="titre">Fiche produit : '.$product->ref.'</div>';
print "<p><TABLE border=\"1\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
print "<TR>";
print "<TD>R<>f<EFBFBD>rence</td><td>$product->ref</a></tr>\n";
print "<TD>Libell<6C></td><td>$product->label</TD></tr>\n";
print "<tr><td>Prix</td><TD>$product->price</td></tr>\n";
print "<tr><td valign=\"top\">Description</td><td>".nl2br($product->description)."</td></tr>";
}
print "</TABLE>";
if ($action == 'edit') {
print "<hr><form action=\"$PHP_SELF?rowid=$rowid\" method=\"post\">\n";
print "<input type=\"hidden\" name=\"action\" value=\"update\">";
print "<textarea name=\"desc\" rows=\"12\" cols=\"40\">";
print nl2br($product->description);
print "</textarea><br>";
print "<input type=\"submit\">";
print "</form>";
}
} else {
print "Error";
}
$db->close();
llxFooter("<em>Derni&egrave;re modification $Date$ r&eacute;vision $Revision$</em>");
?>

View File

@@ -51,50 +51,8 @@ $offset = $limit * $page ;
$pageprev = $page - 1;
$pagenext = $page + 1;
print "<a href=\"$PHP_SELF\">Liste</a><P>";
print '<div class="titre">Liste des produits</div>';
if ($rowid) {
$sql = "SELECT p.rowid, p.label, p.price, p.description, p.duration,p.ref FROM llx_product as p";
$sql .= " WHERE p.rowid = $rowid;";
if ( $db->query($sql) ) {
$num = $db->num_rows();
$i = 0;
print "<p><TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
print "<TR bgcolor=\"orange\">";
print "<TD>R<>f</TD>";
print "<TD><a href=\"$PHP_SELF?sortfield=lower(p.label)&sortorder=ASC\">Nom</a></td>";
print "</TR>\n";
$var=True;
if ( $num ) {
$objp = $db->fetch_object(0);
$var=!$var;
print "<TR $bc[$var]>";
print "<TD><a href=\"$PHP_SELF?rowid=$objp->rowid\">$objp->ref</a></TD>\n";
print "<TD>$objp->label</TD></tr>\n";
print "<tr><td>prix</td><TD>$objp->price</td></tr>\n";
print "<tr><td>duree</td><TD>$objp->duration</td></tr>\n";
print "<tr><td>desc</td><td>".nl2br($objp->description)."</td></tr>";
$i++;
}
print "</TABLE>";
$db->free();
print "<hr><form action=\"$PHP_SELF?rowid=$rowid\" method=\"post\">\n";
print "<input type=\"hidden\" name=\"action\" value=\"update\">";
print "<textarea name=\"desc\" rows=\"12\" cols=\"40\">";
print nl2br($objp->description);
print "</textarea><br>";
print "<input type=\"submit\">";
print "</form>";
}
} else {
$sql = "SELECT p.rowid, p.label, p.price, p.duration,p.ref FROM llx_product as p";
@@ -109,17 +67,15 @@ if ($rowid) {
print "<TD>R<>f</TD>";
print "<TD><a href=\"$PHP_SELF?sortfield=lower(p.label)&sortorder=ASC\">Nom</a></td>";
print "<TD align=\"right\">Prix</TD>";
print "<TD align=\"right\">Dur<75>e</TD>";
print "</TR>\n";
$var=True;
while ($i < $num) {
$objp = $db->fetch_object( $i);
$var=!$var;
print "<TR $bc[$var]>";
print "<TD><a href=\"$PHP_SELF?rowid=$objp->rowid\">$objp->ref</a></TD>\n";
print "<TD><a href=\"fiche.php3?id=$objp->rowid\">$objp->ref</a></TD>\n";
print "<TD>$objp->label</TD>\n";
print '<TD align="right">'.price($objp->price).'</TD>';
print "<TD align=\"right\">$objp->duration</TD>\n";
print "</TR>\n";
$i++;
}
@@ -127,7 +83,7 @@ if ($rowid) {
$db->free();
}
}
$db->close();
llxFooter("<em>Derni&egrave;re modification $Date$ r&eacute;vision $Revision$</em>");

View File

@@ -22,59 +22,55 @@
require("../main.inc.php3");
function llxHeader($head = "", $urlp = "") {
global $PREFIX, $user, $conf;
global $user, $conf;
print "<HTML>\n<HEAD>$head\n</HEAD>\n";
?>
<BODY BGCOLOR="#c0c0c0" TOPMARGIN="0" BOTTOMMARGIN="0" LEFTMARGIN="0" RIGHTMARGIN="0" MARGINHEIGHT="0" MARGINWIDTH="0">
<?PHP
/*
*
*
*/
top_menu($head);
print "<TABLE border=\"0\" width=\"100%\">\n";
print "<TR bgcolor=\"".$GLOBALS["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%\" align=\"center\"><A href=\"".$urlp."../comm/\">Commercial</A></TD>";
print "<TD width=\"20%\" bgcolor=\"#e0e0e0\" align=\"center\"><A href=\"".$urlp."../compta/\">Compta</A></TD>";
print "<TD width=\"20%\" bgcolor=\"#e0e0e0\" align=\"center\"><A href=\"".$urlp."../stats/\">Stats</A></TD>";
print "</TR></TABLE>\n";
print "<TABLE border=\"1\" width=\"100%\" cellpadding=\"0\">";
print "<TR><TD valign=\"top\" align=\"right\">";
print "<TABLE border=\"1\" cellspacing=\"0\" width=\"100%\" cellpadding=\"3\">";
print "<TR><TD valign=\"top\" align=\"right\">";
print '<TR><TD class="barre" valign="top" align="right">';
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>";
print "<tr><td valign=\"top\" align=\"right\">";
print '<TR><TD class="barre" valign="top" align="right">';
print "<CENTER><A href=\"".$urlp."index.php3\">Societe</A></CENTER>\n";
print "<A href=\"".$urlp."contact.php3\">Contact</A><BR>\n";
print "</TD></TR>";
print '<TR><TD class="barre_select" valign="top" align="right">';
print "<div align=\"center\"><A href=\"index.php3\">Produits</A></div>";
print "</TD></TR>";
print "<TR><TD valign=\"top\" align=\"right\">";
print '<TR><TD class="barre" valign="top" align="right">';
print "<div align=\"center\"><A href=\"".$urlp."../comm/actioncomm.php3\">Actions</A></div>\n";
print "</TD></TR>";
/*
*
*/
print "<TR><TD valign=\"top\" align=\"right\">";
print '<TR><TD class="barre" valign="top" align="right">';
print '<div align="center"><A href="'.$urlp.'propal.php3">Propal</A></div>';
print "</TD></TR>";
/*
*
*/
print "<TR><TD valign=\"top\" align=\"right\">";
print '<TR><TD class="barre" valign="top" align="right">';
print '<div align="center"><A href="'.$urlp.'../compta/\">Factures</A></div>';
print "</TD></TR>";
/*
*
*/
print "<tr><td align=\"right\" valign=\"top\">";
print '<TR><TD class="barre" valign="top" align="right">';
print "<CENTER><A href=\"".$urlp."../comm/index.php3\">Societes</A></CENTER>\n";
print "<form action=\"../comm/index.php3\">";
print '<input type="hidden" name="mode" value="search">';

View File

@@ -23,9 +23,6 @@
require("./pre.inc.php3");
llxHeader();
$bc[0]="bgcolor=\"#90c090\"";
$bc[1]="bgcolor=\"#b0e0b0\"";
$db = new Db();
if ($sortfield == "") {
@@ -61,9 +58,9 @@ if ( $db->query($sql) ) {
$i = 0;
print "<p><TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
print "<TR bgcolor=\"orange\">";
print "<TD>R<>f</TD>";
print "<TD><a href=\"$PHP_SELF?sortfield=lower(p.label)&sortorder=ASC\">Nom</a></td>";
print "<TD align=\"right\">Prix</TD>";
print "<TH>R<>f</TH>";
print "<TH><a href=\"$PHP_SELF?sortfield=lower(p.label)&sortorder=ASC\">Nom</a></th>";
print "<TH align=\"right\">Prix</th>";
print "</TR>\n";
$var=True;
while ($i < $num) {

View File

@@ -22,55 +22,47 @@
require("../main.inc.php3");
function llxHeader($head = "", $urlp = "") {
global $PREFIX, $user;
global $user, $conf;
print "<HTML>\n<HEAD>$head\n</HEAD>\n";
?>
<BODY BGCOLOR="#c0c0c0" TOPMARGIN="0" BOTTOMMARGIN="0" LEFTMARGIN="0" RIGHTMARGIN="0" MARGINHEIGHT="0" MARGINWIDTH="0">
<?PHP
/*
*
*
*/
top_menu($head);
print "<TABLE border=\"0\" width=\"100%\">\n";
print "<TR bgcolor=\"".$GLOBALS["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%\" align=\"center\"><A href=\"".$urlp."../comm/\">Commercial</A></TD>";
print "<TD width=\"20%\" bgcolor=\"#e0e0e0\" align=\"center\"><A href=\"".$urlp."../compta/\">Compta</A></TD>";
print "<TD width=\"20%\" bgcolor=\"#e0e0e0\" align=\"center\"><A href=\"".$urlp."../stats/\">Stats</A></TD>";
print "</TR></TABLE>\n";
print "<TABLE border=\"1\" width=\"100%\" cellpadding=\"0\">";
print "<TR><TD valign=\"top\" align=\"right\">";
print "<TABLE border=\"1\" cellspacing=\"0\" width=\"100%\" cellpadding=\"3\">";
print "<TR><TD valign=\"top\" align=\"right\">";
print '<TR><TD class="barre" valign="top" align="right">';
print "<center><b>" . $GLOBALS["dbname"] . " - " . $user->code ."</B></center>";
print "<A href=\"".$urlp."../\">Accueil</A><br>";
print "<A href=\"".$urlp."bookmark.php3\">Bookmark</A>";
print "</td></tr>";
print "<tr><td valign=\"top\" align=\"right\">";
print '<TR><TD class="barre" valign="top" align="right">';
print "<CENTER><A href=\"".$urlp."../comm/index.php3\">Societe</A></CENTER>\n";
print "<A href=\"".$urlp."contact.php3\">Contact</A><BR>\n";
print "</TD></TR>";
print "<TR><TD valign=\"top\" align=\"right\">";
print '<TR><TD class="barre" valign="top" align="right">';
print "<div align=\"center\"><A href=\"".$urlp."actioncomm.php3\">Actions</A></div>\n";
print "</TD></TR>";
/*
*
*/
print "<TR><TD valign=\"top\" align=\"right\">";
print '<TR><TD class="barre" valign="top" align="right">';
print "<center><A href=\"/product/\">Produits</center></A>\n";
print "</TD></TR>";
print '<TR><TD valign="top" bgcolor="#e0e0e0" align="right">';
print '<TR><TD class="barre_select" valign="top" align="right">';
print '<div align="center"><A href="/service/">Services</A></div><br>';
print '<a href="fiche.php3?action=create">Nouveau service</a>';
print '</td></tr>';
print "<tr><td align=\"right\" valign=\"top\">";
print '<TR><TD class="barre" valign="top" align="right">';
print "<CENTER><A href=\"".$urlp."../comm/index.php3\">Societes</A></CENTER>\n";
print "<form action=\"../comm/index.php3\">";
print '<input type="hidden" name="mode" value="search">';

View File

@@ -61,6 +61,7 @@ if ($action == 'update') {
$soc->tel = $tel;
$soc->fax = $fax;
$soc->url = $url;
$soc->siren = $siren;
$soc->update($socid);
}
@@ -110,15 +111,18 @@ if ($action == 'create') {
print '<table border="1" cellpadding="3" cellspacing="0">';
print '<tr><td>Nom</td><td><input type="text" name="nom" value="'.$soc->nom.'"></td></tr>';
print '<tr><td>Adresse</td><td><textarea name="adresse" cols="30" rows="3" wrap="soft"></textarea></td></tr>';
print '<tr><td>CP</td><td><input size="6" type="text" name="cp">&nbsp;';
print 'Ville&nbsp;<input type="text" name="ville"></td></tr>';
print '<tr><td valign="top">Adresse</td><td><textarea name="adresse" cols="30" rows="3" wrap="soft">';
print $soc->adresse;
print '</textarea></td></tr>';
print '<tr><td>CP</td><td><input size="6" type="text" name="cp" value="'.$soc->cp.'">&nbsp;';
print 'Ville&nbsp;<input type="text" name="ville" value="'.$soc->ville.'"></td></tr>';
print '<tr><td>Tel</td><td><input type="text" name="tel" value="'.$soc->tel.'"></td></tr>';
print '<tr><td>Fax</td><td><input type="text" name="fax" value="'.$soc->fax.'"></td></tr>';
print '<tr><td>Web</td><td>http://<input type="text" name="url" value="'.$soc->url.'"></td></tr>';
print '<tr><td>Siren</td><td><input type="text" name="siren"></td></tr>';
print '<tr><td>Siren</td><td><input type="text" name="siren" value="'.$soc->siren.'"></td></tr>';
print '<tr><td>Type</td><td><select name="type">';
print '</select>';
@@ -137,17 +141,16 @@ if ($action == 'create') {
$soc->id = $socid;
$soc->fetch();
print "[<a href=\"soc.php3?socid=$socid&action=edit\">Editer</a>]";
print '<table>';
print '<table border="1" cellpadding="3" cellspacing="0">';
print '<tr><td>Nom</td><td>'.$soc->nom.'</td></tr>';
print '<tr><td>Adresse</td><td><textarea name="adresse" cols="30" rows="3" wrap="soft"></textarea></td></tr>';
print '<tr><td>CP</td><td><input size="6" type="text" name="cp">&nbsp;';
print 'Ville&nbsp;<input type="text" name="ville"></td></tr>';
print '<tr><td valign="top">Adresse</td><td>'.nl2br($soc->adresse).'</td></tr>';
print '<tr><td>CP</td><td>'.$soc->cp.'&nbsp;'.$soc->ville.'</td></tr>';
print '<tr><td>Tel</td><td>'.$soc->tel.'</td></tr>';
print '<tr><td>Fax</td><td>'.$soc->fax.'</td></tr>';
print '<tr><td>Web</td><td><a href="http://'.$soc->url.'">http://'.$soc->url.'</a></td></tr>';
print '<tr><td>Siren</td><td><input type="text" name="siren"></td></tr>';
print '<tr><td>Siren</td><td>'.$soc->siren.'</td></tr>';
print '<tr><td>Type</td><td><select name="type">';
print '</select>';

View File

@@ -30,7 +30,7 @@ class User {
var $prenom;
var $code;
var $email;
var $admin;
var $comm;
var $compta;
@@ -49,7 +49,7 @@ class User {
Function fetch($login) {
$sql = "SELECT u.rowid, u.name, u.firstname, u.email, u.code, u.module_comm, u.module_compta";
$sql = "SELECT u.rowid, u.name, u.firstname, u.email, u.code, u.admin, u.module_comm, u.module_compta,webcal_login";
$sql .= " FROM llx_user as u";
if ($this->id) {
@@ -69,7 +69,8 @@ class User {
$this->prenom = $obj->firstname;
$this->fullname = $this->prenom . ' ' . $this->nom;
$this->admin = $obj->admin;
$this->webcal_login = $obj->webcal_login;
$this->code = $obj->code;
$this->email = $obj->email;

View File

@@ -24,6 +24,7 @@
delete from c_actioncomm;
insert into c_actioncomm (id,libelle) values ( 1, 'Appel T<>l<EFBFBD>phonique');
insert into c_actioncomm (id,libelle) values ( 2, 'Envoi Fax');
insert into c_actioncomm (id,libelle) values ( 3, 'Envoi propal par mail');
insert into c_actioncomm (id,libelle) values ( 4, 'Envoi d\'un email');
insert into c_actioncomm (id,libelle) values ( 9, 'Envoi Facture');

View File

@@ -31,6 +31,8 @@ create table llx_user
firstname varchar(50),
code varchar(4),
email varchar(255),
admin smallint default 0,
webcal_login varchar(25),
module_comm smallint default 1,
module_compta smallint default 1,
note text,

View File

@@ -1,8 +1,22 @@
%
% footer.tex
% Copyright (C) 2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
%
% $Id$
% $Source$
%
% 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
% the Free Software Foundation; either version 2 of the License, or
% (at your option) any later version.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with this program; if not, write to the Free Software
% Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
% or see http://www.gnu.org/
\multicolumn{1}{|c|}{} & & \multicolumn{1}{|c|}{} & \multicolumn{1}{|r|}{} & \multicolumn{1}{|r|}{} \\
\hline

View File

@@ -1,8 +1,23 @@
%
% header.tex
% Copyright (C) 2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
%
% $Id$
% $Source$
%
% 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
% the Free Software Foundation; either version 2 of the License, or
% (at your option) any later version.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with this program; if not, write to the Free Software
% Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
% or see http://www.gnu.org/
\documentclass[a4paper]{article}
\usepackage{fancyhdr, hhline}
\usepackage[francais]{layout}