Commit for release

This commit is contained in:
Rodolphe Quiedeville 2003-06-22 12:16:11 +00:00
parent 94446fb402
commit e81e80ab12
7 changed files with 225 additions and 227 deletions

View File

@ -220,5 +220,19 @@ print "</table>";
print "</form>";
$db->close();
llxFooter();
/*
* Repertoire
*/
print_titre("Chemins d'accés aux documents");
print '<table border="1" cellpadding="3" cellspacing="0">';
print '<TR class="liste_titre">';
print '<td>Nom</td><td>Valeur</td>';
print "</TR>\n";
print '<tr><td>Répertoire</td><td><a href="file:/'.FAC_OUTPUTDIR.'">'.FAC_OUTPUTDIR.'</a></td></tr>';
print '<tr><td>URL</td><td><a href="'.FAC_OUTPUT_URL.'">'.FAC_OUTPUT_URL.'</a></td></tr>';
print "</table>";
llxFooter("<em>Derni&egrave;re modification $Date$ r&eacute;vision $Revision$</em>");
?>

View File

@ -24,54 +24,29 @@ llxHeader();
print_titre("Configuration Dolibarr (version ".DOL_VERSION.")");
print '<table border="1" cellpadding="3" cellspacing="0">';
print '<tr><td>css</td><td>' . $conf->css . '</td></tr>';
print '<tr><td>theme</td><td>' . $conf->theme . '</td></tr>';
print '<tr><td>document root</td><td>' . $DOCUMENT_ROOT . '</td></tr>';
print '<TR class="liste_titre">';
print '<td>Nom</td><td>Valeur</td><td>Action</td>';
print "</TR>\n";
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>';
print '<tr><td>Database name</td><td>' . $conf->db->name . '</td></tr>';
print '<tr class="list_sep"><td bgcolor="#e0e0e0" colspan="2">Propale</td></tr>';
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>';
print '<tr class="list_sep"><td bgcolor="#e0e0e0" colspan="2">Facture</td></tr>';
print '<tr><td>templates</td><td>' . $conf->facture->templatesdir . '</td></tr>';
print '<tr><td>output dir</td><td>' . $conf->facture->outputdir . '</td></tr>';
print '<tr><td>output url</td><td>' . $conf->facture->outputurl . '</td></tr>';
print '<tr><td>Version</td><td>' . DOL_VERSION . '</td><td>&nbsp;</td></tr>';
print '<tr><td>css</td><td>' . $conf->css . '</td><td>&nbsp;</td></tr>';
print '<tr><td>theme</td><td>' . $conf->theme . '</td><td>&nbsp;</td></tr>';
print '<tr><td>document root</td><td>' . DOL_DOCUMENT_ROOT . '</td><td>&nbsp;</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 '<tr class="liste_titre"><td colspan="3">Database</td></tr>';
print '<tr><td>type</td><td>' . $conf->db->type . '</td><td>&nbsp;</td></tr>';
print '<tr><td>host</td><td>' . $conf->db->host . '</td><td>&nbsp;</td></tr>';
print '<tr><td>user</td><td>' . $conf->db->user . '&nbsp;</td><td>&nbsp;</td></tr>';
print '<tr><td>pass</td><td>' . $conf->db->pass . '&nbsp;</td><td>&nbsp;</td></tr>';
print '<tr><td>Database name</td><td>' . $conf->db->name . '</td><td>&nbsp;</td></tr>';
if ($conf->don->enabled) {
print '<tr><td bgcolor="#e0e0e0" colspan="2">Dons</td></tr>';
print '<tr><td>Paiement en ligne</td><td>' . $conf->don->onlinepayment . '</td></tr>';
print '<tr><td>Don minimum</td><td>' . $conf->don->minimum . '</td></tr>';
print '<tr><td>Email Moderateurs</td><td>'.$conf->don->email_moderator.'</td></tr>';
}
print '<tr><td bgcolor="#e0e0e0" colspan="2">Webcal</td></tr>';
print '<tr><td>type</td><td>' . $conf->webcal->db->type . '</td></tr>';
print '<tr><td>host</td><td>' . $conf->webcal->db->host . '</td></tr>';
print '<tr><td>user</td><td>' . $conf->webcal->db->user . '&nbsp;</td></tr>';
print '<tr><td>pass</td><td>' . $conf->webcal->db->pass . '&nbsp;</td></tr>';
print '<tr><td>Database name</td><td>' . $conf->webcal->db->name . '</td></tr>';
print '</table>';
llxFooter();
llxFooter("<em>Derni&egrave;re modification $Date$ r&eacute;vision $Revision$</em>");
?>

