From a9031505f145161a34f37516c95e72591362efd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 18 Oct 2022 14:26:26 +0200 Subject: [PATCH 01/22] display count extrafields in invoice admin --- htdocs/core/lib/invoice.lib.php | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/invoice.lib.php b/htdocs/core/lib/invoice.lib.php index b98f17e46ee..bd02d7cca53 100644 --- a/htdocs/core/lib/invoice.lib.php +++ b/htdocs/core/lib/invoice.lib.php @@ -2,7 +2,7 @@ /* Copyright (C) 2005-2012 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2013 Florian Henry - * Copyright (C) 2015 Juanjo Menent + * Copyright (C) 2015 Juanjo Menent * Copyright (C) 2017 Charlie Benke * Copyright (C) 2017 ATM-CONSULTING * @@ -137,7 +137,13 @@ function facture_prepare_head($object) */ function invoice_admin_prepare_head() { - global $langs, $conf, $user; + global $langs, $conf, $user, $db; + + $extrafields = new ExtraFields($db); + $extrafields->fetch_name_optionals_label('facture'); + $extrafields->fetch_name_optionals_label('facturedet'); + $extrafields->fetch_name_optionals_label('facture_rec'); + $extrafields->fetch_name_optionals_label('facturedet_rec'); $h = 0; $head = array(); @@ -160,25 +166,41 @@ function invoice_admin_prepare_head() $head[$h][0] = DOL_URL_ROOT.'/compta/facture/admin/facture_cust_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFieldsCustomerInvoices"); + $nbExtrafields = $extrafields->attributes['facture']['count']; + if ($nbExtrafields > 0) { + $head[$h][1] .= ''.$nbExtrafields.''; + } $head[$h][2] = 'attributes'; $h++; $head[$h][0] = DOL_URL_ROOT.'/compta/facture/admin/facturedet_cust_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFieldsLines"); + $nbExtrafields = $extrafields->attributes['facturedet']['count']; + if ($nbExtrafields > 0) { + $head[$h][1] .= ''.$nbExtrafields.''; + } $head[$h][2] = 'attributeslines'; $h++; $head[$h][0] = DOL_URL_ROOT.'/compta/facture/admin/facture_rec_cust_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFieldsCustomerInvoicesRec"); + $nbExtrafields = $extrafields->attributes['facture_rec']['count']; + if ($nbExtrafields > 0) { + $head[$h][1] .= ''.$nbExtrafields.''; + } $head[$h][2] = 'attributesrec'; $h++; $head[$h][0] = DOL_URL_ROOT.'/compta/facture/admin/facturedet_rec_cust_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFieldsLinesRec"); + $nbExtrafields = $extrafields->attributes['facturedet_rec']['count']; + if ($nbExtrafields > 0) { + $head[$h][1] .= ''.$nbExtrafields.''; + } $head[$h][2] = 'attributeslinesrec'; $h++; - if ($conf->global->INVOICE_USE_SITUATION) { // Warning, implementation is seriously bugged and a new one not compatible is expected to become stable + if (!empty($conf->global->INVOICE_USE_SITUATION)) { // Warning, implementation is seriously bugged and a new one not compatible is expected to become stable $head[$h][0] = DOL_URL_ROOT.'/admin/facture_situation.php'; $head[$h][1] = $langs->trans("InvoiceSituation"); $head[$h][2] = 'situation'; From 5d12903b3458699a65da1d87bedce50a68a4c4bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 19 Oct 2022 10:22:55 +0200 Subject: [PATCH 02/22] add count extrafields badge in bank admin --- htdocs/core/lib/bank.lib.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/bank.lib.php b/htdocs/core/lib/bank.lib.php index 8920808766a..736b200bea3 100644 --- a/htdocs/core/lib/bank.lib.php +++ b/htdocs/core/lib/bank.lib.php @@ -131,7 +131,12 @@ function bank_prepare_head(Account $object) */ function bank_admin_prepare_head($object) { - global $langs, $conf, $user; + global $langs, $conf, $user, $db; + + $extrafields = new ExtraFields($db); + $extrafields->fetch_name_optionals_label('bank_account'); + $extrafields->fetch_name_optionals_label('bank'); + $h = 0; $head = array(); @@ -154,11 +159,19 @@ function bank_admin_prepare_head($object) $head[$h][0] = DOL_URL_ROOT.'/admin/bank_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFields").' ('.$langs->trans("BankAccounts").')'; + $nbExtrafields = $extrafields->attributes['bank_account']['count']; + if ($nbExtrafields > 0) { + $head[$h][1] .= ''.$nbExtrafields.''; + } $head[$h][2] = 'attributes'; $h++; $head[$h][0] = DOL_URL_ROOT.'/admin/bankline_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFields").' ('.$langs->trans("BankTransactions").')'; + $nbExtrafields = $extrafields->attributes['bank']['count']; + if ($nbExtrafields > 0) { + $head[$h][1] .= ''.$nbExtrafields.''; + } $head[$h][2] = 'bankline_extrafields'; $h++; From 477f5e2890fc841cc9b87fedb2b4358b27b6a0a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9=20Courtier?= Date: Wed, 19 Oct 2022 11:53:17 +0200 Subject: [PATCH 03/22] FIX: Missing return 0 if object not found --- htdocs/commande/class/commande.class.php | 6 ++++++ htdocs/compta/facture/class/facture.class.php | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 54e50baa9f7..97bd4d36fa4 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -4138,6 +4138,12 @@ class OrderLine extends CommonOrderLine $result = $this->db->query($sql); if ($result) { $objp = $this->db->fetch_object($result); + + if (!$objp) { + $this->error = 'OrderLine with id '. $rowid .' not found sql='.$sql; + return 0; + } + $this->rowid = $objp->rowid; $this->id = $objp->rowid; $this->fk_commande = $objp->fk_commande; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 862a86e9e16..8804e58b1c1 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -5293,6 +5293,11 @@ class FactureLigne extends CommonInvoiceLine if ($result) { $objp = $this->db->fetch_object($result); + if (!$objp) { + $this->error = 'InvoiceLine with id '. $rowid .' not found sql='.$sql; + return 0; + } + $this->rowid = $objp->rowid; $this->id = $objp->rowid; $this->fk_facture = $objp->fk_facture; From d4344a736f9a70d98f986d665bb3232487698576 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 19 Oct 2022 12:28:51 +0200 Subject: [PATCH 04/22] add accessible values --- htdocs/product/dynamic_price/class/price_parser.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/product/dynamic_price/class/price_parser.class.php b/htdocs/product/dynamic_price/class/price_parser.class.php index 764ff919cc7..412d015f8b9 100644 --- a/htdocs/product/dynamic_price/class/price_parser.class.php +++ b/htdocs/product/dynamic_price/class/price_parser.class.php @@ -150,6 +150,8 @@ class PriceParser "length" => $product->length, "surface" => $product->surface, "price_min" => $product->price_min, + "cost_price" => $product->cost_price, + "pmp" => $product->pmp, )); //Retrieve all extrafield for product and add it to values From 8d515b9c2f2b206a03b890f248e47e00dd490e5e Mon Sep 17 00:00:00 2001 From: Anthony Berton Date: Wed, 19 Oct 2022 17:06:20 +0200 Subject: [PATCH 05/22] FIX - php 8 Warning newonlinessign --- htdocs/public/onlinesign/newonlinesign.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/public/onlinesign/newonlinesign.php b/htdocs/public/onlinesign/newonlinesign.php index 91c3ec2ce73..09d8eccd66f 100644 --- a/htdocs/public/onlinesign/newonlinesign.php +++ b/htdocs/public/onlinesign/newonlinesign.php @@ -78,6 +78,9 @@ $message = GETPOST('message', 'aZ09'); $suffix = GETPOST("suffix", 'aZ09'); $source = GETPOST("source", 'alpha'); $ref = $REF = GETPOST("ref", 'alpha'); +$urlok = ''; +$urlko = ''; + if (empty($source)) { $source = 'proposal'; From d9aaf3e4d36461fb5547c6b4c04b08906bc42237 Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Wed, 19 Oct 2022 22:02:04 +0200 Subject: [PATCH 06/22] ajax.php Add price --- htdocs/takepos/ajax/ajax.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/takepos/ajax/ajax.php b/htdocs/takepos/ajax/ajax.php index 1ee27c51f8b..671ef27ba96 100644 --- a/htdocs/takepos/ajax/ajax.php +++ b/htdocs/takepos/ajax/ajax.php @@ -84,6 +84,7 @@ if ($action == 'getProducts') { } unset($prod->fields); unset($prod->db); + $prod->price_formated=price(price2num($prod->price, 'MU'), 1, $langs, 1, -1, -1, $conf->currency); $res[] = $prod; } } @@ -301,7 +302,7 @@ if ($action == 'getProducts') { 'object' => 'product', 'img' => $ig, 'qty' => 1, - //'price_formated' => price(price2num($obj->price, 'MU'), 1, $langs, 1, -1, -1, $conf->currency) + 'price_formated' => price(price2num($obj->price, 'MU'), 1, $langs, 1, -1, -1, $conf->currency) ); // Add entries to row from hooks $parameters=array(); From bdc979eaadfe75c46f727e5643a557424456960b Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Wed, 19 Oct 2022 22:03:26 +0200 Subject: [PATCH 07/22] pos.css.php Add price --- htdocs/takepos/css/pos.css.php | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/htdocs/takepos/css/pos.css.php b/htdocs/takepos/css/pos.css.php index ed968ea6f4e..f4a130dc5f1 100644 --- a/htdocs/takepos/css/pos.css.php +++ b/htdocs/takepos/css/pos.css.php @@ -826,10 +826,6 @@ div#moreinfo, div#infowarehouse { clear: both; } -.div5 .price { - display: none; -} - .div5 .imgadd { display: none; } @@ -925,18 +921,12 @@ div#moreinfo, div#infowarehouse { .div5 .arrow .centerinmiddle { transform: translate(0, 0); } - - .div5 .price { - font-size: 14px; - margin-left: auto; - margin-right: 30px; - padding-right: 10px; - font-weight: bold; - color: #ff6d6d; - display: flex; - } .div5 .imgadd { display: flex; } + + div.wrapper2{ + height:10%; + } } \ No newline at end of file From 6b1e4dbf6b83c3c34065f381118edd092ccc4364 Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Wed, 19 Oct 2022 22:05:01 +0200 Subject: [PATCH 08/22] Index Add price --- htdocs/takepos/index.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index 7443c380b9a..8be5a97e465 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -1375,9 +1375,6 @@ if (!empty($conf->global->TAKEPOS_WEIGHING_SCALE)) {
-
-
-
...
From 11ef2517e972ade70d578d66114ad4e525eb52d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 20 Oct 2022 12:30:10 +0200 Subject: [PATCH 09/22] add extrafields count badge --- htdocs/core/lib/fichinter.lib.php | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/htdocs/core/lib/fichinter.lib.php b/htdocs/core/lib/fichinter.lib.php index eaa1f85d142..87c9ce4a3fc 100644 --- a/htdocs/core/lib/fichinter.lib.php +++ b/htdocs/core/lib/fichinter.lib.php @@ -139,7 +139,11 @@ function fichinter_prepare_head($object) */ function fichinter_admin_prepare_head() { - global $langs, $conf, $user; + global $langs, $conf, $user, $db; + + $extrafields = new ExtraFields($db); + $extrafields->fetch_name_optionals_label('fichinter'); + $extrafields->fetch_name_optionals_label('fichinterdet'); $h = 0; $head = array(); @@ -159,19 +163,25 @@ function fichinter_admin_prepare_head() $head[$h][0] = DOL_URL_ROOT.'/fichinter/admin/fichinter_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFields"); + $nbExtrafields = $extrafields->attributes['fichinter']['count']; + if ($nbExtrafields > 0) { + $head[$h][1] .= ''.$nbExtrafields.''; + } $head[$h][2] = 'attributes'; $h++; $head[$h][0] = DOL_URL_ROOT.'/fichinter/admin/fichinterdet_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFieldsLines"); + $nbExtrafields = $extrafields->attributes['fichinterdet']['count']; + if ($nbExtrafields > 0) { + $head[$h][1] .= ''.$nbExtrafields.''; + } $head[$h][2] = 'attributesdet'; $h++; - - complete_head_from_modules($conf, $langs, null, $head, $h, 'fichinter_admin', 'remove'); - return $head; + return $head; } /** From eb4a260fca948fae4c780b43c18a15913d2699c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20N=C3=BA=C3=B1ez?= Date: Thu, 20 Oct 2022 13:52:51 +0200 Subject: [PATCH 10/22] NEW: Add option FICHINTER_ALLOW_EXTERNAL_DOWNLOAD --- htdocs/core/class/commonobject.class.php | 3 +++ htdocs/core/lib/functions.lib.php | 11 +++++++++++ htdocs/fichinter/card.php | 8 +++++++- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index a198d74f808..7d1c1295cb6 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -5611,6 +5611,9 @@ abstract class CommonObject if ($this->element == 'contrat' && !empty($conf->global->CONTRACT_ALLOW_EXTERNAL_DOWNLOAD)) { $setsharekey = true; } + if ($this->element == 'fichinter' && !empty($conf->global->FICHINTER_ALLOW_EXTERNAL_DOWNLOAD)) { + $setsharekey = true; + } if ($this->element == 'supplier_proposal' && !empty($conf->global->SUPPLIER_PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD)) { $setsharekey = true; } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 6c278f4764d..e8537b03391 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -7782,6 +7782,9 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, if (is_object($object) && $object->element == 'contrat') { $typeforonlinepayment = 'contract'; } + if (is_object($object) && $object->element == 'fichinter') { + $typeforonlinepayment = 'ficheinter'; + } $url = getOnlinePaymentUrl(0, $typeforonlinepayment, $substitutionarray['__REF__']); $paymenturl = $url; } @@ -7814,6 +7817,11 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, } else { $substitutionarray['__DIRECTDOWNLOAD_URL_CONTRACT__'] = ''; } + if (!empty($conf->global->FICHINTER_ALLOW_EXTERNAL_DOWNLOAD) && is_object($object) && $object->element == 'fichinter') { + $substitutionarray['__DIRECTDOWNLOAD_URL_FICHINTER__'] = $object->getLastMainDocLink($object->element); + } else { + $substitutionarray['__DIRECTDOWNLOAD_URL_FICHINTER__'] = ''; + } if (!empty($conf->global->SUPPLIER_PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD) && is_object($object) && $object->element == 'supplier_proposal') { $substitutionarray['__DIRECTDOWNLOAD_URL_SUPPLIER_PROPOSAL__'] = $object->getLastMainDocLink($object->element); } else { @@ -7832,6 +7840,9 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, if (is_object($object) && $object->element == 'contrat') { $substitutionarray['__URL_CONTRACT__'] = DOL_MAIN_URL_ROOT."/contrat/card.php?id=".$object->id; } + if (is_object($object) && $object->element == 'fichinter') { + $substitutionarray['__URL_FICHINTER__'] = DOL_MAIN_URL_ROOT."/fichinter/card.php?id=".$object->id; + } if (is_object($object) && $object->element == 'supplier_proposal') { $substitutionarray['__URL_SUPPLIER_PROPOSAL__'] = DOL_MAIN_URL_ROOT."/supplier_proposal/card.php?id=".$object->id; } diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index cef3f737c53..ff8492f6d14 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -1713,7 +1713,13 @@ if ($action == 'create') { $linktoelem = $form->showLinkToObjectBlock($object, null, array('fichinter')); $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem); - + //Show direct download link + if ($object->statut != Fichinter::STATUS_DRAFT && !empty($conf->global->FICHINTER_ALLOW_EXTERNAL_DOWNLOAD)) + { + print '
'."\n"; + print showDirectDownloadLink($object).'
'; + } + print '
'; // List of actions on element From 57ca1e9e3ca9f29aa73e051a7fb0e562c34445be Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 20 Oct 2022 12:02:06 +0000 Subject: [PATCH 11/22] Fixing style errors. --- htdocs/fichinter/card.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index ff8492f6d14..384049ab92a 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -1714,12 +1714,11 @@ if ($action == 'create') { $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem); //Show direct download link - if ($object->statut != Fichinter::STATUS_DRAFT && !empty($conf->global->FICHINTER_ALLOW_EXTERNAL_DOWNLOAD)) - { + if ($object->statut != Fichinter::STATUS_DRAFT && !empty($conf->global->FICHINTER_ALLOW_EXTERNAL_DOWNLOAD)) { print '
'."\n"; print showDirectDownloadLink($object).'
'; } - + print '
'; // List of actions on element From 72d163b896faa17bfd6f2130c6e40c2a26ec69d9 Mon Sep 17 00:00:00 2001 From: melina Date: Thu, 20 Oct 2022 16:21:31 +0200 Subject: [PATCH 12/22] Added hidden constant and modified edit on reference --- htdocs/product/card.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 8eac47207cd..8ddef85682a 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1866,7 +1866,13 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; // Ref - print ''; + if (!empty($conf->global->MAIN_PRODUCT_REF_NOT_EDITABLE)) { + print ''; + } + else { + print ''; + } + // Label print ''; From 57e62867387ea540b0bce55e7fca2a6a6508936e Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 20 Oct 2022 16:36:50 +0200 Subject: [PATCH 13/22] FIX value can be a string --- htdocs/core/ajax/constantonoff.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/ajax/constantonoff.php b/htdocs/core/ajax/constantonoff.php index b8beec3111a..fb750d346bd 100644 --- a/htdocs/core/ajax/constantonoff.php +++ b/htdocs/core/ajax/constantonoff.php @@ -49,7 +49,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; $action = GETPOST('action', 'aZ09'); // set or del $name = GETPOST('name', 'alpha'); $entity = GETPOST('entity', 'int'); -$value = ((GETPOST('value', 'int') || GETPOST('value', 'int') == '0') ? GETPOST('value', 'int') : 1); +$value = (GETPOST('value', 'aZ09') != '' ? GETPOST('value', 'aZ09') : ((GETPOST('value', 'int') || GETPOST('value', 'int') == '0') ? GETPOST('value', 'int') : 1)); /* From b048d95cc82243b411a3478680a99d4d52e7312f Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 20 Oct 2022 16:09:26 +0000 Subject: [PATCH 14/22] Fixing style errors. --- htdocs/product/card.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 8ddef85682a..e8edb5d1d8b 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1866,13 +1866,12 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print '
'.$langs->trans("Ref").'
'.$langs->trans("Ref").'
'.$langs->trans("Ref").'
'.$langs->trans("Label").'
'; // Ref - if (!empty($conf->global->MAIN_PRODUCT_REF_NOT_EDITABLE)) { + if (!empty($conf->global->MAIN_PRODUCT_REF_NOT_EDITABLE)) { print ''; - } - else { + } else { print ''; } - + // Label print ''; From 8b61fd5c1a1ee5c6464c426c1a1644f4b93c23ad Mon Sep 17 00:00:00 2001 From: Anthony Berton Date: Fri, 21 Oct 2022 00:31:31 +0200 Subject: [PATCH 15/22] Lang --- htdocs/langs/en_US/cron.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/langs/en_US/cron.lang b/htdocs/langs/en_US/cron.lang index 9705f8823b0..021de63de05 100644 --- a/htdocs/langs/en_US/cron.lang +++ b/htdocs/langs/en_US/cron.lang @@ -84,6 +84,7 @@ MakeLocalDatabaseDumpShort=Local database backup MakeLocalDatabaseDump=Create a local database dump. Parameters are: compression ('gz' or 'bz' or 'none'), backup type ('mysql', 'pgsql', 'auto'), 1, 'auto' or filename to build, number of backup files to keep MakeSendLocalDatabaseDumpShort=Send local database backup MakeSendLocalDatabaseDump=Send local database backup by email. Parameters are: to, from, subject, message, filename (Name of file sent), filter ('sql' for backup of database only) +BackupIsTooLargeSend=Sorry, last backup file is too large to be send by email WarningCronDelayed=Attention, for performance purpose, whatever is next date of execution of enabled jobs, your jobs may be delayed to a maximum of %s hours, before being run. DATAPOLICYJob=Data cleaner and anonymizer JobXMustBeEnabled=Job %s must be enabled From 0e5f01dd13fec2a74c2905c457132ad99dc8a80a Mon Sep 17 00:00:00 2001 From: Anthony Berton Date: Fri, 21 Oct 2022 00:33:04 +0200 Subject: [PATCH 16/22] Add param --- htdocs/core/class/utils.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php index 9a330c7aba5..daaebd09ecf 100644 --- a/htdocs/core/class/utils.class.php +++ b/htdocs/core/class/utils.class.php @@ -1237,9 +1237,10 @@ class Utils * @param string $message Message * @param string $filename List of files to attach (full path of filename on file system) * @param string $filter Filter file send + * @param string $sizelimit Limit size to send file * @return int 0 if OK, < 0 if KO (this function is used also by cron so only 0 is OK) */ - public function sendBackup($sendto = '', $from = '', $subject = '', $message = '', $filename = '', $filter = '') + public function sendBackup($sendto = '', $from = '', $subject = '', $message = '', $filename = '', $filter = '', $sizelimit = 100000000) { global $conf, $langs; From 1db5ab30a944aa41718a1540234a0c8a48960234 Mon Sep 17 00:00:00 2001 From: Anthony Berton Date: Fri, 21 Oct 2022 00:34:52 +0200 Subject: [PATCH 17/22] Link download file in mail --- htdocs/core/class/utils.class.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php index daaebd09ecf..1d3df8191a6 100644 --- a/htdocs/core/class/utils.class.php +++ b/htdocs/core/class/utils.class.php @@ -1298,9 +1298,13 @@ class Utils } if ($filepath) { - if ($filesize > 100000000) { - $output = 'Sorry, last backup file is too large to be send by email'; - $error++; + if ($filesize > $sizelimit) { + $message .= '
'.$langs->trans("BackupIsTooLargeSend"); + $documenturl = $dolibarr_main_url_root.'/document.php?modulepart=systemtools&atachement=1&file=backup/'.urlencode($filename[0]); + $message .= '
Lien de téléchargement'; + $filepath = ''; + $mimetype = ''; + $filename = ''; } } else { $output = 'No backup file found'; From 2fabbf846a8553eb68ade5c0830c5717c38fdcd5 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 21 Oct 2022 06:35:40 +0200 Subject: [PATCH 18/22] FIX more simple --- htdocs/core/ajax/constantonoff.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/ajax/constantonoff.php b/htdocs/core/ajax/constantonoff.php index fb750d346bd..405424229ab 100644 --- a/htdocs/core/ajax/constantonoff.php +++ b/htdocs/core/ajax/constantonoff.php @@ -49,7 +49,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; $action = GETPOST('action', 'aZ09'); // set or del $name = GETPOST('name', 'alpha'); $entity = GETPOST('entity', 'int'); -$value = (GETPOST('value', 'aZ09') != '' ? GETPOST('value', 'aZ09') : ((GETPOST('value', 'int') || GETPOST('value', 'int') == '0') ? GETPOST('value', 'int') : 1)); +$value = (GETPOST('value', 'aZ09') != '' ? GETPOST('value', 'aZ09') : 1); /* From a96a623c0ee9af7b074d9a1cb842d52424784720 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 21 Oct 2022 06:48:33 +0200 Subject: [PATCH 19/22] FIX remove unused code for avoid error --- htdocs/core/class/translate.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index 5bfdbc7e0f1..394f328ccdf 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -721,9 +721,9 @@ class Translate return $str; } else { - if ($key[0] == '$') { + /*if ($key[0] == '$') { return dol_eval($key, 1, 1, '1'); - } + }*/ return $this->getTradFromKey($key); } } From 4a3a72245f00b6b9a0f6eba2049f4adc74f2b5ef Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Wed, 19 Oct 2022 12:16:44 +0200 Subject: [PATCH 20/22] Use shared entity on supplier order create --- htdocs/fourn/class/fournisseur.commande.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 9e59dbceda6..c535ad14b72 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -1398,7 +1398,7 @@ class CommandeFournisseur extends CommonOrder $sql .= ", '".$this->db->escape($this->ref_supplier)."'"; $sql .= ", '".$this->db->escape($this->note_private)."'"; $sql .= ", '".$this->db->escape($this->note_public)."'"; - $sql .= ", ".((int) $conf->entity); + $sql .= ", ".setEntity($this); $sql .= ", ".((int) $this->socid); $sql .= ", ".($this->fk_project > 0 ? ((int) $this->fk_project) : "null"); $sql .= ", '".$this->db->idate($date)."'"; From cd9984cd3e3cc380fdb69a935b397f1f12d6b20f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 24 Oct 2022 19:19:41 +0200 Subject: [PATCH 21/22] Update card.php --- htdocs/product/card.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index e8edb5d1d8b..7c51da5d02a 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1866,10 +1866,10 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print '
'.$langs->trans("Ref").'
'.$langs->trans("Ref").'
'.$langs->trans("Label").'
'; // Ref - if (!empty($conf->global->MAIN_PRODUCT_REF_NOT_EDITABLE)) { - print ''; - } else { + if (empty($conf->global->MAIN_PRODUCT_REF_NOT_EDITABLE)) { print ''; + } else { + print ''; } From 4eeb73276a1f06300ab193deacaf29926b2aeefd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 24 Oct 2022 19:38:38 +0200 Subject: [PATCH 22/22] Close #22650 --- htdocs/install/mysql/migration/16.0.0-17.0.0.sql | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/install/mysql/migration/16.0.0-17.0.0.sql b/htdocs/install/mysql/migration/16.0.0-17.0.0.sql index b10aa69767b..d98840379a9 100644 --- a/htdocs/install/mysql/migration/16.0.0-17.0.0.sql +++ b/htdocs/install/mysql/migration/16.0.0-17.0.0.sql @@ -197,6 +197,12 @@ ALTER TABLE llx_societe_remise_except ADD COLUMN multicurrency_tx double(24,8) N ALTER TABLE llx_hrm_evaluationdet CHANGE COLUMN rank rankorder integer; + +-- Rename const to hide public and private notes (fix allow notes const was used to hide) +UPDATE llx_const SET name = 'MAIN_LIST_HIDE_PUBLIC_NOTES' WHERE name = 'MAIN_LIST_ALLOW_PUBLIC_NOTES'; +UPDATE llx_const SET name = 'MAIN_LIST_HIDE_PRIVATE_NOTES' WHERE name = 'MAIN_LIST_ALLOW_PRIVATE_NOTES'; + + ALTER TABLE llx_projet ADD COLUMN date_start_event datetime; ALTER TABLE llx_projet ADD COLUMN date_end_event datetime; ALTER TABLE llx_projet ADD COLUMN location varchar(255);
'.$langs->trans("Ref").'
'.$langs->trans("Ref").'
'.$langs->trans("Ref").'