From d5419912e80fc7739c398ed89b49c6ed13efaf45 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Tue, 27 Jul 2004 16:30:19 +0000 Subject: [PATCH] Synchro --- htdocs/admin/system/index.php | 23 ++- htdocs/commande/fiche.php | 5 - htdocs/compta/facture.php | 3 +- htdocs/contrat/fiche.php | 321 ++++++++++++++-------------------- htdocs/main.inc.php | 2 +- htdocs/pre.inc.php | 2 +- 6 files changed, 144 insertions(+), 212 deletions(-) diff --git a/htdocs/admin/system/index.php b/htdocs/admin/system/index.php index 6ef3c79da13..45a91130955 100644 --- a/htdocs/admin/system/index.php +++ b/htdocs/admin/system/index.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2001-2004 Rodolphe Quiedeville * Copyright (C) 2004 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify @@ -37,7 +37,6 @@ require("./pre.inc.php"); if (!$user->admin) accessforbidden(); - llxHeader(); print_titre("Résumé des informations systèmes Dolibarr"); @@ -46,7 +45,8 @@ print "
\n"; print ''; print "\n"; -print "\n"; +print "\n"; +//print "\n"; print '
Dolibar
Version" . DOL_VERSION . "
Version" . DOL_VERSION . "
Version de la base de données" . DOL_VERSION_DB . "
'; print "
\n"; @@ -54,19 +54,19 @@ print "
\n"; print ''; print "\n"; // Récupère la version de l'OS -ob_start(); +ob_start(); phpinfo(); -$chaine = ob_get_contents(); -ob_end_clean(); +$chaine = ob_get_contents(); +ob_end_clean(); eregi('System ',$chaine,$reg); -print "\n"; +print "\n"; print '
OS
([^\/]*)
Version".$reg[1]."
Version".$reg[1]."
'; print "
\n"; print ''; print "\n"; -print "\n"; +print "\n"; print "\n"; print '
Serveur Web
Version".$_SERVER["SERVER_SOFTWARE"]."
Version".$_SERVER["SERVER_SOFTWARE"]."
document root" . DOL_DOCUMENT_ROOT . "
'; @@ -74,7 +74,7 @@ print "
\n"; print ''; print "\n"; -print "\n"; +print "\n"; print "\n"; print '
PHP
Version".phpversion()."
Version".phpversion()."
Liaison Web-PHP".php_sapi_name()."
'; @@ -89,16 +89,13 @@ if ($result) $row = $db->fetch_row(); } print "Version" . $row[1] . "\n"; -print "Type" . $conf->db->type . "\n"; +print "Type" . $conf->db->type . "\n"; print "Host" . $conf->db->host . "\n"; print "User" . $conf->db->user . " \n"; print "Pass" . $conf->db->pass . " \n"; print "Database name" . $conf->db->name . "\n"; - - print ''; - llxFooter("Dernière modification $Date$ révision $Revision$"); ?> diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 7a8c90a4d94..09639c5e20f 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -681,11 +681,6 @@ else { print 'Supprimer'; } - elseif ($commande->statut == 1 && abs($resteapayer) > 0 && $user->rights->commande->envoyer) - { - print 'Envoyer'; - } - if ($commande->statut > 0 && $commande->statut < 3 && $user->rights->expedition->creer) { diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 05e5ec761e1..73e7fb28670 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -390,8 +390,7 @@ if ($_GET["action"] == 'pdf') facture_pdf_create($db, $_GET["facid"]); } - -llxHeader(); +llxHeader('','Facture','Facture'); $html = new Form($db); diff --git a/htdocs/contrat/fiche.php b/htdocs/contrat/fiche.php index 412361e215a..55cbfe22b2d 100644 --- a/htdocs/contrat/fiche.php +++ b/htdocs/contrat/fiche.php @@ -27,7 +27,8 @@ require("../facture.class.php"); llxHeader(); -$id = $_GET["id"]; +$id = $_GET["id"]; +$socid = $_GET["socid"]; $mesg = ''; /* @@ -40,24 +41,26 @@ if ($user->societe_id > 0) } -if ($action == 'add') -{ - $contrat = new Contrat($db); - - $id = $product->create($user); - $action = ''; -} - if ($_POST["action"] == 'miseenservice') { $contrat = new Contrat($db); $contrat->id = $id; $contrat->fetch($id); $contrat->mise_en_service($user, - mktime($_POST["date_starthour"],$_POST["date_startmin"],0,$_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"]) - ); + mktime($_POST["date_starthour"], + $_POST["date_startmin"], + 0, + $_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"]) + ); } if ($_GET["action"] == 'cloture') @@ -75,127 +78,64 @@ 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 !' . "
" . $product->mesg_error; - } -} $html = new Form($db); -/* - * Fiche création - * - */ -if ($action == 'create') -{ - print "
\n"; - print "\n"; - print ''."\n"; - print '
Nouveau

