diff --git a/htdocs/commande/contact.php b/htdocs/commande/contact.php
index 958ae3f4aa2..5305d52d0b4 100644
--- a/htdocs/commande/contact.php
+++ b/htdocs/commande/contact.php
@@ -232,7 +232,9 @@ if ($id > 0)
print '';
print '
';
- $html->select_users($user->id,'contactid');
+ // On récupère les id des users déjà sélectionnés
+ $userAlreadySelected = $commande->getListContactId('internal');
+ $html->select_users($user->id,'contactid',0,$userAlreadySelected);
print ' | ';
print '';
$commande->selectTypeContact($commande, '', 'type','internal');
@@ -261,7 +263,9 @@ if ($id > 0)
print ' | ';
print '';
- $html->select_contacts($selectedCompany, $selected = '', $htmlname = 'contactid');
+ // On récupère les id des contacts déjà sélectionnés
+ $contactAlreadySelected = $commande->getListContactId('external');
+ $html->select_contacts($selectedCompany, $selected = '', $htmlname = 'contactid',0,$contactAlreadySelected);
print ' | ';
print '';
$commande->selectTypeContact($commande, '', 'type','external');
diff --git a/htdocs/compta/facture/contact.php b/htdocs/compta/facture/contact.php
index 0dcc5fbdf9d..898a38353e2 100644
--- a/htdocs/compta/facture/contact.php
+++ b/htdocs/compta/facture/contact.php
@@ -212,7 +212,9 @@ if ($id > 0)
print ' | ';
print '';
- $html->select_users($user->id,'contactid');
+ // On récupère les id des users déjà sélectionnés
+ $userAlreadySelected = $facture->getListContactId('internal');
+ $html->select_users($user->id,'contactid',0,$userAlreadySelected);
print ' | ';
print '';
$facture->selectTypeContact($facture, '', 'type','internal');
@@ -241,7 +243,9 @@ if ($id > 0)
print ' | ';
print '';
- $html->select_contacts($selectedCompany, $selected = '', $htmlname = 'contactid');
+ // On récupère les id des contacts déjà sélectionnés
+ $contactAlreadySelected = $facture->getListContactId('external');
+ $html->select_contacts($selectedCompany, $selected = '', $htmlname = 'contactid',0,$contactAlreadySelected);
print ' | ';
print '';
$facture->selectTypeContact($facture, '', 'type','external');
diff --git a/htdocs/contrat/contact.php b/htdocs/contrat/contact.php
index d821dd02381..c434afa230f 100644
--- a/htdocs/contrat/contact.php
+++ b/htdocs/contrat/contact.php
@@ -233,7 +233,9 @@ if ($id > 0)
print ' | ';
print '';
- $html->select_users($user->id,'contactid');
+ // On récupère les id des users déjà sélectionnés
+ $userAlreadySelected = $contrat->getListContactId('internal');
+ $html->select_users($user->id,'contactid',0,$userAlreadySelected);
print ' | ';
print '';
$contrat->selectTypeContact($contrat, '', 'type','internal');
@@ -262,7 +264,9 @@ if ($id > 0)
print ' | ';
print '';
- $html->select_contacts($selectedCompany, $selected = '', $htmlname = 'contactid');
+ // On récupère les id des contacts déjà sélectionnés
+ $contactAlreadySelected = $contrat->getListContactId('external');
+ $html->select_contacts($selectedCompany, $selected = '', $htmlname = 'contactid',0,$contactAlreadySelected);
print ' | ';
print '';
$contrat->selectTypeContact($contrat, '', 'type','external');
diff --git a/htdocs/fichinter/contact.php b/htdocs/fichinter/contact.php
index 74baf05f534..aa4612436d1 100644
--- a/htdocs/fichinter/contact.php
+++ b/htdocs/fichinter/contact.php
@@ -218,7 +218,9 @@ if ($id > 0)
print ' | ';
print '';
- $html->select_users($user->id,'contactid');
+ // On récupère les id des users déjà sélectionnés
+ $userAlreadySelected = $fichinter->getListContactId('internal');
+ $html->select_users($user->id,'contactid',0,$userAlreadySelected);
print ' | ';
print '';
$fichinter->selectTypeContact($fichinter, '', 'type','internal');
@@ -247,7 +249,9 @@ if ($id > 0)
print ' | ';
print '';
- $html->select_contacts($selectedCompany, $selected = '', $htmlname = 'contactid');
+ // On récupère les id des contacts déjà sélectionnés
+ $contactAlreadySelected = $fichinter->getListContactId('external');
+ $html->select_contacts($selectedCompany, $selected = '', $htmlname = 'contactid',0,$contactAlreadySelected);
print ' | ';
print '';
$fichinter->selectTypeContact($fichinter, '', 'type','external');
|