View File

@ -1,8 +1,5 @@
<?PHP
/* Copyright (C) 2001-2003 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
@ -18,6 +15,9 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
* $Source$
*
*/
require("./pre.inc.php3");
@ -92,49 +92,52 @@ if ($action == 'create')
$propales = $projet->get_propal_list();
if (sizeof($propales)>0 && is_array($propales)) {
if (sizeof($propales)>0 && is_array($propales))
{
print '<p>Listes des propales associées au projet';
print '<TABLE border="0" width="100%" cellspacing="0" cellpadding="4">';
print "<TR bgcolor=\"#e0e0e0\">";
print "<TD>Réf</TD>";
print '<TD>Date</TD>';
print '<TD align="right">Prix</TD>';
print '<TD align="center">Statut</TD>';
print '</TR>';
for ($i = 0; $i<sizeof($propales);$i++){
$propale = new Propal($db);
$propale->fetch($propales[$i]);
print_titre('Listes des propales associées au projet');
print '<TABLE border="0" width="100%" cellspacing="0" cellpadding="4">';
$var=!$var;
print "<TR $bc[$var]>";
print "<TD><a href=\"../propal.php3?propalid=$propale->id\">$propale->ref</a></TD>\n";
print '<TD>'.strftime("%d %B %Y",$propale->datep).'</a></TD>';
print '<TD align="right">'.price($propale->price).'</TD>';
print '<TD align="center">statut</TD>';
print '<TR class="liste_titre">';
print "<TD>Réf</TD>";
print '<TD>Date</TD>';
print '<TD align="right">Prix</TD>';
print '<TD align="center">Statut</TD>';
print '</TR>';
$total = $total + $propale->price;
}
print '<tr><td>'.$i.' propales</td>';
print '<td colspan="2" align="right"><b>Total : '.price($total).'</b></td>';
print '<td align="left"><b>Euros HT</b></td></tr>';
print "</TABLE>";
} else {
print "pas de propales";
}
}
print "<p><TABLE border=\"1\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\"><tr>";
print "<td align=\"center\" width=\"25%\"><a href=\"fiche.php3?id=$id&action=edit\">Editer</a></td>";
for ($i = 0; $i<sizeof($propales);$i++){
$propale = new Propal($db);
$propale->fetch($propales[$i]);
$var=!$var;
print "<TR $bc[$var]>";
print "<TD><a href=\"../propal.php3?propalid=$propale->id\">$propale->ref</a></TD>\n";
print '<TD>'.strftime("%d %B %Y",$propale->datep).'</a></TD>';
print '<TD align="right">'.price($propale->price).'</TD>';
print '<TD align="center">'.$propale->statut.'</TD>';
print '</TR>';
$total = $total + $propale->price;
}
print '<tr><td>'.$i.' propales</td>';
print '<td colspan="2" align="right"><b>Total : '.price($total).'</b></td>';
print '<td align="left"><b>Euros HT</b></td></tr>';
print "</TABLE>";
}
else
{
print "pas de propales";
}
}
print "<p><TABLE border=\"1\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\"><tr>";
print "<td align=\"center\" width=\"25%\"><a href=\"fiche.php3?id=$id&action=edit\">Editer</a></td>";
print "<td align=\"center\" width=\"25%\">-</td>";
print "<td align=\"center\" width=\"25%\">-</td>";

View File

@ -30,7 +30,6 @@ if ($user->societe_id > 0)
$socidp = $user->societe_id;
}
llxHeader();
$db = new Db();

View File

