From 9d582a53cac663fca6f4a1643ca59544cb613b7e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 23 Nov 2018 11:28:28 +0100 Subject: [PATCH 001/462] Fix compatibility with new mysql versions --- htdocs/install/mysql/tables/llx_product.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/tables/llx_product.sql b/htdocs/install/mysql/tables/llx_product.sql index 22006040327..edfb6567726 100755 --- a/htdocs/install/mysql/tables/llx_product.sql +++ b/htdocs/install/mysql/tables/llx_product.sql @@ -31,7 +31,7 @@ create table llx_product datec datetime, tms timestamp, - virtual tinyint DEFAULT 0 NOT NULL, -- Not used. Used by external modules. Value 0 for physical product, 1 for virtual product + `virtual` tinyint DEFAULT 0 NOT NULL, -- Not used. Used by external modules. Value 0 for physical product, 1 for virtual product fk_parent integer DEFAULT 0, -- Not used. Used by external modules. Virtual product id label varchar(255) NOT NULL, From 5c1a84746cbb5c8045ef62bbec132b3c5ea11db2 Mon Sep 17 00:00:00 2001 From: Lenin Rivas <53640168+leninrivas@users.noreply.github.com> Date: Mon, 12 Aug 2019 15:21:41 -0500 Subject: [PATCH 002/462] Add Linked objects Fichinter Ref. in PDF formats --- htdocs/core/lib/pdf.lib.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 56ca215e118..22bccb4462e 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -10,6 +10,7 @@ * Copyright (C) 2014 Cedric GROSS * Copyright (C) 2014 Teddy Andreotti <125155@supinfo.com> * Copyright (C) 2015-2016 Marcos García + * Copyright (C) 2019 Lenin Rivas * * 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 @@ -2129,6 +2130,17 @@ function pdf_getLinkedObjects($object, $outputlangs) $linkedobjects[$objecttype]['date_value'] = dol_print_date($elementobject->date_contrat, 'day', '', $outputlangs); } } + else if ($objecttype == 'fichinter') + { + $outputlangs->load('interventions'); + foreach($objects as $elementobject) + { + $linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("InterRef"); + $linkedobjects[$objecttype]['ref_value'] = $outputlangs->transnoentities($elementobject->ref); + $linkedobjects[$objecttype]['date_title'] = $outputlangs->transnoentities("InterDate"); + $linkedobjects[$objecttype]['date_value'] = dol_print_date($elementobject->datec,'day','',$outputlangs); + } + } elseif ($objecttype == 'shipping') { $outputlangs->loadLangs(array("orders", "sendings")); From 48419da7698617d50b69ebcdd56510f5850be975 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 10 Sep 2019 14:58:55 +0200 Subject: [PATCH 003/462] FIX new invoice with generic thirdparty in takepos by default, new invoice should always create with default thirdparty and avoid errors : creating new invoice with last customer and forget to change it... --- htdocs/takepos/invoice.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 6ae5429d062..accc4befe82 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -280,8 +280,10 @@ if ($action == "delete") { $resql1 = $db->query($sql); $sql = "DELETE FROM " . MAIN_DB_PREFIX . "facturedet where fk_facture = ".$placeid; $resql2 = $db->query($sql); + $sql="UPDATE ".MAIN_DB_PREFIX."facture set fk_soc=".$conf->global->{'CASHDESK_ID_THIRDPARTY'.$_SESSION["takeposterminal"]}." where ref='(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")'"; + $resql3 = $db->query($sql); - if ($resql1 && $resql2) + if ($resql1 && $resql2 && $resql3) { $db->commit(); } From 95417d4c86129b1a55283d097ebece7857b87265 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Tue, 10 Sep 2019 16:24:04 +0200 Subject: [PATCH 004/462] allow standalone credit note even if no invoice --- htdocs/compta/facture/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index d81467d64e4..3d363b60bb2 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -3047,7 +3047,7 @@ if ($action == 'create') { print '
'; $tmp='global->INVOICE_CREDIT_NOTE_STANDALONE) ) $tmp.=' disabled'; $tmp.= '> '; // Show credit note options only if we checked credit note print '\n',1,'2019-08-15 00:03:30',NULL,'2019-08-14 22:18:11',NULL,NULL,'page','en_US',NULL,'','',NULL,''),(2,2,'blog-our-company-is-now-on-dolibarr','','Our company is now on Dolibarr ERP CRM','Our company has moved on Dolibarr ERP CRM. This is an important step in improving all of our services.','','\n\n \n \n
\n
\n
\n
\n
\n
\n
\n
\n
title; ?>\n
\n
\n
\n
\n
\n
\n
\n
\n\n
\n


\n Like several thousands of companies, our company (name ?>) has moved all its information system to Dolibarr ERP CRM. More than 20 applications have been replaced by only one, easier to use and fully integrated.\n This is an important step in improving all of our services.\n \n


\n \n
\n \n

\n
Screenshot of our new Open Source solution
\n
\n \n \n \n





\n
\n\n\n\n\n\n',1,'2019-08-15 00:03:30',NULL,'2019-08-14 22:23:06',NULL,NULL,'blogpost','en_US',NULL,'','',NULL,'image/template/background_dolibarr.jpg'),(3,2,'blog-our-new-web-site-has-been-launched','','Our new web site has been launched','Our new website, based on Dolibarr CMS, has been launched. Modern and directly integrated with the internal management tools of the company, many new online services for our customers will be able to see the day...','','\n\n
\n
\n
\n
\n
\n
\n
\n
\n
title; ?>\n
\n
\n
\n
\n
\n
\n
\n
\n\n
\n





\n\n\n Our new website, based on Dolibarr CMS, has been launched.
\n Now it is modern and directly integrated with the internal management tools of the company. Many new online services will be available for our customers...\n\n \n\n





\n
\n\n\n\n\n\n\n',1,'2019-08-15 00:03:30',NULL,'2019-08-14 22:23:16',NULL,NULL,'blogpost','en_US',NULL,'','',NULL,'image/template/background_rough-horn.jpg'),(4,2,'careers','','Careers','Our job opportunities','career','
\n\n \n\n
\n
\n
\n
\n
\n
\n
\n
\n
Job opportunities\n
\n
\n
\n
\n
\n
\n
\n
\n\n\n
\n
\n
\n
\n
\nThere is no job opportunities for the moment...
\n
\n
\n
\n
\n
\n
\n\n\n

\n\n \n\n
\n \n\n',1,'2019-08-15 00:03:30',NULL,'2019-08-14 22:24:41',NULL,NULL,'page','en_US',NULL,'','',NULL,''),(5,2,'carriere','','Carrière','Nos opportunités professionnelles','career','
\n\n \n\n
\n
\n
\n
\n
\n
\n
\n
\n
Offres d\'emploi\n
\n
\n
\n
\n
\n
\n
\n
\n\n\n
\n
\n
\n
\n
\nNous n\'avons pas d\'offres d\'emploi ouvertes en ce moment...
\n
\n
\n
\n
\n
\n
\n\n\n

\n\n \n\n
\n \n\n',1,'2019-08-15 00:03:30',NULL,'2019-08-14 22:24:57',NULL,NULL,'page','fr_FR',NULL,'','',NULL,''),(6,2,'clients-testimonials','','Clients Testimonials','Client Testimonials','testimonials, use cases, success story','
\n\n \n\n
\n
\n
\n
\n
\n
\n
\n
\n
Testimonials\n
\n
\n
\n
\n
\n
\n
\n
\n\n\n
\n

\n

What they say about us

\n



\n Send us your testimonial (by email to email; ?>\">email; ?>)\n



\n

\n
\n\n

\n\n \n\n
\n \n',1,'2019-08-15 00:03:30',NULL,'2019-08-14 22:25:18',NULL,NULL,'page','en_US',NULL,'','',NULL,''),(7,2,'contact','','Contact','Privacy Policies','Contact','
\n\n \n\n
\n
\n
\n
\n
\n
\n
\n
\n
Contact\n
\n
\n
\n
\n
\n
\n
\n
\n\n\n
\n
\n

Contact us:



\n email ?>
\n getFullAddress() ?>
\n
\n
\n\n\n \n
\n
\n \n
\n\n


\n\n \n\n
\n \n',1,'2019-08-15 00:03:30',NULL,'2019-08-14 22:25:38',NULL,NULL,'page','en_US',NULL,'','',NULL,''),(8,2,'faq','','FAQ','Frequently Asked Questions','faq','
\n\n \n\n
\n
\n
\n
\n
\n
\n
\n
\n
FAQs\n
\n
\n
\n
\n
\n
\n
\n
\n\n\n
\n
\n


Frequently Asked Questions

\n
\n
\n
\n

How can I contact you ?


\nYou can contact us by using this page.\n
\n
\n
\n

What is your privacy policy ?


\nYou may find information about our privacy policy on this page.\n\n\n



\n\n
\n
\n\n\n

\n\n \n\n
\n \n\n',1,'2019-08-15 00:03:30',NULL,'2019-08-14 22:25:51',NULL,NULL,'page','en_US',NULL,'','',NULL,''),(9,2,'footer','','Footer','Footer','','\n
\n\n \n \n \n\n
\n\n\n\n',1,'2019-08-15 00:03:30',NULL,'2019-08-14 22:28:20',NULL,NULL,'other','en_US',NULL,'','',NULL,''),(10,2,'header','','Header and Top Menu','Header with menu','','\n\n\n\n\n
\n
\n
\n \n \n
\n
\n
\n',1,'2019-08-15 00:03:30',NULL,'2019-08-14 22:10:17',NULL,NULL,'other','en_US',NULL,'','',NULL,''),(11,2,'home','','Home','Welcome','','
\n \n \n \n \n \n
\n
\n
\n
\n
\n
\n
\n
\n
Boost your business\n
\n
\n

We provide powerful solutions for all businesses

\n
\n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
 Best prices on the market \n
\n
\n

Our optimized processes allows us to provide you very competitive prices

\n
\n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n\n\n\n \n
\n
\n
\n
\n
\n
\n \n
\n
\n

Our sales representative are also technicians.

\n
\n
\n
\n
\n
\n \n
\n

Take a look at our offers...

\n
\n
\n
\n
\n
\n \n
\n

Our customer-supplier relationship is very appreciated by our customers

\n
\n
\n
\n
\n
\n
\n
\n \n
\n
\n

We continue to follow and assist you after the sale. Contact us at any time.

\n
\n
\n
\n
\n
\n\n\n \n
\n
\n

Looking for

\n

a high quality service?

\n

With a lot of experience, hiring us is a security for your business!

\n
\n
\n
11
\n
Years of Experience
\n
\n
\n
\n query($sql); $obj = $db->fetch_object($resql); print $obj->nb; ?>\n
\n
Experts
\n
\n
\n
\n query($sql); $obj = $db->fetch_object($resql); print $obj->nb; ?>\n
\n
Trusted Clients
\n
\n
\n
\n \n
\n
\n
\n\n \n \n \n
\n
\n
\n \n
\n \n
\n \n
\n

our plans

\n\n \n
\n \n
\n
\n
\n
FREE
\n
The best choice for personal use
\n
The service 1 for free
\n
\n 0/ month\n
\n
\n Available features are : \n
    \n
  • \n \n Service 1 \n
  • \n
\n
\n
\n Subcribe\n
\n
\n
\n \n \n \n
\n
\n
\n
STARTER
\n
For small companiess
\n
The service 1 and product 1 at low price
\n
\n 29/ month\n
\n
\n Available features are : \n
    \n
  • \n \n Service 1\n
  • \n
  • \n \n Product 1\n
  • \n
\n
\n
\n Subscribe\n
\n
\n
\n \n \n \n
\n
\n
\n
PREMIUM
\n
For large companies
\n
The full option package for a one shot price\n
\n
\n 2499\n
\n
\n Available features are :\n
    \n
  • \n \n Service 1
  • \n
  • \n \n Service 2
  • \n
  • \n \n Product 1
  • \n
\n
\n
\n Buy\n
\n
\n
\n \n
\n \n
\n \n
\n \n
\n \n \n
\n
\n
\n \n \n \n
\n
\n

our team

\n
\n
\n \n
\n
\n
\n
\n\n\n \n
\n
\n
\n
\n
\n

Request a callback

\n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n
\n
\n
\n
\n
\n \n \n \n
\n
\n
\n
\n
\n

successful cases

\n
\n
\n
\n
\n
\"\"\n
\n
\n
\n
\"\"\n
\n
\n
\n
\"\"\n
\n
\n
\n
\"\"\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n Albert Einstein\n
\n
Scientist, www.emc2.org
\n
\n
\n
\n
\n
-20%
\n
Expenses
\n
\n
\n
\n
\n
\n
\n \n They did everything, with almost no time or effort for me. The best part was that I could trust their team to represent our company professionally with our clients.\n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n Pierre Curie\n
\n
CEO “Cyclonic”
\n
\n
\n
\n
\n
-30%
\n
Expenses
\n
\n
\n
\n
\n
\n
\n \n Their course gave me the confidence to implement new techniques in my work. I learn “how” to write – “what” and “why” also became much clearer.\n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n Marie Curie\n
\n
CTO \"Cyclonic\"
\n
\n
\n
\n
\n
+22%
\n
Turnover
\n
\n
\n
\n
\n
\n
\n \n We were skeptical to work with a consultant to optimize our sales emails, but they were highly recommended by many other startups we knew. They helped us to reach our objective of 20% turnover increase, in 4 monthes.\n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n John Doe\n
\n
Sale representative
\n
\n
\n
\n
\n
+40%
\n
Quotes
\n
\n
\n
\n
\n
\n
\n \n Their work on our website and Internet marketing has made a significant different to our business. We’ve seen a +40% increase in quote requests from our website.\n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n \n\n \n
\n
\n

Latest News

\n
\n fetchAll($website->id, \'DESC\', \'date_creation\', $MAXNEWS, 0, array(\'type_container\'=>\'blogpost\', \'lang\'=>\'en_US\'));\n foreach($arrayofblogs as $blog)\n {\n $fuser->fetch($blog->fk_user_creat);\n ?>\n \n \n \n
\n
\n
\n\n\n \n\n\n
\n',1,'2019-08-15 00:03:30',NULL,'2019-08-14 22:29:04',NULL,NULL,'page','en_US',NULL,'','',NULL,''),(12,2,'our-team','','Our team','Our team','team','
\n\n \n\n
\n
\n
\n
\n
\n
\n
\n
\n
Our team\n
\n
\n
\n
\n
\n
\n
\n
\n\n\n
\n

\n

The crew...




\n query($sql);\n if (! $resql) dol_print_error($db);\n while ($obj = $db->fetch_object($resql))\n {\n $arrayofusers[]=$obj->rowid;\n }\n \n print \'
\';\n foreach($arrayofusers as $id)\n {\n $fuser->fetch($id);\n\n print \'
\';\n print \'
\';\n print \'
\';\n if ($fuser->photo) print Form::showphoto(\'userphoto\', $fuser, 100, 0, 0, \'photowithmargin\', \'\', 0);\n //print \'photo.\'\" width=\"129\" height=\"129\" alt=\"\">\';\n else print \'\"\"\';\n print \'
\';\n print \'
\';\n print \'
\'.$fuser->firstname.\'
\';\n print \'
    \';\n //print \'
  • September 24, 2018
  • \';\n if ($fuser->job) print \'
  • \'.$fuser->job.\'
  • \';\n else print \'
  • \';\n print \'
\';\n print \'
\';\n print \'
\';\n print \'
\';\n }\n print \'
\';\n\n ?>\n
\n
\n\n

\n\n \n\n
\n \n',1,'2019-08-15 00:03:30',NULL,'2019-08-14 22:29:25',NULL,NULL,'page','en_US',NULL,'','',NULL,''),(13,2,'partners','','Partners','Partners','partners','
\n\n \n\n
\n
\n
\n
\n
\n
\n
\n
\n
Partners\n
\n
\n
\n
\n
\n
\n
\n
\n\n\n
\n
\n

Our partners...

\n
\n
\n
\n
\n
\n \n
\n
\n
\n
\n \n
\n
\n
\n
\n
\n \n
\n
\n
\n
\n
\n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n\n\n

\n\n \n\n
\n \n\n',1,'2019-08-15 00:03:30',NULL,'2019-08-14 22:29:51',NULL,NULL,'page','en_US',NULL,'','',NULL,''),(14,2,'pricing','','Pricing','All the prices of our offers','pricing','
\n\n \n\n
\n
\n
\n
\n
\n
\n
\n
\n
Our plans\n
\n
\n
\n
\n
\n
\n
\n
\n\n\n\n\n \n
\n
\n
\n \n
\n \n
\n \n
\n\n \n
\n \n
\n
\n
\n
FREE
\n
The best choice for personal use
\n
The service 1 for free
\n
\n 0/ month\n
\n
\n Available features are : \n
    \n
  • \n \n Service 1 \n
  • \n
\n
\n
\n Subcribe\n
\n
\n
\n \n \n \n
\n
\n
\n
STARTER
\n
For small companiess
\n
The service 1 and product 1 at low price
\n
\n 29/ month\n
\n
\n Available features are : \n
    \n
  • \n \n Service 1\n
  • \n
  • \n \n Product 1\n
  • \n
\n
\n
\n Subscribe\n
\n
\n
\n \n \n \n
\n
\n
\n
PREMIUM
\n
For large companies
\n
The full option package for a one shot price\n
\n
\n 2499\n
\n
\n Available features are :\n
    \n
  • \n \n Service 1
  • \n
  • \n \n Service 2
  • \n
  • \n \n Product 1
  • \n
\n
\n
\n Buy\n
\n
\n
\n \n
\n \n
\n \n
\n \n
\n \n \n
\n
\n
\n \n \n \n

\n\n \n\n
\n \n',1,'2019-08-15 00:03:30',NULL,'2019-08-14 22:26:54',NULL,NULL,'page','en_US',NULL,'','',NULL,''),(15,2,'privacy-policies','','Privacy Policies','Privacy Policies','Privacy policies, GDPR','
\n \n \n \n\n\n
\n
\n
\n
\n
\n
\n
\n
\n
Privacy Policy\n
\n
\n
\n
\n
\n
\n
\n
\n\n


\n\n
\n
\n

Information collected and used


\n

* Your customer information (email, phone, business name, first and last name of contact, address, postal code, country and VAT number) are stored when you become a customer. This information allows us to bill you. \n

* If you paid using our online service, we also store the last 4 digits of your card. The full details of your credit card is stored by our payment provider Stripe (the world leader in online payment).

\n

* You have the option to request the deletion of your data and the above information at any time (except data required y fiscal tracking rules, like your invoices).

\n

* The Privacy Policies and GDPR referral contact for our services is: global->MAIN_INFO_GDPR; ?>

\n


\n

Data Storage and Backups


\n

* The storage of collected data (see \'Information collected and used\') is done in a database.

\n

* We made one backup every week. Only 4 weeks are kept.

\n


\n

Subcontractor


\n

* Our services relies on the following subcontractors and service:
\n** The host of computer servers, which is ABC company. These servers are hosted in US. No customer information is communicated to this subcontractor who only provides the hardware and network layer, the installation and operation being carried out by us directly.
\n** The online payment service Stripe, which is used, to ensure regular payment of subscription or your invoices paid online.

\n


\n

Software Protection


\n

* Our services runs on Linux Ubuntu systems and software. They benefit from regular security updates when the operating system editor (Ubuntu Canonical) publishes them.

\n

* Our services are accessible in HTTPS (HTTP encrypted) only, encrypted with SHA256 certificates.

\n

* Our technical platform are protected by various solutions.

\n


\n

Data theft


\n

* In case of suspicion of a theft of the data we have collected (see first point \'Information collected and used\'), customers will be informed by email, at email corresponding to their customer account

\n

 

\n
\n
\n\n\n \n \n \n
\n \n',1,'2019-08-15 00:03:30',NULL,'2019-08-14 22:27:09',NULL,NULL,'page','en_US',NULL,'','',NULL,''),(16,2,'product-p','','Product P','Product P','','
\n\n \n\n
\n
\n
\n
\n
\n
\n
\n
\n
Product P\n
\n
\n
\n
\n
\n
\n
\n
\n\n\n
\n
\n
\n
\n
\nThis is a description page of our product P...
\n
\n
\n
\n
\n
\n
\n\n\n

\n\n \n\n
\n \n\n',1,'2019-08-15 00:03:30',NULL,'2019-08-14 22:27:20',NULL,NULL,'page','en_US',NULL,'','',NULL,''),(17,2,'search','','Search Page','Search Page','','
\n\n \n\n
\n
\n
\n
\n
\n
\n
\n
\n
Search\n
\n
\n
\n
\n
\n
\n
\n
\n\n


\n\n
\n \n
\n
\n
\n \">\n
\n
\n \n
\n
\n
\n \n ref.\'.php\">\'.$websitepagefound->title.\' - \'.$websitepagefound->description.\'
\';\n }\n }\n else\n {\n print $listofpages[\'message\'];\n }\n }\n }\n else\n {\n print $weblang->trans(\"FeatureNotYetAvailable\");\n }\n ?>\n \n





\n\n\n \n\n
\n',1,'2019-08-15 00:03:30',NULL,'2019-08-14 22:27:33',NULL,NULL,'page','fr_FR',NULL,'','',NULL,''),(18,2,'service-s','','Service S','Service S','','
\n\n \n\n
\n
\n
\n
\n
\n
\n
\n
\n
Service S\n
\n
\n
\n
\n
\n
\n
\n
\n\n\n
\n
\n
\n
\n
\nThis is a description page of our service S...
\n
\n
\n
\n
\n
\n
\n\n\n

\n\n \n\n
\n',1,'2019-08-15 00:03:30',NULL,'2019-08-14 22:27:45',NULL,NULL,'page','en_US',NULL,'','',NULL,''),(19,2,'test','','test','Page test','test','Test\n',1,'2019-08-15 00:03:30',NULL,'2019-08-14 22:03:30',NULL,NULL,'page','en_US',NULL,'','',NULL,''),(20,3,'credits','','Credits','Credits and legal notices','',' \n \n
\n\n \n
\n

Mentions légales

\n

Curriculum Vitae

\n
\n\n \n \n\n \n
\n\n \n
\n\n

\n \nThis site is edited by name; ?>\n\n \n

\n\n
\n\n
\n\n \n \n\n
\n\n',1,'2019-08-15 16:39:56',NULL,'2019-08-16 03:55:59',NULL,NULL,'page','en_US',NULL,'','',NULL,''),(21,3,'footer','','Footer','','',' \n
\n
\n

Aliquam sed mauris

\n

Sed lorem ipsum dolor sit amet et nullam consequat feugiat consequat magna adipiscing tempus etiam dolore veroeros. eget dapibus mauris. Cras aliquet, nisl ut viverra sollicitudin, ligula erat egestas velit, vitae tincidunt odio.

\n \n
\n
\n

Etiam feugiat

\n
\n
Address
\n
getFullAddress(1, \'
\'); ?>
\n
Phone
\n
phone; ?>
\n
Email
\n
email; ?>\">email; ?>
\n
\n \n
\n
© Untitled. Design: HTML5 UP adapted for Dolibarr by NLTechno.
\n
\n\n\n\n',1,'2019-08-15 16:42:44',NULL,'2019-08-29 13:25:37',NULL,NULL,'page','fr_FR',NULL,'','',NULL,''),(22,3,'generic','','Generic page','Generic page or my personal Blog','My generic page',' \n\n
\n\n \n
\n

Generic

\n

Ipsum dolor sit amet nullam

\n
\n\n \n \n\n \n
\n\n \n
\n \"\"\n

Magna feugiat lorem

\n

Donec eget ex magna. Interdum et malesuada fames ac ante ipsum primis in faucibus. Pellentesque venenatis dolor imperdiet dolor mattis sagittis. Praesent rutrum sem diam, vitae egestas enim auctor sit amet. Pellentesque leo mauris, consectetur id ipsum sit amet, fergiat. Pellentesque in mi eu massa lacinia malesuada et a elit. Donec urna ex, lacinia in purus ac, pretium pulvinar mauris. Curabitur sapien risus, commodo eget turpis at, elementum convallis fames ac ante ipsum primis in faucibus.

\n

Pellentesque venenatis dolor imperdiet dolor mattis sagittis. Praesent rutrum sem diam, vitae egestas enim auctor sit amet.

\n

Tempus veroeros

\n

Cep risus aliquam gravida cep ut lacus amet. Adipiscing faucibus nunc placerat. Tempus adipiscing turpis non blandit accumsan eget lacinia nunc integer interdum amet aliquam ut orci non col ut ut praesent.

\n
\n\n \n
\n

Latest Blog posts

\n
\n loadLangs(array(\"main\",\"website\"));\n $websitepage = new WebsitePage($db);\n $fuser = new User($db);\n $arrayofblogs = $websitepage->fetchAll($website->id, \'DESC\', \'date_creation\', 5, 0, array(\'type_container\'=>\'blogpost\', \'keywords\'=>$keyword));\n if (is_numeric($arrayofblogs) && $arrayofblogs < 0)\n {\n print \'
\'.$weblangs->trans($websitepage->error).\'
\';\n }\n elseif (is_array($arrayofblogs) && ! empty($arrayofblogs))\n {\n foreach($arrayofblogs as $blog)\n {\n print \'\';\n }\n }\n else\n {\n print \'
\';\n print \'
\';\n print $weblangs->trans(\"NoArticlesFoundForTheKeyword\", $keyword);\n print \'
\';\n print \'
\';\n \n }\n ?>\n
\n
\n\n
\n\n\n\n \n \n \n \n
\n\n',1,'2019-08-15 00:03:43',NULL,'2019-08-17 16:19:49',NULL,NULL,'page','en_US',NULL,'','',NULL,''),(23,3,'home','','My personal blog','Home page or my personal Blog','My personal blog','\n
\n\n \n
\n \"\"\n

David Doe

\n

Welcome on my website
\n

\n
\n\n \n \n\n \n
\n\n \n
\n
\n
\n
\n

Ipsum sed adipiscing

\n
\n

Sed lorem ipsum dolor sit amet nullam consequat feugiat consequat magna\n adipiscing magna etiam amet veroeros. Lorem ipsum dolor tempus sit cursus.\n Tempus nisl et nullam lorem ipsum dolor sit amet aliquam.

\n \n
\n \"\"\n
\n
\n\n \n
\n
\n

Magna veroeros

\n
\n
    \n
  • \n \n

    Ipsum consequat

    \n

    Sed lorem amet ipsum dolor et amet nullam consequat a feugiat consequat tempus veroeros sed consequat.

    \n
  • \n
  • \n \n

    Amed sed feugiat

    \n

    Sed lorem amet ipsum dolor et amet nullam consequat a feugiat consequat tempus veroeros sed consequat.

    \n
  • \n
  • \n \n

    Dolor nullam

    \n

    Sed lorem amet ipsum dolor et amet nullam consequat a feugiat consequat tempus veroeros sed consequat.

    \n
  • \n
\n \n
\n\n \n
\n
\n

Ipsum consequat

\n

Donec imperdiet consequat consequat. Suspendisse feugiat congue
\n posuere. Nulla massa urna, fermentum eget quam aliquet.

\n
\n
    \n
  • \n \n 5,120 Etiam\n
  • \n
  • \n \n 8,192 Magna\n
  • \n
  • \n \n 2,048 Tempus\n
  • \n
  • \n \n 4,096 Aliquam\n
  • \n
  • \n \n 1,024 Nullam\n
  • \n
\n

Nam elementum nisl et mi a commodo porttitor. Morbi sit amet nisl eu arcu faucibus hendrerit vel a risus. Nam a orci mi, elementum ac arcu sit amet, fermentum pellentesque et purus. Integer maximus varius lorem, sed convallis diam accumsan sed. Etiam porttitor placerat sapien, sed eleifend a enim pulvinar faucibus semper quis ut arcu. Ut non nisl a mollis est efficitur vestibulum. Integer eget purus nec nulla mattis et accumsan ut magna libero. Morbi auctor iaculis porttitor. Sed ut magna ac risus et hendrerit scelerisque. Praesent eleifend lacus in lectus aliquam porta. Cras eu ornare dui curabitur lacinia.

\n \n
\n\n \n
\n
\n

Congue imperdiet

\n

Donec imperdiet consequat consequat. Suspendisse feugiat congue
\n posuere. Nulla massa urna, fermentum eget quam aliquet.

\n
\n \n
\n\n
\n\n \n\n
\n\n',1,'2019-08-15 00:03:43',NULL,'2019-08-29 13:32:53',NULL,NULL,'page','en_US',NULL,'','',NULL,''),(24,3,'menu','','Menu','Menu common to all pages','','\n\n \n',1,'2019-08-15 00:03:43',NULL,'2019-08-29 13:33:08',NULL,NULL,'other','fr_FR',NULL,'','',NULL,''),(25,3,'this-is-a-blog-post','','This is a Blog post','This is a full meta description of the article','blog','\n
\n This is a blog post article...\n
\n',1,'2019-08-17 17:18:45',NULL,'2019-08-17 16:26:25',NULL,NULL,'blogpost','fr_FR',NULL,'','',NULL,''); /*!40000 ALTER TABLE `llx_website_page` ENABLE KEYS */; UNLOCK TABLES; @@ -12320,4 +12324,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2019-09-26 14:36:09 +-- Dump completed on 2019-10-08 21:05:17 From 9f4aadae18e05183e8f267acb006207de90927b9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 9 Oct 2019 02:05:20 +0200 Subject: [PATCH 142/462] Missing Nature, Duration and Type fields in export of products --- htdocs/core/modules/modProduct.class.php | 18 ++++++++++++------ htdocs/core/modules/modService.class.php | 19 +++++++++++++------ 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/htdocs/core/modules/modProduct.class.php b/htdocs/core/modules/modProduct.class.php index 001c7759c67..2b41a76ea45 100644 --- a/htdocs/core/modules/modProduct.class.php +++ b/htdocs/core/modules/modProduct.class.php @@ -176,9 +176,11 @@ class modProduct extends DolibarrModules 'p.accountancy_code_sell_export'=>"ProductAccountancySellExportCode", 'p.accountancy_code_buy'=>"ProductAccountancyBuyCode", 'p.note'=>"NotePrivate",'p.note_public'=>'NotePublic', 'p.weight'=>"Weight",'p.length'=>"Length",'p.width'=>"Width",'p.height'=>"Height",'p.surface'=>"Surface",'p.volume'=>"Volume", - //'p.duration'=>"Duration", + 'p.duration'=>"Duration", + 'p.finished' => 'Nature', 'p.price_base_type'=>"PriceBase",'p.price'=>"UnitPriceHT",'p.price_ttc'=>"UnitPriceTTC", - 'p.tva_tx'=>'VATRate','p.datec'=>'DateCreation','p.tms'=>'DateModification' + 'p.tva_tx'=>'VATRate', + 'p.datec'=>'DateCreation','p.tms'=>'DateModification' ); if (is_object($mysoc) && $mysoc->useNPR()) $this->export_fields_array[$r]['p.recuperableonly']='NPR'; if (! empty($conf->fournisseur->enabled) || !empty($conf->margin->enabled)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r], array('p.cost_price'=>'CostPrice')); @@ -191,13 +193,17 @@ class modProduct extends DolibarrModules if (! empty($conf->global->MAIN_MULTILANGS)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r], array('l.lang'=>'Language', 'l.label'=>'TranslatedLabel','l.description'=>'TranslatedDescription','l.note'=>'TranslatedNote')); if (! empty($conf->global->PRODUCT_USE_UNITS)) $this->export_fields_array[$r]['p.fk_unit'] = 'Unit'; $this->export_TypeFields_array[$r]=array( - 'p.ref'=>"Text",'p.label'=>"Text",'p.description'=>"Text",'p.url'=>"Text",'p.accountancy_code_sell'=>"Text", + 'p.ref'=>"Text",'p.label'=>"Text", + 'p.fk_product_type'=>'Numeric','p.tosell'=>"Boolean",'p.tobuy'=>"Boolean", + 'p.description'=>"Text",'p.url'=>"Text",'p.accountancy_code_sell'=>"Text", 'p.accountancy_code_sell_intra'=>"Text",'p.accountancy_code_sell_export'=>"Text",'p.accountancy_code_buy'=>"Text", 'p.note'=>"Text",'p.note_public'=>"Text", 'p.weight'=>"Numeric",'p.length'=>"Numeric",'p.width'=>"Numeric",'p.height'=>"Numeric",'p.surface'=>"Numeric",'p.volume'=>"Numeric", - 'p.customcode'=>'Text','p.price_base_type'=>"Text",'p.price'=>"Numeric",'p.price_ttc'=>"Numeric",'p.tva_tx'=>'Numeric','p.tosell'=>"Boolean", - 'p.tobuy'=>"Boolean",'p.datec'=>'Date','p.tms'=>'Date' - //'p.duration'=>"Duree", + 'p.customcode'=>'Text', + 'p.duration'=>"Text", + 'p.finished' => 'Numeric', + 'p.price_base_type'=>"Text",'p.price'=>"Numeric",'p.price_ttc'=>"Numeric",'p.tva_tx'=>'Numeric', + 'p.datec'=>'Date','p.tms'=>'Date' ); if (! empty($conf->stock->enabled)) $this->export_TypeFields_array[$r]=array_merge($this->export_TypeFields_array[$r], array('p.stock'=>'Numeric','p.seuil_stock_alerte'=>'Numeric','p.desiredstock'=>'Numeric','p.pmp'=>'Numeric','p.cost_price'=>'Numeric')); if (! empty($conf->barcode->enabled)) $this->export_TypeFields_array[$r]=array_merge($this->export_TypeFields_array[$r], array('p.barcode'=>'Text')); diff --git a/htdocs/core/modules/modService.class.php b/htdocs/core/modules/modService.class.php index b21c954185a..2f3e62903a4 100644 --- a/htdocs/core/modules/modService.class.php +++ b/htdocs/core/modules/modService.class.php @@ -149,10 +149,12 @@ class modService extends DolibarrModules 'p.accountancy_code_sell'=>"ProductAccountancySellCode", 'p.accountancy_code_sell_intra'=>"ProductAccountancySellIntraCode", 'p.accountancy_code_sell_export'=>"ProductAccountancySellExportCode", 'p.accountancy_code_buy'=>"ProductAccountancyBuyCode", 'p.note'=>"NotePrivate",'p.note_public'=>'NotePublic', - //'p.weight'=>"Weight",'p.length'=>"Length",'p.width'=>"Width",'p.height'=>"Height",'p.surface'=>"Surface",'p.volume'=>"Volume", + 'p.weight'=>"Weight",'p.length'=>"Length",'p.width'=>"Width",'p.height'=>"Height",'p.surface'=>"Surface",'p.volume'=>"Volume", 'p.duration'=>"Duration", + 'p.finished' => 'Nature', 'p.price_base_type'=>"PriceBase",'p.price'=>"UnitPriceHT",'p.price_ttc'=>"UnitPriceTTC", - 'p.tva_tx'=>'VATRate','p.datec'=>'DateCreation','p.tms'=>'DateModification' + 'p.tva_tx'=>'VATRate', + 'p.datec'=>'DateCreation','p.tms'=>'DateModification' ); if (is_object($mysoc) && $mysoc->useNPR()) $this->export_fields_array[$r]['p.recuperableonly']='NPR'; if (! empty($conf->fournisseur->enabled) || !empty($conf->margin->enabled)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r], array('p.cost_price'=>'CostPrice')); @@ -165,13 +167,17 @@ class modService extends DolibarrModules if (! empty($conf->global->MAIN_MULTILANGS)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r], array('l.lang'=>'Language', 'l.label'=>'TranslatedLabel','l.description'=>'TranslatedDescription','l.note'=>'TranslatedNote')); if (! empty($conf->global->PRODUCT_USE_UNITS)) $this->export_fields_array[$r]['p.fk_unit'] = 'Unit'; $this->export_TypeFields_array[$r]=array( - 'p.ref'=>"Text",'p.label'=>"Text",'p.description'=>"Text",'p.url'=>"Text",'p.accountancy_code_sell'=>"Text", + 'p.ref'=>"Text",'p.label'=>"Text", + 'p.fk_product_type'=>'Numeric','p.tosell'=>"Boolean",'p.tobuy'=>"Boolean", + 'p.description'=>"Text",'p.url'=>"Text",'p.accountancy_code_sell'=>"Text", 'p.accountancy_code_sell_intra'=>"Text",'p.accountancy_code_sell_export'=>"Text",'p.accountancy_code_buy'=>"Text", 'p.note'=>"Text",'p.note_public'=>"Text", 'p.weight'=>"Numeric",'p.length'=>"Numeric",'p.width'=>"Numeric",'p.height'=>"Numeric",'p.surface'=>"Numeric",'p.volume'=>"Numeric", - 'p.customcode'=>'Text','p.price_base_type'=>"Text",'p.price'=>"Numeric",'p.price_ttc'=>"Numeric",'p.tva_tx'=>'Numeric','p.tosell'=>"Boolean", - 'p.tobuy'=>"Boolean",'p.datec'=>'Date','p.tms'=>'Date', - 'p.duration'=>"Duree", + 'p.customcode'=>'Text', + 'p.duration'=>"Text", + 'p.finished' => 'Numeric', + 'p.price_base_type'=>"Text",'p.price'=>"Numeric",'p.price_ttc'=>"Numeric",'p.tva_tx'=>'Numeric', + 'p.datec'=>'Date','p.tms'=>'Date' ); if (! empty($conf->stock->enabled)) $this->export_TypeFields_array[$r]=array_merge($this->export_TypeFields_array[$r], array('p.stock'=>'Numeric','p.seuil_stock_alerte'=>'Numeric','p.desiredstock'=>'Numeric','p.pmp'=>'Numeric','p.cost_price'=>'Numeric')); if (! empty($conf->barcode->enabled)) $this->export_TypeFields_array[$r]=array_merge($this->export_TypeFields_array[$r], array('p.barcode'=>'Text')); @@ -527,6 +533,7 @@ class modService extends DolibarrModules ) ); + if (! is_array($this->import_convertvalue_array[$r])) $this->import_convertvalue_array[$r] = array(); $this->import_convertvalue_array[$r] = array_merge($this->import_convertvalue_array[$r], array( 'p.fk_unit' => array( 'rule' => 'fetchidfromcodeorlabel', From 9da1d5025bc5492de5c66604cd451711105c4ee2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 9 Oct 2019 02:33:12 +0200 Subject: [PATCH 143/462] FIX If product account not suggested during bind, it is not preselected --- htdocs/accountancy/customer/list.php | 17 ++++++++++++----- htdocs/accountancy/supplier/list.php | 6 ++++-- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index b738933c89c..127f1795e19 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -425,7 +425,6 @@ if ($result) { $objp->code_sell_l = ''; $objp->code_sell_p = ''; - $objp->aarowid_suggest = ''; $product_static->ref = $objp->product_ref; $product_static->id = $objp->product_id; @@ -437,7 +436,7 @@ if ($result) { $facture_static->type = $objp->ftype; $code_sell_p_notset = ''; - $objp->aarowid_suggest = $objp->aarowid; + $objp->aarowid_suggest = ''; // Will be set later $isBuyerInEEC = isInEEC($objp); @@ -471,8 +470,9 @@ if ($result) { } if ($objp->code_sell_l == -1) $objp->code_sell_l=''; + // Search suggested account for product/service $suggestedaccountingaccountfor = ''; - if ($objp->country_code == $mysoc->country_code || empty($objp->country_code)) { // If buyer in same country than seller (if not defined, we assume it is same country) + if (($objp->country_code == $mysoc->country_code) || empty($objp->country_code)) { // If buyer in same country than seller (if not defined, we assume it is same country) $objp->code_sell_p = $objp->code_sell; $objp->aarowid_suggest = $objp->aarowid; $suggestedaccountingaccountfor = ''; @@ -561,12 +561,19 @@ if ($result) { // Suggested accounting account print ''; - print $formaccounting->select_account($objp->aarowid_suggest, 'codeventil'.$objp->rowid, 1, array(), 0, 0, 'codeventil maxwidth200 maxwidthonsmartphone', 'cachewithshowemptyone'); + $suggestedid = $objp->aarowid_suggest; + if (empty($suggestedid) && empty($objp->code_sell_p) && ! empty($objp->code_sell_l) && ! empty($conf->global->ACCOUNTANCY_AUTOFILL_ACCOUNT_WITH_GENERIC)) + { + //$suggestedid = // id of $objp->code_sell_l + } + print $formaccounting->select_account($suggestedid, 'codeventil'.$objp->rowid, 1, array(), 0, 0, 'codeventil maxwidth200 maxwidthonsmartphone', 'cachewithshowemptyone'); print ''; // Column with checkbox print ''; - print 'aarowid ? "checked" : "") . '/>'; + //var_dump($objp->aarowid);var_dump($objp->aarowid_intra);var_dump($objp->aarowid_export);var_dump($objp->aarowid_suggest); + $ischecked = $objp->aarowid_suggest; + print ''; print ''; print ''; diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php index 9ce49b23e6a..d7bfdcc5db3 100644 --- a/htdocs/accountancy/supplier/list.php +++ b/htdocs/accountancy/supplier/list.php @@ -533,12 +533,14 @@ if ($result) { // Suggested accounting account print ''; - print $formaccounting->select_account($objp->aarowid_suggest, 'codeventil'.$objp->rowid, 1, array(), 0, 0, 'codeventil maxwidth200 maxwidthonsmartphone', 'cachewithshowemptyone'); + $suggestedid = $objp->aarowid_suggest; + print $formaccounting->select_account($suggestedid, 'codeventil'.$objp->rowid, 1, array(), 0, 0, 'codeventil maxwidth200 maxwidthonsmartphone', 'cachewithshowemptyone'); print ''; // Column with checkbox print ''; - print 'aarowid ? "checked" : "") . '/>'; + $ischecked = $objp->aarowid_suggest; + print ''; print ''; print ''; From f2d04fe55cce45fe5295f1dff4bb318d43cb2386 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 9 Oct 2019 11:51:10 +0200 Subject: [PATCH 144/462] Code comment --- htdocs/core/lib/product.lib.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index 0673ad2c3c7..404e33f1404 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -527,9 +527,9 @@ function measuring_units_string($unit, $measuring_style = '', $scale = '', $use_ } /** - * Transform a given unit into the square of that unit, if known + * Transform a given unit scale into the square of that unit, if known. * - * @param int $unit Unit key (-3,-2,-1,0,98,99...) + * @param int $unit Unit scale key (-3,-2,-1,0,98,99...) * @return int Squared unit key (-6,-4,-2,0,98,99...) * @see formproduct->selectMeasuringUnits */ @@ -547,9 +547,9 @@ function measuring_units_squared($unit) /** - * Transform a given unit into the cube of that unit, if known + * Transform a given unit scale into the cube of that unit, if known * - * @param int $unit Unit key (-3,-2,-1,0,98,99...) + * @param int $unit Unit scale key (-3,-2,-1,0,98,99...) * @return int Cubed unit key (-9,-6,-3,0,88,89...) * @see formproduct->selectMeasuringUnits */ From 0c8331b6d798eb83a1ad3c05059dcc0c79803102 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 9 Oct 2019 18:47:25 +0200 Subject: [PATCH 145/462] doxygen --- htdocs/compta/facture/class/facture.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index e4140357370..adf00d69d82 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -3506,7 +3506,7 @@ class Facture extends CommonInvoice * @param int $offset For pagination * @param string $sortfield Sort criteria * @param string $sortorder Sort order - * @return int -1 if KO, array with result if OK + * @return array|int -1 if KO, array with result if OK */ function liste_array($shortlist=0, $draft=0, $excluser='', $socid=0, $limit=0, $offset=0, $sortfield='f.datef,f.rowid', $sortorder='DESC') { @@ -3577,7 +3577,7 @@ class Facture extends CommonInvoice * (Status validated or abandonned for a reason 'other') + not payed + no payment at all + not already replaced * * @param int $socid Id thirdparty - * @return array Array of invoices ('id'=>id, 'ref'=>ref, 'status'=>status, 'paymentornot'=>0/1) + * @return array|int Array of invoices ('id'=>id, 'ref'=>ref, 'status'=>status, 'paymentornot'=>0/1) */ function list_replacable_invoices($socid=0) { From c3aba5f1a32b9609c4597bd51a529f28b49e8ed8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 11 Oct 2019 14:53:30 +0200 Subject: [PATCH 146/462] FIX #12083 --- htdocs/debugbar/class/TraceableDB.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/debugbar/class/TraceableDB.php b/htdocs/debugbar/class/TraceableDB.php index d4bfd291602..20b5d47f0e8 100644 --- a/htdocs/debugbar/class/TraceableDB.php +++ b/htdocs/debugbar/class/TraceableDB.php @@ -333,9 +333,9 @@ class TraceableDB extends DoliDB 'sql' => $sql, 'duration' => $duration, 'memory_usage' => $memoryDelta, - 'is_success' => $resql, - 'error_code' => ! $resql ? $this->db->lasterrno() : null, - 'error_message' => ! $resql ? $this->db->lasterror() : null + 'is_success' => $resql ? true : false, + 'error_code' => $resql ? null : $this->db->lasterrno(), + 'error_message' => $resql ? null : $this->db->lasterror() ); } From 868bfb518b80c17b1253a8e485b5282bf3392290 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 11 Oct 2019 15:08:10 +0200 Subject: [PATCH 147/462] FIX #11702 FIX #12088 --- htdocs/bom/tpl/objectline_create.tpl.php | 5 +++-- htdocs/core/tpl/objectline_create.tpl.php | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/bom/tpl/objectline_create.tpl.php b/htdocs/bom/tpl/objectline_create.tpl.php index e266c142480..b77d713268f 100644 --- a/htdocs/bom/tpl/objectline_create.tpl.php +++ b/htdocs/bom/tpl/objectline_create.tpl.php @@ -100,14 +100,15 @@ if ($nolinesbefore) { $filtertype=''; if (! empty($object->element) && $object->element == 'contrat' && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS)) $filtertype='1'; + $statustoshow = -1; if (! empty($conf->global->ENTREPOT_EXTRA_STATUS)) { // hide products in closed warehouse, but show products for internal transfer - $form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, 1, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, 'warehouseopen,warehouseinternal', GETPOST('combinations', 'array')); + $form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, 'warehouseopen,warehouseinternal', GETPOST('combinations', 'array')); } else { - $form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, 1, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, '', GETPOST('combinations', 'array')); + $form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, '', GETPOST('combinations', 'array')); } echo ''; diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index 6bad5bb2ac5..ee34654f2f2 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -38,7 +38,6 @@ if (empty($object) || ! is_object($object)) { exit; } - $usemargins=0; if (! empty($conf->margin->enabled) && ! empty($object->element) && in_array($object->element, array('facture','facturerec','propal','commande'))) { @@ -248,14 +247,15 @@ if ($nolinesbefore) { if (empty($senderissupplier)) { + $statustoshow = 1; if (! empty($conf->global->ENTREPOT_EXTRA_STATUS)) { // hide products in closed warehouse, but show products for internal transfer - $form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, -1, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth300', 0, 'warehouseopen,warehouseinternal', GETPOST('combinations', 'array')); + $form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth300', 0, 'warehouseopen,warehouseinternal', GETPOST('combinations', 'array')); } else { - $form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, -1, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth300', 0, '', GETPOST('combinations', 'array')); + $form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth300', 0, '', GETPOST('combinations', 'array')); } if (! empty($conf->global->MAIN_AUTO_OPEN_SELECT2_ON_FOCUS_FOR_CUSTOMER_PRODUCTS)) From 85a4bac9e078e3c8e18ca72c2f34752b1cff0109 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 11 Oct 2019 15:22:12 +0200 Subject: [PATCH 148/462] Better translation --- htdocs/langs/en_US/admin.lang | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index bc9981faf3f..5996d643624 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -870,9 +870,9 @@ Permission1251=Run mass imports of external data into database (data load) Permission1321=Export customer invoices, attributes and payments Permission1322=Reopen a paid bill Permission1421=Export sales orders and attributes -Permission2401=Read actions (events or tasks) linked to his account -Permission2402=Create/modify actions (events or tasks) linked to his account -Permission2403=Delete actions (events or tasks) linked to his account +Permission2401=Read actions (events or tasks) linked to his user account (if owner of event) +Permission2402=Create/modify actions (events or tasks) linked to his user account (if owner of event) +Permission2403=Delete actions (events or tasks) linked to his user account (if owner of event) Permission2411=Read actions (events or tasks) of others Permission2412=Create/modify actions (events or tasks) of others Permission2413=Delete actions (events or tasks) of others From 777c297353431b777f1d769ea29f735e2b16610a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 11 Oct 2019 15:42:27 +0200 Subject: [PATCH 149/462] FIX #12054 --- .../compta/facture/invoicetemplate_list.php | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php index 5da37d46fd5..661f9604500 100644 --- a/htdocs/compta/facture/invoicetemplate_list.php +++ b/htdocs/compta/facture/invoicetemplate_list.php @@ -217,7 +217,17 @@ $sql = "SELECT s.nom as name, s.rowid as socid, f.rowid as facid, f.titre, f.tot $sql.= " f.nb_gen_done, f.nb_gen_max, f.date_last_gen, f.date_when, f.suspended,"; $sql.= " f.datec, f.tms,"; $sql.= " f.fk_cond_reglement, f.fk_mode_reglement"; -$sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture_rec as f"; +// Add fields from extrafields +if (! empty($extrafields->attributes[$object->table_element]['label'])) + foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key : ''); +// Add fields from hooks +$parameters=array(); +$reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook +$sql.=preg_replace('/^,/', '', $hookmanager->resPrint); +$sql =preg_replace('/,\s*$/', '', $sql); + +$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_rec as f"; +$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture_rec_extrafields as ef ON ef.fk_object = f.rowid"; if (! $user->rights->societe->client->voir && ! $socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } @@ -492,6 +502,8 @@ if ($resql) if (! empty($arrayfields['f.date_when']['checked'])) print_liste_field_titre($arrayfields['f.date_when']['label'], $_SERVER['PHP_SELF'], "f.date_when", "", $param, 'align="center"', $sortfield, $sortorder); if (! empty($arrayfields['f.datec']['checked'])) print_liste_field_titre($arrayfields['f.datec']['label'], $_SERVER['PHP_SELF'], "f.datec", "", $param, 'align="center"', $sortfield, $sortorder); if (! empty($arrayfields['f.tms']['checked'])) print_liste_field_titre($arrayfields['f.tms']['label'], $_SERVER['PHP_SELF'], "f.tms", "", $param, 'align="center"', $sortfield, $sortorder); + // Extra fields + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; if (! empty($arrayfields['status']['checked'])) print_liste_field_titre($arrayfields['status']['label'], $_SERVER['PHP_SELF'], "f.suspended,f.frequency", "", $param, 'align="center"', $sortfield, $sortorder); print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', 'align="center"', $sortfield, $sortorder, 'nomaxwidthsearch ')."\n"; print "\n"; @@ -630,6 +642,15 @@ if ($resql) print ''; if (! $i) $totalarray['nbfield']++; } + + $obj = $objp; + // Extra fields + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; + // Fields from hook + $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$objp, 'i'=>$i, 'totalarray'=>&$totalarray); + $reshook=$hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + // Status if (! empty($arrayfields['status']['checked'])) { print ''; From d109341ebedd95d7b0eeaa84a4d9510e7db7fcfe Mon Sep 17 00:00:00 2001 From: JC Prieto Date: Fri, 11 Oct 2019 18:08:15 +0200 Subject: [PATCH 150/462] Update card.php Variable $mesg not do anything --- htdocs/fourn/card.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index 5ebe8ffed56..5c183cc212b 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -85,10 +85,7 @@ if (empty($reshook)) $result=$object->fetch($id); $object->code_compta_fournisseur=$_POST["supplieraccountancycode"]; $result=$object->update($object->id, $user, 1, 0, 1); - if ($result < 0) - { - $mesg=join(',', $object->errors); - } + if ($result < 0) setEventMessages($object->error, $object->errors, 'errors'); } // terms of the settlement if ($action == 'setconditions' && $user->rights->societe->creer) From f345b5fdb0d2b3bc4f2ce52d541393a1f1c7d050 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 11 Oct 2019 19:32:45 +0200 Subject: [PATCH 151/462] Fix look and feel v10 --- htdocs/comm/multiprix.php | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/htdocs/comm/multiprix.php b/htdocs/comm/multiprix.php index 8a5226d36d2..6442bb45a88 100644 --- a/htdocs/comm/multiprix.php +++ b/htdocs/comm/multiprix.php @@ -91,15 +91,13 @@ if ($_socid > 0) dol_fiche_head($head, $tabchoice, $langs->trans("ThirdParty"), 0, 'company'); - print ''; - print '\n"; - - - print ""; - print "
'; - print ''; + print '
'; - print '"; + print '"; - print '
'; - print $langs->trans("PriceLevel").''.$objsoc->price_level."
'; + print $langs->trans("PriceLevel").''.$objsoc->price_level."
'; - print $langs->trans("NewValue").''; + print '
'; + print $langs->trans("NewValue").''; print '
"; - print "
"; - dol_fiche_end(); print '
'; @@ -157,8 +149,8 @@ if ($_socid > 0) while ($i < $num ) { $obj = $db->fetch_object($resql); - $tag = !$tag; - print ''; + + print ''; print ''.dol_print_date($db->jdate($obj->dc), "dayhour").''; print ''.$obj->price_level.' '; $userstatic->id=$obj->uid; From 2fa3b23cf10c9e05afc81be1caec91c6b6990d74 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 11 Oct 2019 19:36:36 +0200 Subject: [PATCH 152/462] Fix missing price level field --- htdocs/core/modules/modSociete.class.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/core/modules/modSociete.class.php b/htdocs/core/modules/modSociete.class.php index e41e96c5add..a0d190c65cd 100644 --- a/htdocs/core/modules/modSociete.class.php +++ b/htdocs/core/modules/modSociete.class.php @@ -270,6 +270,9 @@ class modSociete extends DolibarrModules 'st.code'=>'ProspectStatus','payterm.libelle'=>'PaymentConditions','paymode.libelle'=>'PaymentMode' ); if (! empty($conf->global->SOCIETE_USEPREFIX)) $this->export_fields_array[$r]['s.prefix']='Prefix'; + + if (! empty($conf->global->SOCIETE_USEPREFIX)) $this->export_fields_array[$r]['s.prefix']='Prefix'; + if (! empty($conf->global->PRODUIT_MULTIPRICES)) $this->export_fields_array[$r]['s.price_level']='PriceLevel'; // Add multicompany field if (! empty($conf->global->MULTICOMPANY_ENTITY_IN_EXPORT_IF_SHARED)) { @@ -295,7 +298,8 @@ class modSociete extends DolibarrModules 's.tva_intra'=>"Text",'s.capital'=>"Numeric",'s.note_private'=>"Text",'s.note_public'=>"Text",'t.libelle'=>"Text", 'ce.code'=>"List:c_effectif:libelle:code","cfj.libelle"=>"Text",'s.fk_prospectlevel'=>'List:c_prospectlevel:label:code', 'st.code'=>'List:c_stcomm:libelle:code','d.nom'=>'Text','u.login'=>'Text','u.firstname'=>'Text','u.lastname'=>'Text','payterm.libelle'=>'Text', - 'paymode.libelle'=>'Text','s.entity'=>'Numeric' + 'paymode.libelle'=>'Text','s.entity'=>'Numeric', + 's.price_level'=>'Numeric' ); $this->export_entities_array[$r]=array('u.login'=>'user','u.firstname'=>'user','u.lastname'=>'user'); // We define here only fields that use another picto From c3e8aec07c6be4e0c315409c34ef65de83b8ee12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 11 Oct 2019 23:54:05 +0200 Subject: [PATCH 153/462] fix translation for showemailing in lang files, it's ShowEMailing not ShowEmailing --- htdocs/comm/mailing/class/mailing.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/mailing/class/mailing.class.php b/htdocs/comm/mailing/class/mailing.class.php index 9df3a04a786..dba1de41cfd 100644 --- a/htdocs/comm/mailing/class/mailing.class.php +++ b/htdocs/comm/mailing/class/mailing.class.php @@ -548,7 +548,7 @@ class Mailing extends CommonObject $result = ''; $companylink = ''; - $label = '' . $langs->trans("ShowEmailing") . ''; + $label = '' . $langs->trans("ShowEMailing") . ''; $label.= '
'; $label.= '' . $langs->trans('Ref') . ': ' . $this->ref; @@ -567,7 +567,7 @@ class Mailing extends CommonObject { if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { - $label=$langs->trans("ShowEmailing"); + $label=$langs->trans("ShowEMailing"); $linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"'; } $linkclose.=' title="'.dol_escape_htmltag($label, 1).'"'; From 9871dd8770a4ffbe59f700a26191c260a5764d01 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 12 Oct 2019 15:27:06 +0200 Subject: [PATCH 154/462] Debug variants --- htdocs/langs/en_US/products.lang | 4 ++-- htdocs/product/stock/product.php | 12 ++++++++---- htdocs/variants/combinations.php | 26 +++++++++++++++++--------- 3 files changed, 27 insertions(+), 15 deletions(-) diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index 36ca0ede002..21f4d4947ce 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -208,8 +208,8 @@ UseMultipriceRules=Use price segment rules (defined into product module setup) t PercentVariationOver=%% variation over %s PercentDiscountOver=%% discount over %s KeepEmptyForAutoCalculation=Keep empty to have this calculated automatically from weight or volume of products -VariantRefExample=Example: COL -VariantLabelExample=Example: Color +VariantRefExample=Examples: COL, SIZE +VariantLabelExample=Examples: Color, Size ### composition fabrication Build=Produce ProductsMultiPrice=Products and prices for each price segment diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 2c0515d309c..9ef671e9913 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -804,8 +804,8 @@ if (! $variants) { */ print '
'; + print ''; - print '
'; print ''; print ''; print ''; @@ -918,7 +918,8 @@ if (! $variants) { print ''; print ''; print ''; - print ''; + print ''; + print ''; } } } @@ -926,12 +927,13 @@ if (! $variants) { } } else dol_print_error($db); + // Total line print ''; print ''; print ''; -// Value purchase + // Value purchase print ''; @@ -939,12 +941,13 @@ if (! $variants) { if (empty($conf->global->PRODUIT_MULTIPRICES)) print ($total ? price($totalvaluesell / $total, 1) : ' '); else print $langs->trans("Variable"); print ''; -// Value to sell + // Value to sell print ''; print ""; + print "
' . $langs->trans("Warehouse") . '' . $langs->trans("NumberOfUnit") . '' . dol_print_date($pdluo->eatby, 'day') . '' . dol_print_date($pdluo->sellby, 'day') . '' . $pdluo->qty . ($pdluo->qty < 0 ? ' ' . img_warning() : '') . '
' . $langs->trans("Total") . ':' . price2num($total, 'MS') . ''; print ($totalwithpmp ? price(price2num($totalvalue / $totalwithpmp, 'MU')) : ' '); // This value may have rounding errors print ''; print $totalvalue ? price(price2num($totalvalue, 'MT'), 1) : ' '; print ''; if (empty($conf->global->PRODUIT_MULTIPRICES)) print price(price2num($totalvaluesell, 'MT'), 1); else print $langs->trans("Variable"); print '
"; print '
'; @@ -1067,6 +1070,7 @@ if (! $variants) { print ''; print ''.$langs->trans("Total").''; print ''.$stock_total.''; + print ''; print ''; } else diff --git a/htdocs/variants/combinations.php b/htdocs/variants/combinations.php index 3239dbb5060..4a7774b1a08 100644 --- a/htdocs/variants/combinations.php +++ b/htdocs/variants/combinations.php @@ -377,6 +377,7 @@ if (! empty($id) || ! empty($ref)) dol_fiche_end(); + $listofvariantselected = ''; // Create or edit a varian if ($action == 'add' || ($action == 'edit')) { @@ -386,7 +387,7 @@ if (! empty($id) || ! empty($ref)) //print dol_fiche_head(); $features = $_SESSION['addvariant_'.$object->id]; //First, sanitize - print '
'; + $listofvariantselected = '
'; if (! empty($features)) { foreach ($features as $feature) { @@ -400,16 +401,14 @@ if (! empty($id) || ! empty($ref)) continue; } - print '' . $prodattr->label . ':'. $prodattr_val->value . ' '; + $listofvariantselected .= '' . $prodattr->label . ':'. $prodattr_val->value . ' '; } } - print '
'; - print '

'; + $listofvariantselected .= '
'; //print dol_fiche_end(); } else { $title = $langs->trans('EditProductCombination'); } - print load_fiche_titre($title); if ($action == 'add') { $prodattr_all = $prodattr->fetchAll(); @@ -499,6 +498,10 @@ if (! empty($id) || ! empty($ref)) '; + + print load_fiche_titre($title); + print '
'."\n"; print ''; print ''."\n"; @@ -507,9 +510,9 @@ if (! empty($id) || ! empty($ref)) print ''."\n"; } - print dol_fiche_head(); + print dol_fiche_head(); - ?> + ?> @@ -524,6 +527,7 @@ if (! empty($id) || ! empty($ref)) print ''; foreach ($prodattr_all as $attr) { + //print ''; print ''; } print ''; @@ -561,6 +565,10 @@ if (! empty($id) || ! empty($ref)) "> + +
+ +
variation_price >= 0 ? '+' : '').price($currcomb->variation_price).($currcomb->variation_price_percentage ? ' %' : '') ?> isProduct()) print ''.($currcomb->variation_weight >= 0 ? '+' : '').price($currcomb->variation_weight).' '.measuring_units_string($prodstatic->weight_units, 'weight').''; ?> - getLibStatut(2, 0) ?> - getLibStatut(2, 1) ?> + getLibStatut(2, 0) ?> + getLibStatut(2, 1) ?> From 67d76787eba1dd3493dc435c36d5695751584131 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 12 Oct 2019 15:29:06 +0200 Subject: [PATCH 155/462] Add new hidden conf VARIANT_ALLOW_STOCK_MOVEMENT_ON_VARIANT_PARENT --- htdocs/product/stock/product.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 9ef671e9913..944b3ce96cd 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -764,7 +764,7 @@ if (empty($reshook)) if ($user->rights->stock->mouvement->creer) { - if (! $variants) { + if (! $variants || ! empty($conf->global->VARIANT_ALLOW_STOCK_MOVEMENT_ON_VARIANT_PARENT)) { print '' . $langs->trans("CorrectStock") . ''; } else @@ -780,7 +780,7 @@ if (empty($reshook)) //if (($user->rights->stock->mouvement->creer) && ! $object->hasbatch()) if ($user->rights->stock->mouvement->creer) { - if (! $variants) { + if (! $variants || ! empty($conf->global->VARIANT_ALLOW_STOCK_MOVEMENT_ON_VARIANT_PARENT)) { print '' . $langs->trans("TransferStock") . ''; } else From 9c94ffeea9cb61efd5cdb2dc3cf6693d9709ef3d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 12 Oct 2019 18:40:41 +0200 Subject: [PATCH 156/462] Fix css --- htdocs/comm/mailing/cibles.php | 2 +- htdocs/theme/eldy/global.inc.php | 3 +++ htdocs/theme/md/style.css.php | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index 3cc5f12566d..532e792bd6e 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -338,7 +338,7 @@ if ($object->fetch($id) >= 0) print '
'; if (empty($obj->picto)) $obj->picto='generic'; - print img_object($langs->trans("EmailingTargetSelector").': '.get_class($obj), $obj->picto); + print img_object($langs->trans("EmailingTargetSelector").': '.get_class($obj), $obj->picto, 'class="valignmiddle pictomodule"'); print ' '; print $obj->getDesc(); print '
'; diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 46d24b08cc6..0189a3988dd 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1293,6 +1293,9 @@ div.nopadding { .pictowarning { vertical-align: text-bottom; } +.pictomodule { + width: 14px; +} .fiche .arearef img.pictoedit, .fiche .arearef span.pictoedit, .fiche .fichecenter img.pictoedit, .fiche .fichecenter span.pictoedit, .tagtdnote span.pictoedit { diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index a9e94eb885c..8e0cf75047b 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1483,6 +1483,9 @@ table.noborder tr.liste_titre td { .pictowarning { vertical-align: text-bottom; } +.pictomodule { + width: 14px; +} .fiche .arearef img.pictoedit, .fiche .arearef span.pictoedit, .fiche .fichecenter img.pictoedit, .fiche .fichecenter span.pictoedit, .tagtdnote span.pictoedit { From 650cd2b54ffe616cff7228a0478291812b08ffdd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 12 Oct 2019 18:41:33 +0200 Subject: [PATCH 157/462] Prepare 10.0.3 --- htdocs/filefunc.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index 94455858e8b..fffd9be3636 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -31,7 +31,7 @@ */ if (! defined('DOL_APPLICATION_TITLE')) define('DOL_APPLICATION_TITLE', 'Dolibarr'); -if (! defined('DOL_VERSION')) define('DOL_VERSION', '10.0.2'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c +if (! defined('DOL_VERSION')) define('DOL_VERSION', '10.0.3'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c if (! defined('EURO')) define('EURO', chr(128)); From 499eb87173aa6b35a843808aca8a5e03e7414c5c Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 13 Oct 2019 08:20:37 +0200 Subject: [PATCH 158/462] lang file for holidays is holiday --- htdocs/core/modules/holiday/modules_holiday.php | 4 ++-- htdocs/holiday/document.php | 4 +--- htdocs/holiday/list.php | 2 +- htdocs/index.php | 2 +- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/htdocs/core/modules/holiday/modules_holiday.php b/htdocs/core/modules/holiday/modules_holiday.php index 9bd0a448ebc..8797d1f377c 100644 --- a/htdocs/core/modules/holiday/modules_holiday.php +++ b/htdocs/core/modules/holiday/modules_holiday.php @@ -96,7 +96,7 @@ class ModelNumRefHolidays public function info() { global $langs; - $langs->load("holidays"); + $langs->load("holiday"); return $langs->trans("NoDescription"); } @@ -108,7 +108,7 @@ class ModelNumRefHolidays public function getExample() { global $langs; - $langs->load("holidays"); + $langs->load("holiday"); return $langs->trans("NoExample"); } diff --git a/htdocs/holiday/document.php b/htdocs/holiday/document.php index a594a920e74..30803a9ecbc 100644 --- a/htdocs/holiday/document.php +++ b/htdocs/holiday/document.php @@ -37,7 +37,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/holiday.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; // Load translation files required by the page -$langs->loadLangs(array('other', 'holidays', 'companies')); +$langs->loadLangs(array('other', 'holiday', 'companies')); $id = GETPOST('id', 'int'); $ref = GETPOST('ref', 'alpha'); @@ -48,8 +48,6 @@ $confirm = GETPOST('confirm', 'alpha'); if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'holiday', $id, 'holiday'); -$langs->load("holiday"); - // Get parameters $sortfield = GETPOST('sortfield', 'alpha'); $sortorder = GETPOST('sortorder', 'alpha'); diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index f74d731e8bd..1c03e3801b6 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -35,7 +35,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php'; // Load translation files required by the page -$langs->loadLangs(array('users', 'holidays', 'hrm')); +$langs->loadLangs(array('users', 'holiday', 'hrm')); // Protection if external user if ($user->societe_id > 0) accessforbidden(); diff --git a/htdocs/index.php b/htdocs/index.php index d6ce8c90067..5eee02efa1e 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -218,7 +218,7 @@ if (empty($user->societe_id)) 'askprice', 'projects', 'expensereports', - 'holidays', + 'holiday', 'donations' ); // Dashboard Icon lines From e50d32dc00536523090307691cd1c0b1d6518119 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 13 Oct 2019 13:20:45 +0200 Subject: [PATCH 159/462] Remove a duplicate line --- htdocs/core/modules/modSociete.class.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/htdocs/core/modules/modSociete.class.php b/htdocs/core/modules/modSociete.class.php index a0d190c65cd..8d6490becfe 100644 --- a/htdocs/core/modules/modSociete.class.php +++ b/htdocs/core/modules/modSociete.class.php @@ -269,8 +269,6 @@ class modSociete extends DolibarrModules 't.libelle'=>"ThirdPartyType",'ce.code'=>"Staff","cfj.libelle"=>"JuridicalStatus",'s.fk_prospectlevel'=>'ProspectLevel', 'st.code'=>'ProspectStatus','payterm.libelle'=>'PaymentConditions','paymode.libelle'=>'PaymentMode' ); - if (! empty($conf->global->SOCIETE_USEPREFIX)) $this->export_fields_array[$r]['s.prefix']='Prefix'; - if (! empty($conf->global->SOCIETE_USEPREFIX)) $this->export_fields_array[$r]['s.prefix']='Prefix'; if (! empty($conf->global->PRODUIT_MULTIPRICES)) $this->export_fields_array[$r]['s.price_level']='PriceLevel'; // Add multicompany field From 4fd12e22cb52e4ba2d747a989c4f0ecd3f866102 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 14 Oct 2019 12:27:44 +0200 Subject: [PATCH 160/462] Fix trans export --- htdocs/exports/export.php | 2 +- htdocs/langs/en_US/admin.lang | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/exports/export.php b/htdocs/exports/export.php index df298153062..c404fc2b264 100644 --- a/htdocs/exports/export.php +++ b/htdocs/exports/export.php @@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/export/modules_export.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; // Load translation files required by the page -$langs->loadlangs(array('exports', 'other', 'users', 'companies', 'projects')); +$langs->loadlangs(array('admin', 'exports', 'other', 'users', 'companies', 'projects', 'suppliers', 'products')); // Everybody should be able to go on this page //if (! $user->admin) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 5996d643624..bef32dfcd84 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1061,6 +1061,7 @@ CompanyTown=Town CompanyCountry=Country CompanyCurrency=Main currency CompanyObject=Object of the company +IDCountry=ID country Logo=Logo DoNotSuggestPaymentMode=Do not suggest NoActiveBankAccountDefined=No active bank account defined From b4827dbe067e6755665a268262c9ea2deb59f4fa Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 14 Oct 2019 12:30:26 +0200 Subject: [PATCH 161/462] Prepare 10.0.3 --- ChangeLog | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 61 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index ee409bb7588..3583c10385b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,8 +2,68 @@ English Dolibarr ChangeLog -------------------------------------------------------------- -***** ChangeLog for 10.0.2 compared to 10.0.1 ***** +***** ChangeLog for 10.0.3 compared to 10.0.2 ***** +FIX: #11702 +FIX: #11861 No consistent code to manage measuring units +FIX: #11942 +FIX: #12026 +FIX: #12040 +FIX: #12041 +FIX: #12054 +FIX: #12083 +FIX: #12088 +FIX: access to public interface when origin email has an alias. +FIX: Alias name is not into the email recipient label. +FIX: allow standalone credit note even if no invoice +FIX: an admin can not access his own permissions after enabling advanced +FIX: an admin can not access his own permissions after enabling advanced permissions +FIX: Attachement of linked files on ticket when sending a message +FIX: avoid non numeric warning +FIX: Bad currency var used in stripe for connect +FIX: Bad list of ticket on public interface for ticket emailcollector +FIX: Can't modify vendor invoice if transfered into accountancy +FIX: change product type must be allowed if we activate hidden conf +FIX: colspan on VAT quadri report +FIX: CSS +FIX: Debug feature orderstoinvoice for suppliers +FIX: do not output return code on screen after a select of bank account +FIX: Edit of ticket module parameters erased others +FIX: empty cache when we want to load specific warehouses in select +FIX: escape email alias +FIX: expedition.class.php +FIX: Export of leave request show the number of open days +FIX: Filtering the HTTP Header "Accept-Language". +FIX: Filter on project on ticket list +FIX: Filter "Open all" of ticket was ko. +FIX: Force downlaod of file with .noexe as octet-stream mime type +FIX: form not closed. +FIX: hidden conf to prevent from changing product_type +FIX: If product account not suggested during bind, it is not preselected +FIX: If we share invoice, we need to see discount created from a deposit on each entity +FIX: Import of product using units +FIX: label of thirdparty is wrong on open project list +FIX: Look and feel v10 +FIX: missing begin() +FIX: missing "$this->id" in "fetch" function +FIX: navigation on ticket tab of projects +FIX: new invoice with generic thirdparty in takepos +FIX: Pb in units of shipments +FIX: regression with option to hide picto on top menu +FIX: selection of project i am contact of. +FIX: Send email from expense report card. +FIX: shipping card: missing user error messages when classifying closed or billed +FIX: SQL injection on qty +FIX: stripe payment when there is a quote into address +FIX: Substitution of __PROJECT_XXX__ not done +FIX: TakePOS no invoice validation control and good payment translate +FIX: the access of the bank account of one user +FIX: top menu right padding +FIX: Update of leave request when CSRF with token is on +FIX: Var not enough sanitized +FIX: wrong test +FIX: XSS +***** ChangeLog for 10.0.2 compared to 10.0.1 ***** FIX: #10460 compatibility with MariaDB 10.4 FIX: #11401 Adherent unknown language key FIX: #11422 Can't edit his own events with standard rights From 92c624daf0bdd80313bed5a4862e750775bf22de Mon Sep 17 00:00:00 2001 From: atm-greg Date: Mon, 14 Oct 2019 15:28:06 +0200 Subject: [PATCH 162/462] add security.lib.php for dol_hash --- htdocs/blockedlog/class/blockedlog.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/blockedlog/class/blockedlog.class.php b/htdocs/blockedlog/class/blockedlog.class.php index d7302a2c795..4413b78a6a4 100644 --- a/htdocs/blockedlog/class/blockedlog.class.php +++ b/htdocs/blockedlog/class/blockedlog.class.php @@ -1048,6 +1048,7 @@ class BlockedLog if (empty($conf->global->BLOCKEDLOG_ENTITY_FINGERPRINT)) { // creation of a unique fingerprint require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; + require_once DOL_DOCUMENT_ROOT.'/core/lib/security.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; $fingerprint = dol_hash(print_r($mysoc, true).getRandomPassword(1), '5'); From 4f10009113a776462c26c4500d3c24c593dc9d63 Mon Sep 17 00:00:00 2001 From: atm-josselin Date: Mon, 14 Oct 2019 15:39:38 +0200 Subject: [PATCH 163/462] Add fields definition in product batch class for extrafields compatibility --- htdocs/product/stock/class/productlot.class.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/htdocs/product/stock/class/productlot.class.php b/htdocs/product/stock/class/productlot.class.php index f3cec8f9a98..dd811a66cf6 100644 --- a/htdocs/product/stock/class/productlot.class.php +++ b/htdocs/product/stock/class/productlot.class.php @@ -53,6 +53,19 @@ class Productlot extends CommonObject */ public $ismultientitymanaged = 1; + /** + * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + */ + public $fields=array( + 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'index'=>1, 'position'=>1, 'comment'=>'Id'), + 'batch' =>array('type'=>'varchar(30)', 'label'=>'Batch', 'enabled'=>1, 'visible'=>1, 'notnull'=>0, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'comment'=>'Batch'), + 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'default'=>1, 'notnull'=>1, 'index'=>1, 'position'=>20), + 'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>500), + 'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>501), + 'fk_user_author'=>array('type'=>'integer', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>510, 'foreignkey'=>'llx_user.rowid'), + 'fk_user_modif' =>array('type'=>'integer', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>511) + ); + /** * @var int Entity */ From 45b3d623bbe90e57252377a6f6efc4404bf33a8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 14 Oct 2019 20:30:31 +0200 Subject: [PATCH 164/462] Update list.php --- htdocs/fourn/facture/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 8985ee33de2..1da06b03d63 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -805,7 +805,7 @@ if ($resql) if (! empty($arrayfields['country.code_iso']['checked'])) print_liste_field_titre($arrayfields['country.code_iso']['label'],$_SERVER["PHP_SELF"],"country.code_iso","",$param,'align="center"',$sortfield,$sortorder); if (! empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'],$_SERVER["PHP_SELF"],"typent.code","",$param,'align="center"',$sortfield,$sortorder); if (! empty($arrayfields['f.fk_mode_reglement']['checked'])) print_liste_field_titre($arrayfields['f.fk_mode_reglement']['label'],$_SERVER["PHP_SELF"],"f.fk_mode_reglement","",$param,"",$sortfield,$sortorder); - if (! empty($arrayfields['f.total_ht']['checked'])) print_liste_field_titre($arrayfields['f.total_ht']['label'],$_SERVER['PHP_SELF'],'f.total','',$param,'align="right"',$sortfield,$sortorder); + if (! empty($arrayfields['f.total_ht']['checked'])) print_liste_field_titre($arrayfields['f.total_ht']['label'],$_SERVER['PHP_SELF'],'f.total_ht','',$param,'align="right"',$sortfield,$sortorder); if (! empty($arrayfields['f.total_vat']['checked'])) print_liste_field_titre($arrayfields['f.total_vat']['label'],$_SERVER['PHP_SELF'],'f.tva','',$param,'align="right"',$sortfield,$sortorder); if (! empty($arrayfields['f.total_localtax1']['checked'])) print_liste_field_titre($arrayfields['f.total_localtax1']['label'],$_SERVER['PHP_SELF'],'f.localtax1','',$param,'align="right"',$sortfield,$sortorder); if (! empty($arrayfields['f.total_localtax2']['checked'])) print_liste_field_titre($arrayfields['f.total_localtax2']['label'],$_SERVER['PHP_SELF'],'f.localtax2','',$param,'align="right"',$sortfield,$sortorder); From 056f7f826bfaad2048597b4a785467176fcee0d9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 14 Oct 2019 20:41:28 +0200 Subject: [PATCH 165/462] Clean code --- htdocs/modulebuilder/template/myobject_card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index 72bc424c53c..132bf158ac8 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -446,7 +446,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Clone if (! empty($user->rights->mymodule->write)) { - print ''; + print '' . $langs->trans("ToClone") . ''."\n"; } /* From 568faef7f4c2f77087fd9005b9a0b37dd0bffc85 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 15 Oct 2019 04:08:34 +0200 Subject: [PATCH 166/462] Fix encoding of message --- htdocs/takepos/takepos.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/takepos.php b/htdocs/takepos/takepos.php index bd14e227876..311bcd00d8b 100644 --- a/htdocs/takepos/takepos.php +++ b/htdocs/takepos/takepos.php @@ -396,7 +396,7 @@ function Refresh() { function New() { // If we go here,it means $conf->global->TAKEPOS_BAR_RESTAURANT is not defined console.log("New with place = , js place="+place); - var r = confirm(' 0 ? $langs->trans("ConfirmDeletionOfThisPOSSale") : $langs->trans("ConfirmDiscardOfThisPOSSale")); ?>'); + var r = confirm(' 0 ? $langs->transnoentitiesnoconv("ConfirmDeletionOfThisPOSSale") : $langs->transnoentitiesnoconv("ConfirmDiscardOfThisPOSSale")); ?>'); if (r == true) { $("#poslines").load("invoice.php?action=delete&place="+place, function() { //$('#poslines').scrollTop($('#poslines')[0].scrollHeight); From a45ad29e71e6b6cfd83d544bb3c0a4f2186fa5b9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 15 Oct 2019 11:32:53 +0200 Subject: [PATCH 167/462] Doc --- ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ChangeLog b/ChangeLog index 3583c10385b..d4e1356b493 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,11 @@ English Dolibarr ChangeLog -------------------------------------------------------------- ***** ChangeLog for 10.0.3 compared to 10.0.2 ***** +IMPORTANT : This version fixes a serious bug in saving the units of weight, size, surface and volume on product card. +The unit were not saved correctly in database making calculation on shipments wrong. +Update to this version must be done if you use them and have installed version 10.0.0, 10.0.1 or 10.0.2 and set some products after installing or upgrading to this version. +Once update is done you must then edit (manually) the product that has bad unit to set the correct unit to have features restored. + FIX: #11702 FIX: #11861 No consistent code to manage measuring units FIX: #11942 From 6a8e8907efc528598cec19f395a8f97e53399d19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 15 Oct 2019 17:55:07 +0200 Subject: [PATCH 168/462] Update list.php --- htdocs/comm/propal/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 893a3935cba..511166991bf 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -267,7 +267,7 @@ $sql.= ' p.rowid, p.entity, p.note_private, p.total_ht, p.tva as total_vat, p.to $sql.= ' p.datec as date_creation, p.tms as date_update,'; $sql.= " pr.rowid as project_id, pr.ref as project_ref, pr.title as project_label,"; $sql.= ' u.login'; -if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", sc.fk_soc, sc.fk_user,"; +if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", sc.fk_soc, sc.fk_user"; if ($search_categ_cus) $sql .= ", cc.fk_categorie, cc.fk_soc"; // Add fields from extrafields foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ", ef.".$key.' as options_'.$key : ''); From 4bb16770796b07b197c8e1dcdd6fe5a44efd7340 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Wed, 16 Oct 2019 10:39:35 +0200 Subject: [PATCH 169/462] Fix - Accountancy - Various payment - Subledger is not recovered in bank journal --- htdocs/accountancy/journal/bankjournal.php | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index 8003cf1c523..a532379c358 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -4,12 +4,12 @@ * Copyright (C) 2011 Juanjo Menent * Copyright (C) 2012 Regis Houssin * Copyright (C) 2013 Christophe Battarel - * Copyright (C) 2013-2018 Alexandre Spangaro + * Copyright (C) 2013-2019 Alexandre Spangaro * Copyright (C) 2013-2014 Florian Henry * Copyright (C) 2013-2014 Olivier Geffroy * Copyright (C) 2017-2018 Frédéric France - * Copyright (C) 2018 Ferran Marcet - * Copyright (C) 2018 Eric Seigne + * Copyright (C) 2018 Ferran Marcet + * Copyright (C) 2018 Eric Seigne * * 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 @@ -387,7 +387,9 @@ if ($result) { $tabpay[$obj->rowid]["paymentvariousid"] = $paymentvariousstatic->id; $paymentvariousstatic->fetch($paymentvariousstatic->id); $account_various = (! empty($paymentvariousstatic->accountancy_code) ? $paymentvariousstatic->accountancy_code : 'NotDefined'); // NotDefined is a reserved word - $tabtp[$obj->rowid][$account_various] += $obj->amount; + $account_subledger = (! empty($paymentvariousstatic->subledger_account) ? $paymentvariousstatic->subledger_account : ''); // NotDefined is a reserved word + $tabpay[$obj->rowid]["account_various"] = $account_various; + $tabtp[$obj->rowid][$account_subledger] += $obj->amount; } elseif ($links[$key]['type'] == 'payment_loan') { $paymentloanstatic->id = $links[$key]['url_id']; $paymentloanstatic->ref = $links[$key]['url_id']; @@ -660,11 +662,11 @@ if (! $error && $action == 'writebookkeeping') { $accountingaccount->fetch(null, $k, true); $bookkeeping->label_compte = $accountingaccount->label; } elseif ($tabtype[$key] == 'payment_various') { - $bookkeeping->subledger_account = ''; - $bookkeeping->subledger_label = ''; - $bookkeeping->numero_compte = $k; + $bookkeeping->subledger_account = $k; + $bookkeeping->subledger_label = $tabcompany[$key]['name']; + $bookkeeping->numero_compte = $tabpay[$obj->rowid]["account_various"]; - $accountingaccount->fetch(null, $k, true); + $accountingaccount->fetch(null, $bookkeeping->numero_compte, true); $bookkeeping->label_compte = $accountingaccount->label; } elseif ($tabtype[$key] == 'banktransfert') { $bookkeeping->subledger_account = ''; @@ -1123,6 +1125,7 @@ if (empty($action) || $action == 'view') { if ($tabtype[$key] == 'payment_salary') $account_ledger = $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT; if ($tabtype[$key] == 'payment_vat') $account_ledger = $conf->global->ACCOUNTING_VAT_PAY_ACCOUNT; if ($tabtype[$key] == 'member') $account_ledger = $conf->global->ADHERENT_SUBSCRIPTION_ACCOUNTINGACCOUNT; + if ($tabtype[$key] == 'payment_various') $account_ledger = $tabpay[$key]["account_various"]; $accounttoshow = length_accounta($account_ledger); if (empty($accounttoshow) || $accounttoshow == 'NotDefined') { @@ -1156,7 +1159,7 @@ if (empty($action) || $action == 'view') { // Subledger account print ""; - if (in_array($tabtype[$key], array('payment', 'payment_supplier', 'payment_expensereport', 'payment_salary'))) // Type of payment with subledger + if (in_array($tabtype[$key], array('payment', 'payment_supplier', 'payment_expensereport', 'payment_salary', 'payment_various'))) // Type of payment with subledger { $accounttoshowsubledger = length_accounta($k); if ($accounttoshow != $accounttoshowsubledger) From 5a1682509beb97483b41431dde8f1873d85d4a29 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Wed, 16 Oct 2019 11:11:34 +0200 Subject: [PATCH 170/462] FIX It is not possible to create an expedition if there is no unit data --- htdocs/expedition/class/expedition.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 915177164ac..1a9a249effc 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -325,8 +325,8 @@ class Expedition extends CommonObject $sql.= ", ".$this->sizeS; // TODO Should use this->trueDepth $sql.= ", ".$this->sizeW; // TODO Should use this->trueWidth $sql.= ", ".$this->sizeH; // TODO Should use this->trueHeight - $sql.= ", ".$this->weight_units; - $sql.= ", ".$this->size_units; + $sql.= ", ".($this->weight_units>0?$this->weight_units:'NULL'); + $sql.= ", ".($this->size_units>0?$this->size_units:'NULL'); $sql.= ", ".(!empty($this->note_private)?"'".$this->db->escape($this->note_private)."'":"null"); $sql.= ", ".(!empty($this->note_public)?"'".$this->db->escape($this->note_public)."'":"null"); $sql.= ", ".(!empty($this->model_pdf)?"'".$this->db->escape($this->model_pdf)."'":"null"); From 86e4ca55dfd9ec41ff43296c622231079037e302 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 16 Oct 2019 13:55:29 +0200 Subject: [PATCH 171/462] Merge --- htdocs/theme/eldy/btn.inc.php | 3 ++- htdocs/theme/md/style.css.php | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/theme/eldy/btn.inc.php b/htdocs/theme/eldy/btn.inc.php index 2e42d42acaa..3ee6a164f75 100644 --- a/htdocs/theme/eldy/btn.inc.php +++ b/htdocs/theme/eldy/btn.inc.php @@ -11,7 +11,8 @@ if (! defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?> div.divButAction { margin-bottom: 1.4em; } -div.tabsAction > a.butAction, div.tabsAction > a.butActionRefused { +div.tabsAction > a.butAction, div.tabsAction > a.butActionRefused, div.tabsAction > a.butActionDelete, +div.tabsAction > span.butAction, div.tabsAction > span.butActionRefused, div.tabsAction > span.butActionDelete { margin-bottom: 1.4em !important; } div.tabsActionNoBottom > a.butAction, div.tabsActionNoBottom > a.butActionRefused { diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 8e0cf75047b..65436182755 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -2571,7 +2571,9 @@ div.divButAction { margin-bottom: 1.4em; vertical-align: top; } -div.tabsAction > a.butAction, div.tabsAction > a.butActionRefused { + +div.tabsAction > a.butAction, div.tabsAction > a.butActionRefused, div.tabsAction > a.butActionDelete, +div.tabsAction > span.butAction, div.tabsAction > span.butActionRefused, div.tabsAction > span.butActionDelete { margin-bottom: 1.4em !important; } From 43ce1543d8f482d9cf4125e9bbbe915b201eade8 Mon Sep 17 00:00:00 2001 From: TuxGasy Date: Wed, 16 Oct 2019 17:37:20 +0200 Subject: [PATCH 172/462] Fix width unit label in product import --- htdocs/core/modules/modProduct.class.php | 2 +- htdocs/core/modules/modService.class.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/modProduct.class.php b/htdocs/core/modules/modProduct.class.php index 2b41a76ea45..f3b3cde38e5 100644 --- a/htdocs/core/modules/modProduct.class.php +++ b/htdocs/core/modules/modProduct.class.php @@ -383,7 +383,7 @@ class modProduct extends DolibarrModules 'p.length' => "Length", 'p.length_units' => "LengthUnit", 'p.width' => "Width", - 'p.width_units' => "VolumeUnits", + 'p.width_units' => "WidthUnits", 'p.height' => "Height", 'p.height_units' => "HeightUnit", 'p.surface' => "Surface", diff --git a/htdocs/core/modules/modService.class.php b/htdocs/core/modules/modService.class.php index 2f3e62903a4..20db49d5e69 100644 --- a/htdocs/core/modules/modService.class.php +++ b/htdocs/core/modules/modService.class.php @@ -360,7 +360,7 @@ class modService extends DolibarrModules 'p.length' => "Length", 'p.length_units' => "LengthUnit", 'p.width' => "Width", - 'p.width_units' => "VolumeUnits", + 'p.width_units' => "WidthUnits", 'p.height' => "Height", 'p.height_units' => "HeightUnit", 'p.surface' => "Surface", From 8a7a0b80e2728d910fcf8cdffce1742cf89af5e6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 16 Oct 2019 19:08:31 +0200 Subject: [PATCH 173/462] Fix remove warnings --- htdocs/core/class/conf.class.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index e3b6ac4e524..c595dd17938 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -226,10 +226,7 @@ class Conf $filesList = explode(":", $this->global->LOCAL_CONSTS_FILES); foreach ($filesList as $file) { $file=dol_sanitizeFileName($file); - include_once DOL_DOCUMENT_ROOT . "/".$file."/".$file."_consts.php"; - foreach ($file2bddconsts as $key=>$value) { - $this->global->$key=$value; - } + include_once DOL_DOCUMENT_ROOT . "/".$file."/".$file."_consts.php"; // This file can run code like setting $this->global->XXX vars. } } From d79340a6325aada703073a2a295e8be27234e1bd Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio Date: Thu, 17 Oct 2019 09:55:02 +0200 Subject: [PATCH 174/462] FIX: stock replenish: fetching and freeing non existing SQL result set --- htdocs/product/stock/replenish.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index cc7f5d1f2f5..0bd7f95373b 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -137,7 +137,6 @@ if ($action == 'order' && isset($_POST['valid'])) if ($qty) { //might need some value checks - $obj = $db->fetch_object($resql); $line = new CommandeFournisseurLigne($db); $line->qty = $qty; $line->fk_product = $idprod; @@ -176,7 +175,7 @@ if ($action == 'order' && isset($_POST['valid'])) $error=$db->lasterror(); dol_print_error($db); } - $db->free($resql); + unset($_POST['fourn' . $i]); } unset($_POST[$i]); From 084ab53b4b87e918e591df998f93d952959633ba Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 17 Oct 2019 12:14:38 +0200 Subject: [PATCH 175/462] Fix translation --- htdocs/core/class/discount.class.php | 27 ++++++++++++++++----------- htdocs/langs/en_US/bills.lang | 3 ++- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/htdocs/core/class/discount.class.php b/htdocs/core/class/discount.class.php index bf00f5bc91a..df25a619e9e 100644 --- a/htdocs/core/class/discount.class.php +++ b/htdocs/core/class/discount.class.php @@ -91,13 +91,15 @@ class DiscountAbsolute public $fk_facture; /** - * @var int ID credit note having caused the discount + * @var int ID credit note or deposit used to create the discount */ public $fk_facture_source; + public $ref_facture_source; // Ref credit note or deposit used to create the discount + public $type_facture_source; - public $ref_facture_source; // Ref credit note having caused the discount - - public $ref_invoice_supplier_source; + public $fk_invoice_supplier_source; + public $ref_invoice_supplier_source; // Ref credit note or deposit used to create the discount + public $type_invoice_supplier_source; /** * Constructor @@ -135,11 +137,12 @@ class DiscountAbsolute $sql.= " sr.multicurrency_amount_ht, sr.multicurrency_amount_tva, sr.multicurrency_amount_ttc,"; $sql.= " sr.fk_facture_line, sr.fk_facture, sr.fk_facture_source, sr.fk_invoice_supplier_line, sr.fk_invoice_supplier, sr.fk_invoice_supplier_source, sr.description,"; $sql.= " sr.datec,"; - $sql.= " f.ref as ref_facture_source, fsup.ref as ref_invoice_supplier_source"; + $sql.= " f.ref as ref_facture_source, f.type as type_facture_source,"; + $sql.= " fsup.ref as ref_invoice_supplier_source, fsup.type as type_invoice_supplier_source"; $sql.= " FROM ".MAIN_DB_PREFIX."societe_remise_except as sr"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as f ON sr.fk_facture_source = f.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as fsup ON sr.fk_invoice_supplier_source = fsup.rowid"; - $sql.= " WHERE sr.entity IN (".getEntity('invoice').")"; + $sql.= " WHERE sr.entity IN (".getEntity('invoice').")"; if ($rowid) $sql.= " AND sr.rowid=".$rowid; if ($fk_facture_source) $sql.= " AND sr.fk_facture_source=".$fk_facture_source; if ($fk_invoice_supplier_source) $sql.= " AND sr.fk_invoice_supplier_source=".$fk_invoice_supplier_source; @@ -168,12 +171,14 @@ class DiscountAbsolute $this->fk_user = $obj->fk_user; $this->fk_facture_line = $obj->fk_facture_line; $this->fk_facture = $obj->fk_facture; - $this->fk_facture_source = $obj->fk_facture_source; // Id avoir source - $this->ref_facture_source = $obj->ref_facture_source; // Ref avoir source + $this->fk_facture_source = $obj->fk_facture_source; // Id credit note or deposit source + $this->ref_facture_source = $obj->ref_facture_source; // Ref credit note or deposit source + $this->type_facture_source = $obj->type_facture_source; // Type credit note or deposit source $this->fk_invoice_supplier_line = $obj->fk_invoice_supplier_line; $this->fk_invoice_supplier = $obj->fk_invoice_supplier; - $this->fk_invoice_supplier_source = $obj->fk_invoice_supplier_source; // Id avoir source - $this->ref_invoice_supplier_source = $obj->ref_invoice_supplier_source; // Ref avoir source + $this->fk_invoice_supplier_source = $obj->fk_invoice_supplier_source; // Id credit note or deposit source + $this->ref_invoice_supplier_source = $obj->ref_invoice_supplier_source; // Ref credit note or deposit source + $this->type_invoice_supplier_source = $obj->type_invoice_supplier_source; // Type credit note or deposit source $this->description = $obj->description; $this->datec = $this->db->jdate($obj->datec); @@ -689,7 +694,7 @@ class DiscountAbsolute if ($option == 'invoice') { $facid=! empty($this->discount_type)?$this->fk_invoice_supplier_source:$this->fk_facture_source; $link=! empty($this->discount_type)?'/fourn/facture/card.php':'/compta/facture/card.php'; - $label=$langs->trans("ShowDiscount").': '.$this->ref_facture_source; + $label=$langs->trans("ShowSourceInvoice").': '.$this->ref_facture_source; $link = ''; $linkend=''; $ref=! empty($this->discount_type)?$this->ref_invoice_supplier_source:$this->ref_facture_source; diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index ab4d9096df2..8e922506b23 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -281,7 +281,8 @@ AddGlobalDiscount=Create absolute discount EditGlobalDiscounts=Edit absolute discounts AddCreditNote=Create credit note ShowDiscount=Show discount -ShowReduc=Show the deduction +ShowReduc=Show the discount +ShowSourceInvoice=Show the source invoice RelativeDiscount=Relative discount GlobalDiscount=Global discount CreditNote=Credit note From e709c005a084ec7ac6d09b9185d48a6eecf7c430 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 17 Oct 2019 12:28:48 +0200 Subject: [PATCH 176/462] FIX Payment was not saved on TakePOS module. --- htdocs/takepos/invoice.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 1f3d4a22563..2b8b0f21921 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -115,7 +115,7 @@ if ($action == 'valid' && $user->rights->facture->creer) $invoice = new Facture($db); $invoice->fetch($placeid); - if($invoice->total_ttc<0){ + if ($invoice->total_ttc < 0) { $invoice->type= $invoice::TYPE_CREDIT_NOTE; $sql="SELECT rowid FROM ".MAIN_DB_PREFIX."facture WHERE "; $sql.="fk_soc = '".$invoice->socid."' "; @@ -153,8 +153,10 @@ if ($action == 'valid' && $user->rights->facture->creer) $res = $invoice->validate($user); } + $remaintopay = $invoice->getRemainToPay(); + // Add the payment - if ($res > 0) { + if ($res >= 0 && $remaintopay > 0) { $payment = new Paiement($db); $payment->datepaye = $now; $payment->fk_account = $bankaccount; @@ -166,9 +168,9 @@ if ($action == 'valid' && $user->rights->facture->creer) $payment->create($user); $payment->addPaymentToBank($user, 'payment', '(CustomerInvoicePayment)', $bankaccount, '', ''); - $remaintopay = $invoice->getRemainToPay(); + $remaintopay = $invoice->getRemainToPay(); // Recalculate remain to pay after the payment is recorded if ($remaintopay == 0) { - dol_syslog("Invoice is paid, so we set it to pay"); + dol_syslog("Invoice is paid, so we set it to status Paid"); $result = $invoice->set_paid($user); if ($result > 0) $invoice->paye = 1; } else { From 1a419a6eb67bf9222f61d76dbc1b926861bdd2b8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 17 Oct 2019 15:15:16 +0200 Subject: [PATCH 177/462] Fix translation --- htdocs/langs/en_US/bills.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index 8e922506b23..ddef01b17c1 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -151,7 +151,7 @@ ErrorBillNotFound=Invoice %s does not exist ErrorInvoiceAlreadyReplaced=Error, you tried to validate an invoice to replace invoice %s. But this one has already been replaced by invoice %s. ErrorDiscountAlreadyUsed=Error, discount already used ErrorInvoiceAvoirMustBeNegative=Error, correct invoice must have a negative amount -ErrorInvoiceOfThisTypeMustBePositive=Error, this type of invoice must have a positive amount +ErrorInvoiceOfThisTypeMustBePositive=Error, this type of invoice must have an amount excluding tax positive (or null) ErrorCantCancelIfReplacementInvoiceNotValidated=Error, can't cancel an invoice that has been replaced by another invoice that is still in draft status ErrorThisPartOrAnotherIsAlreadyUsedSoDiscountSerieCantBeRemoved=This part or another is already used so discount series cannot be removed. BillFrom=From From 5e12dcc6b14f51c2766aa9c8d2db63cbf64ea2a5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 17 Oct 2019 15:40:02 +0200 Subject: [PATCH 178/462] Fix on FACTURE_ENABLE_NEGATIVE --- htdocs/compta/facture/card.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 1b6b4a50e01..cf5d3477527 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -278,8 +278,11 @@ if (empty($reshook)) $action = ''; } } else { - // Si non avoir, le signe doit etre positif - if (empty($conf->global->FACTURE_ENABLE_NEGATIVE) && $object->total_ht < 0) { + // If not a credit note, amount with tax must be positive or nul. + // Note that amount excluding tax can be negative because you can have a invoice of 100 with vat of 20 that + // consumes a credit note of 100 with vat 0 (total with tax is 0 but without tax is -20). + // For some cases, credit notes can have a vat of 0 (for example when selling goods in France). + if (empty($conf->global->FACTURE_ENABLE_NEGATIVE) && $object->total_ttc < 0) { setEventMessages($langs->trans("ErrorInvoiceOfThisTypeMustBePositive"), null, 'errors'); $action = ''; } From d388c0b0a3ed8f610394ec4684976027a00b6084 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 17 Oct 2019 16:03:07 +0200 Subject: [PATCH 179/462] Doc --- ChangeLog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ChangeLog b/ChangeLog index d4e1356b493..5093894d86b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -67,6 +67,8 @@ FIX: Update of leave request when CSRF with token is on FIX: Var not enough sanitized FIX: wrong test FIX: XSS +FIX: Can validate invoice with amount including tax of zero for the case of having a final invoice with + VAT that includes a deposit without vat. ***** ChangeLog for 10.0.2 compared to 10.0.1 ***** FIX: #10460 compatibility with MariaDB 10.4 From 3267c224ff1d99c16a68e4bd4fff73734e15ce55 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 17 Oct 2019 16:03:56 +0200 Subject: [PATCH 180/462] doc --- ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 5093894d86b..14838c1281d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,7 +5,7 @@ English Dolibarr ChangeLog ***** ChangeLog for 10.0.3 compared to 10.0.2 ***** IMPORTANT : This version fixes a serious bug in saving the units of weight, size, surface and volume on product card. The unit were not saved correctly in database making calculation on shipments wrong. -Update to this version must be done if you use them and have installed version 10.0.0, 10.0.1 or 10.0.2 and set some products after installing or upgrading to this version. +Update to this version must be done if you use them and have installed version 10.0.0, 10.0.1 or 10.0.2 and set some products after installing or upgrading to one of this version. Once update is done you must then edit (manually) the product that has bad unit to set the correct unit to have features restored. FIX: #11702 From ac46d2c9185df86b28fcddffb136c6375c22b77d Mon Sep 17 00:00:00 2001 From: Gildas Date: Thu, 17 Oct 2019 15:10:05 +0200 Subject: [PATCH 181/462] Fix filtering ticket bug (Fixes #12081) --- htdocs/ticket/list.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index 2bfc1719360..a62120f6e55 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -524,15 +524,15 @@ foreach($object->fields as $key => $val) if (! empty($arrayfields['t.'.$key]['checked'])) { if ($key == 'type_code') { print ''; - $formTicket->selectTypesTickets(dol_escape_htmltag($search[$key]), 'search_'.$key.'', '', 0, 1, 1, 0, ($val['css']?$val['css']:'maxwidth150')); + $formTicket->selectTypesTickets(dol_escape_htmltag($search[$key]), 'search_'.$key.'', '', 2, 1, 1, 0, ($val['css']?$val['css']:'maxwidth150')); print ''; } elseif ($key == 'category_code') { print ''; - $formTicket->selectGroupTickets(dol_escape_htmltag($search[$key]), 'search_'.$key.'', '', 0, 1, 1, 0, ($val['css']?$val['css']:'maxwidth150')); + $formTicket->selectGroupTickets(dol_escape_htmltag($search[$key]), 'search_'.$key.'', '', 2, 1, 1, 0, ($val['css']?$val['css']:'maxwidth150')); print ''; } elseif ($key == 'severity_code') { print ''; - $formTicket->selectSeveritiesTickets(dol_escape_htmltag($search[$key]), 'search_'.$key.'', '', 0, 1, 1, 0, ($val['css']?$val['css']:'maxwidth150')); + $formTicket->selectSeveritiesTickets(dol_escape_htmltag($search[$key]), 'search_'.$key.'', '', 2, 1, 1, 0, ($val['css']?$val['css']:'maxwidth150')); print ''; } elseif ($key == 'fk_user_assign') { print ''; From eaffe4d1eb0eaec5f2ca0a8c1355261113f556c2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 17 Oct 2019 20:13:10 +0200 Subject: [PATCH 182/462] doc --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index 14838c1281d..d1c8b22d96f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -67,6 +67,7 @@ FIX: Update of leave request when CSRF with token is on FIX: Var not enough sanitized FIX: wrong test FIX: XSS +FIX: Payment from POS ware not recorded. FIX: Can validate invoice with amount including tax of zero for the case of having a final invoice with VAT that includes a deposit without vat. From d9abbfa46110e03b9f02318b08346191af2ed495 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 17 Oct 2019 21:12:18 +0200 Subject: [PATCH 183/462] Add a message --- htdocs/filefunc.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index fffd9be3636..274f1953d40 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -165,7 +165,7 @@ if (! defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck)) if ($csrfattack) { //print 'NOCSRFCHECK='.defined('NOCSRFCHECK').' REQUEST_METHOD='.$_SERVER['REQUEST_METHOD'].' HTTP_HOST='.$_SERVER['HTTP_HOST'].' HTTP_REFERER='.$_SERVER['HTTP_REFERER']; - print "Access refused by CSRF protection in main.inc.php. Referer of form is outside server that serve the POST.\n"; + print "Access refused by CSRF protection in main.inc.php. Referer of form (".$_SERVER['HTTP_REFERER'].") is outside server that serve the POST.\n"; print "If you access your server behind a proxy using url rewriting, you might check that all HTTP header is propagated (or add the line \$dolibarr_nocsrfcheck=1 into your conf.php file).\n"; die; } From 373d6d60e7bbf9c0a75df69d5a6c304526788280 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 17 Oct 2019 21:12:18 +0200 Subject: [PATCH 184/462] Add a message --- htdocs/filefunc.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index a5d8df20cfc..3c0608c06e2 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -164,7 +164,7 @@ if (! defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck)) if ($csrfattack) { //print 'NOCSRFCHECK='.defined('NOCSRFCHECK').' REQUEST_METHOD='.$_SERVER['REQUEST_METHOD'].' HTTP_HOST='.$_SERVER['HTTP_HOST'].' HTTP_REFERER='.$_SERVER['HTTP_REFERER']; - print "Access refused by CSRF protection in main.inc.php. Referer of form is outside server that serve the POST.\n"; + print "Access refused by CSRF protection in main.inc.php. Referer of form (".$_SERVER['HTTP_REFERER'].") is outside server that serve the POST.\n"; print "If you access your server behind a proxy using url rewriting, you might check that all HTTP header is propagated (or add the line \$dolibarr_nocsrfcheck=1 into your conf.php file).\n"; die; } From d442134a51d7cbca93605d968ce2aaa18b7fb23c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 17 Oct 2019 21:15:34 +0200 Subject: [PATCH 185/462] fix cant add bookmark with csrf active --- htdocs/bookmarks/bookmarks.lib.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/bookmarks/bookmarks.lib.php b/htdocs/bookmarks/bookmarks.lib.php index 319c44c9d73..f49fd1f93a3 100644 --- a/htdocs/bookmarks/bookmarks.lib.php +++ b/htdocs/bookmarks/bookmarks.lib.php @@ -72,6 +72,7 @@ function printBookmarksList($aDb, $aLangs) $ret.= ''."\n"; $ret.= ''; + $ret.= ''; $ret.= ''; + $out.= ''; } else // In most cases, this is not used. We used instead function with no specific list of colors { diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 90cc0a142cb..34802a57a5d 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -788,12 +788,12 @@ if ($action == 'create' || $action == 'adduserldap') print ''; if (! empty($ldap_lastname)) { - print ''; + print ''; print $ldap_lastname; } else { - print ''; + print ''; } print ''; @@ -802,12 +802,12 @@ if ($action == 'create' || $action == 'adduserldap') print ''; if (! empty($ldap_firstname)) { - print ''; + print ''; print $ldap_firstname; } else { - print ''; + print ''; } print ''; @@ -816,17 +816,17 @@ if ($action == 'create' || $action == 'adduserldap') print ''; if (! empty($ldap_login)) { - print ''; + print ''; print $ldap_login; } elseif (! empty($ldap_loginsmb)) { - print ''; + print ''; print $ldap_loginsmb; } else { - print ''; + print ''; } print ''; @@ -836,7 +836,7 @@ if ($action == 'create' || $action == 'adduserldap') require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; $generated_password=getRandomPassword(false); } - $password=$generated_password; + $password=(GETPOSTISSET('password')?GETPOST('password'):$generated_password); // Password print ''.$langs->trans("Password").''; @@ -1004,12 +1004,12 @@ if ($action == 'create' || $action == 'adduserldap') print ''; if (! empty($ldap_phone)) { - print ''; + print ''; print $ldap_phone; } else { - print ''; + print ''; } print ''; @@ -1018,12 +1018,12 @@ if ($action == 'create' || $action == 'adduserldap') print ''; if (! empty($ldap_mobile)) { - print ''; + print ''; print $ldap_mobile; } else { - print ''; + print ''; } print ''; @@ -1032,12 +1032,12 @@ if ($action == 'create' || $action == 'adduserldap') print ''; if (! empty($ldap_fax)) { - print ''; + print ''; print $ldap_fax; } else { - print ''; + print ''; } print ''; @@ -1114,12 +1114,12 @@ if ($action == 'create' || $action == 'adduserldap') print ''; if (! empty($ldap_mail)) { - print ''; + print ''; print $ldap_mail; } else { - print ''; + print ''; } print ''; @@ -1128,7 +1128,7 @@ if ($action == 'create' || $action == 'adduserldap') { print ''.$langs->trans("AccountancyCode").''; print ''; - print ''; + print ''; print ''; } @@ -1137,7 +1137,7 @@ if ($action == 'create' || $action == 'adduserldap') { print ''.$langs->trans("ColorUser").''; print ''; - print $formother->selectColor(GETPOST('color')?GETPOST('color'):$object->color, 'color', null, 1, '', 'hideifnotset'); + print $formother->selectColor(GETPOSTISSET('color')?GETPOST('color', 'alphanohtml'):$object->color, 'color', null, 1, '', 'hideifnotset'); print ''; } @@ -1183,7 +1183,7 @@ if ($action == 'create' || $action == 'adduserldap') print $langs->trans("Note"); print ''; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor=new DolEditor('note', '', '', 120, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_3, '90%'); + $doleditor=new DolEditor('note', GETPOSTISSET('note')?GETPOST('note', 'none'):'', '', 120, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_3, '90%'); $doleditor->Create(); print "\n"; @@ -1204,7 +1204,7 @@ if ($action == 'create' || $action == 'adduserldap') // Position/Job print ''.$langs->trans("PostOrFunction").''; print ''; - print ''; + print ''; print ''; // Default warehouse @@ -1226,7 +1226,7 @@ if ($action == 'create' || $action == 'adduserldap') print $form->textwithpicto($text, $langs->trans("THMDescription"), 1, 'help', 'classthm'); print ''; print ''; - print ''; + print ''; print ''; print "\n"; @@ -1236,14 +1236,14 @@ if ($action == 'create' || $action == 'adduserldap') print $form->textwithpicto($text, $langs->trans("TJMDescription"), 1, 'help', 'classtjm'); print ''; print ''; - print ''; + print ''; print ''; print "\n"; // Salary print ''.$langs->trans("Salary").''; print ''; - print ''; + print ''; print ''; print "\n"; } @@ -1251,7 +1251,7 @@ if ($action == 'create' || $action == 'adduserldap') // Weeklyhours print ''.$langs->trans("WeeklyHours").''; print ''; - print ''; + print ''; print ''; print "\n"; @@ -2446,7 +2446,7 @@ else print ''; if ($caneditfield) { - print $formother->selectColor(GETPOST('color')?GETPOST('color'):$object->color, 'color', null, 1, '', 'hideifnotset'); + print $formother->selectColor(GETPOSTISSET('color')?GETPOST('color', 'alphanohtml'):$object->color, 'color', null, 1, '', 'hideifnotset'); }else{ print $formother->showColor($object->color, ''); } From 7e52c70321fdd5270f7ae94419e8858b6ea50a30 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 Nov 2019 21:16:18 +0100 Subject: [PATCH 247/462] FIX Advisory ID: usd20190067 --- htdocs/core/lib/functions.lib.php | 6 ++++-- htdocs/fourn/class/fournisseur.product.class.php | 2 +- htdocs/product/fournisseurs.php | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 9d926b3bc98..071b7a3b794 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5134,16 +5134,18 @@ function get_default_npr(Societe $thirdparty_seller, Societe $thirdparty_buyer, if ($idprodfournprice > 0) { - if (! class_exists('ProductFournisseur')) + if (! class_exists('ProductFournisseur')) { require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.product.class.php'; + } $prodprice = new ProductFournisseur($db); $prodprice->fetch_product_fournisseur_price($idprodfournprice); return $prodprice->fourn_tva_npr; } elseif ($idprod > 0) { - if (! class_exists('Product')) + if (! class_exists('Product')) { require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; + } $prod = new Product($db); $prod->fetch($idprod); return $prod->tva_npr; diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index faa681b0e88..786a650efb3 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -499,7 +499,7 @@ class ProductFournisseur extends Product $sql.= " pfp.multicurrency_price, pfp.multicurrency_unitprice, pfp.multicurrency_tx, pfp.fk_multicurrency, pfp.multicurrency_code,"; $sql.=" pfp.barcode, pfp.fk_barcode_type"; $sql.= " FROM ".MAIN_DB_PREFIX."product_fournisseur_price as pfp"; - $sql.= " WHERE pfp.rowid = ".$rowid; + $sql.= " WHERE pfp.rowid = ".(int) $rowid; dol_syslog(get_class($this)."::fetch_product_fournisseur_price", LOG_DEBUG); $resql = $this->db->query($sql); diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index 560f5b1b574..0bda7d44564 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -254,8 +254,8 @@ if (empty($reshook)) { $supplier=new Fournisseur($db); $result=$supplier->fetch($id_fourn); - if (isset($_POST['ref_fourn_price_id'])) - $object->fetch_product_fournisseur_price($_POST['ref_fourn_price_id']); + if (GETPOSTISSET('ref_fourn_price_id')) + $object->fetch_product_fournisseur_price(GETPOST('ref_fourn_price_id', 'int')); $newprice = price2num(GETPOST("price", "alpha")); From 3937b45c5f18a8964299081538bcee7a406a8286 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sat, 16 Nov 2019 07:51:38 +0100 Subject: [PATCH 248/462] Core - Fix accountancy write social contribution in bookkeeping (Need for FEC format) --- htdocs/accountancy/journal/bankjournal.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index a532379c358..16996358425 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -632,7 +632,9 @@ if (! $error && $action == 'writebookkeeping') { $bookkeeping->subledger_account = ''; $bookkeeping->subledger_label = ''; $bookkeeping->numero_compte = $k; - $bookkeeping->label_compte = $objmid->labelc; + + $accountingaccount->fetch(null, $k, true); + $bookkeeping->label_compte = $accountingaccount->label; } elseif ($tabtype[$key] == 'payment_vat') { $bookkeeping->subledger_account = ''; $bookkeeping->subledger_label = ''; From 79ee2b8c4d1816f1bbb77713c385d823880fb6a2 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 18 Nov 2019 11:48:44 +0100 Subject: [PATCH 249/462] Missing language key --- htdocs/langs/en_US/stocks.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/langs/en_US/stocks.lang b/htdocs/langs/en_US/stocks.lang index 17f914b7405..96e4a911d10 100644 --- a/htdocs/langs/en_US/stocks.lang +++ b/htdocs/langs/en_US/stocks.lang @@ -210,3 +210,4 @@ StockIncreaseAfterCorrectTransfer=Increase by correction/transfer StockDecreaseAfterCorrectTransfer=Decrease by correction/transfer StockIncrease=Stock increase StockDecrease=Stock decrease +StockIsRequiredToChooseWhichLotToUse=Stock is required to choose which lot to use From 99f93dbbf5894ee0ed8f8447069a976f13786e7a Mon Sep 17 00:00:00 2001 From: atm-greg Date: Mon, 18 Nov 2019 14:33:01 +0100 Subject: [PATCH 250/462] fix bad getpost --- htdocs/contact/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index cfe86fb3793..909dfd9e2e2 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -927,7 +927,7 @@ else // Civility print ''; - print $formcompany->select_civility(GETPOSTISSET("civility_code")?GETPOST("civility", "aZ09"):$object->civility_code, 'civility_code'); + print $formcompany->select_civility(GETPOSTISSET("civility_code")?GETPOST("civility_code", "aZ09"):$object->civility_code, 'civility_code'); print ''; print ''; From 74c85b742e4836406abffb9934f2e64ec48d7145 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 Nov 2019 18:09:12 +0100 Subject: [PATCH 251/462] Fix ref must be null until the generation of ref is ok --- htdocs/install/mysql/migration/9.0.0-10.0.0.sql | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/install/mysql/migration/9.0.0-10.0.0.sql b/htdocs/install/mysql/migration/9.0.0-10.0.0.sql index e9130c5d5c4..df796e54f49 100644 --- a/htdocs/install/mysql/migration/9.0.0-10.0.0.sql +++ b/htdocs/install/mysql/migration/9.0.0-10.0.0.sql @@ -328,6 +328,9 @@ UPDATE llx_c_shipment_mode SET label = 'https://www.laposte.fr/outils/suivre-vos UPDATE llx_c_shipment_mode SET label = 'https://www.laposte.fr/outils/suivre-vos-envois?code={TRACKID}' WHERE code IN ('LETTREMAX'); +-- VMYSQL4.3 ALTER TABLE llx_holiday MODIFY COLUMN ref varchar(30) NULL; +-- VPGSQL8.2 ALTER TABLE llx_holiday ALTER COLUMN ref DROP NOT NULL; + create table llx_reception ( From 918f476c2b802f6770fb5f127ffe5091c765e7f5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 Nov 2019 19:02:12 +0100 Subject: [PATCH 252/462] Fix backport fix not checking mandatory extrafields of type select --- htdocs/core/class/extrafields.class.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index b3c257bfaaa..5b171d70bfb 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1830,7 +1830,7 @@ class ExtraFields function setOptionalsFromPost($extralabels, &$object, $onlykey='') { global $_POST, $langs; - $nofillrequired='';// For error when required field left blank + $nofillrequired=0;// For error when required field left blank $error_field_required = array(); if (is_array($this->attributes[$object->table_element]['label'])) $extralabels=$this->attributes[$object->table_element]['label']; @@ -1861,8 +1861,9 @@ class ExtraFields if ($this->attributes[$object->table_element]['required'][$key]) // Value is required { // Check if empty without using GETPOST, value can be alpha, int, array, etc... - if ((! is_array($_POST["options_".$key]) && empty($_POST["options_".$key]) && $_POST["options_".$key] != '0') - || (is_array($_POST["options_".$key]) && empty($_POST["options_".$key]))) + if ((! is_array($_POST["options_".$key]) && empty($_POST["options_".$key]) && $this->attributes[$object->table_element]['type'][$key] != 'select' && $_POST["options_".$key] != '0') + || (! is_array($_POST["options_".$key]) && empty($_POST["options_".$key]) && $this->attributes[$object->table_element]['type'][$key] == 'select') + || (is_array($_POST["options_".$key]) && empty($_POST["options_".$key]))) { //print 'ccc'.$value.'-'.$this->attributes[$object->table_element]['required'][$key]; $nofillrequired++; From 010219bf097851bc40db06114efe5ef3f93b6a3f Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Mon, 18 Nov 2019 19:47:34 +0100 Subject: [PATCH 253/462] fix title pasge linked files user --- htdocs/user/document.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/user/document.php b/htdocs/user/document.php index 91d0e7219ce..3b0282179d2 100644 --- a/htdocs/user/document.php +++ b/htdocs/user/document.php @@ -115,8 +115,7 @@ if (empty($reshook)) { $form = new Form($db); -$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; -llxHeader('', $langs->trans("ThirdParty").' - '.$langs->trans("Files"), $help_url); +llxHeader('', $langs->trans("UserCard").' - '.$langs->trans("Files")); if ($object->id) { From 8f5c8c63dfb7fbce04356d7c73c688d5f66e585a Mon Sep 17 00:00:00 2001 From: John Botella Date: Tue, 19 Nov 2019 16:35:31 +0100 Subject: [PATCH 254/462] Fix dom and showOptionals call --- htdocs/expedition/card.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index be5ed4c757a..a33055d4b10 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -2443,10 +2443,10 @@ elseif ($id || $ref) // Display lines extrafields if (is_array($extralabelslines) && count($extralabelslines)>0) { $colspan= empty($conf->productbatch->enabled) ? 5 : 6; - $line = new ExpeditionLigne($db); - $line->fetch_optionals($lines[$i]->id); - print ''; - if ($action == 'editline' && $lines[$i]->id == $line_id) + $line = $lines[$i]; + $line->fetch_optionals($line->id); + + if ($action == 'editline' && $line->id == $line_id) { print $line->showOptionals($extrafieldsline, 'edit', array('style'=>$bc[$var], 'colspan'=>$colspan), $indiceAsked); } @@ -2454,7 +2454,6 @@ elseif ($id || $ref) { print $line->showOptionals($extrafieldsline, 'view', array('style'=>$bc[$var], 'colspan'=>$colspan), $indiceAsked); } - print ''; } } } From f73bd0e0a6fba4087e50e1f1548870b0068805ea Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Wed, 20 Nov 2019 13:07:26 +0100 Subject: [PATCH 255/462] FIX display job of contact list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit can see différent contact with same name but different job --- htdocs/comm/action/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 4e5abac75d3..c057dc2dee3 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -1290,7 +1290,7 @@ if ($id > 0) // related contact print ''.$langs->trans("ActionOnContact").''; print '
'; - print $form->selectcontacts($object->socid, array_keys($object->socpeopleassigned), 'socpeopleassigned[]', 1, '', '', 0, 'quatrevingtpercent', false, 0, 0, array(), 'multiple', 'contactid'); + print $form->selectcontacts($object->socid, array_keys($object->socpeopleassigned), 'socpeopleassigned[]', 1, '', '', 1, 'quatrevingtpercent', false, 0, 0, array(), 'multiple', 'contactid'); print '
'; print ''; print ''; From 3daeb24da1ff2adf2d0c312156c41bb46254441f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 21 Nov 2019 13:05:13 +0100 Subject: [PATCH 256/462] Fix confusion with field name in sql --- htdocs/comm/remx.php | 41 +++++++++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/htdocs/comm/remx.php b/htdocs/comm/remx.php index eabb217fb99..7a8b03cde4e 100644 --- a/htdocs/comm/remx.php +++ b/htdocs/comm/remx.php @@ -739,8 +739,8 @@ if ($socid > 0) $sql.= " rc.datec as dc, rc.description, rc.fk_facture_line, rc.fk_facture,"; $sql.= " rc.fk_facture_source,"; $sql.= " u.login, u.rowid as user_id,"; - $sql.= " f.rowid, f.ref,"; - $sql.= " fa.ref as ref, fa.type as type"; + $sql.= " f.rowid as invoiceid, f.ref,"; + $sql.= " fa.ref as invoice_source_ref, fa.type as type"; $sql.= " FROM ".MAIN_DB_PREFIX."facture as f"; $sql.= " , ".MAIN_DB_PREFIX."user as u"; $sql.= " , ".MAIN_DB_PREFIX."facturedet as fc"; @@ -758,8 +758,8 @@ if ($socid > 0) $sql2.= " rc.datec as dc, rc.description, rc.fk_facture_line, rc.fk_facture,"; $sql2.= " rc.fk_facture_source,"; $sql2.= " u.login, u.rowid as user_id,"; - $sql2.= " f.rowid, f.ref,"; - $sql2.= " fa.ref as ref, fa.type as type"; + $sql2.= " f.rowid as invoiceid, f.ref,"; + $sql2.= " fa.ref as invoice_source_ref, fa.type as type"; $sql2.= " FROM ".MAIN_DB_PREFIX."facture as f"; $sql2.= " , ".MAIN_DB_PREFIX."user as u"; $sql2.= " , ".MAIN_DB_PREFIX."societe_remise_except as rc"; @@ -833,7 +833,7 @@ if ($socid > 0) { print ''; $facturestatic->id=$obj->fk_facture_source; - $facturestatic->ref=$obj->ref; + $facturestatic->ref=$obj->invoice_source_ref; $facturestatic->type=$obj->type; print preg_replace('/\(CREDIT_NOTE\)/', $langs->trans("CreditNote"), $obj->description).' '.$facturestatic->getNomURl(1); print ''; @@ -842,7 +842,7 @@ if ($socid > 0) { print ''; $facturestatic->id=$obj->fk_facture_source; - $facturestatic->ref=$obj->ref; + $facturestatic->ref=$obj->invoice_source_ref; $facturestatic->type=$obj->type; print preg_replace('/\(DEPOSIT\)/', $langs->trans("InvoiceDeposit"), $obj->description).' '.$facturestatic->getNomURl(1); print ''; @@ -851,7 +851,7 @@ if ($socid > 0) { print ''; $facturestatic->id=$obj->fk_facture_source; - $facturestatic->ref=$obj->ref; + $facturestatic->ref=$obj->invoice_source_ref; $facturestatic->type=$obj->type; print preg_replace('/\(EXCESS RECEIVED\)/', $langs->trans("Invoice"), $obj->description).' '.$facturestatic->getNomURl(1); print ''; @@ -862,7 +862,12 @@ if ($socid > 0) print $obj->description; print ''; } - print ''.img_object($langs->trans("ShowBill"), 'bill').' '.$obj->ref.''; + print ''; + if ($obj->invoiceid) + { + print ''.img_object($langs->trans("ShowBill"), 'bill').' '.$obj->ref.''; + } + print ''; print ''.price($obj->amount_ht).''; if (! empty($conf->multicurrency->enabled)) { @@ -909,8 +914,8 @@ if ($socid > 0) $sql.= " rc.datec as dc, rc.description, rc.fk_invoice_supplier_line, rc.fk_invoice_supplier,"; $sql.= " rc.fk_invoice_supplier_source,"; $sql.= " u.login, u.rowid as user_id,"; - $sql.= " f.rowid, f.ref as ref,"; - $sql.= " fa.ref, fa.type as type"; + $sql.= " f.rowid as invoiceid, f.ref as ref,"; + $sql.= " fa.ref as invoice_source_ref, fa.type as type"; $sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; $sql.= " , ".MAIN_DB_PREFIX."user as u"; $sql.= " , ".MAIN_DB_PREFIX."facture_fourn_det as fc"; @@ -928,8 +933,8 @@ if ($socid > 0) $sql2.= " rc.datec as dc, rc.description, rc.fk_invoice_supplier_line, rc.fk_invoice_supplier,"; $sql2.= " rc.fk_invoice_supplier_source,"; $sql2.= " u.login, u.rowid as user_id,"; - $sql2.= " f.rowid, f.ref as ref,"; - $sql2.= " fa.ref, fa.type as type"; + $sql2.= " f.rowid as invoiceid, f.ref as ref,"; + $sql2.= " fa.ref as invoice_source_ref, fa.type as type"; $sql2.= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; $sql2.= " , ".MAIN_DB_PREFIX."user as u"; $sql2.= " , ".MAIN_DB_PREFIX."societe_remise_except as rc"; @@ -1003,7 +1008,7 @@ if ($socid > 0) { print ''; $facturefournstatic->id=$obj->fk_invoice_supplier_source; - $facturefournstatic->ref=$obj->ref; + $facturefournstatic->ref=$obj->invoice_source_ref; $facturefournstatic->type=$obj->type; print preg_replace('/\(CREDIT_NOTE\)/', $langs->trans("CreditNote"), $obj->description).' '.$facturefournstatic->getNomURl(1); print ''; @@ -1012,7 +1017,7 @@ if ($socid > 0) { print ''; $facturefournstatic->id=$obj->fk_invoice_supplier_source; - $facturefournstatic->ref=$obj->ref; + $facturefournstatic->ref=$obj->invoice_source_ref; $facturefournstatic->type=$obj->type; print preg_replace('/\(DEPOSIT\)/', $langs->trans("InvoiceDeposit"), $obj->description).' '.$facturefournstatic->getNomURl(1); print ''; @@ -1021,7 +1026,7 @@ if ($socid > 0) { print ''; $facturefournstatic->id=$obj->fk_invoice_supplier_source; - $facturefournstatic->ref=$obj->ref; + $facturefournstatic->ref=$obj->invoice_source_ref; $facturefournstatic->type=$obj->type; print preg_replace('/\(EXCESS PAID\)/', $langs->trans("Invoice"), $obj->description).' '.$facturefournstatic->getNomURl(1); print ''; @@ -1032,7 +1037,11 @@ if ($socid > 0) print $obj->description; print ''; } - print ''.img_object($langs->trans("ShowBill"), 'bill').' '.$obj->ref.''; + print ''; + if ($obj->invoiceid) { + print ''.img_object($langs->trans("ShowBill"), 'bill').' '.$obj->ref.''; + } + print ''; print ''.price($obj->amount_ht).''; if (! empty($conf->multicurrency->enabled)) { From a8d02615a843a5b9debf34d80a64a1245fe937ef Mon Sep 17 00:00:00 2001 From: gauthier Date: Thu, 21 Nov 2019 14:58:20 +0100 Subject: [PATCH 257/462] FIX : we need to be able to recalculate tva only if invoice not ventil --- htdocs/fourn/facture/card.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index a294cf3c6ad..f82a2aeac0b 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2642,11 +2642,14 @@ else else $calculationrule=(empty($conf->global->MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND)?'totalofround':'roundoftotal'); if ($calculationrule == 'totalofround') $calculationrulenum=1; else $calculationrulenum=2; - $s=$langs->trans("ReCalculate").' '; - $s.=''.$langs->trans("Mode1").''; - $s.=' / '; - $s.=''.$langs->trans("Mode2").''; - print $form->textwithtooltip($s, $langs->trans("CalculationRuleDesc",$calculationrulenum).'
'.$langs->trans("CalculationRuleDescSupplier"), 2, 1, img_picto('','help')); + + if(empty($object->getVentilExportCompta())) { + $s=$langs->trans("ReCalculate").' '; + $s.=''.$langs->trans("Mode1").''; + $s.=' / '; + $s.=''.$langs->trans("Mode2").''; + print $form->textwithtooltip($s, $langs->trans("CalculationRuleDesc",$calculationrulenum).'
'.$langs->trans("CalculationRuleDescSupplier"), 2, 1, img_picto('','help')); + } print '
'; // Amount Local Taxes From 5fdd6f698d3b550c7537d37deab1e54b69a50033 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 21 Nov 2019 20:45:19 +0100 Subject: [PATCH 258/462] More complete error message Conflicts: htdocs/core/class/CMailFile.class.php --- htdocs/core/class/CMailFile.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index bf9b617693f..9b1a5a69525 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -752,9 +752,9 @@ class CMailFile } else { - if (empty($this->error)) $this->error=$result; - dol_syslog("CMailFile::sendfile: mail end error=".$this->error, LOG_ERR); - $res=false; + if (empty($this->error)) $this->error = $result; + dol_syslog("CMailFile::sendfile: mail end error with smtps lib to HOST=".$server.", PORT=".$conf->global->$keyforsmtpport."
".$this->error, LOG_ERR); + $res = false; } } } From 4043356f3a7ac51122d08d6bf23776a470cec010 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 22 Nov 2019 14:25:32 +0100 Subject: [PATCH 259/462] Update card.php --- htdocs/fourn/facture/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index f82a2aeac0b..1fd48033047 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2643,7 +2643,7 @@ else if ($calculationrule == 'totalofround') $calculationrulenum=1; else $calculationrulenum=2; - if(empty($object->getVentilExportCompta())) { + if (empty($object->getVentilExportCompta())) { $s=$langs->trans("ReCalculate").' '; $s.=''.$langs->trans("Mode1").''; $s.=' / '; From cf0311dd6ad1579cb7cdc6c65d38e55fb32041f2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 22 Nov 2019 16:13:22 +0100 Subject: [PATCH 260/462] FIX Hook getAccessForbiddenMessage was missing parameters --- htdocs/core/lib/security.lib.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index 051f3a5392a..71d52f1bd9d 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -413,7 +413,8 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f if (! empty($objectid) && $objectid > 0) { $ok = checkUserAccessToObject($user, $featuresarray, $objectid, $tableandshare, $feature2, $dbt_keyfield, $dbt_select); - return $ok ? 1 : accessforbidden(); + $params=array('objectid' => $objectid, 'features' => join(',', $featuresarray), 'features2' => $feature2); + return $ok ? 1 : accessforbidden('', 1, 1, 0, $params); } return 1; @@ -651,13 +652,14 @@ function checkUserAccessToObject($user, $featuresarray, $objectid = 0, $tableand * Show a message to say access is forbidden and stop program * Calling this function terminate execution of PHP. * - * @param string $message Force error message - * @param int $printheader Show header before - * @param int $printfooter Show footer after - * @param int $showonlymessage Show only message parameter. Otherwise add more information. + * @param string $message Force error message + * @param int $printheader Show header before + * @param int $printfooter Show footer after + * @param int $showonlymessage Show only message parameter. Otherwise add more information. + * @param array|null $params Send params * @return void */ -function accessforbidden($message = '', $printheader = 1, $printfooter = 1, $showonlymessage = 0) +function accessforbidden($message = '', $printheader = 1, $printfooter = 1, $showonlymessage = 0, $params = null) { global $conf, $db, $user, $langs, $hookmanager; if (! is_object($langs)) @@ -688,7 +690,7 @@ function accessforbidden($message = '', $printheader = 1, $printfooter = 1, $sho // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('main')); } - $parameters = array('message'=>$message); + $parameters = array('message'=>$message, 'params'=>$params); $reshook=$hookmanager->executeHooks('getAccessForbiddenMessage', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks print $hookmanager->resPrint; if (empty($reshook)) From 27e4c66dd5c91a926bf843d47c44d60402878e85 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 24 Nov 2019 18:11:11 +0100 Subject: [PATCH 261/462] Fix empty --- htdocs/fourn/facture/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 1fd48033047..cba4a5f8b67 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -906,7 +906,7 @@ if (empty($reshook)) // FIXME Missing special_code into addline and updateline methods $object->special_code = $lines[$i]->special_code; - + // FIXME Missing $lines[$i]->ref_supplier and $lines[$i]->label into addline and updateline methods. They are filled when coming from order for example. $result = $object->addline( $desc, @@ -2643,7 +2643,7 @@ else if ($calculationrule == 'totalofround') $calculationrulenum=1; else $calculationrulenum=2; - if (empty($object->getVentilExportCompta())) { + if ($object->getVentilExportCompta() != 0) { $s=$langs->trans("ReCalculate").' '; $s.=''.$langs->trans("Mode1").''; $s.=' / '; From 98a7a5559fb0bd1a4777b3b5c5cbe8c439faf810 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 24 Nov 2019 18:12:40 +0100 Subject: [PATCH 262/462] Fix bad fix --- htdocs/fourn/facture/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index cba4a5f8b67..9933217a8bb 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2643,7 +2643,7 @@ else if ($calculationrule == 'totalofround') $calculationrulenum=1; else $calculationrulenum=2; - if ($object->getVentilExportCompta() != 0) { + if ($object->getVentilExportCompta() == 0) { $s=$langs->trans("ReCalculate").' '; $s.=''.$langs->trans("Mode1").''; $s.=' / '; From 1a43b58f8ab3cfda3a7dd4d2c779e993c0fbd64d Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 25 Nov 2019 10:03:35 +0100 Subject: [PATCH 263/462] FIX compatibility with Multicompany --- htdocs/public/ticket/create_ticket.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/public/ticket/create_ticket.php b/htdocs/public/ticket/create_ticket.php index b2434e7d826..a6d18937da4 100644 --- a/htdocs/public/ticket/create_ticket.php +++ b/htdocs/public/ticket/create_ticket.php @@ -53,7 +53,6 @@ $object = new Ticket($db); $extrafields = new ExtraFields($db); $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); - /* * Actions */ @@ -359,7 +358,7 @@ if ($action != "infos_success") { $formticket->withfile = 2; $formticket->action = 'create_ticket'; - $formticket->param = array('returnurl' => $_SERVER['PHP_SELF']); + $formticket->param = array('returnurl' => $_SERVER['PHP_SELF'].($conf->entity > 1 ? '?entity='.$conf->entity : '')); if (empty($defaultref)) { $defaultref = ''; From 60f19d134c0794ae4a78d703e7d9bc2dd5fcc48c Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Tue, 26 Nov 2019 03:58:01 +0100 Subject: [PATCH 264/462] Fix Ticket - Align language type with datas for translation --- htdocs/langs/en_US/ticket.lang | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/langs/en_US/ticket.lang b/htdocs/langs/en_US/ticket.lang index 70bd8220af0..f0e0ff8b726 100644 --- a/htdocs/langs/en_US/ticket.lang +++ b/htdocs/langs/en_US/ticket.lang @@ -33,8 +33,9 @@ TicketDictSeverity=Ticket - Severities TicketTypeShortBUGSOFT=Dysfonctionnement logiciel TicketTypeShortBUGHARD=Dysfonctionnement matériel TicketTypeShortCOM=Commercial question -TicketTypeShortINCIDENT=Request for assistance -TicketTypeShortPROJET=Project +TicketTypeShortISSUE=Request for assistance +TicketTypeShortREQUEST=Change or enhancement request +TicketTypeShortPROJECT=Project TicketTypeShortOTHER=Other TicketSeverityShortLOW=Low From 6cc61fef9c3001da486b5bc6a03c243c7b5664f5 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Tue, 26 Nov 2019 04:32:38 +0100 Subject: [PATCH 265/462] Fix Ticket - Deprecated
--- htdocs/core/class/html.formticket.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 747b2dbdf8b..1e51d54f37e 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -419,14 +419,14 @@ class FormTicket if ($withdolfichehead) dol_fiche_end(); - print '
'; + print '
'; print ''; if ($this->withcancel) { - print "     "; + print "      "; print "trans("Cancel") . "\">"; } - print "
\n"; + print ''; print "\n"; print "\n"; From 6a210945b7d70256f3386bdeca41972cd0eed90d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 26 Nov 2019 20:38:06 +0100 Subject: [PATCH 266/462] Prepare 10.0.4 --- htdocs/filefunc.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index 274f1953d40..7c71221ba3c 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -31,7 +31,7 @@ */ if (! defined('DOL_APPLICATION_TITLE')) define('DOL_APPLICATION_TITLE', 'Dolibarr'); -if (! defined('DOL_VERSION')) define('DOL_VERSION', '10.0.3'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c +if (! defined('DOL_VERSION')) define('DOL_VERSION', '10.0.4'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c if (! defined('EURO')) define('EURO', chr(128)); From 355d7545f62beb5658c948bb2b0f8743ae3e9813 Mon Sep 17 00:00:00 2001 From: altairis Date: Wed, 27 Nov 2019 10:23:01 +0100 Subject: [PATCH 267/462] filter language is an array --- 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 9411e8bc824..7b885d36a52 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -741,7 +741,7 @@ class FormFile $defaultlang=$codelang?$codelang:$langs->getDefaultLang(); $morecss='maxwidth150'; if ($conf->browser->layout == 'phone') $morecss='maxwidth100'; - $out.= $formadmin->select_language($defaultlang, 'lang_id', 0, 0, 0, 0, 0, $morecss); + $out.= $formadmin->select_language($defaultlang, 'lang_id', 0, null, 0, 0, 0, $morecss); } else { From 425f88082fbd26b1a45c2805add7b9a76c20f75b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 27 Nov 2019 11:53:37 +0100 Subject: [PATCH 268/462] Prepare 10.0.4 --- ChangeLog | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/ChangeLog b/ChangeLog index 9cb2225cd08..99e70e960c9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,31 @@ English Dolibarr ChangeLog -------------------------------------------------------------- + +***** ChangeLog for 10.0.4 compared to 10.0.3 ***** +FIX: The pdf templates were using the large logo making PDF too large (and edition of proposal, order, invoice VERY slow) +FIX: #12258 +FIX: #12319 Restore feature ACCOUNTANCY_AUTOFILL_ACCOUNT_WITH_GENERIC. +FIX: #12356 +FIX: #12372 +FIX: #12385 +FIX: Advisory ID: usd20190053 +FIX: Advisory ID: usd20190067 +FIX: Avoid fatal error when creating thumb from PDF +FIX: compatibility with Multicompany +FIX: display job of contact list +FIX: Extrafields missing in export of expense report +FIX: Hook getAccessForbiddenMessage was missing parameters +FIX: limit 20 prevent to see all products/services +FIX: Search on leave request ref +FIX: security check. A user can see holiday with link without permissions +FIX: Set unpaid of expense report +FIX: shipping extrafields line +FIX: the SELECT examine more than MAX_JOIN_SIZE rows #12305 +FIX: triggers: directories read with opendir() never closed +FIX: we need to be able to recalculate tva only if invoice not in accountancy +FIX: wrong invoice id for fetchObjetctLinked + ***** ChangeLog for 10.0.3 compared to 10.0.2 ***** IMPORTANT : This version fixes a serious bug in saving the units of weight, size, surface and volume on product card. The unit were not saved correctly in database making calculation on shipments wrong. From 3acd0bc2ff1231484f2518b0def3ca2dd8b4f85e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 29 Nov 2019 11:32:09 +0100 Subject: [PATCH 269/462] FIX Reduce number of request for list of products --- htdocs/core/lib/product.lib.php | 62 +++++++++++++++++++-------------- htdocs/product/list.php | 14 +++++--- 2 files changed, 46 insertions(+), 30 deletions(-) diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index 6701a82b31b..f54f39b20f3 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -509,36 +509,46 @@ function measuring_units_string($scale = '', $measuring_style = '', $unit = 0, $ function measuringUnitString($unit, $measuring_style = '', $scale = '', $use_short_label = 0) { global $langs, $db; - require_once DOL_DOCUMENT_ROOT.'/core/class/cunits.class.php'; - $measuringUnits= new CUnits($db); + global $measuring_unit_cache; - if ($scale !== '') + if (empty($measuring_unit_cache[$unit.'_'.$measuring_style.'_'.$scale.'_'.$use_short_label])) { - $arrayforfilter = array( - 't.scale' => $scale, - 't.unit_type' => $measuring_style, - 't.active' => 1 - ); - } - else - { - $arrayforfilter = array( - 't.rowid' => $unit, - 't.unit_type' => $measuring_style, - 't.active' => 1 - ); - } - $result = $measuringUnits->fetchAll('', '', 0, 0, $arrayforfilter); + require_once DOL_DOCUMENT_ROOT.'/core/class/cunits.class.php'; + $measuringUnits= new CUnits($db); - if ($result<0) { - return -1; - } else { - if (is_array($measuringUnits->records) && count($measuringUnits->records)>0) { - if ($use_short_label) return $measuringUnits->records[key($measuringUnits->records)]->short_label; - else return $langs->transnoentitiesnoconv($measuringUnits->records[key($measuringUnits->records)]->label); - } else { - return ''; + if ($scale !== '') + { + $arrayforfilter = array( + 't.scale' => $scale, + 't.unit_type' => $measuring_style, + 't.active' => 1 + ); } + else + { + $arrayforfilter = array( + 't.rowid' => $unit, + 't.unit_type' => $measuring_style, + 't.active' => 1 + ); + } + $result = $measuringUnits->fetchAll('', '', 0, 0, $arrayforfilter); + + if ($result < 0) { + return -1; + } else { + if (is_array($measuringUnits->records) && count($measuringUnits->records)>0) { + if ($use_short_label) $labeltoreturn = $measuringUnits->records[key($measuringUnits->records)]->short_label; + else $labeltoreturn = $langs->transnoentitiesnoconv($measuringUnits->records[key($measuringUnits->records)]->label); + } else { + $labeltoreturn = ''; + } + $measuring_unit_cache[$unit.'_'.$measuring_style.'_'.$scale.'_'.$use_short_label] = $labeltoreturn; + return $labeltoreturn; + } + } + else { + return $measuring_unit_cache[$unit.'_'.$measuring_style.'_'.$scale.'_'.$use_short_label]; } } diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 6e870c05740..cfa330196d9 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -783,7 +783,7 @@ if ($resql) $obj = $db->fetch_object($resql); // Multilangs - if (! empty($conf->global->MAIN_MULTILANGS)) // si l'option est active + if (! empty($conf->global->MAIN_MULTILANGS)) // If multilang is enabled { $sql = "SELECT label"; $sql.= " FROM ".MAIN_DB_PREFIX."product_lang"; @@ -801,7 +801,8 @@ if ($resql) $product_static->id = $obj->rowid; $product_static->ref = $obj->ref; - $product_static->ref_fourn = $obj->ref_supplier; + $product_static->ref_fourn = $obj->ref_supplier; // deprecated + $product_static->ref_supplier = $obj->ref_supplier; $product_static->label = $obj->label; $product_static->type = $obj->fk_product_type; $product_static->status_buy = $obj->tobuy; @@ -826,15 +827,17 @@ if ($resql) $product_static->surface = $obj->surface; $product_static->surface_units = $obj->surface_units; + // STOCK_DISABLE_OPTIM_LOAD can be set to force load_stock whatever is permissions on stock. if ((! empty($conf->stock->enabled) && $user->rights->stock->lire && $search_type != 1) || ! empty($conf->global->STOCK_DISABLE_OPTIM_LOAD)) // To optimize call of load_stock { if ($obj->fk_product_type != 1 || ! empty($conf->global->STOCK_SUPPORTS_SERVICES)) // Not a service { - $product_static->load_stock('nobatch'); // Load stock_reel + stock_warehouse. This also call load_virtual_stock() + $option = 'nobatch'; + if (empty($arrayfields['stock_virtual']['checked'])) $option .= ',novirtual'; + $product_static->load_stock($option); // Load stock_reel + stock_warehouse. This can also call load_virtual_stock() } } - print ''; // Ref @@ -845,6 +848,7 @@ if ($resql) print "\n"; if (! $i) $totalarray['nbfield']++; } + // Ref supplier if (! empty($arrayfields['pfp.ref_fourn']['checked'])) { @@ -853,6 +857,7 @@ if ($resql) print "\n"; if (! $i) $totalarray['nbfield']++; } + // Label if (! empty($arrayfields['p.label']['checked'])) { @@ -1120,6 +1125,7 @@ if ($resql) print ''; if (! $i) $totalarray['nbfield']++; } + // Action print ''; if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined From a4a805f618f7c440fdad24f55870f4def51b1bab Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 29 Nov 2019 11:32:22 +0100 Subject: [PATCH 270/462] Doxygen --- htdocs/product/class/product.class.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index ac987d49845..d00cba86e6a 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -4010,7 +4010,7 @@ class Product extends CommonObject if ($this->type == Product::TYPE_PRODUCT || ! empty($conf->global->STOCK_SUPPORTS_SERVICES)) { if (! empty($conf->productbatch->enabled)) { - $langs->load("productbatch"); + $langs->load("productbatch"); $label.="
".$langs->trans("ManageLotSerial").': '.$this->getLibStatut(0, 2); } } @@ -4361,12 +4361,12 @@ class Product extends CommonObject // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * Load information about stock of a product into ->stock_reel, ->stock_warehouse[] (including stock_warehouse[idwarehouse]->detail_batch for batch products) - * This function need a lot of load. If you use it on list, use a cache to execute it once for each product id. - * If ENTREPOT_EXTRA_STATUS set, filtering on warehouse status possible. + * Load information about stock of a product into ->stock_reel, ->stock_warehouse[] (including stock_warehouse[idwarehouse]->detail_batch for batch products) + * This function need a lot of load. If you use it on list, use a cache to execute it once for each product id. + * If ENTREPOT_EXTRA_STATUS set, filtering on warehouse status possible. * - * @param string $option '' = Load all stock info, also from closed and internal warehouses, - * @return int < 0 if KO, > 0 if OK + * @param string $option '' = Load all stock info, also from closed and internal warehouses, 'nobatch', 'novirtual' + * @return int < 0 if KO, > 0 if OK * @see load_virtual_stock(), loadBatchInfo() */ public function load_stock($option = '') @@ -4396,7 +4396,8 @@ class Product extends CommonObject $sql.= " WHERE w.entity IN (".getEntity('stock').")"; $sql.= " AND w.rowid = ps.fk_entrepot"; $sql.= " AND ps.fk_product = ".$this->id; - if ($conf->global->ENTREPOT_EXTRA_STATUS && count($warehouseStatus)) { $sql.= " AND w.statut IN (".$this->db->escape(implode(',', $warehouseStatus)).")"; + if ($conf->global->ENTREPOT_EXTRA_STATUS && count($warehouseStatus)) { + $sql.= " AND w.statut IN (".$this->db->escape(implode(',', $warehouseStatus)).")"; } dol_syslog(get_class($this)."::load_stock", LOG_DEBUG); @@ -4411,7 +4412,8 @@ class Product extends CommonObject $this->stock_warehouse[$row->fk_entrepot] = new stdClass(); $this->stock_warehouse[$row->fk_entrepot]->real = $row->reel; $this->stock_warehouse[$row->fk_entrepot]->id = $row->rowid; - if ((! preg_match('/nobatch/', $option)) && $this->hasbatch()) { $this->stock_warehouse[$row->fk_entrepot]->detail_batch=Productbatch::findAll($this->db, $row->rowid, 1, $this->id); + if ((! preg_match('/nobatch/', $option)) && $this->hasbatch()) { + $this->stock_warehouse[$row->fk_entrepot]->detail_batch=Productbatch::findAll($this->db, $row->rowid, 1, $this->id); } $this->stock_reel+=$row->reel; $i++; From d480da5629bdd77cbe0244d899c06fbf1fc855d6 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Fri, 29 Nov 2019 23:43:42 +0100 Subject: [PATCH 271/462] =?UTF-8?q?Fix=20#12496=20:=20currency=20was=20?= =?UTF-8?q?=E2=82=AC=20in=20loan=20schedule?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/loan/calcmens.php | 4 +-- htdocs/loan/schedule.php | 65 ++++++++++++++++++++++++++++++++-------- 2 files changed, 55 insertions(+), 14 deletions(-) diff --git a/htdocs/loan/calcmens.php b/htdocs/loan/calcmens.php index 7e3d1f83a8f..c741dfa13c9 100644 --- a/htdocs/loan/calcmens.php +++ b/htdocs/loan/calcmens.php @@ -44,7 +44,7 @@ $object = new LoanSchedule($db); $int = ($capital*($rate/12)); $int = round($int, 2, PHP_ROUND_HALF_UP); $cap_rest = round($capital - ($mens-$int), 2, PHP_ROUND_HALF_UP); -$output[$echance]=array('cap_rest'=>$cap_rest,'cap_rest_str'=>price($cap_rest),'interet'=>$int,'interet_str'=>price($int, 0, '', 1),'mens'=>$mens); +$output[$echance]=array('cap_rest'=>$cap_rest,'cap_rest_str'=>price($cap_rest, 0, '', 1, -1, -1, $conf->currency),'interet'=>$int,'interet_str'=>price($int, 0, '', 1, -1, -1, $conf->currency),'mens'=>$mens); $echance++; $capital=$cap_rest; @@ -56,7 +56,7 @@ while ($echance<=$nbterm) { $int = round($int, 2, PHP_ROUND_HALF_UP); $cap_rest = round($capital - ($mens-$int), 2, PHP_ROUND_HALF_UP); - $output[$echance]=array('cap_rest'=>$cap_rest,'cap_rest_str'=>price($cap_rest),'interet'=>$int,'interet_str'=>price($int, 0, '', 1),'mens'=>$mens); + $output[$echance]=array('cap_rest'=>$cap_rest,'cap_rest_str'=>price($cap_rest, 0, '', 1, -1, -1, $conf->currency),'interet'=>$int,'interet_str'=>price($int, 0, '', 1, -1, -1, $conf->currency),'mens'=>$mens); $capital=$cap_rest; $echance++; diff --git a/htdocs/loan/schedule.php b/htdocs/loan/schedule.php index 1c9cb9d8c3f..d4e7dec9feb 100644 --- a/htdocs/loan/schedule.php +++ b/htdocs/loan/schedule.php @@ -44,6 +44,47 @@ llxHeader("", $title, $help_url); $head=loan_prepare_head($object); dol_fiche_head($head, 'FinancialCommitment', $langs->trans("Loan"), -1, 'bill'); +$linkback = '' . $langs->trans("BackToList") . ''; + +$morehtmlref='
'; +// Ref loan +$morehtmlref.=$form->editfieldkey("Label", 'label', $object->label, $object, $user->rights->loan->write, 'string', '', 0, 1); +$morehtmlref.=$form->editfieldval("Label", 'label', $object->label, $object, $user->rights->loan->write, 'string', '', null, null, '', 1); +// Project +if (! empty($conf->projet->enabled)) +{ + $langs->loadLangs(array("projects")); + $morehtmlref.='
'.$langs->trans('Project') . ' '; + if ($user->rights->loan->write) + { + if ($action != 'classify') + $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + if ($action == 'classify') { + //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); + $morehtmlref.='
'; + $morehtmlref.=''; + $morehtmlref.=''; + $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref.=''; + $morehtmlref.='
'; + } else { + $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); + } + } else { + if (! empty($object->fk_project)) { + $proj = new Project($db); + $proj->fetch($object->fk_project); + $morehtmlref.=''; + $morehtmlref.=$proj->ref; + $morehtmlref.=''; + } else { + $morehtmlref.=''; + } + } +} +$morehtmlref.='
'; +dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlright); + if ($action == 'createecheancier') { $i=1; @@ -128,9 +169,9 @@ $(document).ready(function() { var interet_res_str='#interets'+index; var men_res='#mens'+index; $(idcap_res).val(element.cap_rest); - $(idcap_res_srt).text(element.cap_rest_str+' €'); + $(idcap_res_srt).text(element.cap_rest_str); $(interet_res).val(element.interet); - $(interet_res_str).text(element.interet_str+' €'); + $(interet_res_str).text(element.interet_str); $(men_res).val(element.mens); }); } @@ -166,7 +207,7 @@ print ''.$langs->trans("Insurance"); print ''.$langs->trans("InterestAmount").''; print ''.$langs->trans("Amount").''; print ''.$langs->trans("CapitalRemain"); -print ' ('.price2num($object->capital).')'; +print '
('.price($object->capital, 0, '', 1, -1, -1, $conf->currency).')'; print ''; print ''; if (count($echeance->lines)>0) print ''.$langs->trans('DoPayment').''; @@ -189,10 +230,10 @@ if ($object->nbterm > 0 && count($echeance->lines)==0) print ''; print '' . $i .''; print '' . dol_print_date(dol_time_plus_duree($object->datestart, $i-1, 'm'), 'day') . ''; - print ''.price($insurance+(($i == 1) ? $regulInsurance : 0), 0, '', 1).' €'; - print ''.price($int, 0, '', 1).' €'; - print ' €'; - print ''.price($cap_rest).' €'; + print ''.price($insurance+(($i == 1) ? $regulInsurance : 0), 0, '', 1, -1, -1, $conf->currency).''; + print ''.price($int, 0, '', 1, -1, -1, $conf->currency).''; + print ''; + print ''.price($cap_rest).''; print ''."\n"; $i++; $capital = $cap_rest; @@ -215,15 +256,15 @@ elseif(count($echeance->lines)>0) print ''; print '' . $i .''; print '' . dol_print_date($line->datep, 'day') . ''; - print ''.price($insu, 0, '', 1).' €'; - print ''.price($int, 0, '', 1).' €'; + print ''.price($insu, 0, '', 1, -1, -1, $conf->currency).''; + print ''.price($int, 0, '', 1, -1, -1, $conf->currency).''; if($line->datep > dol_now() && empty($line->fk_bank)){ - print ' €'; + print ''; }else{ - print '' . price($mens) . ' €'; + print '' . price($mens, 0, '', 1, -1, -1, $conf->currency) . ''; } - print ''.price($cap_rest).' €'; + print ''.price($cap_rest, 0, '', 1, -1, -1, $conf->currency).''; print ''; if (!empty($line->fk_bank)) print $langs->trans('Paid'); elseif (!$printed) From 9116110737d152a4ef861aff37fbc396d4d6fbe5 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sat, 30 Nov 2019 00:35:32 +0100 Subject: [PATCH 272/462] Fix #12502 : loan rate wasn't updatable --- htdocs/loan/card.php | 2 +- htdocs/loan/class/loan.class.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/loan/card.php b/htdocs/loan/card.php index 242472aff0a..bde0ce6ccb4 100644 --- a/htdocs/loan/card.php +++ b/htdocs/loan/card.php @@ -544,7 +544,7 @@ if ($id > 0) } else { - print $object->rate . '%'; + print price($object->rate) . '%'; } print ''; diff --git a/htdocs/loan/class/loan.class.php b/htdocs/loan/class/loan.class.php index 0e4542b1d20..cb980b36d2d 100644 --- a/htdocs/loan/class/loan.class.php +++ b/htdocs/loan/class/loan.class.php @@ -335,6 +335,7 @@ class Loan extends CommonObject $sql.= " datestart='".$this->db->idate($this->datestart)."',"; $sql.= " dateend='".$this->db->idate($this->dateend)."',"; $sql.= " nbterm=".$this->nbterm.","; + $sql.= " rate=".$this->db->escape($this->rate).","; $sql.= " accountancy_account_capital = '".$this->db->escape($this->account_capital)."',"; $sql.= " accountancy_account_insurance = '".$this->db->escape($this->account_insurance)."',"; $sql.= " accountancy_account_interest = '".$this->db->escape($this->account_interest)."',"; From 02b5da5db1c2b57c6d88bd18f247527843d6b8fd Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sat, 30 Nov 2019 00:57:21 +0100 Subject: [PATCH 273/462] Fix #12448 : notifications were sent to disabled user or contacts --- htdocs/core/class/notify.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php index ae22728f06d..f8bb58a05fb 100644 --- a/htdocs/core/class/notify.class.php +++ b/htdocs/core/class/notify.class.php @@ -329,6 +329,7 @@ class Notify $sql.= " ".MAIN_DB_PREFIX."societe as s"; $sql.= " WHERE n.fk_contact = c.rowid AND a.rowid = n.fk_action"; $sql.= " AND n.fk_soc = s.rowid"; + $sql.= " AND c.statut = 1"; if (is_numeric($notifcode)) $sql.= " AND n.fk_action = ".$notifcode; // Old usage else $sql.= " AND a.code = '".$notifcode."'"; // New usage $sql .= " AND s.rowid = ".$object->socid; @@ -342,6 +343,7 @@ class Notify $sql.= " ".MAIN_DB_PREFIX."c_action_trigger as a,"; $sql.= " ".MAIN_DB_PREFIX."notify_def as n"; $sql.= " WHERE n.fk_user = c.rowid AND a.rowid = n.fk_action"; + $sql.= " AND c.statut = 1"; if (is_numeric($notifcode)) $sql.= " AND n.fk_action = ".$notifcode; // Old usage else $sql.= " AND a.code = '".$notifcode."'"; // New usage From 2a3012f12db7aff48eccbab49329ef7d6e55fed3 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sat, 30 Nov 2019 01:15:47 +0100 Subject: [PATCH 274/462] Fix #12481 : fix ticket creation from thirdparty, mission $socid var --- htdocs/ticket/card.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 2f3a79c59be..93a6981f8be 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -46,6 +46,7 @@ $langs->loadLangs(array("companies","other","ticket")); // Get parameters $id = GETPOST('id', 'int'); +$socid = GETPOST('socid', 'int'); $track_id = GETPOST('track_id', 'alpha', 3); $ref = GETPOST('ref', 'alpha'); $projectid = GETPOST('projectid', 'int'); From fe37983b06d61334f7946aaeb84c794217b577cb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 30 Nov 2019 12:02:05 +0100 Subject: [PATCH 275/462] Fix inversion of mime type and mime file name --- htdocs/adherents/subscription.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index 7663fe6fba3..006edce6319 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -398,7 +398,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && ! $moreinheader='X-Dolibarr-Info: send_an_email by adherents/subscription.php'."\r\n"; - $result=$object->send_an_email($texttosend, $subjecttosend, $listofpaths, $listofnames, $listofmimes, "", "", 0, -1, '', $moreinheader); + $result=$object->send_an_email($texttosend, $subjecttosend, $listofpaths, $listofmimes, $listofnames, "", "", 0, -1, '', $moreinheader); if ($result < 0) { $errmsg=$object->error; From 9095482113a40e10a6e39edf26cfc7047e52b0dd Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sat, 30 Nov 2019 14:47:48 +0100 Subject: [PATCH 276/462] Fix margins access + menu display --- htdocs/core/menus/standard/eldy.lib.php | 3 ++- htdocs/margin/productMargins.php | 2 +- htdocs/margin/tabs/productMargins.php | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 6325643cf87..c875c0c28a5 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -165,9 +165,10 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$mode if (! empty($conf->salaries->enabled)) $menuqualified++; if (! empty($conf->supplier_invoice->enabled)) $menuqualified++; if (! empty($conf->loan->enabled)) $menuqualified++; + if (! empty($conf->margins->enabled)) $menuqualified++; $tmpentry=array( 'enabled'=>$menuqualified, - 'perms'=>(! empty($user->rights->facture->lire) || ! empty($user->rights->don->lire) || ! empty($user->rights->tax->charges->lire) || ! empty($user->rights->salaries->read) || ! empty($user->rights->fournisseur->facture->lire) || ! empty($user->rights->loan->read)), + 'perms'=>(! empty($user->rights->facture->lire) || ! empty($user->rights->don->lire) || ! empty($user->rights->tax->charges->lire) || ! empty($user->rights->salaries->read) || ! empty($user->rights->fournisseur->facture->lire) || ! empty($user->rights->loan->read) || ! empty($user->rights->margins->liretous)), 'module'=>'facture|supplier_invoice|don|tax|salaries|loan'); $showmode=isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal); if ($showmode) diff --git a/htdocs/margin/productMargins.php b/htdocs/margin/productMargins.php index d827f5d985e..38018852ffe 100644 --- a/htdocs/margin/productMargins.php +++ b/htdocs/margin/productMargins.php @@ -42,7 +42,7 @@ $fieldvalue = (! empty($id) ? $id : (! empty($ref) ? $ref : '')); $fieldtype = (! empty($ref) ? 'ref' : 'rowid'); if (! empty($user->societe_id)) $socid=$user->societe_id; $result=restrictedArea($user,'produit|service',$fieldvalue,'product&product','','',$fieldtype); -$result=restrictedArea($user,'margins'); +if(empty($user->rights->margins->liretous)) accessforbidden(); $mesg = ''; diff --git a/htdocs/margin/tabs/productMargins.php b/htdocs/margin/tabs/productMargins.php index 3b826501614..cd6b93e04e1 100644 --- a/htdocs/margin/tabs/productMargins.php +++ b/htdocs/margin/tabs/productMargins.php @@ -41,6 +41,7 @@ $fieldvalue = (! empty($id) ? $id : (! empty($ref) ? $ref : '')); $fieldtype = (! empty($ref) ? 'ref' : 'rowid'); if (! empty($user->societe_id)) $socid=$user->societe_id; $result=restrictedArea($user,'produit|service',$fieldvalue,'product&product','','',$fieldtype); +if(empty($user->rights->margins->liretous)) accessforbidden(); $object = new Product($db); From 916954b301a1168064489a73d4111225f8ab5499 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sat, 30 Nov 2019 14:48:05 +0100 Subject: [PATCH 277/462] Fix #12371 : access rights on contacts --- htdocs/core/lib/company.lib.php | 2 +- htdocs/societe/contact.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 68ad744dee2..8528c25bac7 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -52,7 +52,7 @@ function societe_prepare_head(Societe $object) if (empty($conf->global->MAIN_SUPPORT_SHARED_CONTACT_BETWEEN_THIRDPARTIES)) { - if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) + if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->societe->contact->lire) { //$nbContact = count($object->liste_contact(-1,'internal')) + count($object->liste_contact(-1,'external')); $nbContact = 0; // TODO diff --git a/htdocs/societe/contact.php b/htdocs/societe/contact.php index 37fb07eb652..8a988edc413 100644 --- a/htdocs/societe/contact.php +++ b/htdocs/societe/contact.php @@ -88,6 +88,7 @@ if (! empty($canvas)) // Security check $result = restrictedArea($user, 'societe', $socid, '&societe', '', 'fk_soc', 'rowid', $objcanvas); +if(empty($user->rights->societe->contact->lire)) accessforbidden(); From 2c165d0a616e40d23dfb4e667795a0895e9efd8b Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sat, 30 Nov 2019 15:53:50 +0100 Subject: [PATCH 278/462] Fix deposit date display in PDF --- htdocs/core/lib/pdf.lib.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index ffd19489d1b..c432a8229da 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1264,9 +1264,10 @@ function pdf_getlinedesc($object,$i,$outputlangs,$hideref=0,$hidedesc=0,$issuppl $sourceref=!empty($discount->discount_type)?$discount->ref_invoive_supplier_source:$discount->ref_facture_source; $libelleproduitservice=$outputlangs->transnoentitiesnoconv("DiscountFromDeposit",$sourceref); // Add date of deposit - if (! empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) echo ' ('.dol_print_date($discount->datec,'day','',$outputlangs).')'; + if (! empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) $libelleproduitservice.= ' ('.dol_print_date($discount->datec,'day','',$outputlangs).')'; + } - if ($desc == '(EXCESS RECEIVED)' && $object->lines[$i]->fk_remise_except) + elseif ($desc == '(EXCESS RECEIVED)' && $object->lines[$i]->fk_remise_except) { $discount=new DiscountAbsolute($db); $discount->fetch($object->lines[$i]->fk_remise_except); From 558669dd88a725fe6b7b84e571fe5d875bf2deec Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sat, 30 Nov 2019 16:14:16 +0100 Subject: [PATCH 279/462] Fix #6497 : deposit lines were not translated --- htdocs/compta/facture/card.php | 2 +- htdocs/core/lib/pdf.lib.php | 3 +++ htdocs/core/tpl/objectline_view.tpl.php | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index df6aa92ff54..62f5899c025 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1314,7 +1314,7 @@ if (empty($reshook)) if (empty($amount)) continue; $arraylist = array('amount' => 'FixAmount','variable' => 'VarAmount'); - $descline = $langs->trans('Deposit'); + $descline = '(DEPOSIT)'; //$descline.= ' - '.$langs->trans($arraylist[$typeamount]); if ($typeamount=='amount') { $descline.= ' ('. price($valuedeposit, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).')'; diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index c432a8229da..8fa12241643 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1238,6 +1238,9 @@ function pdf_getlinedesc($object,$i,$outputlangs,$hideref=0,$hidedesc=0,$issuppl if (! empty($prodser->multilangs[$outputlangs->defaultlang]["note"]) && ($textwasmodified || $translatealsoifmodified)) $note=$prodser->multilangs[$outputlangs->defaultlang]["note"]; } } + elseif ($object->type == Facture::TYPE_DEPOSIT && $object->element == 'facture') { + $desc = str_replace('(DEPOSIT)', $outputlangs->trans('Deposit'), $desc); + } // Description short of product line $libelleproduitservice=$label; diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index 38c492a84ae..c747e97d0a0 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -137,6 +137,8 @@ $domData .= ' data-product_type="'.$line->product_type.'"'; if (! empty($line->label)) { $text.= ' '.$line->label.''; echo $form->textwithtooltip($text,dol_htmlentitiesbr($line->description),3,'','',$i,0,(!empty($line->fk_parent_line)?img_picto('', 'rightarrow'):'')); + } elseif (strpos($line->description, '(DEPOSIT)') === 0) { + echo $text.' '.str_replace('(DEPOSIT)', $langs->trans("Deposit"), $line->description);; } else { if (! empty($line->fk_parent_line)) echo img_picto('', 'rightarrow'); echo $text.' '.dol_htmlentitiesbr($line->description); From 3c639772d9234c2bbe4ef9b5bede70ace4d2abb8 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sat, 30 Nov 2019 17:16:16 +0100 Subject: [PATCH 280/462] Fix #11228 : VAT dates regarding fiscal year --- htdocs/compta/tva/index.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/compta/tva/index.php b/htdocs/compta/tva/index.php index 6b0c2875d42..fb3ee8b8b6d 100644 --- a/htdocs/compta/tva/index.php +++ b/htdocs/compta/tva/index.php @@ -39,6 +39,7 @@ $year=GETPOST("year","int"); if (empty($year)) { $year_current = strftime("%Y",dol_now()); + if($conf->global->SOCIETE_FISCAL_MONTH_START > date('m')) $year_current--; $year_start = $year_current; } else { $year_current = $year; From 13577d8d48b30cd3b648a541f54eee455e067d0c Mon Sep 17 00:00:00 2001 From: Nicolas Date: Sat, 30 Nov 2019 19:52:06 +0100 Subject: [PATCH 281/462] FIX #12473 --- scripts/emailings/mailing-send.php | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/scripts/emailings/mailing-send.php b/scripts/emailings/mailing-send.php index 0e161a9c9cc..f4d3ab08802 100755 --- a/scripts/emailings/mailing-send.php +++ b/scripts/emailings/mailing-send.php @@ -4,6 +4,7 @@ * Copyright (C) 2004 Rodolphe Quiedeville * Copyright (C) 2005-2013 Laurent Destailleur * Copyright (C) 2005-2016 Regis Houssin + * Copyright (C) 2019 Nicolas ZABOURI * * 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 @@ -90,6 +91,8 @@ if ($resql) { $emailing = new Mailing($db); $emailing->fetch($obj->rowid); + $upload_dir = $conf->mailing->dir_output . "/" . get_exdir($emailing->id, 2, 0, 1, $emailing, 'mailing'); + $id = $emailing->id; $subject = $emailing->sujet; $message = $emailing->body; @@ -228,9 +231,25 @@ if ($resql) { $substitutionisok = true; + $arr_file = array(); + $arr_mime = array(); + $arr_name = array(); + $arr_css = array(); + + $listofpaths=dol_dir_list($upload_dir, 'all', 0, '', '', 'name', SORT_ASC, 0); + + if (count($listofpaths)) + { + foreach($listofpaths as $key => $val) + { + $arr_file[]=$listofpaths[$key]['fullname']; + $arr_mime[]=dol_mimetype($listofpaths[$key]['name']); + $arr_name[]=$listofpaths[$key]['name']; + } + } // Fabrication du mail $trackid = 'emailing-' . $obj->fk_mailing . '-' . $obj->rowid; - $mail = new CMailFile($newsubject, $sendto, $from, $newmessage, array(), array(), array(), '', '', 0, $msgishtml, $errorsto, '', $trackid, '', 'emailing'); + $mail = new CMailFile($newsubject, $sendto, $from, $newmessage, $arr_file, $arr_mime, $arr_name, '', '', 0, $msgishtml, $errorsto, $arr_css, $trackid, '', 'emailing'); if ($mail->error) { $res = 0; From f2ff443641b4d45fde0d0baf0d2de82cbacfaecd Mon Sep 17 00:00:00 2001 From: Nicolas Date: Sat, 30 Nov 2019 20:04:27 +0100 Subject: [PATCH 282/462] FIX #12482 --- htdocs/core/lib/functions.lib.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 8d301275b5e..d0bcead2eb9 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -14,6 +14,7 @@ * Copyright (C) 2014-2015 Marcos García * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2018 Frédéric France + * Copyright (C) 2019 Nicolas ZABOURI * * 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 @@ -6085,7 +6086,8 @@ function getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $ob if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label']) > 0) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $label) { - $substitutionarray['__EXTRAFIELD_' . strtoupper($key) . '__'] = $object->array_options['options_' . $key]; + $value = $object->array_options['options_' . $key]; + $substitutionarray['__EXTRAFIELD_' . strtoupper($key) . '__'] = $extrafields->showOutputField($key, $value); } } } From a352fd5a6e92e75eb60920d3ef320965f8d1eca2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 30 Nov 2019 21:00:56 +0100 Subject: [PATCH 283/462] Revert "FIX#12482" --- htdocs/core/lib/functions.lib.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index d0bcead2eb9..8d301275b5e 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -14,7 +14,6 @@ * Copyright (C) 2014-2015 Marcos García * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2018 Frédéric France - * Copyright (C) 2019 Nicolas ZABOURI * * 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 @@ -6086,8 +6085,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $ob if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label']) > 0) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $label) { - $value = $object->array_options['options_' . $key]; - $substitutionarray['__EXTRAFIELD_' . strtoupper($key) . '__'] = $extrafields->showOutputField($key, $value); + $substitutionarray['__EXTRAFIELD_' . strtoupper($key) . '__'] = $object->array_options['options_' . $key]; } } } From edb8bcb5987422245329f36e9d5b36b670316c94 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sat, 30 Nov 2019 22:58:32 +0100 Subject: [PATCH 284/462] Fix PDF rouget for SHIPPING_PDF_HIDE_WEIGHT_AND_VOLUME --- htdocs/core/modules/expedition/doc/pdf_rouget.modules.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index 087b4a373aa..a6a14106832 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -155,6 +155,8 @@ class pdf_rouget extends ModelePdfExpedition $this->posxtotalht=$this->page_largeur - $this->marge_droite - 20; } + if(!empty($conf->global->SHIPPING_PDF_HIDE_WEIGHT_AND_VOLUME)) $this->posxweightvol = $this->posxqtyordered; + $this->posxpicture=$this->posxweightvol - (empty($conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH)?20:$conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH); // width of images if ($this->page_largeur < 210) // To work with US executive format From a220d43bd6c612945a590dc1a2dfe4b78fce5ea1 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sun, 1 Dec 2019 01:41:13 +0100 Subject: [PATCH 285/462] Fix #11849 : missing price2num in discount split --- htdocs/comm/remx.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/remx.php b/htdocs/comm/remx.php index eb1c14a4beb..aa9307df8d2 100644 --- a/htdocs/comm/remx.php +++ b/htdocs/comm/remx.php @@ -61,8 +61,10 @@ if ($action == 'confirm_split' && GETPOST("confirm") == 'yes') //if ($user->rights->societe->creer) //if ($user->rights->facture->creer) - $amount_ttc_1=GETPOST('amount_ttc_1'); - $amount_ttc_2=GETPOST('amount_ttc_2'); + $amount_ttc_1 = GETPOST('amount_ttc_1'); + $amount_ttc_1 = price2num($amount_ttc_1); + $amount_ttc_2 = GETPOST('amount_ttc_2'); + $amount_ttc_2 = price2num($amount_ttc_2); $error=0; $remid=GETPOST("remid")?GETPOST("remid"):0; From 270f4c250025b45e434c25729c860b83c187390c Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sun, 1 Dec 2019 09:26:54 +0100 Subject: [PATCH 286/462] Fix #12044 : with replenish function, use product supplier desc in order --- htdocs/product/stock/replenish.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index 87d60263e4f..a31a184731f 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -147,7 +147,13 @@ if ($action == 'order' && isset($_POST['valid'])) { $productsupplier->getMultiLangs(); } - $line->desc = $productsupplier->description; + + // if we use supplier description of the products + if(!empty($productsupplier->desc_supplier) && !empty($conf->global->PRODUIT_FOURN_TEXTS)) { + $desc = $productsupplier->desc_supplier; + } else $desc = $productsupplier->description; + + $line->desc = $desc; if (! empty($conf->global->MAIN_MULTILANGS)) { // TODO Get desc in language of thirdparty From bf99e8af5d2561f6f6fb0318c35c7daac2aa5f3b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 1 Dec 2019 10:33:55 +0100 Subject: [PATCH 287/462] Fix phpcs --- htdocs/core/lib/pdf.lib.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index ac139be95d6..6c2fb96e76c 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -264,7 +264,7 @@ function pdf_getHeightForLogo($logo, $url = false) * @param TCPDF $pdf PDF initialized object * @param string $htmlcontent HTML Contect * @return int Height - * @see getStringHeight + * @see getStringHeight() */ function pdfGetHeightForHtmlContent(&$pdf, $htmlcontent) { @@ -1286,7 +1286,6 @@ function pdf_getlinedesc($object,$i,$outputlangs,$hideref=0,$hidedesc=0,$issuppl $libelleproduitservice=$outputlangs->transnoentitiesnoconv("DiscountFromDeposit",$sourceref); // Add date of deposit if (! empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) $libelleproduitservice.= ' ('.dol_print_date($discount->datec,'day','',$outputlangs).')'; - } elseif ($desc == '(EXCESS RECEIVED)' && $object->lines[$i]->fk_remise_except) { From d76608729b212dc23e85bb6c6b31f65dfbc0e68c Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sun, 1 Dec 2019 10:50:28 +0100 Subject: [PATCH 288/462] Fix #12569 : update qty on expensereport prevented decimals --- htdocs/expensereport/card.php | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index e2d1b29772d..6bfbe405b40 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -2076,12 +2076,12 @@ else $i = 0;$total = 0; print ''; - print ''.$langs->trans('LineNb').''; - //print ''.$langs->trans('Piece').''; - print ''.$langs->trans('Date').''; + print ''.$langs->trans('LineNb').''; + //print ''.$langs->trans('Piece').''; + print ''.$langs->trans('Date').''; if (! empty($conf->projet->enabled)) print ''.$langs->trans('Project').''; if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) print ''.$langs->trans('CarCategory').''; - print ''.$langs->trans('Type').''; + print ''.$langs->trans('Type').''; print ''.$langs->trans('Description').''; print ''.$langs->trans('VAT').''; print ''.$langs->trans('PriceUTTC').''; @@ -2106,16 +2106,16 @@ else { print ''; - print ''; + print ''; print $numline; print ''; - /*print ''; + /*print ''; print img_picto($langs->trans("Document"), "object_generic"); print ' '.$piece_comptable.''; print '';*/ - print ''.dol_print_date($db->jdate($line->date), 'day').''; + print ''.dol_print_date($db->jdate($line->date), 'day').''; if (! empty($conf->projet->enabled)) { print ''; @@ -2170,7 +2170,9 @@ else { print ''; - print ''; + print ''; + print $numline; + print ''; // Select date print ''; @@ -2215,7 +2217,7 @@ else // Quantity print ''; - print ''; + print ''; print ''; if ($action != 'editline') @@ -2224,7 +2226,7 @@ else print ''.$langs->trans('AmountTTC').''; } - print ''; + print ''; print ''; print ''; print '
'; From 4a33ee60f862e109e6efc0c239ccba01f10b7b63 Mon Sep 17 00:00:00 2001 From: John Botella Date: Mon, 2 Dec 2019 10:34:14 +0100 Subject: [PATCH 289/462] Fix user card : use comma in amounts inputs --- htdocs/user/card.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/user/card.php b/htdocs/user/card.php index ef0ed3743dd..cf9f82d7483 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -218,8 +218,11 @@ if (empty($reshook)) { $object->employee = GETPOST('employee', 'alphanohtml'); $object->thm = GETPOST("thm", 'alphanohtml') != '' ? GETPOST("thm", 'alphanohtml') : ''; + $object->thm = price2num($object->thm); $object->tjm = GETPOST("tjm", 'alphanohtml') != '' ? GETPOST("tjm", 'alphanohtml') : ''; + $object->tjm = price2num($object->tjm); $object->salary = GETPOST("salary", 'alphanohtml') != '' ? GETPOST("salary", 'alphanohtml') : ''; + $object->salary = price2num($object->salary); $object->salaryextra = GETPOST("salaryextra", 'alphanohtml') != '' ? GETPOST("salaryextra", 'alphanohtml') : ''; $object->weeklyhours = GETPOST("weeklyhours", 'alphanohtml') != '' ? GETPOST("weeklyhours", 'alphanohtml') : ''; @@ -366,8 +369,11 @@ if (empty($reshook)) { $object->employee = GETPOST('employee','int'); $object->thm = GETPOST("thm",'alphanohtml') != '' ? GETPOST("thm",'alphanohtml') : ''; + $object->thm = price2num($object->thm); $object->tjm = GETPOST("tjm",'alphanohtml') != '' ? GETPOST("tjm",'alphanohtml') : ''; + $object->tjm = price2num($object->tjm); $object->salary = GETPOST("salary",'alphanohtml') != '' ? GETPOST("salary",'alphanohtml') : ''; + $object->salary = price2num($object->salary); $object->salaryextra = GETPOST("salaryextra",'alphanohtml') != '' ? GETPOST("salaryextra",'alphanohtml') : ''; $object->weeklyhours = GETPOST("weeklyhours",'alphanohtml') != '' ? GETPOST("weeklyhours",'alphanohtml') : ''; From 66571df449bac021d2f9fabd8eb5b15dd414994f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 2 Dec 2019 15:19:14 +0100 Subject: [PATCH 290/462] Fix remove a link that is private --- htdocs/langs/en_US/admin.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index c45688b3557..ece9f4b3d06 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1125,7 +1125,7 @@ TriggerAlwaysActive=Triggers in this file are always active, whatever are the ac TriggerActiveAsModuleActive=Triggers in this file are active as module %s is enabled. GeneratedPasswordDesc=Choose the method to be used for auto-generated passwords. DictionaryDesc=Insert all reference data. You can add your values to the default. -ConstDesc=This page allows you to edit (override) parameters not available in other pages. These are mostly reserved parameters for developers/advanced troubleshooting. For a full list of the parameters available see here. +ConstDesc=This page allows you to edit (override) parameters not available in other pages. These are mostly reserved parameters for developers/advanced troubleshooting only. MiscellaneousDesc=All other security related parameters are defined here. LimitsSetup=Limits/Precision setup LimitsDesc=You can define limits, precisions and optimizations used by Dolibarr here From 4846885eea9606fc3d8049b4df63066937970eba Mon Sep 17 00:00:00 2001 From: Florian Mortgat Date: Mon, 2 Dec 2019 16:54:05 +0100 Subject: [PATCH 291/462] NEW 9.0: enable user to use the mysqldump '--quick' option (useful if the server has low RAM or large tables) --- htdocs/admin/tools/dolibarr_export.php | 9 ++++++++- htdocs/core/class/utils.class.php | 1 + htdocs/langs/en_US/admin.lang | 2 ++ htdocs/langs/fr_FR/admin.lang | 2 ++ 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/htdocs/admin/tools/dolibarr_export.php b/htdocs/admin/tools/dolibarr_export.php index 231699dc636..d04840e2d71 100644 --- a/htdocs/admin/tools/dolibarr_export.php +++ b/htdocs/admin/tools/dolibarr_export.php @@ -211,7 +211,6 @@ print '';
-
global->MYSQL_OLD_OPTION_DISABLE_FK)) { ?> @@ -234,6 +233,14 @@ print '';
+ + +
diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php index 6b6d2d42c67..8ce4cca7ca6 100644 --- a/htdocs/core/class/utils.class.php +++ b/htdocs/core/class/utils.class.php @@ -262,6 +262,7 @@ class Utils if (GETPOST("disable_fk", "alpha") || $usedefault) $param.=" -K"; if (GETPOST("sql_compat", "alpha") && GETPOST("sql_compat", "alpha") != 'NONE') $param.=" --compatible=".escapeshellarg(GETPOST("sql_compat", "alpha")); if (GETPOST("drop_database", "alpha")) $param.=" --add-drop-database"; + if (GETPOST("use_mysql_quick_param", "alpha"))$param.=" --quick"; if (GETPOST("sql_structure", "alpha") || $usedefault) { if (GETPOST("drop", "alpha") || $usedefault) $param.=" --add-drop-table=TRUE"; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index d70bfe959e9..b477298f88a 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -174,6 +174,8 @@ Compression=Compression CommandsToDisableForeignKeysForImport=Command to disable foreign keys on import CommandsToDisableForeignKeysForImportWarning=Mandatory if you want to be able to restore your sql dump later ExportCompatibility=Compatibility of generated export file +ExportUseMySQLQuickParameter=Use the --quick parameter +ExportUseMySQLQuickParameterHelp=The '--quick' parameter helps limit RAM consumption for large tables. MySqlExportParameters=MySQL export parameters PostgreSqlExportParameters= PostgreSQL export parameters UseTransactionnalMode=Use transactional mode diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 4b7cb82e4d4..8abb4dd8d29 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -174,6 +174,8 @@ Compression=Compression CommandsToDisableForeignKeysForImport=Commande pour désactiver les clés étrangères à l'importation CommandsToDisableForeignKeysForImportWarning=Requis si vous voulez être en mesure de restaurer votre « dump » SQL plus tard ExportCompatibility=Compatibilité du fichier d'exportation généré +ExportUseMySQLQuickParameter=Utiliser le paramètre --quick +ExportUseMySQLQuickParameterHelp=permet de limiter la consommation de mémoire vive (utile en cas de tables volumineuses) MySqlExportParameters=Paramètres de l'exportation MySQL PostgreSqlExportParameters= Paramètres de l'exportation PostgreSQL UseTransactionnalMode=Utiliser le mode transactionnel From 15715aa12c933b7ee7dc90becd748e3e0410f35a Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Mon, 2 Dec 2019 23:53:01 +0100 Subject: [PATCH 292/462] FIX not fee in payout list --- htdocs/stripe/payout.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/htdocs/stripe/payout.php b/htdocs/stripe/payout.php index 0149775c360..b975680838e 100644 --- a/htdocs/stripe/payout.php +++ b/htdocs/stripe/payout.php @@ -107,7 +107,6 @@ if (! $rowid) { print_liste_field_titre("DateOperation", $_SERVER["PHP_SELF"], "", "", "", '', $sortfield, $sortorder, 'center '); print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "", "", "", '', $sortfield, $sortorder, 'left '); print_liste_field_titre("Paid", $_SERVER["PHP_SELF"], "", "", "", '', $sortfield, $sortorder, 'right '); - print_liste_field_titre("Fee", $_SERVER["PHP_SELF"], "", "", "", '', $sortfield, $sortorder, 'right '); print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "", "", "", '', '', '', 'right '); print "\n"; @@ -205,7 +204,6 @@ if (! $rowid) { print '' . $payout->description . ''; // Amount print '' . price(($payout->amount) / 100, 0, '', 1, - 1, - 1, strtoupper($payout->currency)) . ""; - print '' . price(($payout->fee) / 100, 0, '', 1, - 1, - 1, strtoupper($payout->currency)) . ""; // Status print ""; if ($payout->status=='paid') { From b67fb8be0267a69d7476c97236d018da411cc1fb Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 3 Dec 2019 00:14:05 +0100 Subject: [PATCH 293/462] Fix stripe menu --- htdocs/core/modules/modStripe.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/core/modules/modStripe.class.php b/htdocs/core/modules/modStripe.class.php index ae15e763fd8..40c4b31cded 100644 --- a/htdocs/core/modules/modStripe.class.php +++ b/htdocs/core/modules/modStripe.class.php @@ -150,7 +150,9 @@ class modStripe extends DolibarrModules 'target' => '', 'user' => 0 ); - $this->menu[$r] = array( + + $r++; + $this->menu[$r] = array( 'fk_menu' => 'fk_mainmenu=bank,fk_leftmenu=stripe', 'type' => 'left', 'titre' => 'StripePayoutList', From 636da4518f877ef5c70fc5952032c749472e3bd9 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 3 Dec 2019 11:22:00 +0100 Subject: [PATCH 294/462] Fix title of transactions list --- htdocs/stripe/transaction.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/stripe/transaction.php b/htdocs/stripe/transaction.php index d1ab2ebe50d..8b06ca6ac90 100644 --- a/htdocs/stripe/transaction.php +++ b/htdocs/stripe/transaction.php @@ -106,7 +106,7 @@ if (! $rowid) { print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "", "", "", '', $sortfield, $sortorder, 'left '); print_liste_field_titre("Paid", $_SERVER["PHP_SELF"], "", "", "", '', $sortfield, $sortorder, 'right '); print_liste_field_titre("Fee", $_SERVER["PHP_SELF"], "", "", "", '', $sortfield, $sortorder, 'right '); - print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "", "", "", '', '', '', 'right_'); + print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "", "", "", '', '', '', 'right '); print "\n"; print "\n"; From 78acf07e4c1ad74a321e49911c10b118e0737691 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 3 Dec 2019 14:59:05 +0100 Subject: [PATCH 295/462] Fix bad side effect of debugbar with android --- htdocs/main.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 5fbc453583b..63b8eaa5561 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -253,7 +253,7 @@ require_once 'master.inc.php'; register_shutdown_function('dol_shutdown'); // Load debugbar -if (! empty($conf->debugbar->enabled)) +if (!empty($conf->debugbar->enabled) && ! GETPOST('dol_use_jmobile') && empty($_SESSION['dol_use_jmobile'])) { global $debugbar; include_once DOL_DOCUMENT_ROOT.'/debugbar/class/DebugBar.php'; From d153918a10907328ee09c5f34e7c093ce810623a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 3 Dec 2019 15:00:52 +0100 Subject: [PATCH 296/462] Fix trans --- htdocs/comm/action/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index 2ef4c74f765..dc00a4dd091 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -37,7 +37,7 @@ include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; // Load translation files required by the page -$langs->loadLangs(array("users","companies","agenda","commercial")); +$langs->loadLangs(array("users","companies","agenda","commercial","other")); $action=GETPOST('action', 'alpha'); $contextpage=GETPOST('contextpage', 'aZ')?GETPOST('contextpage', 'aZ'):'actioncommlist'; // To manage different context of search From cec54d6ce0e9b47db1e988c2a21a183fd64331b8 Mon Sep 17 00:00:00 2001 From: gauthier Date: Tue, 3 Dec 2019 16:40:35 +0100 Subject: [PATCH 297/462] FIX : when we need to bill several orders, order lines unit is not on bill lines --- htdocs/core/actions_massactions.inc.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 2f5f03ee5a8..62d8e2466b0 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -701,7 +701,10 @@ if ($massaction == 'confirm_createbills') $lines[$i]->fk_fournprice, $lines[$i]->pa_ht, $lines[$i]->label, - $array_options + $array_options, + 100, + 0, + $lines[$i]->fk_unit ); if ($result > 0) { From 558e0cb5f6a4bb71d01b2ea17f43e397ea32cd59 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 3 Dec 2019 22:34:49 +0100 Subject: [PATCH 298/462] Fix regression --- htdocs/core/lib/pdf.lib.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index ac407bd42a1..bb689d52519 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1263,8 +1263,10 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0, if (! empty($prodser->multilangs[$outputlangs->defaultlang]["note"]) && ($textwasmodified || $translatealsoifmodified)) $note=$prodser->multilangs[$outputlangs->defaultlang]["note"]; } } - elseif ($object->type == Facture::TYPE_DEPOSIT && $object->element == 'facture') { - $desc = str_replace('(DEPOSIT)', $outputlangs->trans('Deposit'), $desc); + elseif ($object->element == 'facture' || $object->element == 'facturefourn') { + if ($object->type == $object::TYPE_DEPOSIT) { + $desc = str_replace('(DEPOSIT)', $outputlangs->trans('Deposit'), $desc); + } } // Description short of product line From 60d3bd0fe9379feca12dd3e9c6b87a64ba048953 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 3 Dec 2019 22:36:26 +0100 Subject: [PATCH 299/462] Fix regression --- htdocs/core/lib/pdf.lib.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 6c2fb96e76c..af1da161dc7 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1256,8 +1256,10 @@ function pdf_getlinedesc($object,$i,$outputlangs,$hideref=0,$hidedesc=0,$issuppl if (! empty($prodser->multilangs[$outputlangs->defaultlang]["note"]) && ($textwasmodified || $translatealsoifmodified)) $note=$prodser->multilangs[$outputlangs->defaultlang]["note"]; } } - elseif ($object->type == Facture::TYPE_DEPOSIT && $object->element == 'facture') { - $desc = str_replace('(DEPOSIT)', $outputlangs->trans('Deposit'), $desc); + elseif ($object->element == 'facture' || $object->element == 'facturefourn') { + if ($object->type == $object::TYPE_DEPOSIT) { + $desc = str_replace('(DEPOSIT)', $outputlangs->trans('Deposit'), $desc); + } } // Description short of product line From a75915a7a85823724ff77d34047d29a17ac517e3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 3 Dec 2019 22:37:58 +0100 Subject: [PATCH 300/462] Fix regression --- htdocs/core/lib/pdf.lib.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 8fa12241643..3d22733ee7f 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1238,8 +1238,10 @@ function pdf_getlinedesc($object,$i,$outputlangs,$hideref=0,$hidedesc=0,$issuppl if (! empty($prodser->multilangs[$outputlangs->defaultlang]["note"]) && ($textwasmodified || $translatealsoifmodified)) $note=$prodser->multilangs[$outputlangs->defaultlang]["note"]; } } - elseif ($object->type == Facture::TYPE_DEPOSIT && $object->element == 'facture') { - $desc = str_replace('(DEPOSIT)', $outputlangs->trans('Deposit'), $desc); + elseif ($object->element == 'facture' || $object->element == 'facturefourn') { + if ($object->type == $object::TYPE_DEPOSIT) { + $desc = str_replace('(DEPOSIT)', $outputlangs->trans('Deposit'), $desc); + } } // Description short of product line From 89dd74c1151ffa963d0f1cfcafb7f8ea3b28d77f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 4 Dec 2019 22:05:09 +0100 Subject: [PATCH 301/462] Fix clean old files --- htdocs/install/upgrade2.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index c932b2631e8..b7b82048e0b 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -4463,13 +4463,15 @@ function migrate_delete_old_files($db, $langs, $conf) '/core/modules/facture/pdf_crabe.modules.php', '/core/modules/facture/pdf_oursin.modules.php', - '/compta/facture/class/api_invoice.class.php', + '/categories/class/api_category.class.php', + '/categories/class/api_deprecated_category.class.php', + '/compta/facture/class/api_invoice.class.php', '/commande/class/api_commande.class.php', '/user/class/api_user.class.php', '/product/class/api_product.class.php', '/societe/class/api_contact.class.php', '/societe/class/api_thirdparty.class.php', - '/support/online.php', + '/support/online.php', '/takepos/class/actions_takepos.class.php' ); From 18464de297ca61caf3d8f1123c1ef82712ee985c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 4 Dec 2019 22:08:32 +0100 Subject: [PATCH 302/462] Clean old file --- htdocs/install/upgrade2.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index b7b82048e0b..60064ff33c2 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -4463,6 +4463,7 @@ function migrate_delete_old_files($db, $langs, $conf) '/core/modules/facture/pdf_crabe.modules.php', '/core/modules/facture/pdf_oursin.modules.php', + '/api/class/api_generic.class.php', '/categories/class/api_category.class.php', '/categories/class/api_deprecated_category.class.php', '/compta/facture/class/api_invoice.class.php', From 139419c3e85928e3b7ecc6775f10f7369b8216df Mon Sep 17 00:00:00 2001 From: Florian Mortgat Date: Thu, 5 Dec 2019 10:38:03 +0100 Subject: [PATCH 303/462] FIX 10.0: do not display single-letter values (indicating duration unit without value) in product list (this fix exists in develop) --- htdocs/product/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/list.php b/htdocs/product/list.php index cfa330196d9..f3a190e329b 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -900,7 +900,7 @@ if ($resql) print $duration_value; print (! empty($duration_unit) && isset($dur[$duration_unit]) ? ' '.$langs->trans($dur[$duration_unit]) : ''); } - else + elseif (! preg_match('/^[a-z]$/i', $obj->duration)) // If duration is a simple char (like 's' of 'm'), we do not show value { print $obj->duration; } From 3f6715a377e5a6f094421140df6feb9b7efe7032 Mon Sep 17 00:00:00 2001 From: Florian Mortgat Date: Thu, 5 Dec 2019 15:22:06 +0100 Subject: [PATCH 304/462] FIX: add URL param "restore_last_search_values=1" to all backlinks that point to a list --- htdocs/adherents/document.php | 2 +- htdocs/adherents/subscription/info.php | 2 +- htdocs/bookmarks/card.php | 2 +- htdocs/comm/card.php | 2 +- htdocs/comm/mailing/card.php | 2 +- htdocs/comm/mailing/cibles.php | 2 +- htdocs/comm/mailing/info.php | 2 +- htdocs/compta/paiement/card.php | 2 +- htdocs/compta/paiement/info.php | 2 +- htdocs/livraison/card.php | 2 +- htdocs/loan/card.php | 2 +- htdocs/loan/document.php | 2 +- htdocs/loan/info.php | 2 +- htdocs/loan/note.php | 2 +- htdocs/loan/schedule.php | 2 +- htdocs/product/stock/card.php | 2 +- htdocs/product/stock/info.php | 2 +- htdocs/product/stock/movement_card.php | 2 +- htdocs/product/stock/movement_list.php | 2 +- htdocs/reception/contact.php | 2 +- htdocs/reception/note.php | 2 +- htdocs/societe/paymentmodes.php | 8 ++++---- htdocs/societe/price.php | 2 +- htdocs/ticket/card.php | 4 ++-- htdocs/user/bank.php | 2 +- htdocs/user/param_ihm.php | 2 +- 26 files changed, 30 insertions(+), 30 deletions(-) diff --git a/htdocs/adherents/document.php b/htdocs/adherents/document.php index 72a1bd0d569..310bc275a9a 100644 --- a/htdocs/adherents/document.php +++ b/htdocs/adherents/document.php @@ -115,7 +115,7 @@ if ($id > 0) print '
'; print ''; - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; // Login if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) diff --git a/htdocs/adherents/subscription/info.php b/htdocs/adherents/subscription/info.php index 37a719e52bc..56043d3f8a3 100644 --- a/htdocs/adherents/subscription/info.php +++ b/htdocs/adherents/subscription/info.php @@ -53,7 +53,7 @@ $head = subscription_prepare_head($object); dol_fiche_head($head, 'info', $langs->trans("Subscription"), -1, 'payment'); -$linkback = ''.$langs->trans("BackToList").''; +$linkback = ''.$langs->trans("BackToList").''; dol_banner_tab($object, 'rowid', $linkback, 1); diff --git a/htdocs/bookmarks/card.php b/htdocs/bookmarks/card.php index 40558895fe2..1fa904a7781 100644 --- a/htdocs/bookmarks/card.php +++ b/htdocs/bookmarks/card.php @@ -223,7 +223,7 @@ if ($id > 0 && ! preg_match('/^add/i', $action)) dol_fiche_head($head, $hselected, $langs->trans("Bookmark"), -1, 'bookmark'); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '', '', 0, '', '', 0); diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 3d21c987c69..9130efabeeb 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -238,7 +238,7 @@ if ($object->id > 0) dol_fiche_head($head, 'customer', $langs->trans("ThirdParty"), -1, 'company'); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom'); diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index 88dfcef7d7f..f0e179c1318 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -1174,7 +1174,7 @@ else dol_fiche_head($head, 'card', $langs->trans("Mailing"), -1, 'email'); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; $morehtmlright=''; if ($object->statut == 2) $morehtmlright.=' ('.$object->countNbOfTargets('alreadysent').'/'.$object->nbemail.') '; diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index 532e792bd6e..06a6dfccc55 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -176,7 +176,7 @@ if ($object->fetch($id) >= 0) dol_fiche_head($head, 'targets', $langs->trans("Mailing"), -1, 'email'); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; $morehtmlright=''; $nbtry = $nbok = 0; diff --git a/htdocs/comm/mailing/info.php b/htdocs/comm/mailing/info.php index 5097b310363..ba606520c18 100644 --- a/htdocs/comm/mailing/info.php +++ b/htdocs/comm/mailing/info.php @@ -54,7 +54,7 @@ if ($object->fetch($id) >= 0) dol_fiche_head($head, 'info', $langs->trans("Mailing"), -1, 'email'); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; $morehtmlright=''; if ($object->statut == 2) $morehtmlright.=' ('.$object->countNbOfTargets('alreadysent').'/'.$object->nbemail.') '; diff --git a/htdocs/compta/paiement/card.php b/htdocs/compta/paiement/card.php index 4c0effee111..848cc20d483 100644 --- a/htdocs/compta/paiement/card.php +++ b/htdocs/compta/paiement/card.php @@ -204,7 +204,7 @@ if ($action == 'valide') print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id.'&facid='.$facid, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_valide', '', 0, 2); } -$linkback = '' . $langs->trans("BackToList") . ''; +$linkback = '' . $langs->trans("BackToList") . ''; dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', ''); diff --git a/htdocs/compta/paiement/info.php b/htdocs/compta/paiement/info.php index 7cf4c7fede0..18be92e4582 100644 --- a/htdocs/compta/paiement/info.php +++ b/htdocs/compta/paiement/info.php @@ -58,7 +58,7 @@ $head = payment_prepare_head($object); dol_fiche_head($head, 'info', $langs->trans("PaymentCustomerInvoice"), -1, 'payment'); -$linkback = '' . $langs->trans("BackToList") . ''; +$linkback = '' . $langs->trans("BackToList") . ''; dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', ''); diff --git a/htdocs/livraison/card.php b/htdocs/livraison/card.php index cb3aa136c2c..b3e654c8104 100644 --- a/htdocs/livraison/card.php +++ b/htdocs/livraison/card.php @@ -440,7 +440,7 @@ else /* if (($object->origin == 'shipment' || $object->origin == 'expedition') && $object->origin_id > 0) { - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; // Ref print ''; diff --git a/htdocs/loan/card.php b/htdocs/loan/card.php index a4e6cd57870..73d7a7eeaf0 100644 --- a/htdocs/loan/card.php +++ b/htdocs/loan/card.php @@ -439,7 +439,7 @@ if ($id > 0) // Loan card - $linkback = '' . $langs->trans("BackToList") . ''; + $linkback = '' . $langs->trans("BackToList") . ''; $morehtmlref='
'; // Ref loan diff --git a/htdocs/loan/document.php b/htdocs/loan/document.php index 7544e1913e8..2dc7566fad7 100644 --- a/htdocs/loan/document.php +++ b/htdocs/loan/document.php @@ -124,7 +124,7 @@ if ($object->id) } $morehtmlref.='
'; - $linkback = '' . $langs->trans("BackToList") . ''; + $linkback = '' . $langs->trans("BackToList") . ''; $object->totalpaid = $totalpaid; // To give a chance to dol_banner_tab to use already paid amount to show correct status diff --git a/htdocs/loan/info.php b/htdocs/loan/info.php index a6f7b12a9de..7027af16636 100644 --- a/htdocs/loan/info.php +++ b/htdocs/loan/info.php @@ -96,7 +96,7 @@ if (! empty($conf->projet->enabled)) { } $morehtmlref.=''; -$linkback = '' . $langs->trans("BackToList") . ''; +$linkback = '' . $langs->trans("BackToList") . ''; $object->totalpaid = $totalpaid; // To give a chance to dol_banner_tab to use already paid amount to show correct status diff --git a/htdocs/loan/note.php b/htdocs/loan/note.php index b0ec23316c7..b8a70c19b7e 100644 --- a/htdocs/loan/note.php +++ b/htdocs/loan/note.php @@ -113,7 +113,7 @@ if ($id > 0) } $morehtmlref.=''; - $linkback = '' . $langs->trans("BackToList") . ''; + $linkback = '' . $langs->trans("BackToList") . ''; $object->totalpaid = $totalpaid; // To give a chance to dol_banner_tab to use already paid amount to show correct status diff --git a/htdocs/loan/schedule.php b/htdocs/loan/schedule.php index d4e7dec9feb..791d16dfa33 100644 --- a/htdocs/loan/schedule.php +++ b/htdocs/loan/schedule.php @@ -44,7 +44,7 @@ llxHeader("", $title, $help_url); $head=loan_prepare_head($object); dol_fiche_head($head, 'FinancialCommitment', $langs->trans("Loan"), -1, 'bill'); -$linkback = '' . $langs->trans("BackToList") . ''; +$linkback = '' . $langs->trans("BackToList") . ''; $morehtmlref='
'; // Ref loan diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php index 1c78d6726d3..879d143b3f7 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -309,7 +309,7 @@ else print $formconfirm; // Warehouse card - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; $morehtmlref='
'; $morehtmlref.=$langs->trans("LocationSummary").' : '.$object->lieu; diff --git a/htdocs/product/stock/info.php b/htdocs/product/stock/info.php index c038952f6ba..5ec19cc6e9d 100644 --- a/htdocs/product/stock/info.php +++ b/htdocs/product/stock/info.php @@ -53,7 +53,7 @@ $head = stock_prepare_head($object); dol_fiche_head($head, 'info', $langs->trans("Warehouse"), -1, 'stock'); -$linkback = ''.$langs->trans("BackToList").''; +$linkback = ''.$langs->trans("BackToList").''; $morehtmlref='
'; $morehtmlref.=$langs->trans("LocationSummary").' : '.$object->lieu; diff --git a/htdocs/product/stock/movement_card.php b/htdocs/product/stock/movement_card.php index b75042c7cca..ac9635d525f 100644 --- a/htdocs/product/stock/movement_card.php +++ b/htdocs/product/stock/movement_card.php @@ -567,7 +567,7 @@ if ($resql) dol_fiche_head($head, 'movements', $langs->trans("Warehouse"), -1, 'stock'); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; $morehtmlref='
'; $morehtmlref.=$langs->trans("LocationSummary").' : '.$object->lieu; diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php index 836bb97e50c..2c69f7f9005 100644 --- a/htdocs/product/stock/movement_list.php +++ b/htdocs/product/stock/movement_list.php @@ -543,7 +543,7 @@ if ($resql) dol_fiche_head($head, 'movements', $langs->trans("Warehouse"), -1, 'stock'); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; $morehtmlref='
'; $morehtmlref.=$langs->trans("LocationSummary").' : '.$object->lieu; diff --git a/htdocs/reception/contact.php b/htdocs/reception/contact.php index d51062ef7ef..445d995b488 100644 --- a/htdocs/reception/contact.php +++ b/htdocs/reception/contact.php @@ -162,7 +162,7 @@ if ($id > 0 || ! empty($ref)) // Reception card - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; $morehtmlref='
'; // Ref customer reception diff --git a/htdocs/reception/note.php b/htdocs/reception/note.php index 740bf6bd522..5af4d12040a 100644 --- a/htdocs/reception/note.php +++ b/htdocs/reception/note.php @@ -103,7 +103,7 @@ if ($id > 0 || ! empty($ref)) // Reception card - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; $morehtmlref='
'; // Ref customer reception diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index 922fea064ec..0276ce9123b 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -1451,7 +1451,7 @@ if ($socid && $action == 'edit' && $user->rights->societe->creer) { dol_fiche_head($head, 'rib', $langs->trans("ThirdParty"), 0, 'company'); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom'); @@ -1555,7 +1555,7 @@ if ($socid && $action == 'editcard' && $user->rights->societe->creer) { dol_fiche_head($head, 'rib', $langs->trans("ThirdParty"), 0, 'company'); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom'); @@ -1603,7 +1603,7 @@ if ($socid && $action == 'create' && $user->rights->societe->creer) { dol_fiche_head($head, 'rib', $langs->trans("ThirdParty"), 0, 'company'); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom'); @@ -1701,7 +1701,7 @@ if ($socid && $action == 'createcard' && $user->rights->societe->creer) { dol_fiche_head($head, 'rib', $langs->trans("ThirdParty"), 0, 'company'); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom'); diff --git a/htdocs/societe/price.php b/htdocs/societe/price.php index 1476bb8ce75..039c1fe1bd5 100644 --- a/htdocs/societe/price.php +++ b/htdocs/societe/price.php @@ -187,7 +187,7 @@ $head = societe_prepare_head($object); dol_fiche_head($head, 'price', $langs->trans("ThirdParty"), -1, 'company'); -$linkback = ''.$langs->trans("BackToList").''; +$linkback = ''.$langs->trans("BackToList").''; dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom'); diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 93a6981f8be..a9a8010eb20 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -693,7 +693,7 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd */ print '
'.$langs->trans("RefSending").'
'; - $linkback = '' . $langs->trans("BackToList") . ''; + $linkback = '' . $langs->trans("BackToList") . ''; // Ref print ''; print "
' . $langs->trans('Ref') . ''; @@ -821,7 +821,7 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd $morehtmlref.=''; - $linkback = '' . $langs->trans("BackToList") . ' '; + $linkback = '' . $langs->trans("BackToList") . ' '; dol_banner_tab($object, 'ref', $linkback, ($user->societe_id ? 0 : 1), 'ref', 'ref', $morehtmlref); diff --git a/htdocs/user/bank.php b/htdocs/user/bank.php index 2e2091034f9..2c00dfe3150 100644 --- a/htdocs/user/bank.php +++ b/htdocs/user/bank.php @@ -477,7 +477,7 @@ if ($id && ($action == 'edit' || $action == 'create' ) && $user->rights->user->u $title = $langs->trans("User"); dol_fiche_head($head, 'bank', $title, 0, 'user'); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin); diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php index 90228aa952e..de2a84518ff 100644 --- a/htdocs/user/param_ihm.php +++ b/htdocs/user/param_ihm.php @@ -323,7 +323,7 @@ else { dol_fiche_head($head, 'guisetup', $title, -1, 'user'); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin); From 486f5980673c011f2b815801cccd97d36228429f Mon Sep 17 00:00:00 2001 From: atm-lena Date: Thu, 5 Dec 2019 16:09:52 +0100 Subject: [PATCH 305/462] FIX getrights() request --- htdocs/user/class/user.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 8e0a9d956cb..b2d31b40590 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -879,6 +879,7 @@ class User extends CommonObject else { $sql.= " AND gr.entity = ".$conf->entity; + $sql.= " AND gu.entity = ".$conf->entity; $sql.= " AND r.entity = ".$conf->entity; } $sql.= " AND gr.fk_usergroup = gu.fk_usergroup"; From d73bd3ee9a6b433f513fec4cdedfdc2e0f8c9e21 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 6 Dec 2019 18:41:22 +0100 Subject: [PATCH 306/462] Fix a supplier ref is mandatory for import --- htdocs/core/modules/modProduct.class.php | 2 +- htdocs/core/modules/modService.class.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/modProduct.class.php b/htdocs/core/modules/modProduct.class.php index d05a767425b..e5c1e91b973 100644 --- a/htdocs/core/modules/modProduct.class.php +++ b/htdocs/core/modules/modProduct.class.php @@ -587,7 +587,7 @@ class modProduct extends DolibarrModules $this->import_fields_array[$r]=array(//field order as per structure of table llx_product_fournisseur_price, without optional fields 'sp.fk_product'=>"ProductOrService*", 'sp.fk_soc' => "Supplier*", - 'sp.ref_fourn' => 'SupplierRef', + 'sp.ref_fourn' => 'SupplierRef*', 'sp.quantity' => "QtyMin*", 'sp.tva_tx' => 'VATRate', 'sp.default_vat_code' => 'VATCode', diff --git a/htdocs/core/modules/modService.class.php b/htdocs/core/modules/modService.class.php index 20db49d5e69..d4e6313e054 100644 --- a/htdocs/core/modules/modService.class.php +++ b/htdocs/core/modules/modService.class.php @@ -563,7 +563,7 @@ class modService extends DolibarrModules $this->import_fields_array[$r]=array(//field order as per structure of table llx_product_fournisseur_price, without optional fields 'sp.fk_product'=>"ProductOrService*", 'sp.fk_soc' => "Supplier*", - 'sp.ref_fourn' => 'SupplierRef', + 'sp.ref_fourn' => 'SupplierRef*', 'sp.quantity' => "QtyMin*", 'sp.tva_tx' => 'VATRate', 'sp.default_vat_code' => 'VATCode', From cafe26cfc34927914fc84f5be22384ad13282d1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 6 Dec 2019 23:23:57 +0100 Subject: [PATCH 307/462] Update card.php --- htdocs/expedition/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index c8ebeb5be57..8abd7779849 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -699,7 +699,7 @@ if (empty($reshook)) if ($lines[$i]->entrepot_id > 0) { // single warehouse shipment line - if ($lines[i]->entrepot_id == $lotStock->warehouseid) + if ($lines[$i]->entrepot_id == $lotStock->warehouseid) { $lineIdToAddLot = $line_id; } From f51a68ceb10fe32d67e6c47c0ea74f9fe114ea2d Mon Sep 17 00:00:00 2001 From: Laurent Dinclaux Date: Sat, 7 Dec 2019 15:36:23 +1100 Subject: [PATCH 308/462] Takepos: Well align the search field width, keep old CSS rule as fallback for old browsers --- htdocs/takepos/takepos.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/takepos.php b/htdocs/takepos/takepos.php index 339bbaa0643..5af931c8fac 100644 --- a/htdocs/takepos/takepos.php +++ b/htdocs/takepos/takepos.php @@ -719,7 +719,7 @@ $menus[$r++]=array('title'=>'< print ''."\n"; print '
'; - print ' '; + print ' '; print ''.img_picto('', 'searchclear').''; print '
'; ?> From 394104291a430cf3e7eda6ad99ba66f3e98f25c9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 8 Dec 2019 04:22:09 +0100 Subject: [PATCH 309/462] Fix function not found when creating a payment of an expense report --- htdocs/core/lib/functions.lib.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index cff0ef2b8ef..6bc3fcd0866 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1251,6 +1251,7 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r { if (empty($conf->global->MAIN_DISABLE_PDF_THUMBS)) // If you experience trouble with pdf thumb generation and imagick, you can disable here. { + include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $ret = dol_convert_file($file, 'png', $fileimage); if ($ret < 0) $error++; } From f28e4c14e875915db7abe99ea4db5a03a49b25cd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 9 Dec 2019 13:40:26 +0100 Subject: [PATCH 310/462] FIX #12644 --- htdocs/compta/facture/card.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 9cb76a2f292..b067adffeca 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1939,7 +1939,14 @@ if (empty($reshook)) if ($tva_npr) $info_bits |= 0x01; - if ($usercanproductignorepricemin && (! empty($price_min) && (price2num($pu_ht) * (1 - price2num($remise_percent) / 100) < price2num($price_min)))) { + $price2num_pu_ht = price2num($pu_ht); + $price2num_remise_percent = price2num($remise_percent); + $price2num_price_min = price2num($price_min); + if (empty($price2num_pu_ht)) $price2num_pu_ht = 0; + if (empty($price2num_remise_percent)) $price2num_remise_percent = 0; + if (empty($price2num_price_min)) $price2num_price_min = 0; + + if ($usercanproductignorepricemin && (! empty($price_min) && ($price2num_pu_ht * (1 - $price2num_remise_percent / 100) < $price2num_price_min))) { $mesg = $langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)); setEventMessages($mesg, null, 'errors'); } else { From 903c3771ba877a717f3efb3503ac68c55290149d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20Lelarge?= Date: Mon, 9 Dec 2019 14:56:20 +0100 Subject: [PATCH 311/462] FIX #12665 Mass invoice validation with stock management Normally the mass invoice validation is not authorized due to the need to choose the warehouse where to increase or decrease the stock. A message ErrorMassValidationNotAllowedWhenStockIncreaseOnAction is displayed to inform the user to do this validation manually one by one. The invoices should not be validated. --- 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 6cd98f00e48..440c16954a1 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -1084,7 +1084,7 @@ if (! $error && $massaction == 'validate' && $permtocreate) { $objecttmp=new $objectclass($db); - if ($objecttmp->element == 'invoice' && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_BILL)) + if (($objecttmp->element == 'facture' || $objecttmp->element == 'invoice') && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_BILL)) { $langs->load("errors"); setEventMessages($langs->trans('ErrorMassValidationNotAllowedWhenStockIncreaseOnAction'), null, 'errors'); From 407fe902b49019c9bd62549d12e40f7d237c6a11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 9 Dec 2019 16:42:57 +0100 Subject: [PATCH 312/462] missing $db for line 711 --- htdocs/core/class/utils.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php index 8ce4cca7ca6..12972a89752 100644 --- a/htdocs/core/class/utils.class.php +++ b/htdocs/core/class/utils.class.php @@ -586,7 +586,7 @@ class Utils */ function generateDoc($module) { - global $conf, $langs; + global $conf, $langs, $db; global $dirins; $error = 0; From a16e342af6b6e5e564e22c09b6812c5640351f08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 9 Dec 2019 23:15:15 +0100 Subject: [PATCH 313/462] typo --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 32dd6fbd361..4ae766d4f4d 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -497,7 +497,7 @@ abstract class CommonObject $this->country =$tmparray['label']; } - if ($withregion && $this->state_id && (empty($this->state_code) || empty($this->state) || empty($this->region) || empty($this->region_cpde))) + if ($withregion && $this->state_id && (empty($this->state_code) || empty($this->state) || empty($this->region) || empty($this->region_code))) { require_once DOL_DOCUMENT_ROOT .'/core/lib/company.lib.php'; $tmparray=getState($this->state_id,'all',0,1); From de741f5dd023715392c7fb7da9e66fa10482486e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 9 Dec 2019 23:22:13 +0100 Subject: [PATCH 314/462] The variable $id seems to be never defined --- htdocs/core/class/commonobject.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 32dd6fbd361..e73447709ac 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1764,7 +1764,7 @@ abstract class CommonObject */ function setMulticurrencyCode($code) { - dol_syslog(get_class($this).'::setMulticurrencyCode('.$id.')'); + dol_syslog(get_class($this).'::setMulticurrencyCode('.$code.')'); if ($this->statut >= 0 || $this->element == 'societe') { $fieldname = 'multicurrency_code'; @@ -1806,7 +1806,7 @@ abstract class CommonObject */ function setMulticurrencyRate($rate, $mode=1) { - dol_syslog(get_class($this).'::setMulticurrencyRate('.$id.')'); + dol_syslog(get_class($this).'::setMulticurrencyRate('.$rate.','.$mode.')'); if ($this->statut >= 0 || $this->element == 'societe') { $fieldname = 'multicurrency_tx'; From f4674a7558037a6d6c6f57fd16c362ec2b9cec45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 10 Dec 2019 07:51:39 +0100 Subject: [PATCH 315/462] doxygen and $db bot defined --- htdocs/core/lib/files.lib.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index e003b74f3e6..10aa26e99d6 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -958,18 +958,18 @@ function dol_unescapefile($filename) */ function dolCheckVirus($src_file) { - global $conf; + global $conf, $db; if (! empty($conf->global->MAIN_ANTIVIRUS_COMMAND)) { if (! class_exists('AntiVir')) { require_once DOL_DOCUMENT_ROOT.'/core/class/antivir.class.php'; } - $antivir=new AntiVir($db); + $antivir = new AntiVir($db); $result = $antivir->dol_avscan_file($src_file); if ($result < 0) // If virus or error, we stop here { - $reterrors=$antivir->errors; + $reterrors = $antivir->errors; return $reterrors; } } @@ -992,7 +992,7 @@ function dolCheckVirus($src_file) * @param integer $uploaderrorcode Value of PHP upload error code ($_FILES['field']['error']) * @param int $nohook Disable all hooks * @param string $varfiles _FILES var name - * @return int >0 if OK, <0 or string if KO + * @return int|string >0 if OK, <0 or string if KO * @see dol_move */ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disablevirusscan=0, $uploaderrorcode=0, $nohook=0, $varfiles='addedfile') From 5d61e53140fa716e6916aa4ab491f27fb0804602 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20Lelarge?= Date: Mon, 9 Dec 2019 14:56:20 +0100 Subject: [PATCH 316/462] FIX #12665 Mass invoice validation with stock management Normally the mass invoice validation is not authorized due to the need to choose the warehouse where to increase or decrease the stock. A message ErrorMassValidationNotAllowedWhenStockIncreaseOnAction is displayed to inform the user to do this validation manually one by one. The invoices should not be validated. --- 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 62d8e2466b0..ad98cfa2ae1 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -1048,7 +1048,7 @@ if (! $error && $massaction == 'validate' && $permtocreate) { $objecttmp=new $objectclass($db); - if ($objecttmp->element == 'invoice' && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_BILL)) + if (($objecttmp->element == 'facture' || $objecttmp->element == 'invoice') && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_BILL)) { $langs->load("errors"); setEventMessages($langs->trans('ErrorMassValidationNotAllowedWhenStockIncreaseOnAction'), null, 'errors'); From 97ec8b8e0261689194ba5a1be20d702aea6ff2a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20Lelarge?= Date: Mon, 9 Dec 2019 14:56:20 +0100 Subject: [PATCH 317/462] FIX #12665 Mass invoice validation with stock management Normally the mass invoice validation is not authorized due to the need to choose the warehouse where to increase or decrease the stock. A message ErrorMassValidationNotAllowedWhenStockIncreaseOnAction is displayed to inform the user to do this validation manually one by one. The invoices should not be validated. --- 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 03cf1eae755..99bc62dff79 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -1079,7 +1079,7 @@ if (! $error && $massaction == 'validate' && $permtocreate) { $objecttmp=new $objectclass($db); - if ($objecttmp->element == 'invoice' && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_BILL)) + if (($objecttmp->element == 'facture' || $objecttmp->element == 'invoice') && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_BILL)) { $langs->load("errors"); setEventMessages($langs->trans('ErrorMassValidationNotAllowedWhenStockIncreaseOnAction'), null, 'errors'); From b92ec604ecc4f7034e0bbaac0bea80213e7f3741 Mon Sep 17 00:00:00 2001 From: Mistral Oz - LWEP Date: Tue, 10 Dec 2019 18:25:30 +0100 Subject: [PATCH 318/462] New model "Excel 2007" : first col at wrong position The first column start at id 0 instead of id 1. At id 0, the first column move at Z position. Documentation : https://phpspreadsheet.readthedocs.io/en/latest/topics/migration-from-PHPExcel/#column-index-based-on-1 --- .../modules/export/export_excel2007new.modules.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/export/export_excel2007new.modules.php b/htdocs/core/modules/export/export_excel2007new.modules.php index 038446643a2..776ad5e395a 100644 --- a/htdocs/core/modules/export/export_excel2007new.modules.php +++ b/htdocs/core/modules/export/export_excel2007new.modules.php @@ -262,7 +262,10 @@ class ExportExcel2007new extends ModeleExports $this->workbook->getActiveSheet()->getStyle('1')->getFont()->setBold(true); $this->workbook->getActiveSheet()->getStyle('1')->getAlignment()->setHorizontal(PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_LEFT); - $this->col=0; + $this->col=1; + if (! empty($conf->global->MAIN_USE_PHP_WRITEEXCEL)) { + $this->col=0; + } foreach($array_selected_sorted as $code => $value) { $alias=$array_export_fields_label[$code]; @@ -302,7 +305,10 @@ class ExportExcel2007new extends ModeleExports global $conf; // Define first row - $this->col=0; + $this->col=1; + if (! empty($conf->global->MAIN_USE_PHP_WRITEEXCEL)) { + $this->col=0; + } $reg=array(); From a527e72124f5b49aa2145542e87f64e8dd55f034 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 12 Dec 2019 16:35:07 +0100 Subject: [PATCH 319/462] FIX #12688 --- htdocs/compta/resultat/index.php | 4 +++- htdocs/compta/stats/index.php | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index d40f00a9c42..887412bc6a4 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -815,7 +815,9 @@ if (! empty($conf->accounting->enabled) && ($modecompta == 'BOOKKEEPING')) $sql = "SELECT b.doc_ref, b.numero_compte, b.subledger_account, b.subledger_label, pcg_type, date_format(b.doc_date,'%Y-%m') as dm, sum(b.debit) as debit, sum(b.credit) as credit, sum(b.montant) as amount"; $sql.= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as b, ".MAIN_DB_PREFIX."accounting_account as aa"; - $sql.= " WHERE b.numero_compte = aa.account_number AND b.entity = ".$conf->entity; + $sql.= " WHERE b.entity = ".$conf->entity; + $sql.= " AND aa.entity = ".$conf->entity; + $sql.= " AND b.numero_compte = aa.account_number"; $sql.= " AND ".$predefinedgroupwhere; $sql.= " AND fk_pcg_version = '".$db->escape($charofaccountstring)."'"; if (! empty($date_start) && ! empty($date_end)) diff --git a/htdocs/compta/stats/index.php b/htdocs/compta/stats/index.php index cd17fbba233..c14bc46ad13 100644 --- a/htdocs/compta/stats/index.php +++ b/htdocs/compta/stats/index.php @@ -194,6 +194,7 @@ elseif ($modecompta=="BOOKKEEPING") $sql = "SELECT date_format(b.doc_date,'%Y-%m') as dm, sum(b.credit) as amount_ttc"; $sql.= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as b, ".MAIN_DB_PREFIX."accounting_journal as aj"; $sql.= " WHERE b.entity = ".$conf->entity; + $sql.= " AND aj.entity = ".$conf->entity; $sql.= " AND b.code_journal = aj.code AND aj.nature = 2" ; // @TODO currently count amount in sale journal, but we need to define a category group for turnover } From a0aa51fe0ce3ae51039a70329b43c43191a6bede Mon Sep 17 00:00:00 2001 From: gauthier Date: Thu, 12 Dec 2019 16:46:25 +0100 Subject: [PATCH 320/462] FIX : CommandeFournisseurLigne update function must not be able to return other value than 1 if success --- 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 d0d0e4a1615..29d56a3aabf 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -3577,7 +3577,7 @@ class CommandeFournisseurLigne extends CommonOrderLine if (! $error) { $this->db->commit(); - return $result; + return 1; } else { From cad54c6d7a8421678d56a2390b6614534d0d35c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 13 Dec 2019 10:42:49 +0100 Subject: [PATCH 321/462] Update generate_filelist_xml.php --- build/generate_filelist_xml.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/generate_filelist_xml.php b/build/generate_filelist_xml.php index 25f4af98207..45955d04ce1 100755 --- a/build/generate_filelist_xml.php +++ b/build/generate_filelist_xml.php @@ -72,7 +72,7 @@ while ($i < $argc) if (empty($release)) { - print "Error: Missing release paramater\n"; + print "Error: Missing release parameter\n"; print "Usage: ".$script_file." release=autostable|auto[-mybuild]|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n"; exit -1; } @@ -164,7 +164,7 @@ $iterator1 = new RecursiveIteratorIterator($dir_iterator1); // Need to ignore document custom etc. Note: this also ignore natively symbolic links. $files = new RegexIterator($iterator1, '#^(?:[A-Z]:)?(?:/(?!(?:'.($includecustom?'':'custom\/|').'documents\/|conf\/|install\/))[^/]+)+/[^/]+\.(?:php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$#i'); */ -$regextoinclude='\.(php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$'; +$regextoinclude='\.(php|css|scss|html|xml|js|json|tpl|jpg|png|gif|ico|sql|lang|txt|yml|bak|md|mp3|mp4|wav|mkv|z|gz|zip|rar|tar|less|svg|eot|woff|woff2|ttf|manifest)$'; $regextoexclude='('.($includecustom?'':'custom|').'documents|conf|install|public\/test|Shared\/PCLZip|nusoap\/lib\/Mail|php\/example|php\/test|geoip\/sample.*\.php|ckeditor\/samples|ckeditor\/adapters)$'; // Exclude dirs $files = dol_dir_list(DOL_DOCUMENT_ROOT, 'files', 1, $regextoinclude, $regextoexclude, 'fullname'); $dir=''; From a923a48e64ffec14d956049d5ae60446653c35b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 13 Dec 2019 10:44:12 +0100 Subject: [PATCH 322/462] Update filecheck.php --- htdocs/admin/system/filecheck.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/system/filecheck.php b/htdocs/admin/system/filecheck.php index 14b25aedac2..7e3468160c6 100644 --- a/htdocs/admin/system/filecheck.php +++ b/htdocs/admin/system/filecheck.php @@ -2,7 +2,7 @@ /* Copyright (C) 2005-2016 Laurent Destailleur * Copyright (C) 2007 Rodolphe Quiedeville * Copyright (C) 2007-2012 Regis Houssin - * Copyright (C) 2015 Frederic France + * Copyright (C) 2015-2019 Frederic France * Copyright (C) 2017 Nicolas ZABOURI * * This program is free software; you can redistribute it and/or modify @@ -214,7 +214,7 @@ if (! $error && $xml) $includecustom=(empty($xml->dolibarr_htdocs_dir[0]['includecustom'])?0:$xml->dolibarr_htdocs_dir[0]['includecustom']); // Defined qualified files (must be same than into generate_filelist_xml.php) - $regextoinclude='\.(php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$'; + $regextoinclude='\.(php|css|scss|html|xml|js|json|tpl|jpg|png|gif|ico|sql|lang|txt|yml|bak|md|mp3|mp4|wav|mkv|z|gz|zip|rar|tar|less|svg|eot|woff|woff2|ttf|manifest)$'; $regextoexclude='('.($includecustom?'':'custom|').'documents|conf|install|public\/test|Shared\/PCLZip|nusoap\/lib\/Mail|php\/example|php\/test|geoip\/sample.*\.php|ckeditor\/samples|ckeditor\/adapters)$'; // Exclude dirs $scanfiles = dol_dir_list(DOL_DOCUMENT_ROOT, 'files', 1, $regextoinclude, $regextoexclude); From 030b78d79f1ab63f3b129363f4c1fff939dfc32e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 13 Dec 2019 11:16:04 +0100 Subject: [PATCH 323/462] Update generate_filelist_xml.php --- build/generate_filelist_xml.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/generate_filelist_xml.php b/build/generate_filelist_xml.php index 45955d04ce1..490b8ca9f37 100755 --- a/build/generate_filelist_xml.php +++ b/build/generate_filelist_xml.php @@ -164,7 +164,7 @@ $iterator1 = new RecursiveIteratorIterator($dir_iterator1); // Need to ignore document custom etc. Note: this also ignore natively symbolic links. $files = new RegexIterator($iterator1, '#^(?:[A-Z]:)?(?:/(?!(?:'.($includecustom?'':'custom\/|').'documents\/|conf\/|install\/))[^/]+)+/[^/]+\.(?:php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$#i'); */ -$regextoinclude='\.(php|css|scss|html|xml|js|json|tpl|jpg|png|gif|ico|sql|lang|txt|yml|bak|md|mp3|mp4|wav|mkv|z|gz|zip|rar|tar|less|svg|eot|woff|woff2|ttf|manifest)$'; +$regextoinclude='\.(php|php3|php4|php5|phtml|phps|phar|css|scss|html|xml|js|json|tpl|jpg|png|gif|ico|sql|lang|txt|yml|bak|md|mp3|mp4|wav|mkv|z|gz|zip|rar|tar|less|svg|eot|woff|woff2|ttf|manifest)$'; $regextoexclude='('.($includecustom?'':'custom|').'documents|conf|install|public\/test|Shared\/PCLZip|nusoap\/lib\/Mail|php\/example|php\/test|geoip\/sample.*\.php|ckeditor\/samples|ckeditor\/adapters)$'; // Exclude dirs $files = dol_dir_list(DOL_DOCUMENT_ROOT, 'files', 1, $regextoinclude, $regextoexclude, 'fullname'); $dir=''; From 6e64a20f9e859d4b6f039ed1c1ad3d763bb156fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 13 Dec 2019 11:16:46 +0100 Subject: [PATCH 324/462] Update filecheck.php --- htdocs/admin/system/filecheck.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/system/filecheck.php b/htdocs/admin/system/filecheck.php index 7e3468160c6..ef1132c272c 100644 --- a/htdocs/admin/system/filecheck.php +++ b/htdocs/admin/system/filecheck.php @@ -214,7 +214,7 @@ if (! $error && $xml) $includecustom=(empty($xml->dolibarr_htdocs_dir[0]['includecustom'])?0:$xml->dolibarr_htdocs_dir[0]['includecustom']); // Defined qualified files (must be same than into generate_filelist_xml.php) - $regextoinclude='\.(php|css|scss|html|xml|js|json|tpl|jpg|png|gif|ico|sql|lang|txt|yml|bak|md|mp3|mp4|wav|mkv|z|gz|zip|rar|tar|less|svg|eot|woff|woff2|ttf|manifest)$'; + $regextoinclude='\.(php|php3|php4|php5|phtml|phps|phar|css|scss|html|xml|js|json|tpl|jpg|png|gif|ico|sql|lang|txt|yml|bak|md|mp3|mp4|wav|mkv|z|gz|zip|rar|tar|less|svg|eot|woff|woff2|ttf|manifest)$'; $regextoexclude='('.($includecustom?'':'custom|').'documents|conf|install|public\/test|Shared\/PCLZip|nusoap\/lib\/Mail|php\/example|php\/test|geoip\/sample.*\.php|ckeditor\/samples|ckeditor\/adapters)$'; // Exclude dirs $scanfiles = dol_dir_list(DOL_DOCUMENT_ROOT, 'files', 1, $regextoinclude, $regextoexclude); From 18e3a4bcbb7f9018f3b9cd5a5102c335991047f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 13 Dec 2019 12:56:02 +0100 Subject: [PATCH 325/462] Update generate_filelist_xml.php --- build/generate_filelist_xml.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/generate_filelist_xml.php b/build/generate_filelist_xml.php index 490b8ca9f37..d8bb0882f6b 100755 --- a/build/generate_filelist_xml.php +++ b/build/generate_filelist_xml.php @@ -164,7 +164,7 @@ $iterator1 = new RecursiveIteratorIterator($dir_iterator1); // Need to ignore document custom etc. Note: this also ignore natively symbolic links. $files = new RegexIterator($iterator1, '#^(?:[A-Z]:)?(?:/(?!(?:'.($includecustom?'':'custom\/|').'documents\/|conf\/|install\/))[^/]+)+/[^/]+\.(?:php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$#i'); */ -$regextoinclude='\.(php|php3|php4|php5|phtml|phps|phar|css|scss|html|xml|js|json|tpl|jpg|png|gif|ico|sql|lang|txt|yml|bak|md|mp3|mp4|wav|mkv|z|gz|zip|rar|tar|less|svg|eot|woff|woff2|ttf|manifest)$'; +$regextoinclude='\.(php|php3|php4|php5|phtml|phps|phar|inc|css|scss|html|xml|js|json|tpl|jpg|jpeg|png|gif|ico|sql|lang|txt|yml|bak|md|mp3|mp4|wav|mkv|z|gz|zip|rar|tar|less|svg|eot|woff|woff2|ttf|manifest)$'; $regextoexclude='('.($includecustom?'':'custom|').'documents|conf|install|public\/test|Shared\/PCLZip|nusoap\/lib\/Mail|php\/example|php\/test|geoip\/sample.*\.php|ckeditor\/samples|ckeditor\/adapters)$'; // Exclude dirs $files = dol_dir_list(DOL_DOCUMENT_ROOT, 'files', 1, $regextoinclude, $regextoexclude, 'fullname'); $dir=''; From 50937f8ca14c046ec76daba922006abf00fc64ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 13 Dec 2019 12:56:48 +0100 Subject: [PATCH 326/462] Update filecheck.php --- htdocs/admin/system/filecheck.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/system/filecheck.php b/htdocs/admin/system/filecheck.php index ef1132c272c..bf777180314 100644 --- a/htdocs/admin/system/filecheck.php +++ b/htdocs/admin/system/filecheck.php @@ -214,7 +214,7 @@ if (! $error && $xml) $includecustom=(empty($xml->dolibarr_htdocs_dir[0]['includecustom'])?0:$xml->dolibarr_htdocs_dir[0]['includecustom']); // Defined qualified files (must be same than into generate_filelist_xml.php) - $regextoinclude='\.(php|php3|php4|php5|phtml|phps|phar|css|scss|html|xml|js|json|tpl|jpg|png|gif|ico|sql|lang|txt|yml|bak|md|mp3|mp4|wav|mkv|z|gz|zip|rar|tar|less|svg|eot|woff|woff2|ttf|manifest)$'; + $regextoinclude='\.(php|php3|php4|php5|phtml|phps|phar|inc|css|scss|html|xml|js|json|tpl|jpg|jpeg|png|gif|ico|sql|lang|txt|yml|bak|md|mp3|mp4|wav|mkv|z|gz|zip|rar|tar|less|svg|eot|woff|woff2|ttf|manifest)$'; $regextoexclude='('.($includecustom?'':'custom|').'documents|conf|install|public\/test|Shared\/PCLZip|nusoap\/lib\/Mail|php\/example|php\/test|geoip\/sample.*\.php|ckeditor\/samples|ckeditor\/adapters)$'; // Exclude dirs $scanfiles = dol_dir_list(DOL_DOCUMENT_ROOT, 'files', 1, $regextoinclude, $regextoexclude); From bac5c3800e2bfc25b70ae83c378339829b2b5cdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 13 Dec 2019 14:46:27 +0100 Subject: [PATCH 327/462] Update api_setup.class.php --- htdocs/api/class/api_setup.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/api/class/api_setup.class.php b/htdocs/api/class/api_setup.class.php index ef2b4c8bb6d..35a6770ead7 100644 --- a/htdocs/api/class/api_setup.class.php +++ b/htdocs/api/class/api_setup.class.php @@ -711,7 +711,7 @@ class Setup extends DolibarrApi $includecustom=(empty($xml->dolibarr_htdocs_dir[0]['includecustom'])?0:$xml->dolibarr_htdocs_dir[0]['includecustom']); // Defined qualified files (must be same than into generate_filelist_xml.php) - $regextoinclude='\.(php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$'; + $regextoinclude='\.(php|php3|php4|php5|phtml|phps|phar|inc|css|scss|html|xml|js|json|tpl|jpg|jpeg|png|gif|ico|sql|lang|txt|yml|bak|md|mp3|mp4|wav|mkv|z|gz|zip|rar|tar|less|svg|eot|woff|woff2|ttf|manifest)$'; $regextoexclude='('.($includecustom?'':'custom|').'documents|conf|install|public\/test|Shared\/PCLZip|nusoap\/lib\/Mail|php\/example|php\/test|geoip\/sample.*\.php|ckeditor\/samples|ckeditor\/adapters)$'; // Exclude dirs $scanfiles = dol_dir_list(DOL_DOCUMENT_ROOT, 'files', 1, $regextoinclude, $regextoexclude); From cc1454c8d5add9d70868428b8af68418b978b5f8 Mon Sep 17 00:00:00 2001 From: gauthier Date: Fri, 13 Dec 2019 14:55:39 +0100 Subject: [PATCH 328/462] FIX : product_fourn_price_id was assigned too late for logPrice() function --- htdocs/fourn/class/fournisseur.product.class.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index 786a650efb3..a6411942f75 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -434,11 +434,9 @@ class ProductFournisseur extends Product $sql .= (empty($fk_barcode_type) ? 'NULL' : "'" . $this->db->escape($fk_barcode_type) . "'"); $sql .= ")"; - $idinserted = 0; - $resql = $this->db->query($sql); if ($resql) { - $idinserted = $this->db->last_insert_id(MAIN_DB_PREFIX . "product_fournisseur_price"); + $this->product_fourn_price_id = $this->db->last_insert_id(MAIN_DB_PREFIX . "product_fournisseur_price"); } else { $error++; @@ -461,7 +459,6 @@ class ProductFournisseur extends Product if (empty($error)) { $this->db->commit(); - $this->product_fourn_price_id = $idinserted; return $this->product_fourn_price_id; } else { $this->db->rollback(); From 9f2a628c3b1dd68d7cc56ebf5b2ff73c187a7b2a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 14 Dec 2019 13:25:21 +0100 Subject: [PATCH 329/462] Remove bak file --- build/generate_filelist_xml.php | 2 +- htdocs/admin/system/filecheck.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/generate_filelist_xml.php b/build/generate_filelist_xml.php index d8bb0882f6b..c2d9fa37e69 100755 --- a/build/generate_filelist_xml.php +++ b/build/generate_filelist_xml.php @@ -164,7 +164,7 @@ $iterator1 = new RecursiveIteratorIterator($dir_iterator1); // Need to ignore document custom etc. Note: this also ignore natively symbolic links. $files = new RegexIterator($iterator1, '#^(?:[A-Z]:)?(?:/(?!(?:'.($includecustom?'':'custom\/|').'documents\/|conf\/|install\/))[^/]+)+/[^/]+\.(?:php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$#i'); */ -$regextoinclude='\.(php|php3|php4|php5|phtml|phps|phar|inc|css|scss|html|xml|js|json|tpl|jpg|jpeg|png|gif|ico|sql|lang|txt|yml|bak|md|mp3|mp4|wav|mkv|z|gz|zip|rar|tar|less|svg|eot|woff|woff2|ttf|manifest)$'; +$regextoinclude='\.(php|php3|php4|php5|phtml|phps|phar|inc|css|scss|html|xml|js|json|tpl|jpg|jpeg|png|gif|ico|sql|lang|txt|yml|md|mp3|mp4|wav|mkv|z|gz|zip|rar|tar|less|svg|eot|woff|woff2|ttf|manifest)$'; $regextoexclude='('.($includecustom?'':'custom|').'documents|conf|install|public\/test|Shared\/PCLZip|nusoap\/lib\/Mail|php\/example|php\/test|geoip\/sample.*\.php|ckeditor\/samples|ckeditor\/adapters)$'; // Exclude dirs $files = dol_dir_list(DOL_DOCUMENT_ROOT, 'files', 1, $regextoinclude, $regextoexclude, 'fullname'); $dir=''; diff --git a/htdocs/admin/system/filecheck.php b/htdocs/admin/system/filecheck.php index bf777180314..fbdfd71c34e 100644 --- a/htdocs/admin/system/filecheck.php +++ b/htdocs/admin/system/filecheck.php @@ -214,7 +214,7 @@ if (! $error && $xml) $includecustom=(empty($xml->dolibarr_htdocs_dir[0]['includecustom'])?0:$xml->dolibarr_htdocs_dir[0]['includecustom']); // Defined qualified files (must be same than into generate_filelist_xml.php) - $regextoinclude='\.(php|php3|php4|php5|phtml|phps|phar|inc|css|scss|html|xml|js|json|tpl|jpg|jpeg|png|gif|ico|sql|lang|txt|yml|bak|md|mp3|mp4|wav|mkv|z|gz|zip|rar|tar|less|svg|eot|woff|woff2|ttf|manifest)$'; + $regextoinclude='\.(php|php3|php4|php5|phtml|phps|phar|inc|css|scss|html|xml|js|json|tpl|jpg|jpeg|png|gif|ico|sql|lang|txt|yml|md|mp3|mp4|wav|mkv|z|gz|zip|rar|tar|less|svg|eot|woff|woff2|ttf|manifest)$'; $regextoexclude='('.($includecustom?'':'custom|').'documents|conf|install|public\/test|Shared\/PCLZip|nusoap\/lib\/Mail|php\/example|php\/test|geoip\/sample.*\.php|ckeditor\/samples|ckeditor\/adapters)$'; // Exclude dirs $scanfiles = dol_dir_list(DOL_DOCUMENT_ROOT, 'files', 1, $regextoinclude, $regextoexclude); From 31a60ff30b8116f8fe7a8d14171699bd19aba835 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 14 Dec 2019 14:41:27 +0100 Subject: [PATCH 330/462] Fix $db --- htdocs/core/class/utils.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php index 12972a89752..5007e642300 100644 --- a/htdocs/core/class/utils.class.php +++ b/htdocs/core/class/utils.class.php @@ -586,7 +586,7 @@ class Utils */ function generateDoc($module) { - global $conf, $langs, $db; + global $conf, $langs; global $dirins; $error = 0; @@ -708,7 +708,7 @@ class Utils $outfile=$dirofmoduletmp.'/out.tmp'; require_once DOL_DOCUMENT_ROOT.'/core/class/utils.class.php'; - $utils = new Utils($db); + $utils = new Utils($this->db); $resarray = $utils->executeCLI($command, $outfile); if ($resarray['result'] != '0') { From e9a0646f6f7ef55bdae6b85c880ace1247e513ab Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 14 Dec 2019 22:25:34 +0100 Subject: [PATCH 331/462] Update fournisseur.product.class.php --- htdocs/fourn/class/fournisseur.product.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index a6411942f75..ac936f30334 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -391,7 +391,6 @@ class ProductFournisseur extends Product return -2; } } - else { dol_syslog(get_class($this) . '::update_buyprice without knowing id of line, so we delete from company, quantity and supplier_ref and insert again', LOG_DEBUG); @@ -434,6 +433,8 @@ class ProductFournisseur extends Product $sql .= (empty($fk_barcode_type) ? 'NULL' : "'" . $this->db->escape($fk_barcode_type) . "'"); $sql .= ")"; + $this->product_fourn_price_id = 0; + $resql = $this->db->query($sql); if ($resql) { $this->product_fourn_price_id = $this->db->last_insert_id(MAIN_DB_PREFIX . "product_fournisseur_price"); From 2c4fd099c8fefe0089c46bcf84c1608553f36601 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 14 Dec 2019 22:27:45 +0100 Subject: [PATCH 332/462] Update fournisseur.product.class.php --- htdocs/fourn/class/fournisseur.product.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index ac936f30334..4dbd2365c6f 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -445,6 +445,7 @@ class ProductFournisseur extends Product if (! $error && empty($conf->global->PRODUCT_PRICE_SUPPLIER_NO_LOG)) { // Add record into log table + // $this->product_fourn_price_id must be set $result = $this->logPrice($user, $now, $buyprice, $qty, $multicurrency_buyprice, $multicurrency_unitBuyPrice, $multicurrency_tx, $fk_multicurrenc, $multicurrency_code); if ($result < 0) { $error++; From 98bd4f3a667cbb1a23fbcf39467b88f95bfb9644 Mon Sep 17 00:00:00 2001 From: John Botella Date: Mon, 16 Dec 2019 09:44:08 +0100 Subject: [PATCH 333/462] Fix document module call --- htdocs/core/class/html.formfile.class.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 7b885d36a52..2508ebce5ca 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -675,7 +675,10 @@ class FormFile else { $tmp=explode(':', $modulepart); - if (! empty($tmp[2])) $submodulepart=$tmp[2]; + if (! empty($tmp[1])){ + $modulepart=$tmp[0]; + $submodulepart=$tmp[1]; + } $file=dol_buildpath('/'.$modulepart.'/core/modules/'.$modulepart.'/modules_'.$submodulepart.'.php', 0); $res=include_once $file; } From bb6523b75d02e59108f9a058690808fd91346cfd Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Tue, 17 Dec 2019 10:49:56 +0100 Subject: [PATCH 334/462] fix task document banner without thirdparty FATAL --- htdocs/projet/tasks/document.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/projet/tasks/document.php b/htdocs/projet/tasks/document.php index b8ff9a175ab..827ac810695 100644 --- a/htdocs/projet/tasks/document.php +++ b/htdocs/projet/tasks/document.php @@ -256,9 +256,11 @@ if ($object->id > 0) $morehtmlref.='
'; // Third party - $morehtmlref.=$langs->trans("ThirdParty").': '; - $morehtmlref.=$projectstatic->thirdparty->getNomUrl(1); - $morehtmlref.=''; + if ($projectstatic->thirdparty->id > 0) { + $morehtmlref .= $langs->trans("ThirdParty") . ': '; + $morehtmlref .= $projectstatic->thirdparty->getNomUrl(1); + $morehtmlref .= ''; + } } dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, $param); From a672673319dfc7216c8236f4569df1475dc41ba6 Mon Sep 17 00:00:00 2001 From: gauthier Date: Tue, 17 Dec 2019 11:24:48 +0100 Subject: [PATCH 335/462] FIX : units traductions for selectUnits() function --- htdocs/langs/en_US/products.lang | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index c7e98972fda..c906bcc1d66 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -188,13 +188,38 @@ unitSET=Set unitS=Second unitH=Hour unitD=Day -unitKG=Kilogram unitG=Gram unitM=Meter unitLM=Linear meter unitM2=Square meter unitM3=Cubic meter unitL=Liter +unitT=tonne +unitKG=kg +unitG=g +unitMG=mg +unitLB=pound +unitOZ=ounce +unitM=m +unitDM=dm +unitCM=cm +unitMM=mm +unitFT=ft +unitIN=in +unitM2=m² +unitDM2=dm² +unitCM2=cm² +unitMM2=mm² +unitFT2=ft² +unitIN2=in² +unitM3=m³ +unitDM3=dm³ +unitCM3=cm³ +unitMM3=mm³ +unitFT3=ft³ +unitIN3=in³ +unitOZ3=ounce +unitgallon=gallon ProductCodeModel=Product ref template ServiceCodeModel=Service ref template CurrentProductPrice=Current price @@ -341,4 +366,4 @@ ErrorCopyProductCombinations=There was an error while copying the product varian ErrorDestinationProductNotFound=Destination product not found ErrorProductCombinationNotFound=Product variant not found ActionAvailableOnVariantProductOnly=Action only available on the variant of product -ProductsPricePerCustomer=Product prices per customers \ No newline at end of file +ProductsPricePerCustomer=Product prices per customers From 03bb395ad84e8e1201a311d042bd1aa9b9642a99 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 17 Dec 2019 12:14:30 +0100 Subject: [PATCH 336/462] Update document.php --- htdocs/projet/tasks/document.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/projet/tasks/document.php b/htdocs/projet/tasks/document.php index 827ac810695..3fa4d5c6d7b 100644 --- a/htdocs/projet/tasks/document.php +++ b/htdocs/projet/tasks/document.php @@ -256,11 +256,11 @@ if ($object->id > 0) $morehtmlref.='
'; // Third party - if ($projectstatic->thirdparty->id > 0) { - $morehtmlref .= $langs->trans("ThirdParty") . ': '; - $morehtmlref .= $projectstatic->thirdparty->getNomUrl(1); - $morehtmlref .= ''; - } + $morehtmlref .= $langs->trans("ThirdParty") . ': '; + if (is_object($projectstatic->thirdparty) && $projectstatic->thirdparty->id > 0) { + $morehtmlref .= $projectstatic->thirdparty->getNomUrl(1); + } + $morehtmlref .= ''; } dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, $param); From 7b1bf32cd9087c7c40a10207eac40931e6ebae97 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 17 Dec 2019 12:19:32 +0100 Subject: [PATCH 337/462] Update products.lang --- htdocs/langs/en_US/products.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index c906bcc1d66..9595378b084 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -194,7 +194,7 @@ unitLM=Linear meter unitM2=Square meter unitM3=Cubic meter unitL=Liter -unitT=tonne +unitT=ton unitKG=kg unitG=g unitMG=mg From 95b56f05183027eaa3ae6136be5c28e803169800 Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Tue, 17 Dec 2019 12:19:35 +0100 Subject: [PATCH 338/462] Update 6.0.0-7.0.0.sql timestamp NOT NULL can cause SQL error. --- htdocs/install/mysql/migration/6.0.0-7.0.0.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql index d2879e5bb3c..ff6a1fe03fb 100644 --- a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql +++ b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql @@ -285,7 +285,7 @@ CREATE TABLE llx_website_account( date_last_login datetime, date_previous_login datetime, date_creation datetime NOT NULL, - tms timestamp NOT NULL, + tms timestamp, fk_user_creat integer NOT NULL, fk_user_modif integer, import_key varchar(14), From 3e19702e392ee26a6dfbf36e700fd474805f2736 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Tue, 17 Dec 2019 18:05:59 +0100 Subject: [PATCH 339/462] Fix prevent double action on shipment close --- htdocs/expedition/class/expedition.class.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index ea6e003d326..81c7cb55fc4 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -1902,6 +1902,12 @@ class Expedition extends CommonObject $error=0; + // Protection. This avoid to move stock later when we should not + if ($this->statut == self::STATUS_CLOSED) + { + return 0; + } + $this->db->begin(); $sql = 'UPDATE '.MAIN_DB_PREFIX.'expedition SET fk_statut='.self::STATUS_CLOSED; From 3fb72c349f47179d088d78201faac965e77da80a Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Wed, 18 Dec 2019 03:25:19 +0100 Subject: [PATCH 340/462] Fix language traduction on import/export tools --- htdocs/core/modules/modProduct.class.php | 8 ++++---- htdocs/core/modules/modSociete.class.php | 6 +++--- htdocs/core/modules/modUser.class.php | 6 +++--- htdocs/langs/en_US/companies.lang | 3 ++- htdocs/langs/en_US/products.lang | 5 ++++- 5 files changed, 16 insertions(+), 12 deletions(-) diff --git a/htdocs/core/modules/modProduct.class.php b/htdocs/core/modules/modProduct.class.php index e5c1e91b973..ff0a814f3ec 100644 --- a/htdocs/core/modules/modProduct.class.php +++ b/htdocs/core/modules/modProduct.class.php @@ -175,7 +175,7 @@ class modProduct extends DolibarrModules 'p.accountancy_code_sell'=>"ProductAccountancySellCode", 'p.accountancy_code_sell_intra'=>"ProductAccountancySellIntraCode", 'p.accountancy_code_sell_export'=>"ProductAccountancySellExportCode", 'p.accountancy_code_buy'=>"ProductAccountancyBuyCode", 'p.note'=>"NotePrivate",'p.note_public'=>'NotePublic', - 'p.weight'=>"Weight", 'p.weight_units'=>"WeightUnits", 'p.length'=>"Length", 'p.width'=>"Width", 'p.height'=>"Height", 'p.length_units'=>"SizeUnits", + 'p.weight'=>"Weight", 'p.weight_units'=>"WeightUnits", 'p.length'=>"Length", 'p.length_units'=>"LengthUnits", 'p.width'=>"Width", 'p.width_units'=>"WidthUnits", 'p.height'=>"Height", 'p.height_units'=>"HeightUnits", 'p.surface'=>"Surface", 'p.surface_units'=>"SurfaceUnits", 'p.volume'=>"Volume", 'p.volume_units'=>"VolumeUnits", 'p.duration'=>"Duration", 'p.finished' => 'Nature', @@ -382,13 +382,13 @@ class modProduct extends DolibarrModules 'p.weight' => "Weight", 'p.weight_units' => "WeightUnits", 'p.length' => "Length", - 'p.length_units' => "LengthUnit", + 'p.length_units' => "LengthUnits", 'p.width' => "Width", 'p.width_units' => "WidthUnits", 'p.height' => "Height", - 'p.height_units' => "HeightUnit", + 'p.height_units' => "HeightUnits", 'p.surface' => "Surface", - 'p.surface_units' => "SurfaceUnit", + 'p.surface_units' => "SurfaceUnits", 'p.volume' => "Volume", 'p.volume_units' => "VolumeUnits", 'p.duration' => "Duration",//duration of service diff --git a/htdocs/core/modules/modSociete.class.php b/htdocs/core/modules/modSociete.class.php index 8d6490becfe..23d92f53cb7 100644 --- a/htdocs/core/modules/modSociete.class.php +++ b/htdocs/core/modules/modSociete.class.php @@ -71,7 +71,7 @@ class modSociete extends DolibarrModules $this->requiredby = array("modExpedition","modFacture","modFournisseur","modFicheinter","modPropale","modContrat","modCommande"); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with $this->phpmin = array(5,4); // Minimum version of PHP required by module - $this->langfiles = array("companies",'bills'); + $this->langfiles = array("companies","bills","compta","admin","banks"); // Constants $this->const = array(); @@ -412,7 +412,7 @@ class modSociete extends DolibarrModules 's.address' => "Address", 's.zip' => "Zip", 's.town' => "Town", - 's.fk_departement' => "StateId", + 's.fk_departement' => "StateCode", 's.fk_pays' => "CountryCode", 's.phone' => "Phone", 's.fax' => "Fax", @@ -583,7 +583,7 @@ class modSociete extends DolibarrModules 's.address' => "Address", 's.zip' => "Zip", 's.town' => "Town", - 's.fk_departement' => "StateId", + 's.fk_departement' => "StateCode", 's.fk_pays' => "CountryCode", 's.birthday' => "BirthdayDate", 's.poste' => "Role", diff --git a/htdocs/core/modules/modUser.class.php b/htdocs/core/modules/modUser.class.php index 7e31400f1ab..a6daef60ebe 100644 --- a/htdocs/core/modules/modUser.class.php +++ b/htdocs/core/modules/modUser.class.php @@ -69,7 +69,7 @@ class modUser extends DolibarrModules $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with $this->phpmin = array(5,4); // Minimum version of PHP required by module - $this->langfiles = array("main","users","companies","members",'salaries'); + $this->langfiles = array("main","users","companies","members","salaries","hrm"); $this->always_enabled = true; // Can't be disabled // Constants @@ -225,7 +225,7 @@ class modUser extends DolibarrModules 'u.address'=>"Address",'u.zip'=>"Zip",'u.town'=>"Town", 'u.office_phone'=>'Phone','u.user_mobile'=>"Mobile",'u.office_fax'=>'Fax', 'u.email'=>"Email",'u.note'=>"Note",'u.signature'=>'Signature', - 'u.fk_user'=>'Supervisor','u.thm'=>'THM','u.tjm'=>'TJM','u.weeklyhours'=>'WeeklyHours', + 'u.fk_user'=>'HierarchicalResponsible','u.thm'=>'THM','u.tjm'=>'TJM','u.weeklyhours'=>'WeeklyHours', 'u.dateemployment'=>'DateEmployment','u.salary'=>'Salary','u.color'=>'Color','u.api_key'=>'ApiKey', 'u.birth'=>'BirthdayDate', 'u.datec'=>"DateCreation",'u.tms'=>"DateLastModification", @@ -281,7 +281,7 @@ class modUser extends DolibarrModules 'u.fk_state'=>"StateId",'u.fk_country'=>"CountryCode", 'u.office_phone'=>"Phone",'u.user_mobile'=>"Mobile",'u.office_fax'=>"Fax", 'u.email'=>"Email",'u.note'=>"Note",'u.signature'=>'Signature', - 'u.fk_user'=>'Supervisor','u.thm'=>'THM','u.tjm'=>'TJM','u.weeklyhours'=>'WeeklyHours', + 'u.fk_user'=>'HierarchicalResponsible','u.thm'=>'THM','u.tjm'=>'TJM','u.weeklyhours'=>'WeeklyHours', 'u.dateemployment'=>'DateEmployment','u.salary'=>'Salary','u.color'=>'Color','u.api_key'=>'ApiKey', 'u.birth'=>'BirthdayDate', 'u.datec'=>"DateCreation", diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index 532fbf14cb7..e6560673942 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -57,6 +57,7 @@ NatureOfThirdParty=Nature of Third party NatureOfContact=Nature of Contact Address=Address State=State/Province +StateCode=State/Province code StateShort=State Region=Region Region-State=Region - State @@ -438,4 +439,4 @@ PaymentTermsCustomer=Payment Terms - Customer PaymentTypeSupplier=Payment Type - Vendor PaymentTermsSupplier=Payment Term - Vendor MulticurrencyUsed=Use Multicurrency -MulticurrencyCurrency=Currency \ No newline at end of file +MulticurrencyCurrency=Currency diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index c7e98972fda..c11cf5f3037 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -287,6 +287,9 @@ ProductWeight=Weight for 1 product ProductVolume=Volume for 1 product WeightUnits=Weight unit VolumeUnits=Volume unit +WidthUnits=Width unit +LengthUnits=Length unit +HeightUnits=Height unit SurfaceUnits=Surface unit SizeUnits=Size unit DeleteProductBuyPrice=Delete buying price @@ -341,4 +344,4 @@ ErrorCopyProductCombinations=There was an error while copying the product varian ErrorDestinationProductNotFound=Destination product not found ErrorProductCombinationNotFound=Product variant not found ActionAvailableOnVariantProductOnly=Action only available on the variant of product -ProductsPricePerCustomer=Product prices per customers \ No newline at end of file +ProductsPricePerCustomer=Product prices per customers From 451b32674e2a0e1a516b2e251393ca7d0013cc5d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 18 Dec 2019 12:15:34 +0100 Subject: [PATCH 341/462] Removed duplicate record --- htdocs/install/mysql/data/llx_c_units.sql | 4 ---- 1 file changed, 4 deletions(-) diff --git a/htdocs/install/mysql/data/llx_c_units.sql b/htdocs/install/mysql/data/llx_c_units.sql index 30484471ca8..f055561f633 100644 --- a/htdocs/install/mysql/data/llx_c_units.sql +++ b/htdocs/install/mysql/data/llx_c_units.sql @@ -49,10 +49,6 @@ INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VAL INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VALUES ('L', '98','VolumeUnitlitre','L', 'volume', 1); INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VALUES ('GAL','99','VolumeUnitgallon','gal', 'volume', 1); -INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VALUES ('GAL','99','VolumeUnitgallon','gal', 'volume', 1); -INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VALUES ('GAL','99','VolumeUnitgallon','gal', 'volume', 1); -INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VALUES ('GAL','99','VolumeUnitgallon','gal', 'volume', 1); - INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VALUES ('P', '0','Piece','p', 'qty', 1); INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VALUES ('SET', '0','Set','set', 'qty', 1); From 6789b7bd1ef54e32142997b4bf16e0c75b121fbf Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Wed, 18 Dec 2019 18:23:31 +0100 Subject: [PATCH 342/462] Fix day scale unit --- htdocs/install/mysql/data/llx_c_units.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/data/llx_c_units.sql b/htdocs/install/mysql/data/llx_c_units.sql index f055561f633..905f3d344be 100644 --- a/htdocs/install/mysql/data/llx_c_units.sql +++ b/htdocs/install/mysql/data/llx_c_units.sql @@ -55,7 +55,7 @@ INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VAL INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VALUES ('S', '0','second','s', 'time', 1); INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VALUES ('MI', '60','minute','i', 'time', 1); INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VALUES ('H', '3600','hour','h', 'time', 1); -INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VALUES ('D','12960000','day','d', 'time', 1); +INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VALUES ('D', '86400','day','d', 'time', 1); INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VALUES ('W', '604800','week','w', 'time', 1); INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VALUES ('MO','2629800','month','m', 'time', 1); INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VALUES ('Y','31557600','year','y', 'time', 1); From 538921f47977c56cbf9aadbdb87bc60b705f6f5a Mon Sep 17 00:00:00 2001 From: Pierre Ardoin <32256817+mapiolca@users.noreply.github.com> Date: Thu, 19 Dec 2019 10:35:38 +0100 Subject: [PATCH 343/462] #FIX Error Margin with Situation Invoice Fix an issue that show a negative margin when $line->situation_percent is not 100% Now, the margin price take progress into account. --- htdocs/core/class/html.formmargin.class.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formmargin.class.php b/htdocs/core/class/html.formmargin.class.php index ea038fa8131..6b7ba7348ff 100644 --- a/htdocs/core/class/html.formmargin.class.php +++ b/htdocs/core/class/html.formmargin.class.php @@ -98,7 +98,11 @@ class FormMargin $pv = $line->total_ht; $pa_ht = ($pv < 0 ? - $line->pa_ht : $line->pa_ht); // We choosed to have line->pa_ht always positive in database, so we guess the correct sign - $pa = $line->qty * $pa_ht; + if ($object->type == Facture::TYPE_SITUATION) { + $pa = $line->qty * $pa_ht * ($line->situation_percent / 100); + } else { + $pa = $line->qty * $pa_ht; + } // calcul des marges if (isset($line->fk_remise_except) && isset($conf->global->MARGIN_METHODE_FOR_DISCOUNT)) { // remise From 063c139feefe0a7d6552a14c0649aa3c83aa5ca0 Mon Sep 17 00:00:00 2001 From: Pierre Ardoin <32256817+mapiolca@users.noreply.github.com> Date: Thu, 19 Dec 2019 11:52:30 +0100 Subject: [PATCH 344/462] Situation Invoice Compatibility take progress percent into account in buying price --- htdocs/margin/productMargins.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/margin/productMargins.php b/htdocs/margin/productMargins.php index 22dfd0146b1..8ec46c3e8ed 100644 --- a/htdocs/margin/productMargins.php +++ b/htdocs/margin/productMargins.php @@ -181,8 +181,8 @@ if ($id > 0) $sql.= " d.fk_product,"; if ($id > 0) $sql.= " f.rowid as facid, f.ref, f.total as total_ht, f.datef, f.paye, f.fk_statut as statut,"; $sql.= " SUM(d.total_ht) as selling_price,"; // Note: qty and buy_price_ht is always positive (if not your database may be corrupted, you can update this) -$sql.= " SUM(".$db->ifsql('d.total_ht < 0', 'd.qty * d.buy_price_ht * -1', 'd.qty * d.buy_price_ht').") as buying_price,"; -$sql.= " SUM(".$db->ifsql('d.total_ht < 0', '-1 * (abs(d.total_ht) - (d.buy_price_ht * d.qty))', 'd.total_ht - (d.buy_price_ht * d.qty)').") as marge"; +$sql.= " SUM(".$db->ifsql('d.total_ht < 0', 'd.qty * d.buy_price_ht * -1 * (d.situation_percent / 100)', 'd.qty * d.buy_price_ht * (d.situation_percent / 100)').") as buying_price,"; +$sql.= " SUM(".$db->ifsql('d.total_ht < 0', '-1 * (abs(d.total_ht) - (d.buy_price_ht * d.qty * (d.situation_percent / 100)))', 'd.total_ht - (d.buy_price_ht * d.qty * (d.situation_percent / 100))').") as marge"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."facture as f"; $sql.= ", ".MAIN_DB_PREFIX."facturedet as d"; From 14cf295f22b10269cbb5a111c32f0f8ccb7c4714 Mon Sep 17 00:00:00 2001 From: Pierre Ardoin <32256817+mapiolca@users.noreply.github.com> Date: Thu, 19 Dec 2019 11:58:25 +0100 Subject: [PATCH 345/462] Update to integer situation invoice Before : Situation invoice with situation_percent < 100 => Negative and Bad margin (not proportional) Now : Situation invoice with situation_percent < 100 => Correct and proportional. --- htdocs/margin/tabs/productMargins.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/margin/tabs/productMargins.php b/htdocs/margin/tabs/productMargins.php index afb1dda37a9..9b62c1b1bca 100644 --- a/htdocs/margin/tabs/productMargins.php +++ b/htdocs/margin/tabs/productMargins.php @@ -137,8 +137,8 @@ if ($id > 0 || ! empty($ref)) if (!$user->rights->societe->client->voir && !$socid) $sql.= " sc.fk_soc, sc.fk_user,"; $sql.= " sum(d.total_ht) as selling_price,"; // may be negative or positive $sql.= " ".$db->ifsql('f.type = 2', -1, 1)." * sum(d.qty) as qty,"; // not always positive in case of Credit note - $sql.= " ".$db->ifsql('f.type = 2', -1, 1)." * sum(d.qty * d.buy_price_ht) as buying_price,"; // not always positive in case of Credit note - $sql.= " ".$db->ifsql('f.type = 2', -1, 1)." * sum(abs(d.total_ht) - (d.buy_price_ht * d.qty)) as marge" ; // not always positive in case of Credit note + $sql.= " ".$db->ifsql('f.type = 2', -1, 1)." * sum(d.qty * d.buy_price_ht * (d.situation_percent / 100)) as buying_price,"; // not always positive in case of Credit note + $sql.= " ".$db->ifsql('f.type = 2', -1, 1)." * sum(abs(d.total_ht) - (d.buy_price_ht * d.qty * (d.situation_percent / 100))) as marge" ; // not always positive in case of Credit note $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."facture as f"; $sql.= ", ".MAIN_DB_PREFIX."facturedet as d"; From 347eae05acf9b5cc613bb6c946648ddabde28053 Mon Sep 17 00:00:00 2001 From: Pierre Ardoin <32256817+mapiolca@users.noreply.github.com> Date: Thu, 19 Dec 2019 12:03:09 +0100 Subject: [PATCH 346/462] Update to integer situation invoice Before : Situation invoice with situation_percent < 100 => Negative and Bad margin (not proportional) Now : Situation invoice with situation_percent < 100 => Correct and proportional. --- htdocs/margin/customerMargins.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/margin/customerMargins.php b/htdocs/margin/customerMargins.php index 78d105ad5cb..36e033a5e50 100644 --- a/htdocs/margin/customerMargins.php +++ b/htdocs/margin/customerMargins.php @@ -205,8 +205,8 @@ $sql.= " s.rowid as socid, s.nom as name, s.code_client, s.client,"; if ($client) $sql.= " f.rowid as facid, f.ref, f.total as total_ht, f.datef, f.paye, f.fk_statut as statut,"; $sql.= " sum(d.total_ht) as selling_price,"; // Note: qty and buy_price_ht is always positive (if not, your database may be corrupted, you can update this) -$sql.= " sum(".$db->ifsql('d.total_ht < 0', 'd.qty * d.buy_price_ht * -1', 'd.qty * d.buy_price_ht').") as buying_price,"; -$sql.= " sum(".$db->ifsql('d.total_ht < 0', '-1 * (abs(d.total_ht) - (d.buy_price_ht * d.qty))', 'd.total_ht - (d.buy_price_ht * d.qty)').") as marge"; +$sql.= " sum(".$db->ifsql('d.total_ht < 0', 'd.qty * d.buy_price_ht * -1 * (d.situation_percent / 100)', 'd.qty * d.buy_price_ht * (d.situation_percent / 100)').") as buying_price,"; +$sql.= " sum(".$db->ifsql('d.total_ht < 0', '-1 * (abs(d.total_ht) - (d.buy_price_ht * d.qty * (d.situation_percent / 100)))', 'd.total_ht - (d.buy_price_ht * d.qty * (d.situation_percent / 100))').") as marge"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."facture as f"; $sql.= ", ".MAIN_DB_PREFIX."facturedet as d"; From a82f996fcf63d35cb3eb455635cd728f802f3eba Mon Sep 17 00:00:00 2001 From: Pierre Ardoin <32256817+mapiolca@users.noreply.github.com> Date: Thu, 19 Dec 2019 12:04:48 +0100 Subject: [PATCH 347/462] Update to integer situation invoice Before : Situation invoice with situation_percent < 100 => Negative and Bad margin (not proportional) Now : Situation invoice with situation_percent < 100 => Correct and proportional. --- htdocs/margin/tabs/thirdpartyMargins.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/margin/tabs/thirdpartyMargins.php b/htdocs/margin/tabs/thirdpartyMargins.php index 1d0897a72b0..337190b6c15 100644 --- a/htdocs/margin/tabs/thirdpartyMargins.php +++ b/htdocs/margin/tabs/thirdpartyMargins.php @@ -147,8 +147,8 @@ if ($socid > 0) $sql.= " f.rowid as facid, f.ref, f.total as total_ht,"; $sql.= " f.datef, f.paye, f.fk_statut as statut, f.type,"; $sql.= " sum(d.total_ht) as selling_price,"; // may be negative or positive - $sql.= " sum(d.qty * d.buy_price_ht) as buying_price,"; // always positive - $sql.= " sum(abs(d.total_ht) - (d.buy_price_ht * d.qty)) as marge"; // always positive + $sql.= " sum(d.qty * d.buy_price_ht * (d.situation_percent / 100)) as buying_price,"; // always positive + $sql.= " sum(abs(d.total_ht) - (d.buy_price_ht * d.qty * (d.situation_percent / 100))) as marge"; // always positive $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."facture as f"; $sql.= ", ".MAIN_DB_PREFIX."facturedet as d"; From 91e2fe9a9997f52d901a6cd964d97ac7b48705e9 Mon Sep 17 00:00:00 2001 From: Pierre Ardoin <32256817+mapiolca@users.noreply.github.com> Date: Thu, 19 Dec 2019 12:06:18 +0100 Subject: [PATCH 348/462] Update to integer situation invoice Before : Situation invoice with situation_percent < 100 => Negative and Bad margin (not proportional) Now : Situation invoice with situation_percent < 100 => Correct and proportional. --- htdocs/margin/agentMargins.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/margin/agentMargins.php b/htdocs/margin/agentMargins.php index b4e323a54c0..96787b1231b 100644 --- a/htdocs/margin/agentMargins.php +++ b/htdocs/margin/agentMargins.php @@ -139,8 +139,8 @@ $sql.= " s.rowid as socid, s.nom as name, s.code_client, s.client,"; $sql.= " u.rowid as agent, u.login, u.lastname, u.firstname,"; $sql.= " sum(d.total_ht) as selling_price,"; // Note: qty and buy_price_ht is always positive (if not your database may be corrupted, you can update this) -$sql.= " sum(".$db->ifsql('d.total_ht < 0', 'd.qty * d.buy_price_ht * -1', 'd.qty * d.buy_price_ht').") as buying_price,"; -$sql.= " sum(".$db->ifsql('d.total_ht < 0', '-1 * (abs(d.total_ht) - (d.buy_price_ht * d.qty))', 'd.total_ht - (d.buy_price_ht * d.qty)').") as marge" ; +$sql.= " sum(".$db->ifsql('d.total_ht < 0', 'd.qty * d.buy_price_ht * -1 * (d.situation_percent / 100)', 'd.qty * d.buy_price_ht * (d.situation_percent / 100)').") as buying_price,"; +$sql.= " sum(".$db->ifsql('d.total_ht < 0', '-1 * (abs(d.total_ht) - (d.buy_price_ht * d.qty * (d.situation_percent / 100)))', 'd.total_ht - (d.buy_price_ht * d.qty * (d.situation_percent / 100))').") as marge" ; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."facture as f"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."element_contact e ON e.element_id = f.rowid and e.statut = 4 and e.fk_c_type_contact = ".(empty($conf->global->AGENT_CONTACT_TYPE)?-1:$conf->global->AGENT_CONTACT_TYPE); From 8321fe6ad2b36623600b00f877111be92f8c0661 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 22 Dec 2019 09:13:34 +0100 Subject: [PATCH 349/462] FIX missing nl2br conversion --- htdocs/core/class/CMailFile.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 9b1a5a69525..4d796bbcd07 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -444,7 +444,7 @@ class CMailFile } else { $this->message->setBody($msg, 'text/plain'); // And optionally an alternative body - $this->message->addPart($msg, 'text/html'); + $this->message->addPart(dol_nl2br($msg), 'text/html'); } if ($this->atleastonefile) From c39e45b81a23eb12359c009b628bccc5b3fe5e6e Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Mon, 23 Dec 2019 10:57:51 +0100 Subject: [PATCH 350/462] FIX set due date in object in create invoice --- htdocs/compta/facture/class/facture.class.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 4204fa0c96b..3bbf150d72f 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -445,7 +445,16 @@ class Facture extends CommonInvoice } // Define due date if not already defined - $datelim=(empty($forceduedate)?$this->calculate_date_lim_reglement():$forceduedate); + if (empty($forceduedate)) { + $duedate = $this->calculate_date_lim_reglement(); + /*if ($duedate < 0) { Regression, a date can be negative if before 1970. + dol_syslog(__METHOD__ . ' Error in calculate_date_lim_reglement. We got ' . $duedate, LOG_ERR); + return -1; + }*/ + $this->date_lim_reglement = $duedate; + } else { + $this->date_lim_reglement = $forceduedate; + } // Insert into database $socid = $this->socid; @@ -497,7 +506,7 @@ class Facture extends CommonInvoice $sql.= ", ".($this->fk_project?$this->fk_project:"null"); $sql.= ", ".$this->cond_reglement_id; $sql.= ", ".$this->mode_reglement_id; - $sql.= ", '".$this->db->idate($datelim)."', '".$this->db->escape($this->modelpdf)."'"; + $sql.= ", '".$this->db->idate($this->date_lim_reglement)."', '".$this->db->escape($this->modelpdf)."'"; $sql.= ", ".($this->situation_cycle_ref?"'".$this->db->escape($this->situation_cycle_ref)."'":"null"); $sql.= ", ".($this->situation_counter?"'".$this->db->escape($this->situation_counter)."'":"null"); $sql.= ", ".($this->situation_final?$this->situation_final:0); @@ -1652,7 +1661,7 @@ class Facture extends CommonInvoice $sql.= " datef=".(strval($this->date)!='' ? "'".$this->db->idate($this->date)."'" : 'null').","; $sql.= " date_pointoftax=".(strval($this->date_pointoftax)!='' ? "'".$this->db->idate($this->date_pointoftax)."'" : 'null').","; $sql.= " date_valid=".(strval($this->date_validation)!='' ? "'".$this->db->idate($this->date_validation)."'" : 'null').","; - $sql.= " paye=".(isset($this->paye)?$this->db->escape($this->paye):"null").","; + $sql.= " paye=".(isset($this->paye)?$this->db->escape($this->paye):0).","; $sql.= " remise_percent=".(isset($this->remise_percent)?$this->db->escape($this->remise_percent):"null").","; $sql.= " remise_absolue=".(isset($this->remise_absolue)?$this->db->escape($this->remise_absolue):"null").","; $sql.= " close_code=".(isset($this->close_code)?"'".$this->db->escape($this->close_code)."'":"null").","; From 558d57730997ce7df837a2fd2423ca6a64708c29 Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Mon, 23 Dec 2019 11:53:19 +0100 Subject: [PATCH 351/462] FIX add and modify category translate form with posted values on errors --- htdocs/categories/traduction.php | 126 +++++++++++++++++++------------ 1 file changed, 79 insertions(+), 47 deletions(-) diff --git a/htdocs/categories/traduction.php b/htdocs/categories/traduction.php index 7e14aaff68e..202d128182f 100644 --- a/htdocs/categories/traduction.php +++ b/htdocs/categories/traduction.php @@ -62,6 +62,7 @@ $object = new Categorie($db); /* * Actions */ +$error = 0; // retour a l'affichage des traduction si annulation if ($cancel == $langs->trans("Cancel")) @@ -78,28 +79,44 @@ $cancel != $langs->trans("Cancel") && $object->fetch($id); $current_lang = $langs->getDefaultLang(); - // update de l'objet - if ( $_POST["forcelangprod"] == $current_lang ) - { - $object->label = $_POST["libelle"]; - $object->description = dol_htmlcleanlastbr($_POST["desc"]); - } - else - { - $object->multilangs[$_POST["forcelangprod"]]["label"] = $_POST["libelle"]; - $object->multilangs[$_POST["forcelangprod"]]["description"] = dol_htmlcleanlastbr($_POST["desc"]); - } + // check parameters + $forcelangprod = GETPOST('forcelangprod', 'alpha'); + $libelle = GETPOST('libelle', 'alpha'); + $desc = GETPOST('desc', 'none'); - // sauvegarde en base - if ( $object->setMultiLangs($user) > 0 ) - { - $action = ''; - } - else - { - $action = 'add'; - setEventMessages($object->error, $object->errors, 'errors'); - } + if (empty($forcelangprod)) { + $error++; + $object->errors[] = $langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Translation')); + } + + if (!$error) { + if (empty($libelle)) { + $error++; + $object->errors[] = $langs->trans('Language_' . $forcelangprod) . ' : ' . $langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Label')); + } + + if (!$error) { + // update de l'objet + if ($forcelangprod == $current_lang) { + $object->label = $libelle; + $object->description = dol_htmlcleanlastbr($desc); + } else { + $object->multilangs[$forcelangprod]["label"] = $libelle; + $object->multilangs[$forcelangprod]["description"] = dol_htmlcleanlastbr($desc); + } + + // sauvegarde en base + $res = $object->setMultiLangs($user); + if ($res < 0) $error++; + } + } + + if ($error) { + $action = 'add'; + setEventMessages($object->error, $object->errors, 'errors'); + } else { + $action = ''; + } } // Validation de l'edition @@ -112,27 +129,34 @@ $cancel != $langs->trans("Cancel") && foreach ($object->multilangs as $key => $value) // enregistrement des nouvelles valeurs dans l'objet { - if ( $key == $current_lang ) - { - $object->label = $_POST["libelle-".$key]; - $object->description = dol_htmlcleanlastbr($_POST["desc-".$key]); - } - else - { - $object->multilangs[$key]["label"] = $_POST["libelle-".$key]; - $object->multilangs[$key]["description"] = dol_htmlcleanlastbr($_POST["desc-".$key]); + $libelle = GETPOST('libelle-'. $key, 'alpha'); + $desc = GETPOST('desc-' . $key); + + if (empty($libelle)) { + $error++; + $object->errors[] = $langs->trans('Language_' . $key) . ' : ' . $langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Label')); + } + + if ( $key == $current_lang ) { + $object->label = $libelle; + $object->description = dol_htmlcleanlastbr($desc); + } else { + $object->multilangs[$key]["label"] = $libelle; + $object->multilangs[$key]["description"] = dol_htmlcleanlastbr($desc); } } - if ( $object->setMultiLangs($user) > 0 ) - { - $action = ''; - } - else - { - $action = 'edit'; - setEventMessages($object->error, $object->errors, 'errors'); - } + if (!$error) { + $res = $object->setMultiLangs($user); + if ($res < 0) $error++; + } + + if ($error) { + $action = 'edit'; + setEventMessages($object->error, $object->errors, 'errors'); + } else { + $action = ''; + } } $result = $object->fetch($id, $ref); @@ -224,8 +248,8 @@ if ($action == '') { if ($user->rights->produit->creer || $user->rights->service->creer) { - print ''.$langs->trans("Add").''; - if ($cnt_trans > 0) print ''.$langs->trans("Update").''; + print ''.$langs->trans('Add').''; + if ($cnt_trans > 0) print ''.$langs->trans('Update').''; } } @@ -242,6 +266,7 @@ if ($action == 'edit') print ''; print ''; print ''; + print ''; if (! empty($object->multilangs)) { @@ -249,9 +274,14 @@ if ($action == 'edit') { print "
".$langs->trans('Language_'.$key)." :
"; print ''; - print ''; + + // Label + $libelle = (GETPOST('libelle-'.$key, 'alpha') ? GETPOST('libelle-'.$key, 'alpha') : $object->multilangs[$key]['label']); + print ''; + // Desc + $desc = (GETPOST('desc-'.$key) ? GETPOST('desc-'.$key) : $object->multilangs[$key]['description']); print ''; @@ -280,7 +310,7 @@ elseif ($action != 'add') { $s=picto_from_langcode($key); print '
'.$langs->trans('Label').'
'.$langs->trans('Label').'
'.$langs->trans('Description').''; - $doleditor = new DolEditor("desc-$key", $object->multilangs[$key]["description"], '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_3, '90%'); + $doleditor = new DolEditor("desc-$key", $desc, '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_3, '90%'); $doleditor->Create(); print '
'; - print ''; + print ''; print ''; print ''; if (! empty($conf->global->CATEGORY_USE_OTHER_FIELD_IN_TRANSLATION)) @@ -308,14 +338,16 @@ if ($action == 'add' && ($user->rights->produit->creer || $user->rights->service print ''; print ''; print ''; + print ''; print '
'.($s?$s.' ':'')." ".$langs->trans('Language_'.$key).": ".''.img_delete('', '').'
'.($s?$s.' ':'')." ".$langs->trans('Language_'.$key).": ".''.img_delete('', '').'
'.$langs->trans('Label').''.$object->multilangs[$key]["label"].'
'.$langs->trans('Description').''.$object->multilangs[$key]["description"].'
'; print ''; - print ''; + print ''; + print ''; print ''; From e59514600b6c9e8ada4e89a0a558b5a605c31ffc Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Mon, 23 Dec 2019 12:10:51 +0100 Subject: [PATCH 352/462] FIX contact card state address selected after filling address --- htdocs/contact/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index 909dfd9e2e2..f013cd7e8aa 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -967,7 +967,7 @@ else print ''; } From 4d12ecb072e20db60817547455aa7d9d53d8c484 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 23 Dec 2019 13:40:35 +0100 Subject: [PATCH 353/462] FIX #12745 --- .../fourn/class/fournisseur.product.class.php | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index 4dbd2365c6f..9f49fb31b83 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -434,7 +434,7 @@ class ProductFournisseur extends Product $sql .= ")"; $this->product_fourn_price_id = 0; - + $resql = $this->db->query($sql); if ($resql) { $this->product_fourn_price_id = $this->db->last_insert_id(MAIN_DB_PREFIX . "product_fournisseur_price"); @@ -939,8 +939,6 @@ class ProductFournisseur extends Product */ public function listProductFournisseurPriceLog($product_fourn_price_id, $sortfield = '', $sortorder = '', $limit = 0, $offset = 0) { - global $conf; - $sql = "SELECT"; $sql.= " pfpl.rowid, pfp.ref_fourn as supplier_ref, pfpl.datec, u.lastname,"; $sql.= " pfpl.price, pfpl.quantity"; @@ -961,9 +959,17 @@ class ProductFournisseur extends Product { $retarray = array(); - while ($record = $this->db->fetch_array($resql)) + while ($obj = $this->db->fetch_object($resql)) { - $retarray[]=$record; + $tmparray = array(); + $tmparray['rowid'] = $obj->rowid; + $tmparray['supplier_ref'] = $obj->supplier_ref; + $tmparray['datec'] = $this->db->jdate($obj->datec); + $tmparray['lastname'] = $obj->lastname; + $tmparray['price'] = $obj->price; + $tmparray['quantity'] = $obj->quantity; + + $retarray[]=$tmparray; } $this->db->free($resql); @@ -991,7 +997,7 @@ class ProductFournisseur extends Product $langs->load("suppliers"); if (count($productFournLogList) > 0) { $out .= '
'.$langs->trans('Translation').''; - print $formadmin->select_language('', 'forcelangprod', 0, $object->multilangs); + print $formadmin->select_language(GETPOST('forcelangprod', 'alpha'), 'forcelangprod', 0, $object->multilangs); print '
'.$langs->trans('Label').'
' . $langs->trans('Label') . '
'.$langs->trans('Description').''; - $doleditor = new DolEditor('desc', '', '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_3, '90%'); + $doleditor = new DolEditor('desc', GETPOST('desc', 'none'), '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_3, '90%'); $doleditor->Create(); print '
'; } - print $formcompany->select_state($object->state_id, isset($_POST["country_id"])?GETPOST("country_id"):$object->country_id, 'state_id'); + print $formcompany->select_state(GETPOSTISSET('state_id')?GETPOST('state_id', 'alpha'):$object->state_id, $object->country_code, 'state_id'); print '
'; - $out .= ''; + $out .= ''; $out .= ''; //$out .= ''; $out .= ''; @@ -1032,7 +1038,7 @@ class ProductFournisseur extends Product $logPrices = $this->listProductFournisseurPriceLog($this->product_fourn_price_id, 'pfpl.datec', 'DESC'); // set sort order here if (is_array($logPrices) && count($logPrices) > 0) { - $label.= '
'; + $label.= '

'; $label.= '' . $langs->trans("History") . ''; $label.= $this->displayPriceProductFournisseurLog($logPrices); } From e7a5d263555b77a720b3eeb304df7e98ddb6dfce Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Mon, 23 Dec 2019 14:25:54 +0100 Subject: [PATCH 354/462] FIX remove backward compatibility projectid and uses object id instead --- htdocs/projet/element.php | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 97e99c93370..fe8a27ec6f8 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -83,17 +83,16 @@ if (! isset($_POST['datesrfc']) && ! isset($_POST['datesday']) && ! empty($conf- //$dates=dol_time_plus_duree($datee, -1, 'y'); $dates=dol_get_first_day($tmp['year'], 1); } -if ($id == '' && $projectid == '' && $ref == '') +if ($id == '' && $ref == '') { - dol_print_error('', 'Bad parameter'); - exit; + setEventMessage($langs->trans('ErrorBadParameters'), 'errors'); + header('Location: list.php'); + exit(); } $mine = $_REQUEST['mode']=='mine' ? 1 : 0; //if (! $user->rights->projet->all->lire) $mine=1; // Special for projects -$projectid=$id; // For backward compatibility - $object = new Project($db); include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once @@ -102,7 +101,7 @@ if(! empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($ob // Security check $socid=$object->socid; //if ($user->societe_id > 0) $socid = $user->societe_id; // For external user, no check is done on company because readability is managed by public status of project and assignement. -$result = restrictedArea($user, 'projet', $projectid, 'projet&project'); +$result = restrictedArea($user, 'projet', $object->id, 'projet&project'); $hookmanager->initHooks(array('projectOverview')); @@ -513,7 +512,7 @@ elseif ($action == "unlink") { $tablename = GETPOST("tablename", "aZ09"); - $projectField = GETPOST("projectfield", "aZ09"); + $projectField = GETPOST('projectfield', 'aZ09') ? GETPOST('projectfield', 'aZ09') : 'fk_projet'; $elementselectid = GETPOST("elementselect", "int"); $result = $object->remove_element($tablename, $elementselectid, $projectField); @@ -532,7 +531,7 @@ $showdatefilter=0; if (! $showdatefilter) { print '
'; - print '
'; + print ''; print ''; print ''; print ''; @@ -755,7 +754,7 @@ foreach ($listofreferent as $key => $value) if (empty($conf->global->PROJECT_LINK_ON_OVERWIEW_DISABLED) && $idtofilterthirdparty && !in_array($tablename, $exclude_select_element)) { $selectList=$formproject->select_element($tablename, $idtofilterthirdparty, 'minwidth300', -2, !empty($project_field)?$project_field:'fk_projet'); - if (! $selectList || ($selectList<0)) + if ($selectList<0) { setEventMessages($formproject->error, $formproject->errors, 'errors'); } @@ -763,7 +762,7 @@ foreach ($listofreferent as $key => $value) { // Define form with the combo list of elements to link $addform.='
'; - $addform.=''; + $addform.=''; $addform.=''; $addform.=''; $addform.=''; @@ -890,7 +889,7 @@ foreach ($listofreferent as $key => $value) { if (empty($conf->global->PROJECT_DISABLE_UNLINK_FROM_OVERVIEW) || $user->admin) // PROJECT_DISABLE_UNLINK_FROM_OVERVIEW is empty by defaut, so this test true { - print ''; + print ''; print img_picto($langs->trans('Unlink'), 'unlink'); print ''; } From e03222b83109f2f56daf7b98398138c4900261d9 Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Mon, 23 Dec 2019 14:38:01 +0100 Subject: [PATCH 355/462] FIX var transkey not defined in input hidden --- htdocs/admin/dict.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index e92cc80a08e..747a621e860 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -1985,9 +1985,9 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') if (in_array($fieldlist[$field], array('libelle', 'label', 'tracking'))) $class='quatrevingtpercent'; print '
'; } @@ -313,14 +315,14 @@ if ($action == 'create') { print ''; } // Type payment print ''; // Number From c8dfc3d9fc85515de1b40105f0fef6180a97681c Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio Date: Tue, 24 Dec 2019 16:09:29 +0100 Subject: [PATCH 364/462] FIX: error 500 when getting margin info for objects other than invoices --- htdocs/core/class/html.formmargin.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formmargin.class.php b/htdocs/core/class/html.formmargin.class.php index 6b7ba7348ff..8485afecec9 100644 --- a/htdocs/core/class/html.formmargin.class.php +++ b/htdocs/core/class/html.formmargin.class.php @@ -98,7 +98,7 @@ class FormMargin $pv = $line->total_ht; $pa_ht = ($pv < 0 ? - $line->pa_ht : $line->pa_ht); // We choosed to have line->pa_ht always positive in database, so we guess the correct sign - if ($object->type == Facture::TYPE_SITUATION) { + if ($object->element == 'facture' && $object->type == Facture::TYPE_SITUATION) { $pa = $line->qty * $pa_ht * ($line->situation_percent / 100); } else { $pa = $line->qty * $pa_ht; From 9a7307eea8f7d6899c6bc854faafcc0dec6c3beb Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Thu, 26 Dec 2019 12:01:09 +0100 Subject: [PATCH 365/462] FIX Missing language key for MAIN_MAXTABS_IN_CARD --- htdocs/langs/en_US/main.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 54eeac4085e..a9c79e747a3 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -982,3 +982,4 @@ PaymentInformation=Payment information ValidFrom=Valid from ValidUntil=Valid until NoRecordedUsers=No users +More=More From a804208b32b0e76d3374018f9a3aae222ffd656a Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Fri, 27 Dec 2019 20:54:47 +0100 Subject: [PATCH 366/462] Fix missing language key --- htdocs/langs/en_US/boxes.lang | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/boxes.lang b/htdocs/langs/en_US/boxes.lang index b1ab8e41fbc..1e2252d54b2 100644 --- a/htdocs/langs/en_US/boxes.lang +++ b/htdocs/langs/en_US/boxes.lang @@ -84,4 +84,5 @@ ForProposals=Proposals LastXMonthRolling=The latest %s month rolling ChooseBoxToAdd=Add widget to your dashboard BoxAdded=Widget was added in your dashboard -BoxTitleUserBirthdaysOfMonth=Birthdays of this month \ No newline at end of file +BoxTitleUserBirthdaysOfMonth=Birthdays of this month +BoxBirthdays=Birthdays of this month From c9cc6cbbeab0d449e22f183e3a8f1ec030b7dd13 Mon Sep 17 00:00:00 2001 From: TuxGasy Date: Sun, 29 Dec 2019 23:15:49 +0100 Subject: [PATCH 367/462] Fix decimal value on update object --- htdocs/core/actions_addupdatedelete.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index 1d5dd28b21a..068a487c448 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -113,8 +113,8 @@ if ($action == 'update' && ! empty($permissiontoadd)) $value = dol_mktime(12, 0, 0, GETPOST($key.'month'), GETPOST($key.'day'), GETPOST($key.'year')); } elseif ($object->fields[$key]['type']=='datetime') { $value = dol_mktime(GETPOST($key.'hour'), GETPOST($key.'min'), 0, GETPOST($key.'month'), GETPOST($key.'day'), GETPOST($key.'year')); - } elseif ($object->fields[$key]['type']=='price') { - $value = price2num(GETPOST($key)); + } elseif (preg_match('/^(integer|price|real|double)/', $object->fields[$key]['type'])) { + $value = price2num(GETPOST($key, 'none')); // To fix decimal separator according to lang setup } else { $value = GETPOST($key, 'alpha'); } From 71a29981187851cbc484db35f91554e8df1a2b51 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 30 Dec 2019 15:36:09 +0100 Subject: [PATCH 368/462] FIX wrong var name and avoid warning --- htdocs/product/admin/product_tools.php | 2 +- htdocs/product/class/product.class.php | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/product/admin/product_tools.php b/htdocs/product/admin/product_tools.php index cfbedbcb7f1..d68b395d5ad 100644 --- a/htdocs/product/admin/product_tools.php +++ b/htdocs/product/admin/product_tools.php @@ -135,7 +135,7 @@ if ($action == 'convert') $newlevel=$level; //print "$objectstatic->id $newprice, $price_base_type, $newvat, $newminprice, $newlevel, $newnpr
\n"; - $retm=$objectstatic->updatePrice($newprice, $price_base_type, $user, $newvatratclean, $newminprice, $newlevel, $newnpr, 0, 0, $localtaxes_type, $newdefaultvatcode); + $retm=$objectstatic->updatePrice($newprice, $price_base_type, $user, $newvatrateclean, $newminprice, $newlevel, $newnpr, 0, 0, $localtaxes_type, $newdefaultvatcode); if ($retm < 0) { $error++; diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index d00cba86e6a..e59b52be803 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -1859,6 +1859,9 @@ class Product extends CommonObject if (empty($newnpr)) { $newnpr=0; } + if (empty($newminprice)) { + $newminprice=0; + } // Check parameters if ($newvat == '') { From 5cc0d26eae777a1e51ceb714021a60ec79e0fd4b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 31 Dec 2019 17:26:02 +0100 Subject: [PATCH 369/462] Revert "FIX class Facture undefined in displaying margin information" --- htdocs/core/class/html.formmargin.class.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/htdocs/core/class/html.formmargin.class.php b/htdocs/core/class/html.formmargin.class.php index 64048c5cfdc..8485afecec9 100644 --- a/htdocs/core/class/html.formmargin.class.php +++ b/htdocs/core/class/html.formmargin.class.php @@ -63,8 +63,6 @@ class FormMargin { global $conf, $db; - require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; - // Default returned array $marginInfos = array( 'pa_products' => 0, From 08d0d63a0461592238f7bbf15ab2f1c862ca2593 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 31 Dec 2019 17:30:27 +0100 Subject: [PATCH 370/462] FIX #12760 #12763 #12755 #12765 #12751 --- htdocs/core/class/html.formmargin.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.formmargin.class.php b/htdocs/core/class/html.formmargin.class.php index 64048c5cfdc..7c169916b60 100644 --- a/htdocs/core/class/html.formmargin.class.php +++ b/htdocs/core/class/html.formmargin.class.php @@ -1,5 +1,5 @@ +/* Copyright (c) 2015-2019 Laurent Destailleur * * 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 @@ -100,7 +100,7 @@ class FormMargin $pv = $line->total_ht; $pa_ht = ($pv < 0 ? - $line->pa_ht : $line->pa_ht); // We choosed to have line->pa_ht always positive in database, so we guess the correct sign - if ($object->element == 'facture' && $object->type == Facture::TYPE_SITUATION) { + if ($object->element == 'facture' && $object->type == $object::TYPE_SITUATION) { $pa = $line->qty * $pa_ht * ($line->situation_percent / 100); } else { $pa = $line->qty * $pa_ht; From d2efe1d4272289af6e73d38974035b57370e61cf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 31 Dec 2019 17:52:28 +0100 Subject: [PATCH 371/462] Fix SQL injection on type parameter in list of events --- htdocs/comm/action/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index dc00a4dd091..5233c58f079 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -301,7 +301,7 @@ if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND (a.fk_soc I if ($socid > 0) $sql.= " AND s.rowid = ".$socid; // We must filter on assignement table if ($filtert > 0 || $usergroup > 0) $sql.= " AND ar.fk_actioncomm = a.id AND ar.element_type='user'"; -if ($type) $sql.= " AND c.id = ".$type; +if ($type) $sql.= " AND c.id = ".(int) $type; if ($status == '0') { $sql.= " AND a.percent = 0"; } if ($status == '-1') { $sql.= " AND a.percent = -1"; } // Not applicable if ($status == '50') { $sql.= " AND (a.percent > 0 AND a.percent < 100)"; } // Running already started From 67316c912542d77dba736938cf7f514d4b316de0 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Fri, 3 Jan 2020 14:38:25 +0100 Subject: [PATCH 372/462] FIX Loan card - Wrong language key used --- htdocs/loan/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/loan/card.php b/htdocs/loan/card.php index 73d7a7eeaf0..0c5eda1d972 100644 --- a/htdocs/loan/card.php +++ b/htdocs/loan/card.php @@ -624,7 +624,7 @@ if ($id > 0) else { print '
'; // More informations print ''; From 041d5aeb463b9638a11ec3b0f477c104aa6b43cb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 19 Jan 2020 18:55:22 +0100 Subject: [PATCH 397/462] FIX XSS vulnerability in description of list of audit events. --- htdocs/admin/tools/listevents.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/tools/listevents.php b/htdocs/admin/tools/listevents.php index 29f3f8fc7fb..39699d4240b 100644 --- a/htdocs/admin/tools/listevents.php +++ b/htdocs/admin/tools/listevents.php @@ -310,7 +310,7 @@ if ($result) $text=$langs->trans($val[0], isset($val[1])?$val[1]:'', isset($val[2])?$val[2]:'', isset($val[3])?$val[3]:'', isset($val[4])?$val[4]:''); if (! empty($reg[2])) $text.=$reg[2]; } - print dol_string_nohtmltag($text); + print dol_escape_htmltag($text); print ''; // More informations From e4eb8883fece909208a94b22f60d276812600e6b Mon Sep 17 00:00:00 2001 From: Pierre Ardoin <32256817+mapiolca@users.noreply.github.com> Date: Sun, 19 Jan 2020 19:10:10 +0100 Subject: [PATCH 398/462] Fix double display of create credit note button Before: Display of the "Create credit note" button twice for standard invoices when situation invoices are activated. After: Displays a single button "Create a credit note" --- htdocs/compta/facture/card.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index b067adffeca..d83e13da433 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -4829,6 +4829,7 @@ elseif ($id > 0 || ! empty($ref)) // For situation invoice with excess received if ($object->statut > Facture::STATUS_DRAFT + && $object->type == Facture::TYPE_SITUATION && ($object->total_ttc - $totalpaye - $totalcreditnotes - $totaldeposits) > 0 && $usercancreate && !$objectidnext From f4cd3236b1563daa1cbc0b390c6311066998ad4e Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 19 Jan 2020 21:59:01 +0100 Subject: [PATCH 399/462] Fix : Accounting - error on right --- htdocs/accountancy/bookkeeping/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index e67b19991b0..7ada77d0bd6 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -855,7 +855,7 @@ print "
'.$langs->trans("Date").'
'.$langs->trans("Date").''.$langs->trans("Price").''.$langs->trans("QtyMin").''.$langs->trans("User").'
'; $transfound=0; + $transkey=''; if (in_array($fieldlist[$field], array('label','libelle'))) { - $transkey=''; // Special case for labels if ($tabname == MAIN_DB_PREFIX.'c_civility') { $transkey="Civility".strtoupper($obj->code); From b0edd464948af16d11adbd5ed311bf15cc55b958 Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Mon, 23 Dec 2019 15:07:26 +0100 Subject: [PATCH 356/462] FIX add product qty in shipment already sent --- htdocs/product/class/product.class.php | 21 +++++++++++++++------ htdocs/product/stock/product.php | 9 ++++++++- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index d00cba86e6a..c61d778a9f9 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -2633,12 +2633,13 @@ class Product extends CommonObject /** * Charge tableau des stats expedition client pour le produit/service * - * @param int $socid Id societe pour filtrer sur une societe - * @param string $filtrestatut Id statut pour filtrer sur un statut - * @param int $forVirtualStock Ignore rights filter for virtual stock calculation. - * @return array Tableau des stats + * @param int $socid Id societe pour filtrer sur une societe + * @param string $filtrestatut Id statut pour filtrer sur un statut + * @param int $forVirtualStock Ignore rights filter for virtual stock calculation. + * @param string $filterShipmentStatus [=''] Ids shipment status separated by comma + * @return int <0 if KO, >0 if OK (Tableau des stats) */ - public function load_stats_sending($socid = 0, $filtrestatut = '', $forVirtualStock = 0) + public function load_stats_sending($socid = 0, $filtrestatut = '', $forVirtualStock = 0, $filterShipmentStatus = '') { // phpcs:enable global $conf,$user; @@ -2668,6 +2669,7 @@ class Product extends CommonObject if ($filtrestatut <> '') { $sql.= " AND c.fk_statut in (".$filtrestatut.")"; } + if (!empty($filterShipmentStatus)) $sql.= " AND e.fk_statut IN (" . $filterShipmentStatus . ")"; $result = $this->db->query($sql); if ($result ) { @@ -4461,7 +4463,14 @@ class Product extends CommonObject } if (! empty($conf->expedition->enabled)) { - $result=$this->load_stats_sending(0, '1,2', 1); + require_once DOL_DOCUMENT_ROOT . '/expedition/class/expedition.class.php'; + $filterShipmentStatus = ''; + if (!empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)) { + $filterShipmentStatus = Expedition::STATUS_VALIDATED . ',' . Expedition::STATUS_CLOSED; + } elseif (!empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)) { + $filterShipmentStatus = Expedition::STATUS_CLOSED; + } + $result = $this->load_stats_sending(0, '1,2', 1, $filterShipmentStatus); if ($result < 0) dol_print_error($this->db, $this->error); $stock_sending_client=$this->stats_expedition['qty']; } diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 944b3ce96cd..89e60ed07ed 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -666,8 +666,15 @@ if ($id > 0 || $ref) // Number of product from customer order already sent (partial shipping) if (!empty($conf->expedition->enabled)) { + require_once DOL_DOCUMENT_ROOT . '/expedition/class/expedition.class.php'; + $filterShipmentStatus = ''; + if (!empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)) { + $filterShipmentStatus = Expedition::STATUS_VALIDATED . ',' . Expedition::STATUS_CLOSED; + } elseif (!empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)) { + $filterShipmentStatus = Expedition::STATUS_CLOSED; + } if ($found) $helpondiff .= '
'; else $found = 1; - $result = $object->load_stats_sending(0, '2', 1); + $result = $object->load_stats_sending(0, '2', 1, $filterShipmentStatus); $helpondiff .= $langs->trans("ProductQtyInShipmentAlreadySent") . ': ' . $object->stats_expedition['qty']; } From 99e63ad5073e0805a36fdc8e0342374c6da68a55 Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Mon, 23 Dec 2019 15:18:45 +0100 Subject: [PATCH 357/462] FIX uses GETPOSTISSET instead of GETPOST for projectfield --- htdocs/projet/element.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index fe8a27ec6f8..d60a71d5999 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -512,7 +512,7 @@ elseif ($action == "unlink") { $tablename = GETPOST("tablename", "aZ09"); - $projectField = GETPOST('projectfield', 'aZ09') ? GETPOST('projectfield', 'aZ09') : 'fk_projet'; + $projectField = GETPOSTISSET('projectfield') ? GETPOST('projectfield', 'aZ09') : 'fk_projet'; $elementselectid = GETPOST("elementselect", "int"); $result = $object->remove_element($tablename, $elementselectid, $projectField); From 720146c45f071364ef6d547a44880276fa6768b6 Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Mon, 23 Dec 2019 15:37:12 +0100 Subject: [PATCH 358/462] FIX class Facture undefined in displaying margin information --- htdocs/core/class/html.formmargin.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/core/class/html.formmargin.class.php b/htdocs/core/class/html.formmargin.class.php index 6b7ba7348ff..579b8fe5208 100644 --- a/htdocs/core/class/html.formmargin.class.php +++ b/htdocs/core/class/html.formmargin.class.php @@ -63,6 +63,8 @@ class FormMargin { global $conf, $db; + require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; + // Default returned array $marginInfos = array( 'pa_products' => 0, From 3250b13f4a3bd297ae4078ba3bc0bd3a1906a0b3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 23 Dec 2019 15:45:08 +0100 Subject: [PATCH 359/462] FIX dol_string_nohtmltag when there is html with windows EOL "
\r\n" --- htdocs/core/lib/functions.lib.php | 2 +- test/phpunit/FunctionsLibTest.php | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 071b7a3b794..3f7d9b8af09 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5389,7 +5389,7 @@ function picto_required() */ function dol_string_nohtmltag($stringtoclean, $removelinefeed = 1, $pagecodeto = 'UTF-8', $strip_tags = 0) { - if ($removelinefeed == 2) $stringtoclean = preg_replace('/]*>\n+/ims', '
', $stringtoclean); + if ($removelinefeed == 2) $stringtoclean = preg_replace('/]*>(\n|\r)+/ims', '
', $stringtoclean); $temp = preg_replace('/]*>/i', "\n", $stringtoclean); if ($strip_tags) { diff --git a/test/phpunit/FunctionsLibTest.php b/test/phpunit/FunctionsLibTest.php index 1081b3bba23..edbfea239ef 100644 --- a/test/phpunit/FunctionsLibTest.php +++ b/test/phpunit/FunctionsLibTest.php @@ -520,15 +520,19 @@ class FunctionsLibTest extends PHPUnit\Framework\TestCase $text="A string
\n
\n\nwith html tag
\n"; $after=dol_string_nohtmltag($text, 0); - $this->assertEquals("A string\n\n\n\n\nwith html tag", $after, "test2a 2 br and 3 \n give 5 \n"); + $this->assertEquals("A string\n\n\n\n\nwith html tag", $after, 'test2a 2 br and 3 \n give 5 \n'); $text="A string
\n
\n\nwith html tag
\n"; $after=dol_string_nohtmltag($text, 1); - $this->assertEquals("A string with html tag", $after, "test2b 2 br and 3 \n give 1 space"); + $this->assertEquals("A string with html tag", $after, 'test2b 2 br and 3 \n give 1 space'); $text="A string
\n
\n\nwith html tag
\n"; $after=dol_string_nohtmltag($text, 2); - $this->assertEquals("A string\n\nwith html tag", $after, "test2c 2 br and 3 \n give 2 \n"); + $this->assertEquals("A string\n\nwith html tag", $after, 'test2c 2 br and 3 \n give 2 \n'); + + $text="A string
\r\n
\r\n\r\nwith html tag
\n"; + $after=dol_string_nohtmltag($text, 2); + $this->assertEquals("A string\n\nwith html tag", $after, 'test2c 2 br and 3 \r\n give 2 \n'); $text="A string
Another string"; $after=dol_string_nohtmltag($text, 0); From 792096ad08ae495ffd81d57bc1b987fb5c227baf Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Mon, 23 Dec 2019 16:00:35 +0100 Subject: [PATCH 360/462] FIX url new for task time spent in project element tab --- htdocs/projet/element.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 97e99c93370..06d14f18042 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -436,7 +436,7 @@ $listofreferent=array( 'table'=>'projet_task', 'datefieldname'=>'task_date', 'disableamount'=>0, - 'urlnew'=>DOL_URL_ROOT.'/projet/tasks/time.php?id='.$id, + 'urlnew'=>DOL_URL_ROOT.'/projet/tasks/time.php?withproject=1&action=createtime&projectid='.$id, 'buttonnew'=>'AddTimeSpent', 'testnew'=>$user->rights->projet->creer, 'test'=>($conf->projet->enabled && $user->rights->projet->lire && empty($conf->global->PROJECT_HIDE_TASKS))), From 5521d13a1186a5f0c5a60da96f1f7c528a2c3db3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 23 Dec 2019 22:12:50 +0100 Subject: [PATCH 361/462] Prepare 10.0.5 --- htdocs/filefunc.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index 7c71221ba3c..c0697df392b 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -31,7 +31,7 @@ */ if (! defined('DOL_APPLICATION_TITLE')) define('DOL_APPLICATION_TITLE', 'Dolibarr'); -if (! defined('DOL_VERSION')) define('DOL_VERSION', '10.0.4'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c +if (! defined('DOL_VERSION')) define('DOL_VERSION', '10.0.5'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c if (! defined('EURO')) define('EURO', chr(128)); From 07b40f043e3992cab80e545d9cc0afdd3a0df1b4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 23 Dec 2019 22:44:34 +0100 Subject: [PATCH 362/462] Prepare 10.0.5 --- ChangeLog | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/ChangeLog b/ChangeLog index 99e70e960c9..b1b64681abb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,33 @@ English Dolibarr ChangeLog -------------------------------------------------------------- +***** ChangeLog for 10.0.5 compared to 10.0.4 ***** +FIX: 10.0: add URL param "restore_last_search_values=1" to all backlinks pointing to lists +FIX: 10.0: do not display single-letter values (indicating duration unit without value) in product list +FIX: #12473 +FIX: #12481 : fix ticket creation from thirdparty, mission $socid var +FIX: #12482 +FIX: #12644 +FIX: #12665 Mass invoice validation with stock management +FIX: #12688 +FIX: #12745 +FIX: add and modify category translate form with posted values on errors +FIX: add URL param "restore_last_search_values=1" to all backlinks that point to a list +FIX: CommandeFournisseurLigne update function must not be able to return other value than 1 if success +FIX: contact card state address selected after filling address +FIX: dol_string_nohtmltag when there is html with windows EOL "
\r\n" +FIX: filter language is an array +FIX: first col at wrong position in Export 2007 (new) +FIX: getrights() request +FIX: Invoice Situation integration into Margin +FIX: missing nl2br conversion +FIX: not fee in payout list +FIX: product_fourn_price_id was assigned too late for logPrice() function +FIX: Reduce number of request for list of products +FIX: set due date in object in create invoice +FIX: units traductions for selectUnits() function +FIX: when we need to bill several orders, order lines unit is not on bill lines +NEW: 9.0: allow users to use the mysqldump '--quick' option ***** ChangeLog for 10.0.4 compared to 10.0.3 ***** FIX: The pdf templates were using the large logo making PDF too large (and edition of proposal, order, invoice VERY slow) From 44400b786654a363bea4a9bf5c3414e6248fb8db Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Tue, 24 Dec 2019 07:22:25 +0100 Subject: [PATCH 363/462] FIX : Some issues on salary payment --- htdocs/compta/salaries/card.php | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/htdocs/compta/salaries/card.php b/htdocs/compta/salaries/card.php index 392b90b7bb6..5371e773828 100644 --- a/htdocs/compta/salaries/card.php +++ b/htdocs/compta/salaries/card.php @@ -44,6 +44,12 @@ $id=GETPOST("id", 'int'); $action=GETPOST('action', 'aZ09'); $cancel= GETPOST('cancel', 'aZ09'); $projectid = (GETPOST('projectid', 'int') ? GETPOST('projectid', 'int') : GETPOST('fk_project', 'int')); +$accountid = GETPOST('accountid', 'int') > 0 ? GETPOST('accountid', 'int') : 0; + +$datep = dol_mktime(12, 0, 0, GETPOST("datepmonth", 'int'), GETPOST("datepday", 'int'), GETPOST("datepyear", 'int')); +$datev = dol_mktime(12, 0, 0, GETPOST("datevmonth", 'int'), GETPOST("datevday", 'int'), GETPOST("datevyear", 'int')); +$datesp = dol_mktime(12, 0, 0, GETPOST("datespmonth", 'int'), GETPOST("datespday", 'int'), GETPOST("datespyear", 'int')); +$dateep = dol_mktime(12, 0, 0, GETPOST("dateepmonth", 'int'), GETPOST("dateepday", 'int'), GETPOST("dateepyear", 'int')); // Security check $socid = GETPOST("socid", "int"); @@ -71,34 +77,30 @@ if ($cancel) if ($action == 'classin' && $user->rights->banque->modifier) { $object->fetch($id); - $object->setProject(GETPOST('projectid')); + $object->setProject($projectid); } if ($action == 'add' && empty($cancel)) { $error=0; - $datep=dol_mktime(12, 0, 0, GETPOST("datepmonth", 'int'), GETPOST("datepday", 'int'), GETPOST("datepyear", 'int')); - $datev=dol_mktime(12, 0, 0, GETPOST("datevmonth", 'int'), GETPOST("datevday", 'int'), GETPOST("datevyear", 'int')); - $datesp=dol_mktime(12, 0, 0, GETPOST("datespmonth", 'int'), GETPOST("datespday", 'int'), GETPOST("datespyear", 'int')); - $dateep=dol_mktime(12, 0, 0, GETPOST("dateepmonth", 'int'), GETPOST("dateepday", 'int'), GETPOST("dateepyear", 'int')); if (empty($datev)) $datev=$datep; $type_payment = dol_getIdFromCode($db, GETPOST("paymenttype", 'alpha'), 'c_paiement', 'code', 'id', 1); - $object->accountid=GETPOST("accountid") > 0 ? GETPOST("accountid", "int") : 0; - $object->fk_user=GETPOST("fk_user") > 0 ? GETPOST("fk_user", "int") : 0; + $object->accountid=GETPOST("accountid", "int") > 0 ? GETPOST("accountid", "int") : 0; + $object->fk_user=GETPOST("fk_user", "int") > 0 ? GETPOST("fk_user", "int") : 0; $object->datev=$datev; $object->datep=$datep; - $object->amount=price2num(GETPOST("amount")); - $object->label=GETPOST("label"); + $object->amount=price2num(GETPOST("amount", "alpha")); + $object->label=GETPOST("label", "alphanohtml"); $object->datesp=$datesp; $object->dateep=$dateep; - $object->note=GETPOST("note"); + $object->note=GETPOST("note", "none"); $object->type_payment=($type_payment > 0 ? $type_payment : 0); - $object->num_payment=GETPOST("num_payment"); + $object->num_payment=GETPOST("num_payment", "alphanohtml"); $object->fk_user_author=$user->id; - $object->fk_project= GETPOST('fk_project', 'int'); + $object->fk_project= $projectid; // Set user current salary as ref salaray for the payment $fuser=new User($db); @@ -303,7 +305,7 @@ if ($action == 'create') print '
'.$langs->trans("Project").''; - $numproject=$formproject->select_projects(-1, $projectid, 'fk_project', 0, 0, 1, 1); + $formproject->select_projects(-1, $projectid, 'fk_project', 0, 0, 1, 1); print '
'; print $form->editfieldkey('BankAccount', 'selectaccountid', '', $object, 0, 'string', '', 1).''; - $form->select_comptes($_POST["accountid"], "accountid", 0, '', 1); // Affiche liste des comptes courant + $form->select_comptes($accountid, "accountid", 0, '', 1); // Affiche liste des comptes courant print '
'; print $form->editfieldkey('PaymentMode', 'selectpaymenttype', '', $object, 0, 'string', '', 1).''; - $form->select_types_paiements(GETPOST("paymenttype"), "paymenttype", '', 2); + $form->select_types_paiements(GETPOST("paymenttype", "aZ09"), "paymenttype", '', 2); print '
'; - print $langs->trans("LoanAccountancyCapitalCode"); + print $langs->trans("LoanAccountancyInsuranceCode"); print ''; if (! empty($conf->accounting->enabled)) From 93d87d581b3f4055c20066eb01b8f071a24f3060 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Fri, 3 Jan 2020 14:56:49 +0100 Subject: [PATCH 373/462] FIX typo on language key --- htdocs/langs/en_US/other.lang | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/langs/en_US/other.lang b/htdocs/langs/en_US/other.lang index 0ad4c5dfc83..5dd7422539a 100644 --- a/htdocs/langs/en_US/other.lang +++ b/htdocs/langs/en_US/other.lang @@ -56,7 +56,7 @@ Notify_BILL_SUPPLIER_PAYED=Vendor invoice paid Notify_BILL_SUPPLIER_SENTBYMAIL=Vendor invoice sent by mail Notify_BILL_SUPPLIER_CANCELED=Vendor invoice cancelled Notify_CONTRACT_VALIDATE=Contract validated -Notify_FICHEINTER_VALIDATE=Intervention validated +Notify_FICHINTER_VALIDATE=Intervention validated Notify_FICHINTER_ADD_CONTACT=Added contact to Intervention Notify_FICHINTER_SENTBYMAIL=Intervention sent by mail Notify_SHIPPING_VALIDATE=Shipping validated @@ -269,4 +269,4 @@ WEBSITE_KEYWORDS=Keywords LinesToImport=Lines to import MemoryUsage=Memory usage -RequestDuration=Duration of request \ No newline at end of file +RequestDuration=Duration of request From f14aaf5e50d9daeb4538d10468c987df9ee01b79 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Fri, 3 Jan 2020 16:35:02 +0100 Subject: [PATCH 374/462] FIX Some problems on conciliation with others modules --- htdocs/compta/bank/releve.php | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php index b93f381c555..845ba1a2172 100644 --- a/htdocs/compta/bank/releve.php +++ b/htdocs/compta/bank/releve.php @@ -37,12 +37,15 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/cheque/class/remisecheque.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; +require_once DOL_DOCUMENT_ROOT.'/don/class/paymentdonation.class.php'; +require_once DOL_DOCUMENT_ROOT.'/loan/class/paymentloan.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/paymentvarious.class.php'; //show files require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php'; // Load translation files required by the page -$langs->loadLangs(array("banks","categories","companies","bills","trips")); +$langs->loadLangs(array("banks","categories","companies","bills","trips","donations","loan")); $action=GETPOST('action', 'alpha'); $id=GETPOST('account', 'int'); @@ -363,7 +366,10 @@ $paymentsupplierstatic=new PaiementFourn($db); $paymentvatstatic=new TVA($db); $bankstatic=new Account($db); $banklinestatic=new AccountLine($db); -$remisestatic = new RemiseCheque($db); +$remisestatic=new RemiseCheque($db); +$paymentdonationstatic=new PaymentDonation($db); +$paymentloanstatic=new PaymentLoan($db); +$paymentvariousstatic=new PaymentVarious($db); // Must be before button action $param=''; @@ -668,6 +674,27 @@ else print ''; $newline=0; } + elseif ($links[$key]['type']=='payment_donation') + { + $paymentdonationstatic->id=$links[$key]['url_id']; + $paymentdonationstatic->ref=$langs->trans("Payment"); + print ' '.$paymentdonationstatic->getNomUrl(1); + $newline = 0; + } + elseif ($links[$key]['type']=='payment_loan') + { + $paymentloanstatic->id=$links[$key]['url_id']; + $paymentloanstatic->ref=$langs->trans("Payment"); + print ' '.$paymentloanstatic->getNomUrl(1); + $newline = 0; + } + elseif ($links[$key]['type']=='payment_various') + { + $paymentvariousstatic->id=$links[$key]['url_id']; + $paymentvariousstatic->ref=$langs->trans("Payment"); + print ' '.$paymentvariousstatic->getNomUrl(1); + $newline = 0; + } elseif ($links[$key]['type']=='banktransfert') { // Do not show link to transfer since there is no transfer card (avoid confusion). Can already be accessed from transaction detail. if ($objp->amount > 0) From 79458ac139e5bd88b1402e98c5b0413dd545ca1f Mon Sep 17 00:00:00 2001 From: Pierre Ardoin <32256817+mapiolca@users.noreply.github.com> Date: Fri, 3 Jan 2020 18:05:49 +0100 Subject: [PATCH 375/462] FIX an issue that shows all entities stock Before : If products are shared between several entities, the stock of each entity are to add in this page (reassort.php) Now : Each entity see only her stock and not other's stock. --- htdocs/product/reassort.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/product/reassort.php b/htdocs/product/reassort.php index 476fec36c2a..cbf461f4fe4 100644 --- a/htdocs/product/reassort.php +++ b/htdocs/product/reassort.php @@ -123,10 +123,12 @@ $sql.= ' SUM(s.reel) as stock_physique'; if (! empty($conf->global->PRODUCT_USE_UNITS)) $sql.= ', u.short_label as unit_short'; $sql.= ' FROM '.MAIN_DB_PREFIX.'product as p'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_stock as s on p.rowid = s.fk_product'; +$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'entrepot as e on s.fk_entrepot = e.rowid'; if (! empty($conf->global->PRODUCT_USE_UNITS)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_units as u on p.fk_unit = u.rowid'; // We'll need this table joined to the select in order to filter by categ if ($search_categ) $sql.= ", ".MAIN_DB_PREFIX."categorie_product as cp"; $sql.= " WHERE p.entity IN (".getEntity('product').")"; +$sql.= " AND e.entity IN (".getEntity('entrepot').")"; if ($search_categ) $sql.= " AND p.rowid = cp.fk_product"; // Join for the needed table to filter by categ if ($sall) $sql.=natural_search(array('p.ref', 'p.label', 'p.description', 'p.note'), $sall); // if the type is not 1, we show all products (type = 0,2,3) From 8a5f3d48f41caaa65f4ca18da1fdd9dd1116be1f Mon Sep 17 00:00:00 2001 From: Pierre Tocquin Date: Fri, 3 Jan 2020 19:18:24 +0100 Subject: [PATCH 376/462] Update api_supplier_invoices.class.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Correction test data 'date' lors de la création d'une facture fournisseur. `array_keys` remplacé par `array_key_exists` dans la clause `if`. Cette clause est correcte dans api_invoices.class.php. --- htdocs/fourn/class/api_supplier_invoices.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/class/api_supplier_invoices.class.php b/htdocs/fourn/class/api_supplier_invoices.class.php index 416f7e11e94..f4918650dc7 100644 --- a/htdocs/fourn/class/api_supplier_invoices.class.php +++ b/htdocs/fourn/class/api_supplier_invoices.class.php @@ -200,7 +200,7 @@ class SupplierInvoices extends DolibarrApi foreach($request_data as $field => $value) { $this->invoice->$field = $value; } - if(! array_keys($request_data, 'date')) { + if(! array_key_exists('date', $request_data)) { $this->invoice->date = dol_now(); } /* We keep lines as an array From 37f93077328b8567674d57f19cb35005bd7f78fd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 3 Jan 2020 20:53:49 +0100 Subject: [PATCH 377/462] Update product.class.php --- htdocs/product/class/product.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index c61d778a9f9..4a8390d80cd 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -2634,7 +2634,7 @@ class Product extends CommonObject * Charge tableau des stats expedition client pour le produit/service * * @param int $socid Id societe pour filtrer sur une societe - * @param string $filtrestatut Id statut pour filtrer sur un statut + * @param string $filtrestatut [=''] Ids order status separated by comma * @param int $forVirtualStock Ignore rights filter for virtual stock calculation. * @param string $filterShipmentStatus [=''] Ids shipment status separated by comma * @return int <0 if KO, >0 if OK (Tableau des stats) From 7853427bb1cc50685aabe6d5b2cb019f397a39d6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 4 Jan 2020 14:21:38 +0100 Subject: [PATCH 378/462] FIX product with empty stock were not visible --- htdocs/product/reassort.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/product/reassort.php b/htdocs/product/reassort.php index cbf461f4fe4..6ee13633139 100644 --- a/htdocs/product/reassort.php +++ b/htdocs/product/reassort.php @@ -123,12 +123,11 @@ $sql.= ' SUM(s.reel) as stock_physique'; if (! empty($conf->global->PRODUCT_USE_UNITS)) $sql.= ', u.short_label as unit_short'; $sql.= ' FROM '.MAIN_DB_PREFIX.'product as p'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_stock as s on p.rowid = s.fk_product'; -$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'entrepot as e on s.fk_entrepot = e.rowid'; +$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'entrepot as e on s.fk_entrepot = e.rowid AND e.entity IN ('.getEntity('entrepot').')'; if (! empty($conf->global->PRODUCT_USE_UNITS)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_units as u on p.fk_unit = u.rowid'; // We'll need this table joined to the select in order to filter by categ if ($search_categ) $sql.= ", ".MAIN_DB_PREFIX."categorie_product as cp"; $sql.= " WHERE p.entity IN (".getEntity('product').")"; -$sql.= " AND e.entity IN (".getEntity('entrepot').")"; if ($search_categ) $sql.= " AND p.rowid = cp.fk_product"; // Join for the needed table to filter by categ if ($sall) $sql.=natural_search(array('p.ref', 'p.label', 'p.description', 'p.note'), $sall); // if the type is not 1, we show all products (type = 0,2,3) From cc4c2d8a0bbd100eaf636c629d0970f9193d2a4b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 5 Jan 2020 20:39:45 +0100 Subject: [PATCH 379/462] Prepare 10.0.6 --- htdocs/filefunc.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index c0697df392b..b3e743aa1a6 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -31,7 +31,7 @@ */ if (! defined('DOL_APPLICATION_TITLE')) define('DOL_APPLICATION_TITLE', 'Dolibarr'); -if (! defined('DOL_VERSION')) define('DOL_VERSION', '10.0.5'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c +if (! defined('DOL_VERSION')) define('DOL_VERSION', '10.0.6'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c if (! defined('EURO')) define('EURO', chr(128)); From 7350331865ec03ae4404d91f6d296f61aa70ae54 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 5 Jan 2020 20:41:12 +0100 Subject: [PATCH 380/462] Prepare 10.0.6 --- ChangeLog | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/ChangeLog b/ChangeLog index b1b64681abb..914d5129f7e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,25 @@ English Dolibarr ChangeLog -------------------------------------------------------------- +***** ChangeLog for 10.0.6 compared to 10.0.5 ***** +FIX Regression of 10.0.5 to create/edit proposals and orders. +FIX: #12760 #12763 #12755 #12765 #12751 +FIX: add product qty in shipment already sent (fix for option STOCK_CALCULATE_ON_SHIPMENT_NEW) +FIX: an issue that shows all entities stock +FIX: class Facture undefined in displaying margin information +FIX: error 500 when getting margin info for objects other than invoices +FIX: Loan card - Wrong language key used +FIX: Missing language key for MAIN_MAXTABS_IN_CARD +FIX: product with empty stock were not visible +FIX: remove backward compatibility projectid and uses object id instead +FIX: Some issues on salary payment +FIX: Some problems on conciliation with others modules +FIX: typo on language key +FIX: url new for task time spent in project element tab +FIX: uses GETPOSTISSET instead of GETPOST for projectfield +FIX: var transkey not defined in input hidden +FIX: wrong var name and avoid warning + ***** ChangeLog for 10.0.5 compared to 10.0.4 ***** FIX: 10.0: add URL param "restore_last_search_values=1" to all backlinks pointing to lists FIX: 10.0: do not display single-letter values (indicating duration unit without value) in product list From e820af4aa08e8fc188785a23892da60af9b7ee3f Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 7 Jan 2020 13:07:36 +0100 Subject: [PATCH 381/462] FIX: multicompany for discount --- htdocs/comm/remise.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/remise.php b/htdocs/comm/remise.php index a2d373f339a..940b2eecba4 100644 --- a/htdocs/comm/remise.php +++ b/htdocs/comm/remise.php @@ -222,7 +222,7 @@ if ($socid > 0) $sql.= " u.login, u.rowid as user_id"; $sql.= " FROM ".MAIN_DB_PREFIX."societe_remise as rc, ".MAIN_DB_PREFIX."user as u"; $sql.= " WHERE rc.fk_soc = " . $object->id; - $sql.= " AND rc.entity = " . $conf->entity; + $sql.= " AND rc.entity IN (".getEntity('discount').")"; $sql.= " AND u.rowid = rc.fk_user_author"; $sql.= " ORDER BY rc.datec DESC"; @@ -281,7 +281,7 @@ if ($socid > 0) $sql.= " u.login, u.rowid as user_id"; $sql.= " FROM ".MAIN_DB_PREFIX."societe_remise_supplier as rc, ".MAIN_DB_PREFIX."user as u"; $sql.= " WHERE rc.fk_soc = " . $object->id; - $sql.= " AND rc.entity = " . $conf->entity; + $sql.= " AND rc.entity IN (".getEntity('discount').")"; $sql.= " AND u.rowid = rc.fk_user_author"; $sql.= " ORDER BY rc.datec DESC"; From 5a1f1239942e1d0b09725c9396511f551e483d02 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 7 Jan 2020 13:10:10 +0100 Subject: [PATCH 382/462] Update societe.class.php --- htdocs/societe/class/societe.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 1ef4de8ae64..f1d489751ac 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1287,7 +1287,7 @@ class Societe extends CommonObject $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_departements as d ON s.fk_departement = d.rowid'; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_typent as te ON s.fk_typent = te.id'; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_incoterms as i ON s.fk_incoterms = i.rowid'; - $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe_remise as sr ON sr.rowid = (SELECT MAX(rowid) FROM '.MAIN_DB_PREFIX.'societe_remise WHERE fk_soc = s.rowid AND entity = '.$conf->entity.')'; + $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe_remise as sr ON sr.rowid = (SELECT MAX(rowid) FROM '.MAIN_DB_PREFIX.'societe_remise WHERE fk_soc = s.rowid AND entity IN ('.getEntity('discount').'))'; $sql .= ' WHERE s.entity IN ('.getEntity($this->element).')'; if ($rowid) $sql .= ' AND s.rowid = '.$rowid; From 36ccb8b08e69135568938a01fbd081fc84b400d7 Mon Sep 17 00:00:00 2001 From: John Botella Date: Tue, 7 Jan 2020 14:49:25 +0100 Subject: [PATCH 383/462] Fix folder rename behavior --- htdocs/variants/combinations.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/variants/combinations.php b/htdocs/variants/combinations.php index 6dc66a32a8e..e53305c2015 100644 --- a/htdocs/variants/combinations.php +++ b/htdocs/variants/combinations.php @@ -168,12 +168,15 @@ if ($_POST) { $bulkaction = $massaction; $error = 0; - $prodstatic = new Product($db); + $db->begin(); foreach ($toselect as $prodid) { + // need create new of Product to prevent rename dir behavior + $prodstatic = new Product($db); + if ($prodstatic->fetch($prodid) < 0) { continue; } From 2d67c2365fdf383a518de99d3dd916efd2fac4dc Mon Sep 17 00:00:00 2001 From: Dev2a Date: Tue, 7 Jan 2020 18:59:58 +0100 Subject: [PATCH 384/462] Fix Check right for service for arrayofmassaction if product module disable, threre is no action for service --- htdocs/product/list.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/product/list.php b/htdocs/product/list.php index dcf43945ccb..55681eef583 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -424,13 +424,13 @@ if ($resql) //'presend'=>$langs->trans("SendByMail"), //'builddoc'=>$langs->trans("PDFMerge"), ); - if ($user->rights->produit->supprimer) $arrayofmassactions['predelete']=$langs->trans("Delete"); + $rightskey='produit'; + if($type == Product::TYPE_SERVICE) $rightskey='service'; + if ($user->rights->{$rightskey}->supprimer) $arrayofmassactions['predelete']=$langs->trans("Delete"); if (in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array(); $massactionbutton=$form->selectMassAction('', $arrayofmassactions); $newcardbutton=''; - $rightskey='produit'; - if($type == Product::TYPE_SERVICE) $rightskey='service'; if($user->rights->{$rightskey}->creer) { $label='NewProduct'; From 57c954f2e862e49ea449f9b13825119cb4191b3a Mon Sep 17 00:00:00 2001 From: Dev2a Date: Tue, 7 Jan 2020 21:41:36 +0100 Subject: [PATCH 385/462] Fix Check array of action after kooks --- htdocs/core/class/html.form.class.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 06fd6cc02e8..e6a324a79a3 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -573,15 +573,14 @@ class Form * Generate select HTML to choose massaction * * @param string $selected Value auto selected when at least one record is selected. Not a preselected value. Use '0' by default. - * @param int $arrayofaction array('code'=>'label', ...). The code is the key stored into the GETPOST('massaction') when submitting action. + * @param array $arrayofaction array('code'=>'label', ...). The code is the key stored into the GETPOST('massaction') when submitting action. * @param int $alwaysvisible 1=select button always visible - * @return string Select list + * @return string|void Select list */ function selectMassAction($selected, $arrayofaction, $alwaysvisible=0) { global $conf,$langs,$hookmanager; - if (count($arrayofaction) == 0) return; $disabled=0; $ret='
'; @@ -590,6 +589,8 @@ class Form // Complete list with data from external modules. THe module can use $_SERVER['PHP_SELF'] to know on which page we are, or use the $parameters['currentcontext'] completed by executeHooks. $parameters=array(); $reshook=$hookmanager->executeHooks('addMoreMassActions',$parameters); // Note that $action and $object may have been modified by hook + // check if there is a mass action + if (count($arrayofaction) == 0 && empty($hookmanager->resPrint)) return; if (empty($reshook)) { $ret.=''; From ae4554af65c497a8798111482fb651f94bf9fb05 Mon Sep 17 00:00:00 2001 From: atm-arnaud Date: Wed, 8 Jan 2020 11:27:52 +0100 Subject: [PATCH 386/462] FIX drafts are now implemented for stats --- htdocs/compta/facture/class/facturestats.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/class/facturestats.class.php b/htdocs/compta/facture/class/facturestats.class.php index 91d3e4476ff..f16e53b966d 100644 --- a/htdocs/compta/facture/class/facturestats.class.php +++ b/htdocs/compta/facture/class/facturestats.class.php @@ -79,7 +79,7 @@ class FactureStats extends Stats $this->field_line='total_ht'; } - $this->where = " f.fk_statut > 0"; + $this->where = " f.fk_statut >= 0"; $this->where.= " AND f.entity IN (".getEntity('invoice').")"; if (!$user->rights->societe->client->voir && !$this->socid) $this->where .= " AND f.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id; if ($mode == 'customer') $this->where.=" AND (f.fk_statut <> 3 OR f.close_code <> 'replaced')"; // Exclude replaced invoices as they are duplicated (we count closed invoices for other reasons) From c028819cab8e109291e24962d19ce36e2e3e2053 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Jan 2020 19:35:49 +0100 Subject: [PATCH 387/462] FIX clone of purchase order --- htdocs/fourn/class/fournisseur.commande.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index b69818bbdb1..fef9c091247 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -191,7 +191,7 @@ class CommandeFournisseur extends CommonOrder $this->extraparams = (array) json_decode($obj->extraparams, true); $this->db->free($resql); - + // Retreive all extrafield // fetch optionals attributes and labels require_once(DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'); @@ -951,6 +951,7 @@ class CommandeFournisseur extends CommonOrder $this->lines[$i]->remise_percent, 'HT', 0, + $this->lines[$i]->product_type, $this->lines[$i]->info_bits ); if ($result < 0) From 5455130a03293088c8d46d68bdfba780e32b4abb Mon Sep 17 00:00:00 2001 From: gauthier Date: Mon, 13 Jan 2020 16:15:22 +0100 Subject: [PATCH 388/462] FIX : We want to be able to import data for extrafields of entity 0 too --- htdocs/core/modules/modSociete.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modSociete.class.php b/htdocs/core/modules/modSociete.class.php index 23d92f53cb7..b57617b4582 100644 --- a/htdocs/core/modules/modSociete.class.php +++ b/htdocs/core/modules/modSociete.class.php @@ -449,7 +449,7 @@ class modSociete extends DolibarrModules 's.multicurrency_code' => 'MulticurrencyCurrency' ); // Add extra fields - $sql = "SELECT name, label, fieldrequired FROM " . MAIN_DB_PREFIX . "extrafields WHERE elementtype = 'societe' AND entity = " . $conf->entity; + $sql = "SELECT name, label, fieldrequired FROM " . MAIN_DB_PREFIX . "extrafields WHERE elementtype = 'societe' AND entity IN (0," . $conf->entity .")"; $resql = $this->db->query($sql); if ($resql) // This can fail when class is used on old database (during migration for example) { From 0442105bd499a33cbc75cd6fe2c92556b3f88d30 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 15 Jan 2020 11:55:27 +0100 Subject: [PATCH 389/462] Fix Generation of zip of module --- htdocs/core/lib/files.lib.php | 6 ++++-- htdocs/modulebuilder/index.php | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index b84bef02910..b8595b435c1 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -2071,9 +2071,10 @@ function dol_uncompress($inputfile, $outputdir) * @param string $outputfile Target file name (output directory must exists and be writable) * @param string $mode 'zip' * @param string $excludefiles A regex pattern. For example: '/\.log$|\/temp\//' + * @param string $rootdirinzip Add a root dir level in zip file * @return int <0 if KO, >0 if OK */ -function dol_compress_dir($inputdir, $outputfile, $mode = "zip", $excludefiles = '') +function dol_compress_dir($inputdir, $outputfile, $mode = "zip", $excludefiles = '', $rootdirinzip = '') { $foundhandler=0; @@ -2134,7 +2135,8 @@ function dol_compress_dir($inputdir, $outputfile, $mode = "zip", $excludefiles = { // Get real and relative path for current file $filePath = $file->getRealPath(); - $relativePath = substr($filePath, strlen($inputdir) + 1); + $relativePath = ($rootdirinzip ? $rootdirinzip.'/' : '').substr($filePath, strlen($inputdir) + 1); + if (empty($excludefiles) || ! preg_match($excludefiles, $filePath)) { // Add current file to archive diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index d67fa08fafa..f1de611051b 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -1071,7 +1071,7 @@ if ($dirins && $action == 'generatepackage') if ($dirofmodule) { if (! dol_is_dir($dirofmodule)) dol_mkdir($dirofmodule); - $result = dol_compress_dir($dir, $outputfilezip, 'zip'); + $result = dol_compress_dir($dir, $outputfilezip, 'zip', '', $modulelowercase); } else { From b4a309a2514db27f54a513b5cf7b4cbc0d074959 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 15 Jan 2020 12:00:25 +0100 Subject: [PATCH 390/462] Prepare 10.0.7 --- htdocs/filefunc.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index b3e743aa1a6..1f8d9bf3b8f 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -31,7 +31,7 @@ */ if (! defined('DOL_APPLICATION_TITLE')) define('DOL_APPLICATION_TITLE', 'Dolibarr'); -if (! defined('DOL_VERSION')) define('DOL_VERSION', '10.0.6'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c +if (! defined('DOL_VERSION')) define('DOL_VERSION', '10.0.7'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c if (! defined('EURO')) define('EURO', chr(128)); From 10c973f38f98e08587f2d7735f584e12ce22ebed Mon Sep 17 00:00:00 2001 From: John Botella Date: Wed, 15 Jan 2020 14:36:44 +0100 Subject: [PATCH 391/462] Fix complex export model loading --- htdocs/exports/export.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/exports/export.php b/htdocs/exports/export.php index c404fc2b264..9122c93bae4 100644 --- a/htdocs/exports/export.php +++ b/htdocs/exports/export.php @@ -373,7 +373,7 @@ if ($step == 2 && $action == 'select_model') $result = $objexport->fetch($exportmodelid); if ($result > 0) { - $fieldsarray=explode(',', $objexport->hexa); + $fieldsarray=preg_split("/,(?! [^(]*\))/", $objexport->hexa); $i=1; foreach($fieldsarray as $val) { From 3cdb84b192bd5ea8c4f6c66eabc2f19215dee08e Mon Sep 17 00:00:00 2001 From: atm-ph Date: Thu, 16 Jan 2020 09:50:57 +0100 Subject: [PATCH 392/462] Fix note started with balise --- htdocs/core/lib/functions.lib.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 3f7d9b8af09..63759ba71ed 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5756,9 +5756,9 @@ function dol_textishtml($msg, $option = 0) elseif (preg_match('//i', $msg)) return true; elseif (preg_match('//i', $msg)) return true; - elseif (preg_match('/<(br|div|font|li|p|span|strong|table)>/i', $msg)) return true; - elseif (preg_match('/<(br|div|font|li|p|span|strong|table)\s+[^<>\/]*>/i', $msg)) return true; - elseif (preg_match('/<(br|div|font|li|p|span|strong|table)\s+[^<>\/]*\/>/i', $msg)) return true; + elseif (preg_match('/<(br|div|font|li|p|span|strong|table|s)>/i', $msg)) return true; + elseif (preg_match('/<(br|div|font|li|p|span|strong|table|s)\s+[^<>\/]*>/i', $msg)) return true; + elseif (preg_match('/<(br|div|font|li|p|span|strong|table|s)\s+[^<>\/]*\/>/i', $msg)) return true; elseif (preg_match('/]*src[^<>]*>/i', $msg)) return true; // must accept elseif (preg_match('/]*href[^<>]*>/i', $msg)) return true; // must accept elseif (preg_match('//i', $msg)) return true; From 60d4f63205a0c8d03bfdf96825f0a5b1894f5ab3 Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Fri, 17 Jan 2020 13:56:01 +0100 Subject: [PATCH 393/462] FIX send expense report mail in HTML format --- htdocs/expensereport/card.php | 18 +++++++++++++----- htdocs/langs/fr_FR/trips.lang | 2 +- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index b95dad0f200..44179745267 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -390,6 +390,7 @@ if (empty($reshook)) // CONTENT $link = $urlwithroot.'/expensereport/card.php?id='.$object->id; + $link = '' . $link . ''; $message = $langs->transnoentities("ExpenseReportWaitingForApprovalMessage", $expediteur->getFullName($langs), get_date_range($object->date_debut, $object->date_fin, '', $langs), $link); // Rebuild pdf @@ -509,6 +510,7 @@ if (empty($reshook)) // CONTENT $link = $urlwithroot.'/expensereport/card.php?id='.$object->id; + $link = '' . $link . ''; $dateRefusEx = explode(" ", $object->date_refuse); $message = $langs->transnoentities("ExpenseReportWaitingForReApprovalMessage", $dateRefusEx[0], $object->detail_refuse, $expediteur->getFullName($langs), $link); @@ -634,6 +636,7 @@ if (empty($reshook)) // CONTENT $link = $urlwithroot.'/expensereport/card.php?id='.$object->id; + $link = '' . $link . ''; $message = $langs->transnoentities("ExpenseReportApprovedMessage", $object->ref, $destinataire->getFullName($langs), $expediteur->getFullName($langs), $link); // Rebuilt pdf @@ -704,7 +707,8 @@ if (empty($reshook)) $object = new ExpenseReport($db); $object->fetch($id); - $result = $object->setDeny($user, GETPOST('detail_refuse', 'alpha')); + $detailRefuse = GETPOST('detail_refuse', 'alpha'); + $result = $object->setDeny($user, $detailRefuse); if ($result > 0) { @@ -752,7 +756,8 @@ if (empty($reshook)) // CONTENT $link = $urlwithroot.'/expensereport/card.php?id='.$object->id; - $message = $langs->transnoentities("ExpenseReportRefusedMessage", $object->ref, $destinataire->getFullName($langs), $expediteur->getFullName($langs), $_POST['detail_refuse'], $link); + $link = '' . $link . ''; + $message = $langs->transnoentities("ExpenseReportRefusedMessage", $object->ref, $destinataire->getFullName($langs), $expediteur->getFullName($langs), $detailRefuse, $link); // Rebuilt pdf /* @@ -832,7 +837,8 @@ if (empty($reshook)) if ($user->id == $object->fk_user_valid || $user->id == $object->fk_user_author) { - $result = $object->set_cancel($user, GETPOST('detail_cancel', 'alpha')); + $detailCancel = GETPOST('detail_cancel', 'alpha'); + $result = $object->set_cancel($user, $detailCancel); if ($result > 0) { @@ -880,7 +886,8 @@ if (empty($reshook)) // CONTENT $link = $urlwithroot.'/expensereport/card.php?id='.$object->id; - $message = $langs->transnoentities("ExpenseReportCanceledMessage", $object->ref, $destinataire->getFullName($langs), $expediteur->getFullName($langs), GETPOST('detail_cancel', 'alpha'), $link); + $link = '' . $link . ''; + $message = $langs->transnoentities("ExpenseReportCanceledMessage", $object->ref, $destinataire->getFullName($langs), $expediteur->getFullName($langs), $detailCancel, $link); // Rebuilt pdf /* @@ -1105,6 +1112,7 @@ if (empty($reshook)) // CONTENT $link = $urlwithroot.'/expensereport/card.php?id='.$object->id; + $link = '' . $link . ''; $message = $langs->transnoentities("ExpenseReportPaidMessage", $object->ref, $destinataire->getFullName($langs), $expediteur->getFullName($langs), $link); // Generate pdf before attachment @@ -1736,7 +1744,7 @@ else if ($action == 'cancel') { $array_input = array('text'=>$langs->trans("ConfirmCancelTrip"), array('type'=>"text",'label'=>''.$langs->trans("Comment").'','name'=>"detail_cancel",'value'=>"")); - $formconfirm=$form->formconfirm($_SEVER["PHP_SELF"]."?id=".$id, $langs->trans("Cancel"), "", "confirm_cancel", $array_input, "", 1); + $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id, $langs->trans("Cancel"), "", "confirm_cancel", $array_input, "", 1); } if ($action == 'setdraft') diff --git a/htdocs/langs/fr_FR/trips.lang b/htdocs/langs/fr_FR/trips.lang index cffe2cc14e8..efb5b645a3d 100644 --- a/htdocs/langs/fr_FR/trips.lang +++ b/htdocs/langs/fr_FR/trips.lang @@ -29,7 +29,7 @@ ExpenseReportApprovedMessage=La note de frais %s a été approuvée.
- Utilis ExpenseReportRefused=Une note de frais a été refusée ExpenseReportRefusedMessage=La note de frais %s a été refusée.
- Utilisateur : %s
- Refusée par : %s
- Motif du refus : %s
Cliquez ici pour afficher la note de frais: %s ExpenseReportCanceled=Une note de frais a été annulée -ExpenseReportCanceledMessage=La note de frais %s a été annulée.
- Utilisateur : %s
- Annulée par : %s
- Motif de l'annulation :%s
Cliquez ici pour afficher la note de frais %s +ExpenseReportCanceledMessage=La note de frais %s a été annulée.
- Utilisateur : %s
- Annulée par : %s
- Motif de l'annulation : %s
Cliquez ici pour afficher la note de frais %s ExpenseReportPaid=Une note de frais a été réglée ExpenseReportPaidMessage=La note de frais %s a été réglée.
- Utilisateur : %s
- Réglée par : %s
Cliquez ici pour afficher la note de frais %s TripId=Id note de frais From f4ae8696782fb7e35c34fd749a470e8fd5cdebfe Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 19 Jan 2020 12:15:47 +0100 Subject: [PATCH 394/462] Fix error return when creating order with not enough stock --- htdocs/commande/class/commande.class.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 434d43e8ffa..7d8e2680977 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -936,6 +936,7 @@ class Commande extends CommonOrder if ($result != self::STOCK_NOT_ENOUGH_FOR_ORDER) { $this->error=$this->db->lasterror(); + $this->errors[] = $this->error; dol_print_error($this->db); } $this->db->rollback(); @@ -1412,7 +1413,8 @@ class Commande extends CommonOrder if (! empty($conf->global->STOCK_MUST_BE_ENOUGH_FOR_ORDER) && $product_type == 0 && $product->stock_reel < $qty) { $langs->load("errors"); - $this->error=$langs->trans('ErrorStockIsNotEnoughToAddProductOnOrder', $product->ref); + $this->error = $langs->trans('ErrorStockIsNotEnoughToAddProductOnOrder', $product->ref); + $this->errors[] = $this->error; dol_syslog(get_class($this)."::addline error=Product ".$product->ref.": ".$this->error, LOG_ERR); $this->db->rollback(); return self::STOCK_NOT_ENOUGH_FOR_ORDER; @@ -3053,7 +3055,8 @@ class Commande extends CommonOrder if (! empty($conf->global->STOCK_MUST_BE_ENOUGH_FOR_ORDER) && $product_type == 0 && $product->stock_reel < $qty) { $langs->load("errors"); - $this->error=$langs->trans('ErrorStockIsNotEnoughToAddProductOnOrder', $product->ref); + $this->error = $langs->trans('ErrorStockIsNotEnoughToAddProductOnOrder', $product->ref); + $this->errors[] = $this->error; dol_syslog(get_class($this)."::addline error=Product ".$product->ref.": ".$this->error, LOG_ERR); $this->db->rollback(); return self::STOCK_NOT_ENOUGH_FOR_ORDER; From 00cddc39fd33b0d6685f04143ebeec3a5a9d9622 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 19 Jan 2020 13:56:16 +0100 Subject: [PATCH 395/462] Fix remove some orphelins in llx_ecm_files --- htdocs/install/mysql/migration/repair.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/install/mysql/migration/repair.sql b/htdocs/install/mysql/migration/repair.sql index 51fe48dcda2..73cb1e6592d 100755 --- a/htdocs/install/mysql/migration/repair.sql +++ b/htdocs/install/mysql/migration/repair.sql @@ -177,6 +177,8 @@ delete from llx_categorie_member where fk_categorie not in (select rowid from ll delete from llx_categorie_contact where fk_categorie not in (select rowid from llx_categorie where type = 4); delete from llx_categorie_project where fk_categorie not in (select rowid from llx_categorie where type = 6); +-- Fix: delete orphelins in ecm_files +delete from llx_ecm_files where src_object_type = 'expensereport' and src_object_id NOT IN (select rowid from llx_expensereport); -- Fix: delete orphelin deliveries. Note: deliveries are linked to shipment by llx_element_element only. No other links. delete from llx_livraisondet where fk_livraison not in (select fk_target from llx_element_element where targettype = 'delivery') AND fk_livraison not in (select fk_source from llx_element_element where sourcetype = 'delivery'); From 6a958dd45b9fbb0a47c2254253344526408edace Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 19 Jan 2020 18:51:37 +0100 Subject: [PATCH 396/462] FIX XSS vulnerability in description of list of audit events. --- htdocs/admin/tools/listevents.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/admin/tools/listevents.php b/htdocs/admin/tools/listevents.php index d508afe63d2..29f3f8fc7fb 100644 --- a/htdocs/admin/tools/listevents.php +++ b/htdocs/admin/tools/listevents.php @@ -199,9 +199,9 @@ if ($result) $i = 0; $param=''; - if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; - if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; - if ($optioncss != '') $param.='&optioncss='.$optioncss; + if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage); + if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit); + if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss); if ($search_code) $param.='&search_code='.urlencode($search_code); if ($search_ip) $param.='&search_ip='.urlencode($search_ip); if ($search_user) $param.='&search_user='.urlencode($search_user); @@ -303,18 +303,19 @@ if ($result) // Description print '
'; $text=$langs->trans($obj->description); + $reg = array(); if (preg_match('/\((.*)\)(.*)/i', $obj->description, $reg)) { $val=explode(',', $reg[1]); $text=$langs->trans($val[0], isset($val[1])?$val[1]:'', isset($val[2])?$val[2]:'', isset($val[3])?$val[3]:'', isset($val[4])?$val[4]:''); if (! empty($reg[2])) $text.=$reg[2]; } - print $text; + print dol_string_nohtmltag($text); print ''; - $htmltext=''.$langs->trans("UserAgent").': '.($obj->user_agent?$obj->user_agent:$langs->trans("Unknown")); + $htmltext=''.$langs->trans("UserAgent").': '.($obj->user_agent ? dol_string_nohtmltag($obj->user_agent) : $langs->trans("Unknown")); print $form->textwithpicto('', $htmltext); print '
"; print ''; // TODO Replace this with mass delete action -if ($user->rights->mouvements->creer) +if ($user->rights->accounting->mouvements->creer) { print '
' . "\n"; print '' . $langs->trans("DeleteMvt") . ''; From b4758295e149723b629b95a6c3d53c95c2aff749 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 21 Jan 2020 10:59:57 +0100 Subject: [PATCH 400/462] fix stripe/charge.php for connect mode with payment intent --- htdocs/stripe/charge.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/stripe/charge.php b/htdocs/stripe/charge.php index 9d4bf71c040..3483efcaa18 100644 --- a/htdocs/stripe/charge.php +++ b/htdocs/stripe/charge.php @@ -142,7 +142,7 @@ if (!$rowid) } if (! empty($charge->payment_intent)) { - $charge = \Stripe\PaymentIntent::retrieve($charge->payment_intent); + $charge = \Stripe\PaymentIntent::retrieve($charge->payment_intent, array("stripe_account" => $stripeacc)); } // The metadata FULLTAG is defined by the online payment page From d6766af35d3e83c4d5132b8791b54c1801b2af02 Mon Sep 17 00:00:00 2001 From: John Botella Date: Tue, 21 Jan 2020 14:17:53 +0100 Subject: [PATCH 401/462] Fix dom and missing param --- htdocs/core/class/commonobject.class.php | 3 ++- htdocs/core/class/html.form.class.php | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index bf39cc1e94d..d4735e4ba8d 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -5932,7 +5932,8 @@ abstract class CommonObject { $param_list=array_keys($param['options']); // $param_list='ObjectName:classPath' $showempty=(($required && $default != '')?0:1); - $out=$form->selectForForms($param_list[0], $keyprefix.$key.$keysuffix, $value, $showempty); + $out=$form->selectForForms($param_list[0], $keyprefix.$key.$keysuffix, $value, $showempty, '', '', $morecss, $moreparam); + if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { list($class,$classfile)=explode(':', $param_list[0]); diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 3f9a6827e49..cb46be383db 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5044,11 +5044,11 @@ class Form { if ($societe_vendeuse->id == $mysoc->id) { - $return.= ''.$langs->trans("ErrorYourCountryIsNotDefined").'
'; + $return.= '
'.$langs->trans("ErrorYourCountryIsNotDefined").'
'; } else { - $return.= ''.$langs->trans("ErrorSupplierCountryIsNotDefined").''; + $return.= '
'.$langs->trans("ErrorSupplierCountryIsNotDefined").'
'; } return $return; } From c91ab621b848180c0954043eb0d63e0c8081dfd2 Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Tue, 21 Jan 2020 17:49:27 +0100 Subject: [PATCH 402/462] FIX length, width and height coherence in product table --- htdocs/product/class/product.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 47b190ed4f7..aa6dd5e08a8 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -819,9 +819,9 @@ class Product extends CommonObject $this->height = price2num($this->height); $this->height_units = trim($this->height_units); // set unit not defined - if ($this->length_units) { $this->width_units = $this->length_units; // Not used yet + if (is_numeric($this->length_units)) { $this->width_units = $this->length_units; // Not used yet } - if ($this->length_units) { $this->height_units = $this->length_units; // Not used yet + if (is_numeric($this->length_units)) { $this->height_units = $this->length_units; // Not used yet } // Automated compute surface and volume if not filled if (empty($this->surface) && !empty($this->length) && !empty($this->width) && $this->length_units == $this->width_units) { From 443e4e22230f4c069c58d5da73e5f70076aecfa3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 22 Jan 2020 13:44:42 +0100 Subject: [PATCH 403/462] Update html.form.class.php --- htdocs/core/class/html.form.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index cb46be383db..acbd15712e5 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5044,11 +5044,11 @@ class Form { if ($societe_vendeuse->id == $mysoc->id) { - $return.= '
'.$langs->trans("ErrorYourCountryIsNotDefined").'
'; + $return.= ''.$langs->trans("ErrorYourCountryIsNotDefined").''; } else { - $return.= '
'.$langs->trans("ErrorSupplierCountryIsNotDefined").'
'; + $return.= ''.$langs->trans("ErrorSupplierCountryIsNotDefined").''; } return $return; } From 999e36344616c199a8cf5ebb3ba28831f369036e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 22 Jan 2020 13:52:37 +0100 Subject: [PATCH 404/462] Update charge.php --- htdocs/stripe/charge.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/stripe/charge.php b/htdocs/stripe/charge.php index 3483efcaa18..992b5266b5b 100644 --- a/htdocs/stripe/charge.php +++ b/htdocs/stripe/charge.php @@ -142,7 +142,11 @@ if (!$rowid) } if (! empty($charge->payment_intent)) { - $charge = \Stripe\PaymentIntent::retrieve($charge->payment_intent, array("stripe_account" => $stripeacc)); + if (empty($stripeacc)) { // If the Stripe connect account not set, we use common API usage + $charge = \Stripe\PaymentIntent::retrieve($charge->payment_intent); + } else { + $charge = \Stripe\PaymentIntent::retrieve($charge->payment_intent, array("stripe_account" => $stripeacc)); + } } // The metadata FULLTAG is defined by the online payment page From fc894d7a2002f2687955d1fe8653f27e9afeabe8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 22 Jan 2020 13:53:20 +0100 Subject: [PATCH 405/462] Fix for stripe connect --- htdocs/public/payment/newpayment.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index dbceb483f97..729a8c68be6 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -658,7 +658,7 @@ if ($action == 'charge' && ! empty($conf->stripe->enabled)) \Stripe\Stripe::setApiKey($stripearrayofkeysbyenv[$servicestatus]['secret_key']); try { - if (empty($key)) { // If the Stripe connect account not set, we use common API usage + if (empty($stripeacc)) { // If the Stripe connect account not set, we use common API usage $paymentintent = \Stripe\PaymentIntent::retrieve($paymentintent_id); } else { $paymentintent = \Stripe\PaymentIntent::retrieve($paymentintent_id, array("stripe_account" => $stripeacc)); From 28d0b85b84e15299a576fa0ac4674f33efaf2a63 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 22 Jan 2020 14:56:19 +0100 Subject: [PATCH 406/462] Fix phpcs --- htdocs/core/lib/pdf.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 56b7f54d609..c1489a1b751 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -2143,7 +2143,7 @@ function pdf_getLinkedObjects($object, $outputlangs) $linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("InterRef"); $linkedobjects[$objecttype]['ref_value'] = $outputlangs->transnoentities($elementobject->ref); $linkedobjects[$objecttype]['date_title'] = $outputlangs->transnoentities("InterDate"); - $linkedobjects[$objecttype]['date_value'] = dol_print_date($elementobject->datec,'day','',$outputlangs); + $linkedobjects[$objecttype]['date_value'] = dol_print_date($elementobject->datec, 'day', '', $outputlangs); } } elseif ($objecttype == 'shipping') From 7964699674f0e92cd859f873ac0dec512d4e94ad Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 22 Jan 2020 16:22:53 +0100 Subject: [PATCH 407/462] FIX Check on unicity on prof id was not triggered sometimes --- htdocs/societe/class/societe.class.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index f1d489751ac..793cbbbb97e 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -3284,6 +3284,12 @@ class Societe extends CommonObject // Define if third party is treated as company (or not) when nature is unknown $isacompany=empty($conf->global->MAIN_UNKNOWN_CUSTOMERS_ARE_COMPANIES)?0:1; // 0 by default if (! empty($this->tva_intra)) $isacompany=1; + elseif (! empty($this->idprof1)) $isacompany=1; + elseif (! empty($this->idprof2)) $isacompany=1; + elseif (! empty($this->idprof3)) $isacompany=1; + elseif (! empty($this->idprof4)) $isacompany=1; + elseif (! empty($this->idprof5)) $isacompany=1; + elseif (! empty($this->idprof6)) $isacompany=1; elseif (! empty($this->typent_code) && $this->typent_code != 'TE_UNKNOWN') { // TODO Add a field is_a_company into dictionary From 381f2d5eee3e41c896e608e9ea3ebb21c5cd334d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 22 Jan 2020 16:24:16 +0100 Subject: [PATCH 408/462] Fix typo --- htdocs/societe/class/societe.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 793cbbbb97e..dd6765e34f5 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -769,7 +769,7 @@ class Societe extends CommonObject } } - // Check for mandatory prof id (but only if country is other than ours) + // Check for mandatory prof id (but only if country is same than ours) if ($mysoc->country_id > 0 && $this->country_id == $mysoc->country_id) { $idprof_mandatory ='SOCIETE_'.$key.'_MANDATORY'; From 5eeef771fac4fa5e81ddec1e31d0a7e01800b156 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Thu, 23 Jan 2020 06:20:31 +0100 Subject: [PATCH 409/462] FIX: FEC export format --- .../class/accountancyexport.class.php | 10 +++---- htdocs/core/lib/functions.lib.php | 29 +++++++++++++++++++ 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index dcf59be27f3..df120e90d09 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -658,9 +658,9 @@ class AccountancyExport print $end_line; foreach ( $objectLines as $line ) { - $date_creation = dol_print_date($line->date_creation, '%d%m%Y'); - $date_doc = dol_print_date($line->doc_date, '%d%m%Y'); - $date_valid = dol_print_date($line->date_validated, '%d%m%Y'); + $date_creation = dol_print_date($line->date_creation, '%Y%m%d'); + $date_doc = dol_print_date($line->doc_date, '%Y%m%d'); + $date_valid = dol_print_date($line->date_validated, '%Y%m%d'); // FEC:JournalCode print $line->code_journal . $separator; @@ -696,10 +696,10 @@ class AccountancyExport print $line->label_operation . $separator; // FEC:Debit - print price2num($line->debit) . $separator; + print price2fec($line->debit) . $separator; // FEC:Credit - print price2num($line->credit) . $separator; + print price2fec($line->credit) . $separator; // FEC:EcritureLet print $line->lettering_code . $separator; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 89bd0622f5f..0ec230d1b87 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -4523,6 +4523,35 @@ function price2num($amount,$rounding='',$alreadysqlnb=0) return $amount; } +/** + * Function to format a value into a defined format for French administration (no thousand separator & decimal separator force to ',' with two decimals) + * Function used into accountancy FEC export + * + * @param float $amount Amount to format + * @return string Chain with formatted upright + * + * @see price2num() Revert function of price2fec + */ +function price2fec($amount) +{ + global $conf; + + // Clean parameters + if (empty($amount)) $amount=0; // To have a numeric value if amount not defined or = '' + $amount = (is_numeric($amount)?$amount:0); // Check if amount is numeric, for example, an error occured when amount value = o (letter) instead 0 (number) + + // Output decimal number by default (french) + $nbdecimal= 2; + + // Output separators by default (french) + $dec=','; $thousand=''; + + // Format number + $output=number_format($amount, $nbdecimal, $dec, $thousand); + + return $output; +} + /** * Output a dimension with best unit From 7f47b48559f1f3aa0cf27e0e556d10523e6e26be Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Thu, 23 Jan 2020 11:47:30 +0100 Subject: [PATCH 410/462] Move function to functions2.lib.php --- .../class/accountancyexport.class.php | 1 + htdocs/core/lib/functions.lib.php | 30 ------------------- htdocs/core/lib/functions2.lib.php | 29 ++++++++++++++++++ 3 files changed, 30 insertions(+), 30 deletions(-) diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index df120e90d09..742c3ac721c 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -38,6 +38,7 @@ */ require_once DOL_DOCUMENT_ROOT . '/core/lib/functions.lib.php'; +require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php'; class AccountancyExport { diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 0ec230d1b87..a16faa50f46 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -4523,36 +4523,6 @@ function price2num($amount,$rounding='',$alreadysqlnb=0) return $amount; } -/** - * Function to format a value into a defined format for French administration (no thousand separator & decimal separator force to ',' with two decimals) - * Function used into accountancy FEC export - * - * @param float $amount Amount to format - * @return string Chain with formatted upright - * - * @see price2num() Revert function of price2fec - */ -function price2fec($amount) -{ - global $conf; - - // Clean parameters - if (empty($amount)) $amount=0; // To have a numeric value if amount not defined or = '' - $amount = (is_numeric($amount)?$amount:0); // Check if amount is numeric, for example, an error occured when amount value = o (letter) instead 0 (number) - - // Output decimal number by default (french) - $nbdecimal= 2; - - // Output separators by default (french) - $dec=','; $thousand=''; - - // Format number - $output=number_format($amount, $nbdecimal, $dec, $thousand); - - return $output; -} - - /** * Output a dimension with best unit * diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index 41d8758cca0..b271a092c90 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -2340,3 +2340,32 @@ function random_color($min=0, $max=255) { return random_color_part($min, $max) . random_color_part($min, $max) . random_color_part($min, $max); } + +/** + * Function to format a value into a defined format for French administration (no thousand separator & decimal separator force to ',' with two decimals) + * Function used into accountancy FEC export + * + * @param float $amount Amount to format + * @return string Chain with formatted upright + * + * @see price2num() Revert function of price2fec + */ +function price2fec($amount) +{ + global $conf; + + // Clean parameters + if (empty($amount)) $amount=0; // To have a numeric value if amount not defined or = '' + $amount = (is_numeric($amount)?$amount:0); // Check if amount is numeric, for example, an error occured when amount value = o (letter) instead 0 (number) + + // Output decimal number by default (french) + $nbdecimal= 2; + + // Output separators by default (french) + $dec=','; $thousand=''; + + // Format number + $output=number_format($amount, $nbdecimal, $dec, $thousand); + + return $output; +} From 1487158082e499ac844e5d0b1613a09a6d3d17e4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 23 Jan 2020 12:02:29 +0100 Subject: [PATCH 411/462] Update functions2.lib.php --- htdocs/core/lib/functions2.lib.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index b271a092c90..f9678c2f569 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -2356,16 +2356,17 @@ function price2fec($amount) // Clean parameters if (empty($amount)) $amount=0; // To have a numeric value if amount not defined or = '' - $amount = (is_numeric($amount)?$amount:0); // Check if amount is numeric, for example, an error occured when amount value = o (letter) instead 0 (number) + $amount = (is_numeric($amount) ? $amount : 0); // Check if amount is numeric, for example, an error occured when amount value = o (letter) instead 0 (number) - // Output decimal number by default (french) - $nbdecimal= 2; + // Output decimal number by default + $nbdecimal = (empty($conf->global->ACCOUNTING_FEC_DECIMAL_LENGTH) ? 2 : $conf->global->ACCOUNTING_FEC_DECIMAL_LENGTH); - // Output separators by default (french) - $dec=','; $thousand=''; + // Output separators by default + $dec = (empty($conf->global->ACCOUNTING_FEC_DECIMAL_SEPARATOR) ? ',' : $conf->global->ACCOUNTING_FEC_DECIMAL_SEPARATOR); + $thousand = (empty($conf->global->ACCOUNTING_FEC_THOUSAND_SEPARATOR) ? '' : $conf->global->ACCOUNTING_FEC_THOUSAND_SEPARATOR); // Format number - $output=number_format($amount, $nbdecimal, $dec, $thousand); + $output = number_format($amount, $nbdecimal, $dec, $thousand); return $output; } From cbe396b97c0596af8a958c990e3af5f2c523ab54 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 23 Jan 2020 12:04:14 +0100 Subject: [PATCH 412/462] Update functions2.lib.php --- htdocs/core/lib/functions2.lib.php | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index f9678c2f569..37bc6c1cd5e 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -2320,9 +2320,9 @@ function getModuleDirForApiClass($module) /* * Return 2 hexa code randomly * - * @param $min int Between 0 and 255 - * @param $max int Between 0 and 255 - * @return String + * @param int $min Between 0 and 255 + * @param int $max Between 0 and 255 + * @return String Color string */ function random_color_part($min=0,$max=255) { @@ -2332,9 +2332,9 @@ function random_color_part($min=0,$max=255) /* * Return hexadecimal color randomly * - * @param $min int Between 0 and 255 - * @param $max int Between 0 and 255 - * @return String + * @param int $min Between 0 and 255 + * @param int $max Between 0 and 255 + * @return String Color string */ function random_color($min=0, $max=255) { @@ -2346,9 +2346,8 @@ function random_color($min=0, $max=255) * Function used into accountancy FEC export * * @param float $amount Amount to format - * @return string Chain with formatted upright - * - * @see price2num() Revert function of price2fec + * @return string Chain with formatted upright + * @see price2num() Format a numeric into a price for FEC files */ function price2fec($amount) { From 7ee37ddd3ff7871e6d58b7bc90edaa74a661a78d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 23 Jan 2020 17:30:05 +0100 Subject: [PATCH 413/462] FIX Error in log for email sending with smtps was not complete --- htdocs/core/class/smtps.class.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/smtps.class.php b/htdocs/core/class/smtps.class.php index 1ade95098fa..4415aad3b9a 100644 --- a/htdocs/core/class/smtps.class.php +++ b/htdocs/core/class/smtps.class.php @@ -506,8 +506,9 @@ class SMTPs // The error here just means the ID/password combo doesn't work. // There is not a method to determine which is the problem, ID or password - if ( ! $_retVal = $this->socket_send_str(base64_encode($this->_smtpsPW), '235') ) - $this->_setErr(130, 'Invalid Authentication Credentials.'); + if (! $_retVal = $this->socket_send_str(base64_encode($this->_smtpsPW), '235') ) { + $this->_setErr(130, 'Invalid Authentication Credentials.'); + } } else { @@ -575,8 +576,12 @@ class SMTPs // From this point onward most server response codes should be 250 // Specify who the mail is from.... // This has to be the raw email address, strip the "name" off - $this->socket_send_str('MAIL FROM: ' . $this->getFrom('addr'), '250'); - + $resultmailfrom = $this->socket_send_str('MAIL FROM: ' . $this->getFrom('addr'), '250'); + if (! $resultmailfrom) { + fclose($this->socket); + return false; + } + // 'RCPT TO:' must be given a single address, so this has to loop // through the list of addresses, regardless of TO, CC or BCC // and send it out "single file" @@ -1786,6 +1791,7 @@ class SMTPs $_retVal = false; break; } + $this->log .= $server_response; $limit++; } From 210e0511d0fdf95e78efb4ecef2e2bf5ee0d6098 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Thu, 23 Jan 2020 17:45:16 +0100 Subject: [PATCH 414/462] fix create SEPA withdraw with limit select and working pagination --- htdocs/compta/prelevement/create.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index 34da3336bcc..66dd6338c9d 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -193,6 +193,7 @@ else } print "\n"; +print ''; print '
'; @@ -221,6 +222,11 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); + if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 + { + $page = 0; + $offset = 0; + } } $sql.= $db->plimit($limit+1, $offset); @@ -236,11 +242,12 @@ if ($resql) if($socid) $param .= '&socid='.urlencode($socid); if($option) $param .= "&option=".urlencode($option); - if(! empty($page) && $num <= $nbtotalofrecords) $page = 0; - print '
'; print ''; - print ''; + print ''; + if (! empty($limit)) { + print ''; + } print_barre_liste($langs->trans("InvoiceWaitingWithdraw"), $page, $_SERVER['PHP_SELF'], $param, '', '', '', $num, $nbtotalofrecords, 'title_accountancy.png', 0, '', '', $limit); @@ -300,6 +307,7 @@ if ($resql) } else print '
'.$langs->trans("None").'
"; + print ''; print ""; print "
\n"; } From 5ad5578f4059d0952fe6672c18a00c67a5ab384c Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Thu, 23 Jan 2020 17:47:00 +0100 Subject: [PATCH 415/462] fix create SEPA withdraw with limit select and working pagination --- htdocs/compta/prelevement/create.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index 66dd6338c9d..eec72ee4b1e 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -307,7 +307,6 @@ if ($resql) } else print ''.$langs->trans("None").''; print ""; - print ''; print ""; print "
\n"; } From 62caf3cbfc1d6f1e72514a57ea6a11156c87c61c Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Thu, 23 Jan 2020 17:59:50 +0100 Subject: [PATCH 416/462] fix create SEPA withdraw with limit select and working pagination --- htdocs/compta/prelevement/demandes.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/compta/prelevement/demandes.php b/htdocs/compta/prelevement/demandes.php index 6c1ea278430..da1b3663d21 100644 --- a/htdocs/compta/prelevement/demandes.php +++ b/htdocs/compta/prelevement/demandes.php @@ -140,8 +140,6 @@ else $newcardbutton = ''.$langs->trans("Back").''; -print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_generic', 0, $newcardbutton, '', $limit); - print '
'; if ($optioncss != '') print ''; print ''; @@ -152,6 +150,7 @@ print ''; print ''; print ''; +print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_generic', 0, $newcardbutton, '', $limit); print ''; From 1f18c93b9f79fd1542b68e5da02de4e97b28432f Mon Sep 17 00:00:00 2001 From: gauthier Date: Fri, 24 Jan 2020 12:06:22 +0100 Subject: [PATCH 417/462] FIX : thirdparty alias name desappeared if we change country with THIRDPARTY_SUGGEST_ALSO_ADDRESS_CREATION conf --- htdocs/societe/card.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 3f7b97fee73..d277632c348 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -950,6 +950,7 @@ else if (! empty($conf->fournisseur->enabled) && (GETPOST("type")=='f' || (GETPOST("type")=='' && ! empty($conf->global->THIRDPARTY_SUPPLIER_BY_DEFAULT)))) { $object->fournisseur=1; } $object->name = GETPOST('name', 'alpha'); + $object->name_alias = GETPOST('name_alias', 'alpha'); $object->firstname = GETPOST('firstname', 'alpha'); $object->particulier = $private; $object->prefix_comm = GETPOST('prefix_comm', 'alpha'); From f5395fa859bf6423e46faaa06e4db60cc1f4def1 Mon Sep 17 00:00:00 2001 From: atm-greg Date: Fri, 24 Jan 2020 14:28:08 +0100 Subject: [PATCH 418/462] fix lost name_alias on country selection --- htdocs/societe/card.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 3f7b97fee73..d277632c348 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -950,6 +950,7 @@ else if (! empty($conf->fournisseur->enabled) && (GETPOST("type")=='f' || (GETPOST("type")=='' && ! empty($conf->global->THIRDPARTY_SUPPLIER_BY_DEFAULT)))) { $object->fournisseur=1; } $object->name = GETPOST('name', 'alpha'); + $object->name_alias = GETPOST('name_alias', 'alpha'); $object->firstname = GETPOST('firstname', 'alpha'); $object->particulier = $private; $object->prefix_comm = GETPOST('prefix_comm', 'alpha'); From f63893a90cf4600b5436e17cf71def45e9bbd647 Mon Sep 17 00:00:00 2001 From: atm-greg Date: Fri, 24 Jan 2020 15:10:57 +0100 Subject: [PATCH 419/462] FIX date filter not used if no operator --- htdocs/contrat/services_list.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/htdocs/contrat/services_list.php b/htdocs/contrat/services_list.php index 07b5cceee1a..93c09d7f256 100644 --- a/htdocs/contrat/services_list.php +++ b/htdocs/contrat/services_list.php @@ -242,9 +242,17 @@ if ($search_contract) $sql.= " AND c.ref LIKE '%".$db->escape($search_contract). if ($search_service) $sql.= " AND (p.ref LIKE '%".$db->escape($search_service)."%' OR p.description LIKE '%".$db->escape($search_service)."%' OR cd.description LIKE '%".$db->escape($search_service)."%')"; if ($socid > 0) $sql.= " AND s.rowid = ".$socid; $filter_dateouvertureprevue=dol_mktime(0, 0, 0, $opouvertureprevuemonth, $opouvertureprevueday, $opouvertureprevueyear); +if ($filter_dateouvertureprevue != '' && $filter_opouvertureprevue == -1) $filter_opouvertureprevue = '='; + $filter_date1=dol_mktime(0, 0, 0, $op1month, $op1day, $op1year); +if ($filter_date1 != '' && $filter_op1 == -1) $filter_op1 = '='; + $filter_date2=dol_mktime(0, 0, 0, $op2month, $op2day, $op2year); +if ($filter_date2 != '' && $filter_op2 == -1) $filter_op2 = '='; + $filter_datecloture=dol_mktime(0, 0, 0, $opcloturemonth, $opclotureday, $opclotureyear); +if ($filter_datecloture != '' && $filter_opcloture == -1) $filter_opcloture = '='; + if (! empty($filter_opouvertureprevue) && $filter_opouvertureprevue != -1 && $filter_dateouvertureprevue != '') $sql.= " AND cd.date_ouverture_prevue ".$filter_opouvertureprevue." '".$db->idate($filter_dateouvertureprevue)."'"; if (! empty($filter_op1) && $filter_op1 != -1 && $filter_date1 != '') $sql.= " AND cd.date_ouverture ".$filter_op1." '".$db->idate($filter_date1)."'"; if (! empty($filter_op2) && $filter_op2 != -1 && $filter_date2 != '') $sql.= " AND cd.date_fin_validite ".$filter_op2." '".$db->idate($filter_date2)."'"; @@ -253,6 +261,8 @@ if (! empty($filter_opcloture) && $filter_opcloture != -1 && $filter_datecloture include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; $sql .= $db->order($sortfield, $sortorder); +//print $sql; + $nbtotalofrecords = ''; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { From 4222639702d0bab73fd1a0f2576caa2a06af7a89 Mon Sep 17 00:00:00 2001 From: gauthier Date: Fri, 24 Jan 2020 15:32:59 +0100 Subject: [PATCH 420/462] FIX : Extrafield position in export field list must respect "pos" field --- htdocs/core/extrafieldsinexport.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/extrafieldsinexport.inc.php b/htdocs/core/extrafieldsinexport.inc.php index 78dbba9934e..e9d10138d1e 100644 --- a/htdocs/core/extrafieldsinexport.inc.php +++ b/htdocs/core/extrafieldsinexport.inc.php @@ -8,7 +8,7 @@ if (empty($keyforselect) || empty($keyforelement) || empty($keyforaliasextra)) } // Add extra fields -$sql="SELECT name, label, type, param, fieldcomputed, fielddefault FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = '".$keyforselect."' AND type != 'separate' AND entity IN (0, ".$conf->entity.')'; +$sql="SELECT name, label, type, param, fieldcomputed, fielddefault FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = '".$keyforselect."' AND type != 'separate' AND entity IN (0, ".$conf->entity.') ORDER BY pos ASC'; //print $sql; $resql=$this->db->query($sql); if ($resql) // This can fail when class is used on old database (during migration for example) From c64acb1a9c414c577fc275e2382174b0ec5a8438 Mon Sep 17 00:00:00 2001 From: Pierre Ardoin <32256817+mapiolca@users.noreply.github.com> Date: Sat, 25 Jan 2020 15:19:46 +0100 Subject: [PATCH 421/462] Permissions Issue fixes an issue that displayed the "restricted area" banner despite user permissions. --- htdocs/compta/tva/document.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/tva/document.php b/htdocs/compta/tva/document.php index 8e4962a6351..8ea2de95efa 100644 --- a/htdocs/compta/tva/document.php +++ b/htdocs/compta/tva/document.php @@ -49,7 +49,7 @@ $confirm = GETPOST('confirm', 'alpha'); // Security check if ($user->societe_id) $socid=$user->societe_id; -$result = restrictedArea($user, 'tax', $id, 'vat', 'charges'); +$result = restrictedArea($user, 'tax', '', 'vat', 'charges'); // Get parameters From ecaacc9543d023babf437bfdd4c0918f5dd8b6c4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 26 Jan 2020 23:27:47 +0100 Subject: [PATCH 422/462] FIX #12875 --- htdocs/fourn/ajax/getSupplierPrices.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/fourn/ajax/getSupplierPrices.php b/htdocs/fourn/ajax/getSupplierPrices.php index 85b0ed37155..495337ade14 100644 --- a/htdocs/fourn/ajax/getSupplierPrices.php +++ b/htdocs/fourn/ajax/getSupplierPrices.php @@ -84,16 +84,16 @@ if ($idprod > 0) } } - // Add price for costprice - $price=$producttmp->cost_price; - $prices[] = array("id" => 'costprice', "price" => price2num($price), "label" => $langs->trans("CostPrice").': '.price($price, 0, $langs, 0, 0, -1, $conf->currency), "title" => $langs->trans("PMPValueShort").': '.price($price, 0, $langs, 0, 0, -1, $conf->currency)); // For price field, we must use price2num(), for label or title, price() - if(!empty($conf->stock->enabled)) { // Add price for pmp $price=$producttmp->pmp; $prices[] = array("id" => 'pmpprice', "price" => price2num($price), "label" => $langs->trans("PMPValueShort").': '.price($price, 0, $langs, 0, 0, -1, $conf->currency), "title" => $langs->trans("PMPValueShort").': '.price($price, 0, $langs, 0, 0, -1, $conf->currency)); // For price field, we must use price2num(), for label or title, price() } + + // Add price for costprice + $price=$producttmp->cost_price; + $prices[] = array("id" => 'costprice', "price" => price2num($price), "label" => $langs->trans("CostPrice").': '.price($price, 0, $langs, 0, 0, -1, $conf->currency), "title" => $langs->trans("PMPValueShort").': '.price($price, 0, $langs, 0, 0, -1, $conf->currency)); // For price field, we must use price2num(), for label or title, price() } echo json_encode($prices); From e0c8fce229cb7a4bd5561dc8ead2e1e870317503 Mon Sep 17 00:00:00 2001 From: Pierre Ardoin <32256817+mapiolca@users.noreply.github.com> Date: Mon, 27 Jan 2020 09:39:38 +0100 Subject: [PATCH 423/462] Fix link direction for late supplier invoices Before : $response->url_late always == $response->url After : if $response->nbtodolate >= 1 : $response->url_late redirects to list with only late unpaid supplier invoices. --- htdocs/fourn/class/fournisseur.facture.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 91310ef9138..b62190686b3 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -2231,6 +2231,7 @@ class FactureFournisseur extends CommonInvoice if ($facturestatic->hasDelay()) { $response->nbtodolate++; + $response->url_late=DOL_URL_ROOT.'/fourn/facture/list.php?option=late&mainmenu=billing&leftmenu=suppliers_bills'; } } $this->db->free($resql); From 4cb423e5c7bb40e787b0af2b8e2cde139bc5ca00 Mon Sep 17 00:00:00 2001 From: Pierre Ardoin <32256817+mapiolca@users.noreply.github.com> Date: Mon, 27 Jan 2020 09:49:49 +0100 Subject: [PATCH 424/462] Add un specific link to late invoices Before : $response->url_late always == $response->url After : if $response->nbtodolate >= 1 : $response->url_late redirects to list with only late unpaid customer invoices. --- htdocs/compta/facture/class/facture.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 3bbf150d72f..b397ff7939f 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -3902,6 +3902,7 @@ class Facture extends CommonInvoice if ($generic_facture->hasDelay()) { $response->nbtodolate++; + $response->url_late=DOL_URL_ROOT.'/compta/facture/list.php?search_option=late&mainmenu=billing&leftmenu=customers_bills'; } } From 7cdd334995a855982c936f7e0ead519f8afa7573 Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Tue, 28 Jan 2020 11:37:23 +0100 Subject: [PATCH 425/462] FIX require category class in extrafield --- htdocs/core/class/extrafields.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index c2c7752e994..9400c64de85 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1321,6 +1321,7 @@ class ExtraFields print 'Error in request ' . $sql . ' ' . $this->db->lasterror() . '. Check setup of extra parameters.
'; } } else { + require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; $data = $form->select_all_categories(Categorie::$MAP_ID_TO_CODE[$InfoFieldList[5]], '', 'parent', 64, $InfoFieldList[6], 1, 1); $out .= ''; foreach ($data as $data_key => $data_value) { @@ -1548,6 +1549,7 @@ class ExtraFields print 'Error in request ' . $sql . ' ' . $this->db->lasterror() . '. Check setup of extra parameters.
'; } } else { + require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; $data = $form->select_all_categories(Categorie::$MAP_ID_TO_CODE[$InfoFieldList[5]], '', 'parent', 64, $InfoFieldList[6], 1, 1); $out = $form->multiselectarray($keyprefix . $key . $keysuffix, $data, $value_arr, '', 0, '', 0, '100%'); } @@ -1628,7 +1630,7 @@ class ExtraFields if ($hidden) return ''; // This is a protection. If field is hidden, we should just not call this method. //if ($computed) $value = // $value is already calculated into $value before calling this method - + $showsize=0; if ($type == 'date') { From 8af5d87e80e1bfda9acf71f44ac7433da55b59e6 Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Tue, 28 Jan 2020 17:13:09 +0100 Subject: [PATCH 426/462] FIX regex for include or exclude categories in full arbo --- htdocs/categories/class/categorie.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index f31e8f9b048..6edb069ef6e 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -1080,7 +1080,7 @@ class Categorie extends CommonObject // Include or exclude leaf including $markafterid from tree if (count($markafterid) > 0) { - $keyfiltercatid = implode('|', $markafterid); + $keyfiltercatid = '(' . implode('|', $markafterid) . ')'; //print "Look to discard category ".$markafterid."\n"; $keyfilter1 = '^' . $keyfiltercatid . '$'; From bffdc63ec65065f24bd0914f5de8084ed15a37e3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 28 Jan 2020 17:44:05 +0100 Subject: [PATCH 427/462] FIX The "automatic bind" was linked EEC to export accountancy code Conflicts: htdocs/accountancy/supplier/index.php --- htdocs/accountancy/customer/index.php | 2 ++ htdocs/accountancy/supplier/index.php | 16 +++++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/htdocs/accountancy/customer/index.php b/htdocs/accountancy/customer/index.php index aa3a8d691dd..ab2c00d13b0 100644 --- a/htdocs/accountancy/customer/index.php +++ b/htdocs/accountancy/customer/index.php @@ -153,6 +153,8 @@ if ($action == 'validatehistory') { while ($i < min($num_lines, 10000)) { // No more than 10000 at once $objp = $db->fetch_object($result); + $isBuyerInEEC = isInEEC($objp); + // Search suggested account for product/service $suggestedaccountingaccountfor = ''; if (($objp->country_code == $mysoc->country_code) || empty($objp->country_code)) { // If buyer in same country than seller (if not defined, we assume it is same country) diff --git a/htdocs/accountancy/supplier/index.php b/htdocs/accountancy/supplier/index.php index f1bf4377f42..8cb752aef4c 100644 --- a/htdocs/accountancy/supplier/index.php +++ b/htdocs/accountancy/supplier/index.php @@ -141,13 +141,15 @@ if ($action == 'validatehistory') { setEventMessages($db->lasterror(), null, 'errors'); } else { $num_lines = $db->num_rows($result); - + $isSellerInEEC = isInEEC($mysoc); - + $i = 0; while ($i < min($num_lines, 10000)) { // No more than 10000 at once $objp = $db->fetch_object($result); - + + $isBuyerInEEC = isInEEC($objp); + // Search suggested account for product/service $suggestedaccountingaccountfor = ''; if (($objp->country_code == $mysoc->country_code) || empty($objp->country_code)) { // If buyer in same country than seller (if not defined, we assume it is same country) @@ -169,13 +171,13 @@ if ($action == 'validatehistory') { $suggestedaccountingaccountfor = 'export'; } } - + if ($objp->aarowid_suggest > 0) { $sqlupdate = "UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det"; $sqlupdate.= " SET fk_code_ventilation = ".$objp->aarowid_suggest; $sqlupdate.= " WHERE fk_code_ventilation <= 0 AND product_type <= 2 AND rowid = ".$objp->rowid; - + $resqlupdate = $db->query($sqlupdate); if (! $resqlupdate) { @@ -184,11 +186,11 @@ if ($action == 'validatehistory') { break; } } - + $i++; } } - + if ($error) { $db->rollback(); From 782be2ac3797c3f5d5fb4d7f00d5f3e82f93690b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 28 Jan 2020 17:50:08 +0100 Subject: [PATCH 428/462] FIX Invert isSellerInEEC and isBuyerInEEC --- htdocs/accountancy/supplier/index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/supplier/index.php b/htdocs/accountancy/supplier/index.php index 8cb752aef4c..eb81e4909d9 100644 --- a/htdocs/accountancy/supplier/index.php +++ b/htdocs/accountancy/supplier/index.php @@ -142,13 +142,13 @@ if ($action == 'validatehistory') { } else { $num_lines = $db->num_rows($result); - $isSellerInEEC = isInEEC($mysoc); + $isBuyerInEEC = isInEEC($mysoc); $i = 0; while ($i < min($num_lines, 10000)) { // No more than 10000 at once $objp = $db->fetch_object($result); - $isBuyerInEEC = isInEEC($objp); + $isSellerInEEC = isInEEC($objp); // Search suggested account for product/service $suggestedaccountingaccountfor = ''; From b04bb9e392738366665a5d0c593762a16092b940 Mon Sep 17 00:00:00 2001 From: altairis Date: Wed, 29 Jan 2020 11:05:10 +0100 Subject: [PATCH 429/462] FIX : fetching account on current entity --- htdocs/accountancy/class/accountingaccount.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index 55e463a73f6..c85fa48fe72 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -178,6 +178,7 @@ class AccountingAccount extends CommonObject if (! empty($limittoachartaccount)) { $sql .= " AND a.fk_pcg_version = '".$this->db->escape($limittoachartaccount)."'"; } + $sql.= " AND a.entity = ".$conf->entity; dol_syslog(get_class($this) . "::fetch sql=" . $sql, LOG_DEBUG); $result = $this->db->query($sql); From 3c3876eb595cb20bc4bfb98800613212cc2312b2 Mon Sep 17 00:00:00 2001 From: altairis Date: Wed, 29 Jan 2020 11:32:24 +0100 Subject: [PATCH 430/462] FIX : default lang selection when filter --- htdocs/core/class/html.formadmin.class.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/html.formadmin.class.php b/htdocs/core/class/html.formadmin.class.php index 166e0ce2044..0ab3b2f9e55 100644 --- a/htdocs/core/class/html.formadmin.class.php +++ b/htdocs/core/class/html.formadmin.class.php @@ -95,12 +95,9 @@ class FormAdmin if ($showcode == 1) $valuetoshow=$key.' - '.$value; if ($showcode == 2) $valuetoshow=$value.' ('.$key.')'; - if ($filter && is_array($filter)) + if ($filter && is_array($filter) && array_key_exists($key, $filter)) { - if ( ! array_key_exists($key, $filter)) - { - $out.= ''; - } + continue; } elseif ($selected == $key) { From 5d2130a5aec3ae306d3f323c977b656fa20c18ca Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 29 Jan 2020 11:38:06 +0100 Subject: [PATCH 431/462] Fix SQL injection --- htdocs/resource/class/dolresource.class.php | 6 +++--- htdocs/resource/list.php | 14 ++++++-------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/htdocs/resource/class/dolresource.class.php b/htdocs/resource/class/dolresource.class.php index 13cbf37c34a..9abbf297370 100644 --- a/htdocs/resource/class/dolresource.class.php +++ b/htdocs/resource/class/dolresource.class.php @@ -533,7 +533,7 @@ class Dolresource extends CommonObject $sql.= $value; } else { - $sql.= ' AND '.$key.' LIKE \'%'.$value.'%\''; + $sql.= ' AND '.$key.' LIKE \'%'.$this->db->escape($value).'%\''; } } } @@ -617,7 +617,7 @@ class Dolresource extends CommonObject $sql.= ' AND '.$key.' = \''.$this->db->idate($value).'\''; } else { - $sql.= ' AND '.$key.' LIKE \'%'.$value.'%\''; + $sql.= ' AND '.$key.' LIKE \'%'.$this->db->escape($value).'%\''; } } } @@ -699,7 +699,7 @@ class Dolresource extends CommonObject $sql.= ' AND '.$key.' = \''.$this->db->idate($value).'\''; } else { - $sql.= ' AND '.$key.' LIKE \'%'.$value.'%\''; + $sql.= ' AND '.$key.' LIKE \'%'.$this->db->escape($value).'%\''; } } } diff --git a/htdocs/resource/list.php b/htdocs/resource/list.php index d9547ad441b..7490bd42a51 100644 --- a/htdocs/resource/list.php +++ b/htdocs/resource/list.php @@ -18,7 +18,7 @@ */ /** - * \file resource/index.php + * \file resource/list.php * \ingroup resource * \brief Page to manage resource objects */ @@ -52,20 +52,19 @@ $extrafields = new ExtraFields($db); $extralabels=$extrafields->fetch_name_optionals_label($object->table_element); $search_array_options=$extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); if (! is_array($search_array_options)) $search_array_options = array(); -$search_ref=GETPOST("search_ref"); -$search_type=GETPOST("search_type"); +$search_ref = GETPOST("search_ref", 'alpha'); +$search_type = GETPOST("search_type", 'alpha'); $filter=array(); if ($search_ref != ''){ - $param.='&search_ref='.$search_ref; + $param.='&search_ref='.urlencode($search_ref); $filter['t.ref']=$search_ref; } if ($search_type != ''){ - $param.='&search_type='.$search_type; + $param.='&search_type='.urlencode($search_type); $filter['ty.label']=$search_type; } -if ($search_label != '') $param.='&search_label='.$search_label; // Add $param from extra fields foreach ($search_array_options as $key => $val) { @@ -83,7 +82,7 @@ foreach ($search_array_options as $key => $val) $filter['ef.'.$tmpkey] = natural_search('ef.'.$tmpkey, $crit, $mode_search); } } -if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; +if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage); $hookmanager->initHooks(array('resourcelist')); @@ -133,7 +132,6 @@ include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // Both test are required to be compatible with all browsers { $search_ref=""; - $search_label=""; $search_type=""; $search_array_options=array(); $filter=array(); From f1ea0ce5a160ac9a998039fa9ee71fb52ee966ee Mon Sep 17 00:00:00 2001 From: altairis Date: Wed, 29 Jan 2020 11:47:23 +0100 Subject: [PATCH 432/462] better fix --- htdocs/accountancy/class/accountingaccount.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index c85fa48fe72..52f71378025 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -171,6 +171,7 @@ class AccountingAccount extends CommonObject $sql .= " a.rowid = " . (int) $rowid; } elseif ($account_number) { $sql .= " a.account_number = '" . $this->db->escape($account_number) . "'"; + $sql .= " AND a.entity = ".$conf->entity; } if (! empty($limittocurrentchart)) { $sql .= ' AND a.fk_pcg_version IN (SELECT pcg_version FROM ' . MAIN_DB_PREFIX . 'accounting_system WHERE rowid=' . $this->db->escape($conf->global->CHARTOFACCOUNTS) . ')'; @@ -178,7 +179,6 @@ class AccountingAccount extends CommonObject if (! empty($limittoachartaccount)) { $sql .= " AND a.fk_pcg_version = '".$this->db->escape($limittoachartaccount)."'"; } - $sql.= " AND a.entity = ".$conf->entity; dol_syslog(get_class($this) . "::fetch sql=" . $sql, LOG_DEBUG); $result = $this->db->query($sql); From 0229cd3c6587720f210faa5ecacc07c597170cd6 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sat, 1 Feb 2020 08:18:48 +0100 Subject: [PATCH 433/462] FIX: FEC export have specific name --- htdocs/accountancy/tpl/export_journal.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/tpl/export_journal.tpl.php b/htdocs/accountancy/tpl/export_journal.tpl.php index 97f0da548ca..d2961670923 100644 --- a/htdocs/accountancy/tpl/export_journal.tpl.php +++ b/htdocs/accountancy/tpl/export_journal.tpl.php @@ -35,7 +35,7 @@ $endaccountingperiod = dol_print_date(dol_now(), '%Y%m%d'); header('Content-Type: text/csv'); -if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == "11" && $type_export == "general_ledger") // Specific filename for FEC model export into the general ledger +if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == "1000" && $type_export == "general_ledger") // Specific filename for FEC model export into the general ledger { // FEC format is defined here: https://www.legifrance.gouv.fr/affichCodeArticle.do?idArticle=LEGIARTI000027804775&cidTexte=LEGITEXT000006069583&dateTexte=20130802&oldAction=rechCodeArticle if (empty($search_date_end)) From 7c35e9aaa862f7b8b50c2f22aa0af2e830c8a9ac Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 3 Feb 2020 03:55:37 +0100 Subject: [PATCH 434/462] FIX #12932 --- htdocs/core/class/CMailFile.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 4d796bbcd07..402b19701d7 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -485,7 +485,7 @@ class CMailFile $res=false; - if (empty($conf->global->MAIN_DISABLE_ALL_MAILS) || !empty($conf->global->MAIN_MAIL_FORCE_SENDTO)) + if (empty($conf->global->MAIN_DISABLE_ALL_MAILS)) { require_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php'; $hookmanager = new HookManager($db); From 2813c9d4b4a663265b5c45a858bc3265b8bc5b6a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 3 Feb 2020 06:31:40 +0100 Subject: [PATCH 435/462] FIX #12973 --- htdocs/includes/tecnickcom/tcpdf/tcpdf.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/includes/tecnickcom/tcpdf/tcpdf.php b/htdocs/includes/tecnickcom/tcpdf/tcpdf.php index 24ef434ab8a..f5a6b9aa931 100644 --- a/htdocs/includes/tecnickcom/tcpdf/tcpdf.php +++ b/htdocs/includes/tecnickcom/tcpdf/tcpdf.php @@ -6846,7 +6846,7 @@ class TCPDF { } // check if file exist and it is valid if (!@TCPDF_STATIC::file_exists($file)) { - return false; + //return false; } if (($imsize = @getimagesize($file)) === FALSE) { if (in_array($file, $this->imagekeys)) { From bc3a210d12add514e6f96f1ec61bef5f6bd2a995 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 3 Feb 2020 11:46:18 +0100 Subject: [PATCH 436/462] FIX compatibility with multicompany (avoid duplicate data) --- htdocs/holiday/class/holiday.class.php | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 66a118c744b..1e3567549a9 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -1658,19 +1658,19 @@ class Holiday extends CommonObject { // Si utilisateur de Dolibarr - $sql = "SELECT u.rowid"; + $sql = "SELECT DISTINCT u.rowid"; $sql.= " FROM ".MAIN_DB_PREFIX."user as u"; if (! empty($conf->multicompany->enabled) && ! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { - $sql.= ", ".MAIN_DB_PREFIX."usergroup_user as ug"; - $sql.= " WHERE (ug.fk_user = u.rowid"; - $sql.= " AND ug.entity = ".$conf->entity.")"; - $sql.= " OR u.admin = 1"; + $sql.= ",".MAIN_DB_PREFIX."usergroup_user as ug"; + $sql.= " WHERE ((ug.fk_user = u.rowid"; + $sql.= " AND ug.entity IN (".getEntity('user')."))"; + $sql.= " OR u.entity = 0)"; // Show always superadmin } else { - $sql.= " WHERE u.entity IN (0,".$conf->entity.")"; + $sql.= " WHERE u.entity IN (".getEntity('user').")"; } $sql.= " AND u.statut > 0"; if ($filters) $sql.=$filters; @@ -1754,18 +1754,20 @@ class Holiday extends CommonObject // List for Dolibarr users if ($type) { - $sql = "SELECT u.rowid, u.lastname, u.firstname, u.gender, u.photo, u.employee, u.statut, u.fk_user"; + $sql = "SELECT DISTINCT u.rowid, u.lastname, u.firstname, u.gender, u.photo, u.employee, u.statut, u.fk_user"; $sql.= " FROM ".MAIN_DB_PREFIX."user as u"; if (! empty($conf->multicompany->enabled) && ! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { - $sql.= ", ".MAIN_DB_PREFIX."usergroup_user as ug"; - $sql.= " WHERE (ug.fk_user = u.rowid"; - $sql.= " AND ug.entity = ".$conf->entity.")"; - $sql.= " OR u.admin = 1"; + $sql.= ",".MAIN_DB_PREFIX."usergroup_user as ug"; + $sql.= " WHERE ((ug.fk_user = u.rowid"; + $sql.= " AND ug.entity IN (".getEntity('user')."))"; + $sql.= " OR u.entity = 0)"; // Show always superadmin } else - $sql.= " WHERE u.entity IN (0,".$conf->entity.")"; + { + $sql.= " WHERE u.entity IN (".getEntity('user').")"; + } $sql.= " AND u.statut > 0"; if ($filters) $sql.=$filters; From e74e63941d6914241a60d5855a891cda1d9a14e8 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 3 Feb 2020 11:55:55 +0100 Subject: [PATCH 437/462] FIX use "usergroup" instead "user" --- htdocs/holiday/class/holiday.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 1e3567549a9..31723379314 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -1665,7 +1665,7 @@ class Holiday extends CommonObject { $sql.= ",".MAIN_DB_PREFIX."usergroup_user as ug"; $sql.= " WHERE ((ug.fk_user = u.rowid"; - $sql.= " AND ug.entity IN (".getEntity('user')."))"; + $sql.= " AND ug.entity IN (".getEntity('usergroup')."))"; $sql.= " OR u.entity = 0)"; // Show always superadmin } else @@ -1761,7 +1761,7 @@ class Holiday extends CommonObject { $sql.= ",".MAIN_DB_PREFIX."usergroup_user as ug"; $sql.= " WHERE ((ug.fk_user = u.rowid"; - $sql.= " AND ug.entity IN (".getEntity('user')."))"; + $sql.= " AND ug.entity IN (".getEntity('usergroup')."))"; $sql.= " OR u.entity = 0)"; // Show always superadmin } else From bf4fca0c7e9ff9c4cc6962598fc0e45f0d42e3ff Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 3 Feb 2020 22:09:21 +0100 Subject: [PATCH 438/462] Fix warning --- htdocs/core/tpl/extrafields_list_search_sql.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/extrafields_list_search_sql.tpl.php b/htdocs/core/tpl/extrafields_list_search_sql.tpl.php index bdaf963b4f5..59b73b4c861 100644 --- a/htdocs/core/tpl/extrafields_list_search_sql.tpl.php +++ b/htdocs/core/tpl/extrafields_list_search_sql.tpl.php @@ -10,7 +10,7 @@ if (empty($conf) || ! is_object($conf)) if (empty($extrafieldsobjectkey) && is_object($object)) $extrafieldsobjectkey=$object->table_element; // Loop to complete the sql search criterias from extrafields -if (! empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_element like 'societe', 'socpeople', ... +if (! empty($extrafieldsobjectkey) && ! empty($search_array_options) && is_array($search_array_options)) // $extrafieldsobject is the $object->table_element like 'societe', 'socpeople', ... { foreach ($search_array_options as $key => $val) { From d93a597a1eb62db89392aa44b79b73ba19e7c6bb Mon Sep 17 00:00:00 2001 From: Pierre Ardoin <32256817+mapiolca@users.noreply.github.com> Date: Tue, 4 Feb 2020 09:17:02 +0100 Subject: [PATCH 439/462] Fix Compatbility with Multicompany Before : Show all projects of all entities Now : Show only projects that are allowed by permissions --- htdocs/core/boxes/box_project.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/core/boxes/box_project.php b/htdocs/core/boxes/box_project.php index e7281708802..5e06e154987 100644 --- a/htdocs/core/boxes/box_project.php +++ b/htdocs/core/boxes/box_project.php @@ -3,6 +3,7 @@ * Copyright (C) 2014 Marcos García * Copyright (C) 2015 Frederic France * Copyright (C) 2016 Juan José Menent + * Copyright (C) 2020 Pierre Ardoin * * 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 @@ -99,6 +100,7 @@ class box_project extends ModeleBoxes $sql = "SELECT p.rowid, p.ref, p.title, p.fk_statut, p.public"; $sql.= " FROM ".MAIN_DB_PREFIX."projet as p"; $sql.= " WHERE p.fk_statut = 1"; // Only open projects + $sql .= " AND entity IN (".getEntity('projet').")"; // Only current entity or severals if permission ok if (! $user->rights->projet->all->lire) $sql.= " AND p.rowid IN (".$projectsListId.")"; // public and assigned to, or restricted to company for external users $sql.= " ORDER BY p.datec DESC"; From 262d889700ac6fb2fb149c149799ccfedcce133e Mon Sep 17 00:00:00 2001 From: Pierre Ardoin <32256817+mapiolca@users.noreply.github.com> Date: Wed, 5 Feb 2020 08:50:51 +0100 Subject: [PATCH 440/462] Update box_project.php --- htdocs/core/boxes/box_project.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/boxes/box_project.php b/htdocs/core/boxes/box_project.php index 5e06e154987..d3670d05ee1 100644 --- a/htdocs/core/boxes/box_project.php +++ b/htdocs/core/boxes/box_project.php @@ -100,7 +100,7 @@ class box_project extends ModeleBoxes $sql = "SELECT p.rowid, p.ref, p.title, p.fk_statut, p.public"; $sql.= " FROM ".MAIN_DB_PREFIX."projet as p"; $sql.= " WHERE p.fk_statut = 1"; // Only open projects - $sql .= " AND entity IN (".getEntity('projet').")"; // Only current entity or severals if permission ok + $sql .= " AND entity IN (".getEntity('project').")"; // Only current entity or severals if permission ok if (! $user->rights->projet->all->lire) $sql.= " AND p.rowid IN (".$projectsListId.")"; // public and assigned to, or restricted to company for external users $sql.= " ORDER BY p.datec DESC"; From d5b74a8ca3d1fc210c0d60160cf8e2d42415f125 Mon Sep 17 00:00:00 2001 From: Pierre Ardoin <32256817+mapiolca@users.noreply.github.com> Date: Wed, 5 Feb 2020 09:06:43 +0100 Subject: [PATCH 441/462] Update box_project.php --- htdocs/core/boxes/box_project.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/boxes/box_project.php b/htdocs/core/boxes/box_project.php index d3670d05ee1..ca9618aab9a 100644 --- a/htdocs/core/boxes/box_project.php +++ b/htdocs/core/boxes/box_project.php @@ -100,7 +100,7 @@ class box_project extends ModeleBoxes $sql = "SELECT p.rowid, p.ref, p.title, p.fk_statut, p.public"; $sql.= " FROM ".MAIN_DB_PREFIX."projet as p"; $sql.= " WHERE p.fk_statut = 1"; // Only open projects - $sql .= " AND entity IN (".getEntity('project').")"; // Only current entity or severals if permission ok + $sql.= " WHERE entity IN (".getEntity('project').")"; // Only current entity or severals if permission ok if (! $user->rights->projet->all->lire) $sql.= " AND p.rowid IN (".$projectsListId.")"; // public and assigned to, or restricted to company for external users $sql.= " ORDER BY p.datec DESC"; From 81ed70ffc7ac61844088e1e664324e5fdacb8e78 Mon Sep 17 00:00:00 2001 From: Pierre Ardoin <32256817+mapiolca@users.noreply.github.com> Date: Wed, 5 Feb 2020 09:18:39 +0100 Subject: [PATCH 442/462] Update box_project.php --- htdocs/core/boxes/box_project.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/boxes/box_project.php b/htdocs/core/boxes/box_project.php index ca9618aab9a..071e4b013ec 100644 --- a/htdocs/core/boxes/box_project.php +++ b/htdocs/core/boxes/box_project.php @@ -99,8 +99,8 @@ class box_project extends ModeleBoxes $sql = "SELECT p.rowid, p.ref, p.title, p.fk_statut, p.public"; $sql.= " FROM ".MAIN_DB_PREFIX."projet as p"; - $sql.= " WHERE p.fk_statut = 1"; // Only open projects - $sql.= " WHERE entity IN (".getEntity('project').")"; // Only current entity or severals if permission ok + $sql.= " WHERE entity IN (".getEntity('project').")"; // Only current entity or severals if permission ok + $sql.= " AND p.fk_statut = 1"; // Only open projects if (! $user->rights->projet->all->lire) $sql.= " AND p.rowid IN (".$projectsListId.")"; // public and assigned to, or restricted to company for external users $sql.= " ORDER BY p.datec DESC"; From c3cf9e62b3bad4145fa1f145f9863e84c2b046df Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Wed, 5 Feb 2020 11:31:02 +0100 Subject: [PATCH 443/462] FIX links in products/services index --- htdocs/product/index.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/product/index.php b/htdocs/product/index.php index caeb5e5d873..246d50e5c3e 100644 --- a/htdocs/product/index.php +++ b/htdocs/product/index.php @@ -143,31 +143,31 @@ print '
'; - $statProducts.= ''; + $statProducts.= ''; $statProducts.= ""; $statProducts.= ''; - $statProducts.= ''; + $statProducts.= ''; $statProducts.= ""; $statProducts.= ''; - $statProducts.= ''; + $statProducts.= ''; $statProducts.= ""; $statProducts.= ''; - $statProducts.= ''; + $statProducts.= ''; $statProducts.= ""; } if (! empty($conf->service->enabled)) { $statServices = ''; - $statServices.= ''; + $statServices.= ''; $statServices.= ""; $statServices.= ''; - $statServices.= ''; + $statServices.= ''; $statServices.= ""; $statServices.= ''; - $statServices.= ''; + $statServices.= ''; $statServices.= ""; $statServices.= ''; - $statServices.= ''; + $statServices.= ''; $statServices.= ""; } $total=0; From 63ba601906cb9e0fda349dd06f0968bc48f3330b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Feb 2020 12:39:00 +0100 Subject: [PATCH 444/462] Update box_project.php --- htdocs/core/boxes/box_project.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/boxes/box_project.php b/htdocs/core/boxes/box_project.php index 071e4b013ec..9b3920590d2 100644 --- a/htdocs/core/boxes/box_project.php +++ b/htdocs/core/boxes/box_project.php @@ -99,7 +99,7 @@ class box_project extends ModeleBoxes $sql = "SELECT p.rowid, p.ref, p.title, p.fk_statut, p.public"; $sql.= " FROM ".MAIN_DB_PREFIX."projet as p"; - $sql.= " WHERE entity IN (".getEntity('project').")"; // Only current entity or severals if permission ok + $sql.= " WHERE p.entity IN (".getEntity('project').")"; // Only current entity or severals if permission ok $sql.= " AND p.fk_statut = 1"; // Only open projects if (! $user->rights->projet->all->lire) $sql.= " AND p.rowid IN (".$projectsListId.")"; // public and assigned to, or restricted to company for external users From d35994e5db1a79ddea4babe94f466589f8b8a69a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Feb 2020 13:25:51 +0100 Subject: [PATCH 445/462] Update holiday.class.php --- htdocs/holiday/class/holiday.class.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 31723379314..78210d08bc9 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -1656,9 +1656,12 @@ class Holiday extends CommonObject { if ($type) { - // Si utilisateur de Dolibarr - - $sql = "SELECT DISTINCT u.rowid"; + // If user of Dolibarr + $sql = "SELECT"; + if (! empty($conf->multicompany->enabled) && ! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { + $sql .= " DISTINCT"; + } + $sql.= " u.rowid"; $sql.= " FROM ".MAIN_DB_PREFIX."user as u"; if (! empty($conf->multicompany->enabled) && ! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) From c101c3dd55ec96f86e23c29618f6a1c4e0ef05ad Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Feb 2020 13:27:22 +0100 Subject: [PATCH 446/462] Update holiday.class.php --- htdocs/holiday/class/holiday.class.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 78210d08bc9..04ccf239766 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -1757,7 +1757,12 @@ class Holiday extends CommonObject // List for Dolibarr users if ($type) { - $sql = "SELECT DISTINCT u.rowid, u.lastname, u.firstname, u.gender, u.photo, u.employee, u.statut, u.fk_user"; + // If user of Dolibarr + $sql = "SELECT"; + if (! empty($conf->multicompany->enabled) && ! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { + $sql .= " DISTINCT"; + } + $sql = " u.rowid, u.lastname, u.firstname, u.gender, u.photo, u.employee, u.statut, u.fk_user"; $sql.= " FROM ".MAIN_DB_PREFIX."user as u"; if (! empty($conf->multicompany->enabled) && ! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) From 9100b8a5486857f964b577e9c81d612ea6253317 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Feb 2020 13:41:10 +0100 Subject: [PATCH 447/462] FIX SQL request and phpunit --- htdocs/holiday/class/holiday.class.php | 2 +- test/phpunit/HolidayTest.php | 20 ++++++++------------ 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 66a118c744b..0c058313ad6 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -1712,7 +1712,7 @@ class Holiday extends CommonObject // We want only list of vacation balance for user ids $sql = "SELECT DISTINCT cpu.fk_user"; $sql.= " FROM ".MAIN_DB_PREFIX."holiday_users as cpu, ".MAIN_DB_PREFIX."user as u"; - $sql.= " WHERE cpu.fk_user = u.user"; + $sql.= " WHERE cpu.fk_user = u.rowid"; if ($filters) $sql.=$filters; $resql=$this->db->query($sql); diff --git a/test/phpunit/HolidayTest.php b/test/phpunit/HolidayTest.php index ce3312ba441..190496cf5bf 100644 --- a/test/phpunit/HolidayTest.php +++ b/test/phpunit/HolidayTest.php @@ -247,21 +247,17 @@ class HolidayTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - //$localobject->fetch($localobject->id); + $result = $localobject->fetchUsers(true, true, ''); + $this->assertNotEquals($result, -1); - /* - $result=$localobject->getNomUrl(1); - print __METHOD__." id=".$localobject->id." result=".$result."\n"; - $this->assertNotEquals($result, ''); + $result = $localobject->fetchUsers(true, false, ''); + $this->assertNotEquals($result, -1); - $result=$localobject->getFullAddress(1); - print __METHOD__." id=".$localobject->id." result=".$result."\n"; - $this->assertContains("New address\nNew zip New town\nBelgium", $result); + $result = $localobject->fetchUsers(false, true, ''); + $this->assertNotEquals($result, -1); - $localobject->info($localobject->id); - print __METHOD__." localobject->date_creation=".$localobject->date_creation."\n"; - $this->assertNotEquals($localobject->date_creation, ''); - */ + $result = $localobject->fetchUsers(false, false, ''); + $this->assertNotEquals($result, -1); return $localobject->id; } From a36cf1f86beb63cfe5bda715885bc06bce8ebfd9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Feb 2020 14:08:13 +0100 Subject: [PATCH 448/462] Fix phpunit --- htdocs/holiday/class/holiday.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 1bbeb869995..25f1d9675bb 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -1762,7 +1762,7 @@ class Holiday extends CommonObject if (! empty($conf->multicompany->enabled) && ! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { $sql .= " DISTINCT"; } - $sql = " u.rowid, u.lastname, u.firstname, u.gender, u.photo, u.employee, u.statut, u.fk_user"; + $sql.= " u.rowid, u.lastname, u.firstname, u.gender, u.photo, u.employee, u.statut, u.fk_user"; $sql.= " FROM ".MAIN_DB_PREFIX."user as u"; if (! empty($conf->multicompany->enabled) && ! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) From 1ef978ccc4a0eb21ecb649e15f11ff05d5fe0070 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Feb 2020 19:32:49 +0100 Subject: [PATCH 449/462] FIX #12966 --- htdocs/theme/md/style.css.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 65436182755..1681c48e4e1 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -923,7 +923,8 @@ div.fiche>form>div.div-table-responsive { flex-grow: 1; flex-shrink: 1; /* flex-basis: 140px; */ - min-width: 150px; + /* min-width: 150px; */ + width: 158px; justify-content: flex-start; align-self: flex-start; } From bd6d49f04a5ff374f4631950443518d51cbbed66 Mon Sep 17 00:00:00 2001 From: atm-arnaud Date: Thu, 6 Feb 2020 12:08:50 +0100 Subject: [PATCH 450/462] FIX advanced target emailing sql and ergonomy --- htdocs/comm/mailing/class/advtargetemailing.class.php | 2 +- htdocs/core/tpl/advtarget.tpl.php | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/mailing/class/advtargetemailing.class.php b/htdocs/comm/mailing/class/advtargetemailing.class.php index ed04192d0e9..6eaddb799cf 100644 --- a/htdocs/comm/mailing/class/advtargetemailing.class.php +++ b/htdocs/comm/mailing/class/advtargetemailing.class.php @@ -141,7 +141,7 @@ class AdvanceTargetingMailing extends CommonObject $sql.= " ".(! isset($this->filtervalue)?'NULL':"'".$this->db->escape($this->filtervalue)."'").","; $sql.= " ".$user->id.","; $sql.= " '".$this->db->idate(dol_now())."',"; - $sql.= " null"; + $sql.= " ".$user->id; $sql.= ")"; $this->db->begin(); diff --git a/htdocs/core/tpl/advtarget.tpl.php b/htdocs/core/tpl/advtarget.tpl.php index 2c351996632..b6c9033cad4 100644 --- a/htdocs/core/tpl/advtarget.tpl.php +++ b/htdocs/core/tpl/advtarget.tpl.php @@ -73,7 +73,10 @@ print '
'.$langs->trans("Statistics").'product->enabled)) { $statProducts = '
'.$langs->trans("ProductsNotOnSell").''.round($prodser[0][0]).''.$langs->trans("ProductsNotOnSell").''.round($prodser[0][0]).'
'.$langs->trans("ProductsOnSaleOnly").''.round($prodser[0][1]).''.$langs->trans("ProductsOnSaleOnly").''.round($prodser[0][1]).'
'.$langs->trans("ProductsOnPurchaseOnly").''.round($prodser[0][2]).''.$langs->trans("ProductsOnPurchaseOnly").''.round($prodser[0][2]).'
'.$langs->trans("ProductsOnSellAndOnBuy").''.round($prodser[0][3]).''.$langs->trans("ProductsOnSellAndOnBuy").''.round($prodser[0][3]).'
'.$langs->trans("ServicesNotOnSell").''.round($prodser[1][0]).''.$langs->trans("ServicesNotOnSell").''.round($prodser[1][0]).'
'.$langs->trans("ServicesOnSaleOnly").''.round($prodser[1][1]).''.$langs->trans("ServicesOnSaleOnly").''.round($prodser[1][1]).'
'.$langs->trans("ServicesOnPurchaseOnly").''.round($prodser[1][2]).''.$langs->trans("ServicesOnPurchaseOnly").''.round($prodser[1][2]).'
'.$langs->trans("ServicesOnSellAndOnBuy").''.round($prodser[1][3]).''.$langs->trans("ServicesOnSellAndOnBuy").''.round($prodser[1][3]).'