From 0c10226d81dc65f31aa53d90f8fbe09ddaf26928 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 28 May 2007 13:14:48 +0000 Subject: [PATCH] =?UTF-8?q?Fix:=20meilleur=20gestion=20de=20la=20liste=20d?= =?UTF-8?q?=E9roulante=20des=20projets?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/fichinter/fiche.php | 77 +++++++++++++++++++++++--------------- 1 file changed, 46 insertions(+), 31 deletions(-) diff --git a/htdocs/fichinter/fiche.php b/htdocs/fichinter/fiche.php index 82835479edb..5db6d762d2a 100644 --- a/htdocs/fichinter/fiche.php +++ b/htdocs/fichinter/fiche.php @@ -198,40 +198,30 @@ if ($_GET["action"] == 'create') { // Projet associe $langs->load("project"); - print ''.$langs->trans("Project").''; - - if ($numprojet==0) - { - print 'Cette société n\'a pas de projet. '; + print ''; + print ''; $user->getrights("projet"); if ($user->rights->projet->creer) { - print ''.$langs->trans("Add").''; + print ''; } + print '
'.$langs->trans("NoProject").''.$langs->trans("Add").'
'; } - + else + { + $html->select_projects($societe->id,'','projetidp'); + } + print ''; } - print ''; print ''.$langs->trans("Description").''; print ""; @@ -295,12 +285,33 @@ elseif ($_GET["action"] == 'edit' && $_GET["id"] > 0) print ''.$langs->trans("Duration")." (".$langs->trans("days").')'; if ($conf->projet->enabled) - { - // Projet associé - print ''.$langs->trans("Project").''; - $html->select_projects($fichinter->societe_id,$fichinter->projet_id,"projetidp"); - print ''; - } + { + $societe=new Societe($db); + $societe->fetch($fichinter->societe_id); + $numprojet = $societe->has_projects(); + + // Projet associé + print ''.$langs->trans("Project").''; + + if (!$numprojet) + { + print ''; + print ''; + + $user->getrights("projet"); + + if ($user->rights->projet->creer) + { + print ''; + } + print '
'.$langs->trans("NoProject").''.$langs->trans("Add").'
'; + } + else + { + $html->select_projects($fichinter->societe_id,$fichinter->projet_id,"projetidp"); + } + print ''; + } // Description print ''.$langs->trans("Description").''; @@ -365,7 +376,11 @@ elseif ($_GET["id"] > 0) if ($conf->projet->enabled) { $fichinter->fetch_projet(); - print ''.$langs->trans("Project").''.$fichinter->projet->title.''; + print ''.$langs->trans("Project").''; + print ''; + print $fichinter->projet->title; + print ''; + print ''; } // Statut