From c341b68eae60db805061ddb1e44eddafb557b4db Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 4 Jul 2011 08:00:52 +0000 Subject: [PATCH] New: Project creation page has a cancel button --- htdocs/contact/fiche.php | 20 ++++++++++---------- htdocs/lib/company.lib.php | 14 ++++++++------ htdocs/projet/fiche.php | 28 ++++++++++++++++++++++------ htdocs/societe/soc.php | 15 ++------------- 4 files changed, 42 insertions(+), 35 deletions(-) diff --git a/htdocs/contact/fiche.php b/htdocs/contact/fiche.php index 6fc5ef70e40..3e40da58a72 100644 --- a/htdocs/contact/fiche.php +++ b/htdocs/contact/fiche.php @@ -24,7 +24,7 @@ * \file htdocs/contact/fiche.php * \ingroup societe * \brief Card of a contact - * \version $Id: fiche.php,v 1.220 2011/07/02 14:53:42 eldy Exp $ + * \version $Id: fiche.php,v 1.221 2011/07/04 08:00:52 eldy Exp $ */ require("../main.inc.php"); @@ -123,7 +123,14 @@ if (method_exists($objcanvas->control,'doActions')) if (empty($reshook)) { - // Creation utilisateur depuis contact + // Cancel + if (GETPOST("cancel") && GETPOST('backtopage')) + { + header("Location: ".GETPOST('backtopage')); + exit; + } + + // Creation utilisateur depuis contact if ($_POST["action"] == 'confirm_create_user' && $_POST["confirm"] == 'yes' && $user->rights->user->user->creer) { // Recuperation contact actuel @@ -162,13 +169,6 @@ if (empty($reshook)) } } - // Cancel - if (GETPOST("cancel") && GETPOST('backtopage')) - { - header("Location: ".GETPOST('backtopage')); - exit; - } - // Add contact if (GETPOST("action") == 'add' && $user->rights->societe->contact->creer) { @@ -974,5 +974,5 @@ else $db->close(); -llxFooter('$Date: 2011/07/02 14:53:42 $ - $Revision: 1.220 $'); +llxFooter('$Date: 2011/07/04 08:00:52 $ - $Revision: 1.221 $'); ?> diff --git a/htdocs/lib/company.lib.php b/htdocs/lib/company.lib.php index fd74cf79c4b..0b72ea1049a 100644 --- a/htdocs/lib/company.lib.php +++ b/htdocs/lib/company.lib.php @@ -24,7 +24,7 @@ * \file htdocs/lib/company.lib.php * \brief Ensemble de fonctions de base pour le module societe * \ingroup societe - * \version $Id: company.lib.php,v 1.120 2011/07/03 18:32:08 eldy Exp $ + * \version $Id: company.lib.php,v 1.121 2011/07/04 08:00:52 eldy Exp $ */ /** @@ -331,9 +331,9 @@ function currency_name($code_iso,$withcode=0) } /** - * \brief Retourne le nom traduit de la forme juridique - * \param code Code de la forme juridique - * \return string Nom traduit du pays + * Retourne le nom traduit de la forme juridique + * @param code Code de la forme juridique + * @return string Nom traduit du pays */ function getFormeJuridiqueLabel($code) { @@ -387,7 +387,8 @@ function show_projects($conf,$langs,$db,$object,$backtopage='') $buttoncreate=''; if ($conf->projet->enabled && $user->rights->projet->creer) { - $buttoncreate=''.$langs->trans("AddProject").''; + //$buttoncreate=''.$langs->trans("AddProject").''; + $buttoncreate=''.$langs->trans("AddProject").' '.img_picto($langs->trans("AddProject"),'filenew').''."\n"; } print "\n"; @@ -487,7 +488,8 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') $buttoncreate=''; if ($user->rights->societe->contact->creer) { - $buttoncreate=''.$langs->trans("AddContact").''."\n"; + //$buttoncreate=''.$langs->trans("AddContact").''."\n"; + $buttoncreate=''.$langs->trans("AddContact").' '.img_picto($langs->trans("AddContact"),'filenew').''."\n"; } print "\n"; diff --git a/htdocs/projet/fiche.php b/htdocs/projet/fiche.php index 3c1c0c69080..8806bc7c32e 100644 --- a/htdocs/projet/fiche.php +++ b/htdocs/projet/fiche.php @@ -1,7 +1,7 @@ - * Copyright (C) 2004-2010 Laurent Destailleur - * Copyright (C) 2005-2010 Regis Houssin + * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2005-2011 Regis Houssin * * 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 @@ -22,7 +22,7 @@ * \file htdocs/projet/fiche.php * \ingroup projet * \brief Project card - * \version $Id$ + * \version $Id: fiche.php,v 1.126 2011/07/04 08:00:52 eldy Exp $ */ require("../main.inc.php"); @@ -55,6 +55,13 @@ $result = restrictedArea($user, 'projet', $projectid); * Actions */ +// Cancel +if (GETPOST("cancel") && GETPOST('backtopage')) +{ + header("Location: ".GETPOST('backtopage')); + exit; +} + if ($_POST["action"] == 'add' && $user->rights->projet->creer) { $error=0; @@ -270,8 +277,10 @@ if ($_GET["action"] == 'create' && $user->rights->projet->creer) print '
'; print ''; - print ''; print ''; + print ''; + + print '
'; $project = new Project($db); @@ -323,7 +332,14 @@ if ($_GET["action"] == 'create' && $user->rights->projet->creer) print '
'; - print '
'; + print '
'; + print ''; + if (GETPOST('backtopage')) + { + print '     '; + print ''; + } + print '
'; print '
'; } @@ -592,5 +608,5 @@ else $db->close(); -llxFooter('$Date$ - $Revision$'); +llxFooter('$Date: 2011/07/04 08:00:52 $ - $Revision: 1.126 $'); ?> diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index ed83535f983..b9cbbc020b4 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -26,7 +26,7 @@ * \file htdocs/societe/soc.php * \ingroup societe * \brief Third party card page - * \version $Id: soc.php,v 1.120 2011/07/02 14:51:27 eldy Exp $ + * \version $Id: soc.php,v 1.121 2011/07/04 08:00:53 eldy Exp $ */ require("../main.inc.php"); @@ -1903,17 +1903,6 @@ else print ''.$langs->trans("Modify").''."\n"; } - /*if ($user->rights->societe->contact->creer) - { - print ''.$langs->trans("AddContact").''."\n"; - } - */ - - /*if ($conf->projet->enabled && $user->rights->projet->creer) - { - print ''.$langs->trans("AddProject").''."\n"; - }*/ - if ($user->rights->societe->supprimer) { if ($conf->use_javascript_ajax) @@ -1972,5 +1961,5 @@ else $db->close(); -llxFooter('$Date: 2011/07/02 14:51:27 $ - $Revision: 1.120 $'); +llxFooter('$Date: 2011/07/04 08:00:53 $ - $Revision: 1.121 $'); ?> \ No newline at end of file