From f5e38e5da87ba7b61d684f8ebe457f8fb555f6f5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 23 Oct 2004 15:09:29 +0000 Subject: [PATCH] =?UTF-8?q?Qual:=20Remplacer=20de=20code=20dupliqu=E9=20su?= =?UTF-8?q?r=20la=20demande=20de=20confirmation=20par=20la=20m=E9thode=20c?= =?UTF-8?q?ommune=20html->form=5Fconfirm?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/projet/fiche.php | 73 +++++++++++++++++++---------------------- 1 file changed, 33 insertions(+), 40 deletions(-) diff --git a/htdocs/projet/fiche.php b/htdocs/projet/fiche.php index 3338e9f4740..17f40258b81 100644 --- a/htdocs/projet/fiche.php +++ b/htdocs/projet/fiche.php @@ -33,6 +33,10 @@ require("../facture.class.php"); require("../commande/commande.class.php"); $langs->load("projects"); +$langs->load("companies"); +$langs->load("bills"); +$langs->load("orders"); + $user->getrights('projet'); @@ -65,7 +69,7 @@ if ($_POST["action"] == 'update' && $user->rights->projet->creer) $_GET["id"]=$projet->id; // On retourne sur la fiche projet } -if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == yes) +if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == "yes") { $projet = new Project($db); $projet->id = $_GET["id"]; @@ -73,54 +77,38 @@ if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == yes) Header("Location: index.php"); } -llxHeader("","Projet","Projet"); +llxHeader("",$langs->trans("Project"),"Projet"); if ($_GET["action"] == 'delete') { - - print '
'; - print ''; - print ''; - - print ''; - - print '\n"; - print ''; - print '
Supprimer le projet
Etes-vous sur de vouloir supprimer ce projet ?'; $htmls = new Form($db); - - $htmls->selectyesno("confirm","no"); - - print "
'; - print "
\n"; + $htmls->form_confirm("fiche.php?id=$id","Supprimer un projet","Etes-vous sur de vouloir supprimer cet projet ?","confirm_delete"); } if ($_GET["action"] == 'create' && $user->rights->projet->creer) { - print_titre("Nouveau projet"); + print_titre($langs->trans("NewProject")); print '
'; - ?> - - - - '; - ?> - - - -
Société - '; + print ''; + print '
'.$langs->trans("Company").''; + $societe = new Societe($db); $societe->fetch($_GET["socidp"]); print $societe->nom_url; - ?> -
Créateur'.$user->fullname.'
trans("Ref") ?>
Titre
">
-
- '; + + print ''.$langs->trans("Author").''.$user->fullname.''; + + print ''.$langs->trans("Ref").''; + print ''.$langs->trans("Title").''; + print ''; + print ''; + print ''; } else { /* @@ -146,13 +134,13 @@ if ($_GET["action"] == 'create' && $user->rights->projet->creer) if ($conf->commande->enabled) { $head[$h][0] = DOL_URL_ROOT.'/projet/commandes.php?id='.$projet->id; - $head[$h][1] = 'Commandes'; + $head[$h][1] = $langs->trans("Orders"); $h++; } if ($conf->facture->enabled) { $head[$h][0] = DOL_URL_ROOT.'/projet/facture.php?id='.$projet->id; - $head[$h][1] = 'Factures'; + $head[$h][1] = $langs->trans("Bills"); $h++; } @@ -164,8 +152,8 @@ if ($_GET["action"] == 'create' && $user->rights->projet->creer) print ''; print ''; - print ''; - print ''; + print '
Société'.$projet->societe->nom.'
'; + print ''; print ''; print ''; print '
'.$langs->trans("Company").''.$projet->societe->nom.'
'.$langs->trans("Title").'
'.$langs->trans("Ref").'
'; @@ -174,16 +162,20 @@ if ($_GET["action"] == 'create' && $user->rights->projet->creer) } else { - print ''; + print '
'; print ''; print ''; - print ''; + print ''; print '
'.$langs->trans("Title").''.$projet->title.''.$langs->trans("Ref").''.$projet->ref.'
Société'.$projet->societe->nom_url.'
'.$langs->trans("Company").''.$projet->societe->nom_url.'
'; print '
'; } print ''; + + /* + * Boutons actions + */ if ($user->rights->projet->creer == 1) { print '
'; @@ -202,6 +194,7 @@ if ($_GET["action"] == 'create' && $user->rights->projet->creer) } } + $db->close(); llxFooter("Dernière modification $Date$ révision $Revision$");