From 8472f185f7762ac90c141778c9e6109c4bdf9245 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Nov 2004 15:14:09 +0000 Subject: [PATCH] Fix: Pb register_globals Trad: Traductions sur propals --- htdocs/comm/propal.php | 153 ++++++++++++++++---------------- htdocs/comm/propal/document.php | 8 +- htdocs/comm/propal/info.php | 24 +++-- htdocs/comm/propal/note.php | 28 +++--- 4 files changed, 115 insertions(+), 98 deletions(-) diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 30d80aa942f..0c5b3b4d0c3 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -30,6 +30,8 @@ require("./pre.inc.php"); $langs->load("companies"); +$langs->load("propal"); +$langs->load("bills"); $user->getrights('propale'); @@ -58,7 +60,7 @@ if ($user->societe_id > 0) /* Actions */ /******************************************************************************/ -if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == yes) +if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == 'yes') { if ($user->rights->propale->supprimer ) { @@ -115,8 +117,8 @@ if ($_POST["action"] == 'add') if ($_GET["action"] == 'pdf') { $propal = new Propal($db); - $propal->fetch($propalid); - propale_pdf_create($db, $propalid, $propal->modelpdf); + $propal->fetch($_GET["propalid"]); + propale_pdf_create($db, $_GET["propalid"], $propal->modelpdf); } if ($_POST["action"] == 'setstatut' && $user->rights->propale->cloturer) @@ -239,18 +241,22 @@ if ($_GET["propalid"]) $societe = new Societe($db); $societe->fetch($propal->soc_id); + $h=0; + + $head[$h][0] = DOL_URL_ROOT.'/comm/propal.php?propalid='.$propal->id; + $head[$h][1] = $langs->trans("Prop").": $propal->ref"; + $hselected=$h; + $h++; - $head[0][0] = DOL_URL_ROOT.'/comm/propal.php?propalid='.$propal->id; - $head[0][1] = "Proposition commerciale : $propal->ref"; - $h = 1; - $a = 0; $head[$h][0] = DOL_URL_ROOT.'/comm/propal/note.php?propalid='.$propal->id; $head[$h][1] = $langs->trans("Note"); $h++; + $head[$h][0] = DOL_URL_ROOT.'/comm/propal/info.php?propalid='.$propal->id; $head[$h][1] = $langs->trans("Info"); + $h++; - dolibarr_fiche_head($head, $a, $societe->nom); + dolibarr_fiche_head($head, $hselected, $societe->nom); /* * Confirmation de la suppression de la propale @@ -303,7 +309,7 @@ if ($_GET["propalid"]) $url = DOL_URL_ROOT.'/comm/prospect/fiche.php?socid='.$societe->id; } print ''.$societe->nom.''; - print ''.$langs->trans("Status").''.$obj->lst.''; + print ''.$langs->trans("Status").''.$obj->lst.''; print ''.$langs->trans("Date").''.strftime("%A %d %B %Y",$propal->date); if ($propal->fin_validite) @@ -317,9 +323,9 @@ if ($_GET["propalid"]) $author->fetch(''); print $author->fullname.''; - print "Destinataire$obj->firstname $obj->name <$obj->email>"; + print "".$langs->trans("To")."$obj->firstname $obj->name <$obj->email>"; - print ''.$langs->trans("Note").' :
'. nl2br($propal->note).""; + print ''.$langs->trans("Note").' :
'. nl2br($propal->note).""; if ($propal->projet_id) { @@ -364,7 +370,7 @@ if ($_GET["propalid"]) * */ - print ""; + print "
"; if ($propal->brouillon == 1 && $user->rights->propale->creer) { @@ -375,7 +381,7 @@ if ($_GET["propalid"]) if ($_GET["action"] == 'statut') { print "
id\" method=\"post\">"; - print '
'; + print '
'; print ''; print "
Clôturer comme : '; print "
"; } - /* - * - * - */ /* * Produits */ - print_titre("Produits"); + print_titre($langs->trans("ProductsAndServices")); print '
'; - print ''; - print ""; - print ''; - print ''; + print '
'.$langs->trans("Ref").'ProduitTvaQté.RemiseP.U.
'; + print ""; + print ''; + print ''; if ($propal->statut == 0) { print ""; @@ -421,7 +423,7 @@ if ($_GET["propalid"]) { $objp = $db->fetch_object($result); $var=!$var; - print ""; + print ""; print "\n"; print ''; print ''; @@ -451,12 +453,12 @@ if ($_GET["propalid"]) { $objp = $db->fetch_object(); $var=!$var; - print "\n"; + print "\n"; print ''; print ''; print "\n"; print ''; - print ""; + print ""; if ($propal->statut == 0 && $user->rights->propale->creer) { print ''; print ''; print ''; @@ -514,8 +515,7 @@ if ($_GET["propalid"]) print ''; /* - * Produits - * + * Ligne d'ajout de produits/services prédéfinis */ $var=!$var; print ""; @@ -526,43 +526,43 @@ if ($_GET["propalid"]) print "\n"; } print "
'.$langs->trans("Ref").''.$langs->trans("ProductOrService").''.$langs->trans("VAT").''.$langs->trans("Qty").'RemiseP.U. 
[$objp->ref]'.$objp->product.''.$objp->tva_tx.' %
 
 '.$objp->description.''.$objp->tva_tx.' %".$objp->qty."'.$objp->remise_percent.' %".price($objp->subprice)."".price($objp->subprice)."'; @@ -492,16 +494,15 @@ if ($_GET["propalid"]) } else { - print $db->error(); + dolibarr_print_error($db); } + /* - * Produits génériques - * + * Ligne d'ajout de produits/services personalisé */ $var=!$var; - print '
 
 
"; - print '
'; + print '
'; + print ''; /* - * Actions + * Barre d'actions */ - print ''; if ($propal->statut < 2) { print '

'; + // Valid if ($propal->statut == 0) { - if ($user->rights->propale->supprimer) + if ($user->rights->propale->valider) { - print "id&action=delete\">Supprimer"; + print "id&valid=1\">".$langs->trans("Valid").""; } } - else - { - if ($propal->statut == 1 && $user->rights->propale->cloturer) - { - print "id&action=statut\">Clôturer"; - } - } - /* - * - */ + // Save + if ($propal->statut == 1) + { + if ($user->rights->propale->creer) + { + print "id&action=modif\">".$langs->trans("Save").""; + } + } + + // Build PDF if ($propal->statut < 2 && $user->rights->propale->creer) { - print 'Générer'; + print ''.$langs->trans("BuildPDF").''; } - /* - * - */ + + // Send if ($propal->statut == 1) { $file = PROPALE_OUTPUTDIR. "/$obj->ref/$obj->ref.pdf"; @@ -575,28 +575,30 @@ if ($_GET["propalid"]) } } - /* - * - */ + + // Delete if ($propal->statut == 0) { - if ($user->rights->propale->valider) + if ($user->rights->propale->supprimer) { - print "id&valid=1\">Valider"; - } - - } - elseif ($propal->statut == 1) - { - if ($user->rights->propale->creer) - { - print "id&action=modif\">Modifier"; + print "id&action=delete\">".$langs->trans("Delete").""; } } print "
"; } + // Close + if ($propal->statut != 0) + { + if ($propal->statut == 1 && $user->rights->propale->cloturer) + { + print "id&action=statut\">".$langs->trans("Close").""; + } + } + + + /* * Envoi de la propale par mail * @@ -640,6 +642,7 @@ if ($_GET["propalid"]) $actioncomm->note = "Envoyée à ".$_POST["sendto"]; $actioncomm->add($user); } + /* * */ @@ -649,14 +652,15 @@ if ($_GET["propalid"]) print ''; } print '
'; - print_titre('Documents'); + print_titre(''.$langs->trans("Document").''); + - print ''; - /* * */ + print '
'; + $file = PROPALE_OUTPUTDIR . "/$propal->ref/$propal->ref.pdf"; if (file_exists($file)) { @@ -669,11 +673,6 @@ if ($_GET["propalid"]) print ''; print ''; } - /* - * - * - */ - if ($propal->brouillon == 1 && $user->rights->propale->creer) { @@ -681,10 +680,11 @@ if ($_GET["propalid"]) $html = new Form($db); $modelpdf = new Propal_Model_pdf($db); $html->select_array("modelpdf",$modelpdf->liste_array(),$propal->modelpdf); - print ''; } print "
'.filesize($file). ' bytes'.strftime("%d %B %Y %H:%M:%S",filemtime($file)).'
'; + print ''; print '
\n"; + /* * */ @@ -692,7 +692,7 @@ if ($_GET["propalid"]) if ($nb_commande > 0) { $coms = $propal->commande_liste_array(); - print '
'; + print '
'; if ($nb_commande == 1) @@ -739,8 +739,8 @@ if ($_GET["propalid"]) { print_titre("Propale envoyée"); - print '
'; - print "\n"; + print '
".$langs->trans("Date")."".$langs->trans("Author")."
'; + print "\n"; while ($i < $num) @@ -770,6 +770,7 @@ if ($_GET["propalid"]) { print ''; } + /* * * @@ -802,7 +803,7 @@ if ($_GET["propalid"]) print ""; print "
".$langs->trans("Date")."".$langs->trans("Author")."
Message
"; - print ""; + print "trans("Send")."\">"; print ""; } diff --git a/htdocs/comm/propal/document.php b/htdocs/comm/propal/document.php index 06d76e3fcdb..45b160ea4ed 100644 --- a/htdocs/comm/propal/document.php +++ b/htdocs/comm/propal/document.php @@ -1,5 +1,6 @@ + * Copyright (C) 2004 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 @@ -26,13 +27,15 @@ */ require("./pre.inc.php"); +require_once("../../propal.class.php"); $user->getrights('propale'); + if (!$user->rights->propale->lire) accessforbidden(); -require_once("../../propal.class.php"); + llxHeader(); function do_upload ($upload_dir) @@ -140,13 +143,14 @@ if ($id > 0) } else { - print $db->error() . "
" . $sql; + dolibarr_print_error($db); } } else { print "Erreur"; } + $db->close(); llxFooter("Dernière modification $Date$ révision $Revision$"); diff --git a/htdocs/comm/propal/info.php b/htdocs/comm/propal/info.php index 587cd559ff7..6d94ba08c92 100644 --- a/htdocs/comm/propal/info.php +++ b/htdocs/comm/propal/info.php @@ -1,5 +1,6 @@ + * Copyright (C) 2004 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 @@ -28,6 +29,8 @@ require("./pre.inc.php"); +$langs->load("propal"); + $user->getrights('propale'); if (!$user->rights->propale->lire) accessforbidden(); @@ -46,19 +49,22 @@ if ($_GET["propalid"]) $societe = new Societe($db); $societe->fetch($propal->soc_id); + $h=0; - $head[0][0] = DOL_URL_ROOT.'/comm/propal.php?propalid='.$propal->id; - $head[0][1] = "Proposition commerciale : $propal->ref"; - $h = 1; - $a = 0; - $head[$h][0] = DOL_URL_ROOT.'/comm/propal/note.php?propalid='.$propal->id; - $head[$h][1] = "Note"; + $head[$h][0] = DOL_URL_ROOT.'/comm/propal.php?propalid='.$propal->id; + $head[$h][1] = $langs->trans("Prop").": $propal->ref"; $h++; + + $head[$h][0] = DOL_URL_ROOT.'/comm/propal/note.php?propalid='.$propal->id; + $head[$h][1] = $langs->trans("Note"); + $h++; + $head[$h][0] = DOL_URL_ROOT.'/comm/propal/info.php?propalid='.$propal->id; - $head[$h][1] = "Info"; - $a=$h; + $head[$h][1] = $langs->trans("Info"); + $hselected=$h; + $h++; - dolibarr_fiche_head($head, $a, $societe->nom); + dolibarr_fiche_head($head, $hselected, $societe->nom); $propal->info($propal->id); dolibarr_print_object_info($propal); diff --git a/htdocs/comm/propal/note.php b/htdocs/comm/propal/note.php index 5f875c05c59..e87af211102 100644 --- a/htdocs/comm/propal/note.php +++ b/htdocs/comm/propal/note.php @@ -28,13 +28,15 @@ */ require("./pre.inc.php"); +require("../../propal.class.php"); + +$langs->load("propal"); $user->getrights('propale'); if (!$user->rights->propale->lire) accessforbidden(); -require("../../propal.class.php"); /* * Sécurité accés client */ @@ -71,16 +73,20 @@ if ($_GET["propalid"]) $societe = new Societe($db); if ( $societe->fetch($propal->soc_id) ) { - - $head[0][0] = DOL_URL_ROOT.'/comm/propal.php?propalid='.$propal->id; - $head[0][1] = "Proposition commerciale : $propal->ref"; - $h = 1; - $head[$h][0] = DOL_URL_ROOT.'/comm/propal/note.php?propalid='.$propal->id; - $head[$h][1] = "Note"; - $hselected = 1; - $h++; - $head[$h][0] = DOL_URL_ROOT.'/comm/propal/info.php?propalid='.$propal->id; - $head[$h][1] = "Info"; + $h=0; + + $head[$h][0] = DOL_URL_ROOT.'/comm/propal.php?propalid='.$propal->id; + $head[$h][1] = $langs->trans("Prop").": $propal->ref"; + $h++; + + $head[$h][0] = DOL_URL_ROOT.'/comm/propal/note.php?propalid='.$propal->id; + $head[$h][1] = $langs->trans("Note"); + $hselected=$h; + $h++; + + $head[$h][0] = DOL_URL_ROOT.'/comm/propal/info.php?propalid='.$propal->id; + $head[$h][1] = $langs->trans("Info"); + $h++; dolibarr_fiche_head($head, $hselected, $societe->nom);