@ -36,7 +36,8 @@ llxHeader();
$db = new Db();
if ($action == 'setstatut') {
if ($action == 'setstatut')
{
/*
* Cloture de la propale
*/
@ -233,8 +234,7 @@ if ($propalid)
print '<td align="center" width="25%">-</td>';
}
print "<td align=\"center\" width=\"25%\">-</td>";
print "<td align=\"center\" width=\"25%\">-</td>";
@ -305,120 +305,111 @@ if ($propalid)
if ($sortfield == "")
{
$sortfield="lower(p.label)";
$sortfield="p.datep";
}
if ($sortorder == "")
{
$sortorder="ASC";
$sortorder="DESC";
}
$yn["t"] = "oui";
$yn["f"] = "non";
if ($page == -1)
{
$page = 0 ;
}
$limit = 26;
$offset = $limit * $page ;
$pageprev = $page - 1;
$pagenext = $page + 1;
$limit = $conf->liste_limit;
$offset = $limit * $page ;
print "<table width=\"100%\">";
print "<tr><td><div class=\"titre\">Propositions commerciales</div></td>";
print "</table>";
print_barre_liste("Propositions commerciales", $page, $PHP_SELF,"&socidp=$socidp",$sortfield,$sortorder);
$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 llx_societe as s, llx_propal as p, c_propalst as c ";
$sql .= " WHERE p.fk_soc = s.idp AND p.fk_statut = c.id AND p.fk_statut in(2,4)";
if ($socidp) {
$sql .= " AND s.idp = $socidp";
}
if ($viewstatut <> '') {
$sql .= " AND c.id = $viewstatut";
}
if ($month > 0) {
$sql .= " AND date_format(p.datep, '%Y-%m') = '$year-$month'";
}
if ($year > 0) {
$sql .= " AND date_format(p.datep, '%Y') = $year";
}
$sql .= " ORDER BY p.fk_statut, datep DESC";
if ( $db->query($sql) ) {
$num = $db->num_rows();
$i = 0;
print "<TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
$oldstatut = -1;
$subtotal = 0;
while ($i < $num) {
$objp = $db->fetch_object( $i);
if ($objp->statut <> $oldstatut ) {
$oldstatut = $objp->statut;
if ($i > 0) {
print "<tr><td align=\"right\" colspan=\"5\">Total : <b>".price($subtotal)."</b></td>\n";
print "<td align=\"left\">Euros HT</td></tr>\n";
}
$subtotal = 0;
print '<TR class="liste_titre">';
print "<TD>Réf</TD>";
print "<TD>Société</td>";
print "<TD align=\"right\" colspan=\"2\">Date</TD>";
print "<TD align=\"right\">Prix</TD>";
print "<TD align=\"center\">Statut <a href=\"$PHP_SELF?viewstatut=$objp->statutid\">";
print '<img src="/theme/'.$conf->theme.'/img/filter.png" border="0"></a></td>';
print "</TR>\n";
$var=True;
}
$var=!$var;
print "<TR $bc[$var]>";
print "<TD><a href=\"$PHP_SELF?propalid=$objp->propalid\">$objp->ref</a></TD>\n";
print "<TD><a href=\"fiche.php3?socid=$objp->idp\">$objp->nom</a></TD>\n";
$now = time();
$lim = 3600 * 24 * 15 ;
if ( ($now - $objp->dp) > $lim && $objp->statutid == 1 ) {
print "<td><b> &gt; 15 jours</b></td>";
} else {
print "<td>&nbsp;</td>";
}
print "<TD align=\"right\">";
$y = strftime("%Y",$objp->dp);
$m = strftime("%m",$objp->dp);
print strftime("%d",$objp->dp)."\n";
print " <a href=\"propal.php3?year=$y&month=$m\">";
print strftime("%B",$objp->dp)."</a>\n";
print " <a href=\"propal.php3?year=$y\">";
print strftime("%Y",$objp->dp)."</a></TD>\n";
print "<TD align=\"right\">".price($objp->price)."</TD>\n";
print "<TD align=\"center\">$objp->statut</TD>\n";
print "</TR>\n";
$total = $total + $objp->price;
$subtotal = $subtotal + $objp->price;
$i++;
if ($socidp)
{
$sql .= " AND s.idp = $socidp";
}
print "</TABLE>";
$db->free();
} else {
print $db->error();
}
if ($viewstatut <> '')
{
$sql .= " AND c.id = $viewstatut";
}
if ($month > 0)
{
$sql .= " AND date_format(p.datep, '%Y-%m') = '$year-$month'";
}
if ($year > 0)
{
$sql .= " AND date_format(p.datep, '%Y') = $year";
}
$sql .= " ORDER BY $sortfield $sortorder ";
$sql .= $db->plimit( $limit ,$offset);
if ( $db->query($sql) )
{
$num = $db->num_rows();
$i = 0;
print "<TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
print '<TR class="liste_titre">';
print "<TD>Réf</TD>";
print "<TD>Société</td>";
print '<td align="right" colspan="2">Date</td>';
print '<td align="right">Prix</td>';
print '<td align="center">Statut</td>';
print "</tr>\n";
while ($i < $num)
{
$objp = $db->fetch_object( $i);
$var=!$var;
print "<TR $bc[$var]>";
print "<TD><a href=\"$PHP_SELF?propalid=$objp->propalid\">$objp->ref</a></TD>\n";
print "<TD><a href=\"fiche.php3?socid=$objp->idp\">$objp->nom</a></TD>\n";
$now = time();
$lim = 3600 * 24 * 15 ;
if ( ($now - $objp->dp) > $lim && $objp->statutid == 1 )
{
print "<td><b> &gt; 15 jours</b></td>";
}
else
{
print "<td>&nbsp;</td>";
}
print "<TD align=\"right\">";
$y = strftime("%Y",$objp->dp);
$m = strftime("%m",$objp->dp);
print strftime("%d",$objp->dp)."\n";
print " <a href=\"propal.php3?year=$y&month=$m\">";
print strftime("%B",$objp->dp)."</a>\n";
print " <a href=\"propal.php3?year=$y\">";
print strftime("%Y",$objp->dp)."</a></TD>\n";
print "<TD align=\"right\">".price($objp->price)."</TD>\n";
print "<TD align=\"center\">$objp->statut</TD>\n";
print "</TR>\n";
$i++;
}
print "</table>";
$db->free();
}
else
{
print $db->error();
print "<br>$sql";
}
}
$db->close();
llxFooter("<em>Derni&egrave;re modification $Date$ r&eacute;vision $Revision$</em>");

View File

@ -58,7 +58,7 @@ class Form {
*
*
*/
Function select_tva($name='')
Function select_tva($name='', $defaulttx = 19.6)
{
if (! strlen(trim($name)))
{

View File

@ -20,7 +20,8 @@
*
*/
class Product {
class Product
{
var $db ;
var $id ;
@ -29,28 +30,34 @@ class Product {
var $description;
var $price ;
Function Product($DB, $id=0) {
$this->db = $DB;
$this->id = $id ;
}
Function Product($DB, $id=0)
{
$this->db = $DB;
$this->id = $id ;
}
/*
*
*
*
*/
Function create($user) {
Function create($user)
{
$sql = "INSERT INTO llx_product (fk_user_author) VALUES (".$user->id.")";
if ($this->db->query($sql) ) {
$id = $this->db->last_insert_id();
if ( $this->update($id, $user) ) {
return $id;
}
} else {
print $this->db->error() . ' in ' . $sql;
}
$sql = "INSERT INTO llx_product (fk_user_author) VALUES (".$user->id.")";
if ($this->db->query($sql) )
{
$id = $this->db->last_insert_id();
if ( $this->update($id, $user) )
{
return $id;
}
}
else
{
print $this->db->error() . ' in ' . $sql;
}
}
/*
@ -58,44 +65,53 @@ class Product {
*
*
*/
Function update($id, $user) {
Function update($id, $user)
{
$sql = "UPDATE llx_product ";
$sql .= " SET label = '" . trim($this->libelle) ."'";
$sql .= ",ref = '" . trim($this->ref) ."'";
$sql .= ",price = " . $this->price ;
$sql .= ",description = '" . trim($this->description) ."'";
$sql .= " WHERE rowid = " . $id;
if ( $this->db->query($sql) ) {
return 1;
} else {
print $this->db->error() . ' in ' . $sql;
$sql = "UPDATE llx_product ";
$sql .= " SET label = '" . trim($this->libelle) ."'";
$sql .= ",ref = '" . trim($this->ref) ."'";
$sql .= ",price = " . $this->price ;
$sql .= ",tva_tx = " . $this->tva_tx ;
$sql .= ",description = '" . trim($this->description) ."'";
$sql .= " WHERE rowid = " . $id;
if ( $this->db->query($sql) )
{
return 1;
}
else
{
print $this->db->error() . ' in ' . $sql;
}
}
}
/*
*
*
*
*/
Function fetch ($id) {
Function fetch ($id)
{
$sql = "SELECT rowid, ref, label, description, price FROM llx_product WHERE rowid = $id";
$sql = "SELECT rowid, ref, label, description, price, tva_tx";
$sql .= " FROM llx_product WHERE rowid = $id";
$result = $this->db->query($sql) ;
$result = $this->db->query($sql) ;
if ( $result ) {
$result = $this->db->fetch_array();
if ( $result )
{
$result = $this->db->fetch_array();
$this->id = $result["rowid"];
$this->ref = $result["ref"];
$this->label = $result["label"];
$this->description = $result["description"];
$this->price = $result["price"];
}
$this->db->free();
return $result;
$this->id = $result["rowid"];
$this->ref = $result["ref"];
$this->label = $result["label"];
$this->description = $result["description"];
$this->price = $result["price"];
$this->tva_tx = $result["tva_tx"];
}
$this->db->free();
return $result;
}
}