From bd5dc6399bf1eb51219103c65153654f38634676 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 30 Nov 2020 12:35:05 +0100 Subject: [PATCH] Fix deprecated code --- htdocs/core/class/html.form.class.php | 4 +++- htdocs/core/class/html.formticket.class.php | 2 +- htdocs/projet/tasks/contact.php | 5 +++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index a56402fddef..ba491580efc 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1456,6 +1456,7 @@ class Form $langs->load('companies'); if (empty($htmlid)) $htmlid = $htmlname; + $num = 0; if ($selected === '') $selected = array(); elseif (!is_array($selected)) $selected = array($selected); @@ -4999,7 +5000,8 @@ class Form print ''; print ''; print ''; diff --git a/htdocs/projet/tasks/contact.php b/htdocs/projet/tasks/contact.php index a04214a2f06..9c71a6f7042 100644 --- a/htdocs/projet/tasks/contact.php +++ b/htdocs/projet/tasks/contact.php @@ -84,7 +84,7 @@ if ($action == 'addcontact' && $user->rights->projet->creer) { header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object->id.($withproject ? '&withproject=1' : '')); exit; - } else { + } else {$nbofcontacts if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') { $langs->load("errors"); @@ -423,7 +423,8 @@ if ($id > 0 || !empty($ref)) print ''; print '
'; - $num = $this->select_contacts($societe->id, $selected, $htmlname); + print $this->selectcontacts($societe->id, $selected, $htmlname); + $num = $this->num; if ($num == 0) { $addcontact = (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("AddContact") : $langs->trans("AddContactAddress")); diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index cd224d55082..aa90ee7fa1c 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -385,7 +385,7 @@ class FormTicket // If no socid, set to -1 to avoid full contacts list $selectedCompany = ($this->withfromsocid > 0) ? $this->withfromsocid : -1; print img_picto('', 'contact', 'class="paddingright"'); - $nbofcontacts = $form->select_contacts($selectedCompany, $this->withfromcontactid, 'contactid', 3, '', '', 0, 'minwidth200'); + print $form->selectcontacts($selectedCompany, $this->withfromcontactid, 'contactid', 3, '', '', 0, 'minwidth200'); print ' '; $formcompany->selectTypeContact($ticketstatic, '', 'type', 'external', '', 0, 'maginleftonly'); print '
'; $contactofproject = $projectstatic->getListContactId('external'); - $nbofcontacts = $form->select_contacts($selectedCompany, '', 'contactid', 0, '', $contactofproject); + print $form->selectcontacts($selectedCompany, '', 'contactid', 0, '', $contactofproject); + $nbofcontacts = $form->num; print ''; $formcompany->selectTypeContact($object, '', 'type', 'external', 'rowid');