From d41c6a93d31d93ba6a48edef13743e94eb847dec Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Mon, 29 Aug 2022 16:23:33 +0200 Subject: [PATCH 1/4] Fix : php 8.1 warn,ings --- htdocs/core/class/html.formticket.class.php | 8 ++++---- htdocs/core/lib/payments.lib.php | 2 +- htdocs/core/lib/ticket.lib.php | 2 +- htdocs/main.inc.php | 2 +- htdocs/public/members/new.php | 8 ++++---- htdocs/public/project/new.php | 2 +- htdocs/public/recruitment/index.php | 3 +++ htdocs/public/ticket/create_ticket.php | 2 ++ htdocs/public/ticket/index.php | 3 ++- 9 files changed, 19 insertions(+), 13 deletions(-) diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 83071830ae7..2e4035e2131 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -416,7 +416,7 @@ class FormTicket $toolbarname = 'dolibarr_notes'; if ($this->ispublic) { $toolbarname = 'dolibarr_details'; - print '
'.($conf->global->TICKET_PUBLIC_TEXT_HELP_MESSAGE ? $conf->global->TICKET_PUBLIC_TEXT_HELP_MESSAGE : $langs->trans('TicketPublicPleaseBeAccuratelyDescribe')).'
'; + print '
'.(getDolGlobalString("TICKET_PUBLIC_TEXT_HELP_MESSAGE", $langs->trans('TicketPublicPleaseBeAccuratelyDescribe'))).'
'; } include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $uselocalbrowser = true; @@ -752,7 +752,7 @@ class FormTicket } } print ''; - if ($user->admin && !$noadmininfo) { + if (isset($user->admin) && $user->admin && !$noadmininfo) { print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); } @@ -864,7 +864,7 @@ class FormTicket } } print ''; - if ($user->admin && !$noadmininfo) { + if (isset($user->admin) && $user->admin && !$noadmininfo) { print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); } @@ -1199,7 +1199,7 @@ class FormTicket } } print ''; - if ($user->admin && !$noadmininfo) { + if (isset($user->admin) && $user->admin && !$noadmininfo) { print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); } diff --git a/htdocs/core/lib/payments.lib.php b/htdocs/core/lib/payments.lib.php index 5c9d9342b01..1ebca6ba65a 100644 --- a/htdocs/core/lib/payments.lib.php +++ b/htdocs/core/lib/payments.lib.php @@ -482,7 +482,7 @@ function htmlPrintOnlinePaymentFooter($fromcompany, $langs, $addformmessage = 0, } // Add other message if VAT exists - if ($object->total_vat != 0 || $object->total_tva != 0) { + if (!empty($object->total_vat) || $object->total_tva != 0) { $parammessageform = 'ONLINE_PAYMENT_MESSAGE_FORMIFVAT_'.$suffix; if (!empty($conf->global->$parammessageform)) { print $langs->transnoentities($conf->global->$parammessageform); diff --git a/htdocs/core/lib/ticket.lib.php b/htdocs/core/lib/ticket.lib.php index 8ef509057c4..28a443f2034 100644 --- a/htdocs/core/lib/ticket.lib.php +++ b/htdocs/core/lib/ticket.lib.php @@ -206,7 +206,7 @@ function generate_random_id($car = 16) function llxHeaderTicket($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '') { global $user, $conf, $langs, $mysoc; - + $urllogo = ""; top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss, 0, 1); // Show html headers print ''; diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 6a0fda06cb0..a45130010a3 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1600,7 +1600,7 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", ((int) $conf->global->MAIN_IHM_PARAMS_REV) + 1, 'chaine', 0, '', $conf->entity); } - $themeparam = '?lang='.$langs->defaultlang.'&theme='.$conf->theme.(GETPOST('optioncss', 'aZ09') ? '&optioncss='.GETPOST('optioncss', 'aZ09', 1) : '').'&userid='.$user->id.'&entity='.$conf->entity; + $themeparam = '?lang='.$langs->defaultlang.'&theme='.$conf->theme.(GETPOST('optioncss', 'aZ09') ? '&optioncss='.GETPOST('optioncss', 'aZ09', 1) : '').'&'.(!empty($user->id) ? ('userid='.$user->id.'&') : '').';entity='.$conf->entity; $themeparam .= ($ext ? '&'.$ext : '').'&revision='.getDolGlobalInt("MAIN_IHM_PARAMS_REV"); if (GETPOSTISSET('dol_hide_topmenu')) { diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index c409703862c..83941861474 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -475,7 +475,7 @@ print '
'; if (!empty($conf->global->MEMBER_NEWFORM_TEXT)) { print $langs->trans($conf->global->MEMBER_NEWFORM_TEXT)."
\n"; } else { - print $langs->trans("NewSubscriptionDesc", $conf->global->MAIN_INFO_SOCIETE_MAIL)."
\n"; + print $langs->trans("NewSubscriptionDesc", getDolGlobalString("MAIN_INFO_SOCIETE_MAIL"))."
\n"; } print '
'; @@ -568,7 +568,7 @@ if (!empty($conf->global->MEMBER_SKIP_TABLE) || !empty($conf->global->MEMBER_NEW // Firstname print ''.$langs->trans("Firstname").' *'."\n"; // EMail - print ''.$langs->trans("Email").($conf->global->ADHERENT_MAIL_REQUIRED ? ' *' : '').''; + print ''.$langs->trans("Email").(getDolGlobalString("ADHERENT_MAIL_REQUIRED") ? ' *' : '').''; //print img_picto('', 'email', 'class="pictofixedwidth"'); print ''."\n"; // Login @@ -623,7 +623,7 @@ if (!empty($conf->global->MEMBER_SKIP_TABLE) || !empty($conf->global->MEMBER_NEW } // Birthday print ''.$langs->trans("DateOfBirth").''; - print $form->selectDate($birthday, 'birth', 0, 0, 1, "newmember", 1, 0); + print $form->selectDate(!empty($birthday) ? $birthday : "", 'birth', 0, 0, 1, "newmember", 1, 0); print ''."\n"; // Photo print ''.$langs->trans("URLPhoto").''."\n"; @@ -786,7 +786,7 @@ if (!empty($conf->global->MEMBER_SKIP_TABLE) || !empty($conf->global->MEMBER_NEW print max(1, intval($objp->duration)).' '.$units[$unit]; print ''; print ''; - $displayedamount = max(intval($objp->amount), intval($conf->global->MEMBER_MIN_AMOUNT)); + $displayedamount = max(intval($objp->amount), intval(getDolGlobalInt("MEMBER_MIN_AMOUNT"))); $caneditamount = !empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT) || $objp->caneditamount; if ($objp->subscription) { if ($displayedamount > 0 || !$caneditamount) { diff --git a/htdocs/public/project/new.php b/htdocs/public/project/new.php index 5b0c35c10f3..d984b3346d8 100644 --- a/htdocs/public/project/new.php +++ b/htdocs/public/project/new.php @@ -423,7 +423,7 @@ print '
'; if (!empty($conf->global->PROJECT_NEWFORM_TEXT)) { print $langs->trans($conf->global->PROJECT_NEWFORM_TEXT)."
\n"; } else { - print $langs->trans("FormForNewLeadDesc", $conf->global->MAIN_INFO_SOCIETE_MAIL)."
\n"; + print $langs->trans("FormForNewLeadDesc", getDolGlobalString("MAIN_INFO_SOCIETE_MAIL"))."
\n"; } print '
'; diff --git a/htdocs/public/recruitment/index.php b/htdocs/public/recruitment/index.php index 632a3f57da2..32585c94bb4 100644 --- a/htdocs/public/recruitment/index.php +++ b/htdocs/public/recruitment/index.php @@ -47,7 +47,10 @@ $langs->loadLangs(array("companies", "other", "recruitment")); // Get parameters $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'alpha'); +$SECUREKEY = GETPOST("securekey"); +$entity = GETPOST('entity', 'int') ? GETPOST('entity', 'int') : $conf->entity; $backtopage = ''; +$suffix = ""; // Load variable for pagination $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; diff --git a/htdocs/public/ticket/create_ticket.php b/htdocs/public/ticket/create_ticket.php index 33b3b8bdccd..4defe2be01f 100644 --- a/htdocs/public/ticket/create_ticket.php +++ b/htdocs/public/ticket/create_ticket.php @@ -71,6 +71,8 @@ $langs->loadLangs(array('companies', 'other', 'mails', 'ticket')); // Get parameters $id = GETPOST('id', 'int'); $msg_id = GETPOST('msg_id', 'int'); +$socid = GETPOST('socid', 'int'); +$suffix = ""; $action = GETPOST('action', 'aZ09'); diff --git a/htdocs/public/ticket/index.php b/htdocs/public/ticket/index.php index 4ea314c8149..bff53d91edb 100644 --- a/htdocs/public/ticket/index.php +++ b/htdocs/public/ticket/index.php @@ -59,6 +59,7 @@ $langs->loadLangs(array('companies', 'other', 'ticket', 'errors')); // Get parameters $track_id = GETPOST('track_id', 'alpha'); $action = GETPOST('action', 'aZ09'); +$suffix = ""; if (empty($conf->ticket->enabled)) { accessforbidden('', 0, 0, 1); @@ -82,7 +83,7 @@ $arrayofcss = array('/ticket/css/styles.css.php'); llxHeaderTicket($langs->trans("Tickets"), "", 0, 0, $arrayofjs, $arrayofcss); print '
'; -print '

'.($conf->global->TICKET_PUBLIC_TEXT_HOME ? $conf->global->TICKET_PUBLIC_TEXT_HOME : $langs->trans("TicketPublicDesc")).'

'; +print '

'.(getDolGlobalString("TICKET_PUBLIC_TEXT_HOME", $langs->trans("TicketPublicDesc"))).'

'; print '
'; print '

'.dol_escape_htmltag($langs->trans("CreateTicket")).'
'; print '

'.dol_escape_htmltag($langs->trans("ViewMyTicketList")).'
'; From ab184bbfda838d09d1edd0b9e927074ff5b3c5bf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 30 Aug 2022 01:00:43 +0200 Subject: [PATCH 2/4] Update main.inc.php --- htdocs/main.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index a45130010a3..56a85f5d03d 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1600,7 +1600,7 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", ((int) $conf->global->MAIN_IHM_PARAMS_REV) + 1, 'chaine', 0, '', $conf->entity); } - $themeparam = '?lang='.$langs->defaultlang.'&theme='.$conf->theme.(GETPOST('optioncss', 'aZ09') ? '&optioncss='.GETPOST('optioncss', 'aZ09', 1) : '').'&'.(!empty($user->id) ? ('userid='.$user->id.'&') : '').';entity='.$conf->entity; + $themeparam = '?lang='.$langs->defaultlang.'&theme='.$conf->theme.(GETPOST('optioncss', 'aZ09') ? '&optioncss='.GETPOST('optioncss', 'aZ09', 1) : '').(empty($user->id) ? '' : ('&userid='.$user->id) : '').'&entity='.$conf->entity; $themeparam .= ($ext ? '&'.$ext : '').'&revision='.getDolGlobalInt("MAIN_IHM_PARAMS_REV"); if (GETPOSTISSET('dol_hide_topmenu')) { From e589cc7d9b35a1f1135fdc2c2fe0bc01b641eda7 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Thu, 1 Sep 2022 16:13:21 +0200 Subject: [PATCH 3/4] fix ci error --- htdocs/main.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index ef64b2e5a74..46790b9cbc5 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1605,7 +1605,7 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", ((int) $conf->global->MAIN_IHM_PARAMS_REV) + 1, 'chaine', 0, '', $conf->entity); } - $themeparam = '?lang='.$langs->defaultlang.'&theme='.$conf->theme.(GETPOST('optioncss', 'aZ09') ? '&optioncss='.GETPOST('optioncss', 'aZ09', 1) : '').(empty($user->id) ? '' : ('&userid='.$user->id) : '').'&entity='.$conf->entity; + $themeparam = '?lang='.$langs->defaultlang.'&theme='.$conf->theme.(GETPOST('optioncss', 'aZ09') ? '&optioncss='.GETPOST('optioncss', 'aZ09', 1) : '').(empty($user->id) ? '' : ('&userid='.$user->id)).'&entity='.$conf->entity; $themeparam .= ($ext ? '&'.$ext : '').'&revision='.getDolGlobalInt("MAIN_IHM_PARAMS_REV"); if (GETPOSTISSET('dol_hide_topmenu')) { From 5a924d23e3e1d14212e28a61b80fce0bf7592458 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Thu, 1 Sep 2022 16:30:48 +0200 Subject: [PATCH 4/4] fix CI errors --- htdocs/public/ticket/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/public/ticket/index.php b/htdocs/public/ticket/index.php index 2f4bd720219..6332f063541 100644 --- a/htdocs/public/ticket/index.php +++ b/htdocs/public/ticket/index.php @@ -81,7 +81,7 @@ llxHeaderTicket($langs->trans("Tickets"), "", 0, 0, $arrayofjs, $arrayofcss); print '
'; -print '

'.(getDolGlobalString("TICKET_PUBLIC_TEXT_HOME", ''.$langs->trans("TicketPublicDesc")).'

')).'

'; +print '

'.(getDolGlobalString("TICKET_PUBLIC_TEXT_HOME", ''.$langs->trans("TicketPublicDesc")).'

').'

'; print '
'; print '
';