From afb79d5d2ce838bd1b33dad45f63e702f040d372 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 21 Apr 2012 19:44:05 +0200 Subject: [PATCH] Fix: [ bug #367 ] "Multi-tiers" fonctionality inverted in project contacts. --- htdocs/core/class/html.formcompany.class.php | 2 +- htdocs/projet/contact.php | 10 +++++----- htdocs/projet/fiche.php | 6 ++++-- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index 52c0ce52e5f..8999341513e 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -506,7 +506,7 @@ class FormCompany * @param string $var_id Name of id field * @param string $selected Pre-selected third party * @param string $htmlname Name of HTML form - * @param string $limitto Disable answers that are not id in this array list + * @param array $limitto Disable answers that are not id in this array list * @param int $forceid This is to force antoher object id than object->id * @return void * TODO obsolete ? diff --git a/htdocs/projet/contact.php b/htdocs/projet/contact.php index d7f501e0a0f..f1fe6eb5c55 100644 --- a/htdocs/projet/contact.php +++ b/htdocs/projet/contact.php @@ -248,8 +248,8 @@ if ($id > 0 || ! empty($ref)) print ''; // Line to add external contact. Only if project is linked to a third party. - if ($project->societe->id) - { + //if ($project->societe->id) + //{ print '
'; print ''; print ''; @@ -265,12 +265,12 @@ if ($id > 0 || ! empty($ref)) print ''; $selectedCompany = isset($_GET["newcompany"])?$_GET["newcompany"]:$project->societe->id; - $selectedCompany = $formcompany->selectCompaniesForNewContact($project, 'id', $selectedCompany, 'newcompany'); + $selectedCompany = $formcompany->selectCompaniesForNewContact($project, 'id', $selectedCompany, 'newcompany', (empty($project->societe->id)?array():array($project->societe->id))); print ''; print ''; $nbofcontacts=$form->select_contacts($selectedCompany, '', 'contactid'); - if ($nbofcontacts == 0) print $langs->trans("NoContactDefined"); + //if ($nbofcontacts == 0) print $langs->trans("NoContactDefined"); print ''; print ''; $formcompany->selectTypeContact($project, '', 'type','external','rowid'); @@ -287,7 +287,7 @@ if ($id > 0 || ! empty($ref)) print ''; print "
"; - } + //} print ' '; } diff --git a/htdocs/projet/fiche.php b/htdocs/projet/fiche.php index edc44e5e7fd..925f93e0465 100644 --- a/htdocs/projet/fiche.php +++ b/htdocs/projet/fiche.php @@ -416,7 +416,9 @@ else // Customer print ''.$langs->trans("Company").''; - print $form->select_company($project->societe->id,'socid','',1,1); + $text=$form->select_company($project->societe->id,'socid','',1,1); + $texthelp=$langs->trans("IfNeedToUseOhterObjectKeepEmpty"); + print $form->textwithtooltip($text.' '.img_help(),$texthelp,1); print ''; // Visibility @@ -449,7 +451,7 @@ else print '

'; print '   '; print '
'; - + print ''; } else