From e0ebe85c134bebf41e794026af59b9b475648af7 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sun, 3 May 2020 09:15:12 +0200 Subject: [PATCH 01/11] Fix addline titles --- htdocs/core/tpl/objectline_create.tpl.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index 160d323a2c2..5e99146bc53 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -813,7 +813,7 @@ if (!empty($usemargins) && $user->rights->margins->creer) jQuery("#prod_entry_mode_free").prop('checked',true).change(); jQuery("#prod_entry_mode_predef").prop('checked',false).change(); jQuery("#search_idprod, #idprod, #search_idprodfournprice, #buying_price").val(''); - jQuery("#price_ht, #multicurrency_price_ht, #price_ttc, #price_ttc, #fourn_ref, #tva_tx, #buying_price, #title_vat, #title_up_ht, #title_up_ht_currency, #title_up_ttc, #title_up_ttc_currency").show(); + jQuery("#price_ht, #multicurrency_price_ht, #price_ttc, #price_ttc, #fourn_ref, #tva_tx, #buying_price, #title_fourn_ref, #title_vat, #title_up_ht, #title_up_ht_currency, #title_up_ttc, #title_up_ttc_currency").show(); jQuery("#np_marginRate, #np_markRate, .np_marginRate, .np_markRate, #units, #title_units").show(); jQuery("#fournprice_predef").hide(); } @@ -825,11 +825,13 @@ if (!empty($usemargins) && $user->rights->margins->creer) global->MAIN_DISABLE_EDIT_PREDEF_PRICEHT)) { ?> jQuery("#price_ht").val('').show(); jQuery("#multicurrency_price_ht").val('').show(); + jQuery("#title_up_ht, #title_up_ht_currency").show(); jQuery("#price_ht").val('').hide(); jQuery("#multicurrency_price_ht").val('').hide(); + jQuery("#title_up_ht, #title_up_ht_currency").hide(); - jQuery("#price_ttc, #fourn_ref, #tva_tx, #title_vat, #title_up_ht_currency, #title_up_ttc, #title_up_ttc_currency").hide(); + jQuery("#price_ttc, #fourn_ref, #tva_tx, #title_fourn_ref, #title_vat, #title_up_ttc, #title_up_ttc_currency").hide(); jQuery("#np_marginRate, #np_markRate, .np_marginRate, .np_markRate, #units, #title_units").hide(); jQuery("#buying_price").show(); jQuery('#trlinefordates, .divlinefordates').show(); From 6d894b7abd3bd0c7e47a4e98b817b9d954ca0f1b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 4 May 2020 19:08:31 +0200 Subject: [PATCH 02/11] Fix missing link in message --- htdocs/core/class/notify.class.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php index db0e490a6c6..6c0ec1ec62b 100644 --- a/htdocs/core/class/notify.class.php +++ b/htdocs/core/class/notify.class.php @@ -528,7 +528,7 @@ class Notify $message.= $outputlangs->transnoentities("YouReceiveMailBecauseOfNotification2", $application, $mysoc->name)."\n"; $message.= "\n"; $message.= $mesg; - if ($link) $message.= "\n" . $urlwithroot . $link; + if ($link) $message.= "\n" . $urlwithroot . $link; // if link is already added around the ref into the translation text, then $link must be set to '' $parameters = array('notifcode'=>$notifcode, 'sendto'=>$sendto, 'replyto'=>$replyto, 'file'=>$filename_list, 'mimefile'=>$mimetype_list, 'filename'=>$mimefilename_list); if (!isset($action)) $action = ''; @@ -600,6 +600,7 @@ class Notify { foreach($conf->global as $key => $val) { + $reg = array(); if ($val == '' || ! preg_match('/^NOTIFICATION_FIXEDEMAIL_'.$notifcode.'_THRESHOLD_HIGHER_(.*)$/', $key, $reg)) continue; $threshold = (float) $reg[1]; @@ -743,7 +744,7 @@ class Notify $message.= $langs->transnoentities("YouReceiveMailBecauseOfNotification2", $application, $mysoc->name)."\n"; $message.= "\n"; $message.= $mesg; - //if ($link) $message.= "\n" . $urlwithroot . $link; // link already added around the ref into the text + if ($link) $message.= "\n" . $urlwithroot . $link; // if link is already added around the ref into the translation text, then $link must be set to '' $message = nl2br($message); From 2afd38e2f65c555579dd661dd728f15c98e0e3e0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 4 May 2020 21:59:31 +0200 Subject: [PATCH 03/11] FIX Combo list of available users to filter on the list of leaves. --- htdocs/core/class/html.form.class.php | 54 +++++++++++++-------------- htdocs/holiday/list.php | 8 ++-- 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 39a006e0342..93061d200d8 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1574,16 +1574,16 @@ class Form // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * Return select list of users + * Return the HTML select list of users * - * @param string $selected Id user preselected - * @param string $htmlname Field name in form - * @param int $show_empty 0=liste sans valeur nulle, 1=ajoute valeur inconnue - * @param array $exclude Array list of users id to exclude - * @param int $disabled If select list must be disabled - * @param array $include Array list of users id to include - * @param int $enableonly Array list of users id to be enabled. All other must be disabled - * @param string $force_entity '0' or Ids of environment to force + * @param string $selected Id user preselected + * @param string $htmlname Field name in form + * @param int $show_empty 0=liste sans valeur nulle, 1=ajoute valeur inconnue + * @param array $exclude Array list of users id to exclude + * @param int $disabled If select list must be disabled + * @param array|string $include Array list of users id to include. User '' for all users or 'hierarchy' to have only supervised users or 'hierarchyme' to have supervised + me + * @param int $enableonly Array list of users id to be enabled. All other must be disabled + * @param string $force_entity '0' or Ids of environment to force * @return void * @deprecated Use select_dolusers instead * @see select_dolusers() @@ -1598,24 +1598,24 @@ class Form /** * Return select list of users * - * @param string $selected User id or user object of user preselected. If 0 or < -2, we use id of current user. If -1, keep unselected (if empty is allowed) - * @param string $htmlname Field name in form - * @param int $show_empty 0=list with no empty value, 1=add also an empty value into list - * @param array $exclude Array list of users id to exclude - * @param int $disabled If select list must be disabled - * @param array|string $include Array list of users id to include or 'hierarchy' to have only supervised users or 'hierarchyme' to have supervised + me - * @param array $enableonly Array list of users id to be enabled. If defined, it means that others will be disabled - * @param string $force_entity '0' or Ids of environment to force - * @param int $maxlength Maximum length of string into list (0=no limit) - * @param int $showstatus 0=show user status only if status is disabled, 1=always show user status into label, -1=never show user status - * @param string $morefilter Add more filters into sql request (Example: 'employee = 1') - * @param integer $show_every 0=default list, 1=add also a value "Everybody" at beginning of list - * @param string $enableonlytext If option $enableonlytext is set, we use this text to explain into label why record is disabled. Not used if enableonly is empty. - * @param string $morecss More css - * @param int $noactive Show only active users (this will also happened whatever is this option if USER_HIDE_INACTIVE_IN_COMBOBOX is on). - * @param int $outputmode 0=HTML select string, 1=Array - * @param bool $multiple add [] in the name of element and add 'multiple' attribut - * @return string HTML select string + * @param string $selected User id or user object of user preselected. If 0 or < -2, we use id of current user. If -1, keep unselected (if empty is allowed) + * @param string $htmlname Field name in form + * @param int $show_empty 0=list with no empty value, 1=add also an empty value into list + * @param array $exclude Array list of users id to exclude + * @param int $disabled If select list must be disabled + * @param array|string $include Array list of users id to include. User '' for all users or 'hierarchy' to have only supervised users or 'hierarchyme' to have supervised + me + * @param array $enableonly Array list of users id to be enabled. If defined, it means that others will be disabled + * @param string $force_entity '0' or Ids of environment to force + * @param int $maxlength Maximum length of string into list (0=no limit) + * @param int $showstatus 0=show user status only if status is disabled, 1=always show user status into label, -1=never show user status + * @param string $morefilter Add more filters into sql request (Example: 'employee = 1') + * @param integer $show_every 0=default list, 1=add also a value "Everybody" at beginning of list + * @param string $enableonlytext If option $enableonlytext is set, we use this text to explain into label why record is disabled. Not used if enableonly is empty. + * @param string $morecss More css + * @param int $noactive Show only active users (this will also happened whatever is this option if USER_HIDE_INACTIVE_IN_COMBOBOX is on). + * @param int $outputmode 0=HTML select string, 1=Array + * @param bool $multiple add [] in the name of element and add 'multiple' attribut + * @return string HTML select string * @see select_dolgroups() */ public function select_dolusers($selected = '', $htmlname = 'userid', $show_empty = 0, $exclude = null, $disabled = 0, $include = '', $enableonly = '', $force_entity = '0', $maxlength = 0, $showstatus = 0, $morefilter = '', $show_every = 0, $enableonlytext = '', $morecss = '', $noactive = 0, $outputmode = 0, $multiple = false) diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index 2361edf8a27..2277563aaa0 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -1,9 +1,9 @@ - * Copyright (C) 2013-2018 Laurent Destailleur + * Copyright (C) 2013-2020 Laurent Destailleur * Copyright (C) 2012-2016 Regis Houssin * Copyright (C) 2018 Charlene Benke - * Copyright (C) 2019 Frédéric France + * Copyright (C) 2019 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 @@ -476,7 +476,7 @@ if ($resql) $include = ''; - if (!empty($user->rights->holiday->read_all)) $include = 'hierarchyme'; // Can see all + if (empty($user->rights->holiday->read_all)) $include = 'hierarchyme'; // Can see only its hierarchyl print '
'; print ''."\n"; @@ -488,7 +488,7 @@ if ($resql) if (!empty($arrayfields['cp.ref']['checked'])) { print ''; } From c0b9fef22907d7cc747b28f142a345702e75ae79 Mon Sep 17 00:00:00 2001 From: Pierre Ardoin <32256817+mapiolca@users.noreply.github.com> Date: Tue, 5 May 2020 08:40:30 +0200 Subject: [PATCH 04/11] Fix issue in status name Before : $commandestatic->LibStatut($obj->nb) shows bad value because bad param Now : $commandestatic->LibStatut($obj->fk_statut) shows good value. --- htdocs/fourn/commande/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/commande/index.php b/htdocs/fourn/commande/index.php index 78d6c01679f..dd50efc7591 100644 --- a/htdocs/fourn/commande/index.php +++ b/htdocs/fourn/commande/index.php @@ -189,7 +189,7 @@ if ($resql) $obj = $db->fetch_object($resql); print ''; - print ''; + print ''; print ''; print "\n"; From c14b6884e3f71de24cd27dc4da3d1e0db04bb13d Mon Sep 17 00:00:00 2001 From: gauthier Date: Tue, 5 May 2020 10:02:36 +0200 Subject: [PATCH 05/11] FIX : missing hook init + table class + $page not set --- htdocs/compta/prelevement/bons.php | 1 + htdocs/compta/prelevement/list.php | 1 + htdocs/compta/prelevement/rejets.php | 4 +++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/prelevement/bons.php b/htdocs/compta/prelevement/bons.php index 2b67b73c95b..27654de1ad0 100644 --- a/htdocs/compta/prelevement/bons.php +++ b/htdocs/compta/prelevement/bons.php @@ -53,6 +53,7 @@ $search_ref = GETPOST('search_ref', 'alpha'); $search_amount = GETPOST('search_amount', 'alpha'); $bon=new BonPrelevement($db, ""); +$hookmanager->initHooks(array('withdrawalsreceiptslist')); /* diff --git a/htdocs/compta/prelevement/list.php b/htdocs/compta/prelevement/list.php index 81e58e19cca..eb741b981d9 100644 --- a/htdocs/compta/prelevement/list.php +++ b/htdocs/compta/prelevement/list.php @@ -56,6 +56,7 @@ $search_company = GETPOST('search_company', 'alpha'); $statut = GETPOST('statut', 'int'); $bon=new BonPrelevement($db, ""); +$hookmanager->initHooks(array('withdrawalsreceiptslineslist')); $ligne=new LignePrelevement($db, $user); diff --git a/htdocs/compta/prelevement/rejets.php b/htdocs/compta/prelevement/rejets.php index 333d07a4617..7611945a40d 100644 --- a/htdocs/compta/prelevement/rejets.php +++ b/htdocs/compta/prelevement/rejets.php @@ -40,6 +40,7 @@ $result = restrictedArea($user, 'prelevement', '', '', 'bons'); // Get supervariables $page = GETPOST('page', 'int'); +if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 $sortorder = GETPOST('sortorder', 'alpha'); $sortfield = GETPOST('sortfield', 'alpha'); @@ -57,6 +58,7 @@ if ($sortorder == "") $sortorder="DESC"; if ($sortfield == "") $sortfield="p.datec"; $rej = new RejetPrelevement($db, $user); +$hookmanager->initHooks(array('withdrawalsreceiptsrejectedlist')); $ligne = new LignePrelevement($db, $user); /* @@ -85,7 +87,7 @@ if ($result) print_barre_liste($langs->trans("WithdrawsRefused"), $page, $_SERVER["PHP_SELF"], $urladd, $sortfield, $sortorder, '', $num); print"\n\n"; - print '
'; - print ''; + print ''; print '
'.$commandestatic->LibStatut($obj->nb).''.$commandestatic->LibStatut($obj->fk_statut).''.$obj->nb.' '.$commandestatic->LibStatut($obj->fk_statut, 3).'
'; + print '
'; print ''; print_liste_field_titre("Line", $_SERVER["PHP_SELF"], "p.ref", '', $urladd); print_liste_field_titre("ThirdParty", $_SERVER["PHP_SELF"], "s.nom", '', $urladd); From 78a427c9967a398e0fd8d3aaeaa4c1b723a487db Mon Sep 17 00:00:00 2001 From: atm-lena Date: Tue, 5 May 2020 14:35:03 +0200 Subject: [PATCH 06/11] FIX wrong user right's name to top menu "commercial" --- htdocs/core/menus/standard/eldy.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 84555ba23cf..f1859c0fcc5 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -234,7 +234,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = ) ? 1 : 0, 'perms'=>(!empty($user->rights->propal->lire) || !empty($user->rights->commande->lire) || - !empty($user->rights->supplier_order->lire) || + !empty($user->rights->fournisseur->lire) || !empty($user->rights->supplier_proposal->lire) || !empty($user->rights->contrat->lire) || !empty($user->rights->ficheinter->lire) From 36a0780f148c684e3172a689e2d8e550d0473b52 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 5 May 2020 15:20:40 +0200 Subject: [PATCH 07/11] More complete fix for #13817 --- htdocs/core/menus/standard/eldy.lib.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index f1859c0fcc5..17edca45676 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -227,19 +227,21 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = $tmpentry = array( 'enabled'=>(!empty($conf->propal->enabled) || !empty($conf->commande->enabled) || - !empty($conf->supplier_order->enabled) || - !empty($conf->supplier_proposal->enabled) || - !empty($conf->contrat->enabled) || + !empty($conf->fournisseur->enabled) || + !empty($conf->supplier_proposal->enabled) || + !empty($conf->supplier_order->enabled) || + !empty($conf->contrat->enabled) || !empty($conf->ficheinter->enabled) ) ? 1 : 0, 'perms'=>(!empty($user->rights->propal->lire) || !empty($user->rights->commande->lire) || !empty($user->rights->fournisseur->lire) || !empty($user->rights->supplier_proposal->lire) || + !empty($user->rights->supplier_order->lire) || !empty($user->rights->contrat->lire) || !empty($user->rights->ficheinter->lire) ), - 'module'=>'propal|commande|supplier_order|supplier_proposal|contrat|ficheinter' + 'module'=>'propal|commande|supplier_proposal|supplier_order|contrat|ficheinter' ); $onlysupplierorder = ! empty($user->rights->fournisseur->commande->lire) && From fa305fdaca1b7b32e51c8f80233693a2625eec4e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 5 May 2020 21:49:46 +0200 Subject: [PATCH 08/11] Prepare version 11.0.4 --- ChangeLog | 78 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) diff --git a/ChangeLog b/ChangeLog index 3b81e0555d5..a7d0282fba5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,84 @@ English Dolibarr ChangeLog -------------------------------------------------------------- +***** ChangeLog for 11.0.4 compared to 11.0.3 ***** +FIX: #13749 +FIX: #7594 +FIX: #7594 Expense report multi pagebreak +FIX: Access to undeclared static property: Contact::$table_element +FIX: actions on supplier proposal not saved (bad trigger name) +FIX: Add function "completeTabsHead" to "addreplace" type hook. +FIX: All forms must use newToken() +FIX: Another "Access to undeclared static property: Contact::$table_element" && "Societe::$table_element" +FIX: author search supplier proposal list +FIX: A variable was erased by a temporary variable +FIX: Avoid infinite loop when a fetch is inside a compute field. +FIX: Backto link +FIX: Bad position of total in column +FIX: bad value in currency into discount created from down payment +FIX: buyprice extrafield langfile and tooltip +FIX: Buyprice was updated only if min price for this qty had same qty +FIX: Can switch from double to price type for extrafields +FIX: Can use decimal value in virtual products +FIX: child categories only with good entity rights +FIX: cloning of emailing when no content selected +FIX: closing tags +FIX: Combo list of available users to filter on the list of leaves. +FIX: Compatibility with multicompany, bad numerotation of task. +FIX: consistency of price w/wo vat wrong when price entered with tax +FIX: default value of selectMasssAction broken +FIX: draftordered replenish virtual stock +FIX: Error update SQL into stock reception +FIX: expensereport status in generated pdf +FIX: extra date field incorrect check +FIX: Extrafields of type price must be '' and not '0' if not defined +FIX: Foreign currency lost when splitting a discount +FIX: get remain to pay with rounding decimals +FIX: gzip and bzip2 must use option -f +FIX: IHM, unexpected quote +FIX: keep viewstatut for doli 3.5 +FIX: Link missing into email of some notification +FIX: Look and feel v11 +FIX: md stylesheet to be included by external modules like eldy +FIX: missing array option +FIX: missing default accountancy product buy code +FIX: missing fk_bank during export of suppliers invoices +FIX: missing member entity +FIX: missing selectedlines on supplier order but checkbox are displayed +FIX: Missing token and take into account max date when it can. +FIX: model export list must be sorted by label +FIX: multicurrency manage on hidden conf SUPPLIER_PROPOSAL_UPDATE_PRICE_ON_SUPPlIER_PROPOSAL +FIX: Must escape shell +FIX: Must exclude logs and some dirs for compressed backup +FIX: ordered stock already in $stock +FIX: picture migration script from doli 9.0 +FIX: print pictures on shipment docs +FIX: product get purchase prices +FIX: product purchase prices +FIX: Protection when database has a corrupted product id +FIX: remove unused var, $usercancreate can be change by Multicompany +FIX: replenish stock to buy +FIX: Sanitizing menu parameter +FIX: Send email from bulk action of list of thirdparties +FIX: setup of suggested payment mode on proposals and orders +FIX: Several pb in export of documents +FIX: Situation invoice take into account the credit notes. +FIX: some others modules (like subtotal) use other product_type than 0 or 1 AND must not be considered in this report +FIX: sort by default role makes no sense +FIX: sort on company on member list +FIX: TakePOS buying price +FIX: text version of html emailing (removed the body style) +FIX: The "test smtp connectivity" failed on page to setup mass emailing +FIX: Error logs an Orderline::delete error, but this is an Orderline::insert error +FIX: Translation of tooltips of extrafields +FIX: Use getNomURL instead of hard coded link. Fix limit. +FIX: Use of image into free text for PDF if DOL_DATA_DIR is outside of +FIX: viewstatut to search status +FIX: we must export company mail address on contact vcard only if contact email address is empty +FIX: when we filter a list on a view status, we want this filter to be on bookmark that we create +FIX: Wrong Sql on getListOfTowns api method +FIX: wrong user right's name to top menu "commercial" +FIX: XSS Vulnerability ***** ChangeLog for 11.0.3 compared to 11.0.2 ***** FIX: unit price for selected supplier products not set. NaN was used. From d9cef1c8d79ac971641fc4304355f5cb44d5b5f3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 May 2020 01:49:19 +0200 Subject: [PATCH 09/11] Fix packager to publish on new web site --- build/makepack-dolibarr.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index c6b8cd330c8..933c5b8f994 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -19,7 +19,7 @@ use Term::ANSIColor; # Change this to defined target for option 98 and 99 $PROJECT="dolibarr"; $PUBLISHSTABLE="eldy,dolibarr\@frs.sourceforge.net:/home/frs/project/dolibarr"; -$PUBLISHBETARC="dolibarr\@vmprod1.dolibarr.org:/home/dolibarr/dolibarr.org/httpdocs/files"; +$PUBLISHBETARC="dolibarr\@vmprod1.dolibarr.org:/home/dolibarr/asso.dolibarr.org/dolibarr_documents/website/www.dolibarr.org/files"; #@LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","EXEDOLIWAMP","SNAPSHOT"); # Possible packages From b3a064d309e2533c911bbf45f246f98309a1e2b8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 May 2020 16:02:34 +0200 Subject: [PATCH 10/11] Fix dup --- ChangeLog | 1 - 1 file changed, 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index a7d0282fba5..bcbfb1a959c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,7 +4,6 @@ English Dolibarr ChangeLog ***** ChangeLog for 11.0.4 compared to 11.0.3 ***** FIX: #13749 -FIX: #7594 FIX: #7594 Expense report multi pagebreak FIX: Access to undeclared static property: Contact::$table_element FIX: actions on supplier proposal not saved (bad trigger name) From d4400cf80fce889f4836338ca40a8bff0080ee2e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 7 May 2020 11:39:32 +0200 Subject: [PATCH 11/11] FIX links into emails of notifications --- htdocs/core/class/notify.class.php | 56 ++++++++++++++---------------- 1 file changed, 27 insertions(+), 29 deletions(-) diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php index 6c0ec1ec62b..8a03196beef 100644 --- a/htdocs/core/class/notify.class.php +++ b/htdocs/core/class/notify.class.php @@ -416,34 +416,34 @@ class Notify switch ($notifcode) { case 'BILL_VALIDATE': - $link='/compta/facture/card.php?facid='.$object->id; + $link = '' . $newref . ''; $dir_output = $conf->facture->dir_output; $object_type = 'facture'; - $mesg = $outputlangs->transnoentitiesnoconv("EMailTextInvoiceValidated", $newref); + $mesg = $outputlangs->transnoentitiesnoconv("EMailTextInvoiceValidated", $link); break; case 'BILL_PAYED': - $link='/compta/facture/card.php?facid='.$object->id; + $link ='' . $newref . ''; $dir_output = $conf->facture->dir_output; $object_type = 'facture'; - $mesg = $outputlangs->transnoentitiesnoconv("EMailTextInvoicePayed", $newref); + $mesg = $outputlangs->transnoentitiesnoconv("EMailTextInvoicePayed", $link); break; case 'ORDER_VALIDATE': - $link='/commande/card.php?id='.$object->id; + $link = '' . $newref . ''; $dir_output = $conf->commande->dir_output; $object_type = 'order'; - $mesg = $outputlangs->transnoentitiesnoconv("EMailTextOrderValidated", $newref); + $mesg = $outputlangs->transnoentitiesnoconv("EMailTextOrderValidated", $link); break; case 'PROPAL_VALIDATE': - $link='/comm/propal/card.php?id='.$object->id; + $link = '' . $newref . ''; $dir_output = $conf->propal->multidir_output[$object->entity]; $object_type = 'propal'; - $mesg = $outputlangs->transnoentitiesnoconv("EMailTextProposalValidated", $newref); + $mesg = $outputlangs->transnoentitiesnoconv("EMailTextProposalValidated", $link); break; case 'PROPAL_CLOSE_SIGNED': - $link='/comm/propal/card.php?id='.$object->id; + $link = '' . $newref . ''; $dir_output = $conf->propal->multidir_output[$object->entity]; $object_type = 'propal'; - $mesg = $outputlangs->transnoentitiesnoconv("EMailTextProposalClosedSigned", $newref); + $mesg = $outputlangs->transnoentitiesnoconv("EMailTextProposalClosedSigned", $link); break; case 'FICHINTER_ADD_CONTACT': $link='/fichinter/card.php?id='.$object->id; @@ -452,17 +452,17 @@ class Notify $mesg = $outputlangs->transnoentitiesnoconv("EMailTextInterventionAddedContact", $newref); break; case 'FICHINTER_VALIDATE': - $link='/fichinter/card.php?id='.$object->id; + $link = '' . $newref . ''; $dir_output = $conf->ficheinter->dir_output; $object_type = 'ficheinter'; - $mesg = $outputlangs->transnoentitiesnoconv("EMailTextInterventionValidated", $newref); + $mesg = $outputlangs->transnoentitiesnoconv("EMailTextInterventionValidated", $link); break; case 'ORDER_SUPPLIER_VALIDATE': $link='/fourn/commande/card.php?id='.$object->id; $dir_output = $conf->fournisseur->commande->dir_output; $object_type = 'order_supplier'; $mesg = $outputlangs->transnoentitiesnoconv("Hello").",\n\n"; - $mesg.= $outputlangs->transnoentitiesnoconv("EMailTextOrderValidatedBy", $newref, $user->getFullName($outputlangs)); + $mesg.= $outputlangs->transnoentitiesnoconv("EMailTextOrderValidatedBy", $link, $user->getFullName($outputlangs)); $mesg.= "\n\n".$outputlangs->transnoentitiesnoconv("Sincerely").".\n\n"; break; case 'ORDER_SUPPLIER_APPROVE': @@ -470,46 +470,46 @@ class Notify $dir_output = $conf->fournisseur->commande->dir_output; $object_type = 'order_supplier'; $mesg = $outputlangs->transnoentitiesnoconv("Hello").",\n\n"; - $mesg.= $outputlangs->transnoentitiesnoconv("EMailTextOrderApprovedBy", $newref, $user->getFullName($outputlangs)); + $mesg.= $outputlangs->transnoentitiesnoconv("EMailTextOrderApprovedBy", $link, $user->getFullName($outputlangs)); $mesg.= "\n\n".$outputlangs->transnoentitiesnoconv("Sincerely").".\n\n"; break; case 'ORDER_SUPPLIER_REFUSE': - $link='/fourn/commande/card.php?id='.$object->id; + $link = '' . $newref . ''; $dir_output = $conf->fournisseur->commande->dir_output; $object_type = 'order_supplier'; $mesg = $outputlangs->transnoentitiesnoconv("Hello").",\n\n"; - $mesg.= $outputlangs->transnoentitiesnoconv("EMailTextOrderRefusedBy", $newref, $user->getFullName($outputlangs)); + $mesg.= $outputlangs->transnoentitiesnoconv("EMailTextOrderRefusedBy", $link, $user->getFullName($outputlangs)); $mesg.= "\n\n".$outputlangs->transnoentitiesnoconv("Sincerely").".\n\n"; break; case 'SHIPPING_VALIDATE': $link = ''.$newref.''; $dir_output = $conf->expedition->dir_output.'/sending/'; $object_type = 'expedition'; - $mesg = $outputlangs->transnoentitiesnoconv("EMailTextExpeditionValidated", $newref); + $mesg = $outputlangs->transnoentitiesnoconv("EMailTextExpeditionValidated", $link); break; case 'EXPENSE_REPORT_VALIDATE': $link = ''.$newref.''; $dir_output = $conf->expensereport->dir_output; $object_type = 'expensereport'; - $mesg = $outputlangs->transnoentitiesnoconv("EMailTextExpenseReportValidated", $newref); + $mesg = $outputlangs->transnoentitiesnoconv("EMailTextExpenseReportValidated", $link); break; case 'EXPENSE_REPORT_APPROVE': $link = ''.$newref.''; $dir_output = $conf->expensereport->dir_output; $object_type = 'expensereport'; - $mesg = $outputlangs->transnoentitiesnoconv("EMailTextExpenseReportApproved", $newref); + $mesg = $outputlangs->transnoentitiesnoconv("EMailTextExpenseReportApproved", $link); break; case 'HOLIDAY_VALIDATE': $link = ''.$newref.''; $dir_output = $conf->holiday->dir_output; $object_type = 'holiday'; - $mesg = $outputlangs->transnoentitiesnoconv("EMailTextHolidayValidated", $newref); + $mesg = $outputlangs->transnoentitiesnoconv("EMailTextHolidayValidated", $link); break; case 'HOLIDAY_APPROVE': $link = ''.$newref.''; $dir_output = $conf->holiday->dir_output; $object_type = 'holiday'; - $mesg = $outputlangs->transnoentitiesnoconv("EMailTextHolidayApproved", $newref); + $mesg = $outputlangs->transnoentitiesnoconv("EMailTextHolidayApproved", $link); break; } $ref = dol_sanitizeFileName($newref); @@ -528,7 +528,6 @@ class Notify $message.= $outputlangs->transnoentities("YouReceiveMailBecauseOfNotification2", $application, $mysoc->name)."\n"; $message.= "\n"; $message.= $mesg; - if ($link) $message.= "\n" . $urlwithroot . $link; // if link is already added around the ref into the translation text, then $link must be set to '' $parameters = array('notifcode'=>$notifcode, 'sendto'=>$sendto, 'replyto'=>$replyto, 'file'=>$filename_list, 'mimefile'=>$mimetype_list, 'filename'=>$mimefilename_list); if (!isset($action)) $action = ''; @@ -655,7 +654,7 @@ class Notify break; case 'FICHINTER_ADD_CONTACT': $link = '' . $newref . ''; - $dir_output = $conf->facture->dir_output; + $dir_output = $conf->ficheinter->dir_output; $object_type = 'ficheinter'; $mesg = $langs->transnoentitiesnoconv("EMailTextInterventionAddedContact", $link); break; @@ -701,31 +700,31 @@ class Notify $link = ''.$newref.''; $dir_output = $conf->expedition->dir_output.'/sending/'; $object_type = 'order_supplier'; - $mesg = $langs->transnoentitiesnoconv("EMailTextExpeditionValidated", $newref); + $mesg = $langs->transnoentitiesnoconv("EMailTextExpeditionValidated", $link); break; case 'EXPENSE_REPORT_VALIDATE': $link = ''.$newref.''; $dir_output = $conf->expensereport->dir_output; $object_type = 'expensereport'; - $mesg = $langs->transnoentitiesnoconv("EMailTextExpenseReportValidated", $newref); + $mesg = $langs->transnoentitiesnoconv("EMailTextExpenseReportValidated", $link); break; case 'EXPENSE_REPORT_APPROVE': $link = ''.$newref.''; $dir_output = $conf->expensereport->dir_output; $object_type = 'expensereport'; - $mesg = $langs->transnoentitiesnoconv("EMailTextExpenseReportApproved", $newref); + $mesg = $langs->transnoentitiesnoconv("EMailTextExpenseReportApproved", $link); break; case 'HOLIDAY_VALIDATE': $link = ''.$newref.''; $dir_output = $conf->holiday->dir_output; $object_type = 'holiday'; - $mesg = $langs->transnoentitiesnoconv("EMailTextHolidayValidated", $newref); + $mesg = $langs->transnoentitiesnoconv("EMailTextHolidayValidated", $link); break; case 'HOLIDAY_APPROVE': $link = ''.$newref.''; $dir_output = $conf->holiday->dir_output; $object_type = 'holiday'; - $mesg = $langs->transnoentitiesnoconv("EMailTextHolidayApproved", $newref); + $mesg = $langs->transnoentitiesnoconv("EMailTextHolidayApproved", $link); break; } $ref = dol_sanitizeFileName($newref); @@ -744,7 +743,6 @@ class Notify $message.= $langs->transnoentities("YouReceiveMailBecauseOfNotification2", $application, $mysoc->name)."\n"; $message.= "\n"; $message.= $mesg; - if ($link) $message.= "\n" . $urlwithroot . $link; // if link is already added around the ref into the translation text, then $link must be set to '' $message = nl2br($message);