From 99206d55705c84872bc4bc5f56780d02bc1a4e2b Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Mon, 24 Apr 2023 12:08:45 +0200 Subject: [PATCH 1/9] FIX special chars in generated file name from build doc mass action --- htdocs/core/actions_massactions.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 3c33765c407..b323b4b3e01 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -1035,7 +1035,7 @@ if (!$error && $massaction == "builddoc" && $permissiontoread && !GETPOST('butto $arrayofinclusion[] = '^'.preg_quote(dol_sanitizeFileName($tmppdf), '/').'\.pdf$'; } foreach ($listofobjectref as $tmppdf) { - $arrayofinclusion[] = '^'.preg_quote(dol_sanitizeFileName($tmppdf), '/').'_[a-zA-Z0-9\-\_\']+\.pdf$'; // To include PDF generated from ODX files + $arrayofinclusion[] = '^'.preg_quote(dol_sanitizeFileName($tmppdf), '/').'_[a-zA-Z0-9\-\_\'\&\.]+\.pdf$'; // To include PDF generated from ODX files } $listoffiles = dol_dir_list($uploaddir, 'all', 1, implode('|', $arrayofinclusion), '\.meta$|\.png', 'date', SORT_DESC, 0, true); From bb350d062b6908ee46331f75a30b233b2361153e Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Wed, 26 Apr 2023 10:25:08 +0200 Subject: [PATCH 2/9] FIX : deletion of a line of time spent (backport e3aa438d2a582313dfd5178b8cc5975e0c912c25) --- htdocs/projet/tasks/time.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 4be29d6f547..4dec93a3654 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -53,6 +53,7 @@ $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected i $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'timespentlist'; // To manage different context of search $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page $optioncss = GETPOST('optioncss', 'alpha'); +$mode = GETPOST('mode', 'alpha'); $id = GETPOST('id', 'int'); $projectid = GETPOST('projectid', 'int'); @@ -316,10 +317,10 @@ if (($action == 'updateline' || $action == 'updatesplitline') && !$cancel && $us } } -if ($action == 'confirm_deleteline' && $confirm == "yes" && $user->rights->projet->supprimer) { +if ($action == 'confirm_deleteline' && $confirm == "yes" && ($user->hasRight('projet', 'time') || $user->hasRight('projet', 'all', 'creer'))) { $object->fetchTimeSpent(GETPOST('lineid', 'int')); // load properties like $object->timespent_id - if (in_array($object->timespent_fk_user, $childids) || $user->rights->projet->all->creer) { + if (in_array($object->timespent_fk_user, $childids) || $user->hasRight('projet', 'all', 'creer')) { $result = $object->delTimeSpent($user); // delete line with $object->timespent_id if ($result < 0) { @@ -1897,7 +1898,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser print ' '; print ''; } elseif ($user->hasRight('projet', 'time') || $user->hasRight('projet', 'all', 'creer')) { // Read project and enter time consumed on assigned tasks - if ($task_time->fk_user == $user->id || in_array($task_time->fk_user, $childids) || $user->hasRight('projet', 'all', 'creer')) { + if (in_array($task_time->fk_user, $childids) || $user->hasRight('projet', 'all', 'creer')) { if (getDolGlobalString('MAIN_FEATURES_LEVEL') >= 2) { print ' '; print 'rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">'; From 1844278c4d99ff40226ad60e3e15143716ed47c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9=20Courtier?= Date: Fri, 28 Apr 2023 10:25:37 +0200 Subject: [PATCH 3/9] FIX: expense report autofill ttc input if force ttc conf is enabled --- htdocs/expensereport/card.php | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index eb1c93f609a..80f5d0baa41 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -2643,10 +2643,22 @@ if ($action == 'create') { ,async:false ,dataType:"json" ,success:function(response) { - if (response.response_status == "success"){ - jQuery("#value_unit_ht").val(response.data); - jQuery("#value_unit_ht").trigger("change"); - jQuery("#value_unit").val(""); + if (response.response_status == "success"){'; + + if (!empty($conf->global->EXPENSEREPORT_FORCE_LINE_AMOUNTS_INCLUDING_TAXES_ONLY)) { + print ' + jQuery("#value_unit").val(parseFloat(response.data) * (100 + parseFloat(tva)) / 100); + jQuery("#value_unit").trigger("change"); + '; + } else { + print ' + jQuery("#value_unit_ht").val(response.data); + jQuery("#value_unit_ht").trigger("change"); + jQuery("#value_unit").val(""); + '; + } + + print ' } else if(response.response_status == "error" && response.errorMessage != undefined && response.errorMessage.length > 0 ){ $.jnotify(response.errorMessage, "error", {timeout: 0, type: "error"},{ remove: function (){} } ); } From a93e3ab3f6496afc1c67bb10115ceeb13ae35964 Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Fri, 28 Apr 2023 10:50:25 +0200 Subject: [PATCH 4/9] FIX : remove NOTOKENRENOWAL (backport commit v17 7c316229db8060781ee50f4465b1133b5aeef156) --- htdocs/public/ticket/create_ticket.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/htdocs/public/ticket/create_ticket.php b/htdocs/public/ticket/create_ticket.php index 68edd453aaf..0e68d1799ea 100644 --- a/htdocs/public/ticket/create_ticket.php +++ b/htdocs/public/ticket/create_ticket.php @@ -26,9 +26,6 @@ if (!defined('NOREQUIREUSER')) { define('NOREQUIREUSER', '1'); }*/ -if (!defined('NOTOKENRENEWAL')) { - define('NOTOKENRENEWAL', '1'); -} if (!defined('NOREQUIREMENU')) { define('NOREQUIREMENU', '1'); } From cd949e9fa750ac40ff8fee8114967c89d1136048 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 28 Apr 2023 12:37:01 +0200 Subject: [PATCH 5/9] Fix error message not shown --- htdocs/commande/list.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 2211422f3c5..62603daa082 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -213,6 +213,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; $object->fields = dol_sort_array($object->fields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position'); +$error = 0; /* @@ -503,6 +504,7 @@ if (empty($reshook)) { } else { $lineid = 0; $error++; + $errors[] = $objecttmp->error; break; } // Defined the new fk_parent_line From 5218a43a4272cb2e71e95d6a1cb6eab7bdbe2970 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 28 Apr 2023 18:59:12 +0200 Subject: [PATCH 6/9] FIX Click on "NEW" in simple POS was broken --- htdocs/cashdesk/affContenu.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/cashdesk/affContenu.php b/htdocs/cashdesk/affContenu.php index d8e31f3b9c9..20f5132bb02 100644 --- a/htdocs/cashdesk/affContenu.php +++ b/htdocs/cashdesk/affContenu.php @@ -26,7 +26,7 @@ require_once 'class/Facturation.class.php'; // Si nouvelle vente, reinitialisation des donnees (destruction de l'objet et vidage de la table contenant la liste des articles) -if (GETPOST('id', 'int') == 'NOUV') { +if (GETPOST('id', 'aZ09') == 'NOUV') { unset($_SESSION['serObjFacturation']); unset($_SESSION['poscart']); } From 889811c6d18f099f7ff09c6b51a187a3e4cbdd75 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 2 May 2023 12:38:25 +0200 Subject: [PATCH 7/9] Fix amount on renewal for membership --- htdocs/adherents/type.php | 4 ---- htdocs/public/payment/newpayment.php | 3 +++ 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index 2f10848a827..8b1fa4e9e10 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -775,10 +775,6 @@ if ($rowid > 0) { print "\n"; print ''; print ''; - - if ($num > $limit) { - print_barre_liste('', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, ''); - } } else { dol_print_error($db); } diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index e3257bd659c..10afcf58ab1 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -1579,6 +1579,9 @@ if ($source == 'member' || $source == 'membersubscription') { if (empty($amount) && !GETPOST('newamount', 'alpha')) { $_GET['newamount'] = $member->last_subscription_amount; } + if (!empty($member->last_subscription_amount) && !GETPOSTISSET('newamount') && is_numeric($amount)) { + $amount = max($member->last_subscription_amount, $amount); + } } if ($member->type) { From 8f3ad5586e034def59d4d2e28ede4ef3f4ff2a85 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 2 May 2023 13:18:04 +0200 Subject: [PATCH 8/9] Fix missing buy_price_ht in export of lines --- htdocs/core/modules/modFacture.class.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/modFacture.class.php b/htdocs/core/modules/modFacture.class.php index 9f8d9d45b4c..e497add843b 100644 --- a/htdocs/core/modules/modFacture.class.php +++ b/htdocs/core/modules/modFacture.class.php @@ -544,7 +544,7 @@ class modFacture extends DolibarrModules $this->export_fields_array[$r] = $this->export_fields_array[$r] + array( 'fd.rowid'=>'LineId', 'fd.description'=>"LineDescription", 'fd.subprice'=>"LineUnitPrice", 'fd.tva_tx'=>"LineVATRate", 'fd.qty'=>"LineQty", 'fd.total_ht'=>"LineTotalHT", 'fd.total_tva'=>"LineTotalVAT", - 'fd.total_ttc'=>"LineTotalTTC", 'fd.date_start'=>"DateStart", 'fd.date_end'=>"DateEnd", 'fd.special_code'=>'SpecialCode', + 'fd.total_ttc'=>"LineTotalTTC", 'fd.buy_price_ht'=>'BuyingPrice', 'fd.date_start'=>"DateStart", 'fd.date_end'=>"DateEnd", 'fd.special_code'=>'SpecialCode', 'fd.product_type'=>"TypeOfLineServiceOrProduct", 'fd.fk_product'=>'ProductId', 'p.ref'=>'ProductRef', 'p.label'=>'ProductLabel', $alias_product_perentity . '.accountancy_code_sell'=>'ProductAccountancySellCode', 'aa.account_number' => 'AccountingAffectation' @@ -562,7 +562,7 @@ class modFacture extends DolibarrModules 'f.entity'=>'List:entity:label:rowid', 'f.fk_user_author'=>'Numeric', 'uc.login'=>'Text', 'f.fk_user_valid'=>'Numeric', 'uv.login'=>'Text', 'pj.ref'=>'Text', 'pj.title'=>'Text', 'fd.rowid'=>'Numeric', 'fd.description'=>"Text", 'fd.subprice'=>"Numeric", 'fd.tva_tx'=>"Numeric", - 'fd.qty'=>"Numeric", 'fd.total_ht'=>"Numeric", 'fd.total_tva'=>"Numeric", 'fd.total_ttc'=>"Numeric", 'fd.date_start'=>"Date", 'fd.date_end'=>"Date", + 'fd.qty'=>"Numeric", 'fd.total_ht'=>"Numeric", 'fd.total_tva'=>"Numeric", 'fd.total_ttc'=>"Numeric", 'fd.buy_price_ht'=>"Numeric", 'fd.date_start'=>"Date", 'fd.date_end'=>"Date", 'fd.special_code'=>'Numeric', 'fd.product_type'=>"Numeric", 'fd.fk_product'=>'List:product:label', 'p.ref'=>'Text', 'p.label'=>'Text', $alias_product_perentity . '.accountancy_code_sell'=>'Text', 'aa.account_number' => 'Text' @@ -572,12 +572,13 @@ class modFacture extends DolibarrModules 's.siren'=>'company', 's.siret'=>'company', 's.ape'=>'company', 's.idprof4'=>'company', 's.code_compta'=>'company', 's.code_compta_fournisseur'=>'company', 's.tva_intra'=>'company', 't.libelle'=>'company', // 'ce.code'=>'company', 'cfj.libelle'=>'company' 'pj.ref'=>'project', 'pj.title'=>'project', 'fd.rowid'=>'invoice_line', 'fd.description'=>"invoice_line", - 'fd.subprice'=>"invoice_line", 'fd.total_ht'=>"invoice_line", 'fd.total_tva'=>"invoice_line", 'fd.total_ttc'=>"invoice_line", 'fd.tva_tx'=>"invoice_line", + 'fd.subprice'=>"invoice_line", 'fd.total_ht'=>"invoice_line", 'fd.total_tva'=>"invoice_line", 'fd.total_ttc'=>"invoice_line", 'fd.buy_price_ht'=>'invoice_line', 'fd.tva_tx'=>"invoice_line", 'fd.qty'=>"invoice_line", 'fd.date_start'=>"invoice_line", 'fd.date_end'=>"invoice_line", 'fd.special_code'=>'invoice_line', 'fd.product_type'=>'invoice_line', 'fd.fk_product'=>'product', 'p.ref'=>'product', 'p.label'=>'product', $alias_product_perentity . '.accountancy_code_sell'=>'product', 'f.fk_user_author'=>'user', 'uc.login'=>'user', 'f.fk_user_valid'=>'user', 'uv.login'=>'user', 'aa.account_number' => "invoice_line", ); + $this->export_help_array[$r] = array('fd.buy_price_ht'=>'CostPriceUsage'); $this->export_special_array[$r] = array('none.rest'=>'getRemainToPay'); $this->export_dependencies_array[$r] = array('invoice_line'=>'fd.rowid', 'product'=>'fd.rowid', 'none.rest'=>array('f.rowid', 'f.total_ttc', 'f.close_code')); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them $keyforselect = 'facture'; From 55414fd4d4fb5b1fc6b3217372fc80ecd2015ec1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 3 May 2023 00:48:29 +0200 Subject: [PATCH 9/9] Log --- htdocs/core/tpl/massactions_pre.tpl.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/tpl/massactions_pre.tpl.php b/htdocs/core/tpl/massactions_pre.tpl.php index 24ec6665d03..c72b3e690b0 100644 --- a/htdocs/core/tpl/massactions_pre.tpl.php +++ b/htdocs/core/tpl/massactions_pre.tpl.php @@ -278,6 +278,7 @@ if ($massaction == 'presend') { $formmail->param['id'] = join(',', $arrayofselected); // $formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?id='.$object->id; if (!empty($conf->global->MAILING_LIMIT_SENDBYWEB) && count($listofselectedrecipientobjid) > $conf->global->MAILING_LIMIT_SENDBYWEB) { + // Note: MAILING_LIMIT_SENDBYWEB may be forced by conf.php file and variable $dolibarr_mailing_limit_sendbyweb $langs->load("errors"); print img_warning().' '.$langs->trans('WarningNumberOfRecipientIsRestrictedInMassAction', $conf->global->MAILING_LIMIT_SENDBYWEB); print ' - '.$langs->trans("GoBack").'';