Merge pull request #17934 from frederic34/patch-7

fix php warning
This commit is contained in:
Laurent Destailleur 2021-06-15 22:08:37 +02:00 committed by GitHub
commit ac7ad64737
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2013-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2015-2016 Charlie BENKE <charlie@patas-monkey.com>
* Copyright (C) 2021 Frédéric France <frederic.france@netlogic.fr>
*
* 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
@ -100,11 +101,11 @@ if ($permission) {
if (empty($hideaddcontactforuser)) {
?>
<form class="tagtr impair nohover" action="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id; ?>" method="POST">
<input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>" />
<input type="hidden" name="token" value="<?php echo newToken(); ?>" />
<input type="hidden" name="id" value="<?php echo $object->id; ?>" />
<input type="hidden" name="action" value="addcontact" />
<input type="hidden" name="source" value="internal" />
<?php if ($withproject) {
<?php if (!empty($withproject)) {
print '<input type="hidden" name="withproject" value="'.$withproject.'">';
} ?>
@ -134,19 +135,17 @@ if ($permission) {
<input type="hidden" name="id" value="<?php echo $object->id; ?>" />
<input type="hidden" name="action" value="addcontact" />
<input type="hidden" name="source" value="external" />
<?php if ($withproject) {
<?php if (!empty($withproject)) {
print '<input type="hidden" name="withproject" value="'.$withproject.'">';
} ?>
<div class="tagtd nowrap maxwidthonsmartphone noborderbottom">
<?php $selectedCompany = isset($_GET["newcompany"]) ? $_GET["newcompany"] : $object->socid; ?>
<?php
<?php $selectedCompany = isset($_GET["newcompany"]) ? $_GET["newcompany"] : (empty($object->socid) ? 0 : $object->socid);
// add company icon before select list
if ($selectedCompany) {
echo img_object('', 'company', 'class="hideonsmartphone"');
}
?>
<?php $selectedCompany = $formcompany->selectCompaniesForNewContact($object, 'id', $selectedCompany, 'newcompany', '', 0, '', 'minwidth300imp'); ?>
$selectedCompany = $formcompany->selectCompaniesForNewContact($object, 'id', $selectedCompany, 'newcompany', '', 0, '', 'minwidth300imp'); ?>
</div>
<!-- <div class="tagtd nowrap noborderbottom"><?php echo img_object('', 'contact').' '.$langs->trans("ThirdPartyContacts"); ?></div>-->
<div class="tagtd maxwidthonsmartphone noborderbottom">