diff --git a/htdocs/core/tpl/contacts.tpl.php b/htdocs/core/tpl/contacts.tpl.php index 32c6b6a9b5871..83096bcddb847 100644 --- a/htdocs/core/tpl/contacts.tpl.php +++ b/htdocs/core/tpl/contacts.tpl.php @@ -1,8 +1,9 @@ - * Copyright (C) 2013-2015 Laurent Destailleur - * Copyright (C) 2015-2016 Charlie BENKE - * Copyright (C) 2021 Frédéric France +/* Copyright (C) 2012 Regis Houssin + * Copyright (C) 2013-2015 Laurent Destailleur + * Copyright (C) 2015-2016 Charlie BENKE + * Copyright (C) 2021 Frédéric France + * Copyright (C) 2024 Solution Libre SAS * * 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 @@ -255,11 +256,13 @@ $entry->contact_id = $userstatic->id; $entry->contact_html = $userstatic->getNomUrl(-1, '', 0, 0, 0, 0, '', 'valignmiddle'); $entry->contact_name = strtolower($userstatic->getFullName($langs)); + $entry->contact_warning = false; } elseif ($contact['source'] == 'external') { $contactstatic->fetch($contact['id']); $entry->contact_id = $contactstatic->id; $entry->contact_html = $contactstatic->getNomUrl(1, '', 0, '', 0, 0); $entry->contact_name = strtolower($contactstatic->getFullName($langs)); + $entry->contact_warning = ($contactstatic->user_id > 0); } if ($contact['source'] == 'internal') { @@ -324,16 +327,27 @@ } print ""; -foreach ($list as $entry) { - print ''; - - print ''.$entry->thirdparty_html.''; - print ''.$entry->contact_html.''; - print ''.dol_escape_htmltag($entry->nature_html).''; - print ''.dol_escape_htmltag($entry->type).''; - print ''.$entry->status_html.''; - - if ($permission) { +foreach ($list as $entry) { ?> + + + thirdparty_html ?> + + + contact_html ?> + + + + nature_html) ?> + + contact_warning ? img_picto($langs->trans("ThisContactHasAnUser"), 'warning') : '') ?> + + + type) ?> + + + status_html ?> + + id); $href .= '&action=deletecontact&token='.newToken(); diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index bedc6a60e081a..c3f7dd9096ed1 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -1306,3 +1306,4 @@ TranslationOfKey=Translation of the key AnyTranslationKey SignedStatus=Signed status NbRecordQualified=Number of qualified records auto=auto +ThisContactHasAnUser=Warning, you must assign the associated user and not this contact to allow access to this object.