From df342b3b4b52b7bab616e14ff3114fe975378843 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 14 Jan 2005 20:30:49 +0000 Subject: [PATCH] =?UTF-8?q?Qual:=20Am=E9liorations=20diverses=20mineures?= =?UTF-8?q?=20du=20module=20projet=20pour=20uniformiser=20l'interface?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/projet/commandes.php | 25 +++++++------ htdocs/projet/facture.php | 26 +++++++------- htdocs/projet/fiche.php | 70 ++++++++++++++++++++----------------- htdocs/projet/index.php | 11 +++--- htdocs/projet/propal.php | 24 ++++++------- 5 files changed, 78 insertions(+), 78 deletions(-) diff --git a/htdocs/projet/commandes.php b/htdocs/projet/commandes.php index b67e1a682ce..577ec3de847 100644 --- a/htdocs/projet/commandes.php +++ b/htdocs/projet/commandes.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/projet/commandes.php +/** \file htdocs/projet/commandes.php \ingroup projet commande \brief Page des commandes par projet \version $Revision$ @@ -34,6 +34,8 @@ require("../commande/commande.class.php"); $langs->load("projects"); $langs->load("companies"); +$langs->load("orders"); + llxHeader("","../"); @@ -67,18 +69,15 @@ if ($conf->facture->enabled) { $h++; } -dolibarr_fiche_head($head, $hselected); +dolibarr_fiche_head($head, $hselected, $langs->trans("Project").": ".$projet->ref); + -/* - * - * - */ $projet->societe->fetch($projet->societe->id); print ''; -print ''; -print ''; -print ''; +print ''; +print ''; +print ''; print '
'.$langs->trans("Title").''.$projet->title.''.$langs->trans("Ref").''.$projet->ref.'
'.$langs->trans("Company").''.$projet->societe->nom.'
'.$langs->trans("Company").''.$projet->societe->nom.'
'.$langs->trans("Ref").''.$projet->ref.'
'.$langs->trans("Label").''.$projet->title.'

'; /* @@ -90,7 +89,7 @@ $total = 0 ; if (sizeof($commandes)>0 && is_array($commandes)) { print_titre('Listes des commandes associées au projet'); - print ''; + print '
'; print ''; print ''; @@ -109,9 +108,9 @@ if (sizeof($commandes)>0 && is_array($commandes)) $total = $total + $commande->total_ht; } - print ''; + print ''; print ''; - print ''; + print ''; print "
'.$langs->trans("Ref").'Date'.$langs->trans("Amount").' 
'.$i.' commandes 
'.$i.' '.$langs->trans("Orders").''.$langs->trans("TotalHT").': '.price($total).''.$conf->monnaie.'
'.$conf->monnaie.'
"; } diff --git a/htdocs/projet/facture.php b/htdocs/projet/facture.php index a21bb5489fd..2d5ed4894dc 100644 --- a/htdocs/projet/facture.php +++ b/htdocs/projet/facture.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/projet/facture.php +/** \file htdocs/projet/facture.php \ingroup projet facture \brief Page des factures par projet \version $Revision$ @@ -34,6 +34,7 @@ require("../commande/commande.class.php"); $langs->load("projects"); $langs->load("companies"); +$langs->load("bills"); $user->getrights('projet'); @@ -73,18 +74,15 @@ if ($conf->facture->enabled) { $h++; } -dolibarr_fiche_head($head, $hselected); +dolibarr_fiche_head($head, $hselected, $langs->trans("Project").": ".$projet->ref); + -/* - * - * - */ $projet->societe->fetch($projet->societe->id); print ''; -print ''; -print ''; -print ''; +print ''; +print ''; +print ''; print '
'.$langs->trans("Title").''.$projet->title.''.$langs->trans("Ref").''.$projet->ref.'
'.$langs->trans("Company").''.$projet->societe->nom.'
'.$langs->trans("Company").''.$projet->societe->nom.'
'.$langs->trans("Ref").''.$projet->ref.'
'.$langs->trans("Label").''.$projet->title.'

