This commit is contained in:
Rodolphe Quiedeville 2004-07-27 16:30:19 +00:00
parent 030948ad03
commit d5419912e8
6 changed files with 144 additions and 212 deletions

View File

@ -1,5 +1,5 @@
<?PHP <?PHP
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -37,7 +37,6 @@ require("./pre.inc.php");
if (!$user->admin) if (!$user->admin)
accessforbidden(); accessforbidden();
llxHeader(); llxHeader();
print_titre("Résumé des informations systèmes Dolibarr"); print_titre("Résumé des informations systèmes Dolibarr");
@ -46,7 +45,8 @@ print "<br>\n";
print '<table class="noborder" cellpadding="3" cellspacing="0" width="100%">'; print '<table class="noborder" cellpadding="3" cellspacing="0" width="100%">';
print "<tr class=\"liste_titre\"><td colspan=\"2\">Dolibar</td></tr>\n"; print "<tr class=\"liste_titre\"><td colspan=\"2\">Dolibar</td></tr>\n";
print "<tr $bc[1]><td width=\"140\">Version</td><td>" . DOL_VERSION . "</td></tr>\n"; print "<tr $bc[1]><td width=\"240\">Version</td><td>" . DOL_VERSION . "</td></tr>\n";
//print "<tr $bc[1]><td width=\"240\">Version de la base de données</td><td>" . DOL_VERSION_DB . "</td></tr>\n";
print '</table>'; print '</table>';
print "<br>\n"; print "<br>\n";
@ -59,14 +59,14 @@ phpinfo();
$chaine = ob_get_contents(); $chaine = ob_get_contents();
ob_end_clean(); ob_end_clean();
eregi('System </td><td class="v">([^\/]*)</td>',$chaine,$reg); eregi('System </td><td class="v">([^\/]*)</td>',$chaine,$reg);
print "<tr $bc[1]><td width=\"140\">Version</td><td>".$reg[1]."</td></tr>\n"; print "<tr $bc[1]><td width=\"240\">Version</td><td>".$reg[1]."</td></tr>\n";
print '</table>'; print '</table>';
print "<br>\n"; print "<br>\n";
print '<table class="noborder" cellpadding="3" cellspacing="0" width="100%">'; print '<table class="noborder" cellpadding="3" cellspacing="0" width="100%">';
print "<tr class=\"liste_titre\"><td colspan=\"2\">Serveur Web</td></tr>\n"; print "<tr class=\"liste_titre\"><td colspan=\"2\">Serveur Web</td></tr>\n";
print "<tr $bc[1]><td width=\"140\">Version</td><td>".$_SERVER["SERVER_SOFTWARE"]."</td></tr>\n"; print "<tr $bc[1]><td width=\"240\">Version</td><td>".$_SERVER["SERVER_SOFTWARE"]."</td></tr>\n";
print "<tr $bc[0]><td>document root</td><td>" . DOL_DOCUMENT_ROOT . "</td></tr>\n"; print "<tr $bc[0]><td>document root</td><td>" . DOL_DOCUMENT_ROOT . "</td></tr>\n";
print '</table>'; print '</table>';
@ -74,7 +74,7 @@ print "<br>\n";
print '<table class="noborder" cellpadding="3" cellspacing="0" width="100%">'; print '<table class="noborder" cellpadding="3" cellspacing="0" width="100%">';
print "<tr class=\"liste_titre\"><td colspan=\"2\">PHP</td></tr>\n"; print "<tr class=\"liste_titre\"><td colspan=\"2\">PHP</td></tr>\n";
print "<tr $bc[1]><td width=\"140\">Version</td><td>".phpversion()."</td></tr>\n"; print "<tr $bc[1]><td width=\"240\">Version</td><td>".phpversion()."</td></tr>\n";
print "<tr $bc[0]><td>Liaison Web-PHP</td><td>".php_sapi_name()."</td></tr>\n"; print "<tr $bc[0]><td>Liaison Web-PHP</td><td>".php_sapi_name()."</td></tr>\n";
print '</table>'; print '</table>';
@ -89,16 +89,13 @@ if ($result)
$row = $db->fetch_row(); $row = $db->fetch_row();
} }
print "<tr $bc[0]><td>Version</td><td>" . $row[1] . "</td></tr>\n"; print "<tr $bc[0]><td>Version</td><td>" . $row[1] . "</td></tr>\n";
print "<tr $bc[1]><td width=\"140\">Type</td><td>" . $conf->db->type . "</td></tr>\n"; print "<tr $bc[1]><td width=\"240\">Type</td><td>" . $conf->db->type . "</td></tr>\n";
print "<tr $bc[0]><td>Host</td><td>" . $conf->db->host . "</td></tr>\n"; print "<tr $bc[0]><td>Host</td><td>" . $conf->db->host . "</td></tr>\n";
print "<tr $bc[1]><td>User</td><td>" . $conf->db->user . "&nbsp;</td></tr>\n"; print "<tr $bc[1]><td>User</td><td>" . $conf->db->user . "&nbsp;</td></tr>\n";
print "<tr $bc[0]><td>Pass</td><td>" . $conf->db->pass . "&nbsp;</td></tr>\n"; print "<tr $bc[0]><td>Pass</td><td>" . $conf->db->pass . "&nbsp;</td></tr>\n";
print "<tr $bc[1]><td>Database name</td><td>" . $conf->db->name . "</td></tr>\n"; print "<tr $bc[1]><td>Database name</td><td>" . $conf->db->name . "</td></tr>\n";
print '</table>'; print '</table>';
llxFooter("<em>Derni&egrave;re modification $Date$ r&eacute;vision $Revision$</em>"); llxFooter("<em>Derni&egrave;re modification $Date$ r&eacute;vision $Revision$</em>");
?> ?>

