From a6d8feefdc47670392b88adaa1ad640b7b819ca4 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Tue, 21 Jan 2025 13:00:18 +0100 Subject: [PATCH 01/46] Fix warning --- htdocs/core/lib/files.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 08dd5e94151..a2795eda594 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -3162,7 +3162,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, $original_file = $conf->fckeditor->dir_output.'/'.$original_file; } elseif ($modulepart == 'user' && !empty($conf->user->dir_output)) { // Wrapping for users - $canreaduser = (!empty($fuser->admin) || $fuser->rights->user->user->{$lire}); + $canreaduser = (!empty($fuser->admin) || $fuser->hasRight('user', 'user', 'lire')); if ($fuser->id == (int) $refname) { $canreaduser = 1; } // A user can always read its own card From 7a8d4e2507ac3108cded12df449f0e2f23883a62 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Tue, 21 Jan 2025 14:08:52 +0100 Subject: [PATCH 02/46] Debug v21 --- htdocs/comm/action/class/actioncomm.class.php | 4 +- .../comm/action/class/cactioncomm.class.php | 2 + htdocs/core/lib/company.lib.php | 64 +++++++++++++------ 3 files changed, 49 insertions(+), 21 deletions(-) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index a96ec4e0e82..6eb05106686 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -1883,7 +1883,7 @@ class ActionComm extends CommonObject $color = 'style="color: #'.$this->type_color.' !important;"'; } if ($this->type_picto) { - $imgpicto = img_picto($titlealt, $this->type_picto, '', 0, 0, 0, '', ($morecss ? ' '.$morecss : '')); + $imgpicto = img_picto($titlealt.'rr', $this->type_picto, '', 0, 0, 0, '', ($morecss ? ' '.$morecss : '')); } else { if ($this->type_code == 'AC_RDV') { $imgpicto = img_picto($titlealt, 'meeting', $color, 0, 0, 0, '', ($morecss ? ' '.$morecss : '')); @@ -1891,7 +1891,7 @@ class ActionComm extends CommonObject $imgpicto = img_picto($titlealt, 'object_phoning', $color, 0, 0, 0, '', ($morecss ? ' '.$morecss : '')); } elseif ($this->type_code == 'AC_FAX') { $imgpicto = img_picto($titlealt, 'object_phoning_fax', $color, 0, 0, 0, '', ($morecss ? ' '.$morecss : '')); - } elseif ($this->type_code == 'AC_EMAIL' || $this->type_code == 'AC_EMAIL_IN' || (!empty($this->code) && preg_match('/_SENTBYMAIL/', $this->code))) { + } elseif ($this->type_code == 'AC_EMAIL' || $this->type_code == 'AC_EMAIL_IN' || $this->type_code == 'AC_EMAILING' || (!empty($this->code) && preg_match('/_SENTBYMAIL/', $this->code))) { $imgpicto = img_picto($titlealt, 'object_email', $color, 0, 0, 0, '', ($morecss ? ' '.$morecss : '')); } elseif ($this->type_code == 'AC_INT') { $imgpicto = img_picto($titlealt, 'object_intervention', $color, 0, 0, 0, '', ($morecss ? ' '.$morecss : '')); diff --git a/htdocs/comm/action/class/cactioncomm.class.php b/htdocs/comm/action/class/cactioncomm.class.php index 9c28468c1c7..db3fcfe1bbc 100644 --- a/htdocs/comm/action/class/cactioncomm.class.php +++ b/htdocs/comm/action/class/cactioncomm.class.php @@ -163,11 +163,13 @@ class CActionComm global $langs, $conf, $user; $langs->load("commercial"); + /* $actionstatic = new ActionComm($this->db); $rep_id = array(); $rep_code = array(); $rep_all = array(); + */ $sql = "SELECT id, code, libelle as label, module, type, color, picto"; $sql .= " FROM ".MAIN_DB_PREFIX."c_actioncomm"; diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index dcaa104ee2c..6f6d25eecb8 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -1809,6 +1809,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = null, $nopr $sql .= " a.percent as percent, 'action' as type,"; $sql .= " a.fk_element, a.elementtype,"; $sql .= " a.fk_contact,"; + $sql .= " a.code,"; $sql .= " c.code as acode, c.libelle as alabel, c.picto as apicto,"; $sql .= " u.rowid as user_id, u.login as user_login, u.photo as user_photo, u.firstname as user_firstname, u.lastname as user_lastname"; if (is_object($filterobj) && in_array(get_class($filterobj), array('Societe', 'Client', 'Fournisseur'))) { @@ -2006,6 +2007,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = null, $nopr $sql .= $hookmanager->resPrint; } + // Now add events of emailing module if (is_array($actioncode)) { foreach ($actioncode as $code) { $sql2 = addMailingEventTypeSQL($code, $objcon, $filterobj); @@ -2087,6 +2089,9 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = null, $nopr 'firstname' => empty($obj->firstname) ? '' : $obj->firstname, 'fk_element' => (int) $obj->fk_element, 'elementtype' => $obj->elementtype, + + 'code' => $obj->code, + // Type of event 'acode' => $obj->acode, 'alabel' => $obj->alabel, @@ -2102,6 +2107,10 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = null, $nopr 'dateend' => $db->jdate($obj->dp2), 'note' => $obj->label, 'percent' => (int) $obj->percent, + + 'code' => $obj->code, + + // Type of event 'acode' => $obj->acode, 'userid' => (int) $obj->user_id, @@ -2238,11 +2247,14 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = null, $nopr require_once DOL_DOCUMENT_ROOT.'/comm/action/class/cactioncomm.class.php'; $caction = new CActionComm($db); - $arraylist = $caction->liste_array(1, 'code', '', (!getDolGlobalString('AGENDA_USE_EVENT_TYPE') ? 1 : 0), '', 1); + $arraylist = $caction->liste_array(1, 'code', '', (getDolGlobalString('AGENDA_USE_EVENT_TYPE') ? 0 : 1), '', 1); foreach ($histo as $key => $value) { $actionstatic->fetch($histo[$key]['id']); // TODO Do we need this, we already have a lot of data of line into $histo + if (empty($actionstatic->code)) { + $actionstatic->code = $histo[$key]['acode']; + } $actionstatic->type_picto = $histo[$key]['apicto'] ?? ''; $actionstatic->type_code = $histo[$key]['acode']; @@ -2314,25 +2326,38 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = null, $nopr } $out .= ''; + // type_code // column "acode" in the sql = code in type of actioncomm, example: AC_OTH_AUTO, AC_EMAILING + // code // columne code in the sql (not yet added), can be AC_CONTACT_SENTBYMAIL, ... + // Type - $labeltype = $actionstatic->type_code; - if (!getDolGlobalString('AGENDA_USE_EVENT_TYPE') && empty($arraylist[$labeltype])) { - $labeltype = 'AC_OTH'; + $labelOfTypeToShow = $actionstatic->type_code; + //$typelabel = $actionstatic->type_label; + $code = $actionstatic->code; + if (!getDolGlobalString('AGENDA_USE_EVENT_TYPE') && empty($arraylist[$labelOfTypeToShow])) { + $labelOfTypeToShow = 'AC_OTH'; } if (!empty($actionstatic->code) && preg_match('/^TICKET_MSG/', $actionstatic->code)) { - $labeltype = $langs->trans("Message"); + $labelOfTypeToShow = $langs->trans("Message"); } else { - if (!empty($arraylist[$labeltype])) { - $labeltype = $arraylist[$labeltype]; + if (!empty($arraylist[$labelOfTypeToShow])) { + $labelOfTypeToShow = $arraylist[$labelOfTypeToShow]; + } elseif ($actionstatic->type_code == 'AC_EMAILING') { + $labelOfTypeToShow = $langs->trans("Emailing"); } - if ($actionstatic->type_code == 'AC_OTH_AUTO' && ($actionstatic->type_code != $actionstatic->code) && $labeltype && !empty($arraylist[$actionstatic->code])) { - $labeltype .= ' - '.$arraylist[$actionstatic->code]; // Use code in priority on type_code + if ($actionstatic->type_code == 'AC_OTH_AUTO' && ($actionstatic->type_code != $actionstatic->code) && $labelOfTypeToShow && !empty($arraylist[$actionstatic->code])) { + $labelOfTypeToShow .= ' - '.$arraylist[$actionstatic->code]; // Show also detailed code } } - $out .= ''; + + $labelOfTypeToShowLong = $labelOfTypeToShow; + if ($actionstatic->type_code == 'AC_OTH_AUTO') { + $labelOfTypeToShowLong .= ' (auto)'; + } + + $out .= ''; $out .= $actionstatic->getTypePicto(); //if (empty($conf->dol_optimize_smallscreen)) { - $out .= $labeltype; + $out .= $labelOfTypeToShow; //} $out .= ''; @@ -2341,18 +2366,19 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = null, $nopr if (isset($histo[$key]['type']) && $histo[$key]['type'] == 'action') { $transcode = $langs->trans("Action".$histo[$key]['acode']); //$libelle = ($transcode != "Action".$histo[$key]['acode'] ? $transcode : $histo[$key]['alabel']); - $libelle = $histo[$key]['note']; + $label = $histo[$key]['note']; $actionstatic->id = $histo[$key]['id']; - $out .= ' title="'.dol_escape_htmltag($libelle).'">'; - $out .= dol_trunc($libelle, 120); + $out .= ' title="'.dol_escape_htmltag($label).'">'; + $out .= dol_trunc($label, 120); } if (isset($histo[$key]['type']) && $histo[$key]['type'] == 'mailing') { $transcode = $langs->trans("Action".$histo[$key]['acode']); - $libelle = ($transcode != "Action".$histo[$key]['acode'] ? $transcode : 'Send mass mailing'); + $label = ($transcode != "Action".$histo[$key]['acode'] ? $transcode : 'Send mass mailing'); + $label .= ' - '.$histo[$key]['note']; $out .= ''; - $out .= img_object($langs->trans("ShowEMailing"), "email").' '; - $out .= dol_trunc($libelle, 120); + $out .= ' title="'.dol_escape_htmltag($label).'">'; + //$out .= img_object($langs->trans("EMailing").'
'.$histo[$key]['note'], "email").' '; + $out .= dol_trunc($label, 120); $out .= '
'; } $out .= ''; @@ -2606,7 +2632,7 @@ function addMailingEventTypeSQL($actioncode, $objcon, $filterobj) if (isModEnabled('mailing') && !empty($objcon->email) && (empty($actioncode) || $actioncode == 'AC_OTH_AUTO' || $actioncode == 'AC_EMAILING')) { $sql2 = "SELECT m.rowid as id, m.titre as label, mc.date_envoi as dp, mc.date_envoi as dp2, '100' as percent, 'mailing' as type"; $sql2 .= ", null as fk_element, '' as elementtype, null as contact_id"; - $sql2 .= ", 'AC_EMAILING' as acode, '' as alabel, '' as apicto"; + $sql2 .= ", 'AC_EMAILING' as code, 'AC_EMAILING' as acode, '' as alabel, '' as apicto"; $sql2 .= ", u.rowid as user_id, u.login as user_login, u.photo as user_photo, u.firstname as user_firstname, u.lastname as user_lastname"; // User that valid action if (is_object($filterobj) && get_class($filterobj) == 'Societe') { $sql2 .= ", '' as lastname, '' as firstname"; From 8f7881a8714d992e5cc404655ecf4ad609edb82d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 21 Jan 2025 17:51:01 +0100 Subject: [PATCH 03/46] Debug v21 --- htdocs/langs/en_US/stripe.lang | 1 + htdocs/public/stripe/ipn.php | 79 +++++++++++++++++++--------------- htdocs/stripe/admin/stripe.php | 24 ++++++++--- 3 files changed, 64 insertions(+), 40 deletions(-) diff --git a/htdocs/langs/en_US/stripe.lang b/htdocs/langs/en_US/stripe.lang index 2e244858d28..3d1e3925309 100644 --- a/htdocs/langs/en_US/stripe.lang +++ b/htdocs/langs/en_US/stripe.lang @@ -12,6 +12,7 @@ YourEMail=Email to receive payment confirmation STRIPE_PAYONLINE_SENDEMAIL=Email notification after a payment attempt (success or fail) Creditor=Creditor PaymentCode=Payment code +StripeAutoRecordPayout=Enable the auto recording of payout (when Stripe do a payout and call the webhook payout.create/payout.paid) StripeDoPayment=Pay with Stripe YouWillBeRedirectedOnStripe=You will be redirected on secured Stripe page to input you credit card information Continue=Next diff --git a/htdocs/public/stripe/ipn.php b/htdocs/public/stripe/ipn.php index 0a2c982258d..e04053634d7 100644 --- a/htdocs/public/stripe/ipn.php +++ b/htdocs/public/stripe/ipn.php @@ -178,14 +178,14 @@ top_httphead(); dol_syslog("***** Stripe IPN was called with event->type=".$event->type." service=".$service); -if ($event->type == 'payout.created') { - // When a payout is create by Stripe to transfer money to your account +if ($event->type == 'payout.created' && getDolGlobalString('STRIPE_AUTO_RECORD_PAYOUT')) { + // When a payout is created by Stripe to transfer money to your account $error = 0; $result = dolibarr_set_const($db, $service."_NEXTPAYOUT", date('Y-m-d H:i:s', $event->data->object->arrival_date), 'chaine', 0, '', $conf->entity); if ($result > 0) { - $subject = $societeName.' - [NOTIFICATION] Stripe payout scheduled'; + $subject = '['.$societeName.'] Notification - Stripe payout scheduled'; if (!empty($user->email)) { $sendto = dolGetFirstLastname($user->firstname, $user->lastname)." <".$user->email.">"; } else { @@ -221,7 +221,7 @@ if ($event->type == 'payout.created') { http_response_code(500); return -1; } -} elseif ($event->type == 'payout.paid') { +} elseif ($event->type == 'payout.paid' && getDolGlobalString('STRIPE_AUTO_RECORD_PAYOUT')) { // When a payout to transfer money to your account is completely done $error = 0; $result = dolibarr_set_const($db, $service."_NEXTPAYOUT", 0, 'chaine', 0, '', $conf->entity); @@ -249,6 +249,8 @@ if ($event->type == 'payout.created') { $typefrom = 'PRE'; $typeto = 'VIR'; + $db->begin(); + if (!$error) { $bank_line_id_from = $accountfrom->addline($dateo, $typefrom, $label, -1 * (float) price2num($amount), '', '', $user); } @@ -274,38 +276,47 @@ if ($event->type == 'payout.created') { if (!($result > 0)) { $error++; } + + if (!$error) { + $db->commit(); + } else { + $db->rollback(); + } + + // Send email + if (!$error) { + $subject = '['.$societeName.'] - NotificationOTIFICATION] Stripe payout done'; + if (!empty($user->email)) { + $sendto = dolGetFirstLastname($user->firstname, $user->lastname)." <".$user->email.">"; + } else { + $sendto = getDolGlobalString('MAIN_INFO_SOCIETE_MAIL') . '" <' . getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'>'; + } + $replyto = $sendto; + $sendtocc = ''; + if (getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL')) { + $sendtocc = getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL') . '" <' . getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL').'>'; + } + + $message = "A bank transfer of ".price2num($event->data->object->amount / 100)." ".$event->data->object->currency." has been done to your account the ".dol_print_date($event->data->object->arrival_date, 'dayhour'); + + $mailfile = new CMailFile( + $subject, + $sendto, + $replyto, + $message, + array(), + array(), + array(), + $sendtocc, + '', + 0, + -1 + ); + + $ret = $mailfile->sendfile(); + } } - $subject = $societeName.' - [NOTIFICATION] Stripe payout done'; - if (!empty($user->email)) { - $sendto = dolGetFirstLastname($user->firstname, $user->lastname)." <".$user->email.">"; - } else { - $sendto = getDolGlobalString('MAIN_INFO_SOCIETE_MAIL') . '" <' . getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'>'; - } - $replyto = $sendto; - $sendtocc = ''; - if (getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL')) { - $sendtocc = getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL') . '" <' . getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL').'>'; - } - - $message = "A bank transfer of ".price2num($event->data->object->amount / 100)." ".$event->data->object->currency." has been done to your account the ".dol_print_date($event->data->object->arrival_date, 'dayhour'); - - $mailfile = new CMailFile( - $subject, - $sendto, - $replyto, - $message, - array(), - array(), - array(), - $sendtocc, - '', - 0, - -1 - ); - - $ret = $mailfile->sendfile(); - return 1; } else { $error++; diff --git a/htdocs/stripe/admin/stripe.php b/htdocs/stripe/admin/stripe.php index a017742d722..eb08aac811d 100644 --- a/htdocs/stripe/admin/stripe.php +++ b/htdocs/stripe/admin/stripe.php @@ -379,18 +379,30 @@ print ''.$langs->trans("Example").': '.$mysoc->name.''; print ''; -print ''; -print $langs->trans("StripeUserAccountForActions").''; -print img_picto('', 'user', 'class="pictofixedwidth"').$form->select_dolusers(getDolGlobalString('STRIPE_USER_ACCOUNT_FOR_ACTIONS'), 'STRIPE_USER_ACCOUNT_FOR_ACTIONS', 0); -print ''; - print ''; print $langs->trans("BankAccount").''; print img_picto('', 'bank_account', 'class="pictofixedwidth"'); $form->select_comptes(getDolGlobalString('STRIPE_BANK_ACCOUNT_FOR_PAYMENTS'), 'STRIPE_BANK_ACCOUNT_FOR_PAYMENTS', 0, '', 1); print ''; -if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) { // What is this for ? + +// Param to record automatically payouts (received from IPN payout.payed and payout.created) +print ''; +print $langs->trans("StripeAutoRecordPayout").''; +if ($conf->use_javascript_ajax) { + print ajax_constantonoff('STRIPE_AUTO_RECORD_PAYOUT', array(), null, 0, 0, 1); +} else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("STRIPE_AUTO_RECORD_PAYOUT", $arrval, getDolGlobalInt('STRIPE_AUTO_RECORD_PAYOUT')); +} +print ''; + +if (getDolGlobalInt('STRIPE_AUTO_RECORD_PAYOUT')) { + print ''; + print $langs->trans("StripeUserAccountForActions").''; + print img_picto('', 'user', 'class="pictofixedwidth"').$form->select_dolusers(getDolGlobalString('STRIPE_USER_ACCOUNT_FOR_ACTIONS'), 'STRIPE_USER_ACCOUNT_FOR_ACTIONS', 0); + print ''; + print ''; print $langs->trans("BankAccountForBankTransfer").''; print img_picto('', 'bank_account', 'class="pictofixedwidth"'); From da3d1f32f13352ae8f87a9229aa2101c9b35abc8 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Tue, 21 Jan 2025 22:55:43 +0100 Subject: [PATCH 04/46] FIX #32656 Loan - Note - Missing formclass project --- htdocs/loan/note.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/loan/note.php b/htdocs/loan/note.php index 44f18d6821b..9bc1da5c0a9 100644 --- a/htdocs/loan/note.php +++ b/htdocs/loan/note.php @@ -4,7 +4,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2013 Florian Henry * Copyright (C) 2015-2024 Frédéric France - * Copyright (C) 2016-2024 Alexandre Spangaro + * Copyright (C) 2016-2025 Alexandre Spangaro * Copyright (C) 2017 Ferran Marcet * Copyright (C) 2024 MDW * @@ -33,6 +33,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/loan/class/loan.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/loan.lib.php'; if (isModEnabled('project')) { + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } /** @@ -83,7 +84,9 @@ if (empty($reshook)) { $morehtmlright = ''; $form = new Form($db); -$formproject = new FormProjets($db); +if (isModEnabled('project')) { + $formproject = new FormProjets($db); +} $title = $langs->trans("Loan").' - '.$langs->trans("Notes"); $help_url = 'EN:Module_Loan|FR:Module_Emprunt'; From 68e8452bd3d62557672d6855f7eda0f3a403865c Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Tue, 21 Jan 2025 23:08:39 +0100 Subject: [PATCH 05/46] Fix language --- htdocs/compta/accounting-files.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/compta/accounting-files.php b/htdocs/compta/accounting-files.php index 2005e7d0fb2..5ccd1ffa2d8 100644 --- a/htdocs/compta/accounting-files.php +++ b/htdocs/compta/accounting-files.php @@ -1,12 +1,12 @@ - * Copyright (C) 2004-2019 Laurent Destailleur - * Copyright (C) 2017 Pierre-Henry Favre - * Copyright (C) 2020 Maxime DEMAREST - * Copyright (C) 2021 Gauthier VERDOL - * Copyright (C) 2022-2024 Alexandre Spangaro +/* Copyright (C) 2001-2006 Rodolphe Quiedeville + * Copyright (C) 2004-2019 Laurent Destailleur + * Copyright (C) 2017 Pierre-Henry Favre + * Copyright (C) 2020 Maxime DEMAREST + * Copyright (C) 2021 Gauthier VERDOL + * Copyright (C) 2022-2025 Alexandre Spangaro * Copyright (C) 2024 MDW - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 Frédéric France * * 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 @@ -622,7 +622,7 @@ $charge_sociales = new ChargeSociales($db); $various_payment = new PaymentVarious($db); $payment_loan = new PaymentLoan($db); -$title = $langs->trans("ComptaFiles").' - '.$langs->trans("List"); +$title = $langs->trans("AccountantFiles").' - '.$langs->trans("List"); $help_url = ''; llxHeader('', $title, $help_url); From 87dbb1f445b57ff04fab99c9ec4df555f54fa4de Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Wed, 22 Jan 2025 02:38:41 +0100 Subject: [PATCH 06/46] Translate "Emailing" line 2345 --- htdocs/core/lib/company.lib.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 6f6d25eecb8..ba8b55c69d7 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -2342,6 +2342,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = null, $nopr if (!empty($arraylist[$labelOfTypeToShow])) { $labelOfTypeToShow = $arraylist[$labelOfTypeToShow]; } elseif ($actionstatic->type_code == 'AC_EMAILING') { + $langs->load("mails"); $labelOfTypeToShow = $langs->trans("Emailing"); } if ($actionstatic->type_code == 'AC_OTH_AUTO' && ($actionstatic->type_code != $actionstatic->code) && $labelOfTypeToShow && !empty($arraylist[$actionstatic->code])) { From a8fe17688f41200f24d2bed1d8a9d561386b6e07 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Wed, 22 Jan 2025 02:46:47 +0100 Subject: [PATCH 07/46] Fix pre-commit --- htdocs/core/lib/company.lib.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index ba8b55c69d7..09ff9d4edd1 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -1756,6 +1756,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = null, $nopr global $user, $conf, $hookmanager; global $form; global $param, $massactionbutton; + global $langs; $start_year = GETPOSTINT('dateevent_startyear'); $start_month = GETPOSTINT('dateevent_startmonth'); From 7378dc0f7a7a268beb2e37a404a846456af563dc Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Wed, 22 Jan 2025 02:50:58 +0100 Subject: [PATCH 08/46] Fix pre-commit --- dev/translation/ignore_translation_keys.lst | 1 + 1 file changed, 1 insertion(+) diff --git a/dev/translation/ignore_translation_keys.lst b/dev/translation/ignore_translation_keys.lst index 9a34c97bc3f..5679343b154 100644 --- a/dev/translation/ignore_translation_keys.lst +++ b/dev/translation/ignore_translation_keys.lst @@ -53,6 +53,7 @@ MoveField MyContacts NbOfActiveNotifications NbOfTargetedContacts +Payed PreviewMailing Processing PropalStatusClosedShort From 0f0ea09f72e95842637cc3300709eac0be7a76d3 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Wed, 22 Jan 2025 16:28:05 +0100 Subject: [PATCH 09/46] Debug v21 - fix canonical url management --- htdocs/core/lib/website2.lib.php | 121 ++++++++++++++++++++----------- 1 file changed, 79 insertions(+), 42 deletions(-) diff --git a/htdocs/core/lib/website2.lib.php b/htdocs/core/lib/website2.lib.php index c2260b72b9e..fa39397bfcd 100644 --- a/htdocs/core/lib/website2.lib.php +++ b/htdocs/core/lib/website2.lib.php @@ -174,6 +174,7 @@ function dolSavePageContent($filetpl, Website $object, WebsitePage $objectpage, $tplcontent = ''; if (!isset($originalcontentonly)) { + // If we want to generate a page with some code to manage PHP content $tplcontent .= "'."\n"; $tplcontent .= ''."\n"; $tplcontent .= ''."\n"; - $tplcontent .= ''."\n"; + $tplcontent .= ''."\n"; $tplcontent .= ''."\n"; $tplcontent .= ''."\n"; $tplcontent .= ''."\n"; - $tplcontent .= ''."\n"; + $tplcontent .= ''."\n"; // Add favicon if (in_array($objectpage->type_container, array('page', 'blogpost'))) { $tplcontent .= ''."\n"; } - // Add canonical reference + // Add the link of the canonical reference + // Note: $object is website, $objectpage is website page if ($object->virtualhost) { - $tplcontent .= ''."\n"; - } - // Add translation reference (main language) - if ($object->isMultiLang()) { - // Add page "translation of" - $translationof = $objectpage->fk_page; - if ($translationof) { - $tmppage = new WebsitePage($db); - $tmppage->fetch($translationof); - if ($tmppage->id > 0) { - $tmpshortlangcode = ''; - if ($tmppage->lang) { - $tmpshortlangcode = preg_replace('/[_-].*$/', '', $tmppage->lang); // en_US or en-US -> en - } - if (empty($tmpshortlangcode)) { - $tmpshortlangcode = preg_replace('/[_-].*$/', '', $object->lang); // en_US or en-US -> en - } - if ($tmpshortlangcode != $shortlangcode) { - $tplcontent .= ''."\n"; - } + $canonicalurladdid = ''; + if ($objectpage->lang) { // A language is forced on the page, it means we may have other langueg files with hard links + $canonicalurl = (($objectpage->id == $object->fk_default_home) ? '/' : (($shortlangcode != substr($object->lang, 0, 2) ? '/'.$shortlangcode : '').'/'.$objectpage->pageurl.'.php')); + } else { // No language forced, it means the canonical is the one with + $canonicalurl = '/'.$objectpage->pageurl.'.php'; + + if ($object->lang && $object->isMultiLang()) { + $tmpshortlangcode = preg_replace('/[_-].*$/', '', $object->lang); // en_US or en-US -> en + $canonicalurl .= '?l=shortlang ? $weblangs->shortlang : "'.$tmpshortlangcode.'"; ?>'; + // Add parameter ID required to be unique/canonical + $canonicalurladdid = ''; + } else { + // Add parameter ID required to be unique/canonical + $canonicalurladdid = ''; } } - // Add "has translation pages" - $sql = "SELECT rowid as id, lang, pageurl from ".MAIN_DB_PREFIX.'website_page where fk_page IN ('.$db->sanitize($objectpage->id.($translationof ? ", ".$translationof : '')).")"; - $resql = $db->query($sql); - if ($resql) { - $num_rows = $db->num_rows($resql); - if ($num_rows > 0) { - while ($obj = $db->fetch_object($resql)) { + $tplcontent .= ''."\n"; + } + + // Add the link of alternate translation reference + if ($object->isMultiLang()) { // If website has other languages to support + if ($objectpage->lang) { // If the page has been set to a given language + // Add page "translation of" + $translationof = $objectpage->fk_page; + if ($translationof) { + $tmppage = new WebsitePage($db); + $tmppage->fetch($translationof); + if ($tmppage->id > 0) { $tmpshortlangcode = ''; - if ($obj->lang) { - $tmpshortlangcode = preg_replace('/[_-].*$/', '', $obj->lang); // en_US or en-US -> en + if ($tmppage->lang) { + $tmpshortlangcode = preg_replace('/[_-].*$/', '', $tmppage->lang); // en_US or en-US -> en + } + if (empty($tmpshortlangcode)) { + $tmpshortlangcode = preg_replace('/[_-].*$/', '', $object->lang); // en_US or en-US -> en } if ($tmpshortlangcode != $shortlangcode) { - $tplcontent .= ''."\n"; + $tplcontent .= ''."\n"; } } } + + // Add "has translation pages" + $sql = "SELECT rowid as id, lang, pageurl from ".MAIN_DB_PREFIX.'website_page where fk_page IN ('.$db->sanitize($objectpage->id.($translationof ? ", ".$translationof : '')).")"; + $resql = $db->query($sql); + if ($resql) { + $num_rows = $db->num_rows($resql); + if ($num_rows > 0) { + while ($obj = $db->fetch_object($resql)) { + $tmpshortlangcode = ''; + if ($obj->lang) { + $tmpshortlangcode = preg_replace('/[_-].*$/', '', $obj->lang); // en_US or en-US -> en + } + if ($tmpshortlangcode != $shortlangcode) { + $tplcontent .= ''."\n"; + } + } + } + } else { + dol_print_error($db); + } + + // Add myself + $tplcontent .= 'fk_default_home == $objectpage->id) ? '/' : (($shortlangcode != substr($object->lang, 0, 2)) ? '/'.$shortlangcode : '')).'/'.$objectpage->pageurl.'.php") { ?>'."\n"; + $tplcontent .= ''."\n"; + + $tplcontent .= ''."\n"; } else { - dol_print_error($db); } - - // Add myself - $tplcontent .= 'fk_default_home == $objectpage->id) ? '/' : (($shortlangcode != substr($object->lang, 0, 2)) ? '/'.$shortlangcode : '')).'/'.$objectpage->pageurl.'.php") { ?>'."\n"; - $tplcontent .= ''."\n"; - - $tplcontent .= ''."\n"; } // Add manifest.json. Do we have to add it only on home page ? $tplcontent .= 'use_manifest) { print \'\'."\n"; } ?>'."\n"; @@ -278,7 +301,9 @@ function dolSavePageContent($filetpl, Website $object, WebsitePage $objectpage, $tplcontent .= ''."\n"; $tplcontent .= 'content, '$__PAGE__TITLE__') !== false) { $tplcontent .= '$tmp = preg_replace("/.*?<\/title>/s", "<title>" . dol_escape_htmltag($__PAGE__TITLE__) . "", $tmp);'."\n"; $tplcontent .= '$tmp = preg_replace("//s", "", $tmp);'; @@ -289,7 +314,19 @@ function dolSavePageContent($filetpl, Website $object, WebsitePage $objectpage, if (strpos($objectpage->content, '$__PAGE__DESC__') !== false) { $tplcontent .= '$tmp = preg_replace("//s", "", $tmp);'; } - $tplcontent .= 'dolWebsiteOutput($tmp, "html", '.$objectpage->id.'); dolWebsiteIncrementCounter('.$object->id.', "'.$objectpage->type_container.'", '.$objectpage->id.');'."\n"; + // New method for custom SEO + if (strpos($objectpage->content, 'define("__SEO_PAGE_TITLE__")') !== false) { + $tplcontent .= '$tmp = preg_replace("/.*?<\/title>/s", "<title>" . dol_escape_htmltag(constant("__SEO_PAGE_TITLE__")) . "", $tmp);'."\n"; + $tplcontent .= '$tmp = preg_replace("//s", "", $tmp);'; + } + if (strpos($objectpage->content, 'define("__SEO_PAGE_KEYWORDS__")') !== false) { + $tplcontent .= '$tmp = preg_replace("//s", "", $tmp);'; + } + if (strpos($objectpage->content, 'define("__SEO_PAGE_DESC__")') !== false) { + $tplcontent .= '$tmp = preg_replace("//s", "", $tmp);'; + } + + $tplcontent .= 'dolWebsiteOutput($tmp, "html", '.((int) $objectpage->id).'); dolWebsiteIncrementCounter('.((int) $object->id).', "'.$objectpage->type_container.'", '.((int) $objectpage->id).');'."\n"; $tplcontent .= "// END PHP ?>\n"; } else { $tplcontent .= " Date: Wed, 22 Jan 2025 16:31:41 +0100 Subject: [PATCH 10/46] Clean meta tags --- htdocs/core/lib/website2.lib.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/lib/website2.lib.php b/htdocs/core/lib/website2.lib.php index fa39397bfcd..f539d9f68c4 100644 --- a/htdocs/core/lib/website2.lib.php +++ b/htdocs/core/lib/website2.lib.php @@ -191,14 +191,14 @@ function dolSavePageContent($filetpl, Website $object, WebsitePage $objectpage, // If a language was forced on page, we use it, else we use the lang of visitor else the lang of web site $tplcontent .= 'lang ? ' lang="'.substr($objectpage->lang, 0, 2).'"' : 'shortlang ? \' lang="\'.$weblangs->shortlang.\'"\' : \'\' ?>').'>'."\n"; $tplcontent .= ''."\n"; - $tplcontent .= ''.dol_string_nohtmltag($objectpage->title, 0, 'UTF-8').''."\n"; + $tplcontent .= ''.dol_string_nohtmltag($objectpage->title, 1, 'UTF-8').''."\n"; $tplcontent .= ''."\n"; $tplcontent .= ''."\n"; $tplcontent .= ''."\n"; $tplcontent .= ''."\n"; - $tplcontent .= ''."\n"; - $tplcontent .= ''."\n"; - $tplcontent .= ''."\n"; + $tplcontent .= ''."\n"; + $tplcontent .= ''."\n"; + $tplcontent .= ''."\n"; $tplcontent .= ''."\n"; $tplcontent .= ''."\n"; From f381a7322cd593a448971ac4c9cebc3e44405356 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Wed, 22 Jan 2025 18:48:03 +0100 Subject: [PATCH 11/46] Fix use of constants --- htdocs/core/lib/website2.lib.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/website2.lib.php b/htdocs/core/lib/website2.lib.php index f539d9f68c4..8aab8ba4962 100644 --- a/htdocs/core/lib/website2.lib.php +++ b/htdocs/core/lib/website2.lib.php @@ -315,14 +315,14 @@ function dolSavePageContent($filetpl, Website $object, WebsitePage $objectpage, $tplcontent .= '$tmp = preg_replace("//s", "", $tmp);'; } // New method for custom SEO - if (strpos($objectpage->content, 'define("__SEO_PAGE_TITLE__")') !== false) { + if (strpos($objectpage->content, 'define("__SEO_PAGE_TITLE__"') !== false) { $tplcontent .= '$tmp = preg_replace("/.*?<\/title>/s", "<title>" . dol_escape_htmltag(constant("__SEO_PAGE_TITLE__")) . "", $tmp);'."\n"; $tplcontent .= '$tmp = preg_replace("//s", "", $tmp);'; } - if (strpos($objectpage->content, 'define("__SEO_PAGE_KEYWORDS__")') !== false) { + if (strpos($objectpage->content, 'define("__SEO_PAGE_KEYWORDS__"') !== false) { $tplcontent .= '$tmp = preg_replace("//s", "", $tmp);'; } - if (strpos($objectpage->content, 'define("__SEO_PAGE_DESC__")') !== false) { + if (strpos($objectpage->content, 'define("__SEO_PAGE_DESC__"') !== false) { $tplcontent .= '$tmp = preg_replace("//s", "", $tmp);'; } From 4673f319621bb8693a0896b736a3a4486c768817 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Wed, 22 Jan 2025 21:13:26 +0100 Subject: [PATCH 12/46] Debug v21 - fix alternate lang --- htdocs/core/lib/website2.lib.php | 107 +++++++++++++++++-------------- 1 file changed, 59 insertions(+), 48 deletions(-) diff --git a/htdocs/core/lib/website2.lib.php b/htdocs/core/lib/website2.lib.php index 8aab8ba4962..6e156b5070a 100644 --- a/htdocs/core/lib/website2.lib.php +++ b/htdocs/core/lib/website2.lib.php @@ -207,79 +207,90 @@ function dolSavePageContent($filetpl, Website $object, WebsitePage $objectpage, $tplcontent .= ''."\n"; } + $listofaltlang = $object->otherlang; + // Add the link of the canonical reference // Note: $object is website, $objectpage is website page if ($object->virtualhost) { - $canonicalurladdid = ''; - if ($objectpage->lang) { // A language is forced on the page, it means we may have other langueg files with hard links + $canonicalurladdidlang = ''; + if ($objectpage->lang) { // A language is forced on the page, it means we may have other language files with hard links into properties of page $canonicalurl = (($objectpage->id == $object->fk_default_home) ? '/' : (($shortlangcode != substr($object->lang, 0, 2) ? '/'.$shortlangcode : '').'/'.$objectpage->pageurl.'.php')); } else { // No language forced, it means the canonical is the one with $canonicalurl = '/'.$objectpage->pageurl.'.php'; - if ($object->lang && $object->isMultiLang()) { + if ($object->lang && $listofaltlang) { $tmpshortlangcode = preg_replace('/[_-].*$/', '', $object->lang); // en_US or en-US -> en - $canonicalurl .= '?l=shortlang ? $weblangs->shortlang : "'.$tmpshortlangcode.'"; ?>'; // Add parameter ID required to be unique/canonical - $canonicalurladdid = ''; + $canonicalurladdidlang = ''; + $canonicalurladdidlang .= 'l=shortlang ? $weblangs->shortlang : "'.$tmpshortlangcode.'"; ?>'; } else { // Add parameter ID required to be unique/canonical - $canonicalurladdid = ''; + $canonicalurladdidlang = ''; } } - $tplcontent .= ''."\n"; - } + $tplcontent .= ''."\n"; - // Add the link of alternate translation reference - if ($object->isMultiLang()) { // If website has other languages to support - if ($objectpage->lang) { // If the page has been set to a given language - // Add page "translation of" - $translationof = $objectpage->fk_page; - if ($translationof) { - $tmppage = new WebsitePage($db); - $tmppage->fetch($translationof); - if ($tmppage->id > 0) { - $tmpshortlangcode = ''; - if ($tmppage->lang) { - $tmpshortlangcode = preg_replace('/[_-].*$/', '', $tmppage->lang); // en_US or en-US -> en - } - if (empty($tmpshortlangcode)) { - $tmpshortlangcode = preg_replace('/[_-].*$/', '', $object->lang); // en_US or en-US -> en - } - if ($tmpshortlangcode != $shortlangcode) { - $tplcontent .= ''."\n"; - } - } - } - - // Add "has translation pages" - $sql = "SELECT rowid as id, lang, pageurl from ".MAIN_DB_PREFIX.'website_page where fk_page IN ('.$db->sanitize($objectpage->id.($translationof ? ", ".$translationof : '')).")"; - $resql = $db->query($sql); - if ($resql) { - $num_rows = $db->num_rows($resql); - if ($num_rows > 0) { - while ($obj = $db->fetch_object($resql)) { + // Add the link of alternate translation reference + if ($listofaltlang) { // If website has other languages to support + if ($objectpage->lang) { // A language is forced on the page, it means we may have other language files with hard links into properties of page + // Add page "translation of" + $translationof = $objectpage->fk_page; + if ($translationof) { + $tmppage = new WebsitePage($db); + $tmppage->fetch($translationof); + if ($tmppage->id > 0) { $tmpshortlangcode = ''; - if ($obj->lang) { - $tmpshortlangcode = preg_replace('/[_-].*$/', '', $obj->lang); // en_US or en-US -> en + if ($tmppage->lang) { + $tmpshortlangcode = preg_replace('/[_-].*$/', '', $tmppage->lang); // en_US or en-US -> en + } + if (empty($tmpshortlangcode)) { + $tmpshortlangcode = preg_replace('/[_-].*$/', '', $object->lang); // en_US or en-US -> en } if ($tmpshortlangcode != $shortlangcode) { - $tplcontent .= ''."\n"; + $tplcontent .= ''."\n"; } } } + + // Add "has translation pages" + $sql = "SELECT rowid as id, lang, pageurl from ".MAIN_DB_PREFIX.'website_page where fk_page IN ('.$db->sanitize($objectpage->id.($translationof ? ", ".$translationof : '')).")"; + $resql = $db->query($sql); + if ($resql) { + $num_rows = $db->num_rows($resql); + if ($num_rows > 0) { + while ($obj = $db->fetch_object($resql)) { + $tmpshortlangcode = ''; + if ($obj->lang) { + $tmpshortlangcode = preg_replace('/[_-].*$/', '', $obj->lang); // en_US or en-US -> en + } + if ($tmpshortlangcode != $shortlangcode) { + $tplcontent .= ''."\n"; + } + } + } + } else { + dol_print_error($db); + } + + // Add myself + $tplcontent .= 'fk_default_home == $objectpage->id) ? '/' : (($shortlangcode != substr($object->lang, 0, 2)) ? '/'.$shortlangcode : '')).'/'.$objectpage->pageurl.'.php") { ?>'."\n"; + $tplcontent .= ''."\n"; + + $tplcontent .= ''."\n"; } else { - dol_print_error($db); + $canonicalurl = '/'.$objectpage->pageurl.'.php'; + $arrayofaltlang = explode(',', $listofaltlang); + foreach ($arrayofaltlang as $altlang) { + // Add parameter ID required to be unique/canonical + $canonicalurladdidlang = ''; + $canonicalurladdidlang .= 'l='.$altlang; + $tplcontent .= ''."\n"; + } } - - // Add myself - $tplcontent .= 'fk_default_home == $objectpage->id) ? '/' : (($shortlangcode != substr($object->lang, 0, 2)) ? '/'.$shortlangcode : '')).'/'.$objectpage->pageurl.'.php") { ?>'."\n"; - $tplcontent .= ''."\n"; - - $tplcontent .= ''."\n"; - } else { } } + // Add manifest.json. Do we have to add it only on home page ? $tplcontent .= 'use_manifest) { print \'\'."\n"; } ?>'."\n"; $tplcontent .= ''."\n"; From 6dc14c6560d0124e3dbc641cacf938f55ed0bb62 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Wed, 22 Jan 2025 21:21:29 +0100 Subject: [PATCH 13/46] Debug v21 - fix alternate lang --- htdocs/core/lib/website2.lib.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/htdocs/core/lib/website2.lib.php b/htdocs/core/lib/website2.lib.php index 6e156b5070a..07caa48f9a0 100644 --- a/htdocs/core/lib/website2.lib.php +++ b/htdocs/core/lib/website2.lib.php @@ -281,11 +281,16 @@ function dolSavePageContent($filetpl, Website $object, WebsitePage $objectpage, } else { $canonicalurl = '/'.$objectpage->pageurl.'.php'; $arrayofaltlang = explode(',', $listofaltlang); + + $tmpshortlangcode = preg_replace('/[_-].*$/', '', $object->lang); // en_US or en-US -> en + foreach ($arrayofaltlang as $altlang) { - // Add parameter ID required to be unique/canonical - $canonicalurladdidlang = ''; - $canonicalurladdidlang .= 'l='.$altlang; - $tplcontent .= ''."\n"; + if ($altlang != $tmpshortlangcode) { + // Add parameter ID required to be unique/canonical + $canonicalurladdidlang = ''; + $canonicalurladdidlang .= 'l='.$altlang; + $tplcontent .= ''."\n"; + } } } } From bae28f5b7e10ba07a186cddc509418ceae62288a Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Wed, 22 Jan 2025 21:21:29 +0100 Subject: [PATCH 14/46] Debug v21 - fix alternate lang --- htdocs/core/lib/website2.lib.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/core/lib/website2.lib.php b/htdocs/core/lib/website2.lib.php index 6e156b5070a..31d90141eaa 100644 --- a/htdocs/core/lib/website2.lib.php +++ b/htdocs/core/lib/website2.lib.php @@ -281,12 +281,16 @@ function dolSavePageContent($filetpl, Website $object, WebsitePage $objectpage, } else { $canonicalurl = '/'.$objectpage->pageurl.'.php'; $arrayofaltlang = explode(',', $listofaltlang); + foreach ($arrayofaltlang as $altlang) { // Add parameter ID required to be unique/canonical $canonicalurladdidlang = ''; $canonicalurladdidlang .= 'l='.$altlang; $tplcontent .= ''."\n"; } + + $tmpshortlangcode = preg_replace('/[_-].*$/', '', $object->lang); // en_US or en-US -> en + $tplcontent .= ''."\n"; } } } From e874b980d8a08231564cee8809706b6c6de38b38 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Wed, 22 Jan 2025 21:31:06 +0100 Subject: [PATCH 15/46] Debug v21 - Fix canonical --- htdocs/core/lib/website2.lib.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/core/lib/website2.lib.php b/htdocs/core/lib/website2.lib.php index 31d90141eaa..d675473a98a 100644 --- a/htdocs/core/lib/website2.lib.php +++ b/htdocs/core/lib/website2.lib.php @@ -290,6 +290,8 @@ function dolSavePageContent($filetpl, Website $object, WebsitePage $objectpage, } $tmpshortlangcode = preg_replace('/[_-].*$/', '', $object->lang); // en_US or en-US -> en + $canonicalurladdidlang = ''; + $canonicalurladdidlang .= 'l='.$tmpshortlangcode; $tplcontent .= ''."\n"; } } From 46ec36846202a8a0ee09973a53b03defc5cc674a Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Wed, 22 Jan 2025 21:50:38 +0100 Subject: [PATCH 16/46] Fix canonical name --- htdocs/core/lib/website2.lib.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/lib/website2.lib.php b/htdocs/core/lib/website2.lib.php index d675473a98a..fb161162679 100644 --- a/htdocs/core/lib/website2.lib.php +++ b/htdocs/core/lib/website2.lib.php @@ -221,11 +221,11 @@ function dolSavePageContent($filetpl, Website $object, WebsitePage $objectpage, if ($object->lang && $listofaltlang) { $tmpshortlangcode = preg_replace('/[_-].*$/', '', $object->lang); // en_US or en-US -> en // Add parameter ID required to be unique/canonical - $canonicalurladdidlang = ''; + $canonicalurladdidlang = ''; $canonicalurladdidlang .= 'l=shortlang ? $weblangs->shortlang : "'.$tmpshortlangcode.'"; ?>'; } else { // Add parameter ID required to be unique/canonical - $canonicalurladdidlang = ''; + $canonicalurladdidlang = ''; } } @@ -284,13 +284,13 @@ function dolSavePageContent($filetpl, Website $object, WebsitePage $objectpage, foreach ($arrayofaltlang as $altlang) { // Add parameter ID required to be unique/canonical - $canonicalurladdidlang = ''; + $canonicalurladdidlang = ''; $canonicalurladdidlang .= 'l='.$altlang; $tplcontent .= ''."\n"; } $tmpshortlangcode = preg_replace('/[_-].*$/', '', $object->lang); // en_US or en-US -> en - $canonicalurladdidlang = ''; + $canonicalurladdidlang = ''; $canonicalurladdidlang .= 'l='.$tmpshortlangcode; $tplcontent .= ''."\n"; } From 821565e03142744fe1f9978c21bf1801c16d4c38 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 23 Jan 2025 01:29:29 +0100 Subject: [PATCH 17/46] Debug v21 --- htdocs/comm/mailing/card.php | 31 +++++++++++++---------- htdocs/core/ajax/mailtemplate.php | 11 ++++---- htdocs/core/class/html.formmail.class.php | 6 ++--- htdocs/core/lib/functions.lib.php | 17 ------------- 4 files changed, 26 insertions(+), 39 deletions(-) diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index b36538b2a68..0920ddae516 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -799,7 +799,7 @@ if ($action == 'create') { // aaa // Print mail form print load_fiche_titre($langs->trans("NewMailing"), $availablelink, 'object_email'); - print dol_get_fiche_head(array(), '', '', -4, '', 0, '', ''); + print dol_get_fiche_head(array(), '', '', 0, '', 0, '', ''); print ''; @@ -831,17 +831,21 @@ if ($action == 'create') { // aaa } print '
'; - print '

'; + print '
'; print ''; - print ''; + print ''; + print ''; - print ''; + print ''; + print ''; - print ''; + print ''; + print ''; - print ''; + print ''; + print ''; // Other attributes $parameters = array(); @@ -852,7 +856,8 @@ if ($action == 'create') { // aaa } print '
'.$langs->trans("MailFrom").'
'.$langs->trans("MailFrom").''.img_picto('', 'email', 'class="pictofixedwidth"').'
'.$langs->trans("MailErrorsTo").'
'.$langs->trans("MailErrorsTo").''.img_picto('', 'email', 'class="pictofixedwidth"').'
'.$langs->trans("MailReply").'
'.$langs->trans("MailReply").''.img_picto('', 'email', 'class="pictofixedwidth"').'
'; - print '

'; + + print '
'; print ''; print ''; @@ -889,7 +894,7 @@ if ($action == 'create') { // aaa print '
'; // wysiwyg editor require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('bodyemail', GETPOST('bodyemail', 'restricthtmlallowunvalid'), '', 600, 'dolibarr_mailings', '', true, -1, getDolGlobalInt('FCKEDITOR_ENABLE_MAILING'), 20, '90%'); + $doleditor = new DolEditor('bodyemail', GETPOST('bodyemail', 'restricthtmlallowunvalid'), '', 600, 'dolibarr_mailings', '', true, -1, getDolGlobalInt('FCKEDITOR_ENABLE_MAILING'), 20, '100%'); $doleditor->Create(); print '
'; @@ -1129,7 +1134,7 @@ if ($action == 'create') { // aaa } print $text; if (getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING') != 'default') { - if (getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING') != 'mail') { + if (getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING') && getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING') != 'mail') { print ' ('.getDolGlobalString('MAIN_MAIL_SMTP_SERVER_EMAILING', getDolGlobalString('MAIN_MAIL_SMTP_SERVER')).')'; } } elseif (getDolGlobalString('MAIN_MAIL_SENDMODE') != 'mail' && getDolGlobalString('MAIN_MAIL_SMTP_SERVER')) { @@ -1329,7 +1334,7 @@ if ($action == 'create') { // aaa $readonly = 1; // wysiwyg editor require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('bodyemail', $object->body, '', 600, 'dolibarr_mailings', '', false, -1, getDolGlobalInt('FCKEDITOR_ENABLE_MAILING'), 20, '90%', $readonly); + $doleditor = new DolEditor('bodyemail', $object->body, '', 600, 'dolibarr_mailings', '', false, -1, getDolGlobalInt('FCKEDITOR_ENABLE_MAILING'), 20, '100%', $readonly); $doleditor->Create(); } else { print dol_htmlentitiesbr($object->body); @@ -1548,19 +1553,19 @@ if ($action == 'create') { // aaa if ($action == 'edit') { // wysiwyg editor require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('bodyemail', $object->body, '', 600, 'dolibarr_mailings', '', true, -1, getDolGlobalInt('FCKEDITOR_ENABLE_MAILING'), 20, '90%'); + $doleditor = new DolEditor('bodyemail', $object->body, '', 600, 'dolibarr_mailings', '', true, -1, getDolGlobalInt('FCKEDITOR_ENABLE_MAILING'), 20, '100%'); $doleditor->Create(); } if ($action == 'edittxt') { // wysiwyg editor require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('bodyemail', $object->body, '', 600, 'dolibarr_mailings', '', true, -1, 0, 20, '90%'); + $doleditor = new DolEditor('bodyemail', $object->body, '', 600, 'dolibarr_mailings', '', true, -1, 0, 20, '100%'); $doleditor->Create(); } if ($action == 'edithtml') { // HTML source editor require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('bodyemail', $object->body, '', 600, 'dolibarr_mailings', '', true, -1, 'ace', 20, '90%'); + $doleditor = new DolEditor('bodyemail', $object->body, '', 600, 'dolibarr_mailings', '', true, -1, 'ace', 20, '100%'); $doleditor->Create(0, '', false, 'HTML Source', 'php'); } diff --git a/htdocs/core/ajax/mailtemplate.php b/htdocs/core/ajax/mailtemplate.php index 41054250305..fd6981b8c7f 100644 --- a/htdocs/core/ajax/mailtemplate.php +++ b/htdocs/core/ajax/mailtemplate.php @@ -73,16 +73,17 @@ if (GETPOSTISSET('content')) { foreach ($selectedPosts as $postId) { $post = getNewsDetailsById($postId); + $newsList .= '
-

' . htmlentities($post['title']) . '

-

' . htmlentities($post['description']) . '

- Created By: ' . htmlentities($post['user_fullname']) . ' +

' . htmlentities(empty($post['title']) ? '' : $post['title']) . '

+

' . htmlentities(empty($post['description']) ? '' : $post['description']) . '

+ Created By: ' . htmlentities(empty($post['user_fullname']) ? '' : $post['user_fullname']) . '
- ' . dol_print_date($post['date_creation'], 'daytext', 'tzserver', $langs) . ' + ' . dol_print_date((empty($post['date_creation']) ? dol_now() : $post['date_creation']), 'daytext', 'tzserver', $langs) . '
- ' . ($post['image'] ? 'Image' : 'Gray rectangle') . ' + ' . (!empty($post['image']) ? 'Image' : 'Gray rectangle') . '
'; } diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 3f09d2816f7..21f064ba8ca 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -1693,7 +1693,7 @@ class FormMail extends Form // Use the multiselect array function to create the dropdown $out .= ''; $out .= '"; } diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index aa46e7ccf0b..1c0d5a61aea 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -169,6 +169,7 @@ $ErrorCode = $ErrorShortMsg = $ErrorLongMsg = $ErrorSeverityCode = ''; $object = new stdClass(); // For triggers +/** @var CommonObject $object */ $error = 0; From d81a25ea11db395e4e95fbc9aa9386897cd14d18 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Thu, 23 Jan 2025 19:39:19 +0100 Subject: [PATCH 35/46] Fix url payment ko --- htdocs/public/payment/paymentko.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/public/payment/paymentko.php b/htdocs/public/payment/paymentko.php index 17e42d8f16b..9a23d6201dd 100644 --- a/htdocs/public/payment/paymentko.php +++ b/htdocs/public/payment/paymentko.php @@ -343,7 +343,7 @@ if (!empty($doactionsthenredirect)) { // Redirect to an error page // Paymentko page must be created for the specific website if (!defined('USEDOLIBARRSERVER') && !empty($ws_virtuelhost)) { - $ext_urlok = $ws_virtuelhost . '/paymentok.php?fulltag='.$FULLTAG; + $ext_urlok = $ws_virtuelhost . '/paymentko.php?fulltag='.$FULLTAG; } else { $ext_urlko = DOL_URL_ROOT.'/public/website/index.php?website='.urlencode($ws).'&pageref=paymentko&fulltag='.$FULLTAG; } From 6198d185442165ce26015b783b45839ae6582f89 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Thu, 23 Jan 2025 19:42:50 +0100 Subject: [PATCH 36/46] Fix url payment ko --- htdocs/public/payment/paymentko.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/public/payment/paymentko.php b/htdocs/public/payment/paymentko.php index 9a23d6201dd..5f833ed119d 100644 --- a/htdocs/public/payment/paymentko.php +++ b/htdocs/public/payment/paymentko.php @@ -343,7 +343,7 @@ if (!empty($doactionsthenredirect)) { // Redirect to an error page // Paymentko page must be created for the specific website if (!defined('USEDOLIBARRSERVER') && !empty($ws_virtuelhost)) { - $ext_urlok = $ws_virtuelhost . '/paymentko.php?fulltag='.$FULLTAG; + $ext_urlko = $ws_virtuelhost . '/paymentko.php?fulltag='.$FULLTAG; } else { $ext_urlko = DOL_URL_ROOT.'/public/website/index.php?website='.urlencode($ws).'&pageref=paymentko&fulltag='.$FULLTAG; } From 132b4f95fe405b6e03a5ae205e766952fc0ab8dc Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Thu, 23 Jan 2025 20:21:23 +0100 Subject: [PATCH 37/46] Fix move of files after a merge of products --- htdocs/product/card.php | 23 ++++++++++++++++++++--- htdocs/societe/class/societe.class.php | 20 ++++++++++---------- 2 files changed, 30 insertions(+), 13 deletions(-) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index c84c0dc6d63..4ce8eb72df0 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -361,7 +361,7 @@ if (empty($reshook)) { 'SupplierProposal' => '/supplier_proposal/class/supplier_proposal.class.php', ); - //First, all core objects must update their tables + // First, all core objects must update their tables foreach ($objects as $object_name => $object_file) { require_once DOL_DOCUMENT_ROOT.$object_file; @@ -406,13 +406,30 @@ if (empty($reshook)) { } if (!$error) { - // We finally remove the old product - // TODO merge attached files from old product into new one before delete + // Delete the product if ($productOrigin->delete($user) < 1) { $error++; } } + if ($error) { + // Move files from the dir of the third party to delete into the dir of the third party to keep + if (!empty($conf->product->multidir_output[$productOrigin->entity])) { + $srcdir = $conf->product->multidir_output[$productOrigin->entity]."/".$productOrigin->ref; + $destdir = $conf->product->multidir_output[$object->entity]."/".$object->ref; + + if (dol_is_dir($srcdir)) { + $dirlist = dol_dir_list($srcdir, 'files', 1); + foreach ($dirlist as $filetomove) { + $destfile = $destdir.'/'.$filetomove['relativename']; + //var_dump('Move file '.$filetomove['relativename'].' into '.$destfile); + dol_move($filetomove['fullname'], $destfile, '0', 0, 0, 1); + } + //exit; + } + } + } + if (!$error) { setEventMessages($langs->trans('ProductsMergeSuccess'), null, 'mesgs'); $db->commit(); diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 13dd05eff14..8d664fda47f 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -5711,6 +5711,16 @@ class Societe extends CommonObject // End call triggers } + if (!$error) { + // We finally remove the old thirdparty + if ($soc_origin->delete($soc_origin->id, $user) < 1) { + $this->error = $soc_origin->error; + $this->errors = $soc_origin->errors; + $error++; + } + } + + if (!$error) { // Move files from the dir of the third party to delete into the dir of the third party to keep if (!empty($conf->societe->multidir_output[$this->entity])) { @@ -5729,16 +5739,6 @@ class Societe extends CommonObject } } - - if (!$error) { - // We finally remove the old thirdparty - if ($soc_origin->delete($soc_origin->id, $user) < 1) { - $this->error = $soc_origin->error; - $this->errors = $soc_origin->errors; - $error++; - } - } - if (!$error) { $this->db->commit(); return 0; From 9c7686e5718c855ed82a87fed68a74998b981b0f Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Thu, 23 Jan 2025 21:02:49 +0100 Subject: [PATCH 38/46] Fix clean unvalid entries into ecm file table --- htdocs/install/repair.php | 52 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 51 insertions(+), 1 deletion(-) diff --git a/htdocs/install/repair.php b/htdocs/install/repair.php index d3d8364b810..06d14be0720 100644 --- a/htdocs/install/repair.php +++ b/htdocs/install/repair.php @@ -111,6 +111,7 @@ print 'Option clean_menus is '.(GETPOST('clean_menus', 'alpha') ? GETPOST('clean print 'Option clean_orphelin_dir is '.(GETPOST('clean_orphelin_dir', 'alpha') ? GETPOST('clean_orphelin_dir', 'alpha') : 'undefined').'
'."\n"; print 'Option clean_product_stock_batch is '.(GETPOST('clean_product_stock_batch', 'alpha') ? GETPOST('clean_product_stock_batch', 'alpha') : 'undefined').'
'."\n"; print 'Option clean_perm_table is '.(GETPOST('clean_perm_table', 'alpha') ? GETPOST('clean_perm_table', 'alpha') : 'undefined').'
'."\n"; +print 'Option clean_ecm_files_table is '.(GETPOST('clean_ecm_files_table', 'alpha') ? GETPOST('clean_ecm_files_table', 'alpha') : 'undefined').'
'."\n"; print 'Option repair_link_dispatch_lines_supplier_order_lines, is '.(GETPOST('repair_link_dispatch_lines_supplier_order_lines', 'alpha') ? GETPOST('repair_link_dispatch_lines_supplier_order_lines', 'alpha') : 'undefined').'
'."\n"; // Init data print 'Option set_empty_time_spent_amount is '.(GETPOST('set_empty_time_spent_amount', 'alpha') ? GETPOST('set_empty_time_spent_amount', 'alpha') : 'undefined').'
'."\n"; @@ -205,7 +206,7 @@ $conf->global->MAIN_ENABLE_LOG_TO_HTML = 1; $oneoptionset = 0; $oneoptionset = (GETPOST('standard', 'alpha') || GETPOST('restore_thirdparties_logos', 'alpha') || GETPOST('clean_linked_elements', 'alpha') || GETPOST('clean_menus', 'alpha') || GETPOST('clean_orphelin_dir', 'alpha') || GETPOST('clean_product_stock_batch', 'alpha') || GETPOST('set_empty_time_spent_amount', 'alpha') || GETPOST('rebuild_product_thumbs', 'alpha') - || GETPOST('clean_perm_table', 'alpha') + || GETPOST('clean_perm_table', 'alpha') || GETPOST('clean_ecm_files_table', 'alpha') || GETPOST('force_disable_of_modules_not_found', 'alpha') || GETPOST('force_utf8_on_tables', 'alpha') || GETPOST('force_utf8mb4_on_tables', 'alpha') || GETPOST('force_collation_from_conf_on_tables', 'alpha') || GETPOST('rebuild_sequences', 'alpha') || GETPOST('recalculateinvoicetotal', 'alpha')); @@ -1294,6 +1295,55 @@ if ($ok && GETPOST('clean_perm_table', 'alpha')) { } +// clean_old_module_entries: Clean data into const when files of module were removed without being +if ($ok && GETPOST('clean_ecm_files_table', 'alpha')) { + print '
'; + + $MAXTODELETE = 100; + + $sql = "SELECT rowid, filename, filepath, entity from ".MAIN_DB_PREFIX."ecm_files"; + $sql .= " WHERE entity = 1"; + $sql .= " ORDER BY rowid ASC"; + + $nbfile = 0; + $nbfiletodelete = 0; + + $resql = $db->query($sql); + if ($resql) { + $num = $db->num_rows($resql); + if ($num) { + $i = 0; + while ($i < $num && $nbfiletodelete < $MAXTODELETE) { + $obj = $db->fetch_object($resql); + if ($obj->rowid > 0) { + $filetocheck = DOL_DATA_ROOT.'/'.$obj->filepath.'/'.$obj->filename; + $nbfile++; + if (!dol_is_file($filetocheck)) { + $nbfiletodelete++; + print ''; + } + } + $i++; + } + } + if ($nbfiletodelete > $MAXTODELETE) { + print ''; + } else { + print ''; + } + } else { + dol_print_error($db); + } +} // force utf8 on tables if ($ok && GETPOST('force_utf8_on_tables', 'alpha')) { From 78e0eeb557673e503f05b91a11269344c4e8134d Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Thu, 23 Jan 2025 21:06:21 +0100 Subject: [PATCH 39/46] Fix repair script --- htdocs/install/repair.php | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/htdocs/install/repair.php b/htdocs/install/repair.php index 06d14be0720..4a0a1b8501b 100644 --- a/htdocs/install/repair.php +++ b/htdocs/install/repair.php @@ -1313,23 +1313,27 @@ if ($ok && GETPOST('clean_ecm_files_table', 'alpha')) { $num = $db->num_rows($resql); if ($num) { $i = 0; - while ($i < $num && $nbfiletodelete < $MAXTODELETE) { + while ($i < $num) { $obj = $db->fetch_object($resql); if ($obj->rowid > 0) { $filetocheck = DOL_DATA_ROOT.'/'.$obj->filepath.'/'.$obj->filename; $nbfile++; if (!dol_is_file($filetocheck)) { $nbfiletodelete++; - print ''; + } else { + break; } - print ''; } } $i++; From 8967d995a864a2a6f912fbd0173d1daa5f2ac5c0 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Thu, 23 Jan 2025 21:08:45 +0100 Subject: [PATCH 40/46] Fix repair script --- htdocs/install/repair.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/repair.php b/htdocs/install/repair.php index 4a0a1b8501b..20498bc6c9e 100644 --- a/htdocs/install/repair.php +++ b/htdocs/install/repair.php @@ -1318,7 +1318,7 @@ if ($ok && GETPOST('clean_ecm_files_table', 'alpha')) { if ($obj->rowid > 0) { $filetocheck = DOL_DATA_ROOT.'/'.$obj->filepath.'/'.$obj->filename; $nbfile++; - if (!dol_is_file($filetocheck)) { + if (!dol_is_file($filetocheck) && !dol_is_file($filetocheck.'.noexe')) { $nbfiletodelete++; if ($nbfiletodelete <= $MAXTODELETE) { print '
'.$langs->trans("MailTopic").'

*** Clean table ecm_files from lines of entries whose physical files does not exists anymore (emplemented for entity 1 only)
Found line with id '.$obj->rowid.', entity '.$obj->entity.', file "'.$filetocheck.'" to delete'; + if (GETPOST('clean_ecm_files_table', 'alpha') == 'confirmed') { + $sqldelete = "DELETE FROM ".MAIN_DB_PREFIX."ecm_files WHERE rowid = ".((int) $obj->rowid); + $resqldelete = $db->query($sqldelete); + if (!$resqldelete) { + dol_print_error($db); + } + print ' - deleted'; + } + print '
There is more than '.$MAXTODELETE.' invalid entries into ecm_files index table (among '.$nbfile.' analyzed) with no valid physical files. Run the page several time to process all of them.
Nb of entries processed into ecm_files index table: '.$nbfile.', number of invalid record: '.$nbfiletodelete.'
Found line with id '.$obj->rowid.', entity '.$obj->entity.', file "'.$filetocheck.'" to delete'; - if (GETPOST('clean_ecm_files_table', 'alpha') == 'confirmed') { - $sqldelete = "DELETE FROM ".MAIN_DB_PREFIX."ecm_files WHERE rowid = ".((int) $obj->rowid); - $resqldelete = $db->query($sqldelete); - if (!$resqldelete) { - dol_print_error($db); + if ($nbfiletodelete <= $MAXTODELETE) { + print '
Found line with id '.$obj->rowid.', entity '.$obj->entity.', file "'.$filetocheck.'" to delete'; + if (GETPOST('clean_ecm_files_table', 'alpha') == 'confirmed') { + $sqldelete = "DELETE FROM ".MAIN_DB_PREFIX."ecm_files WHERE rowid = ".((int) $obj->rowid); + $resqldelete = $db->query($sqldelete); + if (!$resqldelete) { + dol_print_error($db); + } + print ' - deleted'; } - print ' - deleted'; + print '
Found line with id '.$obj->rowid.', entity '.$obj->entity.', file "'.$filetocheck.'" to delete'; From db128814b566feddaeea7ed6f104d52745bfc3e4 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Thu, 23 Jan 2025 22:13:19 +0100 Subject: [PATCH 41/46] Debug v21 --- htdocs/theme/eldy/info-box.inc.php | 8 ++++---- htdocs/theme/eldy/style.css.php | 2 +- htdocs/theme/md/info-box.inc.php | 12 ++++++------ 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/htdocs/theme/eldy/info-box.inc.php b/htdocs/theme/eldy/info-box.inc.php index 44f1ff7ddd8..24f981291a5 100644 --- a/htdocs/theme/eldy/info-box.inc.php +++ b/htdocs/theme/eldy/info-box.inc.php @@ -329,10 +329,10 @@ if (getDolGlobalString('THEME_INFOBOX_COLOR_ON_BACKGROUND')) { } if (!isset($conf->global->THEME_SATURATE_RATIO)) { - $conf->global->THEME_SATURATE_RATIO = 0.7; + $conf->global->THEME_SATURATE_RATIO = 0.8; } if (GETPOSTISSET('THEME_SATURATE_RATIO')) { - $conf->global->THEME_SATURATE_RATIO = GETPOSTINT('THEME_SATURATE_RATIO'); + $conf->global->THEME_SATURATE_RATIO = GETPOSTFLOAT('THEME_SATURATE_RATIO'); } ?> @@ -341,8 +341,8 @@ if (GETPOSTISSET('THEME_SATURATE_RATIO')) { color: #fff !important; opacity: 0.95; - global->THEME_SATURATE_RATIO)) { ?> - filter: saturate(global->THEME_SATURATE_RATIO; ?>); + + filter: saturate(); } diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 9ce2b990fcd..4fad79772c3 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -411,7 +411,7 @@ print 'fontsizesmaller='.$fontsizesmaller."\n"; print 'topMenuFontSize='.$topMenuFontSize."\n"; print 'toolTipBgColor='.$toolTipBgColor."\n"; print 'toolTipFontColor='.$toolTipFontColor."\n"; -print 'conf->global->THEME_SATURATE_RATIO='.getDolGlobalString('THEME_SATURATE_RATIO')." (must be between 0 and 1)\n"; +print 'getDolGlobalString("THEME_SATURATE_RATIO")='.getDolGlobalString('THEME_SATURATE_RATIO')." (must be between 0 and 1)\n"; print '*/'."\n"; diff --git a/htdocs/theme/md/info-box.inc.php b/htdocs/theme/md/info-box.inc.php index f2afc753cf4..a0588f5656b 100644 --- a/htdocs/theme/md/info-box.inc.php +++ b/htdocs/theme/md/info-box.inc.php @@ -34,10 +34,10 @@ if (getDolGlobalString('THEME_INFOBOX_COLOR_ON_BACKGROUND')) { } if (!isset($conf->global->THEME_SATURATE_RATIO)) { - $conf->global->THEME_SATURATE_RATIO = 0.7; + $conf->global->THEME_SATURATE_RATIO = 0.8; } if (GETPOSTISSET('THEME_SATURATE_RATIO')) { - $conf->global->THEME_SATURATE_RATIO = GETPOSTINT('THEME_SATURATE_RATIO'); + $conf->global->THEME_SATURATE_RATIO = GETPOSTFLOAT('THEME_SATURATE_RATIO'); } ?> @@ -241,8 +241,8 @@ a.info-box-text-a i.fa.fa-exclamation-triangle { height: 94px; /* must be same height as min-height of .info-box */ width: 86px; background: var(--colorbacktitle1) !important; - global->THEME_SATURATE_RATIO)) { ?> - filter: saturate(global->THEME_SATURATE_RATIO; ?>); + + filter: saturate(); } @@ -459,10 +459,10 @@ if (getDolGlobalString('THEME_INFOBOX_COLOR_ON_BACKGROUND')) { } if (!isset($conf->global->THEME_SATURATE_RATIO)) { - $conf->global->THEME_SATURATE_RATIO = 0.7; + $conf->global->THEME_SATURATE_RATIO = 0.8; } if (GETPOSTISSET('THEME_SATURATE_RATIO')) { - $conf->global->THEME_SATURATE_RATIO = GETPOSTINT('THEME_SATURATE_RATIO'); + $conf->global->THEME_SATURATE_RATIO = GETPOSTFLOAT('THEME_SATURATE_RATIO'); } ?> .bg-infobox-project i.fa{ From b6390f959cdaf47676fd7a806d7f9a718fd6ab7e Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Thu, 23 Jan 2025 22:19:39 +0100 Subject: [PATCH 42/46] Add slugify function for security purpose --- htdocs/core/lib/functions.lib.php | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 459bc021b4d..e436c45cfb5 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1874,6 +1874,33 @@ function dol_string_nounprintableascii($str, $removetabcrlf = 1) } } +/** + * Returns text slugified (no special char, separator is "-". + * + * @param string $stringtoslugify String to slugify + * @return string Slugified string + */ +function dolSlugify($stringtoslugify) +{ + $slug = dol_string_unaccent($stringtoslugify); + + // Convert special characters to their ASCII equivalents + if (function_exists('iconv')) { + $slug = iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $slug); + } + + // Convert to lowercase + $slug = strtolower($slug); + + // Replace non-alphanumeric characters with hyphens + $slug = preg_replace('/[^a-z0-9]+/', '-', $slug); + + // Remove leading and trailing hyphens + $slug = trim($slug, '-'); + + return $slug; +} + /** * Returns text escaped for inclusion into javascript code * From 48190b39de0a80f8a6335277de6ca1342568c695 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Thu, 23 Jan 2025 23:26:59 +0100 Subject: [PATCH 43/46] Debug v21 --- htdocs/societe/class/societeaccount.class.php | 10 +++++++ htdocs/societe/website.php | 14 ++++----- htdocs/website/class/website.class.php | 30 +++++++++++-------- 3 files changed, 35 insertions(+), 19 deletions(-) diff --git a/htdocs/societe/class/societeaccount.class.php b/htdocs/societe/class/societeaccount.class.php index e97ec89d8fa..47207ec2fda 100644 --- a/htdocs/societe/class/societeaccount.class.php +++ b/htdocs/societe/class/societeaccount.class.php @@ -31,6 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; //require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; //require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; + /** * Class for SocieteAccount */ @@ -257,6 +258,15 @@ class SocieteAccount extends CommonObject */ public function create(User $user, $notrigger = 0) { + global $langs; + + if ($this->site == 'dolibarr_website') { + if ((int) $this->fk_website <= 0) { + $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Website")); + return -1; + } + } + return $this->createCommon($user, $notrigger); } diff --git a/htdocs/societe/website.php b/htdocs/societe/website.php index 4ed8e18f7d6..1fa3b0678f7 100644 --- a/htdocs/societe/website.php +++ b/htdocs/societe/website.php @@ -35,6 +35,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/societeaccount.class.php'; +require_once DOL_DOCUMENT_ROOT.'/website/class/website.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; @@ -684,15 +685,14 @@ while ($i < $imaxinloop) { print ' title="'.dol_escape_htmltag($object->$key).'"'; } print '>'; - /*if ($key == 'status') { - print $objectwebsiteaccount->getLibStatut(5); - } elseif ($key == 'rowid') { - print $objectwebsiteaccount->showOutputField($val, $key, $object->id, ''); - } else { - print $objectwebsiteaccount->showOutputField($val, $key, $object->$key, ''); - }*/ if ($key == 'login') { print $objectwebsiteaccount->getNomUrl(1, '', 0, '', 1); + } elseif ($key == 'fk_website') { + if ($obj->$key > 0) { + $tmpwebsite = new Website($db); + $tmpwebsite->fetch($obj->$key); + print $tmpwebsite->getNomUrl(1); + } } else { print $objectwebsiteaccount->showOutputField($val, $key, $obj->$key, ''); } diff --git a/htdocs/website/class/website.class.php b/htdocs/website/class/website.class.php index 98fe79aa763..a95a2d84463 100644 --- a/htdocs/website/class/website.class.php +++ b/htdocs/website/class/website.class.php @@ -901,25 +901,31 @@ class Website extends CommonObject $result = ''; - $label = ''.$langs->trans("WebSite").''; + $label = ''.img_picto('', 'website', 'class="pictofixedwidth"').$langs->trans("WebSite").''; $label .= '
'; $label .= ''.$langs->trans('Ref').': '.$this->ref.'
'; $label .= ''.$langs->trans('MainLanguage').': '.$this->lang; - $linkstart = 'picto ? $this->picto : 'generic'), ($notooltip ? '' : 'class="classfortooltip"')).$linkend); - if ($withpicto != 2) { - $result .= ' '; - } + */ + if (!empty($this->virtualhost)) { + $linkstart = ''; + $linkend = ''; + } else { + $linkstart = $linkend = ''; } - $result .= $linkstart.$this->ref.$linkend; + + $result .= $linkstart; + if ($withpicto) { + $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), 'class="pictofixedwidth'.($notooltip ? '' : ' classfortooltip').'"'); + } + $result .= $this->ref; + $result .= $linkend; + return $result; } From 58b9fac4b51dac17907df3331225f36b7d65a148 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Thu, 23 Jan 2025 23:41:51 +0100 Subject: [PATCH 44/46] Fix sort on natural order --- htdocs/core/class/html.formfile.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 00c1a3bf98e..c95f857a4a9 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -1437,7 +1437,7 @@ class FormFile //var_dump($sortfield.' - '.$sortorder); if ($sortfield && $sortorder) { // If $sortfield is for example 'position_name', we will sort on the property 'position_name' (that is concat of position+name) - $filearray = dol_sort_array($filearray, $sortfield, $sortorder); + $filearray = dol_sort_array($filearray, $sortfield, $sortorder, 1); } } From 697a9fc59961107e509f0e3d21aed212f07cc06c Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Fri, 24 Jan 2025 13:12:48 +0100 Subject: [PATCH 45/46] Finish cleaning v21 of the setup pages --- htdocs/admin/accountant.php | 2 +- htdocs/admin/bank.php | 4 +-- htdocs/admin/barcode.php | 2 +- htdocs/admin/bom.php | 2 +- htdocs/admin/clicktodial.php | 4 +-- htdocs/admin/company.php | 2 +- htdocs/admin/contract.php | 2 +- htdocs/admin/dav.php | 4 +-- htdocs/admin/debugbar.php | 2 +- htdocs/admin/delais.php | 8 +++--- htdocs/admin/delivery.php | 2 +- htdocs/admin/ecm.php | 2 +- htdocs/admin/eventorganization.php | 4 +-- htdocs/admin/fichinter.php | 2 +- htdocs/admin/geoipmaxmind.php | 2 +- htdocs/admin/holiday.php | 20 +-------------- htdocs/admin/hrm.php | 4 +-- htdocs/admin/invoice.php | 4 +-- htdocs/admin/knowledgemanagement.php | 4 +-- htdocs/admin/ldap.php | 2 +- htdocs/admin/limits.php | 4 +-- htdocs/admin/mailing.php | 2 +- htdocs/admin/mails_ingoing.php | 2 +- htdocs/admin/mrp.php | 2 +- htdocs/admin/notification.php | 2 +- htdocs/admin/openinghours.php | 14 +++++------ htdocs/admin/order.php | 2 +- htdocs/admin/payment.php | 2 +- htdocs/admin/paymentbybanktransfer.php | 4 +-- htdocs/admin/pdf.php | 4 +-- htdocs/admin/pdf_other.php | 34 +++++++++----------------- htdocs/admin/prelevement.php | 4 +-- htdocs/admin/resource.php | 2 +- htdocs/admin/sms.php | 4 +-- htdocs/admin/stock.php | 2 +- htdocs/admin/stocktransfer.php | 4 +-- htdocs/admin/supplier_invoice.php | 2 +- htdocs/admin/supplier_order.php | 2 +- htdocs/admin/supplier_payment.php | 2 +- htdocs/admin/syslog.php | 4 +-- htdocs/admin/taxes.php | 2 +- htdocs/admin/webhook.php | 4 +-- htdocs/admin/website_options.php | 2 +- htdocs/admin/workstation.php | 4 +-- htdocs/core/class/conf.class.php | 9 ++++++- 45 files changed, 88 insertions(+), 109 deletions(-) diff --git a/htdocs/admin/accountant.php b/htdocs/admin/accountant.php index 0dbe9d5dc4c..174e71a7516 100644 --- a/htdocs/admin/accountant.php +++ b/htdocs/admin/accountant.php @@ -127,7 +127,7 @@ print ''; print ''; print ''; -print ''."\n"; +print ''."\n"; // Name of Accountant Company print '
'.$langs->trans("CompanyInfo").''.$langs->trans("Value").'
'.$langs->trans("CompanyInfo").'
'; diff --git a/htdocs/admin/bank.php b/htdocs/admin/bank.php index 18b5dff4645..2e1afa189cc 100644 --- a/htdocs/admin/bank.php +++ b/htdocs/admin/bank.php @@ -444,8 +444,8 @@ print load_fiche_titre($langs->trans("BankColorizeMovement"), '', ''); print '
'; print ''."\n"; print ''."\n"; -print ''; -print ''."\n"; +print ''; +print ''."\n"; print "\n"; print '
'.$langs->trans("Name").''.$langs->trans("Value").''.$langs->trans("Parameter").'
'; diff --git a/htdocs/admin/barcode.php b/htdocs/admin/barcode.php index a2d261159e0..f425524f3cc 100644 --- a/htdocs/admin/barcode.php +++ b/htdocs/admin/barcode.php @@ -450,7 +450,7 @@ print '
'; print ''; print ''; print ''; -print ''; +print ''; print ''; print ''; diff --git a/htdocs/admin/bom.php b/htdocs/admin/bom.php index 1c28ed4c482..1c4f0b4377a 100644 --- a/htdocs/admin/bom.php +++ b/htdocs/admin/bom.php @@ -456,7 +456,7 @@ print '
'; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").' 
'; print ''; print ''; -print ''; +print ''; print "\n"; print "\n"; diff --git a/htdocs/admin/clicktodial.php b/htdocs/admin/clicktodial.php index 49cb87e885c..ba4836f815c 100644 --- a/htdocs/admin/clicktodial.php +++ b/htdocs/admin/clicktodial.php @@ -92,8 +92,8 @@ print ''; print '
'; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").' 
'; print ''; -print ''; -print ''; +print ''; +print ''; print "\n"; diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index e3d08bb29cb..68856768f08 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -899,7 +899,7 @@ if ($mysoc->country_code == 'GR') { print '
'.$langs->trans("Name").''.$langs->trans("Value").''.$langs->trans("Parameter").'
'; print ''; print ''; - print ''; + print ''; print ''; print "\n"; diff --git a/htdocs/admin/contract.php b/htdocs/admin/contract.php index cf91b5fb5cb..ae676a142fd 100644 --- a/htdocs/admin/contract.php +++ b/htdocs/admin/contract.php @@ -497,7 +497,7 @@ print '
'; print '
'.$langs->trans("AccountParameter").''.$langs->trans("Value").'
'; print ''; print ''; -print ''; +print ''; print "\n"; $substitutionarray = pdf_getSubstitutionArray($langs, array('objectamount'), null, 2); diff --git a/htdocs/admin/dav.php b/htdocs/admin/dav.php index 76bfbd63b8f..6099d183348 100644 --- a/htdocs/admin/dav.php +++ b/htdocs/admin/dav.php @@ -102,7 +102,7 @@ if ($action == 'edit') { print ''; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; - print ''; + print ''; foreach ($arrayofparameters as $key => $val) { if (isset($val['enabled']) && empty($val['enabled'])) { @@ -138,7 +138,7 @@ if ($action == 'edit') { print '
'; } else { print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("Parameter").'
'; - print ''; + print ''; foreach ($arrayofparameters as $key => $val) { if (isset($val['enabled']) && empty($val['enabled'])) { diff --git a/htdocs/admin/debugbar.php b/htdocs/admin/debugbar.php index 9d1356362ba..6f77e1ef4e9 100644 --- a/htdocs/admin/debugbar.php +++ b/htdocs/admin/debugbar.php @@ -97,7 +97,7 @@ print ''; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("Parameter").'
'; print ''; -print ''; +print ''; print ''; print "\n"; diff --git a/htdocs/admin/delais.php b/htdocs/admin/delais.php index fe17368d821..092ec5bc5fc 100644 --- a/htdocs/admin/delais.php +++ b/htdocs/admin/delais.php @@ -249,11 +249,11 @@ if ($action == 'edit') { // Show if meteo is enabled print '
'.$langs->trans("Parameter").''.$langs->trans("Value").''.$langs->trans("Parameter").'
'; - print ''; + print ''; print ''; print ''; print '
'.$langs->trans("Option").''.$langs->trans("Value").'
'.$langs->trans("Option").'
'.$langs->trans("MAIN_DISABLE_METEO").''; - print $form->selectarray('MAIN_DISABLE_METEO', $labelmeteo, (!getDolGlobalString('MAIN_DISABLE_METEO') ? 0 : $conf->global->MAIN_DISABLE_METEO)); + print $form->selectarray('MAIN_DISABLE_METEO', $labelmeteo, getDolGlobalInt('MAIN_DISABLE_METEO')); print '
'; @@ -263,7 +263,7 @@ if ($action == 'edit') { */ print ''; - print ''; + print ''; foreach ($modules as $module => $delays) { if (isModEnabled($module)) { @@ -283,7 +283,7 @@ if ($action == 'edit') { // Show if meteo is enabled print '
'.$langs->trans("DelaysOfToleranceBeforeWarning").''.$langs->trans("Value").'
'.$langs->trans("DelaysOfToleranceBeforeWarning").'
'; - print ''; + print ''; print ''; print '
'.$langs->trans("Option").''.$langs->trans("Value").'
'.$langs->trans("Option").'
'.$langs->trans("MAIN_DISABLE_METEO").''; diff --git a/htdocs/admin/delivery.php b/htdocs/admin/delivery.php index f8d6c1730ad..fa05a39c472 100644 --- a/htdocs/admin/delivery.php +++ b/htdocs/admin/delivery.php @@ -490,7 +490,7 @@ if (getDolGlobalString('MAIN_SUBMODULE_DELIVERY')) { print ''; print ''; print ''; - print ''; + print ''; print ''; print "\n"; diff --git a/htdocs/admin/ecm.php b/htdocs/admin/ecm.php index b881d6d6a1a..cfc02d93efa 100644 --- a/htdocs/admin/ecm.php +++ b/htdocs/admin/ecm.php @@ -96,7 +96,7 @@ print dol_get_fiche_head($head, 'ecm', '', -1, ''); print '
'.$langs->trans("Parameter").''.$langs->trans("Value").' 
'; print ''; print ''; -print ''."\n"; +print ''."\n"; print ''; // Mail required for members diff --git a/htdocs/admin/eventorganization.php b/htdocs/admin/eventorganization.php index a92affd82cd..51eaededfb0 100644 --- a/htdocs/admin/eventorganization.php +++ b/htdocs/admin/eventorganization.php @@ -186,7 +186,7 @@ if ($action == 'edit') { print ''; print '
'.$langs->trans("Description").''.$langs->trans("Value").'
'; - print ''; + print ''; foreach ($arrayofparameters as $constname => $val) { if ($val['enabled'] == 1) { @@ -269,7 +269,7 @@ if ($action == 'edit') { } else { if (!empty($arrayofparameters)) { print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("Parameter").'
'; - print ''; + print ''; foreach ($arrayofparameters as $constname => $val) { if ($val['enabled'] == 1) { diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php index 9e04a9894da..edcd0469c1a 100644 --- a/htdocs/admin/fichinter.php +++ b/htdocs/admin/fichinter.php @@ -538,7 +538,7 @@ print '
'; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("Parameter").'
'; print ''; print ''; -print ''; +print ''; print "\n"; print "\n"; diff --git a/htdocs/admin/geoipmaxmind.php b/htdocs/admin/geoipmaxmind.php index 64bc975d3da..20716b351cf 100644 --- a/htdocs/admin/geoipmaxmind.php +++ b/htdocs/admin/geoipmaxmind.php @@ -110,7 +110,7 @@ print ''; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").' 
'; print ''; -print ''; +print ''; print ''; print "\n"; diff --git a/htdocs/admin/holiday.php b/htdocs/admin/holiday.php index 18b7ac33f6d..b6fc587032d 100644 --- a/htdocs/admin/holiday.php +++ b/htdocs/admin/holiday.php @@ -461,27 +461,9 @@ print '
'; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").''.$langs->trans("Parameter").'
'; print ''; print ''; -print ''; +print ''; print "\n"; -//var_dump($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_MONDAY); -//var_dump($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_FRIDAY); -//var_dump($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY); -//var_dump($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SUNDAY); - -if (!isset($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY)) { - $conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY = 1; -} -if (!isset($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SUNDAY)) { - $conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SUNDAY = 1; -} - -//var_dump($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_MONDAY); -//var_dump($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_FRIDAY); -//var_dump($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY); -//var_dump($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SUNDAY); - - // Set working days print ''; print ""; diff --git a/htdocs/admin/hrm.php b/htdocs/admin/hrm.php index 6671a5b68ad..e80962f6d25 100644 --- a/htdocs/admin/hrm.php +++ b/htdocs/admin/hrm.php @@ -510,7 +510,7 @@ if ($action == 'edit') { print ''; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
".$langs->trans("XIsAUsualNonWorkingDay", $langs->transnoentitiesnoconv("Monday"))."
'; - print ''; + print ''; foreach ($arrayofparameters as $constname => $val) { if ($val['enabled'] == 1) { @@ -595,7 +595,7 @@ if ($action == 'edit') { } else { if (!empty($arrayofparameters)) { print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("Parameter").'
'; - print ''; + print ''; foreach ($arrayofparameters as $constname => $val) { if ($val['enabled'] == 1) { diff --git a/htdocs/admin/invoice.php b/htdocs/admin/invoice.php index 736078cd4cf..e9dc88c9b96 100644 --- a/htdocs/admin/invoice.php +++ b/htdocs/admin/invoice.php @@ -792,7 +792,7 @@ print '
'; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("Parameter").'
'; print ''; print ''; -print ''; +print ''; print ''; print "\n"; @@ -879,7 +879,7 @@ print '
'; print '
'.$langs->trans("Parameters").''.$langs->trans("Value").' 
'."\n"; print ''."\n"; print ''."\n"; -print ''."\n"; +print ''."\n"; print "\n"; print ''."\n"; print ''."\n"; diff --git a/htdocs/admin/knowledgemanagement.php b/htdocs/admin/knowledgemanagement.php index ffd63bb379c..7c7458a6901 100644 --- a/htdocs/admin/knowledgemanagement.php +++ b/htdocs/admin/knowledgemanagement.php @@ -217,7 +217,7 @@ if ($action == 'edit') { print ''; print '
'.$langs->trans("Name").''.$langs->trans("Value").'
'.$langs->trans("PathDirectory").'
'; - print ''; + print ''; // @phan-suppress-next-line PhanEmptyForeach foreach ($arrayofparameters as $constname => $val) { @@ -285,7 +285,7 @@ if ($action == 'edit') { } else { if (!empty($arrayofparameters)) { print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("Parameter").'
'; - print ''; + print ''; // @phan-suppress-next-line PhanEmptyForeach foreach ($arrayofparameters as $constname => $val) { diff --git a/htdocs/admin/ldap.php b/htdocs/admin/ldap.php index c7c55268b4b..2fb95d6e572 100644 --- a/htdocs/admin/ldap.php +++ b/htdocs/admin/ldap.php @@ -198,7 +198,7 @@ print $hookmanager->resPrint; print ''; print ''; -print ''; +print ''; print ''; print "\n"; diff --git a/htdocs/admin/limits.php b/htdocs/admin/limits.php index a3e9b993621..164a0ce525c 100644 --- a/htdocs/admin/limits.php +++ b/htdocs/admin/limits.php @@ -173,7 +173,7 @@ if ($action == 'edit') { clearstatcache(); print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("Parameter").'
'.$langs->trans("Parameter").''.$langs->trans("Value").''.$langs->trans("Example").'
'; - print ''; + print ''; print '
'.$langs->trans("Parameters").''.$langs->trans("Value").'
'.$langs->trans("Parameters").'
'; print $form->textwithpicto($langs->trans("MAIN_MAX_DECIMALS_UNIT"), $langs->trans("ParameterActiveForNextInputOnly")); @@ -204,7 +204,7 @@ if ($action == 'edit') { } else { print '
'; print ''; - print ''; + print ''; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("Parameter").'
'; print $form->textwithpicto($langs->trans("MAIN_MAX_DECIMALS_UNIT"), $langs->trans("ParameterActiveForNextInputOnly")); diff --git a/htdocs/admin/mailing.php b/htdocs/admin/mailing.php index 36b8553156e..73a0787486b 100644 --- a/htdocs/admin/mailing.php +++ b/htdocs/admin/mailing.php @@ -144,7 +144,7 @@ print ''; print ''; print ''; print ''; -print ''; +print ''; print ''; print "\n"; diff --git a/htdocs/admin/mails_ingoing.php b/htdocs/admin/mails_ingoing.php index 734d83f619c..a206f4bed29 100644 --- a/htdocs/admin/mails_ingoing.php +++ b/htdocs/admin/mails_ingoing.php @@ -118,7 +118,7 @@ print "

