diff --git a/htdocs/admin/contract.php b/htdocs/admin/contract.php
index 9c4cf2561e6..29effeb5c80 100644
--- a/htdocs/admin/contract.php
+++ b/htdocs/admin/contract.php
@@ -243,7 +243,7 @@ foreach ($dirmodels as $reldir) {
$file = substr($file, 0, dol_strlen($file) - 4);
require_once $dir.$file.'.php';
-
+ /** @var ModelNumRefContracts $module */
$module = new $file($db);
// Show modules according to features level
@@ -255,7 +255,7 @@ foreach ($dirmodels as $reldir) {
}
if ($module->isEnabled()) {
- print '
| '.$module->nom." | \n";
+ print ' |
| '.$module->name." | \n";
print $module->info($langs);
print ' | ';
@@ -376,6 +376,7 @@ foreach ($dirmodels as $reldir) {
$classname = substr($file, 0, dol_strlen($file) - 12);
require_once $dir.'/'.$file;
+ /** @var ModelePDFContract $module */
$module = new $classname($db);
$modulequalified = 1;
diff --git a/htdocs/bookcal/calendar_list.php b/htdocs/bookcal/calendar_list.php
index df0a90da524..9230edb9285 100644
--- a/htdocs/bookcal/calendar_list.php
+++ b/htdocs/bookcal/calendar_list.php
@@ -22,26 +22,6 @@
* \brief List page for calendar
*/
-//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db
-//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user
-//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc
-//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs
-//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters
-//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters
-//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on)
-//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data
-//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu
-//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php
-//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library
-//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too.
-//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
-//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value
-//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler
-//if (! defined("MAIN_SECURITY_FORCECSP")) define('MAIN_SECURITY_FORCECSP', 'none'); // Disable all Content Security Policies
-//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET
-//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification
-//if (! defined('NOSESSION')) define('NOSESSION', '1'); // On CLI mode, no need to use web sessions
-
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
@@ -51,9 +31,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
// load module libraries
require_once __DIR__.'/class/calendar.class.php';
-// for other modules
-//dol_include_once('/othermodule/class/otherobject.class.php');
-
// Load translation files required by the page
$langs->loadLangs(array("bookcal@bookcal", "other"));
@@ -398,21 +375,6 @@ if ($num == 1 && !getDolGlobalInt('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $sea
llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist'); // Can use also classforhorizontalscrolloftabs instead of bodyforlist for no horizontal scroll
-// Example : Adding jquery code
-// print '';
-
$arrayofselected = is_array($toselect) ? $toselect : array();
$param = '';
diff --git a/htdocs/bookcal/class/calendar.class.php b/htdocs/bookcal/class/calendar.class.php
index 82e251b1fd0..7c84275f0ce 100644
--- a/htdocs/bookcal/class/calendar.class.php
+++ b/htdocs/bookcal/class/calendar.class.php
@@ -656,7 +656,7 @@ class Calendar extends CommonObject
if (isset($this->status)) {
$datas['picto'] .= ' '.$this->getLibStatut(5);
}
- $datas['ref'] .= '
'.$langs->trans('Ref').': '.$this->ref;
+ $datas['ref'] = '
'.$langs->trans('Ref').': '.$this->ref;
return $datas;
}
diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php
index d17a75b63e5..8eca3b5adab 100644
--- a/htdocs/categories/class/categorie.class.php
+++ b/htdocs/categories/class/categorie.class.php
@@ -1645,6 +1645,36 @@ class Categorie extends CommonObject
}
}
+ /**
+ * Return if at least one photo is available
+ *
+ * @param string $sdir Directory to scan
+ * @return boolean True if at least one photo is available, False if not
+ */
+ public function isAnyPhotoAvailable($sdir)
+ {
+ include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
+ include_once DOL_DOCUMENT_ROOT . '/core/lib/images.lib.php';
+
+ $sdir .= '/' . get_exdir($this->id, 2, 0, 0, $this, 'category') . $this->id . "/photos/";
+
+ $dir_osencoded = dol_osencode($sdir);
+ if (file_exists($dir_osencoded)) {
+ $handle = opendir($dir_osencoded);
+ if (is_resource($handle)) {
+ while (($file = readdir($handle)) !== false) {
+ if (!utf8_check($file)) {
+ $file = mb_convert_encoding($file, 'UTF-8', 'ISO-8859-1'); // To be sure data is stored in UTF8 in memory
+ }
+ if (dol_is_file($sdir . $file) && image_format_supported($file) >= 0) {
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+ }
+
/**
* getTooltipContentArray
* @param array $params params to construct tooltip data
@@ -1755,7 +1785,7 @@ class Categorie extends CommonObject
if (file_exists($dir)) {
if (is_array($file['name']) && count($file['name']) > 0) {
$nbfile = count($file['name']);
- for ($i = 0; $i <= $nbfile; $i++) {
+ for ($i = 0; $i < $nbfile; $i++) {
$originImage = $dir.$file['name'][$i];
// Cree fichier en taille origine
diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php
index a7fd4dc433e..d471e9d7ca4 100644
--- a/htdocs/commande/list.php
+++ b/htdocs/commande/list.php
@@ -2446,7 +2446,7 @@ while ($i < $imaxinloop) {
$userstatic->lastname = $obj->lastname;
$userstatic->firstname = $obj->firstname;
$userstatic->email = $obj->user_email;
- $userstatic->statut = $obj->user_statut;
+ $userstatic->status = $obj->user_statut;
$userstatic->entity = $obj->entity;
$userstatic->photo = $obj->photo;
$userstatic->office_phone = $obj->office_phone;
@@ -2773,10 +2773,10 @@ while ($i < $imaxinloop) {
$i++;
}
- // Show total line
- include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php';
+// Show total line
+include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php';
- // If no record found
+// If no record found
if ($num == 0) {
$colspan = 1;
foreach ($arrayfields as $key => $val) {
@@ -2787,16 +2787,16 @@ if ($num == 0) {
print '
| '.$langs->trans("NoRecordFound").' |
';
}
- $db->free($resql);
+$db->free($resql);
- $parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql);
- $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
- print $hookmanager->resPrint;
+$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql);
+$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
+print $hookmanager->resPrint;
- print ''."\n";
- print ''."\n";
+print ''."\n";
+print ''."\n";
- print ''."\n";
+print ''."\n";
if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
$hidegeneratedfilelistifempty = 1;
@@ -2815,6 +2815,6 @@ if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords
print $formfile->showdocuments('massfilesarea_orders', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty);
}
- // End of page
- llxFooter();
- $db->close();
+// End of page
+llxFooter();
+$db->close();
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index 36a84e840bb..5eaa20bc1fa 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -9051,7 +9051,8 @@ abstract class CommonObject
{
global $conf;
- $file = ''; $originalfile = '';
+ $file = '';
+ $originalfile = '';
$newmodulepart = $modulepart;
if ($modulepart == 'unknown' && !empty($this->module)) {
$newmodulepart = $this->module;
@@ -9124,6 +9125,10 @@ abstract class CommonObject
$pdir = '/'.get_exdir($this->id, 2, 0, 0, $this, $modulepart).$this->id."/photos/";
}
}
+ if ($modulepart == 'category') {
+ $dir = $sdir.'/'.get_exdir($this->id, 2, 0, 0, $this, $modulepart).$this->id."/photos/";
+ $pdir = '/'.get_exdir($this->id, 2, 0, 0, $this, $modulepart).$this->id."/photos/";
+ }
// Defined relative dir to DOL_DATA_ROOT
$relativedir = '';
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index f9e551644f6..95cf0b9dbff 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -2414,6 +2414,26 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi
$morehtmlleft .= '!['.dol_escape_htmltag($langs->trans(]()
transnoentitiesnoconv("Documents"))).'" alt="No photo"'.($width ? ' style="width: '.$width.'px"' : '').' src="'.DOL_URL_ROOT.$nophoto.'">
';
}
}
+ } elseif ($object->element == 'category') {
+ /** @var Categorie $object */
+ $width = 80;
+ $cssclass = 'photowithmargin photoref';
+ $showimage = $object->isAnyPhotoAvailable($conf->categorie->multidir_output[$entity]);
+ $maxvisiblephotos = getDolGlobalInt('CATEGORY_MAX_VISIBLE_PHOTO', 5);
+ if ($conf->browser->layout == 'phone') {
+ $maxvisiblephotos = 1;
+ }
+ if ($showimage) {
+ $morehtmlleft .= ''.$object->show_photos('category', $conf->categorie->multidir_output[$entity], 'small', $maxvisiblephotos, 0, 0, 0, 0, $width, 0, '').'
';
+ } else {
+ if (getDolGlobalString('CATEGORY_NODISPLAYIFNOPHOTO')) {
+ $nophoto = '';
+ $morehtmlleft .= '';
+ } else { // Show no photo link
+ $nophoto = '/public/theme/common/nophoto.png';
+ $morehtmlleft .= '!['.dol_escape_htmltag($langs->trans(]()
transnoentitiesnoconv("Documents"))).'" alt="No photo"'.($width ? ' style="width: '.$width.'px"' : '').' src="'.DOL_URL_ROOT.$nophoto.'">
';
+ }
+ }
} elseif ($object->element == 'bom') {
/** @var Bom $object */
$width = 80;
@@ -2437,6 +2457,7 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi
} elseif ($object->element == 'ticket') {
$width = 80;
$cssclass = 'photoref';
+ /** @var Ticket $object */
$showimage = $object->is_photo_available($conf->ticket->multidir_output[$entity].'/'.$object->ref);
$maxvisiblephotos = getDolGlobalInt('TICKET_MAX_VISIBLE_PHOTO', 2);
if ($conf->browser->layout == 'phone') {
diff --git a/htdocs/core/tpl/list_print_total.tpl.php b/htdocs/core/tpl/list_print_total.tpl.php
index 970eb93c84d..e8fb9978be6 100644
--- a/htdocs/core/tpl/list_print_total.tpl.php
+++ b/htdocs/core/tpl/list_print_total.tpl.php
@@ -15,7 +15,7 @@ if (isset($totalarray['pos'])) {
while ($i < $totalarray['nbfield']) {
$i++;
if (!empty($totalarray['pos'][$i])) {
- printTotalValCell($totalarray['type'][$i], $totalarray['val'][$totalarray['pos'][$i]]);
+ printTotalValCell($totalarray['type'][$i] ?? '', $totalarray['val'][$totalarray['pos'][$i]]);
} else {
if ($i == 1) {
if (is_null($limit) || $num < $limit) {
diff --git a/htdocs/install/mysql/migration/19.0.0-20.0.0.sql b/htdocs/install/mysql/migration/19.0.0-20.0.0.sql
index b00780abc51..de87c76bff3 100644
--- a/htdocs/install/mysql/migration/19.0.0-20.0.0.sql
+++ b/htdocs/install/mysql/migration/19.0.0-20.0.0.sql
@@ -225,7 +225,8 @@ ALTER TABLE llx_ticket ADD COLUMN last_main_doc varchar(255);
ALTER TABLE llx_ticket ADD COLUMN extraparams varchar(255);
ALTER TABLE llx_ticket ADD COLUMN origin_replyto varchar(128);
-
+ALTER TABLE llx_expensereport MODIFY COLUMN model_pdf varchar(255) DEFAULT NULL;
+ALTER TABLE llx_fichinter_rec MODIFY COLUMN modelpdf varchar(255) DEFAULT NULL;
ALTER TABLE llx_societe ADD COLUMN geolat double(24,8) DEFAULT NULL;
ALTER TABLE llx_societe ADD COLUMN geolong double(24,8) DEFAULT NULL;
ALTER TABLE llx_societe ADD COLUMN geopoint point DEFAULT NULL;
diff --git a/htdocs/install/mysql/tables/llx_expensereport.sql b/htdocs/install/mysql/tables/llx_expensereport.sql
index e5c44ec0f36..c7a9b32dd5a 100644
--- a/htdocs/install/mysql/tables/llx_expensereport.sql
+++ b/htdocs/install/mysql/tables/llx_expensereport.sql
@@ -52,9 +52,9 @@ CREATE TABLE llx_expensereport (
detail_cancel varchar(255) DEFAULT NULL,
integration_compta integer DEFAULT NULL, -- not used
fk_bank_account integer DEFAULT NULL,
- model_pdf varchar(50) DEFAULT NULL,
+ model_pdf varchar(255) DEFAULT NULL,
last_main_doc varchar(255), -- relative filepath+filename of last main generated document
-
+
fk_multicurrency integer,
multicurrency_code varchar(3),
multicurrency_tx double(24,8) DEFAULT 1,
@@ -65,4 +65,3 @@ CREATE TABLE llx_expensereport (
import_key varchar(14),
extraparams varchar(255) -- for other parameters with json format
) ENGINE=innodb;
-
diff --git a/htdocs/install/mysql/tables/llx_fichinter_rec.sql b/htdocs/install/mysql/tables/llx_fichinter_rec.sql
index 4a97bdc2e41..4f52e9f4600 100644
--- a/htdocs/install/mysql/tables/llx_fichinter_rec.sql
+++ b/htdocs/install/mysql/tables/llx_fichinter_rec.sql
@@ -4,7 +4,7 @@
-- Copyright (C) 2009 Regis Houssin
-- Copyright (C) 2010 Juanjo Menent
-- Copyright (C) 2018 Charlene Benke
---
+--
-- 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
-- the Free Software Foundation; either version 3 of the License, or
@@ -27,18 +27,18 @@ create table llx_fichinter_rec
entity integer DEFAULT 1 NOT NULL, -- multi company id
fk_soc integer DEFAULT NULL,
datec datetime, -- date de creation
-
+
fk_contrat integer DEFAULT 0, -- contrat auquel est rattache la fiche
fk_user_author integer, -- createur
fk_projet integer, -- projet auquel est associe la facture
duree real, -- duree totale de l'intervention
description text,
- modelpdf varchar(50),
+ modelpdf varchar(255),
note_private text,
note_public text,
frequency integer, -- frequency (for example: 3 for every 3 month)
- unit_frequency varchar(2) DEFAULT 'm', -- 'm' for month (date_when must be a day <= 28), 'y' for year, ...
+ unit_frequency varchar(2) DEFAULT 'm', -- 'm' for month (date_when must be a day <= 28), 'y' for year, ...
date_when datetime DEFAULT NULL, -- date for next gen (when an invoice is generated, this field must be updated with next date)
date_last_gen datetime DEFAULT NULL, -- date for last gen (date with last successfull generation of invoice)
nb_gen_done integer DEFAULT NULL, -- nb of generation done (when an invoice is generated, this field must incremented)
diff --git a/htdocs/public/bookcal/index.php b/htdocs/public/bookcal/index.php
index d6f3042cb88..c5fc4ea5dca 100644
--- a/htdocs/public/bookcal/index.php
+++ b/htdocs/public/bookcal/index.php
@@ -47,6 +47,11 @@ require_once DOL_DOCUMENT_ROOT.'/bookcal/class/availabilities.class.php';
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
+// Security check
+if (!isModEnabled('bookcal')) {
+ httponly_accessforbidden('Module Bookcal isn\'t enabled');
+}
+
$langs->loadLangs(array("main", "other", "dict", "agenda", "errors", "companies"));
$action = GETPOST('action', 'aZ09');
@@ -103,11 +108,13 @@ if ($next_day < 6) {
$lastdaytoshow = dol_mktime(0, 0, 0, $next_month, $next_day, $next_year, 'tzuserrel');
$datechosen = GETPOST('datechosen', 'alpha');
-$datetimechosen = GETPOST('datetimechosen', 'int');
+$datetimechosen = GETPOSTINT('datetimechosen');
$isdatechosen = false;
$timebooking = GETPOST("timebooking");
-$datetimebooking = GETPOST("datetimebooking", 'int');
-$durationbooking = GETPOST("durationbooking", 'int');
+$datetimebooking = GETPOSTINT("datetimebooking");
+$durationbooking = GETPOSTINT("durationbooking");
+$errmsg = '';
+
/**
* Show header for booking
*
@@ -127,6 +134,8 @@ function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $
print '';
+ $urllogo = '';
+
// Define urllogo
if (getDolGlobalInt('BOOKCAL_SHOW_COMPANY_LOGO') || getDolGlobalString('BOOPKCAL_PUBLIC_INTERFACE_TOPIC')) {
// Print logo
@@ -410,13 +419,16 @@ if ($action == 'afteradd') {
$arrayofavailabledays = array();
$arrayofavailabilities = $availability->fetchAll('', '', 0, 0, array('status' => '1', 'fk_bookcal_calendar' => $id));
-
- foreach ($arrayofavailabilities as $key => $value) {
- $startarray = dol_getdate($value->start);
- $endarray = dol_getdate($value->end);
- for ($i = $startarray['mday']; $i <= $endarray['mday']; $i++) {
- if ($todayarray['mon'] >= $startarray['mon'] && $todayarray['mon'] <= $endarray['mon']) {
- $arrayofavailabledays[dol_mktime(0, 0, 0, $todayarray['mon'], $i, $todayarray['year'])] = dol_mktime(0, 0, 0, $todayarray['mon'], $i, $todayarray['year']);
+ if ($arrayofavailabilities < 0) {
+ setEventMessages($availability->error, $availability->errors, 'errors');
+ } else {
+ foreach ($arrayofavailabilities as $key => $value) {
+ $startarray = dol_getdate($value->start);
+ $endarray = dol_getdate($value->end);
+ for ($i = $startarray['mday']; $i <= $endarray['mday']; $i++) {
+ if ($todayarray['mon'] >= $startarray['mon'] && $todayarray['mon'] <= $endarray['mon']) {
+ $arrayofavailabledays[dol_mktime(0, 0, 0, $todayarray['mon'], $i, $todayarray['year'])] = dol_mktime(0, 0, 0, $todayarray['mon'], $i, $todayarray['year']);
+ }
}
}
}
diff --git a/htdocs/societe/checkvat/checkVatPopup.php b/htdocs/societe/checkvat/checkVatPopup.php
index ba9d77715eb..229cf5ce9bf 100644
--- a/htdocs/societe/checkvat/checkVatPopup.php
+++ b/htdocs/societe/checkvat/checkVatPopup.php
@@ -63,8 +63,10 @@ if (!$vatNumber) {
print '
';
// Set the parameters to send to the WebService
- $parameters = array("countryCode" => $countryCode,
- "vatNumber" => $vatNumber);
+ $parameters = array(
+ "countryCode" => $countryCode,
+ "vatNumber" => $vatNumber,
+ );
// Set the WebService URL
dol_syslog("Create nusoap_client for URL=".$WS_DOL_URL." WSDL=".$WS_DOL_URL_WSDL);
@@ -87,30 +89,23 @@ if (!$vatNumber) {
dol_syslog("Call method ".$WS_METHOD);
$result = $soapclient->call($WS_METHOD, $parameters);
- //var_dump($parameters);
- //var_dump($soapclient);
- //print "x".is_array($result)."i";
- //var_dump($result);
- //print $soapclient->request.'
';
- //print $soapclient->response.'
';
-
$messagetoshow = '';
print ''.$langs->trans("Response").':
';
-
+ $faultstring = $result['faultstring'] ?? '';
// Service indisponible
- if (!is_array($result) || preg_match('/SERVICE_UNAVAILABLE/i', $result['faultstring'])) {
+ if (!is_array($result) || preg_match('/SERVICE_UNAVAILABLE/i', $faultstring)) {
print ''.$langs->trans("ErrorServiceUnavailableTryLater").'
';
$messagetoshow = $soapclient->response;
- } elseif (preg_match('/TIMEOUT/i', $result['faultstring'])) {
+ } elseif (preg_match('/TIMEOUT/i', $faultstring)) {
print ''.$langs->trans("ErrorServiceUnavailableTryLater").'
';
$messagetoshow = $soapclient->response;
- } elseif (preg_match('/SERVER_BUSY/i', $result['faultstring'])) {
+ } elseif (preg_match('/SERVER_BUSY/i', $faultstring)) {
print ''.$langs->trans("ErrorServiceUnavailableTryLater").'
';
$messagetoshow = $soapclient->response;
- } elseif ($result['faultstring']) {
+ } elseif ($faultstring) {
print ''.$langs->trans("Error").'
';
- $messagetoshow = $result['faultstring'];
- } elseif (preg_match('/INVALID_INPUT/i', $result['faultstring'])
+ $messagetoshow = $faultstring;
+ } elseif (preg_match('/INVALID_INPUT/i', $faultstring)
|| ($result['requestDate'] && !$result['valid'])) {
// Syntax ko
if ($result['requestDate']) {
@@ -126,7 +121,7 @@ if (!$vatNumber) {
}
print $langs->trans("VATIntraSyntaxIsValid").': '.$langs->trans("Yes").'
';
print $langs->trans("ValueIsValid").': ';
- if (preg_match('/MS_UNAVAILABLE/i', $result['faultstring'])) {
+ if (preg_match('/MS_UNAVAILABLE/i', $faultstring)) {
print ''.$langs->trans("ErrorVATCheckMS_UNAVAILABLE", $countryCode).'
';
} else {
if (!empty($result['valid']) && ($result['valid'] == 1 || $result['valid'] == 'true')) {
diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php
index 7ca1a9574ff..d6262ad4298 100644
--- a/htdocs/user/class/user.class.php
+++ b/htdocs/user/class/user.class.php
@@ -12,7 +12,7 @@
* Copyright (C) 2015 Marcos García
* Copyright (C) 2018 charlene Benke
* Copyright (C) 2018-2021 Nicolas ZABOURI
- * Copyright (C) 2019-2023 Frédéric France
+ * Copyright (C) 2019-2024 Frédéric France
* Copyright (C) 2019 Abbes Bahfir
* Copyright (C) 2024 MDW
*
@@ -2961,6 +2961,7 @@ class User extends CommonObject
'objecttype' => $this->element,
'infologin' => $infologin,
'option' => $option,
+ 'hidethirdpartylogo' => $hidethirdpartylogo,
];
$classfortooltip = 'classfortooltip';
$dataparams = '';