View File

@ -681,11 +681,6 @@ else
{ {
print '<a class="tabAction" href="fiche.php?id='.$id.'&amp;action=delete">Supprimer</a>'; print '<a class="tabAction" href="fiche.php?id='.$id.'&amp;action=delete">Supprimer</a>';
} }
elseif ($commande->statut == 1 && abs($resteapayer) > 0 && $user->rights->commande->envoyer)
{
print '<a class="tabAction" href="fiche.php?id='.$id.'&amp;action=presend">Envoyer</a>';
}
if ($commande->statut > 0 && $commande->statut < 3 && $user->rights->expedition->creer) if ($commande->statut > 0 && $commande->statut < 3 && $user->rights->expedition->creer)
{ {

View File

@ -390,8 +390,7 @@ if ($_GET["action"] == 'pdf')
facture_pdf_create($db, $_GET["facid"]); facture_pdf_create($db, $_GET["facid"]);
} }
llxHeader('','Facture','Facture');
llxHeader();
$html = new Form($db); $html = new Form($db);

View File

@ -28,6 +28,7 @@ require("../facture.class.php");
llxHeader(); llxHeader();
$id = $_GET["id"]; $id = $_GET["id"];
$socid = $_GET["socid"];
$mesg = ''; $mesg = '';
/* /*
@ -40,23 +41,25 @@ if ($user->societe_id > 0)
} }
if ($action == 'add')
{
$contrat = new Contrat($db);
$id = $product->create($user);
$action = '';
}
if ($_POST["action"] == 'miseenservice') if ($_POST["action"] == 'miseenservice')
{ {
$contrat = new Contrat($db); $contrat = new Contrat($db);
$contrat->id = $id; $contrat->id = $id;
$contrat->fetch($id); $contrat->fetch($id);
$contrat->mise_en_service($user, $contrat->mise_en_service($user,
mktime($_POST["date_starthour"],$_POST["date_startmin"],0,$_POST["date_startmonth"],$_POST["date_startday"],$_POST["date_startyear"]), mktime($_POST["date_starthour"],
$_POST["date_startmin"],
0, 0,
mktime($_POST["date_endhour"],$_POST["date_endmin"],0,$_POST["date_endmonth"],$_POST["date_endday"],$_POST["date_endyear"]) $_POST["date_startmonth"],
$_POST["date_startday"],
$_POST["date_startyear"]),
0,
mktime($_POST["date_endhour"],
$_POST["date_endmin"],
0,
$_POST["date_endmonth"],
$_POST["date_endday"],
$_POST["date_endyear"])
); );
} }
@ -75,78 +78,15 @@ if ($_GET["action"] == 'annule')
} }
if ($action == 'update' && $cancel <> 'Annuler')
{
$product = new Product($db);
$product->ref = $_POST["ref"];
$product->libelle = $_POST["libelle"];
$product->price = $_POST["price"];
$product->tva_tx = $_POST["tva_tx"];
$product->description = $_POST["desc"];
$product->envente = $_POST["statut"];
$product->duration_value = $_POST["duration_value"];
$product->duration_unit = $_POST["duration_unit"];
if ( $product->update($id, $user))
{
$action = '';
$mesg = 'Fiche mise à jour';
}
else
{
$action = 'edit';
$mesg = 'Fiche non mise à jour !' . "<br>" . $product->mesg_error;
}
}
$html = new Form($db); $html = new Form($db);
/*
* Fiche création
*
*/
if ($action == 'create')
{
print "<form action=\"$PHP_SELF?type=".$_POST["type"]."\" method=\"post\">\n";
print "<input type=\"hidden\" name=\"action\" value=\"add\">\n";
print '<input type="hidden" name="type" value="'.$_POST["type"].'">'."\n";
print '<div class="titre">Nouveau</div><br>'."\n";
print '<table class="border" width="100%" cellspacing="0" cellpadding="3">';
print "<tr>";
print '<td>Référence</td><td><input name="ref" size="20" value=""></td></tr>';
print '<td>Libellé</td><td><input name="libelle" size="40" value=""></td></tr>';
print '<tr><td>Prix de vente</td><TD><input name="price" size="10" value=""></td></tr>';
print '<tr><td>Taux TVA</td><TD>';
print $html->select_tva("tva_tx");
print ' %</td></tr>';
print "<tr><td valign=\"top\">Description</td><td>";
print '<textarea name="desc" rows="8" cols="50">';
print "</textarea></td></tr>";
if ($_POST["type"] == 1)
{
// Si contrat de type service
print '<tr><td>Durée</td><td><input name="duration_value" size="6" value="'.$product->duree.'">';
print '<input name="duration_unit" type="radio" value="d">jour&nbsp;';
print '<input name="duration_unit" type="radio" value="w">semaine&nbsp;';
print '<input name="duration_unit" type="radio" value="m">mois&nbsp;';
print '<input name="duration_unit" type="radio" value="y">année';
print '</td></tr>';
}
print '<tr><td>&nbsp;</td><td><input type="submit" value="Créer"></td></tr>';
print '</table>';
print '</form>';
}
else
{
/* /*
* Fiche visu/édition * Fiche visu/édition
* *
*/ */
if ($id) if ($id)
{ {
$contrat = new Contrat($db); $contrat = new Contrat($db);
$result = $contrat->fetch($id); $result = $contrat->fetch($id);
@ -209,7 +149,7 @@ else
} }
print "<tr><td>Statut</td><td colspan=\"3\" class=\"$class\">$statut</td></tr>\n"; print "<tr><td>Statut</td><td colspan=\"3\" class=\"$class\">$statut</td></tr>\n";
if ($request == 'miseenservice') if ($_GET["request"] == 'miseenservice')
{ {
// Si contrat lié à une ligne de facture, on recherche date debut et fin de la ligne // Si contrat lié à une ligne de facture, on recherche date debut et fin de la ligne
if ($contrat->facturedetid) { if ($contrat->facturedetid) {
@ -223,7 +163,8 @@ else
// definit à une valeur par défaut en fonction de la durée définie pour le service. // definit à une valeur par défaut en fonction de la durée définie pour le service.
if (! $date_start) { $date_start=mktime(); } if (! $date_start) { $date_start=mktime(); }
if (! $date_end) { if (! $date_end) {
if ($contrat->product->duration) { if ($contrat->product->duration)
{
// Si duree du service connue // Si duree du service connue
$duree_value = substr($contrat->product->duration,0,strlen($contrat->product->duration)-1); $duree_value = substr($contrat->product->duration,0,strlen($contrat->product->duration)-1);
$duree_unit = substr($contrat->product->duration,-1); $duree_unit = substr($contrat->product->duration,-1);
@ -301,12 +242,12 @@ else
print '</div>'; print '</div>';
} }
}
else
{
print "Error";
}
} }
else
{
print "Error";
}
/* ************************************************************************** */ /* ************************************************************************** */
/* */ /* */

View File

@ -208,7 +208,7 @@ $langs = new Translate(DOL_DOCUMENT_ROOT ."/langs", $conf->langage);
*/ */
if (defined("MAIN_NOT_INSTALLED")) if (defined("MAIN_NOT_INSTALLED"))
{ {
Header("Location: install.php"); Header("Location: install/index.php");
} }