\n"; /* print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table print '
'.$langs->trans("Parameter").''.$langs->trans("Value").''.$langs->trans("Example").'
'; -print ''; +print ''; print '
'; diff --git a/htdocs/admin/mrp.php b/htdocs/admin/mrp.php index bf7c39d8b9a..0b343459e3d 100644 --- a/htdocs/admin/mrp.php +++ b/htdocs/admin/mrp.php @@ -450,7 +450,7 @@ print load_fiche_titre($langs->trans("OtherOptions"), '', ''); print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("Parameter").'
'; print ''; print ''; -print ''; +print ''; print "\n"; print "\n"; diff --git a/htdocs/admin/notification.php b/htdocs/admin/notification.php index d9a9ae5bbfc..7bf96c88081 100644 --- a/htdocs/admin/notification.php +++ b/htdocs/admin/notification.php @@ -202,7 +202,7 @@ print '
'; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").' 
'; print ''; print ''; -print ''; +print ''; print "\n"; diff --git a/htdocs/admin/openinghours.php b/htdocs/admin/openinghours.php index 67289748f37..f79b92a7949 100644 --- a/htdocs/admin/openinghours.php +++ b/htdocs/admin/openinghours.php @@ -107,37 +107,37 @@ if (empty($action) || $action == 'edit' || $action == 'updateedit') { print ''."\n"; + print ''."\n"; print ''."\n"; + print ''."\n"; print ''."\n"; + print ''."\n"; print ''."\n"; + print ''."\n"; print ''."\n"; + print ''."\n"; print ''."\n"; + print ''."\n"; print ''."\n"; + print ''."\n"; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; print $form->textwithpicto($langs->trans("Monday"), $langs->trans("OpeningHoursFormatDesc")); print ''; - print '
'; print $form->textwithpicto($langs->trans("Tuesday"), $langs->trans("OpeningHoursFormatDesc")); print ''; - print '
'; print $form->textwithpicto($langs->trans("Wednesday"), $langs->trans("OpeningHoursFormatDesc")); print ''; - print '
'; print $form->textwithpicto($langs->trans("Thursday"), $langs->trans("OpeningHoursFormatDesc")); print ''; - print '
'; print $form->textwithpicto($langs->trans("Friday"), $langs->trans("OpeningHoursFormatDesc")); print ''; - print '
'; print $form->textwithpicto($langs->trans("Saturday"), $langs->trans("OpeningHoursFormatDesc")); print ''; - print '
'; print $form->textwithpicto($langs->trans("Sunday"), $langs->trans("OpeningHoursFormatDesc")); print ''; - print '
'; diff --git a/htdocs/admin/order.php b/htdocs/admin/order.php index d915eda1693..38b4dd721cf 100644 --- a/htdocs/admin/order.php +++ b/htdocs/admin/order.php @@ -649,7 +649,7 @@ print '
'; print ''; print ''; print ''; -print ''; +print ''; print "\n"; print "\n"; diff --git a/htdocs/admin/payment.php b/htdocs/admin/payment.php index c37c008ad9c..f60bed8f0c9 100644 --- a/htdocs/admin/payment.php +++ b/htdocs/admin/payment.php @@ -265,7 +265,7 @@ print '
'; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").' 
'; print ''; print ''; -print ''; +print ''; print ''; print "\n"; diff --git a/htdocs/admin/paymentbybanktransfer.php b/htdocs/admin/paymentbybanktransfer.php index a4771a9013b..3d5fb00b6ac 100644 --- a/htdocs/admin/paymentbybanktransfer.php +++ b/htdocs/admin/paymentbybanktransfer.php @@ -162,7 +162,7 @@ print '
'.$langs->trans("Parameter").''.$langs->trans("Value").' 
'; print ''; print ''; -print ''; +print ''; print ""; // Bank account (from Banks module) @@ -445,7 +445,7 @@ if (isModEnabled('notification')) print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; print ''; print ''; - print ''; + print ''; print ''; print "\n"; diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index 6101cdcc7bf..02521e57b9e 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -306,7 +306,7 @@ print load_fiche_titre($langs->trans("DictionaryPaperFormat"), '', ''); print '
'; print '
'.$langs->trans("User").''.$langs->trans("Value").''.$langs->trans("Action").'
'; -print ''; +print ''; $selected = getDolGlobalString('MAIN_PDF_FORMAT'); if (empty($selected)) { @@ -515,7 +515,7 @@ print load_fiche_titre($langs->trans("Other"), '', ''); print '
'; print '
'.$langs->trans("Parameters").''.$langs->trans("Value").'
'.$langs->trans("Parameters").'
'; -print ''; +print ''; // Use 2 languages into PDF diff --git a/htdocs/admin/pdf_other.php b/htdocs/admin/pdf_other.php index 39e97b2ee70..c325cec6aed 100644 --- a/htdocs/admin/pdf_other.php +++ b/htdocs/admin/pdf_other.php @@ -211,7 +211,7 @@ if (isModEnabled('propal')) { print '
'; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("Parameter").'
'; - print ''; + print ''; /* This feature seems not yet used into Dolibarr. So option is kept hidden and enabled by default print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("Parameter").'
'; @@ -253,11 +253,12 @@ if (isModEnabled('propal')) { } if (isModEnabled('order')) { - print load_fiche_titre($langs->trans("Orders"), '', 'bill'); + $langs->load("orders"); + print load_fiche_titre($langs->trans('CustomersOrders'), '', 'order'); print '
'; print ''; - print ''; + print ''; print ''; - print '
'.$langs->trans("Parameters").''.$langs->trans("Value").'
'.$langs->trans("Parameters").'
'; print $form->textwithpicto($langs->trans("MAIN_PDF_ADD_TERMSOFSALE_ORDER"), $langs->trans("PdfAddTermOfSaleHelp")); print ''; @@ -268,19 +269,8 @@ if (isModEnabled('order')) { print $form->selectarray("MAIN_PDF_ADD_TERMSOFSALE_ORDER", $arrval, $conf->global->MAIN_PDF_ADD_TERMSOFSALE_ORDER); } print '
'; - print '
'; -} -if (isModEnabled('order')) { - $langs->load("orders"); - print load_fiche_titre($langs->trans('CustomersOrders'), '', 'order'); - - print '
'; - print ''; - print ''; - - print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; + print '
'; print $form->textwithpicto($langs->trans("SALES_ORDER_SHOW_SHIPPING_ADDRESS"), $langs->trans("SALES_ORDER_SHOW_SHIPPING_ADDRESSMore")); print ''; if ($conf->use_javascript_ajax) { @@ -302,7 +292,7 @@ if (isModEnabled('supplier_proposal')) { print '
'; print ''; - print ''; + print ''; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("Parameter").'
'; print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_UNIT_PRICE"), ''); @@ -337,7 +327,7 @@ if (isModEnabled('supplier_order')) { print '
'; print ''; - print ''; + print ''; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("Parameter").'
'; print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_UNIT_PRICE"), ''); @@ -370,7 +360,7 @@ if (isModEnabled('invoice')) { print '
'; print ''; - print ''; + print ''; print '
'.$langs->trans("Parameters").''.$langs->trans("Value").'
'.$langs->trans("Parameters").'
'; print $form->textwithpicto($langs->trans("MAIN_PDF_ADD_TERMSOFSALE_INVOICE"), $langs->trans("PdfAddTermOfSaleHelp")); @@ -476,7 +466,7 @@ if (isModEnabled('shipping')) { print '
'; print ''; - print ''; + print ''; print '
'.$langs->trans("Parameters").''.$langs->trans("Value").'
'.$langs->trans("Parameters").'
'; print $langs->trans("BARCODE_ON_SHIPPING_PDF"); @@ -498,7 +488,7 @@ if (isModEnabled('reception')) { print '
'; print ''; - print ''; + print ''; print '
'.$langs->trans("Parameters").''.$langs->trans("Value").'
'.$langs->trans("Parameters").'
'; print $langs->trans("RECEPTION_PDF_HIDE_ORDERED"); @@ -541,7 +531,7 @@ if (isModEnabled('stocktransfer')) { print '
'; print ''; - print ''; + print ''; print '
'.$langs->trans("Parameters").''.$langs->trans("Value").'
'.$langs->trans("Parameters").'
'; print $langs->trans("BARCODE_ON_STOCKTRANSFER_PDF"); @@ -561,7 +551,7 @@ if (isModEnabled('stocktransfer')) { print load_fiche_titre($langs->trans("Files"), '', 'file'); print '
'; print ''; -print ''; +print ''; // Terms of sale $tooltiptermsofsale = $langs->trans('AvailableFormats').' : pdf'; diff --git a/htdocs/admin/prelevement.php b/htdocs/admin/prelevement.php index 90a150ba6bc..50a5430df3e 100644 --- a/htdocs/admin/prelevement.php +++ b/htdocs/admin/prelevement.php @@ -164,7 +164,7 @@ print '
'.$langs->trans("Parameters").''.$langs->trans("Value").'
'.$langs->trans("Parameters").'
'; print ''; print ''; -print ''; +print ''; print ""; @@ -460,7 +460,7 @@ if (isModEnabled('notification') ) print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; print ''; print ''; - print ''; + print ''; print ''; print "\n"; diff --git a/htdocs/admin/resource.php b/htdocs/admin/resource.php index aac4c03bfb4..7b16c42eb81 100644 --- a/htdocs/admin/resource.php +++ b/htdocs/admin/resource.php @@ -88,7 +88,7 @@ print '
'; print '
'.$langs->trans("User").''.$langs->trans("Value").''.$langs->trans("Action").'
'; print ''; print ''."\n"; -print ''."\n"; +print ''."\n"; print ''; diff --git a/htdocs/admin/sms.php b/htdocs/admin/sms.php index ad815dc5bc8..15bbe9a6691 100644 --- a/htdocs/admin/sms.php +++ b/htdocs/admin/sms.php @@ -181,7 +181,7 @@ if ($action == 'edit') { clearstatcache(); print '
'.$langs->trans("Parameters").''.$langs->trans("Value").'
'; - print ''; + print ''; // Disable print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("Parameter").'
'.$langs->trans("MAIN_DISABLE_ALL_SMS").''; @@ -217,7 +217,7 @@ if ($action == 'edit') { print '
'; } else { print ''; - print ''; + print ''; // Disable print ''; diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php index 78590db9795..952bccf2074 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -697,7 +697,7 @@ print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("Parameter").'
'.$langs->trans("MAIN_DISABLE_ALL_SMS").''.yn(getDolGlobalString('MAIN_DISABLE_ALL_SMS')).'
'; print ''; print "\n"; -print ''."\n"; +print ''."\n"; print ''."\n"; print ''; diff --git a/htdocs/admin/stocktransfer.php b/htdocs/admin/stocktransfer.php index e1281c1bf58..6a14e25c466 100644 --- a/htdocs/admin/stocktransfer.php +++ b/htdocs/admin/stocktransfer.php @@ -192,7 +192,7 @@ print ''.$langs->trans("StockTransferSetupPage").''; print '
".$langs->trans("Parameter")."'.$langs->trans("Value").'
'; - print ''; + print ''; foreach ($arrayofparameters as $key => $val) { @@ -213,7 +213,7 @@ print ''.$langs->trans("StockTransferSetupPage").''; - print ''; + print ''; foreach ($arrayofparameters as $key => $val) { diff --git a/htdocs/admin/supplier_invoice.php b/htdocs/admin/supplier_invoice.php index 325378332ce..8dab80b8157 100644 --- a/htdocs/admin/supplier_invoice.php +++ b/htdocs/admin/supplier_invoice.php @@ -472,7 +472,7 @@ print '
'; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("Parameter").'
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("Parameter").'
'; print ''; print ''; -print ''; +print ''; print ''; print "\n"; diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php index 17aa2f5f78f..ba4886573f3 100644 --- a/htdocs/admin/supplier_order.php +++ b/htdocs/admin/supplier_order.php @@ -477,7 +477,7 @@ print '
'; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").' 
'; print ''; print ''; -print ''; +print ''; print ''; print "\n"; diff --git a/htdocs/admin/supplier_payment.php b/htdocs/admin/supplier_payment.php index b76fe11f1bd..3419f734977 100644 --- a/htdocs/admin/supplier_payment.php +++ b/htdocs/admin/supplier_payment.php @@ -454,7 +454,7 @@ print '
'; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").' 
'; print ''; print ''; -print ''; +print ''; print ''; print "\n"; diff --git a/htdocs/admin/syslog.php b/htdocs/admin/syslog.php index fac147f09d4..2a922fbd752 100644 --- a/htdocs/admin/syslog.php +++ b/htdocs/admin/syslog.php @@ -217,7 +217,7 @@ print '
'; // You can use div-table-resp print '
'.$langs->trans("Parameter").''.$langs->trans("Value").' 
'; print ''; print ''; -print ''; +print ''; print ''; print "\n"; @@ -309,7 +309,7 @@ print ''; print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table print '
'.$langs->trans("Type").''.$langs->trans("Value").'
'; print ''; -print ''; +print ''; print ''; print "\n"; diff --git a/htdocs/admin/taxes.php b/htdocs/admin/taxes.php index 77ff2b03096..d70217c985e 100644 --- a/htdocs/admin/taxes.php +++ b/htdocs/admin/taxes.php @@ -180,7 +180,7 @@ if (empty($mysoc->tva_assuj)) { print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table print '
'.$langs->trans("Parameter").''.$langs->trans("Value").''.$langs->trans("Parameter").'
'; - print ''; + print ''; print '
'.$langs->trans("Parameters").''.$langs->trans("Value").'
'.$langs->trans("Parameters").'
'; print ''; diff --git a/htdocs/admin/webhook.php b/htdocs/admin/webhook.php index 382971d9906..a4451fec911 100644 --- a/htdocs/admin/webhook.php +++ b/htdocs/admin/webhook.php @@ -182,7 +182,7 @@ if ($action == 'edit') { print ''; print ''; - print ''; + print ''; // @phan-suppress-next-line PhanEmptyForeach foreach ($arrayofparameters as $constname => $val) { @@ -273,7 +273,7 @@ if ($action == 'edit') { } else { if (!empty($arrayofparameters)) { print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("Parameter").'
'; - print ''; + print ''; foreach ($arrayofparameters as $constname => $val) { if ($val['enabled'] == 1) { diff --git a/htdocs/admin/website_options.php b/htdocs/admin/website_options.php index e41ccdf90c7..4cb3f9c6120 100644 --- a/htdocs/admin/website_options.php +++ b/htdocs/admin/website_options.php @@ -128,7 +128,7 @@ print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("Parameter").'
'; print ''; print ''; print ''; -print ''."\n"; +print ''."\n"; print ''; diff --git a/htdocs/admin/workstation.php b/htdocs/admin/workstation.php index f05467d68da..eac57dbf797 100644 --- a/htdocs/admin/workstation.php +++ b/htdocs/admin/workstation.php @@ -195,7 +195,7 @@ if ($action == 'edit') { print ''; print '
'.$langs->trans("Parameter").' '.$langs->trans("Value").'
'; - print ''; + print ''; // @phan-suppress-next-line PhanEmptyForeach foreach ($arrayofparameters as $key => $val) { @@ -215,7 +215,7 @@ if ($action == 'edit') { } else { if (!empty($arrayofparameters)) { print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("Parameter").'
'; - print ''; + print ''; foreach ($arrayofparameters as $key => $val) { $setupnotempty++; diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index f6f452062c1..d0471938c67 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -20,7 +20,6 @@ * along with this program. If not, see . */ - /** * \file htdocs/core/class/conf.class.php * \ingroup core @@ -1038,6 +1037,14 @@ class Conf extends stdClass $this->global->MAIN_MAX_DECIMALS_SHOWN = 8; } + // Non working days + if (!isset($this->global->MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY)) { + $this->global->MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY = 1; + } + if (!isset($this->global->MAIN_NON_WORKING_DAYS_INCLUDE_SUNDAY)) { + $this->global->MAIN_NON_WORKING_DAYS_INCLUDE_SUNDAY = 1; + } + // Default pdf option if (!isset($this->global->MAIN_PDF_DASH_BETWEEN_LINES)) { $this->global->MAIN_PDF_DASH_BETWEEN_LINES = 1; // use dash between lines From 34feedbb033f2eb348b065ae1f5b56bcd7fceb4d Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Fri, 24 Jan 2025 13:14:32 +0100 Subject: [PATCH 46/46] Clean dead code --- htdocs/admin/workstation.php | 51 ------------------------------------ 1 file changed, 51 deletions(-) diff --git a/htdocs/admin/workstation.php b/htdocs/admin/workstation.php index eac57dbf797..dc6017c33ed 100644 --- a/htdocs/admin/workstation.php +++ b/htdocs/admin/workstation.php @@ -185,57 +185,6 @@ print load_fiche_titre($langs->trans($page_name), $linkback, 'title_setup'); $head = workstationAdminPrepareHead(); print dol_get_fiche_head($head, 'settings', $langs->trans($page_name), -1, "workstation"); -// Setup page goes here -//echo ''.$langs->trans("WorkstationSetupPage").'