'; @@ -100,7 +98,7 @@ print '
'; print ''; print ''; - print ''; + print ''; for ($i = 0; $i
'; $total = $total + $facture->total_ht; } - print '
'; - print ''; + print ''; + print ''; + print ''; print "
'.$langs->trans("Ref").'DateMontant 
'.$langs->trans("Ref").''.$langs->trans("Date").''.$langs->trans("Amount").' 
'.$i.' factures '.$langs-'; - print ''.$conf->monnaie.' HT
'.$i.' '.$langs->trans("Bills").''.$langs->trans("TotalHT").' : '.price($total).''.$conf->monnaie.'
"; } diff --git a/htdocs/projet/fiche.php b/htdocs/projet/fiche.php index 4432a628486..ddcb88ac62f 100644 --- a/htdocs/projet/fiche.php +++ b/htdocs/projet/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/projet/fiche.php +/** \file htdocs/projet/fiche.php \ingroup projet \brief Fiche projet \version $Revision$ @@ -60,13 +60,17 @@ if ($_POST["action"] == 'add' && $user->rights->projet->creer) if ($_POST["action"] == 'update' && $user->rights->projet->creer) { - $projet = new Project($db); - $projet->id = $_POST["id"]; - $projet->ref = $_POST["ref"]; - $projet->title = $_POST["title"]; - $projet->update(); - - $_GET["id"]=$projet->id; // On retourne sur la fiche projet + if (! $_POST["cancel"]) { + $projet = new Project($db); + $projet->id = $_POST["id"]; + $projet->ref = $_POST["ref"]; + $projet->title = $_POST["title"]; + $projet->update(); + + $_GET["id"]=$projet->id; // On retourne sur la fiche projet + } else { + $_GET["id"]=$_POST["id"]; // On retourne sur la fiche projet + } } if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == "yes") @@ -80,19 +84,13 @@ if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == "yes") llxHeader("",$langs->trans("Project"),"Projet"); -if ($_GET["action"] == 'delete') -{ - $htmls = new Form($db); - $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($langs->trans("NewProject")); print '
'; - print ''; + print '
'; print ''; print ''; print ''; - print ''; - print ''; + print ''; + print ''; print '
'.$langs->trans("Company").''; @@ -105,12 +103,13 @@ if ($_GET["action"] == 'create' && $user->rights->projet->creer) print '
'.$langs->trans("Author").''.$user->fullname.'
'.$langs->trans("Ref").'
'.$langs->trans("Title").'
'.$langs->trans("Label").'
'; print '
'; } else { + /* * Fiche projet en mode visu * @@ -147,7 +146,15 @@ if ($_GET["action"] == 'create' && $user->rights->projet->creer) $h++; } - dolibarr_fiche_head($head, $hselected); + dolibarr_fiche_head($head, $hselected, $langs->trans("Project").": ".$projet->ref); + + + if ($_GET["action"] == 'delete') + { + $htmls = new Form($db); + $htmls->form_confirm("fiche.php?id=".$_GET["id"],$langs->trans("DeleteAProject"),$langs->trans("ConfirmDeleteAProject"),"confirm_delete"); + print "
"; + } if ($_GET["action"] == 'edit') { @@ -156,19 +163,20 @@ if ($_GET["action"] == 'create' && $user->rights->projet->creer) print ''; print ''; - print ''; - print ''; + print ''; print ''; + print ''; + print ''; print '
'.$langs->trans("Company").''.$projet->societe->nom.'
'.$langs->trans("Title").'
'.$langs->trans("Company").''.$projet->societe->nom.'
'.$langs->trans("Ref").'
'.$langs->trans("Label").'
 
'; - print '

