From e5efb28a6cbcf9edaafa3332446556e5b66a4e9a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 6 Feb 2005 17:50:44 +0000 Subject: [PATCH] New: Personalisation des propal par un picto. --- htdocs/comm/fiche.php | 4 +- htdocs/comm/index.php | 14 ++--- htdocs/comm/propal.php | 39 +++++------- htdocs/commande/fiche.php | 95 ++++++++++++++++-------------- htdocs/commande/index.php | 10 ++-- htdocs/langs/en_US/commercial.lang | 1 + htdocs/langs/fr_FR/commercial.lang | 1 + 7 files changed, 78 insertions(+), 86 deletions(-) diff --git a/htdocs/comm/fiche.php b/htdocs/comm/fiche.php index e9e0e95e9b5..f39603d17d2 100644 --- a/htdocs/comm/fiche.php +++ b/htdocs/comm/fiche.php @@ -295,7 +295,7 @@ if ($_socid > 0) { $objp = $db->fetch_object(); print ""; - print "propalid\">$objp->ref\n"; + print "propalid\">".img_object($langs->trans("ShowPropal"),"propal")." ".$objp->ref."\n"; if ( ($now - $objp->dp) > $lim && $objp->statutid == 1 ) { print " > 15 jours"; @@ -343,7 +343,7 @@ if ($_socid > 0) $objp = $db->fetch_object(); $var=!$var; print ""; - print ''.$objp->ref."\n"; + print ''.img_object($langs->trans("ShowOrder"),"order").' '.$objp->ref."\n"; if ( ($now - $objp->dp) > $lim && $objp->statutid == 1 ) { print " > 15 jours"; diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index 52075bcca03..f37b8721398 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -79,7 +79,7 @@ if ($_GET["action"] == 'del_bookmark') * Affichage page */ -print_titre("Espace commercial"); +print_titre($langs->trans("CommercialArea")); print ''; @@ -136,7 +136,7 @@ if ($conf->propal->enabled) { { $obj = $db->fetch_object(); $var=!$var; - print ""; + print ""; $i++; $total += $obj->price; } @@ -174,7 +174,7 @@ if ($conf->commande->enabled) while ($i < $num) { $obj = $db->fetch_object(); - print ""; + print ""; print ''; $i++; $var=!$var; @@ -364,8 +364,7 @@ if ($conf->contrat->enabled && 0) // TODO A REFAIRE DEPUIS NOUVEAU CONTRAT while ($i < $num) { $obj = $db->fetch_object(); - print ""; + print ""; print "\n"; print "\n"; $var=!$var; @@ -408,9 +407,8 @@ if ($conf->propal->enabled) { while ($i < $num) { $obj = $db->fetch_object(); - print ""; - print "\n"; + print ""; + print "\n"; print "\n"; print "\n"; diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 9bfeb55c074..594e7894c8a 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -354,7 +354,7 @@ if ($_GET["propalid"]) } else { - print ''; + print ''; print ''; } @@ -393,7 +393,7 @@ if ($_GET["propalid"]) print ''; print ''; + print ''; print "
rowid."\">".$obj->ref."".$obj->nom."".price($obj->price)."
rowid."\">".img_object($langs->trans("ShowPropal"),"propal")." ".$obj->ref."".$obj->nom."".price($obj->price)."
rowid\">$obj->ref
rowid\">".img_object($langs->trans("ShowOrder"),"order")." ".$obj->ref."'.$obj->nom.'
rowid."\">".img_file()." "; - print "rowid."\">".$obj->ref."
rowid."\">".img_object($langs->trans("ShowContract","contract"))." ".$obj->ref."idp\">$obj->nom".$contrat->LibStatut($obj->enservice)."
propalid."\">".img_file()." "; - print "propalid."\">".$obj->ref."idp\">$obj->nom
propalid."\">".img_object($langs->trans("ShowPropal"),"propal")." ".$obj->ref."idp\">".img_object($langs->trans("ShowCompany"),"company")." ".$obj->nom.""; print strftime("%e %b %Y",$obj->dp)."".price($obj->price)."
Remise
'.$langs->trans("Discount").''.$propal->remise_percent.' % 
'.$langs->trans("Comments").' :
"; } @@ -405,11 +405,11 @@ if ($_GET["propalid"]) print ''; print ""; print ''; - print ''; + print ''; print ""; print "\n"; - $sql = "SELECT pt.rowid, p.label as product, p.ref, pt.price, pt.qty, p.rowid as prodid, pt.tva_tx, pt.remise_percent, pt.subprice"; + $sql = "SELECT pt.rowid, p.label as product, p.ref, pt.price, p.fk_product_type, pt.qty, p.rowid as prodid, pt.tva_tx, pt.remise_percent, pt.subprice"; $sql .= " FROM ".MAIN_DB_PREFIX."propaldet as pt, ".MAIN_DB_PREFIX."product as p WHERE pt.fk_product = p.rowid AND pt.fk_propal = $propal->id"; $sql .= " ORDER BY pt.rowid ASC"; $result = $db->query($sql); @@ -425,8 +425,11 @@ if ($_GET["propalid"]) $objp = $db->fetch_object($result); $var=!$var; print ""; - print "\n"; - print ''; + print "\n"; + print ''; print ''; print "\n"; print ''; @@ -704,32 +707,20 @@ if ($_GET["propalid"]) $coms = $propal->commande_liste_array(); print '
'.$langs->trans("Ref").''.$langs->trans("ProductOrService").''.$langs->trans("VAT").''.$langs->trans("Qty").'RemiseP.U.'.$langs->trans("VAT").''.$langs->trans("Qty").''.$langs->trans("Discount").'P.U. 
[$objp->ref]'.$objp->product.'".$objp->ref."'; + if ($objp->fk_product_type==0) print img_object($langs->trans("ShowProduct"),"product"); + if ($objp->fk_product_type==1) print img_object($langs->trans("ShowService"),"service"); + print ' '.$objp->product.''.$objp->tva_tx.' %".$objp->qty."'.$objp->remise_percent.' %
'; - if ($nb_commande == 1) - - { - print "\n"; - } - else - { - print "\n"; + print "\n"; for ($i = 0 ; $i < $nb_commande ; $i++) { print '\n"; print "\n"; } - } + print "
Commande rattachée : "; - print ''; - print img_file(); - print ' '.$coms[0].""; - print "
Commandes rattachées
Commande(s) rattachée(s)
'.$coms[$i]."
"; } } - // print 'Générer"; /* * */ @@ -895,7 +886,7 @@ else if ( $db->query($sql) ) { $num = $db->num_rows(); - print_barre_liste("Propositions commerciales", $page,"propal.php","&socidp=$socidp",$sortfield,$sortorder,'',$num); + print_barre_liste($langs->trans("Proposals"), $page,"propal.php","&socidp=$socidp",$sortfield,$sortorder,'',$num); $i = 0; @@ -916,9 +907,7 @@ else $now = time(); $var=!$var; print ""; - print ''; - print img_file(); - print " propalid\">$objp->ref\n"; + print ''.img_object($langs->trans("ShowPropal"),"propal").' '.$objp->ref."\n"; if ($objp->client == 1) { $url = DOL_URL_ROOT.'/comm/fiche.php?socid='.$objp->idp; @@ -928,7 +917,7 @@ else $url = DOL_URL_ROOT.'/comm/prospect/fiche.php?socid='.$objp->idp; } - print ''.$objp->nom.''; + print ''.img_object($langs->trans("ShowCompany"),"company").' '.$objp->nom.''; if ( $now > $objp->dfv && $objp->dfv > 0 ) { diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index a800bb50bdf..4fb9139faf7 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004 Laurent Destailleur + * Copyright (C) 2004-2005 Laurent Destailleur * * 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 @@ -21,7 +21,7 @@ * */ -/*! \file htdocs/commande/fiche.php +/** \file htdocs/commande/fiche.php \ingroup commande \brief Fiche commande \version $Revision$ @@ -233,7 +233,7 @@ if ($_GET["action"] == 'create') print '' ."\n"; print ''; - print ''; + print '
'; print ''; print ''; @@ -270,9 +270,9 @@ if ($_GET["action"] == 'create') print ''."\n"; print ''; - print ''; - print ''; - print '"; + print ''; + print ''; + print '"; print '"; } else @@ -304,7 +304,7 @@ if ($_GET["action"] == 'create') } else { - print $db->error(); + dolibarr_print_error($db); } print '
'.$langs->trans("Customer").' :'.$obj->nom.''.$langs->trans("Comments").' :
Proposition'.$obj->ref.'
Montant HT'.price($amount).'
TVA'.price($obj->tva)."
'.$langs->trans("Ref").''.$obj->ref.'
'.$langs->trans("TotalTTC").''.price($amount).'
'.$langs->trans("VAT").''.price($obj->tva)."
'.$langs->trans("TotalTTC").''.price($obj->total)."
'; @@ -323,7 +323,7 @@ if ($_GET["action"] == 'create') /* * */ - print ''; + print ''; print "\n"; print "
\n"; @@ -332,11 +332,11 @@ if ($_GET["action"] == 'create') /* * Produits */ - print_titre("Produits"); + print_titre($langs->trans("Products")); - print ''; - print ''; - print ''; + print '
'.$langs->trans("Ref").'Produit'.$langs->trans("Price").'RemiseQté.
'; + print ''; + print ''; $sql = "SELECT pt.rowid, p.label as product, p.ref, pt.price, pt.qty, p.rowid as prodid, pt.remise_percent"; $sql .= " FROM ".MAIN_DB_PREFIX."propaldet as pt, ".MAIN_DB_PREFIX."product as p WHERE pt.fk_product = p.rowid AND pt.fk_propal = $propalid"; @@ -352,13 +352,14 @@ if ($_GET["action"] == 'create') $objp = $db->fetch_object(); $var=!$var; print "\n"; - print ''; - print ""; + print ''; + print ""; print ''; print "\n"; $i++; } } + $sql = "SELECT pt.rowid, pt.description as product, pt.price, pt.qty, pt.remise_percent"; $sql .= " FROM ".MAIN_DB_PREFIX."propaldet as pt WHERE pt.fk_propal = $propalid AND pt.fk_product = 0"; $sql .= " ORDER BY pt.rowid ASC"; @@ -371,7 +372,7 @@ if ($_GET["action"] == 'create') $objp = $db->fetch_object(); $var=!$var; print "\n"; - print ''; + print ''; print ''; print ''; print "\n"; @@ -389,7 +390,7 @@ if ($_GET["action"] == 'create') } else { - print $db->error() . "
$sql";; + dolibarr_print_error($db); } } else @@ -479,17 +480,20 @@ else print ''; - print '"; // Ligne de 3 colonnes @@ -561,14 +565,14 @@ else if ($objp->fk_product > 0) { print ''; + print ''.img_object($langs->trans("ShowProduct"),"product").' '.stripslashes(nl2br($objp->description)).''; } else { - print "\n"; + print "\n"; } - print ''; - print ''; + print ''; + print ''; if ($objp->remise_percent > 0) { print '\n"; @@ -628,10 +632,11 @@ else $sql .= " ORDER BY p.nbvente DESC LIMIT 20"; if ( $db->query($sql) ) { - $opt = ""; + $opt = ""; if ($result) { - $num = $db->num_rows(); $i = 0; + $num = $db->num_rows(); + $i = 0; while ($i < $num) { $objp = $db->fetch_object(); @@ -643,16 +648,16 @@ else } else { - print $db->error(); + dolibarr_print_error($db); } print ""; print ""; print ''; - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; print ''."\n"; print ''; print "".''; @@ -687,9 +692,9 @@ else { print '
'; - if ($commande->statut > 0 && $commande->statut < 3 && $user->rights->expedition->creer) + if ($conf->expedition->enabled && $commande->statut > 0 && $commande->statut < 3 && $user->rights->expedition->creer) { - print 'Expédier'; + print ''.$langs->trans("Send").''; } @@ -720,7 +725,7 @@ else print "
\n"; - print '
'.$langs->trans("Ref").''.$langs->trans("Product").''.$langs->trans("Price").'Remise'.$langs->trans("Qty").'
[$objp->ref]'.$objp->product.'".price($objp->price)."'.img_object($langs->trans("ShowProduct"),"product").' '.$objp->product.'".price($objp->price)."'.$objp->remise_percent.' %".$objp->qty."
 '.$objp->product.''.img_object($langs->trans("ShowProduct"),"product").' '.$objp->product.''.price($objp->price).''.$objp->remise_percent.' %".$objp->qty."
'.$langs->trans("Author").''.$author->fullname.'Projet : '; - if ($commande->projet_id > 0) - { - $projet = New Project($db); - $projet->fetch($commande->projet_id); - print ''.$projet->title.''; - } - else - { - print 'Classer la commande'; - } + print ''; + if ($conf->projet->enabled) { + print $langs->trans("Project").' : '; + if ($commande->projet_id > 0) + { + $projet = New Project($db); + $projet->fetch($commande->projet_id); + print ''.$projet->title.''; + } + else + { + print 'Classer la commande'; + } + } print " 
'; - print ''.stripslashes(nl2br($objp->description)).'".stripslashes(nl2br($objp->description))."".stripslashes(nl2br($objp->description))."'.$objp->tva_tx.' %'.$objp->qty.''.$objp->tva_tx.' %'.$objp->qty.''.$objp->remise_percent." %
'.$langs->trans("Description").'TvaQuantitéRemiseP.U.'.$langs->trans("VAT").''.$langs->trans("Qty").''.$langs->trans("Discount").'P.U.  
'; + print '
'; /* * Liste des expéditions */ @@ -737,7 +742,7 @@ else print_titre("Expéditions"); $i = 0; $total = 0; print ''; - print "\n"; + print "\n"; $var=True; while ($i < $num) @@ -771,10 +776,10 @@ else $num = $db->num_rows(); if ($num) { - print_titre("Factures"); + print_titre($langs->trans("Bills")); $i = 0; $total = 0; print '
ExpéditionDate
Expédition".$langs->trans("Date")."
'; - print "\n"; + print "\n"; $var=True; while ($i < $num) @@ -807,7 +812,7 @@ else if (file_exists($file)) { - print_titre("Documents"); + print_titre($langs->trans("Documents")); print '
Facture".$langs->trans("Date")."
".$langs->trans("Bill")."".$langs->trans("Date")."
'; print ""; diff --git a/htdocs/commande/index.php b/htdocs/commande/index.php index 3fb955aae2d..c70ae68d030 100644 --- a/htdocs/commande/index.php +++ b/htdocs/commande/index.php @@ -20,8 +20,8 @@ * $Source$ * */ - -/*! + +/** \file htdocs/commande/index.php \ingroup compta \brief Page acceuil zone comptabilité @@ -77,8 +77,7 @@ if ( $db->query($sql) ) { $var=!$var; $obj = $db->fetch_object(); - print ""; + print ""; print ''; $i++; } @@ -111,8 +110,7 @@ if ( $db->query($sql) ) { $var=!$var; $obj = $db->fetch_object(); - print ""; + print ""; print ''; $i++; } diff --git a/htdocs/langs/en_US/commercial.lang b/htdocs/langs/en_US/commercial.lang index 896af3ba834..3b25a812c86 100644 --- a/htdocs/langs/en_US/commercial.lang +++ b/htdocs/langs/en_US/commercial.lang @@ -1,5 +1,6 @@ # Dolibarr language file - en_US - commercial Commercial=Commercial +CommercialArea=Commercial area Customer=Customer Customers=Customers Prospect=Prospect diff --git a/htdocs/langs/fr_FR/commercial.lang b/htdocs/langs/fr_FR/commercial.lang index 39411fab1cb..afebaf8557b 100644 --- a/htdocs/langs/fr_FR/commercial.lang +++ b/htdocs/langs/fr_FR/commercial.lang @@ -1,5 +1,6 @@ # Dolibarr language file - fr_FR - commercial Commercial=Commercial +CommercialArea=Espace commercial Customer=Client Customers=Clients Prospect=Prospect
".$langs->trans("Order")." PDF
rowid\">".img_file()." "; - print "rowid\">$obj->ref
rowid\">".img_object($langs->trans("ShowOrder"),"order")." ".$obj->ref."'.$obj->nom.'
rowid\">".img_file().""; - print " rowid\">$obj->ref
rowid\">".img_object($langs->trans("ShowOrder"),"order")." ".$obj->ref."'.$obj->nom.'