'; - - -if ($action == 'edit') { - print '
'; - print ''; - print ''; - - print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("Parameter").'
'; - print ''; - - // @phan-suppress-next-line PhanEmptyForeach - foreach ($arrayofparameters as $key => $val) { - print ''; - } - print '
'.$langs->trans("Parameter").'
'; - $tooltiphelp = (($langs->trans($key.'Tooltip') != $key.'Tooltip') ? $langs->trans($key.'Tooltip') : ''); - print $form->textwithpicto($langs->trans($key), $tooltiphelp); - print '
'; - - print '
'; - print ''; - print '
'; - - print ''; - print '
'; -} else { - if (!empty($arrayofparameters)) { - print ''; - print ''; - - foreach ($arrayofparameters as $key => $val) { - $setupnotempty++; - - print ''; - } - - print '
'.$langs->trans("Parameter").'
'; - $tooltiphelp = (($langs->trans($key.'Tooltip') != $key.'Tooltip') ? $langs->trans($key.'Tooltip') : ''); - print $form->textwithpicto($langs->trans($key), $tooltiphelp); - print ''.getDolGlobalString($key).'
'; - - print '
'; - print ''.$langs->trans("Modify").''; - print '
'; - }/* else { - print '
'.$langs->trans("NothingToSetup"); - }*/ -} - foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { if ($myTmpObjectArray['includerefgeneration']) {