'; + print '
'; print ''; } else { print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; print '
'.$langs->trans("Title").''.$projet->title.''.$langs->trans("Ref").''.$projet->ref.'
'.$langs->trans("Company").''.$projet->societe->nom_url.'
'.$langs->trans("Company").''.$projet->societe->nom.'
'.$langs->trans("Ref").''.$projet->ref.'
'.$langs->trans("Label").''.$projet->title.'
'; print '
'; } @@ -182,17 +190,13 @@ if ($_GET["action"] == 'create' && $user->rights->projet->creer) if ($user->rights->projet->creer == 1) { print '
'; - if ($_GET["action"] == "edit") - { - print ''.$langs->trans("Cancel").''; - } - else + + if ($_GET["action"] != "edit") { print ''.$langs->trans("Edit").''; + print ''.$langs->trans("Delete").''; } - - print ''.$langs->trans("Delete").''; - + print "
"; } diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php index d8c5d96c29c..d32a6d55caf 100644 --- a/htdocs/projet/index.php +++ b/htdocs/projet/index.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,8 +21,7 @@ * */ -/*! - \file htdocs/projet/index.php +/** \file htdocs/projet/index.php \ingroup projet \brief Page d'accueil du module projet \version $Revision$ @@ -50,7 +49,7 @@ $sortorder = isset($_GET["sortorder"])?$_GET["sortorder"]:$_POST["sortorder"]; $page=isset($_GET["page"])?$_GET["page"]:$_POST["page"]; if ($sortfield == "") { - $sortfield="lower(s.nom)"; + $sortfield="p.ref"; } if ($sortorder == "") { @@ -72,8 +71,8 @@ $pagenext = $page + 1; print '
'; print ''; print ''; -print_liste_field_titre($langs->trans("Ref"),"index.php","s.idp","","","",$sortfield); -print_liste_field_titre($langs->trans("Title"),"index.php","p.title","","","",$sortfield); +print_liste_field_titre($langs->trans("Ref"),"index.php","p.ref","","","",$sortfield); +print_liste_field_titre($langs->trans("Label"),"index.php","p.title","","","",$sortfield); print_liste_field_titre($langs->trans("Company"),"index.php","s.nom","","","",$sortfield); print "\n"; diff --git a/htdocs/projet/propal.php b/htdocs/projet/propal.php index 14a9c5bb521..b548e4c24a5 100644 --- a/htdocs/projet/propal.php +++ b/htdocs/projet/propal.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/projet/propal.php +/** \file htdocs/projet/propal.php \ingroup projet propale \brief Page des propositions commerciales par projet \version $Revision$ @@ -34,6 +34,8 @@ require("../commande/commande.class.php"); $langs->load("projects"); $langs->load("companies"); +$langs->load("propal"); + llxHeader("","../"); @@ -67,19 +69,17 @@ if ($conf->facture->enabled) { $h++; } -dolibarr_fiche_head($head, $hselected); +dolibarr_fiche_head($head, $hselected, $langs->trans("Project").": ".$projet->ref); + -/* - * - */ $propales = array(); $projet->societe->fetch($projet->societe->id); print '
'; -print ''; -print ''; -print ''; +print ''; +print ''; +print ''; print '
'.$langs->trans("Title").''.$projet->title.''.$langs->trans("Ref").''.$projet->ref.'
'.$langs->trans("Company").''.$projet->societe->nom.'
'.$langs->trans("Company").''.$projet->societe->nom.'
'.$langs->trans("Ref").''.$projet->ref.'
'.$langs->trans("Label").''.$projet->title.'

'; $propales = $projet->get_propal_list(); @@ -107,9 +107,9 @@ if (sizeof($propales)>0 && is_array($propales)) $total = $total + $propale->price; } - print ''.$i.' propales '; - print 'Total : '.price($total).''; - print ''.$conf->monnaie.' HT'; + print ''.$i.' '.$langs->trans("Proposal").''; + print ''.$langs->trans("TotalHT").': '.price($total).''; + print ''.$conf->monnaie.''; } $db->close();