From fe96d826ef19d581808a0ba03f9eab9947977a19 Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Tue, 15 Jul 2025 21:49:28 +0200 Subject: [PATCH 1/9] Avoid duplicate apt install --- .travis.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 597b7ee4d4f..5af797c5fef 100644 --- a/.travis.yml +++ b/.travis.yml @@ -78,9 +78,6 @@ before_install: if [ "$TRAVIS_PHP_VERSION" = '7.1' ]; then sudo apt install unzip apache2 php7.1 php7.1-cli php7.1-curl php7.1-mysql php7.1-pgsql php7.1-gd php7.1-imap php7.1-intl php7.1-ldap php7.1-xml php7.1-mbstring php7.1-xml php7.1-zip libapache2-mod-php7.1 fi - if [ "$TRAVIS_PHP_VERSION" = '7.1' ]; then - sudo apt install unzip apache2 php7.1 php7.1-cli php7.1-curl php7.1-mysql php7.1-pgsql php7.1-gd php7.1-imap php7.1-intl php7.1-ldap php7.1-xml php7.1-mbstring php7.1-xml php7.1-zip libapache2-mod-php7.1 - fi if [ "$TRAVIS_PHP_VERSION" = '8.1' ]; then sudo apt install unzip apache2 php8.1 php8.1-cli php8.1-curl php8.1-mysql php8.1-pgsql php8.1-gd php8.1-imap php8.1-intl php8.1-ldap php8.1-xml php8.1-mbstring php8.1-xml php8.1-zip libapache2-mod-php8.1 fi From 6641e00cd67c5b58c2e558963135afe6d327509f Mon Sep 17 00:00:00 2001 From: atm-adrien <67913809+atm-adrien@users.noreply.github.com> Date: Sat, 19 Jul 2025 00:29:55 +0200 Subject: [PATCH 2/9] FIX : Correct rank when adding line on order (#34764) * FIX : Correct rank when adding line on order * FIX : Delete TODO --- htdocs/commande/class/commande.class.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 3d8a670b693..f261ecea741 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -1693,9 +1693,12 @@ class Commande extends CommonOrder if (!empty($fk_parent_line)) { $this->line_order(true, 'DESC'); } elseif ($ranktouse > 0 && $ranktouse <= count($this->lines)) { // Update all rank of all other lines - $linecount = count($this->lines); - for ($ii = $ranktouse; $ii <= $linecount; $ii++) { - $this->updateRangOfLine($this->lines[$ii - 1]->id, $ii + 1); + foreach ($this->lines as $line) { + if ($line->rang >= $ranktouse) { + if (!empty($line->id)) { + $this->updateRangOfLine($line->id, $line->rang + 1); + } + } } } From 5f70ad29a29ef43722628769c14f20cc98d87b2a Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Sat, 19 Jul 2025 15:43:40 +0200 Subject: [PATCH 3/9] FIX html title when using custom value --- htdocs/admin/security_other.php | 13 -------- htdocs/core/class/notify.class.php | 8 +++-- htdocs/core/lib/security2.lib.php | 10 +++++-- htdocs/core/tpl/login.tpl.php | 18 +++++++---- htdocs/index.php | 13 +++++--- htdocs/main.inc.php | 48 +++++++++++------------------- htdocs/user/passwordforgotten.php | 13 +++++--- 7 files changed, 62 insertions(+), 61 deletions(-) diff --git a/htdocs/admin/security_other.php b/htdocs/admin/security_other.php index 433d7a325fd..d89732dc8bf 100644 --- a/htdocs/admin/security_other.php +++ b/htdocs/admin/security_other.php @@ -214,19 +214,6 @@ print ''; -print ''.$langs->trans("MAIN_APPLICATION_TITLE").''; -print ''; -print ''; -print ' '; -print ''; -print ''; -*/ - print ''; print $form->buttonsSaveCancel("Modify", ''); diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php index 4171340d424..79d46359458 100644 --- a/htdocs/core/class/notify.class.php +++ b/htdocs/core/class/notify.class.php @@ -662,10 +662,12 @@ class Notify //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current // Define some vars - $application = 'Dolibarr'; - if (getDolGlobalString('MAIN_APPLICATION_TITLE')) { - $application = getDolGlobalString('MAIN_APPLICATION_TITLE'); + $application = constant('DOL_APPLICATION_TITLE'); + $applicationcustom = getDolGlobalString('MAIN_APPLICATION_TITLE'); + if ($applicationcustom) { + $application = (preg_match('/^\+/', $applicationcustom) ? $application : '').$applicationcustom; } + $from = getDolGlobalString('NOTIFICATION_EMAIL_FROM'); $object_type = ''; $link = ''; diff --git a/htdocs/core/lib/security2.lib.php b/htdocs/core/lib/security2.lib.php index 23b62303987..1cb47e1d710 100644 --- a/htdocs/core/lib/security2.lib.php +++ b/htdocs/core/lib/security2.lib.php @@ -152,8 +152,14 @@ if (!function_exists('dol_loginfunction')) { // Title $appli = constant('DOL_APPLICATION_TITLE'); $title = $appli.(getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER') ? '' : ' '.constant('DOL_VERSION')); - if (getDolGlobalString('MAIN_APPLICATION_TITLE')) { - $title = getDolGlobalString('MAIN_APPLICATION_TITLE'); + + $customapplication = getDolGlobalString('MAIN_APPLICATION_TITLE'); + if ($customapplication) { + if (preg_match('/^\+/', $customapplication)) { + $title .= $customapplication; + } else { + $title = $customapplication; + } } $titletruedolibarrversion = constant('DOL_VERSION'); // $title used by login template after the @ to inform of true Dolibarr version diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php index ef2f44d0630..99fceb82483 100644 --- a/htdocs/core/tpl/login.tpl.php +++ b/htdocs/core/tpl/login.tpl.php @@ -145,12 +145,20 @@ $arrayofjs = array( '/core/js/dst.js'.(empty($conf->dol_use_jmobile) ? '' : '?version='.urlencode(DOL_VERSION)) ); -// We display application title instead Login term -if (getDolGlobalString('MAIN_APPLICATION_TITLE')) { - $titleofloginpage = getDolGlobalString('MAIN_APPLICATION_TITLE'); +// We display application title +$application = constant('DOL_APPLICATION_TITLE'); +$applicationcustom = getDolGlobalString('MAIN_APPLICATION_TITLE'); +if ($applicationcustom) { + $application = (preg_match('/^\+/', $applicationcustom) ? $application : '').$applicationcustom; +} + +// We define login title +if ($applicationcustom) { + $titleofloginpage = $langs->trans('Login').' '.$application; } else { $titleofloginpage = $langs->trans('Login'); } +// Title of HTML page must have pattern ' @ (?:Doli[a-zA-Z]+ |)(\\d+)\\.(\\d+)\\.([^\\s]+)' to be detected as THE login page by webviews. $titleofloginpage .= ' @ '.$titletruedolibarrversion; // $titletruedolibarrversion is defined by dol_loginfunction in security2.lib.php. We must keep the @, some tools use it to know it is login page and find true dolibarr version. $disablenofollow = 1; @@ -253,12 +261,12 @@ if (!getDolGlobalString('ADD_UNSPLASH_LOGIN_BACKGROUND')) { -