'."\n"; - - print ''; - print ""; - print ''; - print ''; - print ''; - print ''; - print ""; - if ($_POST["type"] == 1) - { - // Si contrat de type service - print ''; - } - - print ''; - print '
Référence
Libellé
Prix de vente
Taux TVA'; - print $html->select_tva("tva_tx"); - print ' %
Description"; - print '
Durée'; - print 'jour '; - print 'semaine '; - print 'mois '; - print 'année'; - print '
 
'; - print '
'; -} -else -{ /* * Fiche visu/édition * */ - if ($id) - { - $contrat = new Contrat($db); - $result = $contrat->fetch($id); - - if ( $result ) +if ($id) +{ + $contrat = new Contrat($db); + $result = $contrat->fetch($id); + + if ( $result ) { $date_start=''; $date_end=''; - - print $mesg; - - /* - * Affichage onglets - */ - $h = 0; - - $hselected=$h; - $head[$h][0] = DOL_URL_ROOT.'/soc.php?socid='.$socid; - $head[$h][1] = 'Fiche contrat : '.$contrat->id; - $h++; - - dolibarr_fiche_head($head, $hselected); - - print ''; - print ""; - print ''; - print ''; - if ($contrat->factureid) - { - print ''; - print ''; - } - else - { - print ''; - } - + print $mesg; + + /* + * Affichage onglets + */ + $h = 0; + + $hselected=$h; + $head[$h][0] = DOL_URL_ROOT.'/soc.php?socid='.$socid; + $head[$h][1] = 'Fiche contrat : '.$contrat->id; + $h++; + + dolibarr_fiche_head($head, $hselected); + + + print '
Service'.($contrat->product->ref).' - '.($contrat->product->label_url).'
Société'.$contrat->societe->nom_url.'FactureFactureSociété'.$contrat->societe->nom_url.'
'; + print ""; + print ''; + print ''; + if ($contrat->factureid) + { + print ''; + print ''; + } + else + { + print ''; + } + // Affiche statut contrat $now=mktime(); if ($contrat->enservice == 1) { - if (! $contrat->date_fin_validite || $contrat->date_fin_validite >= $now) { - $class = "normal"; - $statut="En service"; - } - else { - $class = "error"; - $statut="En service, expiré"; - } + if (! $contrat->date_fin_validite || $contrat->date_fin_validite >= $now) { + $class = "normal"; + $statut="En service"; + } + else { + $class = "error"; + $statut="En service, expiré"; + } } elseif($contrat->enservice == 2) { @@ -207,27 +147,28 @@ else $class = "warning"; $statut= "Ce contrat n'est pas en service"; } - print "\n"; - - if ($request == 'miseenservice') - { - // Si contrat lié à une ligne de facture, on recherche date debut et fin de la ligne + print "\n"; + + if ($_GET["request"] == 'miseenservice') + { + // Si contrat lié à une ligne de facture, on recherche date debut et fin de la ligne if ($contrat->facturedetid) { $facturedet = new FactureLigne($db); $facturedet->fetch($contrat->facturedetid); $date_start=$facturedet->date_start; - $date_end=$facturedet->date_end; + $date_end=$facturedet->date_end; } - + // Si date_start et date_end ne sont pas connues de la ligne de facture, on les // 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_end) { - if ($contrat->product->duration) { - // Si duree du service connue - $duree_value = substr($contrat->product->duration,0,strlen($contrat->product->duration)-1); - $duree_unit = substr($contrat->product->duration,-1); - + if ($contrat->product->duration) + { + // Si duree du service connue + $duree_value = substr($contrat->product->duration,0,strlen($contrat->product->duration)-1); + $duree_unit = substr($contrat->product->duration,-1); + $month = date("m",$date_start); $day = date("d",$date_start); $year = date("Y",$date_start); @@ -235,78 +176,78 @@ else switch($duree_unit) { case "d": - $day = $day + $duree_value; - break; + $day = $day + $duree_value; + break; case "w": - $day = $day + ($duree_value * 7); - break; + $day = $day + ($duree_value * 7); + break; case "m": - $month = $month + $duree_value; - break; + $month = $month + $duree_value; + break; case "y": - $year = $year + $duree_value; - break; + $year = $year + $duree_value; + break; } $date_end = mktime(date("H",$date_start), date("i",$date_start), 0, $month, $day, $year); - } + } } - - - print ''; - print ''; - - print ''; - - // Date de début de mise en service - print ''; - - // Date de fin prévue de mise en service - print ''; - - print ''; - print ''; - } - - if ($contrat->enservice > 0) - { - print ""; - $contrat->user_service->fetch(); - print ''; - - print '"; - $contrat->user_cloture->fetch(); - print ''; - } + print ''; + print ''; + + print ''; + + // Date de début de mise en service + print ''; - print "
Service'.($contrat->product->ref).' - '.($contrat->product->label_url).'
Société'.$contrat->societe->nom_url.'FactureFactureSociété'.$contrat->societe->nom_url.'
Statut$statut
Statut$statut
Durée standard pour ce service'; - print $contrat->product->duration; - print ''; - print '
Date de mise en service'; - print $html->select_date($date_start,'date_start',1,1); - print " "; - print '
Date de fin prévue'; - print $html->select_date($date_end,'date_end',1,1); - print " "; - print '
'; - print ''; - print '
Mis en service".dolibarr_print_date($contrat->mise_en_service,"%d %B %Y à %H:%M"); - print "par'.$contrat->user_service->fullname.'
Fin de validité'.dolibarr_print_date($contrat->date_fin_validite,"%d %B %Y à %H:%M"); - } - if ($contrat->enservice == 2) - { - print "
Cloturé".dolibarr_print_date($contrat->date_cloture,"%d %B %Y à %H:%M")."par'.$contrat->user_cloture->fullname.'
Durée standard pour ce service'; + print $contrat->product->duration; + print ''; + print '
Date de mise en service'; + print $html->select_date($date_start,'date_start',1,1); + print " "; + print '
"; - print '
'; - print ''; + // Date de fin prévue de mise en service + print 'Date de fin prévue'; + print $html->select_date($date_end,'date_end',1,1); + print " "; + print ''; + + print ''; + print ''; + print ''; + print ''; } + if ($contrat->enservice > 0) + { + print "Mis en service".dolibarr_print_date($contrat->mise_en_service,"%d %B %Y à %H:%M"); + print ""; + $contrat->user_service->fetch(); + print 'par'.$contrat->user_service->fullname.''; + + print 'Fin de validité'.dolibarr_print_date($contrat->date_fin_validite,"%d %B %Y à %H:%M"); + } + + if ($contrat->enservice == 2) + { + print "Cloturé".dolibarr_print_date($contrat->date_cloture,"%d %B %Y à %H:%M").""; + $contrat->user_cloture->fetch(); + print 'par'.$contrat->user_cloture->fullname.''; + } + + + print ""; + print '
'; + print ''; } - else - { - print "Error"; - } + } +else +{ + print "Error"; +} + /* ************************************************************************** */ /* */ diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index dc23443f3ee..965937a6533 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -208,7 +208,7 @@ $langs = new Translate(DOL_DOCUMENT_ROOT ."/langs", $conf->langage); */ if (defined("MAIN_NOT_INSTALLED")) { - Header("Location: install.php"); + Header("Location: install/index.php"); } diff --git a/htdocs/pre.inc.php b/htdocs/pre.inc.php index 9924625173c..bd2520a778b 100644 --- a/htdocs/pre.inc.php +++ b/htdocs/pre.inc.php @@ -110,7 +110,7 @@ function llxHeader($head = "") { if ($conf->commande->enabled) { $menu->add(DOL_URL_ROOT."/commande/index.php", "Commandes"); - if ($conf->expedition->enabled) { + if ($conf->expedition->enabled) { $menu->add_submenu(DOL_URL_ROOT."/expedition/index.php", "Expéditions"); } }