diff --git a/.mailmap b/.mailmap index 436b557ee63..ae4b0eb7146 100644 --- a/.mailmap +++ b/.mailmap @@ -21,9 +21,9 @@ Florian Henry FHenry Florian HENRY Florian Henry FHenry Florian Henry HENRY Florian -Alexandre Spangaro aspangaro -Alexandre Spangaro Spangaro Alexandre -Alexandre Spangaro Alexandre SPANGARO +Alexandre Spangaro aspangaro +Alexandre Spangaro Spangaro Alexandre +Alexandre Spangaro Alexandre SPANGARO Raphaël Doursenaud Raphaël Doursenaud Philippe Grand Grand Philippe Philippe Grand Philippe GRAND diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index 9e163bd0541..3f55ccf8431 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -1,6 +1,6 @@ - * Copyright (C) 2013-2017 Alexandre Spangaro + * Copyright (C) 2013-2017 Alexandre Spangaro * Copyright (C) 2016-2018 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/accountancy/admin/accountmodel.php b/htdocs/accountancy/admin/accountmodel.php index fc4406714c0..4b663146fce 100644 --- a/htdocs/accountancy/admin/accountmodel.php +++ b/htdocs/accountancy/admin/accountmodel.php @@ -8,7 +8,7 @@ * Copyright (C) 2011 Remy Younes * Copyright (C) 2012-2015 Marcos García * Copyright (C) 2012 Christophe Battarel - * Copyright (C) 2011-2016 Alexandre Spangaro + * Copyright (C) 2011-2016 Alexandre Spangaro * Copyright (C) 2015 Ferran Marcet * Copyright (C) 2016 Raphaël Doursenaud * diff --git a/htdocs/accountancy/admin/card.php b/htdocs/accountancy/admin/card.php index bcea246706d..6d43f01b03f 100644 --- a/htdocs/accountancy/admin/card.php +++ b/htdocs/accountancy/admin/card.php @@ -1,6 +1,6 @@ - * Copyright (C) 2013-2018 Alexandre Spangaro + * Copyright (C) 2013-2018 Alexandre Spangaro * Copyright (C) 2014 Florian Henry * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/accountancy/admin/categories.php b/htdocs/accountancy/admin/categories.php index 9bcc43dcc7e..21e53d5c928 100644 --- a/htdocs/accountancy/admin/categories.php +++ b/htdocs/accountancy/admin/categories.php @@ -1,6 +1,6 @@ - * Copyright (C) 2017 Alexandre Spangaro + * Copyright (C) 2017 Alexandre Spangaro * * 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 diff --git a/htdocs/accountancy/admin/categories_list.php b/htdocs/accountancy/admin/categories_list.php index 9aea3045b40..9c2be8091a6 100644 --- a/htdocs/accountancy/admin/categories_list.php +++ b/htdocs/accountancy/admin/categories_list.php @@ -1,6 +1,6 @@ - * Copyright (C) 2011-2017 Alexandre Spangaro + * Copyright (C) 2011-2017 Alexandre Spangaro * * 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 diff --git a/htdocs/accountancy/admin/export.php b/htdocs/accountancy/admin/export.php index 6ef4bdda90b..21fef9a1930 100644 --- a/htdocs/accountancy/admin/export.php +++ b/htdocs/accountancy/admin/export.php @@ -1,6 +1,6 @@ - * Copyright (C) 2013-2017 Alexandre Spangaro + * Copyright (C) 2013-2017 Alexandre Spangaro * Copyright (C) 2014 Florian Henry * Copyright (C) 2014 Marcos García * Copyright (C) 2014 Juanjo Menent diff --git a/htdocs/accountancy/admin/fiscalyear.php b/htdocs/accountancy/admin/fiscalyear.php index dd8bed921d0..9bce886420d 100644 --- a/htdocs/accountancy/admin/fiscalyear.php +++ b/htdocs/accountancy/admin/fiscalyear.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2013-2018 Alexandre Spangaro * * 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 diff --git a/htdocs/accountancy/admin/fiscalyear_card.php b/htdocs/accountancy/admin/fiscalyear_card.php index febb4cecadd..3c10e1a9068 100644 --- a/htdocs/accountancy/admin/fiscalyear_card.php +++ b/htdocs/accountancy/admin/fiscalyear_card.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2014-2016 Alexandre Spangaro * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/accountancy/admin/fiscalyear_info.php b/htdocs/accountancy/admin/fiscalyear_info.php index b2a8019cc59..86b01fa7397 100644 --- a/htdocs/accountancy/admin/fiscalyear_info.php +++ b/htdocs/accountancy/admin/fiscalyear_info.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2014-2016 Alexandre Spangaro * * 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 diff --git a/htdocs/accountancy/admin/importaccounts.php b/htdocs/accountancy/admin/importaccounts.php index 243e19965cd..930028ae274 100644 --- a/htdocs/accountancy/admin/importaccounts.php +++ b/htdocs/accountancy/admin/importaccounts.php @@ -1,6 +1,6 @@ - * Copyright (C) 2013-2017 Alexandre Spangaro + * Copyright (C) 2013-2017 Alexandre Spangaro * Copyright (C) 2014 Florian Henry * Copyright (C) 2018 Frédéric France * diff --git a/htdocs/accountancy/admin/index.php b/htdocs/accountancy/admin/index.php index 536b3c38148..b3b8a67241b 100644 --- a/htdocs/accountancy/admin/index.php +++ b/htdocs/accountancy/admin/index.php @@ -1,7 +1,7 @@ * Copyright (C) 2013-2014 Florian Henry - * Copyright (C) 2013-2018 Alexandre Spangaro + * Copyright (C) 2013-2018 Alexandre Spangaro * Copyright (C) 2014-2015 Ari Elbaz (elarifr) * Copyright (C) 2014 Marcos García * Copyright (C) 2014 Juanjo Menent diff --git a/htdocs/accountancy/admin/journals_list.php b/htdocs/accountancy/admin/journals_list.php index 080a23d6aca..f1c014860d0 100644 --- a/htdocs/accountancy/admin/journals_list.php +++ b/htdocs/accountancy/admin/journals_list.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2017 Alexandre Spangaro * * 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 diff --git a/htdocs/accountancy/admin/productaccount.php b/htdocs/accountancy/admin/productaccount.php index 19506c82f63..df4af8a0a12 100644 --- a/htdocs/accountancy/admin/productaccount.php +++ b/htdocs/accountancy/admin/productaccount.php @@ -1,6 +1,6 @@ - * Copyright (C) 2013-2016 Alexandre Spangaro + * Copyright (C) 2013-2016 Alexandre Spangaro * Copyright (C) 2014 Florian Henry * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2015 Ari Elbaz (elarifr) diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php index b76e42bdd90..b797d86e3c7 100644 --- a/htdocs/accountancy/bookkeeping/balance.php +++ b/htdocs/accountancy/bookkeeping/balance.php @@ -1,7 +1,7 @@ * Copyright (C) 2016 Florian Henry - * Copyright (C) 2016-2018 Alexandre Spangaro + * Copyright (C) 2016-2018 Alexandre Spangaro * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/accountancy/bookkeeping/balancebymonth.php b/htdocs/accountancy/bookkeeping/balancebymonth.php index 7a9c8969f9a..677160ed2b9 100644 --- a/htdocs/accountancy/bookkeeping/balancebymonth.php +++ b/htdocs/accountancy/bookkeeping/balancebymonth.php @@ -1,6 +1,6 @@ - * Copyright (C) 2013-2014 Alexandre Spangaro + * Copyright (C) 2013-2014 Alexandre Spangaro * Copyright (C) 2014 Florian Henry * Copyright (C) 2015 Jean-François Ferry * diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index 6a763f74e04..7e3d3a6e68d 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -1,7 +1,7 @@ * Copyright (C) 2013-2017 Florian Henry - * Copyright (C) 2013-2018 Alexandre Spangaro + * Copyright (C) 2013-2018 Alexandre Spangaro * Copyright (C) 2017 Laurent Destailleur * Copyright (C) 2018 Frédéric France * diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index 22ddfa39af3..e405c9256a6 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -1,7 +1,7 @@ * Copyright (C) 2013-2016 Florian Henry - * Copyright (C) 2013-2018 Alexandre Spangaro + * Copyright (C) 2013-2018 Alexandre Spangaro * Copyright (C) 2016-2017 Laurent Destailleur * Copyright (C) 2018 Frédéric France * diff --git a/htdocs/accountancy/bookkeeping/listbyaccount.php b/htdocs/accountancy/bookkeeping/listbyaccount.php index bfe1207a7cf..1559aa44ec9 100644 --- a/htdocs/accountancy/bookkeeping/listbyaccount.php +++ b/htdocs/accountancy/bookkeeping/listbyaccount.php @@ -2,7 +2,7 @@ /* Copyright (C) 2016 Neil Orley * Copyright (C) 2013-2016 Olivier Geffroy * Copyright (C) 2013-2016 Florian Henry - * Copyright (C) 2013-2018 Alexandre Spangaro + * Copyright (C) 2013-2018 Alexandre Spangaro * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php b/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php index c4f08ecf1a4..69e1bc2a7b8 100644 --- a/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php +++ b/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php @@ -3,7 +3,7 @@ * Copyright (C) 2005 Laurent Destailleur * Copyright (C) 2013 Olivier Geffroy * Copyright (C) 2013 Florian Henry - * Copyright (C) 2013-2018 Alexandre Spangaro + * Copyright (C) 2013-2018 Alexandre Spangaro * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php b/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php index 4475f316a25..11da2236703 100644 --- a/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php +++ b/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php @@ -3,7 +3,7 @@ * Copyright (C) 2005 Laurent Destailleur * Copyright (C) 2013 Olivier Geffroy * Copyright (C) 2013 Florian Henry - * Copyright (C) 2013-2018 Alexandre Spangaro + * Copyright (C) 2013-2018 Alexandre Spangaro * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/accountancy/class/accountancycategory.class.php b/htdocs/accountancy/class/accountancycategory.class.php index 70752f6d268..6885df63b61 100644 --- a/htdocs/accountancy/class/accountancycategory.class.php +++ b/htdocs/accountancy/class/accountancycategory.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2016-2017 Alexandre Spangaro + * Copyright (C) 2016-2017 Alexandre Spangaro * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index c86d0a4198f..f2c0691da00 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -5,7 +5,7 @@ * Copyright (C) 2015 Florian Henry * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2016 Pierre-Henry Favre - * Copyright (C) 2016-2018 Alexandre Spangaro + * Copyright (C) 2016-2018 Alexandre Spangaro * Copyright (C) 2013-2017 Olivier Geffroy * Copyright (C) 2017 Elarifr. Ari Elbaz * Copyright (C) 2017 Frédéric France diff --git a/htdocs/accountancy/class/accountancysystem.class.php b/htdocs/accountancy/class/accountancysystem.class.php index b70fa7238bb..65852258867 100644 --- a/htdocs/accountancy/class/accountancysystem.class.php +++ b/htdocs/accountancy/class/accountancysystem.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2013-2014 Alexandre Spangaro + * Copyright (C) 2013-2014 Alexandre Spangaro * Copyright (C) 2013-2014 Florian Henry * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index e6c6a672634..6fd9504964c 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2013-2016 Alexandre Spangaro + * Copyright (C) 2013-2016 Alexandre Spangaro * Copyright (C) 2013-2014 Florian Henry * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2015 Ari Elbaz (elarifr) diff --git a/htdocs/accountancy/class/accountingjournal.class.php b/htdocs/accountancy/class/accountingjournal.class.php index b8a823a5b8e..091f1019cdd 100644 --- a/htdocs/accountancy/class/accountingjournal.class.php +++ b/htdocs/accountancy/class/accountingjournal.class.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2017 Alexandre Spangaro * * 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 diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index d398d2ebfad..1499cc60819 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2015-2017 Alexandre Spangaro + * Copyright (C) 2015-2017 Alexandre Spangaro * Copyright (C) 2015-2017 Florian Henry * Copyright (C) 2018 Frédéric France * diff --git a/htdocs/accountancy/class/lettering.class.php b/htdocs/accountancy/class/lettering.class.php index 138384b5a78..e6594e21d2f 100644 --- a/htdocs/accountancy/class/lettering.class.php +++ b/htdocs/accountancy/class/lettering.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2013 Olivier Geffroy - * Copyright (C) 2013-2018 Alexandre Spangaro + * Copyright (C) 2013-2018 Alexandre Spangaro * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/accountancy/customer/card.php b/htdocs/accountancy/customer/card.php index 7d506c6c72c..5c1dfc5ccbb 100644 --- a/htdocs/accountancy/customer/card.php +++ b/htdocs/accountancy/customer/card.php @@ -1,7 +1,7 @@ * Copyright (C) 2013-2014 Florian Henry - * Copyright (C) 2013-2017 Alexandre Spangaro + * Copyright (C) 2013-2017 Alexandre Spangaro * * 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 diff --git a/htdocs/accountancy/customer/index.php b/htdocs/accountancy/customer/index.php index f1bc9840fa1..aa8161b9c52 100644 --- a/htdocs/accountancy/customer/index.php +++ b/htdocs/accountancy/customer/index.php @@ -1,7 +1,7 @@ * Copyright (C) 2013-2014 Florian Henry - * Copyright (C) 2013-2017 Alexandre Spangaro + * Copyright (C) 2013-2017 Alexandre Spangaro * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2015 Jean-François Ferry * diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php index 267a0778131..fb1cc48d3e0 100644 --- a/htdocs/accountancy/customer/lines.php +++ b/htdocs/accountancy/customer/lines.php @@ -1,6 +1,6 @@ - * Copyright (C) 2013-2016 Alexandre Spangaro + * Copyright (C) 2013-2016 Alexandre Spangaro * Copyright (C) 2014-2015 Ari Elbaz (elarifr) * Copyright (C) 2014-2016 Florian Henry * Copyright (C) 2014 Juanjo Menent diff --git a/htdocs/accountancy/expensereport/card.php b/htdocs/accountancy/expensereport/card.php index b245e2539a7..eb620d7bf14 100644 --- a/htdocs/accountancy/expensereport/card.php +++ b/htdocs/accountancy/expensereport/card.php @@ -1,7 +1,7 @@ * Copyright (C) 2005 Simon TOSSER - * Copyright (C) 2013-2017 Alexandre Spangaro + * Copyright (C) 2013-2017 Alexandre Spangaro * Copyright (C) 2013-2014 Olivier Geffroy * Copyright (C) 2013-2014 Florian Henry * Copyright (C) 2014 Juanjo Menent diff --git a/htdocs/accountancy/expensereport/index.php b/htdocs/accountancy/expensereport/index.php index 50aea53986a..a5d8126567d 100644 --- a/htdocs/accountancy/expensereport/index.php +++ b/htdocs/accountancy/expensereport/index.php @@ -1,7 +1,7 @@ * Copyright (C) 2013-2014 Florian Henry - * Copyright (C) 2013-2016 Alexandre Spangaro + * Copyright (C) 2013-2016 Alexandre Spangaro * Copyright (C) 2014 Juanjo Menent * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/accountancy/expensereport/lines.php b/htdocs/accountancy/expensereport/lines.php index e1f43f010ba..ddc4f0d9227 100644 --- a/htdocs/accountancy/expensereport/lines.php +++ b/htdocs/accountancy/expensereport/lines.php @@ -1,6 +1,6 @@ - * Copyright (C) 2013-2017 Alexandre Spangaro + * Copyright (C) 2013-2017 Alexandre Spangaro * Copyright (C) 2014-2015 Ari Elbaz (elarifr) * Copyright (C) 2013-2016 Florian Henry * Copyright (C) 2014 Juanjo Menent diff --git a/htdocs/accountancy/expensereport/list.php b/htdocs/accountancy/expensereport/list.php index 49096d8a2f5..fc5a4d97b08 100644 --- a/htdocs/accountancy/expensereport/list.php +++ b/htdocs/accountancy/expensereport/list.php @@ -1,6 +1,6 @@ - * Copyright (C) 2013-2017 Alexandre Spangaro + * Copyright (C) 2013-2017 Alexandre Spangaro * Copyright (C) 2014-2015 Ari Elbaz (elarifr) * Copyright (C) 2013-2014 Florian Henry * Copyright (C) 2014 Juanjo Menent s diff --git a/htdocs/accountancy/journal/expensereportsjournal.php b/htdocs/accountancy/journal/expensereportsjournal.php index c40fda8a564..abcd85df1d4 100644 --- a/htdocs/accountancy/journal/expensereportsjournal.php +++ b/htdocs/accountancy/journal/expensereportsjournal.php @@ -3,7 +3,7 @@ * Copyright (C) 2007-2010 Jean Heimburger * Copyright (C) 2011 Juanjo Menent * Copyright (C) 2012 Regis Houssin - * Copyright (C) 2013-2018 Alexandre Spangaro + * Copyright (C) 2013-2018 Alexandre Spangaro * Copyright (C) 2013-2016 Olivier Geffroy * Copyright (C) 2013-2016 Florian Henry * Copyright (C) 2018 Frédéric France diff --git a/htdocs/accountancy/journal/purchasesjournal.php b/htdocs/accountancy/journal/purchasesjournal.php index 3249841df88..e7f74d5fb7c 100644 --- a/htdocs/accountancy/journal/purchasesjournal.php +++ b/htdocs/accountancy/journal/purchasesjournal.php @@ -3,7 +3,7 @@ * Copyright (C) 2007-2010 Jean Heimburger * Copyright (C) 2011 Juanjo Menent * Copyright (C) 2012 Regis Houssin - * Copyright (C) 2013-2017 Alexandre Spangaro + * Copyright (C) 2013-2017 Alexandre Spangaro * Copyright (C) 2013-2016 Olivier Geffroy * Copyright (C) 2013-2016 Florian Henry * Copyright (C) 2018 Frédéric France diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php index 1df11a6058d..4e33eee1f43 100644 --- a/htdocs/accountancy/journal/sellsjournal.php +++ b/htdocs/accountancy/journal/sellsjournal.php @@ -4,7 +4,7 @@ * Copyright (C) 2011 Juanjo Menent * Copyright (C) 2012 Regis Houssin * Copyright (C) 2013 Christophe Battarel - * Copyright (C) 2013-2018 Alexandre Spangaro + * Copyright (C) 2013-2018 Alexandre Spangaro * Copyright (C) 2013-2016 Florian Henry * Copyright (C) 2013-2016 Olivier Geffroy * Copyright (C) 2014 Raphaël Doursenaud diff --git a/htdocs/accountancy/supplier/card.php b/htdocs/accountancy/supplier/card.php index 8de24e09a9e..10e52d6c029 100644 --- a/htdocs/accountancy/supplier/card.php +++ b/htdocs/accountancy/supplier/card.php @@ -1,7 +1,7 @@ * Copyright (C) 2005 Simon TOSSER - * Copyright (C) 2013-2017 Alexandre Spangaro + * Copyright (C) 2013-2017 Alexandre Spangaro * Copyright (C) 2013-2014 Olivier Geffroy * Copyright (C) 2013-2014 Florian Henry * Copyright (C) 2014 Juanjo Menent diff --git a/htdocs/accountancy/supplier/index.php b/htdocs/accountancy/supplier/index.php index 72afb5495dc..3dd96e90a4a 100644 --- a/htdocs/accountancy/supplier/index.php +++ b/htdocs/accountancy/supplier/index.php @@ -1,7 +1,7 @@ * Copyright (C) 2013-2014 Florian Henry - * Copyright (C) 2013-2015 Alexandre Spangaro + * Copyright (C) 2013-2015 Alexandre Spangaro * Copyright (C) 2014 Juanjo Menent * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/accountancy/supplier/lines.php b/htdocs/accountancy/supplier/lines.php index 0638b4f0e30..91a289511c9 100644 --- a/htdocs/accountancy/supplier/lines.php +++ b/htdocs/accountancy/supplier/lines.php @@ -1,6 +1,6 @@ - * Copyright (C) 2013-2017 Alexandre Spangaro + * Copyright (C) 2013-2017 Alexandre Spangaro * Copyright (C) 2014-2015 Ari Elbaz (elarifr) * Copyright (C) 2013-2016 Florian Henry * Copyright (C) 2014 Juanjo Menent diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php index 221cd480c18..4dd9be839fe 100644 --- a/htdocs/accountancy/supplier/list.php +++ b/htdocs/accountancy/supplier/list.php @@ -1,6 +1,6 @@ - * Copyright (C) 2013-2017 Alexandre Spangaro + * Copyright (C) 2013-2017 Alexandre Spangaro * Copyright (C) 2014-2015 Ari Elbaz (elarifr) * Copyright (C) 2013-2014 Florian Henry * Copyright (C) 2014 Juanjo Menent s diff --git a/htdocs/accountancy/tpl/export_journal.tpl.php b/htdocs/accountancy/tpl/export_journal.tpl.php index ca3c9c49ea0..97f0da548ca 100644 --- a/htdocs/accountancy/tpl/export_journal.tpl.php +++ b/htdocs/accountancy/tpl/export_journal.tpl.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2015-2018 Alexandre Spangaro * Copyright (C) 2016 Charlie Benke * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 266e15700f9..9629b8572fc 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -5,7 +5,7 @@ * Copyright (C) 2005-2018 Regis Houssin * Copyright (C) 2012 Marcos García * Copyright (C) 2012-2018 Philippe Grand - * Copyright (C) 2015-2018 Alexandre Spangaro + * Copyright (C) 2015-2018 Alexandre Spangaro * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 1d854a0d8ec..738b538540a 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -5,7 +5,7 @@ * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2009-2017 Regis Houssin - * Copyright (C) 2014-2018 Alexandre Spangaro + * Copyright (C) 2014-2018 Alexandre Spangaro * Copyright (C) 2015 Marcos García * Copyright (C) 2015-2018 Frédéric France * Copyright (C) 2015 Raphaël Doursenaud diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 1891085a37a..3332f6be23a 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -4,7 +4,7 @@ * Copyright (C) 2004-2016 Laurent Destailleur * Copyright (C) 2013-2015 Raphaël Doursenaud * Copyright (C) 2014-2016 Juanjo Menent - * Copyright (C) 2018 Alexandre Spangaro + * Copyright (C) 2018 Alexandre Spangaro * * 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 diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index 0539162ab7b..1e6d6044c75 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -3,7 +3,7 @@ * Copyright (C) 2002-2003 Jean-Louis Bergamo * Copyright (C) 2004-2018 Laurent Destailleur * Copyright (C) 2012-2017 Regis Houssin - * Copyright (C) 2015-2016 Alexandre Spangaro + * Copyright (C) 2015-2016 Alexandre Spangaro * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index 38feea99fab..f220ba50135 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -4,7 +4,7 @@ * Copyright (C) 2004-2011 Laurent Destailleur * Copyright (C) 2005-2017 Regis Houssin * Copyright (C) 2013 Florian Henry - * Copyright (C) 2015 Alexandre Spangaro + * Copyright (C) 2015 Alexandre Spangaro * * 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 diff --git a/htdocs/admin/accountant.php b/htdocs/admin/accountant.php index c1e63c1d932..38e19adb745 100644 --- a/htdocs/admin/accountant.php +++ b/htdocs/admin/accountant.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2018 Alexandre Spangaro * * 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 diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index 14dde504460..ec814718f0f 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -4,7 +4,7 @@ * Copyright (C) 2005-2017 Regis Houssin * Copyright (C) 2010-2014 Juanjo Menent * Copyright (C) 2011-2017 Philippe Grand - * Copyright (C) 2015 Alexandre Spangaro + * Copyright (C) 2015 Alexandre Spangaro * Copyright (C) 2017 Rui Strecht * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index dff30150544..e7fb5860bca 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -8,7 +8,7 @@ * Copyright (C) 2011 Remy Younes * Copyright (C) 2012-2015 Marcos García * Copyright (C) 2012 Christophe Battarel - * Copyright (C) 2011-2016 Alexandre Spangaro + * Copyright (C) 2011-2016 Alexandre Spangaro * Copyright (C) 2015 Ferran Marcet * Copyright (C) 2016 Raphaël Doursenaud * diff --git a/htdocs/admin/loan.php b/htdocs/admin/loan.php index 2ea1a4c3f04..56d80c2e7d7 100644 --- a/htdocs/admin/loan.php +++ b/htdocs/admin/loan.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2014-2017 Alexandre Spangaro * * 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 diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index d33c87522b1..c9cad44ec72 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -8,7 +8,7 @@ * Copyright (C) 2011 Remy Younes * Copyright (C) 2012-2015 Marcos García * Copyright (C) 2012 Christophe Battarel - * Copyright (C) 2011-2016 Alexandre Spangaro + * Copyright (C) 2011-2016 Alexandre Spangaro * Copyright (C) 2015 Ferran Marcet * Copyright (C) 2016 Raphaël Doursenaud * Copyright (C) 2018 Frédéric France diff --git a/htdocs/admin/openinghours.php b/htdocs/admin/openinghours.php index ef14ad6b4d8..3dee14ef24d 100644 --- a/htdocs/admin/openinghours.php +++ b/htdocs/admin/openinghours.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2018 Alexandre Spangaro * * 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 diff --git a/htdocs/admin/salaries.php b/htdocs/admin/salaries.php index 9cfb8f58429..324ae1b0a17 100644 --- a/htdocs/admin/salaries.php +++ b/htdocs/admin/salaries.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2014-2015 Alexandre Spangaro * * 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 diff --git a/htdocs/admin/supplier_invoice.php b/htdocs/admin/supplier_invoice.php index e6611503b32..6d8936fbe71 100644 --- a/htdocs/admin/supplier_invoice.php +++ b/htdocs/admin/supplier_invoice.php @@ -43,6 +43,8 @@ accessforbidden(); $type=GETPOST('type', 'alpha'); $value=GETPOST('value', 'alpha'); $action=GETPOST('action', 'alpha'); + +$label = GETPOST('label', 'alpha'); $scandir = GETPOST('scan_dir', 'alpha'); $specimenthirdparty=new Societe($db); diff --git a/htdocs/admin/taxes.php b/htdocs/admin/taxes.php index b6719125fb5..ac39ffbfc7e 100644 --- a/htdocs/admin/taxes.php +++ b/htdocs/admin/taxes.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2008 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2011-2013 Juanjo Menent - * Copyright (C) 2015-2018 Alexandre Spangaro + * Copyright (C) 2015-2018 Alexandre Spangaro * * 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 diff --git a/htdocs/asset/admin/assets_extrafields.php b/htdocs/asset/admin/assets_extrafields.php index de72f8daf53..f35ed7f391a 100644 --- a/htdocs/asset/admin/assets_extrafields.php +++ b/htdocs/asset/admin/assets_extrafields.php @@ -1,6 +1,6 @@ - * Copyright (C) 2018 Alexandre Spangaro + * Copyright (C) 2018 Alexandre Spangaro * * 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 diff --git a/htdocs/asset/admin/assets_type_extrafields.php b/htdocs/asset/admin/assets_type_extrafields.php index 3481ccb46b3..1ea4393fb69 100644 --- a/htdocs/asset/admin/assets_type_extrafields.php +++ b/htdocs/asset/admin/assets_type_extrafields.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2018 Alexandre Spangaro * * 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 diff --git a/htdocs/asset/admin/setup.php b/htdocs/asset/admin/setup.php index b03f4daf505..83ccadc7e1f 100644 --- a/htdocs/asset/admin/setup.php +++ b/htdocs/asset/admin/setup.php @@ -1,6 +1,6 @@ - * Copyright (C) 2018 Alexandre Spangaro + * Copyright (C) 2018 Alexandre Spangaro * * 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 diff --git a/htdocs/asset/card.php b/htdocs/asset/card.php index 9dab2383364..a45eae7047d 100644 --- a/htdocs/asset/card.php +++ b/htdocs/asset/card.php @@ -1,6 +1,6 @@ - * Copyright (C) 2018 Alexandre Spangaro + * Copyright (C) 2018 Alexandre Spangaro * * 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 diff --git a/htdocs/asset/class/asset.class.php b/htdocs/asset/class/asset.class.php index 91a6f4956bf..aca175b59d2 100644 --- a/htdocs/asset/class/asset.class.php +++ b/htdocs/asset/class/asset.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2018 Alexandre Spangaro + * Copyright (C) 2018 Alexandre Spangaro * * 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 diff --git a/htdocs/asset/class/asset_type.class.php b/htdocs/asset/class/asset_type.class.php index 50910f78014..58baf280036 100644 --- a/htdocs/asset/class/asset_type.class.php +++ b/htdocs/asset/class/asset_type.class.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2018 Alexandre Spangaro * * 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 diff --git a/htdocs/asset/document.php b/htdocs/asset/document.php index 5dabf99e574..3359d5539b5 100644 --- a/htdocs/asset/document.php +++ b/htdocs/asset/document.php @@ -1,6 +1,6 @@ - * Copyright (C) 2018 Alexandre Spangaro + * Copyright (C) 2018 Alexandre Spangaro * * 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 diff --git a/htdocs/asset/info.php b/htdocs/asset/info.php index 21e96e6f8ca..462abf17342 100644 --- a/htdocs/asset/info.php +++ b/htdocs/asset/info.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2018 Alexandre Spangaro * * 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 diff --git a/htdocs/asset/list.php b/htdocs/asset/list.php index a14c8eee62a..0e69776b50d 100644 --- a/htdocs/asset/list.php +++ b/htdocs/asset/list.php @@ -1,6 +1,6 @@ - * Copyright (C) 2018 Alexandre Spangaro + * Copyright (C) 2018 Alexandre Spangaro * Copyright (C) 2018 Ferran Marcet * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/asset/note.php b/htdocs/asset/note.php index ca03f279fcc..cfcb5fe70bc 100644 --- a/htdocs/asset/note.php +++ b/htdocs/asset/note.php @@ -1,6 +1,6 @@ - * Copyright (C) 2018 Alexandre Spangaro + * Copyright (C) 2018 Alexandre Spangaro * * 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 diff --git a/htdocs/asset/type.php b/htdocs/asset/type.php index a08a775d07a..9f11889185f 100644 --- a/htdocs/asset/type.php +++ b/htdocs/asset/type.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2018 Alexandre Spangaro * * 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 diff --git a/htdocs/blockedlog/class/blockedlog.class.php b/htdocs/blockedlog/class/blockedlog.class.php index b85b3be4659..64ff412b86c 100644 --- a/htdocs/blockedlog/class/blockedlog.class.php +++ b/htdocs/blockedlog/class/blockedlog.class.php @@ -385,7 +385,7 @@ class BlockedLog $this->object_data=new stdClass(); // Add fields to exclude $arrayoffieldstoexclude = array( - 'table_element','fields','ref_previous','ref_next','origin','origin_id','oldcopy','picto','error','errors','modelpdf','civility_id','contact','contact_id', + 'table_element','fields','ref_previous','ref_next','origin','origin_id','oldcopy','picto','error','errors','modelpdf','last_main_doc','civility_id','contact','contact_id', 'table_element_line','ismultientitymanaged','isextrafieldmanaged', 'linkedObjectsIds','linkedObjects','fk_delivery_address', 'context', diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index c7cea037944..596cc20c9e0 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -6,7 +6,7 @@ * Copyright (C) 2010-2013 Juanjo Menent * Copyright (C) 2013 Florian Henry * Copyright (C) 2014 Cedric GROSS - * Copyright (C) 2015 Alexandre Spangaro + * Copyright (C) 2015 Alexandre Spangaro * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 0d915fcfa93..fd65422cdcc 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -6,7 +6,7 @@ * Copyright (C) 2005-2017 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) * Copyright (C) 2010-2014 Juanjo Menent - * Copyright (C) 2013 Alexandre Spangaro + * Copyright (C) 2013 Alexandre Spangaro * Copyright (C) 2015 Frederic France * Copyright (C) 2015 Marcos García * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index 61956ff4533..2b599b1e60d 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -6,7 +6,7 @@ * Copyright (C) 2014 Florian Henry * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2016 Juanjo Menent - * Copyright (C) 2017 Alexandre Spangaro + * Copyright (C) 2017 Alexandre Spangaro * Copyright (C) 2018 Ferran Marcet * Copyright (C) 2018 Frédéric France * diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php index d517ad0dfc9..518918f62c2 100644 --- a/htdocs/compta/bank/card.php +++ b/htdocs/compta/bank/card.php @@ -3,7 +3,7 @@ * Copyright (C) 2003 Jean-Louis Bergamo * Copyright (C) 2004-2016 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin - * Copyright (C) 2014-2017 Alexandre Spangaro + * Copyright (C) 2014-2017 Alexandre Spangaro * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2016 Marcos García * Copyright (C) 2018 Frédéric France diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 9787e995141..84f6a4bacb1 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -6,7 +6,7 @@ * Copyright (C) 2005-2010 Regis Houssin * Copyright (C) 2013 Florian Henry * Copyright (C) 2015-2016 Marcos García - * Copyright (C) 2015-2017 Alexandre Spangaro + * Copyright (C) 2015-2017 Alexandre Spangaro * Copyright (C) 2016 Ferran Marcet * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/compta/bank/class/paymentvarious.class.php b/htdocs/compta/bank/class/paymentvarious.class.php index fc9365f7508..5d6c1408a57 100644 --- a/htdocs/compta/bank/class/paymentvarious.class.php +++ b/htdocs/compta/bank/class/paymentvarious.class.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2017 Alexandre Spangaro * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/compta/bank/ligne.php b/htdocs/compta/bank/ligne.php index 99b2a813149..40906bfd455 100644 --- a/htdocs/compta/bank/ligne.php +++ b/htdocs/compta/bank/ligne.php @@ -4,7 +4,7 @@ * Copyright (C) 2004-2017 Laurent Destailleur * Copyright (C) 2004 Christophe Combelles * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2015-2017 Alexandre Spangaro + * Copyright (C) 2015-2017 Alexandre Spangaro * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2016 Marcos García * Copyright (C) 2018 Frédéric France diff --git a/htdocs/compta/bank/various_payment/card.php b/htdocs/compta/bank/various_payment/card.php index dcc55d24587..43e30a8e71b 100644 --- a/htdocs/compta/bank/various_payment/card.php +++ b/htdocs/compta/bank/various_payment/card.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2017 Alexandre Spangaro * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/compta/bank/various_payment/document.php b/htdocs/compta/bank/various_payment/document.php index 6f95f1944e7..4a9ccec2672 100644 --- a/htdocs/compta/bank/various_payment/document.php +++ b/htdocs/compta/bank/various_payment/document.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2017 Alexandre Spangaro * * 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 diff --git a/htdocs/compta/bank/various_payment/info.php b/htdocs/compta/bank/various_payment/info.php index 88a194093c8..9afae281f78 100644 --- a/htdocs/compta/bank/various_payment/info.php +++ b/htdocs/compta/bank/various_payment/info.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2017 Alexandre Spangaro * * 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 diff --git a/htdocs/compta/bank/various_payment/list.php b/htdocs/compta/bank/various_payment/list.php index d10172201a0..4437a9cfd2d 100644 --- a/htdocs/compta/bank/various_payment/list.php +++ b/htdocs/compta/bank/various_payment/list.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2017 Alexandre Spangaro * Copyright (C) 2017 Laurent Destailleur * Copyright (C) 2018 Frédéric France * diff --git a/htdocs/compta/cashcontrol/report.php b/htdocs/compta/cashcontrol/report.php index c71d0a3a950..348c9bab450 100644 --- a/htdocs/compta/cashcontrol/report.php +++ b/htdocs/compta/cashcontrol/report.php @@ -6,7 +6,7 @@ * Copyright (C) 2014 Florian Henry * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2016 Juanjo Menent - * Copyright (C) 2017 Alexandre Spangaro + * Copyright (C) 2017 Alexandre Spangaro * Copyright (C) 2018 Andreu Bisquerra * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/compta/charges/index.php b/htdocs/compta/charges/index.php index 34fce3e6048..e2381605306 100644 --- a/htdocs/compta/charges/index.php +++ b/htdocs/compta/charges/index.php @@ -2,7 +2,7 @@ /* Copyright (C) 2001-2003 Rodolphe Quiedeville * Copyright (C) 2004-2016 Laurent Destailleur * Copyright (C) 2005-2010 Regis Houssin - * Copyright (C) 2011-2016 Alexandre Spangaro + * Copyright (C) 2011-2016 Alexandre Spangaro * Copyright (C) 2011-2014 Juanjo Menent * Copyright (C) 2015 Jean-François Ferry * diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 9ff69004444..96e6b649a69 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -15,7 +15,7 @@ * Copyright (C) 2013 Cedric Gross * Copyright (C) 2013 Florian Henry * Copyright (C) 2016 Ferran Marcet - * Copyright (C) 2018 Alexandre Spangaro + * Copyright (C) 2018 Alexandre Spangaro * Copyright (C) 2018 Nicolas ZABOURI * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php index 674b63fe18d..be867a66c99 100644 --- a/htdocs/compta/facture/fiche-rec.php +++ b/htdocs/compta/facture/fiche-rec.php @@ -6,7 +6,7 @@ * Copyright (C) 2013 Juanjo Menent * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2012 Cedric Salvador - * Copyright (C) 2015 Alexandre Spangaro + * Copyright (C) 2015 Alexandre Spangaro * Copyright (C) 2016 Meziane Sof * Copyright (C) 2017-2018 Frédéric France * diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php index 76a7641f327..795693998a7 100644 --- a/htdocs/compta/facture/invoicetemplate_list.php +++ b/htdocs/compta/facture/invoicetemplate_list.php @@ -6,7 +6,7 @@ * Copyright (C) 2013 Juanjo Menent * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2012 Cedric Salvador - * Copyright (C) 2015 Alexandre Spangaro + * Copyright (C) 2015 Alexandre Spangaro * Copyright (C) 2016 Meziane Sof * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/compta/journal/purchasesjournal.php b/htdocs/compta/journal/purchasesjournal.php index 900d460dc23..687c31de036 100644 --- a/htdocs/compta/journal/purchasesjournal.php +++ b/htdocs/compta/journal/purchasesjournal.php @@ -3,7 +3,7 @@ * Copyright (C) 2007-2010 Jean Heimburger * Copyright (C) 2011-2014 Juanjo Menent * Copyright (C) 2012 Regis Houssin - * Copyright (C) 2011-2012 Alexandre spangaro + * Copyright (C) 2011-2012 Alexandre spangaro * Copyright (C) 2013 Marcos García * Copyright (C) 2018 Frédéric France * diff --git a/htdocs/compta/journal/sellsjournal.php b/htdocs/compta/journal/sellsjournal.php index 9cc9d4e1795..fcd53a58ea3 100644 --- a/htdocs/compta/journal/sellsjournal.php +++ b/htdocs/compta/journal/sellsjournal.php @@ -3,7 +3,7 @@ * Copyright (C) 2007-2010 Jean Heimburger * Copyright (C) 2011-2014 Juanjo Menent * Copyright (C) 2012 Regis Houssin - * Copyright (C) 2011-2012 Alexandre Spangaro + * Copyright (C) 2011-2012 Alexandre Spangaro * Copyright (C) 2012 Cédric Salvador * Copyright (C) 2013 Marcos García * Copyright (C) 2014 Raphaël Doursenaud diff --git a/htdocs/compta/paiement/cheque/card.php b/htdocs/compta/paiement/cheque/card.php index f1bd327f1d7..e52a1135ba0 100644 --- a/htdocs/compta/paiement/cheque/card.php +++ b/htdocs/compta/paiement/cheque/card.php @@ -4,7 +4,7 @@ * Copyright (C) 2009-2012 Regis Houssin * Copyright (C) 2011-2016 Juanjo Menent * Copyright (C) 2013 Philippe Grand - * Copyright (C) 2015-2016 Alexandre Spangaro + * Copyright (C) 2015-2016 Alexandre Spangaro * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/compta/paiement/cheque/list.php b/htdocs/compta/paiement/cheque/list.php index 19c59356226..1c0736e5cc9 100644 --- a/htdocs/compta/paiement/cheque/list.php +++ b/htdocs/compta/paiement/cheque/list.php @@ -2,7 +2,7 @@ /* Copyright (C) 2006 Rodolphe Quiedeville * Copyright (C) 2007-2016 Laurent Destailleur * Copyright (C) 2009-2012 Regis Houssin - * Copyright (C) 2014 Alexandre Spangaro + * Copyright (C) 2014 Alexandre Spangaro * Copyright (C) 2016 Juanjo Menent * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/compta/paiement/list.php b/htdocs/compta/paiement/list.php index 211e6c12803..1f0b26a5563 100644 --- a/htdocs/compta/paiement/list.php +++ b/htdocs/compta/paiement/list.php @@ -5,7 +5,7 @@ * Copyright (C) 2013 Cédric Salvador * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2015 Juanjo Menent - * Copyright (C) 2017 Alexandre Spangaro + * Copyright (C) 2017 Alexandre Spangaro * Copyright (C) 2018 Ferran Marcet * Copyright (C) 2018 Charlene Benke * diff --git a/htdocs/compta/resultat/result.php b/htdocs/compta/resultat/result.php index 15daf23f2ac..7b7d37a6cb9 100644 --- a/htdocs/compta/resultat/result.php +++ b/htdocs/compta/resultat/result.php @@ -1,6 +1,6 @@ - * Copyright (C) 2016 Alexandre Spangaro + * Copyright (C) 2016 Alexandre Spangaro * Copyright (C) 2018 Laurent Destailleur * Copyright (C) 2018 Frédéric France * diff --git a/htdocs/compta/salaries/card.php b/htdocs/compta/salaries/card.php index 8d2ee44f8c0..c19b18bc0f0 100644 --- a/htdocs/compta/salaries/card.php +++ b/htdocs/compta/salaries/card.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2011-2018 Alexandre Spangaro * Copyright (C) 2014 Laurent Destailleur * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2015 Charlie BENKE diff --git a/htdocs/compta/salaries/class/paymentsalary.class.php b/htdocs/compta/salaries/class/paymentsalary.class.php index 2f4c7623bd3..1e4dd5e5ef7 100644 --- a/htdocs/compta/salaries/class/paymentsalary.class.php +++ b/htdocs/compta/salaries/class/paymentsalary.class.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2011-2018 Alexandre Spangaro * Copyright (C) 2014 Juanjo Menent * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/compta/salaries/class/salariesstats.class.php b/htdocs/compta/salaries/class/salariesstats.class.php index 8dd602cd3e9..803aaa5a916 100644 --- a/htdocs/compta/salaries/class/salariesstats.class.php +++ b/htdocs/compta/salaries/class/salariesstats.class.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2018 Alexandre Spangaro * Copyright (c) 2018 Fidesio * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/compta/salaries/document.php b/htdocs/compta/salaries/document.php index 5c2e669d784..cf894f79135 100644 --- a/htdocs/compta/salaries/document.php +++ b/htdocs/compta/salaries/document.php @@ -6,7 +6,7 @@ * Copyright (C) 2005 Simon TOSSER * Copyright (C) 2011-2012 Juanjo Menent * Copyright (C) 2013 Cédric Salvador - * Copyright (C) 2015-2017 Alexandre Spangaro + * Copyright (C) 2015-2017 Alexandre Spangaro * * 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 diff --git a/htdocs/compta/salaries/info.php b/htdocs/compta/salaries/info.php index 96047128df9..4ef9691bd31 100644 --- a/htdocs/compta/salaries/info.php +++ b/htdocs/compta/salaries/info.php @@ -1,7 +1,7 @@ * Copyright (C) 2015 Charlie BENKE - * Copyright (C) 2017 Alexandre Spangaro + * Copyright (C) 2017 Alexandre Spangaro * * 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 diff --git a/htdocs/compta/salaries/list.php b/htdocs/compta/salaries/list.php index 4acce274c07..99a41f5ad9f 100644 --- a/htdocs/compta/salaries/list.php +++ b/htdocs/compta/salaries/list.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2011-2016 Alexandre Spangaro * Copyright (C) 2015-2016 Laurent Destailleur * Copyright (C) 2015 Jean-François Ferry * diff --git a/htdocs/compta/salaries/stats/index.php b/htdocs/compta/salaries/stats/index.php index e5b252b4d3d..f51e102d4f2 100644 --- a/htdocs/compta/salaries/stats/index.php +++ b/htdocs/compta/salaries/stats/index.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2018 Alexandre Spangaro * Copyright (C) 2018 Fidesio * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php index 44b04bc5e3a..bc0727889a6 100644 --- a/htdocs/compta/sociales/card.php +++ b/htdocs/compta/sociales/card.php @@ -2,7 +2,7 @@ /* Copyright (C) 2004-2016 Laurent Destailleur * Copyright (C) 2005-2013 Regis Houssin * Copyright (C) 2016-2018 Frédéric France - * Copyright (C) 2017 Alexandre Spangaro + * Copyright (C) 2017 Alexandre Spangaro * * 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 diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php index 687553a7bf2..8dff6f5a67b 100644 --- a/htdocs/compta/sociales/class/chargesociales.class.php +++ b/htdocs/compta/sociales/class/chargesociales.class.php @@ -2,7 +2,7 @@ /* Copyright (C) 2002 Rodolphe Quiedeville * Copyright (C) 2004-2007 Laurent Destailleur * Copyright (C) 2016 Frédéric France - * Copyright (C) 2017 Alexandre Spangaro + * Copyright (C) 2017 Alexandre Spangaro * * 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 diff --git a/htdocs/compta/sociales/payments.php b/htdocs/compta/sociales/payments.php index d0b3f6de855..9b2bb9552a8 100644 --- a/htdocs/compta/sociales/payments.php +++ b/htdocs/compta/sociales/payments.php @@ -2,7 +2,7 @@ /* Copyright (C) 2001-2003 Rodolphe Quiedeville * Copyright (C) 2004-2014 Laurent Destailleur * Copyright (C) 2005-2010 Regis Houssin - * Copyright (C) 2011-2016 Alexandre Spangaro + * Copyright (C) 2011-2016 Alexandre Spangaro * Copyright (C) 2011-2014 Juanjo Menent * Copyright (C) 2015 Jean-François Ferry * diff --git a/htdocs/compta/tva/card.php b/htdocs/compta/tva/card.php index d34a26009fc..be738b374cf 100644 --- a/htdocs/compta/tva/card.php +++ b/htdocs/compta/tva/card.php @@ -2,7 +2,7 @@ /* Copyright (C) 2003 Rodolphe Quiedeville * Copyright (C) 2004-2016 Laurent Destailleur * Copyright (C) 2005-2013 Regis Houssin - * Copyright (C) 2015-2017 Alexandre Spangaro + * Copyright (C) 2015-2017 Alexandre Spangaro * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/compta/tva/class/tva.class.php b/htdocs/compta/tva/class/tva.class.php index a498ebf3ab7..c66e19ea5f2 100644 --- a/htdocs/compta/tva/class/tva.class.php +++ b/htdocs/compta/tva/class/tva.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2004-2008 Laurent Destailleur - * Copyright (C) 2011-2017 Alexandre Spangaro + * Copyright (C) 2011-2017 Alexandre Spangaro * Copyright (C) 2018 Philippe Grand * Copyright (C) 2018 Frédéric France * diff --git a/htdocs/compta/tva/info.php b/htdocs/compta/tva/info.php index 7418ba30d3f..d7fb6c92f44 100644 --- a/htdocs/compta/tva/info.php +++ b/htdocs/compta/tva/info.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2016-2017 Alexandre Spangaro * * 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 diff --git a/htdocs/compta/tva/list.php b/htdocs/compta/tva/list.php index 17d041decf7..d3ec5e53f71 100644 --- a/htdocs/compta/tva/list.php +++ b/htdocs/compta/tva/list.php @@ -2,7 +2,7 @@ /* Copyright (C) 2001-2003 Rodolphe Quiedeville * Copyright (C) 2004-2018 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin - * Copyright (C) 2011-2017 Alexandre Spangaro + * Copyright (C) 2011-2017 Alexandre Spangaro * * 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 diff --git a/htdocs/contact/agenda.php b/htdocs/contact/agenda.php index d368692bc06..cf2c198d36e 100644 --- a/htdocs/contact/agenda.php +++ b/htdocs/contact/agenda.php @@ -5,7 +5,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2007 Franky Van Liedekerke * Copyright (C) 2013 Florian Henry - * Copyright (C) 2013-2016 Alexandre Spangaro + * Copyright (C) 2013-2016 Alexandre Spangaro * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2015 Jean-François Ferry * diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index 8b747883b19..63704ab6bca 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -5,7 +5,7 @@ * Copyright (C) 2005-2017 Regis Houssin * Copyright (C) 2007 Franky Van Liedekerke * Copyright (C) 2013 Florian Henry - * Copyright (C) 2013-2016 Alexandre Spangaro + * Copyright (C) 2013-2016 Alexandre Spangaro * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2018 Frédéric France diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 49354ea8806..633c1dbf77b 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -6,7 +6,7 @@ * Copyright (C) 2007 Franky Van Liedekerke * Copyright (C) 2008 Raphael Bertrand (Resultic) * Copyright (C) 2013 Florian Henry - * Copyright (C) 2013 Alexandre Spangaro + * Copyright (C) 2013 Alexandre Spangaro * Copyright (C) 2013 Juanjo Menent * Copyright (C) 2015 Marcos García * diff --git a/htdocs/contact/document.php b/htdocs/contact/document.php index e9a4df4a6c6..1f2f895fed8 100644 --- a/htdocs/contact/document.php +++ b/htdocs/contact/document.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2014 Alexandre Spangaro * Copyright (C) 2015 Frederic France * Copyright (C) 2017 Regis Houssin * diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index e75d4a3231e..244dffcc0e1 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -5,7 +5,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2013-2015 Raphaël Doursenaud * Copyright (C) 2013 Cédric Salvador - * Copyright (C) 2013 Alexandre Spangaro + * Copyright (C) 2013 Alexandre Spangaro * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2018 Nicolas ZABOURI * Copyright (C) 2018 Juanjo Menent diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 4bc42aa266a..79fd0229eb8 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -37,8 +37,8 @@ // Protection if (empty($objectclass) || empty($uploaddir)) { - dol_print_error(null, 'include of actions_massactions.inc.php is done but var $massaction or $objectclass or $uploaddir was not defined'); - exit; + dol_print_error(null, 'include of actions_massactions.inc.php is done but var $massaction or $objectclass or $uploaddir was not defined'); + exit; } @@ -46,1047 +46,1060 @@ if (empty($objectclass) || empty($uploaddir)) $maxformassaction=(empty($conf->global->MAIN_LIMIT_FOR_MASS_ACTIONS)?1000:$conf->global->MAIN_LIMIT_FOR_MASS_ACTIONS); if (! empty($massaction) && count($toselect) < 1) { - $error++; - setEventMessages($langs->trans("NoRecordSelected"), null, "warnings"); + $error++; + setEventMessages($langs->trans("NoRecordSelected"), null, "warnings"); } if (! $error && is_array($toselect) && count($toselect) > $maxformassaction) { - setEventMessages($langs->trans('TooManyRecordForMassAction', $maxformassaction), null, 'errors'); - $error++; + setEventMessages($langs->trans('TooManyRecordForMassAction', $maxformassaction), null, 'errors'); + $error++; } if (! $error && $massaction == 'confirm_presend' && ! GETPOST('sendmail')) // If we do not choose button send (for example when we change template or limit), we must not send email, but keep on send email form { - $massaction='presend'; + $massaction='presend'; } if (! $error && $massaction == 'confirm_presend') { - $resaction = ''; - $nbsent = 0; - $nbignored = 0; - $langs->load("mails"); - include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - - $listofobjectid=array(); - $listofobjectthirdparties=array(); - $listofobjectref=array(); - - if (! $error) - { - $thirdparty=new Societe($db); - if ($objecttmp->element == 'expensereport') $thirdparty=new User($db); - if ($objecttmp->element == 'holiday') $thirdparty=new User($db); - - $objecttmp=new $objectclass($db); - foreach($toselect as $toselectid) - { - $objecttmp=new $objectclass($db); // we must create new instance because instance is saved into $listofobjectref array for future use - $result=$objecttmp->fetch($toselectid); - if ($result > 0) - { - $listofobjectid[$toselectid]=$toselectid; - $thirdpartyid=($objecttmp->fk_soc?$objecttmp->fk_soc:$objecttmp->socid); - if ($objecttmp->element == 'societe') $thirdpartyid=$objecttmp->id; - if ($objecttmp->element == 'expensereport') $thirdpartyid=$objecttmp->fk_user_author; - if ($objecttmp->element == 'holiday') $thirdpartyid=$objecttmp->fk_user; - $listofobjectthirdparties[$thirdpartyid]=$thirdpartyid; - $listofobjectref[$thirdpartyid][$toselectid]=$objecttmp; - } - } - } - - // Check mandatory parameters - if (GETPOST('fromtype', 'alpha') === 'user' && empty($user->email)) - { - $error++; - setEventMessages($langs->trans("NoSenderEmailDefined"), null, 'warnings'); - $massaction='presend'; - } - - $receiver=$_POST['receiver']; - if (! is_array($receiver)) - { - if (empty($receiver) || $receiver == '-1') $receiver=array(); - else $receiver=array($receiver); - } - if (! trim($_POST['sendto']) && count($receiver) == 0 && count($listofobjectthirdparties) == 1) // if only one recipient, receiver is mandatory - { - $error++; - setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Recipient")), null, 'warnings'); - $massaction='presend'; - } - - if (! GETPOST('subject', 'none')) - { - $error++; - setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("MailTopic")), null, 'warnings'); - $massaction='presend'; - } - - // Loop on each recipient/thirdparty - if (! $error) - { - foreach ($listofobjectthirdparties as $thirdpartyid) - { - $result = $thirdparty->fetch($thirdpartyid); - if ($result < 0) - { - dol_print_error($db); - exit; - } - - $sendto=''; - $sendtocc=''; - $sendtobcc=''; - $sendtoid = array(); - - // Define $sendto - $tmparray=array(); - if (trim($_POST['sendto'])) - { - // Recipients are provided into free text - $tmparray[] = trim($_POST['sendto']); - } - if (count($receiver)>0) - { - foreach($receiver as $key=>$val) - { - // Recipient was provided from combo list - if ($val == 'thirdparty') // Id of third party or user - { - $tmparray[] = $thirdparty->name.' <'.$thirdparty->email.'>'; - } - elseif ($val && method_exists($thirdparty, 'contact_get_property')) // Id of contact - { - $tmparray[] = $thirdparty->contact_get_property((int) $val, 'email'); - $sendtoid[] = $val; - } - } - } - $sendto=implode(',', $tmparray); - - // Define $sendtocc - $receivercc=$_POST['receivercc']; - if (! is_array($receivercc)) - { - if ($receivercc == '-1') $receivercc=array(); - else $receivercc=array($receivercc); - } - $tmparray=array(); - if (trim($_POST['sendtocc'])) - { - $tmparray[] = trim($_POST['sendtocc']); - } - if (count($receivercc) > 0) - { - foreach($receivercc as $key=>$val) - { - // Recipient was provided from combo list - if ($val == 'thirdparty') // Id of third party - { - $tmparray[] = $thirdparty->name.' <'.$thirdparty->email.'>'; - } - elseif ($val) // Id du contact - { - $tmparray[] = $thirdparty->contact_get_property((int) $val, 'email'); - //$sendtoid[] = $val; TODO Add also id of contact in CC ? - } - } - } - $sendtocc=implode(',', $tmparray); - - //var_dump($listofobjectref);exit; - $attachedfiles=array('paths'=>array(), 'names'=>array(), 'mimes'=>array()); - $listofqualifiedobj=array(); - $listofqualifiedref=array(); - $thirdpartywithoutemail=array(); - - foreach($listofobjectref[$thirdpartyid] as $objectid => $objectobj) - { - //var_dump($thirdpartyid.' - '.$objectid.' - '.$objectobj->statut); - if ($objectclass == 'Propal' && $objectobj->statut == Propal::STATUS_DRAFT) - { - $langs->load("errors"); - $nbignored++; - $resaction.='
'.$langs->trans('ErrorOnlyProposalNotDraftCanBeSentInMassAction', $objectobj->ref).'

'; - continue; // Payment done or started or canceled - } - if ($objectclass == 'Commande' && $objectoj->statut == Commande::STATUS_DRAFT) - { - $langs->load("errors"); - $nbignored++; - $resaction.='
'.$langs->trans('ErrorOnlyOrderNotDraftCanBeSentInMassAction', $objectobj->ref).'

'; - continue; - } - if ($objectclass == 'Facture' && $objectobj->statut == Facture::STATUS_DRAFT) - { - $langs->load("errors"); - $nbignored++; - $resaction.='
'.$langs->trans('ErrorOnlyInvoiceValidatedCanBeSentInMassAction', $objectobj->ref).'

'; - continue; // Payment done or started or canceled - } - - // Test recipient - if (empty($sendto)) // For the case, no recipient were set (multi thirdparties send) - { - if ($objectobj->element == 'expensereport') - { - $fuser = new User($db); - $fuser->fetch($objectobj->fk_user_author); - $sendto = $fuser->email; - } - else - { - $objectobj->fetch_thirdparty(); - $sendto = $objectobj->thirdparty->email; - } - } - - if (empty($sendto)) - { - //print "No recipient for thirdparty ".$objectobj->thirdparty->name; - $nbignored++; - if (empty($thirdpartywithoutemail[$objectobj->thirdparty->id])) - { - $resaction.='
'.$langs->trans('NoRecipientEmail', $objectobj->thirdparty->name).'

'; - } - dol_syslog('No recipient for thirdparty: '.$objectobj->thirdparty->name, LOG_WARNING); - $thirdpartywithoutemail[$objectobj->thirdparty->id]=1; - continue; - } - - if ($_POST['addmaindocfile']) - { - // TODO Use future field $objectobj->fullpathdoc to know where is stored default file - // TODO If not defined, use $objectobj->modelpdf (or defaut invoice config) to know what is template to use to regenerate doc. - $filename=dol_sanitizeFileName($objectobj->ref).'.pdf'; - $filedir=$uploaddir . '/' . dol_sanitizeFileName($objectobj->ref); - $file = $filedir . '/' . $filename; - $mime = dol_mimetype($file); - - if (dol_is_file($file)) - { - // Create form object - $attachedfiles=array( - 'paths'=>array_merge($attachedfiles['paths'], array($file)), - 'names'=>array_merge($attachedfiles['names'], array($filename)), - 'mimes'=>array_merge($attachedfiles['mimes'], array($mime)) - ); - } - else - { - $nbignored++; - $langs->load("errors"); - $resaction.='
'.$langs->trans('ErrorCantReadFile', $file).'

'; - dol_syslog('Failed to read file: '.$file, LOG_WARNING); - continue; - } - } - - // Object of thirdparty qualified - $listofqualifiedobj[$objectid]=$objectobj; - $listofqualifiedref[$objectid]=$objectobj->ref; - - - //var_dump($listofqualifiedref); - } - - // Send email if there is at least one qualified record - if (count($listofqualifiedobj) > 0) - { - $langs->load("commercial"); - - $fromtype = GETPOST('fromtype'); - if ($fromtype === 'user') { - $from = $user->getFullName($langs) .' <'.$user->email.'>'; - } - elseif ($fromtype === 'company') { - $from = $conf->global->MAIN_INFO_SOCIETE_NOM .' <'.$conf->global->MAIN_INFO_SOCIETE_MAIL.'>'; - } - elseif (preg_match('/user_aliases_(\d+)/', $fromtype, $reg)) { - $tmp=explode(',', $user->email_aliases); - $from = trim($tmp[($reg[1] - 1)]); - } - elseif (preg_match('/global_aliases_(\d+)/', $fromtype, $reg)) { - $tmp=explode(',', $conf->global->MAIN_INFO_SOCIETE_MAIL_ALIASES); - $from = trim($tmp[($reg[1] - 1)]); - } - elseif (preg_match('/senderprofile_(\d+)_(\d+)/', $fromtype, $reg)) { - $sql='SELECT rowid, label, email FROM '.MAIN_DB_PREFIX.'c_email_senderprofile WHERE rowid = '.(int) $reg[1]; - $resql = $db->query($sql); - $obj = $db->fetch_object($resql); - if ($obj) - { - $from = $obj->label.' <'.$obj->email.'>'; - } - } - else { - $from = $_POST['fromname'] . ' <' . $_POST['frommail'] .'>'; - } - - $replyto = $from; - $subject = GETPOST('subject', 'none'); - $message = GETPOST('message', 'none'); - - $sendtobcc = GETPOST('sendtoccc'); - if ($objectclass == 'Propal') $sendtobcc .= (empty($conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO) ? '' : (($sendtobcc?", ":"").$conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO)); - if ($objectclass == 'Commande') $sendtobcc .= (empty($conf->global->MAIN_MAIL_AUTOCOPY_ORDER_TO) ? '' : (($sendtobcc?", ":"").$conf->global->MAIN_MAIL_AUTOCOPY_ORDER_TO)); - if ($objectclass == 'Facture') $sendtobcc .= (empty($conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO) ? '' : (($sendtobcc?", ":"").$conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO)); - if ($objectclass == 'Supplier_Proposal') $sendtobcc .= (empty($conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_PROPOSAL_TO) ? '' : (($sendtobcc?", ":"").$conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_PROPOSAL_TO)); - if ($objectclass == 'CommandeFournisseur') $sendtobcc .= (empty($conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_ORDER_TO) ? '' : (($sendtobcc?", ":"").$conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_ORDER_TO)); - if ($objectclass == 'FactureFournisseur') $sendtobcc .= (empty($conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_INVOICE_TO) ? '' : (($sendtobcc?", ":"").$conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_INVOICE_TO)); - - // $listofqualifiedobj is array with key = object id and value is instance of qualified objects, for the current thirdparty (but thirdparty property is not loaded yet) - $oneemailperrecipient=(GETPOST('oneemailperrecipient')=='on'?1:0); - $looparray=array(); - if (! $oneemailperrecipient) - { - $looparray = $listofqualifiedobj; - foreach ($looparray as $key => $objecttmp) - { - $looparray[$key]->thirdparty = $thirdparty; - } - } - else - { - $objectforloop=new $objectclass($db); - $objectforloop->thirdparty = $thirdparty; - $looparray[0]=$objectforloop; - } - //var_dump($looparray);exit; - - foreach ($looparray as $objecttmp) // $objecttmp is a real object or an empty object if we choose to send one email per thirdparty instead of one per record - { - // Make substitution in email content - $substitutionarray=getCommonSubstitutionArray($langs, 0, null, $objecttmp); - $substitutionarray['__ID__'] = ($oneemailperrecipient ? join(', ', array_keys($listofqualifiedobj)) : $objecttmp->id); - $substitutionarray['__REF__'] = ($oneemailperrecipient ? join(', ', $listofqualifiedref) : $objecttmp->ref); - $substitutionarray['__EMAIL__'] = $thirdparty->email; - $substitutionarray['__CHECK_READ__'] = ''; - - $parameters=array('mode'=>'formemail'); - - if ( ! empty( $listofobjectthirdparties ) ) { - $parameters['listofobjectthirdparties'] = $listofobjectthirdparties; - } - if ( ! empty( $listofobjectref ) ) { - $parameters['listofobjectref'] = $listofobjectref; - } - - complete_substitutions_array($substitutionarray, $langs, $objecttmp, $parameters); - - $subject=make_substitutions($subject, $substitutionarray); - $message=make_substitutions($message, $substitutionarray); - - $filepath = $attachedfiles['paths']; - $filename = $attachedfiles['names']; - $mimetype = $attachedfiles['mimes']; - - // Define the trackid when emails sent from the mass action - if ($oneemailperrecipient) - { - $trackid='thi'.$thirdparty->id; - if ($objecttmp->element == 'expensereport') $trackid='use'.$thirdparty->id; - if ($objecttmp->element == 'holiday') $trackid='use'.$thirdparty->id; - } - else - { - $trackid=strtolower(get_class($objecttmp)); - if (get_class($objecttmp)=='Contrat') $trackid='con'; - if (get_class($objecttmp)=='Propal') $trackid='pro'; - if (get_class($objecttmp)=='Commande') $trackid='ord'; - if (get_class($objecttmp)=='Facture') $trackid='inv'; - if (get_class($objecttmp)=='Supplier_Proposal') $trackid='spr'; - if (get_class($objecttmp)=='CommandeFournisseur') $trackid='sor'; - if (get_class($objecttmp)=='FactureFournisseur') $trackid='sin'; - - $trackid.=$objecttmp->id; - } - //var_dump($filepath); - //var_dump($trackid);exit; - - // Send mail (substitutionarray must be done just before this) - require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; - $mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, $sendtobcc, $deliveryreceipt, -1, '', '', $trackid); - if ($mailfile->error) - { - $resaction.='
'.$mailfile->error.'
'; - } - else - { - $result=$mailfile->sendfile(); - if ($result) - { - $resaction.=$langs->trans('MailSuccessfulySent', $mailfile->getValidAddress($from, 2), $mailfile->getValidAddress($sendto, 2)).'
'; // Must not contain " - - $error=0; - - // Insert logs into agenda - foreach($listofqualifiedobj as $objid => $objectobj) - { - dol_syslog("Try to insert email event into agenda for objid=".$objid." => objectobj=".get_class($objectobj)); - - /*if ($objectclass == 'Propale') $actiontypecode='AC_PROP'; - if ($objectclass == 'Commande') $actiontypecode='AC_COM'; - if ($objectclass == 'Facture') $actiontypecode='AC_FAC'; - if ($objectclass == 'Supplier_Proposal') $actiontypecode='AC_SUP_PRO'; - if ($objectclass == 'CommandeFournisseur') $actiontypecode='AC_SUP_ORD'; - if ($objectclass == 'FactureFournisseur') $actiontypecode='AC_SUP_INV';*/ - - $actionmsg=$langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto; - if ($message) - { - if ($sendtocc) $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc); - $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject); - $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":"); - $actionmsg = dol_concatdesc($actionmsg, $message); - } - $actionmsg2=''; - - // Initialisation donnees - $objectobj->sendtoid = 0; - $objectobj->actionmsg = $actionmsg; // Long text - $objectobj->actionmsg2 = $actionmsg2; // Short text - $objectobj->fk_element = $objid; - $objectobj->elementtype = $objectobj->element; - - $triggername = strtoupper(get_class($objectobj)) .'_SENTBYMAIL'; - if ($triggername == 'SOCIETE_SENTBYMAIL') $triggername = 'COMPANY_SENTBYMAIL'; - if ($triggername == 'CONTRAT_SENTBYMAIL') $triggername = 'CONTRACT_SENTBYMAIL'; - if ($triggername == 'COMMANDE_SENTBYMAIL') $triggername = 'ORDER_SENTBYMAIL'; - if ($triggername == 'FACTURE_SENTBYMAIL') $triggername = 'BILL_SENTBYMAIL'; - if ($triggername == 'EXPEDITION_SENTBYMAIL') $triggername = 'SHIPPING_SENTBYMAIL'; - if ($triggername == 'COMMANDEFOURNISSEUR_SENTBYMAIL') $triggername = 'ORDER_SUPPLIER_SENTBYMAIL'; - if ($triggername == 'FACTUREFOURNISSEUR_SENTBYMAIL') $triggername = 'BILL_SUPPLIER_SENTBYMAIL'; - if ($triggername == 'SUPPLIERPROPOSAL_SENTBYMAIL') $triggername = 'PROPOSAL_SUPPLIER_SENTBYMAIL'; - - if (! empty($triggername)) - { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php"; - $interface=new Interfaces($db); - $result=$interface->run_triggers($triggername, $objectobj, $user, $langs, $conf); - if ($result < 0) { $error++; $errors=$interface->errors; } - // Fin appel triggers - - if ($error) - { - setEventMessages($db->lasterror(), $errors, 'errors'); - dol_syslog("Error in trigger ".$triggername.' '.$db->lasterror(), LOG_ERR); - } - } - - $nbsent++; - } - } - else - { - $langs->load("other"); - if ($mailfile->error) - { - $resaction.=$langs->trans('ErrorFailedToSendMail', $from, $sendto); - $resaction.='
'.$mailfile->error.'
'; - } - else - { - $resaction.='
No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS
'; - } - } - } - } - } - } - - $resaction.=($resaction?'
':$resaction); - $resaction.=''.$langs->trans("ResultOfMailSending").':
'."\n"; - $resaction.=$langs->trans("NbSelected").': '.count($toselect)."\n
"; - $resaction.=$langs->trans("NbIgnored").': '.($nbignored?$nbignored:0)."\n
"; - $resaction.=$langs->trans("NbSent").': '.($nbsent?$nbsent:0)."\n
"; - - if ($nbsent) - { - $action=''; // Do not show form post if there was at least one successfull sent - //setEventMessages($langs->trans("EMailSentToNRecipients", $nbsent.'/'.count($toselect)), null, 'mesgs'); - setEventMessages($langs->trans("EMailSentForNElements", $nbsent.'/'.count($toselect)), null, 'mesgs'); - setEventMessages($resaction, null, 'mesgs'); - } - else - { - //setEventMessages($langs->trans("EMailSentToNRecipients", 0), null, 'warnings'); // May be object has no generated PDF file - setEventMessages($resaction, null, 'warnings'); - } - - $action='list'; - $massaction=''; - } + $resaction = ''; + $nbsent = 0; + $nbignored = 0; + $langs->load("mails"); + include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + + $listofobjectid=array(); + $listofobjectthirdparties=array(); + $listofobjectref=array(); + + if (! $error) + { + $thirdparty=new Societe($db); + + $objecttmp=new $objectclass($db); + if ($objecttmp->element == 'expensereport') $thirdparty=new User($db); + if ($objecttmp->element == 'holiday') $thirdparty=new User($db); + + foreach($toselect as $toselectid) + { + $objecttmp=new $objectclass($db); // we must create new instance because instance is saved into $listofobjectref array for future use + $result=$objecttmp->fetch($toselectid); + if ($result > 0) + { + $listofobjectid[$toselectid]=$toselectid; + + $thirdpartyid=($objecttmp->fk_soc?$objecttmp->fk_soc:$objecttmp->socid); + if ($objecttmp->element == 'societe') $thirdpartyid=$objecttmp->id; + if ($objecttmp->element == 'expensereport') $thirdpartyid=$objecttmp->fk_user_author; + if ($objecttmp->element == 'holiday') $thirdpartyid=$objecttmp->fk_user; + if (empty($thirdpartyid)) $thirdpartyid=0; + + $listofobjectthirdparties[$thirdpartyid]=$thirdpartyid; + $listofobjectref[$thirdpartyid][$toselectid]=$objecttmp; + } + } + } + + // Check mandatory parameters + if (GETPOST('fromtype','alpha') === 'user' && empty($user->email)) + { + $error++; + setEventMessages($langs->trans("NoSenderEmailDefined"), null, 'warnings'); + $massaction='presend'; + } + + $receiver=$_POST['receiver']; + if (! is_array($receiver)) + { + if (empty($receiver) || $receiver == '-1') $receiver=array(); + else $receiver=array($receiver); + } + if (! trim($_POST['sendto']) && count($receiver) == 0 && count($listofobjectthirdparties) == 1) // if only one recipient, receiver is mandatory + { + $error++; + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Recipient")), null, 'warnings'); + $massaction='presend'; + } + + if (! GETPOST('subject','none')) + { + $error++; + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("MailTopic")), null, 'warnings'); + $massaction='presend'; + } + + // Loop on each recipient/thirdparty + if (! $error) + { + foreach ($listofobjectthirdparties as $thirdpartyid) + { + $result = $thirdparty->fetch($thirdpartyid); + if ($result < 0) + { + dol_print_error($db); + exit; + } + + $sendto=''; + $sendtocc=''; + $sendtobcc=''; + $sendtoid = array(); + + // Define $sendto + $tmparray=array(); + if (trim($_POST['sendto'])) + { + // Recipients are provided into free text + $tmparray[] = trim($_POST['sendto']); + } + if (count($receiver)>0) + { + foreach($receiver as $key=>$val) + { + // Recipient was provided from combo list + if ($val == 'thirdparty') // Id of third party or user + { + $tmparray[] = $thirdparty->name.' <'.$thirdparty->email.'>'; + } + elseif ($val && method_exists($thirdparty, 'contact_get_property')) // Id of contact + { + $tmparray[] = $thirdparty->contact_get_property((int) $val,'email'); + $sendtoid[] = $val; + } + } + } + $sendto=implode(',',$tmparray); + + // Define $sendtocc + $receivercc=$_POST['receivercc']; + if (! is_array($receivercc)) + { + if ($receivercc == '-1') $receivercc=array(); + else $receivercc=array($receivercc); + } + $tmparray=array(); + if (trim($_POST['sendtocc'])) + { + $tmparray[] = trim($_POST['sendtocc']); + } + if (count($receivercc) > 0) + { + foreach($receivercc as $key=>$val) + { + // Recipient was provided from combo list + if ($val == 'thirdparty') // Id of third party + { + $tmparray[] = $thirdparty->name.' <'.$thirdparty->email.'>'; + } + elseif ($val) // Id du contact + { + $tmparray[] = $thirdparty->contact_get_property((int) $val,'email'); + //$sendtoid[] = $val; TODO Add also id of contact in CC ? + } + } + } + $sendtocc=implode(',',$tmparray); + + //var_dump($listofobjectref);exit; + $attachedfiles=array('paths'=>array(), 'names'=>array(), 'mimes'=>array()); + $listofqualifiedobj=array(); + $listofqualifiedref=array(); + $thirdpartywithoutemail=array(); + + foreach($listofobjectref[$thirdpartyid] as $objectid => $objectobj) + { + //var_dump($thirdpartyid.' - '.$objectid.' - '.$objectobj->statut); + if ($objectclass == 'Propal' && $objectobj->statut == Propal::STATUS_DRAFT) + { + $langs->load("errors"); + $nbignored++; + $resaction.='
'.$langs->trans('ErrorOnlyProposalNotDraftCanBeSentInMassAction',$objectobj->ref).'

'; + continue; // Payment done or started or canceled + } + if ($objectclass == 'Commande' && $objectoj->statut == Commande::STATUS_DRAFT) + { + $langs->load("errors"); + $nbignored++; + $resaction.='
'.$langs->trans('ErrorOnlyOrderNotDraftCanBeSentInMassAction',$objectobj->ref).'

'; + continue; + } + if ($objectclass == 'Facture' && $objectobj->statut == Facture::STATUS_DRAFT) + { + $langs->load("errors"); + $nbignored++; + $resaction.='
'.$langs->trans('ErrorOnlyInvoiceValidatedCanBeSentInMassAction',$objectobj->ref).'

'; + continue; // Payment done or started or canceled + } + + // Test recipient + if (empty($sendto)) // For the case, no recipient were set (multi thirdparties send) + { + if ($objectobj->element == 'expensereport') + { + $fuser = new User($db); + $fuser->fetch($objectobj->fk_user_author); + $sendto = $fuser->email; + } + elseif ($objectobj->element == 'holiday') + { + $fuser = new User($db); + $fuser->fetch($objectobj->fk_user); + $sendto = $fuser->email; + } + else + { + $objectobj->fetch_thirdparty(); + $sendto = $objectobj->thirdparty->email; + } + } + + if (empty($sendto)) + { + //print "No recipient for thirdparty ".$objectobj->thirdparty->name; + $nbignored++; + if (empty($thirdpartywithoutemail[$objectobj->thirdparty->id])) + { + $resaction.='
'.$langs->trans('NoRecipientEmail',$objectobj->thirdparty->name).'

'; + } + dol_syslog('No recipient for thirdparty: '.$objectobj->thirdparty->name, LOG_WARNING); + $thirdpartywithoutemail[$objectobj->thirdparty->id]=1; + continue; + } + + if ($_POST['addmaindocfile']) + { + // TODO Use future field $objectobj->fullpathdoc to know where is stored default file + // TODO If not defined, use $objectobj->modelpdf (or defaut invoice config) to know what is template to use to regenerate doc. + $filename=dol_sanitizeFileName($objectobj->ref).'.pdf'; + $filedir=$uploaddir . '/' . dol_sanitizeFileName($objectobj->ref); + $file = $filedir . '/' . $filename; + $mime = dol_mimetype($file); + + if (dol_is_file($file)) + { + // Create form object + $attachedfiles=array( + 'paths'=>array_merge($attachedfiles['paths'],array($file)), + 'names'=>array_merge($attachedfiles['names'],array($filename)), + 'mimes'=>array_merge($attachedfiles['mimes'],array($mime)) + ); + } + else + { + $nbignored++; + $langs->load("errors"); + $resaction.='
'.$langs->trans('ErrorCantReadFile',$file).'

'; + dol_syslog('Failed to read file: '.$file, LOG_WARNING); + continue; + } + } + + // Object of thirdparty qualified, we add it + $listofqualifiedobj[$objectid]=$objectobj; + $listofqualifiedref[$objectid]=$objectobj->ref; + + //var_dump($listofqualifiedref); + } + + // Send email if there is at least one qualified object for current thirdparty + if (count($listofqualifiedobj) > 0) + { + $langs->load("commercial"); + + $fromtype = GETPOST('fromtype'); + if ($fromtype === 'user') { + $from = $user->getFullName($langs) .' <'.$user->email.'>'; + } + elseif ($fromtype === 'company') { + $from = $conf->global->MAIN_INFO_SOCIETE_NOM .' <'.$conf->global->MAIN_INFO_SOCIETE_MAIL.'>'; + } + elseif (preg_match('/user_aliases_(\d+)/', $fromtype, $reg)) { + $tmp=explode(',', $user->email_aliases); + $from = trim($tmp[($reg[1] - 1)]); + } + elseif (preg_match('/global_aliases_(\d+)/', $fromtype, $reg)) { + $tmp=explode(',', $conf->global->MAIN_INFO_SOCIETE_MAIL_ALIASES); + $from = trim($tmp[($reg[1] - 1)]); + } + elseif (preg_match('/senderprofile_(\d+)_(\d+)/', $fromtype, $reg)) { + $sql='SELECT rowid, label, email FROM '.MAIN_DB_PREFIX.'c_email_senderprofile WHERE rowid = '.(int) $reg[1]; + $resql = $db->query($sql); + $obj = $db->fetch_object($resql); + if ($obj) + { + $from = $obj->label.' <'.$obj->email.'>'; + } + } + else { + $from = $_POST['fromname'] . ' <' . $_POST['frommail'] .'>'; + } + + $replyto = $from; + $subject = GETPOST('subject','none'); + $message = GETPOST('message','none'); + + $sendtobcc = GETPOST('sendtoccc'); + if ($objectclass == 'Propal') $sendtobcc .= (empty($conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO) ? '' : (($sendtobcc?", ":"").$conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO)); + if ($objectclass == 'Commande') $sendtobcc .= (empty($conf->global->MAIN_MAIL_AUTOCOPY_ORDER_TO) ? '' : (($sendtobcc?", ":"").$conf->global->MAIN_MAIL_AUTOCOPY_ORDER_TO)); + if ($objectclass == 'Facture') $sendtobcc .= (empty($conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO) ? '' : (($sendtobcc?", ":"").$conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO)); + if ($objectclass == 'Supplier_Proposal') $sendtobcc .= (empty($conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_PROPOSAL_TO) ? '' : (($sendtobcc?", ":"").$conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_PROPOSAL_TO)); + if ($objectclass == 'CommandeFournisseur') $sendtobcc .= (empty($conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_ORDER_TO) ? '' : (($sendtobcc?", ":"").$conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_ORDER_TO)); + if ($objectclass == 'FactureFournisseur') $sendtobcc .= (empty($conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_INVOICE_TO) ? '' : (($sendtobcc?", ":"").$conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_INVOICE_TO)); + + // $listofqualifiedobj is array with key = object id and value is instance of qualified objects, for the current thirdparty (but thirdparty property is not loaded yet) + // $looparray will be an array with number of email to send for the current thirdparty (so 1 or n if n object for same thirdparty) + $oneemailperrecipient=(GETPOST('oneemailperrecipient','alpha')=='on'?1:0); + $looparray=array(); + if (! $oneemailperrecipient) + { + $looparray = $listofqualifiedobj; + foreach ($looparray as $key => $objecttmp) + { + $looparray[$key]->thirdparty = $thirdparty; // Force thirdparty on object + } + } + else + { + $objectforloop=new $objectclass($db); + $objectforloop->thirdparty = $thirdparty; // Force thirdparty on object (even if object was not loaded) + $looparray[0]=$objectforloop; + } + //var_dump($looparray);exit; + dol_syslog("We have set an array of ".count($looparray)." emails to send"); + + foreach ($looparray as $objectid => $objecttmp) // $objecttmp is a real object or an empty object if we choose to send one email per thirdparty instead of one per object + { + // Make substitution in email content + $substitutionarray=getCommonSubstitutionArray($langs, 0, null, $objecttmp); + $substitutionarray['__ID__'] = ($oneemailperrecipient ? join(', ',array_keys($listofqualifiedobj)) : $objecttmp->id); + $substitutionarray['__REF__'] = ($oneemailperrecipient ? join(', ',$listofqualifiedref) : $objecttmp->ref); + $substitutionarray['__EMAIL__'] = $thirdparty->email; + $substitutionarray['__CHECK_READ__'] = ''; + + $parameters=array('mode'=>'formemail'); + + if ( ! empty( $listofobjectthirdparties ) ) { + $parameters['listofobjectthirdparties'] = $listofobjectthirdparties; + } + if ( ! empty( $listofobjectref ) ) { + $parameters['listofobjectref'] = $listofobjectref; + } + + complete_substitutions_array($substitutionarray, $langs, $objecttmp, $parameters); + + $subject=make_substitutions($subject, $substitutionarray); + $message=make_substitutions($message, $substitutionarray); + + $filepath = $attachedfiles['paths']; + $filename = $attachedfiles['names']; + $mimetype = $attachedfiles['mimes']; + + // Define the trackid when emails sent from the mass action + if ($oneemailperrecipient) + { + $trackid='thi'.$thirdparty->id; + if ($objecttmp->element == 'expensereport') $trackid='use'.$thirdparty->id; + if ($objecttmp->element == 'holiday') $trackid='use'.$thirdparty->id; + } + else + { + $trackid=strtolower(get_class($objecttmp)); + if (get_class($objecttmp)=='Contrat') $trackid='con'; + if (get_class($objecttmp)=='Propal') $trackid='pro'; + if (get_class($objecttmp)=='Commande') $trackid='ord'; + if (get_class($objecttmp)=='Facture') $trackid='inv'; + if (get_class($objecttmp)=='Supplier_Proposal') $trackid='spr'; + if (get_class($objecttmp)=='CommandeFournisseur') $trackid='sor'; + if (get_class($objecttmp)=='FactureFournisseur') $trackid='sin'; + + $trackid.=$objecttmp->id; + } + //var_dump($filepath); + //var_dump($trackid);exit; + + // Send mail (substitutionarray must be done just before this) + require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; + $mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,$sendtobcc,$deliveryreceipt,-1,'','',$trackid); + if ($mailfile->error) + { + $resaction.='
'.$mailfile->error.'
'; + } + else + { + $result=$mailfile->sendfile(); + if ($result) + { + $resaction.=$langs->trans('MailSuccessfulySent',$mailfile->getValidAddress($from,2),$mailfile->getValidAddress($sendto,2)).'
'; // Must not contain " + + $error=0; + + // Insert logs into agenda + foreach($listofqualifiedobj as $objid2 => $objectobj2) + { + if ((! $oneemailperrecipient) && $objid2 != $objectid) continue; // We discard this pass to avoid duplicate with other pass in looparray at higher level + + dol_syslog("Try to insert email event into agenda for objid=".$objid2." => objectobj=".get_class($objectobj2)); + + /*if ($objectclass == 'Propale') $actiontypecode='AC_PROP'; + if ($objectclass == 'Commande') $actiontypecode='AC_COM'; + if ($objectclass == 'Facture') $actiontypecode='AC_FAC'; + if ($objectclass == 'Supplier_Proposal') $actiontypecode='AC_SUP_PRO'; + if ($objectclass == 'CommandeFournisseur') $actiontypecode='AC_SUP_ORD'; + if ($objectclass == 'FactureFournisseur') $actiontypecode='AC_SUP_INV';*/ + + $actionmsg=$langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto; + if ($message) + { + if ($sendtocc) $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc); + $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject); + $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":"); + $actionmsg = dol_concatdesc($actionmsg, $message); + } + $actionmsg2=''; + + // Initialisation donnees + $objectobj2->sendtoid = 0; + $objectobj2->actionmsg = $actionmsg; // Long text + $objectobj2->actionmsg2 = $actionmsg2; // Short text + $objectobj2->fk_element = $objid2; + $objectobj2->elementtype = $objectobj2->element; + + $triggername = strtoupper(get_class($objectobj2)) .'_SENTBYMAIL'; + if ($triggername == 'SOCIETE_SENTBYMAIL') $triggername = 'COMPANY_SENTBYMAIL'; + if ($triggername == 'CONTRAT_SENTBYMAIL') $triggername = 'CONTRACT_SENTBYMAIL'; + if ($triggername == 'COMMANDE_SENTBYMAIL') $triggername = 'ORDER_SENTBYMAIL'; + if ($triggername == 'FACTURE_SENTBYMAIL') $triggername = 'BILL_SENTBYMAIL'; + if ($triggername == 'EXPEDITION_SENTBYMAIL') $triggername = 'SHIPPING_SENTBYMAIL'; + if ($triggername == 'COMMANDEFOURNISSEUR_SENTBYMAIL') $triggername = 'ORDER_SUPPLIER_SENTBYMAIL'; + if ($triggername == 'FACTUREFOURNISSEUR_SENTBYMAIL') $triggername = 'BILL_SUPPLIER_SENTBYMAIL'; + if ($triggername == 'SUPPLIERPROPOSAL_SENTBYMAIL') $triggername = 'PROPOSAL_SUPPLIER_SENTBYMAIL'; + + if (! empty($triggername)) + { + // Appel des triggers + include_once DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php"; + $interface=new Interfaces($db); + $result=$interface->run_triggers($triggername, $objectobj2, $user, $langs, $conf); + if ($result < 0) { $error++; $errors=$interface->errors; } + // Fin appel triggers + + if ($error) + { + setEventMessages($db->lasterror(), $errors, 'errors'); + dol_syslog("Error in trigger ".$triggername.' '.$db->lasterror(), LOG_ERR); + } + } + } + + $nbsent++; // Nb of email sent (may be lower than number of record selected if we group thirdparties) + } + else + { + $langs->load("other"); + if ($mailfile->error) + { + $resaction.=$langs->trans('ErrorFailedToSendMail',$from,$sendto); + $resaction.='
'.$mailfile->error.'
'; + } + else + { + $resaction.='
No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS
'; + } + } + } + } + } + } + + $resaction.=($resaction?'
':$resaction); + $resaction.=''.$langs->trans("ResultOfMailSending").':
'."\n"; + $resaction.=$langs->trans("NbSelected").': '.count($toselect)."\n
"; + $resaction.=$langs->trans("NbIgnored").': '.($nbignored?$nbignored:0)."\n
"; + $resaction.=$langs->trans("NbSent").': '.($nbsent?$nbsent:0)."\n
"; + + if ($nbsent) + { + $action=''; // Do not show form post if there was at least one successfull sent + //setEventMessages($langs->trans("EMailSentToNRecipients", $nbsent.'/'.count($toselect)), null, 'mesgs'); + setEventMessages($langs->trans("EMailSentForNElements", $nbsent.'/'.count($toselect)), null, 'mesgs'); + setEventMessages($resaction, null, 'mesgs'); + } + else + { + //setEventMessages($langs->trans("EMailSentToNRecipients", 0), null, 'warnings'); // May be object has no generated PDF file + setEventMessages($resaction, null, 'warnings'); + } + + $action='list'; + $massaction=''; + } } if ($massaction == 'confirm_createbills') { - $orders = GETPOST('toselect', 'array'); - $createbills_onebythird = GETPOST('createbills_onebythird', 'int'); - $validate_invoices = GETPOST('valdate_invoices', 'int'); - - $TFact = array(); - $TFactThird = array(); - - $nb_bills_created = 0; - - $db->begin(); - - foreach($orders as $id_order) - { - $cmd = new Commande($db); - if ($cmd->fetch($id_order) <= 0) continue; - - $objecttmp = new Facture($db); - if (!empty($createbills_onebythird) && !empty($TFactThird[$cmd->socid])) $objecttmp = $TFactThird[$cmd->socid]; // If option "one bill per third" is set, we use already created order. - else { - // Load extrafields of order - $cmd->fetch_optionals(); - - $objecttmp->socid = $cmd->socid; - $objecttmp->type = Facture::TYPE_STANDARD; - $objecttmp->cond_reglement_id = $cmd->cond_reglement_id; - $objecttmp->mode_reglement_id = $cmd->mode_reglement_id; - $objecttmp->fk_project = $cmd->fk_project; - - $datefacture = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); - if (empty($datefacture)) - { - $datefacture = dol_mktime(date("h"), date("M"), 0, date("m"), date("d"), date("Y")); - } - - $objecttmp->date = $datefacture; - $objecttmp->origin = 'commande'; - $objecttmp->origin_id = $id_order; - - $objecttmp->array_options = $cmd->array_options; // Copy extrafields - - $res = $objecttmp->create($user); - - if($res > 0) $nb_bills_created++; - } - - if ($objecttmp->id > 0) - { - $sql = "INSERT INTO ".MAIN_DB_PREFIX."element_element ("; - $sql.= "fk_source"; - $sql.= ", sourcetype"; - $sql.= ", fk_target"; - $sql.= ", targettype"; - $sql.= ") VALUES ("; - $sql.= $id_order; - $sql.= ", '".$objecttmp->origin."'"; - $sql.= ", ".$objecttmp->id; - $sql.= ", '".$objecttmp->element."'"; - $sql.= ")"; - - if (! $db->query($sql)) - { - $error++; - } - - if (! $error) - { - $lines = $cmd->lines; - if (empty($lines) && method_exists($cmd, 'fetch_lines')) - { - $cmd->fetch_lines(); - $lines = $cmd->lines; - } - - $fk_parent_line=0; - $num=count($lines); - - for ($i=0;$i<$num;$i++) - { - $desc=($lines[$i]->desc?$lines[$i]->desc:$lines[$i]->libelle); - if ($lines[$i]->subprice < 0) - { - // Negative line, we create a discount line - $discount = new DiscountAbsolute($db); - $discount->fk_soc=$objecttmp->socid; - $discount->amount_ht=abs($lines[$i]->total_ht); - $discount->amount_tva=abs($lines[$i]->total_tva); - $discount->amount_ttc=abs($lines[$i]->total_ttc); - $discount->tva_tx=$lines[$i]->tva_tx; - $discount->fk_user=$user->id; - $discount->description=$desc; - $discountid=$discount->create($user); - if ($discountid > 0) - { - $result=$objecttmp->insert_discount($discountid); - //$result=$discount->link_to_invoice($lineid,$id); - } - else - { - setEventMessages($discount->error, $discount->errors, 'errors'); - $error++; - break; - } - } - else - { - // Positive line - $product_type=($lines[$i]->product_type?$lines[$i]->product_type:0); - // Date start - $date_start=false; - if ($lines[$i]->date_debut_prevue) $date_start=$lines[$i]->date_debut_prevue; - if ($lines[$i]->date_debut_reel) $date_start=$lines[$i]->date_debut_reel; - if ($lines[$i]->date_start) $date_start=$lines[$i]->date_start; - //Date end - $date_end=false; - if ($lines[$i]->date_fin_prevue) $date_end=$lines[$i]->date_fin_prevue; - if ($lines[$i]->date_fin_reel) $date_end=$lines[$i]->date_fin_reel; - if ($lines[$i]->date_end) $date_end=$lines[$i]->date_end; - // Reset fk_parent_line for no child products and special product - if (($lines[$i]->product_type != 9 && empty($lines[$i]->fk_parent_line)) || $lines[$i]->product_type == 9) - { - $fk_parent_line = 0; - } - - // Extrafields - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) { - $lines[$i]->fetch_optionals($lines[$i]->rowid); - $array_options = $lines[$i]->array_options; - } - - $result = $objecttmp->addline( - $desc, - $lines[$i]->subprice, - $lines[$i]->qty, - $lines[$i]->tva_tx, - $lines[$i]->localtax1_tx, - $lines[$i]->localtax2_tx, - $lines[$i]->fk_product, - $lines[$i]->remise_percent, - $date_start, - $date_end, - 0, - $lines[$i]->info_bits, - $lines[$i]->fk_remise_except, - 'HT', - 0, - $product_type, - $ii, - $lines[$i]->special_code, - $objecttmp->origin, - $lines[$i]->rowid, - $fk_parent_line, - $lines[$i]->fk_fournprice, - $lines[$i]->pa_ht, - $lines[$i]->label, - $array_options - ); - if ($result > 0) - { - $lineid=$result; - } - else - { - $lineid=0; - $error++; - break; - } - // Defined the new fk_parent_line - if ($result > 0 && $lines[$i]->product_type == 9) - { - $fk_parent_line = $result; - } - } - } - } - } - - //$cmd->classifyBilled($user); // Disabled. This behavior must be set or not using the workflow module. - - if(!empty($createbills_onebythird) && empty($TFactThird[$cmd->socid])) $TFactThird[$cmd->socid] = $objecttmp; - else $TFact[$objecttmp->id] = $objecttmp; - } - - // Build doc with all invoices - $TAllFact = empty($createbills_onebythird) ? $TFact : $TFactThird; - $toselect = array(); - - if (! $error && $validate_invoices) - { - $massaction = $action = 'builddoc'; - - foreach($TAllFact as &$objecttmp) - { - $result = $objecttmp->validate($user); - if ($result <= 0) - { - $error++; - setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); - break; - } - - $id = $objecttmp->id; // For builddoc action - $object = $objecttmp; - - // Builddoc - $donotredirect = 1; - $upload_dir = $conf->facture->dir_output; - $permissioncreate=$user->rights->facture->creer; - - // Call action to build doc - $savobject = $object; - $object = $objecttmp; - include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; - $object = $savobject; - } - - $massaction = $action = 'confirm_createbills'; - } - - if (! $error) - { - $db->commit(); - setEventMessages($langs->trans('BillCreated', $nb_bills_created), null, 'mesgs'); - - // Make a redirect to avoid to bill twice if we make a refresh or back - $param=''; - if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage); - if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit); - if ($sall) $param.='&sall='.urlencode($sall); - if ($socid > 0) $param.='&socid='.urlencode($socid); - if ($viewstatut != '') $param.='&viewstatut='.urlencode($viewstatut); - if ($search_orderday) $param.='&search_orderday='.urlencode($search_orderday); - if ($search_ordermonth) $param.='&search_ordermonth='.urlencode($search_ordermonth); - if ($search_orderyear) $param.='&search_orderyear='.urlencode($search_orderyear); - if ($search_deliveryday) $param.='&search_deliveryday='.urlencode($search_deliveryday); - if ($search_deliverymonth) $param.='&search_deliverymonth='.urlencode($search_deliverymonth); - if ($search_deliveryyear) $param.='&search_deliveryyear='.urlencode($search_deliveryyear); - if ($search_ref) $param.='&search_ref='.urlencode($search_ref); - if ($search_company) $param.='&search_company='.urlencode($search_company); - if ($search_ref_customer) $param.='&search_ref_customer='.urlencode($search_ref_customer); - if ($search_user > 0) $param.='&search_user='.urlencode($search_user); - if ($search_sale > 0) $param.='&search_sale='.urlencode($search_sale); - if ($search_total_ht != '') $param.='&search_total_ht='.urlencode($search_total_ht); - if ($search_total_vat != '') $param.='&search_total_vat='.urlencode($search_total_vat); - if ($search_total_ttc != '') $param.='&search_total_ttc='.urlencode($search_total_ttc); - if ($search_project_ref >= 0) $param.="&search_project_ref=".urlencode($search_project_ref); - if ($show_files) $param.='&show_files=' .urlencode($show_files); - if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss); - if ($billed != '') $param.='&billed='.urlencode($billed); - - header("Location: ".$_SERVER['PHP_SELF'].'?'.$param); - exit; - } - else - { - $db->rollback(); - $action='create'; - $_GET["origin"]=$_POST["origin"]; - $_GET["originid"]=$_POST["originid"]; - setEventMessages("Error", null, 'errors'); - $error++; - } + $orders = GETPOST('toselect','array'); + $createbills_onebythird = GETPOST('createbills_onebythird', 'int'); + $validate_invoices = GETPOST('valdate_invoices', 'int'); + + $TFact = array(); + $TFactThird = array(); + + $nb_bills_created = 0; + + $db->begin(); + + foreach($orders as $id_order) + { + $cmd = new Commande($db); + if ($cmd->fetch($id_order) <= 0) continue; + + $objecttmp = new Facture($db); + if (!empty($createbills_onebythird) && !empty($TFactThird[$cmd->socid])) $objecttmp = $TFactThird[$cmd->socid]; // If option "one bill per third" is set, we use already created order. + else { + // Load extrafields of order + $cmd->fetch_optionals(); + + $objecttmp->socid = $cmd->socid; + $objecttmp->type = Facture::TYPE_STANDARD; + $objecttmp->cond_reglement_id = $cmd->cond_reglement_id; + $objecttmp->mode_reglement_id = $cmd->mode_reglement_id; + $objecttmp->fk_project = $cmd->fk_project; + + $datefacture = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); + if (empty($datefacture)) + { + $datefacture = dol_mktime(date("h"), date("M"), 0, date("m"), date("d"), date("Y")); + } + + $objecttmp->date = $datefacture; + $objecttmp->origin = 'commande'; + $objecttmp->origin_id = $id_order; + + $objecttmp->array_options = $cmd->array_options; // Copy extrafields + + $res = $objecttmp->create($user); + + if($res > 0) $nb_bills_created++; + } + + if ($objecttmp->id > 0) + { + $sql = "INSERT INTO ".MAIN_DB_PREFIX."element_element ("; + $sql.= "fk_source"; + $sql.= ", sourcetype"; + $sql.= ", fk_target"; + $sql.= ", targettype"; + $sql.= ") VALUES ("; + $sql.= $id_order; + $sql.= ", '".$objecttmp->origin."'"; + $sql.= ", ".$objecttmp->id; + $sql.= ", '".$objecttmp->element."'"; + $sql.= ")"; + + if (! $db->query($sql)) + { + $error++; + } + + if (! $error) + { + $lines = $cmd->lines; + if (empty($lines) && method_exists($cmd, 'fetch_lines')) + { + $cmd->fetch_lines(); + $lines = $cmd->lines; + } + + $fk_parent_line=0; + $num=count($lines); + + for ($i=0;$i<$num;$i++) + { + $desc=($lines[$i]->desc?$lines[$i]->desc:$lines[$i]->libelle); + if ($lines[$i]->subprice < 0) + { + // Negative line, we create a discount line + $discount = new DiscountAbsolute($db); + $discount->fk_soc=$objecttmp->socid; + $discount->amount_ht=abs($lines[$i]->total_ht); + $discount->amount_tva=abs($lines[$i]->total_tva); + $discount->amount_ttc=abs($lines[$i]->total_ttc); + $discount->tva_tx=$lines[$i]->tva_tx; + $discount->fk_user=$user->id; + $discount->description=$desc; + $discountid=$discount->create($user); + if ($discountid > 0) + { + $result=$objecttmp->insert_discount($discountid); + //$result=$discount->link_to_invoice($lineid,$id); + } + else + { + setEventMessages($discount->error, $discount->errors, 'errors'); + $error++; + break; + } + } + else + { + // Positive line + $product_type=($lines[$i]->product_type?$lines[$i]->product_type:0); + // Date start + $date_start=false; + if ($lines[$i]->date_debut_prevue) $date_start=$lines[$i]->date_debut_prevue; + if ($lines[$i]->date_debut_reel) $date_start=$lines[$i]->date_debut_reel; + if ($lines[$i]->date_start) $date_start=$lines[$i]->date_start; + //Date end + $date_end=false; + if ($lines[$i]->date_fin_prevue) $date_end=$lines[$i]->date_fin_prevue; + if ($lines[$i]->date_fin_reel) $date_end=$lines[$i]->date_fin_reel; + if ($lines[$i]->date_end) $date_end=$lines[$i]->date_end; + // Reset fk_parent_line for no child products and special product + if (($lines[$i]->product_type != 9 && empty($lines[$i]->fk_parent_line)) || $lines[$i]->product_type == 9) + { + $fk_parent_line = 0; + } + + // Extrafields + if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) { + $lines[$i]->fetch_optionals($lines[$i]->rowid); + $array_options = $lines[$i]->array_options; + } + + $result = $objecttmp->addline( + $desc, + $lines[$i]->subprice, + $lines[$i]->qty, + $lines[$i]->tva_tx, + $lines[$i]->localtax1_tx, + $lines[$i]->localtax2_tx, + $lines[$i]->fk_product, + $lines[$i]->remise_percent, + $date_start, + $date_end, + 0, + $lines[$i]->info_bits, + $lines[$i]->fk_remise_except, + 'HT', + 0, + $product_type, + $ii, + $lines[$i]->special_code, + $objecttmp->origin, + $lines[$i]->rowid, + $fk_parent_line, + $lines[$i]->fk_fournprice, + $lines[$i]->pa_ht, + $lines[$i]->label, + $array_options + ); + if ($result > 0) + { + $lineid=$result; + } + else + { + $lineid=0; + $error++; + break; + } + // Defined the new fk_parent_line + if ($result > 0 && $lines[$i]->product_type == 9) + { + $fk_parent_line = $result; + } + } + } + } + } + + //$cmd->classifyBilled($user); // Disabled. This behavior must be set or not using the workflow module. + + if(!empty($createbills_onebythird) && empty($TFactThird[$cmd->socid])) $TFactThird[$cmd->socid] = $objecttmp; + else $TFact[$objecttmp->id] = $objecttmp; + } + + // Build doc with all invoices + $TAllFact = empty($createbills_onebythird) ? $TFact : $TFactThird; + $toselect = array(); + + if (! $error && $validate_invoices) + { + $massaction = $action = 'builddoc'; + + foreach($TAllFact as &$objecttmp) + { + $result = $objecttmp->validate($user); + if ($result <= 0) + { + $error++; + setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); + break; + } + + $id = $objecttmp->id; // For builddoc action + $object = $objecttmp; + + // Builddoc + $donotredirect = 1; + $upload_dir = $conf->facture->dir_output; + $permissioncreate=$user->rights->facture->creer; + + // Call action to build doc + $savobject = $object; + $object = $objecttmp; + include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; + $object = $savobject; + } + + $massaction = $action = 'confirm_createbills'; + } + + if (! $error) + { + $db->commit(); + setEventMessages($langs->trans('BillCreated', $nb_bills_created), null, 'mesgs'); + + // Make a redirect to avoid to bill twice if we make a refresh or back + $param=''; + if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage); + if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit); + if ($sall) $param.='&sall='.urlencode($sall); + if ($socid > 0) $param.='&socid='.urlencode($socid); + if ($viewstatut != '') $param.='&viewstatut='.urlencode($viewstatut); + if ($search_orderday) $param.='&search_orderday='.urlencode($search_orderday); + if ($search_ordermonth) $param.='&search_ordermonth='.urlencode($search_ordermonth); + if ($search_orderyear) $param.='&search_orderyear='.urlencode($search_orderyear); + if ($search_deliveryday) $param.='&search_deliveryday='.urlencode($search_deliveryday); + if ($search_deliverymonth) $param.='&search_deliverymonth='.urlencode($search_deliverymonth); + if ($search_deliveryyear) $param.='&search_deliveryyear='.urlencode($search_deliveryyear); + if ($search_ref) $param.='&search_ref='.urlencode($search_ref); + if ($search_company) $param.='&search_company='.urlencode($search_company); + if ($search_ref_customer) $param.='&search_ref_customer='.urlencode($search_ref_customer); + if ($search_user > 0) $param.='&search_user='.urlencode($search_user); + if ($search_sale > 0) $param.='&search_sale='.urlencode($search_sale); + if ($search_total_ht != '') $param.='&search_total_ht='.urlencode($search_total_ht); + if ($search_total_vat != '') $param.='&search_total_vat='.urlencode($search_total_vat); + if ($search_total_ttc != '') $param.='&search_total_ttc='.urlencode($search_total_ttc); + if ($search_project_ref >= 0) $param.="&search_project_ref=".urlencode($search_project_ref); + if ($show_files) $param.='&show_files=' .urlencode($show_files); + if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss); + if ($billed != '') $param.='&billed='.urlencode($billed); + + header("Location: ".$_SERVER['PHP_SELF'].'?'.$param); + exit; + } + else + { + $db->rollback(); + $action='create'; + $_GET["origin"]=$_POST["origin"]; + $_GET["originid"]=$_POST["originid"]; + setEventMessages("Error", null, 'errors'); + $error++; + } } if (!$error && $massaction == 'cancelorders') { - - $db->begin(); - - $nbok = 0; - - - $orders = GETPOST('toselect', 'array'); - foreach ($orders as $id_order) - { - - $cmd = new Commande($db); - if ($cmd->fetch($id_order) <= 0) - continue; - - if ($cmd->statut != Commande::STATUS_VALIDATED) - { - $langs->load('errors'); - setEventMessages($langs->trans("ErrorObjectMustHaveStatusValidToBeCanceled", $cmd->ref), null, 'errors'); - $error++; - break; - } - else - $result = $cmd->cancel(); - - if ($result < 0) - { - setEventMessages($cmd->error, $cmd->errors, 'errors'); - $error++; - break; - } - else - $nbok++; - } - if (!$error) - { - if ($nbok > 1) - setEventMessages($langs->trans("RecordsModified", $nbok), null, 'mesgs'); - else - setEventMessages($langs->trans("RecordsModified", $nbok), null, 'mesgs'); - $db->commit(); - } - else - { - $db->rollback(); - } + + $db->begin(); + + $nbok = 0; + + + $orders = GETPOST('toselect', 'array'); + foreach ($orders as $id_order) + { + + $cmd = new Commande($db); + if ($cmd->fetch($id_order) <= 0) + continue; + + if ($cmd->statut != Commande::STATUS_VALIDATED) + { + $langs->load('errors'); + setEventMessages($langs->trans("ErrorObjectMustHaveStatusValidToBeCanceled", $cmd->ref), null, 'errors'); + $error++; + break; + } + else + $result = $cmd->cancel(); + + if ($result < 0) + { + setEventMessages($cmd->error, $cmd->errors, 'errors'); + $error++; + break; + } + else + $nbok++; + } + if (!$error) + { + if ($nbok > 1) + setEventMessages($langs->trans("RecordsModified", $nbok), null, 'mesgs'); + else + setEventMessages($langs->trans("RecordsModified", $nbok), null, 'mesgs'); + $db->commit(); + } + else + { + $db->rollback(); + } } if (! $error && $massaction == "builddoc" && $permtoread && ! GETPOST('button_search')) { - if (empty($diroutputmassaction)) - { - dol_print_error(null, 'include of actions_massactions.inc.php is done but var $diroutputmassaction was not defined'); - exit; - } - - require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; - require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; - - $objecttmp=new $objectclass($db); - $listofobjectid=array(); - $listofobjectthirdparties=array(); - $listofobjectref=array(); - foreach($toselect as $toselectid) - { - $objecttmp=new $objectclass($db); // must create new instance because instance is saved into $listofobjectref array for future use - $result=$objecttmp->fetch($toselectid); - if ($result > 0) - { - $listofobjectid[$toselectid]=$toselectid; - $thirdpartyid=$objecttmp->fk_soc?$objecttmp->fk_soc:$objecttmp->socid; - $listofobjectthirdparties[$thirdpartyid]=$thirdpartyid; - $listofobjectref[$toselectid]=$objecttmp->ref; - } - } - - $arrayofinclusion=array(); - foreach($listofobjectref as $tmppdf) $arrayofinclusion[]='^'.preg_quote(dol_sanitizeFileName($tmppdf), '/').'\.pdf$'; - foreach($listofobjectref as $tmppdf) $arrayofinclusion[]='^'.preg_quote(dol_sanitizeFileName($tmppdf), '/').'_[a-zA-Z0-9-_]+\.pdf$'; // To include PDF generated from ODX files - $listoffiles = dol_dir_list($uploaddir, 'all', 1, implode('|', $arrayofinclusion), '\.meta$|\.png', 'date', SORT_DESC, 0, true); - - // build list of files with full path - $files = array(); - foreach($listofobjectref as $basename) - { - $basename = dol_sanitizeFileName($basename); - foreach($listoffiles as $filefound) - { - if (strstr($filefound["name"], $basename)) - { - $files[] = $uploaddir.'/'.$basename.'/'.$filefound["name"]; - break; - } - } - } - - // Define output language (Here it is not used because we do only merging existing PDF) - $outputlangs = $langs; - $newlang=''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) $newlang=GETPOST('lang_id', 'aZ09'); - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$objecttmp->thirdparty->default_lang; - if (! empty($newlang)) - { - $outputlangs = new Translate("", $conf); - $outputlangs->setDefaultLang($newlang); - } - - if (!empty($conf->global->USE_PDFTK_FOR_PDF_CONCAT)) - { - // Create output dir if not exists - dol_mkdir($diroutputmassaction); - - // Defined name of merged file - $filename=strtolower(dol_sanitizeFileName($langs->transnoentities($objectlabel))); - $filename=preg_replace('/\s/', '_', $filename); - - // Save merged file - if (in_array($objecttmp->element, array('facture', 'facture_fournisseur')) && $search_status == Facture::STATUS_VALIDATED) - { - if ($option=='late') $filename.='_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Unpaid"))).'_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Late"))); - else $filename.='_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Unpaid"))); - } - if ($year) $filename.='_'.$year; - if ($month) $filename.='_'.$month; - - if (count($files)>0) - { - $now=dol_now(); - $file=$diroutputmassaction.'/'.$filename.'_'.dol_print_date($now, 'dayhourlog').'.pdf'; - - $input_files = ''; - foreach($files as $f) { - $input_files.=' '.escapeshellarg($f); - } - - $cmd = 'pdftk '.escapeshellarg($input_files).' cat output '.escapeshellarg($file); - exec($cmd); - - if (! empty($conf->global->MAIN_UMASK)) - @chmod($file, octdec($conf->global->MAIN_UMASK)); - - $langs->load("exports"); - setEventMessages($langs->trans('FileSuccessfullyBuilt', $filename.'_'.dol_print_date($now, 'dayhourlog')), null, 'mesgs'); - } - else - { - setEventMessages($langs->trans('NoPDFAvailableForDocGenAmongChecked'), null, 'errors'); - } - } - else { - // Create empty PDF - $formatarray=pdf_getFormat(); - $page_largeur = $formatarray['width']; - $page_hauteur = $formatarray['height']; - $format = array($page_largeur,$page_hauteur); - - $pdf=pdf_getInstance($format); - - if (class_exists('TCPDF')) - { - $pdf->setPrintHeader(false); - $pdf->setPrintFooter(false); - } - $pdf->SetFont(pdf_getPDFFont($outputlangs)); - - if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false); - - // Add all others - foreach($files as $file) - { - // Charge un document PDF depuis un fichier. - $pagecount = $pdf->setSourceFile($file); - for ($i = 1; $i <= $pagecount; $i++) - { - $tplidx = $pdf->importPage($i); - $s = $pdf->getTemplatesize($tplidx); - $pdf->AddPage($s['h'] > $s['w'] ? 'P' : 'L'); - $pdf->useTemplate($tplidx); - } - } - - // Create output dir if not exists - dol_mkdir($diroutputmassaction); - - // Defined name of merged file - $filename=strtolower(dol_sanitizeFileName($langs->transnoentities($objectlabel))); - $filename=preg_replace('/\s/', '_', $filename); - - // Save merged file - if (in_array($objecttmp->element, array('facture', 'facture_fournisseur')) && $search_status == Facture::STATUS_VALIDATED) - { - if ($option=='late') $filename.='_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Unpaid"))).'_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Late"))); - else $filename.='_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Unpaid"))); - } - if ($year) $filename.='_'.$year; - if ($month) $filename.='_'.$month; - if ($pagecount) - { - $now=dol_now(); - $file=$diroutputmassaction.'/'.$filename.'_'.dol_print_date($now, 'dayhourlog').'.pdf'; - $pdf->Output($file, 'F'); - if (! empty($conf->global->MAIN_UMASK)) - @chmod($file, octdec($conf->global->MAIN_UMASK)); - - $langs->load("exports"); - setEventMessages($langs->trans('FileSuccessfullyBuilt', $filename.'_'.dol_print_date($now, 'dayhourlog')), null, 'mesgs'); - } - else - { - setEventMessages($langs->trans('NoPDFAvailableForDocGenAmongChecked'), null, 'errors'); - } - } + if (empty($diroutputmassaction)) + { + dol_print_error(null, 'include of actions_massactions.inc.php is done but var $diroutputmassaction was not defined'); + exit; + } + + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; + require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; + + $objecttmp=new $objectclass($db); + $listofobjectid=array(); + $listofobjectthirdparties=array(); + $listofobjectref=array(); + foreach($toselect as $toselectid) + { + $objecttmp=new $objectclass($db); // must create new instance because instance is saved into $listofobjectref array for future use + $result=$objecttmp->fetch($toselectid); + if ($result > 0) + { + $listofobjectid[$toselectid]=$toselectid; + $thirdpartyid=$objecttmp->fk_soc?$objecttmp->fk_soc:$objecttmp->socid; + $listofobjectthirdparties[$thirdpartyid]=$thirdpartyid; + $listofobjectref[$toselectid]=$objecttmp->ref; + } + } + + $arrayofinclusion=array(); + foreach($listofobjectref as $tmppdf) $arrayofinclusion[]='^'.preg_quote(dol_sanitizeFileName($tmppdf),'/').'\.pdf$'; + foreach($listofobjectref as $tmppdf) $arrayofinclusion[]='^'.preg_quote(dol_sanitizeFileName($tmppdf),'/').'_[a-zA-Z0-9-_]+\.pdf$'; // To include PDF generated from ODX files + $listoffiles = dol_dir_list($uploaddir,'all',1,implode('|',$arrayofinclusion),'\.meta$|\.png','date',SORT_DESC,0,true); + + // build list of files with full path + $files = array(); + foreach($listofobjectref as $basename) + { + $basename = dol_sanitizeFileName($basename); + foreach($listoffiles as $filefound) + { + if (strstr($filefound["name"],$basename)) + { + $files[] = $uploaddir.'/'.$basename.'/'.$filefound["name"]; + break; + } + } + } + + // Define output language (Here it is not used because we do only merging existing PDF) + $outputlangs = $langs; + $newlang=''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','aZ09')) $newlang=GETPOST('lang_id','aZ09'); + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$objecttmp->thirdparty->default_lang; + if (! empty($newlang)) + { + $outputlangs = new Translate("",$conf); + $outputlangs->setDefaultLang($newlang); + } + + if (!empty($conf->global->USE_PDFTK_FOR_PDF_CONCAT)) + { + // Create output dir if not exists + dol_mkdir($diroutputmassaction); + + // Defined name of merged file + $filename=strtolower(dol_sanitizeFileName($langs->transnoentities($objectlabel))); + $filename=preg_replace('/\s/','_',$filename); + + // Save merged file + if (in_array($objecttmp->element, array('facture', 'facture_fournisseur')) && $search_status == Facture::STATUS_VALIDATED) + { + if ($option=='late') $filename.='_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Unpaid"))).'_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Late"))); + else $filename.='_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Unpaid"))); + } + if ($year) $filename.='_'.$year; + if ($month) $filename.='_'.$month; + + if (count($files)>0) + { + $now=dol_now(); + $file=$diroutputmassaction.'/'.$filename.'_'.dol_print_date($now,'dayhourlog').'.pdf'; + + $input_files = ''; + foreach($files as $f) { + $input_files.=' '.escapeshellarg($f); + } + + $cmd = 'pdftk '.escapeshellarg($input_files).' cat output '.escapeshellarg($file); + exec($cmd); + + if (! empty($conf->global->MAIN_UMASK)) + @chmod($file, octdec($conf->global->MAIN_UMASK)); + + $langs->load("exports"); + setEventMessages($langs->trans('FileSuccessfullyBuilt',$filename.'_'.dol_print_date($now,'dayhourlog')), null, 'mesgs'); + } + else + { + setEventMessages($langs->trans('NoPDFAvailableForDocGenAmongChecked'), null, 'errors'); + } + } + else { + // Create empty PDF + $formatarray=pdf_getFormat(); + $page_largeur = $formatarray['width']; + $page_hauteur = $formatarray['height']; + $format = array($page_largeur,$page_hauteur); + + $pdf=pdf_getInstance($format); + + if (class_exists('TCPDF')) + { + $pdf->setPrintHeader(false); + $pdf->setPrintFooter(false); + } + $pdf->SetFont(pdf_getPDFFont($outputlangs)); + + if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false); + + // Add all others + foreach($files as $file) + { + // Charge un document PDF depuis un fichier. + $pagecount = $pdf->setSourceFile($file); + for ($i = 1; $i <= $pagecount; $i++) + { + $tplidx = $pdf->importPage($i); + $s = $pdf->getTemplatesize($tplidx); + $pdf->AddPage($s['h'] > $s['w'] ? 'P' : 'L'); + $pdf->useTemplate($tplidx); + } + } + + // Create output dir if not exists + dol_mkdir($diroutputmassaction); + + // Defined name of merged file + $filename=strtolower(dol_sanitizeFileName($langs->transnoentities($objectlabel))); + $filename=preg_replace('/\s/','_',$filename); + + // Save merged file + if (in_array($objecttmp->element, array('facture', 'facture_fournisseur')) && $search_status == Facture::STATUS_VALIDATED) + { + if ($option=='late') $filename.='_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Unpaid"))).'_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Late"))); + else $filename.='_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Unpaid"))); + } + if ($year) $filename.='_'.$year; + if ($month) $filename.='_'.$month; + if ($pagecount) + { + $now=dol_now(); + $file=$diroutputmassaction.'/'.$filename.'_'.dol_print_date($now,'dayhourlog').'.pdf'; + $pdf->Output($file,'F'); + if (! empty($conf->global->MAIN_UMASK)) + @chmod($file, octdec($conf->global->MAIN_UMASK)); + + $langs->load("exports"); + setEventMessages($langs->trans('FileSuccessfullyBuilt',$filename.'_'.dol_print_date($now,'dayhourlog')), null, 'mesgs'); + } + else + { + setEventMessages($langs->trans('NoPDFAvailableForDocGenAmongChecked'), null, 'errors'); + } + } } // Remove a file from massaction area if ($action == 'remove_file') { - require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - - $langs->load("other"); - $upload_dir = $diroutputmassaction; - $file = $upload_dir . '/' . GETPOST('file'); - $ret=dol_delete_file($file); - if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('file')), null, 'mesgs'); - else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('file')), null, 'errors'); - $action=''; + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + + $langs->load("other"); + $upload_dir = $diroutputmassaction; + $file = $upload_dir . '/' . GETPOST('file'); + $ret=dol_delete_file($file); + if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('file')), null, 'mesgs'); + else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('file')), null, 'errors'); + $action=''; } // Validate records if (! $error && $massaction == 'validate' && $permtocreate) { - $objecttmp=new $objectclass($db); - - if ($objecttmp->element == 'invoice' && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_BILL)) - { - $langs->load("errors"); - setEventMessages($langs->trans('ErrorMassValidationNotAllowedWhenStockIncreaseOnAction'), null, 'errors'); - $error++; - } - if ($objecttmp->element == 'invoice_supplier' && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL)) - { - $langs->load("errors"); - setEventMessages($langs->trans('ErrorMassValidationNotAllowedWhenStockIncreaseOnAction'), null, 'errors'); - $error++; - } - if (! $error) - { - $db->begin(); - - $nbok = 0; - foreach($toselect as $toselectid) - { - $result=$objecttmp->fetch($toselectid); - if ($result > 0) - { - //if (in_array($objecttmp->element, array('societe','member'))) $result = $objecttmp->delete($objecttmp->id, $user, 1); - //else - $result = $objecttmp->validate($user); - if ($result == 0) - { - $langs->load("errors"); - setEventMessages($langs->trans("ErrorObjectMustHaveStatusDraftToBeValidated", $objecttmp->ref), null, 'errors'); - $error++; - break; - } - elseif ($result < 0) - { - setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); - $error++; - break; - } - else $nbok++; - } - else - { - setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); - $error++; - break; - } - } - - if (! $error) - { - if ($nbok > 1) setEventMessages($langs->trans("RecordsModified", $nbok), null, 'mesgs'); - else setEventMessages($langs->trans("RecordsModified", $nbok), null, 'mesgs'); - $db->commit(); - } - else - { - $db->rollback(); - } - //var_dump($listofobjectthirdparties);exit; - } + $objecttmp=new $objectclass($db); + + if ($objecttmp->element == 'invoice' && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_BILL)) + { + $langs->load("errors"); + setEventMessages($langs->trans('ErrorMassValidationNotAllowedWhenStockIncreaseOnAction'), null, 'errors'); + $error++; + } + if ($objecttmp->element == 'invoice_supplier' && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL)) + { + $langs->load("errors"); + setEventMessages($langs->trans('ErrorMassValidationNotAllowedWhenStockIncreaseOnAction'), null, 'errors'); + $error++; + } + if (! $error) + { + $db->begin(); + + $nbok = 0; + foreach($toselect as $toselectid) + { + $result=$objecttmp->fetch($toselectid); + if ($result > 0) + { + //if (in_array($objecttmp->element, array('societe','member'))) $result = $objecttmp->delete($objecttmp->id, $user, 1); + //else + $result = $objecttmp->validate($user); + if ($result == 0) + { + $langs->load("errors"); + setEventMessages($langs->trans("ErrorObjectMustHaveStatusDraftToBeValidated", $objecttmp->ref), null, 'errors'); + $error++; + break; + } + elseif ($result < 0) + { + setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); + $error++; + break; + } + else $nbok++; + } + else + { + setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); + $error++; + break; + } + } + + if (! $error) + { + if ($nbok > 1) setEventMessages($langs->trans("RecordsModified", $nbok), null, 'mesgs'); + else setEventMessages($langs->trans("RecordsModified", $nbok), null, 'mesgs'); + $db->commit(); + } + else + { + $db->rollback(); + } + //var_dump($listofobjectthirdparties);exit; + } } // Closed records if (!$error && $massaction == 'closed' && $objectclass == "Propal" && $permtoclose) { $db->begin(); - + $objecttmp = new $objectclass($db); $nbok = 0; foreach ($toselect as $toselectid) { @@ -1106,13 +1119,13 @@ if (!$error && $massaction == 'closed' && $objectclass == "Propal" && $permtoclo break; } } - + if (!$error) { if ($nbok > 1) setEventMessages($langs->trans("RecordsModified", $nbok), null, 'mesgs'); - else - setEventMessages($langs->trans("RecordsModified", $nbok), null, 'mesgs'); - $db->commit(); + else + setEventMessages($langs->trans("RecordsModified", $nbok), null, 'mesgs'); + $db->commit(); } else { $db->rollback(); @@ -1121,127 +1134,127 @@ if (!$error && $massaction == 'closed' && $objectclass == "Propal" && $permtoclo // Delete record from mass action (massaction = 'delete' for direct delete, action/confirm='delete'/'yes' with a confirmation step before) if (! $error && ($massaction == 'delete' || ($action == 'delete' && $confirm == 'yes')) && $permtodelete) { - $db->begin(); - - $objecttmp=new $objectclass($db); - $nbok = 0; - foreach($toselect as $toselectid) - { - $result=$objecttmp->fetch($toselectid); - if ($result > 0) - { - // Refuse deletion for some objects/status - if ($objectclass == 'Facture' && empty($conf->global->INVOICE_CAN_ALWAYS_BE_REMOVED) && $objecttmp->status != Facture::STATUS_DRAFT) - { - $langs->load("errors"); - $nbignored++; - $resaction.='
'.$langs->trans('ErrorOnlyDraftStatusCanBeDeletedInMassAction', $objecttmp->ref).'

'; - continue; - } - - if ($objectclass == "Task" && $objecttmp->hasChildren() > 0) - { - $sql = "UPDATE ".MAIN_DB_PREFIX."projet_task SET fk_task_parent = 0 WHERE fk_task_parent = ".$objecttmp->id; - $res = $db->query($sql); - - if (!$res) - { - setEventMessage('ErrorRecordParentingNotModified', 'errors'); - $error++; - } - } - - if (in_array($objecttmp->element, array('societe', 'member'))) $result = $objecttmp->delete($objecttmp->id, $user, 1); - else $result = $objecttmp->delete($user); - - if ($result <= 0) - { - setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); - $error++; - break; - } - else $nbok++; - } - else - { - setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); - $error++; - break; - } - } - - if (! $error) - { - if ($nbok > 1) setEventMessages($langs->trans("RecordsDeleted", $nbok), null, 'mesgs'); - else setEventMessages($langs->trans("RecordDeleted", $nbok), null, 'mesgs'); - $db->commit(); - } - else - { - $db->rollback(); - } - //var_dump($listofobjectthirdparties);exit; + $db->begin(); + + $objecttmp=new $objectclass($db); + $nbok = 0; + foreach($toselect as $toselectid) + { + $result=$objecttmp->fetch($toselectid); + if ($result > 0) + { + // Refuse deletion for some objects/status + if ($objectclass == 'Facture' && empty($conf->global->INVOICE_CAN_ALWAYS_BE_REMOVED) && $objecttmp->status != Facture::STATUS_DRAFT) + { + $langs->load("errors"); + $nbignored++; + $resaction.='
'.$langs->trans('ErrorOnlyDraftStatusCanBeDeletedInMassAction',$objecttmp->ref).'

'; + continue; + } + + if ($objectclass == "Task" && $objecttmp->hasChildren() > 0) + { + $sql = "UPDATE ".MAIN_DB_PREFIX."projet_task SET fk_task_parent = 0 WHERE fk_task_parent = ".$objecttmp->id; + $res = $db->query($sql); + + if (!$res) + { + setEventMessage('ErrorRecordParentingNotModified', 'errors'); + $error++; + } + } + + if (in_array($objecttmp->element, array('societe', 'member'))) $result = $objecttmp->delete($objecttmp->id, $user, 1); + else $result = $objecttmp->delete($user); + + if ($result <= 0) + { + setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); + $error++; + break; + } + else $nbok++; + } + else + { + setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); + $error++; + break; + } + } + + if (! $error) + { + if ($nbok > 1) setEventMessages($langs->trans("RecordsDeleted", $nbok), null, 'mesgs'); + else setEventMessages($langs->trans("RecordDeleted", $nbok), null, 'mesgs'); + $db->commit(); + } + else + { + $db->rollback(); + } + //var_dump($listofobjectthirdparties);exit; } // Generate document foreach object according to model linked to object // @TODO : propose model selection if (! $error && $massaction == 'generate_doc' && $permtoread) { - $db->begin(); - - $objecttmp=new $objectclass($db); - $nbok = 0; - foreach($toselect as $toselectid) - { - $result=$objecttmp->fetch($toselectid); - if ($result > 0) - { - $outputlangs = $langs; - $newlang=''; - - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) $newlang=GETPOST('lang_id', 'aZ09'); - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && isset($objecttmp->thirdparty->default_lang)) $newlang=$objecttmp->thirdparty->default_lang; // for proposal, order, invoice, ... - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && isset($objecttmp->default_lang)) $newlang=$objecttmp->default_lang; // for thirdparty - if (! empty($newlang)) - { - $outputlangs = new Translate("", $conf); - $outputlangs->setDefaultLang($newlang); - } - - // To be sure vars is defined - if (empty($hidedetails)) $hidedetails=0; - if (empty($hidedesc)) $hidedesc=0; - if (empty($hideref)) $hideref=0; - if (empty($moreparams)) $moreparams=null; - - $result= $objecttmp->generateDocument($objecttmp->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams); - - if ($result <= 0) - { - setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); - $error++; - break; - } - else $nbok++; - } - else - { - setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); - $error++; - break; - } - } - - if (! $error) - { - if ($nbok > 1) setEventMessages($langs->trans("RecordsGenerated", $nbok), null, 'mesgs'); - else setEventMessages($langs->trans("RecordGenerated", $nbok), null, 'mesgs'); - $db->commit(); - } - else - { - $db->rollback(); - } + $db->begin(); + + $objecttmp=new $objectclass($db); + $nbok = 0; + foreach($toselect as $toselectid) + { + $result=$objecttmp->fetch($toselectid); + if ($result > 0) + { + $outputlangs = $langs; + $newlang=''; + + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','aZ09')) $newlang=GETPOST('lang_id','aZ09'); + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && isset($objecttmp->thirdparty->default_lang)) $newlang=$objecttmp->thirdparty->default_lang; // for proposal, order, invoice, ... + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && isset($objecttmp->default_lang)) $newlang=$objecttmp->default_lang; // for thirdparty + if (! empty($newlang)) + { + $outputlangs = new Translate("",$conf); + $outputlangs->setDefaultLang($newlang); + } + + // To be sure vars is defined + if (empty($hidedetails)) $hidedetails=0; + if (empty($hidedesc)) $hidedesc=0; + if (empty($hideref)) $hideref=0; + if (empty($moreparams)) $moreparams=null; + + $result= $objecttmp->generateDocument($objecttmp->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams); + + if ($result <= 0) + { + setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); + $error++; + break; + } + else $nbok++; + } + else + { + setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); + $error++; + break; + } + } + + if (! $error) + { + if ($nbok > 1) setEventMessages($langs->trans("RecordsGenerated", $nbok), null, 'mesgs'); + else setEventMessages($langs->trans("RecordGenerated", $nbok), null, 'mesgs'); + $db->commit(); + } + else + { + $db->rollback(); + } } $parameters['toselect']=$toselect; diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 98d676307f8..66cb3cc53f7 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -7,7 +7,7 @@ * Copyright (C) 2012-2015 Marcos García * Copyright (C) 2012-2015 Raphaël Doursenaud * Copyright (C) 2012 Cedric Salvador - * Copyright (C) 2015 Alexandre Spangaro + * Copyright (C) 2015 Alexandre Spangaro * Copyright (C) 2016 Bahfir abbes * Copyright (C) 2017 ATM Consulting * Copyright (C) 2017 Nicolas ZABOURI @@ -310,6 +310,12 @@ abstract class CommonObject */ public $modelpdf; + /** + * @var string + * Contains relative path of last generated main file + */ + public $last_main_doc; + /** * @var int Bank account ID * @see SetBankAccount() @@ -4667,10 +4673,15 @@ abstract class CommonObject if (! empty($obj->update_main_doc_field)) $update_main_doc_field=1; if ($update_main_doc_field && ! empty($this->table_element)) { - $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element." SET last_main_doc = '".($ecmfile->filepath.'/'.$ecmfile->filename)."'"; + $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element." SET last_main_doc = '".$this->db->escape($ecmfile->filepath.'/'.$ecmfile->filename)."'"; $sql.= ' WHERE rowid = '.$this->id; + $resql = $this->db->query($sql); if (! $resql) dol_print_error($this->db); + else + { + $this->last_main_doc = $ecmfile->filepath.'/'.$ecmfile->filename; + } } } } @@ -4900,7 +4911,7 @@ abstract class CommonObject //var_dump('key '.$key.' '.$value.' type='.$extrafields->attributes[$this->table_element]['type'][$key].' '.$this->array_options["options_".$key]); } } - + // If field is a computed field, value must become result of compute foreach ($tab as $key => $value) { if (! empty($extrafields) && !empty($extrafields->attributes[$this->table_element]['computed'][$key])) diff --git a/htdocs/core/class/fiscalyear.class.php b/htdocs/core/class/fiscalyear.class.php index de162f27c37..ddbe70303d2 100644 --- a/htdocs/core/class/fiscalyear.class.php +++ b/htdocs/core/class/fiscalyear.class.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2014-2018 Alexandre Spangaro * * 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 diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 4a8ed275e5a..1ae21b8f28a 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -15,7 +15,7 @@ * Copyright (C) 2012-2016 Marcos García * Copyright (C) 2012 Cedric Salvador * Copyright (C) 2012-2015 Raphaël Doursenaud - * Copyright (C) 2014 Alexandre Spangaro + * Copyright (C) 2014 Alexandre Spangaro * Copyright (C) 2018 Ferran Marcet * Copyright (C) 2018 Frédéric France * Copyright (C) 2018 Nicolas ZABOURI diff --git a/htdocs/core/class/html.formaccounting.class.php b/htdocs/core/class/html.formaccounting.class.php index 77812226138..b4a8293fba4 100644 --- a/htdocs/core/class/html.formaccounting.class.php +++ b/htdocs/core/class/html.formaccounting.class.php @@ -3,7 +3,7 @@ * Copyright (C) 2013-2014 Olivier Geffroy * Copyright (C) 2015 Ari Elbaz (elarifr) * Copyright (C) 2016 Marcos García - * Copyright (C) 2016-2017 Alexandre Spangaro + * Copyright (C) 2016-2017 Alexandre Spangaro * * 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 diff --git a/htdocs/core/class/html.formbank.class.php b/htdocs/core/class/html.formbank.class.php index 9cf60cc45b1..b4fd2df88f3 100644 --- a/htdocs/core/class/html.formbank.class.php +++ b/htdocs/core/class/html.formbank.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2015 Alexandre Spangaro + * Copyright (C) 2015 Alexandre Spangaro * Copyright (C) 2016 Marcos García * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/core/lib/accounting.lib.php b/htdocs/core/lib/accounting.lib.php index cccb7af671c..45398b6f1fb 100644 --- a/htdocs/core/lib/accounting.lib.php +++ b/htdocs/core/lib/accounting.lib.php @@ -1,6 +1,6 @@ - * Copyright (C) 2013-2017 Alexandre Spangaro + * Copyright (C) 2013-2017 Alexandre Spangaro * Copyright (C) 2014 Florian Henry * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/core/lib/asset.lib.php b/htdocs/core/lib/asset.lib.php index 91fee878cc3..b9890533a00 100644 --- a/htdocs/core/lib/asset.lib.php +++ b/htdocs/core/lib/asset.lib.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2018 Alexandre Spangaro * * 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 diff --git a/htdocs/core/lib/bank.lib.php b/htdocs/core/lib/bank.lib.php index f4202ad92d4..6985c421062 100644 --- a/htdocs/core/lib/bank.lib.php +++ b/htdocs/core/lib/bank.lib.php @@ -1,7 +1,7 @@ * Copyright (C) 2012 Regis Houssin - * Copyright (C) 2015 Alexandre Spangaro + * Copyright (C) 2015 Alexandre Spangaro * Copyright (C) 2016 Juanjo Menent * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index a47215f4553..3dcfafdbb61 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -6,7 +6,7 @@ * Copyright (C) 2013-2014 Florian Henry * Copyright (C) 2013-2014 Juanjo Menent * Copyright (C) 2013 Christophe Battarel - * Copyright (C) 2013-2018 Alexandre Spangaro + * Copyright (C) 2013-2018 Alexandre Spangaro * Copyright (C) 2015-2018 Frédéric France * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2017 Rui Strecht diff --git a/htdocs/core/lib/doleditor.lib.php b/htdocs/core/lib/doleditor.lib.php index f7d379aaad1..6e60faaa38f 100644 --- a/htdocs/core/lib/doleditor.lib.php +++ b/htdocs/core/lib/doleditor.lib.php @@ -1,7 +1,7 @@ * Copyright (C) 2010-2012 Regis Houssin - * Copyright (C) 2015 Alexandre Spangaro + * Copyright (C) 2015 Alexandre Spangaro * * 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 diff --git a/htdocs/core/lib/donation.lib.php b/htdocs/core/lib/donation.lib.php index 3bd7cffbfe2..4672085acbd 100644 --- a/htdocs/core/lib/donation.lib.php +++ b/htdocs/core/lib/donation.lib.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2015 Alexandre Spangaro * * 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 diff --git a/htdocs/core/lib/fiscalyear.lib.php b/htdocs/core/lib/fiscalyear.lib.php index bef0dbf5e68..6ba1b04a41c 100644 --- a/htdocs/core/lib/fiscalyear.lib.php +++ b/htdocs/core/lib/fiscalyear.lib.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2014 Alexandre Spangaro * * 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 diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index ebca2aee9cf..7b2d95a2fea 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -9,7 +9,7 @@ * Copyright (C) 2008 Raphael Bertrand (Resultic) * Copyright (C) 2010-2018 Juanjo Menent * Copyright (C) 2013 Cédric Salvador - * Copyright (C) 2013-2017 Alexandre Spangaro + * Copyright (C) 2013-2017 Alexandre Spangaro * Copyright (C) 2014 Cédric GROSS * Copyright (C) 2014-2015 Marcos García * Copyright (C) 2015 Jean-François Ferry diff --git a/htdocs/core/lib/hrm.lib.php b/htdocs/core/lib/hrm.lib.php index ea83d1f6d93..1827f6c1def 100644 --- a/htdocs/core/lib/hrm.lib.php +++ b/htdocs/core/lib/hrm.lib.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2015 Alexandre Spangaro * * 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 diff --git a/htdocs/core/lib/loan.lib.php b/htdocs/core/lib/loan.lib.php index 19de75a5fca..25531cb3894 100644 --- a/htdocs/core/lib/loan.lib.php +++ b/htdocs/core/lib/loan.lib.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2014-2016 Alexandre Spangaro * Copyright (C) 2015 Frederic France * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/core/lib/member.lib.php b/htdocs/core/lib/member.lib.php index 797f9502e43..27df67aedac 100644 --- a/htdocs/core/lib/member.lib.php +++ b/htdocs/core/lib/member.lib.php @@ -1,6 +1,6 @@ - * Copyright (C) 2015-2016 Alexandre Spangaro + * Copyright (C) 2015-2016 Alexandre Spangaro * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2017 Regis Houssin * diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index 52bbb77afa5..22a3aea6d6c 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -1,7 +1,7 @@ * Copyright (C) 2010-2017 Regis Houssin - * Copyright (C) 2015 Alexandre Spangaro + * Copyright (C) 2015 Alexandre Spangaro * Copyright (C) 2018 Ferran Marcet * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/core/lib/vat.lib.php b/htdocs/core/lib/vat.lib.php index ba19dc3a5ee..5842964d378 100644 --- a/htdocs/core/lib/vat.lib.php +++ b/htdocs/core/lib/vat.lib.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2016 Alexandre Spangaro * Copyright (C) 2018 Philippe Grand * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/core/modules/dons/html_cerfafr.modules.php b/htdocs/core/modules/dons/html_cerfafr.modules.php index f74476f2cee..cbb6f3807cc 100644 --- a/htdocs/core/modules/dons/html_cerfafr.modules.php +++ b/htdocs/core/modules/dons/html_cerfafr.modules.php @@ -3,7 +3,7 @@ * Copyright (C) 2005-2006 Laurent Destailleur * Copyright (C) 2012 Regis Houssin * Copyright (C) 2012 Marcos García - * Copyright (C) 2014-2015 Alexandre Spangaro + * Copyright (C) 2014-2015 Alexandre Spangaro * Copyright (C) 2015 Benoit Bruchard * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php index 5e5c136460f..ac61582c7bb 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php @@ -1,6 +1,6 @@ - * Copyright (C) 2015 Alexandre Spangaro + * Copyright (C) 2015 Alexandre Spangaro * Copyright (C) 2016-2018 Philippe Grand * Copyright (C) 2018 Frédéric France * Copyright (C) 2018 Francis Appels diff --git a/htdocs/core/modules/modAccounting.class.php b/htdocs/core/modules/modAccounting.class.php index c47e8d310f1..2a4ff0fc42e 100644 --- a/htdocs/core/modules/modAccounting.class.php +++ b/htdocs/core/modules/modAccounting.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2013-2018 Alexandre Spangaro + * Copyright (C) 2013-2018 Alexandre Spangaro * Copyright (C) 2014 Ari Elbaz (elarifr) * Copyright (C) 2014 Florian Henry * Copyright (C) 2016-2017 Laurent Destailleur @@ -262,15 +262,34 @@ class modAccounting extends DolibarrModules $this->import_icon[$r]=$this->picto; $this->import_entities_array[$r]=array(); // We define here only fields that use another icon that the one defined into import_icon $this->import_tables_array[$r]=array('b'=>MAIN_DB_PREFIX.'accounting_bookkeeping'); // List of tables to insert into (insert done in same order) - $this->import_fields_array[$r]=array('b.doc_date'=>"Docdate",'b.code_journal'=>'Codejournal','b.numero_compte'=>'AccountAccountingShort','b.label_operation'=>'LabelOperation','b.debit'=>"Debit",'b.credit'=>"Credit",'b.date_creation'=>"DateCreation"); - $this->import_fieldshidden_array[$r]=array('b.fk_user'=>'user->id'); // aliastable.field => ('user->id' or 'lastrowid-'.tableparent) - $this->import_convertvalue_array[$r]=array( - 't.fk_projet'=>array('rule'=>'fetchidfromref','classfile'=>'/projet/class/project.class.php','class'=>'Project','method'=>'fetch','element'=>'Project'), - 't.ref'=>array('rule'=>'getrefifauto') - ); - //$this->import_convertvalue_array[$r]=array('s.fk_soc'=>array('rule'=>'lastrowid',table='t'); + $this->import_fields_array[$r]=array( + 'b.doc_date'=>"Docdate", + 'b.piece_num'=>"TransactionNumShort", + 'b.code_journal'=>'Codejournal', + 'b.journal_label'=>'JournalLabel', + 'b.numero_compte'=>'AccountAccounting', + 'b.label_compte'=>'LabelAccount', + 'b.subledger_account'=>'SubledgerAccount', + 'b.subledger_label'=>'SubledgerAccountLabel', + 'b.label_operation'=>'LabelOperation', + 'b.debit'=>"Debit", + 'b.credit'=>"Credit" + ); + $this->import_fieldshidden_array[$r]=array('b.fk_user_author'=>'user->id'); // aliastable.field => ('user->id' or 'lastrowid-'.tableparent) $this->import_regex_array[$r]=array('b.doc_date'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$'); - //$this->import_examplevalues_array[$r]=array('t.fk_projet'=>'MyProjectRef','t.ref'=>"auto or TK2010-1234",'t.label'=>"My task",'t.progress'=>"0 (not started) to 100 (finished)",'t.datec'=>'1972-10-10','t.note_private'=>"My private note",'t.note_public'=>"My public note"); + $this->import_examplevalues_array[$r]=array( + 'b.doc_date'=>'formatted as \'.dol_print_date(dol_now(),\'%Y-%m-%d\')', + 'b.piece_num'=>'1', + 'b.code_journal'=>"VTE", + 'b.journal_label'=>"Journal des ventes", + 'b.numero_compte'=>"707", + 'b.label_compte'=>'Ventes', + 'b.subledger_account'=>'', + 'b.subledger_label'=>'', + 'b.label_operation'=>"Ventes services", + 'b.debit'=>"0,00", + 'b.credit'=>"100,00" + ); // Chart of accounts $r++; diff --git a/htdocs/core/modules/modAdherent.class.php b/htdocs/core/modules/modAdherent.class.php index 7e58205203a..7a686c97157 100644 --- a/htdocs/core/modules/modAdherent.class.php +++ b/htdocs/core/modules/modAdherent.class.php @@ -6,7 +6,7 @@ * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2013 Juanjo Menent * Copyright (C) 2014-2015 Raphaël Doursenaud - * Copyright (C) 2018 Alexandre Spangaro + * Copyright (C) 2018 Alexandre Spangaro * * 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 diff --git a/htdocs/core/modules/modAsset.class.php b/htdocs/core/modules/modAsset.class.php index 70e4dacece1..d7464c8ac0e 100644 --- a/htdocs/core/modules/modAsset.class.php +++ b/htdocs/core/modules/modAsset.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2018 Alexandre Spangaro + * Copyright (C) 2018 Alexandre Spangaro * * 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 diff --git a/htdocs/core/modules/modDon.class.php b/htdocs/core/modules/modDon.class.php index 136da1affbc..bc1af9e34ff 100644 --- a/htdocs/core/modules/modDon.class.php +++ b/htdocs/core/modules/modDon.class.php @@ -2,7 +2,7 @@ /* Copyright (C) 2003-2005 Rodolphe Quiedeville * Copyright (C) 2004-2010 Laurent Destailleur * Copyright (C) 2005-2011 Regis Houssin - * Copyright (C) 2015 Alexandre Spangaro + * Copyright (C) 2015 Alexandre Spangaro * * 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 diff --git a/htdocs/core/modules/modHRM.class.php b/htdocs/core/modules/modHRM.class.php index 8ccc210b86d..2524cf8f128 100644 --- a/htdocs/core/modules/modHRM.class.php +++ b/htdocs/core/modules/modHRM.class.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2015 Alexandre Spangaro * * 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 diff --git a/htdocs/core/modules/modLoan.class.php b/htdocs/core/modules/modLoan.class.php index 76405476ce8..43a2876ef79 100644 --- a/htdocs/core/modules/modLoan.class.php +++ b/htdocs/core/modules/modLoan.class.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2014 Alexandre Spangaro * * 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 diff --git a/htdocs/core/modules/modSalaries.class.php b/htdocs/core/modules/modSalaries.class.php index c85a4fa1d01..4756f2a1a41 100644 --- a/htdocs/core/modules/modSalaries.class.php +++ b/htdocs/core/modules/modSalaries.class.php @@ -5,7 +5,7 @@ * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2014 Juanjo Menent - * Copyright (C) 2014 Alexandre Spangaro + * Copyright (C) 2014 Alexandre Spangaro * * 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 diff --git a/htdocs/core/modules/modSocialNetworks.class.php b/htdocs/core/modules/modSocialNetworks.class.php index 7a9ef6da402..b7e1bfd44a3 100644 --- a/htdocs/core/modules/modSocialNetworks.class.php +++ b/htdocs/core/modules/modSocialNetworks.class.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2013 Alexandre Spangaro * Copyright (C) 2014 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/core/modules/modStripe.class.php b/htdocs/core/modules/modStripe.class.php index 58344400ab6..229415edec6 100644 --- a/htdocs/core/modules/modStripe.class.php +++ b/htdocs/core/modules/modStripe.class.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2017 Alexandre Spangaro * Copyright (C) 2017 Saasprov * * This program is free software; you can redistribute it and/or modify @@ -150,6 +150,18 @@ class modStripe extends DolibarrModules 'target' => '', 'user' => 0 ); + $this->menu[$r] = array( + 'fk_menu' => 'fk_mainmenu=bank,fk_leftmenu=stripe', + 'type' => 'left', + 'titre' => 'StripePayoutList', + 'url' => '/stripe/payout.php', + 'langs' => 'stripe', + 'position' => 103, + 'enabled' => '$conf->stripe->enabled && $conf->banque->enabled && $conf->global->MAIN_FEATURES_LEVEL >= 1', + 'perms' => '$user->rights->banque->lire', + 'target' => '', + 'user' => 0 + ); // Exports $r=1; diff --git a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php index 06b7cc48f37..cc56a41ea19 100644 --- a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php +++ b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php @@ -2,7 +2,7 @@ /* Copyright (C) 2005-2008 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2013-2018 Philippe Grand - * Copyright (C) 2016 Alexandre Spangaro + * Copyright (C) 2016 Alexandre Spangaro * * 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 diff --git a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php index 8ba87024146..989f0a5090d 100644 --- a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php +++ b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php @@ -4,7 +4,7 @@ * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2013-2018 Philippe Grand * Copyright (C) 2013 Juanjo Menent - * Copyright (C) 2016 Alexandre Spangaro + * Copyright (C) 2016 Alexandre Spangaro * * 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 diff --git a/htdocs/core/tpl/card_presend.tpl.php b/htdocs/core/tpl/card_presend.tpl.php index 989d03482df..ffe8d16b9eb 100644 --- a/htdocs/core/tpl/card_presend.tpl.php +++ b/htdocs/core/tpl/card_presend.tpl.php @@ -48,12 +48,15 @@ if ($action == 'presend') $ref = dol_sanitizeFileName($object->ref); include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; - $fileparams = dol_most_recent_file($diroutput . '/' . $ref, preg_quote($ref, '/').'[^\-]+'); - // + // Special case if ($object->element == 'invoice_supplier') { $fileparams = dol_most_recent_file($diroutput . '/' . get_exdir($object->id, 2, 0, 0, $object, $object->element).$ref, preg_quote($ref, '/').'([^\-])+'); } + else + { + $fileparams = dol_most_recent_file($diroutput . '/' . $ref, preg_quote($ref, '/').'[^\-]+'); + } $file = $fileparams['fullname']; } @@ -86,16 +89,27 @@ if ($action == 'presend') } // Build document if it not exists - if (! in_array($object->element, array('societe', 'user', 'member'))) + $forcebuilddoc=true; + if (in_array($object->element, array('societe', 'user', 'member'))) $forcebuilddoc=false; + if ($object->element == 'invoice_supplier' && empty($conf->global->INVOICE_SUPPLIER_ADDON_PDF)) $forcebuilddoc=false; + if ($forcebuilddoc) // If there is no default value for supplier invoice, we do not generate file, even if modelpdf was set by a manual generation { if ((! $file || ! is_readable($file)) && method_exists($object, 'generateDocument')) { $result = $object->generateDocument(GETPOST('model') ? GETPOST('model') : $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); - if ($result <= 0) { + if ($result < 0) { dol_print_error($db, $object->error, $object->errors); exit(); } - $fileparams = dol_most_recent_file($diroutput . '/' . $ref, preg_quote($ref, '/').'[^\-]+'); + if ($object->element == 'invoice_supplier') + { + $fileparams = dol_most_recent_file($diroutput . '/' . get_exdir($object->id,2,0,0,$object,$object->element).$ref, preg_quote($ref,'/').'([^\-])+'); + } + else + { + $fileparams = dol_most_recent_file($diroutput . '/' . $ref, preg_quote($ref, '/').'[^\-]+'); + } + $file = $fileparams['fullname']; } } diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index e16cbdafec8..cd8948a630d 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -209,7 +209,7 @@ $domData .= ' data-product_type="'.$line->product_type.'"'; // for example always visible on invoice but must be visible only if stock module on and stock decrease option is on invoice validation and status is not validated // must also not be output for most entities (proposal, intervention, ...) //if($line->qty > $line->stock) print img_picto($langs->trans("StockTooLow"),"warning", 'style="vertical-align: bottom;"')." "; - echo $line->qty; + echo price($line->qty, 0, '', 0, 0); // Yes, it is a quantity, not a price, but we just want the formating role of function price } else echo ' '; ?> diff --git a/htdocs/don/admin/donation.php b/htdocs/don/admin/donation.php index b10013a7614..db0633c8e9d 100644 --- a/htdocs/don/admin/donation.php +++ b/htdocs/don/admin/donation.php @@ -2,7 +2,7 @@ /* Copyright (C) 2005-2010 Laurent Destailleur * Copyright (C) 2012-2015 Juanjo Menent * Copyright (C) 2013-2017 Philippe Grand - * Copyright (C) 2015-2017 Alexandre Spangaro + * Copyright (C) 2015-2017 Alexandre Spangaro * Copyright (C) 2015 Benoit Bruchard * Copyright (C) 2019 Thibault FOUCART * diff --git a/htdocs/don/admin/donation_extrafields.php b/htdocs/don/admin/donation_extrafields.php index 0636ec1714b..1bfc12f2758 100644 --- a/htdocs/don/admin/donation_extrafields.php +++ b/htdocs/don/admin/donation_extrafields.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2015 Alexandre Spangaro * Copyright (C) 2015 Juanjo Menent * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/don/card.php b/htdocs/don/card.php index e62d5f925ff..40d0616ad37 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2017 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2013 Florian Henry - * Copyright (C) 2015-2016 Alexandre Spangaro + * Copyright (C) 2015-2016 Alexandre Spangaro * Copyright (C) 2018-2019 Thibault FOUCART * Copyright (C) 2018 Frédéric France * diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php index 150dcf54380..c8072b23142 100644 --- a/htdocs/don/class/don.class.php +++ b/htdocs/don/class/don.class.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2008 Laurent Destailleur * Copyright (C) 2009 Regis Houssin * Copyright (C) 2014 Florian Henry - * Copyright (C) 2015-2017 Alexandre Spangaro + * Copyright (C) 2015-2017 Alexandre Spangaro * Copyright (C) 2016 Juanjo Menent * Copyright (C) 2019 Thibault FOUCART * diff --git a/htdocs/don/class/paymentdonation.class.php b/htdocs/don/class/paymentdonation.class.php index dbd53ef0473..deec339c1cc 100644 --- a/htdocs/don/class/paymentdonation.class.php +++ b/htdocs/don/class/paymentdonation.class.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2015 Alexandre Spangaro * * 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 diff --git a/htdocs/don/document.php b/htdocs/don/document.php index cb2c28b792b..c068b33399c 100644 --- a/htdocs/don/document.php +++ b/htdocs/don/document.php @@ -6,7 +6,7 @@ * Copyright (C) 2005 Simon TOSSER * Copyright (C) 2011-2012 Juanjo Menent * Copyright (C) 2013 Cédric Salvador - * Copyright (C) 2015 Alexandre Spangaro + * Copyright (C) 2015 Alexandre Spangaro * * 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 diff --git a/htdocs/don/info.php b/htdocs/don/info.php index ca6659bee04..0f76e4f65ca 100644 --- a/htdocs/don/info.php +++ b/htdocs/don/info.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2015-2016 Alexandre Spangaro * * 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 diff --git a/htdocs/don/note.php b/htdocs/don/note.php index 335b7a8a644..59feada0423 100644 --- a/htdocs/don/note.php +++ b/htdocs/don/note.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2008 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2013 Florian Henry - * Copyright (C) 2016 Alexandre Spangaro + * Copyright (C) 2016 Alexandre Spangaro * * 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 diff --git a/htdocs/don/payment/card.php b/htdocs/don/payment/card.php index 2d238038ee1..43e329f3d08 100644 --- a/htdocs/don/payment/card.php +++ b/htdocs/don/payment/card.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2015 Alexandre Spangaro * * 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 diff --git a/htdocs/don/payment/payment.php b/htdocs/don/payment/payment.php index d9aa4f1f3f8..640a94ff729 100644 --- a/htdocs/don/payment/payment.php +++ b/htdocs/don/payment/payment.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2015 Alexandre Spangaro * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/don/stats/index.php b/htdocs/don/stats/index.php index 32320bea0ba..4c360786425 100644 --- a/htdocs/don/stats/index.php +++ b/htdocs/don/stats/index.php @@ -2,7 +2,7 @@ /* Copyright (C) 2001-2003 Rodolphe Quiedeville * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin - * Copyright (C) 2015 Alexandre Spangaro + * Copyright (C) 2015 Alexandre Spangaro * * 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 diff --git a/htdocs/ecm/dir_add_card.php b/htdocs/ecm/dir_add_card.php index 502e481be80..aec0e39a2df 100644 --- a/htdocs/ecm/dir_add_card.php +++ b/htdocs/ecm/dir_add_card.php @@ -1,7 +1,7 @@ * Copyright (C) 2008-2012 Regis Houssin - * Copyright (C) 2015-2016 Alexandre Spangaro + * Copyright (C) 2015-2016 Alexandre Spangaro * * 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 diff --git a/htdocs/ecm/index_auto.php b/htdocs/ecm/index_auto.php index db65882fcda..5f43426ae63 100644 --- a/htdocs/ecm/index_auto.php +++ b/htdocs/ecm/index_auto.php @@ -1,7 +1,7 @@ * Copyright (C) 2008-2010 Regis Houssin - * Copyright (C) 2016 Alexandre Spangaro + * Copyright (C) 2016 Alexandre Spangaro * * 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 diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index a21bd5a0bb9..6105c086c61 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -205,8 +205,7 @@ if (empty($reshook)) $date_delivery = dol_mktime(GETPOST('date_deliveryhour', 'int'), GETPOST('date_deliverymin', 'int'), 0, GETPOST('date_deliverymonth', 'int'), GETPOST('date_deliveryday', 'int'), GETPOST('date_deliveryyear', 'int')); - // On va boucler sur chaque ligne du document d'origine pour completer objet expedition - // avec info diverses + qte a livrer + // We will loop on each line of the original document to complete the shipping object with various info and quantity to deliver $classname = ucfirst($object->origin); $objectsrc = new $classname($db); $objectsrc->fetch($object->origin_id); @@ -839,11 +838,11 @@ if (empty($reshook)) } else { - header('Location: ' . $_SERVER['PHP_SELF'] . '?id=' . $object->id); // Pour reaffichage de la fiche en cours d'edition + header('Location: ' . $_SERVER['PHP_SELF'] . '?id=' . $object->id); // To redisplay the form being edited exit(); } } elseif ($action == 'updateline' && $user->rights->expedition->creer && GETPOST('cancel', 'alpha') == $langs->trans('Cancel')) { - header('Location: ' . $_SERVER['PHP_SELF'] . '?id=' . $object->id); // Pour reaffichage de la fiche en cours d'edition + header('Location: ' . $_SERVER['PHP_SELF'] . '?id=' . $object->id); // To redisplay the form being edited exit(); } diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 69793d7f9ab..2ce6ca0f70a 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -2,7 +2,7 @@ /* Copyright (C) 2003 Rodolphe Quiedeville * Copyright (C) 2004-2017 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin - * Copyright (C) 2015-2017 Alexandre Spangaro + * Copyright (C) 2015-2017 Alexandre Spangaro * Copyright (C) 2017 Ferran Marcet * Copyright (C) 2018 Frédéric France * diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 82ff6ccfa41..8dc0cbcdcf8 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2015 Laurent Destailleur - * Copyright (C) 2015 Alexandre Spangaro + * Copyright (C) 2015 Alexandre Spangaro * Copyright (C) 2018 Nicolas ZABOURI * Copyright (c) 2018 Frédéric France * Copyright (C) 2016-2018 Ferran Marcet diff --git a/htdocs/expensereport/class/paymentexpensereport.class.php b/htdocs/expensereport/class/paymentexpensereport.class.php index 82441df7226..655c148069e 100644 --- a/htdocs/expensereport/class/paymentexpensereport.class.php +++ b/htdocs/expensereport/class/paymentexpensereport.class.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2015-2017 Alexandre Spangaro * Copyright (C) 2018 Nicolas ZABOURI * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/expensereport/index.php b/htdocs/expensereport/index.php index eb6f75b7d38..bfe5bc59126 100644 --- a/htdocs/expensereport/index.php +++ b/htdocs/expensereport/index.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2015 Laurent Destailleur * Copyright (C) 2004 Eric Seigne * Copyright (C) 2005-2011 Regis Houssin - * Copyright (C) 2015 Alexandre Spangaro + * Copyright (C) 2015 Alexandre Spangaro * * 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 diff --git a/htdocs/expensereport/list.php b/htdocs/expensereport/list.php index 52f69b371f7..c59b6d70e0f 100644 --- a/htdocs/expensereport/list.php +++ b/htdocs/expensereport/list.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2017 Laurent Destailleur * Copyright (C) 2004 Eric Seigne * Copyright (C) 2005-2009 Regis Houssin - * Copyright (C) 2015 Alexandre Spangaro + * Copyright (C) 2015 Alexandre Spangaro * Copyright (C) 2018 Ferran Marcet * Copyright (C) 2018 Charlene Benke * diff --git a/htdocs/expensereport/payment/card.php b/htdocs/expensereport/payment/card.php index 12386d990a9..83de49358bc 100644 --- a/htdocs/expensereport/payment/card.php +++ b/htdocs/expensereport/payment/card.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2015-2017 Alexandre Spangaro * * 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 diff --git a/htdocs/expensereport/payment/info.php b/htdocs/expensereport/payment/info.php index 0b74f080d49..53d4a26eef4 100644 --- a/htdocs/expensereport/payment/info.php +++ b/htdocs/expensereport/payment/info.php @@ -2,7 +2,7 @@ /* Copyright (C) 2004 Rodolphe Quiedeville * Copyright (C) 2004-2009 Laurent Destailleur * Copyright (C) 2013 Marcos García - * Copyright (C) 2015 Alexandre Spangaro + * Copyright (C) 2015 Alexandre Spangaro * * 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 diff --git a/htdocs/expensereport/payment/payment.php b/htdocs/expensereport/payment/payment.php index e998872da12..2c8c2604c9c 100644 --- a/htdocs/expensereport/payment/payment.php +++ b/htdocs/expensereport/payment/payment.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2015 Alexandre Spangaro * Copyright (C) 2015 Laurent Destailleur * Copyright (C) 2018 Frédéric France * diff --git a/htdocs/fichinter/card-rec.php b/htdocs/fichinter/card-rec.php index 837b77eb3aa..62e16c0e483 100644 --- a/htdocs/fichinter/card-rec.php +++ b/htdocs/fichinter/card-rec.php @@ -6,7 +6,7 @@ * Copyright (C) 2013 Juanjo Menent * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2012 Cedric Salvador - * Copyright (C) 2015 Alexandre Spangaro + * Copyright (C) 2015 Alexandre Spangaro * Copyright (C) 2016-2018 Charlie Benke * Copyright (C) 2018 Frédéric France * diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 49c90f29fe1..aca1c204fd3 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -10,7 +10,7 @@ * Copyright (C) 2014-2016 Marcos García * Copyright (C) 2015 Bahfir Abbes * Copyright (C) 2015 Ferran Marcet - * Copyright (C) 2016 Alexandre Spangaro + * Copyright (C) 2016 Alexandre Spangaro * Copyright (C) 2018 Nicolas ZABOURI * Copyright (C) 2018 Frédéric France * diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 10debc20d96..047b4c7cac1 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -8,7 +8,7 @@ * Copyright (C) 2013-2015 Philippe Grand * Copyright (C) 2013 Florian Henry * Copyright (C) 2014-2016 Marcos García - * Copyright (C) 2016-2017 Alexandre Spangaro + * Copyright (C) 2016-2017 Alexandre Spangaro * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/fourn/facture/document.php b/htdocs/fourn/facture/document.php index 40a2c23d25b..ec4003dcfb7 100644 --- a/htdocs/fourn/facture/document.php +++ b/htdocs/fourn/facture/document.php @@ -4,7 +4,7 @@ * Copyright (C) 2005 Marc Barilley / Ocebo * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2013 Cédric Salvador - * Copyright (C) 2016 Alexandre Spangaro + * Copyright (C) 2016 Alexandre Spangaro * Copyright (C) 2017 Ferran Marcet * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/fourn/facture/info.php b/htdocs/fourn/facture/info.php index ae56e8cc307..d926f7811ad 100644 --- a/htdocs/fourn/facture/info.php +++ b/htdocs/fourn/facture/info.php @@ -2,7 +2,7 @@ /* Copyright (C) 2004 Rodolphe Quiedeville * Copyright (C) 2004-2006 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin - * Copyright (C) 2016 Alexandre Spangaro + * Copyright (C) 2016 Alexandre Spangaro * Copyright (C) 2017 Ferran Marcet * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index 5b79860bcea..8dedb03a632 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -8,7 +8,7 @@ * Copyright (C) 2014 Teddy Andreotti <125155@supinfo.com> * Copyright (C) 2015 Marcos García * Copyright (C) 2015 Juanjo Menent - * Copyright (C) 2017 Alexandre Spangaro + * Copyright (C) 2017 Alexandre Spangaro * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index 71783dbdf0f..15c201d2cf9 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -3,7 +3,7 @@ * Copyright (C) 2012-2016 Laurent Destailleur * Copyright (C) 2012-2016 Regis Houssin * Copyright (C) 2013 Juanjo Menent - * Copyright (C) 2017 Alexandre Spangaro + * Copyright (C) 2017 Alexandre Spangaro * Copyright (C) 2014-2017 Ferran Marcet * Copyright (C) 2018 Frédéric France * diff --git a/htdocs/hrm/admin/admin_establishment.php b/htdocs/hrm/admin/admin_establishment.php index d042f1fc413..4ea0b76a9d4 100644 --- a/htdocs/hrm/admin/admin_establishment.php +++ b/htdocs/hrm/admin/admin_establishment.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2015 Alexandre Spangaro * * 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 diff --git a/htdocs/hrm/admin/admin_hrm.php b/htdocs/hrm/admin/admin_hrm.php index c61480347bb..13f678e40d8 100644 --- a/htdocs/hrm/admin/admin_hrm.php +++ b/htdocs/hrm/admin/admin_hrm.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2015 Alexandre Spangaro * * 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 diff --git a/htdocs/hrm/class/establishment.class.php b/htdocs/hrm/class/establishment.class.php index 392cb2c4cfd..dcd73437772 100644 --- a/htdocs/hrm/class/establishment.class.php +++ b/htdocs/hrm/class/establishment.class.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2015 Alexandre Spangaro * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/hrm/establishment/card.php b/htdocs/hrm/establishment/card.php index c7611b310af..311da81a92d 100644 --- a/htdocs/hrm/establishment/card.php +++ b/htdocs/hrm/establishment/card.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2015 Alexandre Spangaro * * 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 diff --git a/htdocs/hrm/establishment/info.php b/htdocs/hrm/establishment/info.php index 431ad0a1203..f2ab32f7939 100644 --- a/htdocs/hrm/establishment/info.php +++ b/htdocs/hrm/establishment/info.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2015 Alexandre Spangaro * * 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 diff --git a/htdocs/hrm/index.php b/htdocs/hrm/index.php index 81e21859307..6aa17362894 100644 --- a/htdocs/hrm/index.php +++ b/htdocs/hrm/index.php @@ -2,7 +2,7 @@ /* Copyright (C) 2011 Dimitri Mouillard * Copyright (C) 2013-2015 Laurent Destailleur * Copyright (C) 2012-2014 Regis Houssin - * Copyright (C) 2015-2016 Alexandre Spangaro + * Copyright (C) 2015-2016 Alexandre Spangaro * * 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 diff --git a/htdocs/install/mysql/data/llx_00_c_country.sql b/htdocs/install/mysql/data/llx_00_c_country.sql index 0ea1a55d3d3..a4c09f8ae30 100644 --- a/htdocs/install/mysql/data/llx_00_c_country.sql +++ b/htdocs/install/mysql/data/llx_00_c_country.sql @@ -5,7 +5,7 @@ -- Copyright (C) 2004 Guillaume Delecourt -- Copyright (C) 2005-2009 Regis Houssin -- Copyright (C) 2007 Patrick Raguin --- Copyright (C) 2014 Alexandre Spangaro +-- Copyright (C) 2014 Alexandre Spangaro -- -- 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 diff --git a/htdocs/install/mysql/data/llx_accounting_abc.sql b/htdocs/install/mysql/data/llx_accounting_abc.sql index 6e4c62d8228..b1dcdb64c35 100644 --- a/htdocs/install/mysql/data/llx_accounting_abc.sql +++ b/htdocs/install/mysql/data/llx_accounting_abc.sql @@ -5,7 +5,7 @@ -- Copyright (C) 2004 Guillaume Delecourt -- Copyright (C) 2005-2009 Regis Houssin -- Copyright (C) 2007 Patrick Raguin --- Copyright (C) 2011-2018 Alexandre Spangaro +-- Copyright (C) 2011-2018 Alexandre Spangaro -- Copyright (C) 2015-2017 Juanjo Menent -- Copyright (C) 2018 Abbes bahfir -- diff --git a/htdocs/install/mysql/data/llx_accounting_account_be.sql b/htdocs/install/mysql/data/llx_accounting_account_be.sql index 610913ed36e..75ee10f7de8 100644 --- a/htdocs/install/mysql/data/llx_accounting_account_be.sql +++ b/htdocs/install/mysql/data/llx_accounting_account_be.sql @@ -5,7 +5,7 @@ -- Copyright (C) 2004 Guillaume Delecourt -- Copyright (C) 2005-2009 Regis Houssin -- Copyright (C) 2007 Patrick Raguin --- Copyright (C) 2011-2017 Alexandre Spangaro +-- Copyright (C) 2011-2017 Alexandre Spangaro -- -- 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 diff --git a/htdocs/install/mysql/data/llx_accounting_account_bf.sql b/htdocs/install/mysql/data/llx_accounting_account_bf.sql index 337ae5b905d..51961097b77 100644 --- a/htdocs/install/mysql/data/llx_accounting_account_bf.sql +++ b/htdocs/install/mysql/data/llx_accounting_account_bf.sql @@ -1,4 +1,4 @@ --- Copyright (C) 2017 Alexandre Spangaro +-- Copyright (C) 2017 Alexandre Spangaro -- -- 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 diff --git a/htdocs/install/mysql/data/llx_accounting_account_bj.sql b/htdocs/install/mysql/data/llx_accounting_account_bj.sql index 0bca4b646a4..13aa8b135e7 100644 --- a/htdocs/install/mysql/data/llx_accounting_account_bj.sql +++ b/htdocs/install/mysql/data/llx_accounting_account_bj.sql @@ -1,4 +1,4 @@ --- Copyright (C) 2017 Alexandre Spangaro +-- Copyright (C) 2017 Alexandre Spangaro -- -- 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 diff --git a/htdocs/install/mysql/data/llx_accounting_account_cd.sql b/htdocs/install/mysql/data/llx_accounting_account_cd.sql index 0df56ea4bbf..25e1e5b7809 100644 --- a/htdocs/install/mysql/data/llx_accounting_account_cd.sql +++ b/htdocs/install/mysql/data/llx_accounting_account_cd.sql @@ -1,4 +1,4 @@ --- Copyright (C) 2017 Alexandre Spangaro +-- Copyright (C) 2017 Alexandre Spangaro -- -- 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 diff --git a/htdocs/install/mysql/data/llx_accounting_account_cf.sql b/htdocs/install/mysql/data/llx_accounting_account_cf.sql index b38c3c02a09..6968641d6ae 100644 --- a/htdocs/install/mysql/data/llx_accounting_account_cf.sql +++ b/htdocs/install/mysql/data/llx_accounting_account_cf.sql @@ -1,4 +1,4 @@ --- Copyright (C) 2017 Alexandre Spangaro +-- Copyright (C) 2017 Alexandre Spangaro -- -- 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 diff --git a/htdocs/install/mysql/data/llx_accounting_account_cg.sql b/htdocs/install/mysql/data/llx_accounting_account_cg.sql index 7317b8f0bee..92d3fa34428 100644 --- a/htdocs/install/mysql/data/llx_accounting_account_cg.sql +++ b/htdocs/install/mysql/data/llx_accounting_account_cg.sql @@ -1,4 +1,4 @@ --- Copyright (C) 2017 Alexandre Spangaro +-- Copyright (C) 2017 Alexandre Spangaro -- -- 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 diff --git a/htdocs/install/mysql/data/llx_accounting_account_ci.sql b/htdocs/install/mysql/data/llx_accounting_account_ci.sql index b12a8e1068f..9df71c78316 100644 --- a/htdocs/install/mysql/data/llx_accounting_account_ci.sql +++ b/htdocs/install/mysql/data/llx_accounting_account_ci.sql @@ -1,4 +1,4 @@ --- Copyright (C) 2017 Alexandre Spangaro +-- Copyright (C) 2017 Alexandre Spangaro -- -- 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 diff --git a/htdocs/install/mysql/data/llx_accounting_account_cl.sql b/htdocs/install/mysql/data/llx_accounting_account_cl.sql index 3029bc9350d..3e962a18680 100644 --- a/htdocs/install/mysql/data/llx_accounting_account_cl.sql +++ b/htdocs/install/mysql/data/llx_accounting_account_cl.sql @@ -5,7 +5,7 @@ -- Copyright (C) 2004 Guillaume Delecourt -- Copyright (C) 2005-2009 Regis Houssin -- Copyright (C) 2007 Patrick Raguin --- Copyright (C) 2011-2017 Alexandre Spangaro +-- Copyright (C) 2011-2017 Alexandre Spangaro -- Copyright (C) 2017 Juanjo Menent -- -- This program is free software; you can redistribute it and/or modify diff --git a/htdocs/install/mysql/data/llx_accounting_account_cm.sql b/htdocs/install/mysql/data/llx_accounting_account_cm.sql index 26bbbce4338..c2514a83379 100644 --- a/htdocs/install/mysql/data/llx_accounting_account_cm.sql +++ b/htdocs/install/mysql/data/llx_accounting_account_cm.sql @@ -1,4 +1,4 @@ --- Copyright (C) 2017 Alexandre Spangaro +-- Copyright (C) 2017 Alexandre Spangaro -- -- 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 diff --git a/htdocs/install/mysql/data/llx_accounting_account_dk.sql b/htdocs/install/mysql/data/llx_accounting_account_dk.sql index f7b3ea7e519..83d9942d9db 100644 --- a/htdocs/install/mysql/data/llx_accounting_account_dk.sql +++ b/htdocs/install/mysql/data/llx_accounting_account_dk.sql @@ -5,7 +5,7 @@ -- Copyright (C) 2004 Guillaume Delecourt -- Copyright (C) 2005-2009 Regis Houssin -- Copyright (C) 2007 Patrick Raguin --- Copyright (C) 2011-2017 Alexandre Spangaro +-- Copyright (C) 2011-2017 Alexandre Spangaro -- -- 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 diff --git a/htdocs/install/mysql/data/llx_accounting_account_es.sql b/htdocs/install/mysql/data/llx_accounting_account_es.sql index ef7d5aaa634..93a80265bb9 100644 --- a/htdocs/install/mysql/data/llx_accounting_account_es.sql +++ b/htdocs/install/mysql/data/llx_accounting_account_es.sql @@ -5,7 +5,7 @@ -- Copyright (C) 2004 Guillaume Delecourt -- Copyright (C) 2005-2009 Regis Houssin -- Copyright (C) 2007 Patrick Raguin --- Copyright (C) 2011-2017 Alexandre Spangaro +-- Copyright (C) 2011-2017 Alexandre Spangaro -- -- 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 diff --git a/htdocs/install/mysql/data/llx_accounting_account_fr.sql b/htdocs/install/mysql/data/llx_accounting_account_fr.sql index ef8ef176597..267602143f3 100644 --- a/htdocs/install/mysql/data/llx_accounting_account_fr.sql +++ b/htdocs/install/mysql/data/llx_accounting_account_fr.sql @@ -5,7 +5,7 @@ -- Copyright (C) 2004 Guillaume Delecourt -- Copyright (C) 2005-2009 Regis Houssin -- Copyright (C) 2007 Patrick Raguin --- Copyright (C) 2011-2017 Alexandre Spangaro +-- Copyright (C) 2011-2017 Alexandre Spangaro -- -- 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 diff --git a/htdocs/install/mysql/data/llx_accounting_account_ga.sql b/htdocs/install/mysql/data/llx_accounting_account_ga.sql index 06a14f69214..f99a42df171 100644 --- a/htdocs/install/mysql/data/llx_accounting_account_ga.sql +++ b/htdocs/install/mysql/data/llx_accounting_account_ga.sql @@ -1,4 +1,4 @@ --- Copyright (C) 2017 Alexandre Spangaro +-- Copyright (C) 2017 Alexandre Spangaro -- -- 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 diff --git a/htdocs/install/mysql/data/llx_accounting_account_gq.sql b/htdocs/install/mysql/data/llx_accounting_account_gq.sql index f38dc2365f8..dd82a35d64c 100644 --- a/htdocs/install/mysql/data/llx_accounting_account_gq.sql +++ b/htdocs/install/mysql/data/llx_accounting_account_gq.sql @@ -1,4 +1,4 @@ --- Copyright (C) 2017 Alexandre Spangaro +-- Copyright (C) 2017 Alexandre Spangaro -- -- 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 diff --git a/htdocs/install/mysql/data/llx_accounting_account_km.sql b/htdocs/install/mysql/data/llx_accounting_account_km.sql index 64b42ee3730..14cb877f999 100644 --- a/htdocs/install/mysql/data/llx_accounting_account_km.sql +++ b/htdocs/install/mysql/data/llx_accounting_account_km.sql @@ -1,4 +1,4 @@ --- Copyright (C) 2017 Alexandre Spangaro +-- Copyright (C) 2017 Alexandre Spangaro -- -- 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 diff --git a/htdocs/install/mysql/data/llx_accounting_account_ml.sql b/htdocs/install/mysql/data/llx_accounting_account_ml.sql index c18fb8a4166..d54f0fb7844 100644 --- a/htdocs/install/mysql/data/llx_accounting_account_ml.sql +++ b/htdocs/install/mysql/data/llx_accounting_account_ml.sql @@ -1,4 +1,4 @@ --- Copyright (C) 2017 Alexandre Spangaro +-- Copyright (C) 2017 Alexandre Spangaro -- -- 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 diff --git a/htdocs/install/mysql/data/llx_accounting_account_ne.sql b/htdocs/install/mysql/data/llx_accounting_account_ne.sql index dbdf2837bda..e43ff41a0a1 100644 --- a/htdocs/install/mysql/data/llx_accounting_account_ne.sql +++ b/htdocs/install/mysql/data/llx_accounting_account_ne.sql @@ -1,4 +1,4 @@ --- Copyright (C) 2017 Alexandre Spangaro +-- Copyright (C) 2017 Alexandre Spangaro -- -- 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 diff --git a/htdocs/install/mysql/data/llx_accounting_account_sn.sql b/htdocs/install/mysql/data/llx_accounting_account_sn.sql index 525f927bf17..c4eec7245a5 100644 --- a/htdocs/install/mysql/data/llx_accounting_account_sn.sql +++ b/htdocs/install/mysql/data/llx_accounting_account_sn.sql @@ -1,4 +1,4 @@ --- Copyright (C) 2017 Alexandre Spangaro +-- Copyright (C) 2017 Alexandre Spangaro -- -- 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 diff --git a/htdocs/install/mysql/data/llx_accounting_account_td.sql b/htdocs/install/mysql/data/llx_accounting_account_td.sql index c09548f12e3..71871663bc3 100644 --- a/htdocs/install/mysql/data/llx_accounting_account_td.sql +++ b/htdocs/install/mysql/data/llx_accounting_account_td.sql @@ -1,4 +1,4 @@ --- Copyright (C) 2017 Alexandre Spangaro +-- Copyright (C) 2017 Alexandre Spangaro -- -- 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 diff --git a/htdocs/install/mysql/data/llx_accounting_account_tg.sql b/htdocs/install/mysql/data/llx_accounting_account_tg.sql index 31bcbe2ae27..21e3989fd74 100644 --- a/htdocs/install/mysql/data/llx_accounting_account_tg.sql +++ b/htdocs/install/mysql/data/llx_accounting_account_tg.sql @@ -1,4 +1,4 @@ --- Copyright (C) 2017 Alexandre Spangaro +-- Copyright (C) 2017 Alexandre Spangaro -- -- 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 diff --git a/htdocs/install/mysql/data/llx_accounting_category.sql b/htdocs/install/mysql/data/llx_accounting_category.sql index 3d96ea205eb..a569114506e 100644 --- a/htdocs/install/mysql/data/llx_accounting_category.sql +++ b/htdocs/install/mysql/data/llx_accounting_category.sql @@ -1,4 +1,4 @@ --- Copyright (C) 2016 Alexandre Spangaro +-- Copyright (C) 2016 Alexandre Spangaro -- Copyright (C) 2017 Laurent Destailleur -- -- This program is free software; you can redistribute it and/or modify diff --git a/htdocs/install/mysql/data/llx_c_hrm_department.sql b/htdocs/install/mysql/data/llx_c_hrm_department.sql index c4865ad9e30..714963896cc 100644 --- a/htdocs/install/mysql/data/llx_c_hrm_department.sql +++ b/htdocs/install/mysql/data/llx_c_hrm_department.sql @@ -1,6 +1,6 @@ -- ============================================================================ -- Copyright (C) 2013 Jean-François Ferry --- Copyright (C) 2015 Alexandre Spangaro +-- Copyright (C) 2015 Alexandre Spangaro -- -- 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 diff --git a/htdocs/install/mysql/data/llx_c_hrm_function.sql b/htdocs/install/mysql/data/llx_c_hrm_function.sql index dd5c6e832bd..900439f9709 100644 --- a/htdocs/install/mysql/data/llx_c_hrm_function.sql +++ b/htdocs/install/mysql/data/llx_c_hrm_function.sql @@ -1,6 +1,6 @@ -- ============================================================================ -- Copyright (C) 2013 Jean-François Ferry --- Copyright (C) 2015 Alexandre Spangaro +-- Copyright (C) 2015 Alexandre Spangaro -- -- 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 diff --git a/htdocs/install/mysql/tables/llx_accounting_account.sql b/htdocs/install/mysql/tables/llx_accounting_account.sql index 79215115cfb..727965f6a9d 100644 --- a/htdocs/install/mysql/tables/llx_accounting_account.sql +++ b/htdocs/install/mysql/tables/llx_accounting_account.sql @@ -1,7 +1,7 @@ -- ============================================================================ -- Copyright (C) 2004-2006 Laurent Destailleur -- Copyright (C) 2014 Juanjo Menent --- Copyright (C) 2016 Alexandre Spangaro +-- Copyright (C) 2016 Alexandre Spangaro -- -- 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 diff --git a/htdocs/install/mysql/tables/llx_accounting_bookkeeping.sql b/htdocs/install/mysql/tables/llx_accounting_bookkeeping.sql index af6cd66826d..af693c273a4 100644 --- a/htdocs/install/mysql/tables/llx_accounting_bookkeeping.sql +++ b/htdocs/install/mysql/tables/llx_accounting_bookkeeping.sql @@ -1,6 +1,6 @@ -- ============================================================================ -- Copyright (C) 2013-2014 Olivier Geffroy --- Copyright (C) 2013-2017 Alexandre Spangaro +-- Copyright (C) 2013-2017 Alexandre Spangaro -- -- 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 diff --git a/htdocs/install/mysql/tables/llx_accounting_bookkeeping_tmp.sql b/htdocs/install/mysql/tables/llx_accounting_bookkeeping_tmp.sql index 2798a3d48e9..d8b1fd81066 100644 --- a/htdocs/install/mysql/tables/llx_accounting_bookkeeping_tmp.sql +++ b/htdocs/install/mysql/tables/llx_accounting_bookkeeping_tmp.sql @@ -1,6 +1,6 @@ -- ============================================================================ -- Copyright (C) 2013-2017 Olivier Geffroy --- Copyright (C) 2013-2017 Alexandre Spangaro +-- Copyright (C) 2013-2017 Alexandre Spangaro -- -- 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 diff --git a/htdocs/install/mysql/tables/llx_accounting_fiscalyear.sql b/htdocs/install/mysql/tables/llx_accounting_fiscalyear.sql index 89fd3ac8780..4cff341ed52 100644 --- a/htdocs/install/mysql/tables/llx_accounting_fiscalyear.sql +++ b/htdocs/install/mysql/tables/llx_accounting_fiscalyear.sql @@ -1,5 +1,5 @@ -- ============================================================================ --- Copyright (C) 2014 Alexandre Spangaro +-- Copyright (C) 2014 Alexandre Spangaro -- -- 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 diff --git a/htdocs/install/mysql/tables/llx_accounting_journal.key.sql b/htdocs/install/mysql/tables/llx_accounting_journal.key.sql index 701c39e06a2..7e16f707710 100644 --- a/htdocs/install/mysql/tables/llx_accounting_journal.key.sql +++ b/htdocs/install/mysql/tables/llx_accounting_journal.key.sql @@ -1,5 +1,5 @@ -- ============================================================================ --- Copyright (C) 2016 Alexandre Spangaro +-- Copyright (C) 2016 Alexandre Spangaro -- -- 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 diff --git a/htdocs/install/mysql/tables/llx_accounting_journal.sql b/htdocs/install/mysql/tables/llx_accounting_journal.sql index 51f1f972859..80d129ba3f6 100644 --- a/htdocs/install/mysql/tables/llx_accounting_journal.sql +++ b/htdocs/install/mysql/tables/llx_accounting_journal.sql @@ -1,5 +1,5 @@ -- ============================================================================ --- Copyright (C) 2016-2017 Alexandre Spangaro +-- Copyright (C) 2016-2017 Alexandre Spangaro -- -- 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 diff --git a/htdocs/install/mysql/tables/llx_accounting_system.sql b/htdocs/install/mysql/tables/llx_accounting_system.sql index 69f31eaa15f..cbee4ee25d3 100644 --- a/htdocs/install/mysql/tables/llx_accounting_system.sql +++ b/htdocs/install/mysql/tables/llx_accounting_system.sql @@ -1,6 +1,6 @@ -- ============================================================================ -- Copyright (C) 2004-2006 Laurent Destailleur --- Copyright (C) 2011-2016 Alexandre Spangaro +-- Copyright (C) 2011-2016 Alexandre Spangaro -- -- 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 diff --git a/htdocs/install/mysql/tables/llx_asset.key.sql b/htdocs/install/mysql/tables/llx_asset.key.sql index 31bed33a3ee..101a5d50250 100644 --- a/htdocs/install/mysql/tables/llx_asset.key.sql +++ b/htdocs/install/mysql/tables/llx_asset.key.sql @@ -1,4 +1,4 @@ --- Copyright (C) 2018 Alexandre Spangaro +-- Copyright (C) 2018 Alexandre Spangaro -- -- 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 diff --git a/htdocs/install/mysql/tables/llx_asset.sql b/htdocs/install/mysql/tables/llx_asset.sql index d6eba5ed93b..a0891ef4b0e 100644 --- a/htdocs/install/mysql/tables/llx_asset.sql +++ b/htdocs/install/mysql/tables/llx_asset.sql @@ -1,4 +1,4 @@ --- Copyright (C) 2018 Alexandre Spangaro +-- Copyright (C) 2018 Alexandre Spangaro -- -- 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 diff --git a/htdocs/install/mysql/tables/llx_asset_extrafields.sql b/htdocs/install/mysql/tables/llx_asset_extrafields.sql index bc5eedae6d6..19a3edf6ddc 100644 --- a/htdocs/install/mysql/tables/llx_asset_extrafields.sql +++ b/htdocs/install/mysql/tables/llx_asset_extrafields.sql @@ -1,4 +1,4 @@ --- Copyright (C) 2018 Alexandre Spangaro +-- Copyright (C) 2018 Alexandre Spangaro -- -- 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 diff --git a/htdocs/install/mysql/tables/llx_asset_type.key.sql b/htdocs/install/mysql/tables/llx_asset_type.key.sql index 2186a4aafd2..412f2ffff20 100644 --- a/htdocs/install/mysql/tables/llx_asset_type.key.sql +++ b/htdocs/install/mysql/tables/llx_asset_type.key.sql @@ -1,4 +1,4 @@ --- Copyright (C) 2018 Alexandre Spangaro +-- Copyright (C) 2018 Alexandre Spangaro -- -- 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 diff --git a/htdocs/install/mysql/tables/llx_asset_type.sql b/htdocs/install/mysql/tables/llx_asset_type.sql index 6b6a8b23db1..7a8866456b1 100644 --- a/htdocs/install/mysql/tables/llx_asset_type.sql +++ b/htdocs/install/mysql/tables/llx_asset_type.sql @@ -1,4 +1,4 @@ --- Copyright (C) 2018 Alexandre Spangaro +-- Copyright (C) 2018 Alexandre Spangaro -- -- 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 diff --git a/htdocs/install/mysql/tables/llx_asset_type_extrafields.key.sql b/htdocs/install/mysql/tables/llx_asset_type_extrafields.key.sql index dbcc2500df8..22c2eee9753 100644 --- a/htdocs/install/mysql/tables/llx_asset_type_extrafields.key.sql +++ b/htdocs/install/mysql/tables/llx_asset_type_extrafields.key.sql @@ -1,4 +1,4 @@ --- Copyright (C) 2018 Alexandre Spangaro +-- Copyright (C) 2018 Alexandre Spangaro -- -- 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 diff --git a/htdocs/install/mysql/tables/llx_asset_type_extrafields.sql b/htdocs/install/mysql/tables/llx_asset_type_extrafields.sql index 1b98bd3f524..2faae65702b 100644 --- a/htdocs/install/mysql/tables/llx_asset_type_extrafields.sql +++ b/htdocs/install/mysql/tables/llx_asset_type_extrafields.sql @@ -1,4 +1,4 @@ --- Copyright (C) 2018 Alexandre Spangaro +-- Copyright (C) 2018 Alexandre Spangaro -- -- 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 diff --git a/htdocs/install/mysql/tables/llx_bank_account.sql b/htdocs/install/mysql/tables/llx_bank_account.sql index 3da5a8d4ec8..ebe6672e70d 100644 --- a/htdocs/install/mysql/tables/llx_bank_account.sql +++ b/htdocs/install/mysql/tables/llx_bank_account.sql @@ -2,7 +2,7 @@ -- Copyright (C) 2000-2004 Rodolphe Quiedeville -- Copyright (C) 2004-2014 Laurent Destailleur -- Copyright (C) 2005-2012 Regis Houssin --- Copyright (C) 2014 Alexandre Spangaro +-- Copyright (C) 2014 Alexandre Spangaro -- -- 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 diff --git a/htdocs/install/mysql/tables/llx_c_accounting_category.key.sql b/htdocs/install/mysql/tables/llx_c_accounting_category.key.sql index be927f6e761..91fe439e46d 100644 --- a/htdocs/install/mysql/tables/llx_c_accounting_category.key.sql +++ b/htdocs/install/mysql/tables/llx_c_accounting_category.key.sql @@ -1,5 +1,5 @@ -- =================================================================== --- Copyright (C) 2015-2016 Alexandre Spangaro +-- Copyright (C) 2015-2016 Alexandre Spangaro -- -- 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 diff --git a/htdocs/install/mysql/tables/llx_c_accounting_category.sql b/htdocs/install/mysql/tables/llx_c_accounting_category.sql index 9df9a9d6ab0..275e001f18d 100644 --- a/htdocs/install/mysql/tables/llx_c_accounting_category.sql +++ b/htdocs/install/mysql/tables/llx_c_accounting_category.sql @@ -1,5 +1,5 @@ -- =================================================================== --- Copyright (C) 2015-2016 Alexandre Spangaro +-- Copyright (C) 2015-2016 Alexandre Spangaro -- Copyright (C) 2016 Jamal Elbaz -- -- This program is free software; you can redistribute it and/or modify diff --git a/htdocs/install/mysql/tables/llx_c_country.sql b/htdocs/install/mysql/tables/llx_c_country.sql index a955d76ea81..ab3935c3103 100644 --- a/htdocs/install/mysql/tables/llx_c_country.sql +++ b/htdocs/install/mysql/tables/llx_c_country.sql @@ -1,7 +1,7 @@ -- ======================================================================== -- Copyright (C) 2001-2004 Rodolphe Quiedeville -- Copyright (C) 2004 Laurent Destailleur --- Copyright (C) 2014 Alexandre Spangaro +-- Copyright (C) 2014 Alexandre Spangaro -- -- 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 diff --git a/htdocs/install/mysql/tables/llx_c_hrm_department.sql b/htdocs/install/mysql/tables/llx_c_hrm_department.sql index f9432d8b821..3407f38d0bd 100644 --- a/htdocs/install/mysql/tables/llx_c_hrm_department.sql +++ b/htdocs/install/mysql/tables/llx_c_hrm_department.sql @@ -1,6 +1,6 @@ -- -- Copyright (C) 2013 Jean-François Ferry --- Copyright (C) 2015 Alexandre Spangaro +-- Copyright (C) 2015 Alexandre Spangaro -- -- 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 diff --git a/htdocs/install/mysql/tables/llx_c_hrm_function.sql b/htdocs/install/mysql/tables/llx_c_hrm_function.sql index f3f87461866..38b63bfc5db 100644 --- a/htdocs/install/mysql/tables/llx_c_hrm_function.sql +++ b/htdocs/install/mysql/tables/llx_c_hrm_function.sql @@ -1,6 +1,6 @@ -- -- Copyright (C) 2013 Jean-François Ferry --- Copyright (C) 2015 Alexandre Spangaro +-- Copyright (C) 2015 Alexandre Spangaro -- -- 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 diff --git a/htdocs/install/mysql/tables/llx_c_paiement.sql b/htdocs/install/mysql/tables/llx_c_paiement.sql index 9e752b7e186..8286e4c8e1f 100644 --- a/htdocs/install/mysql/tables/llx_c_paiement.sql +++ b/htdocs/install/mysql/tables/llx_c_paiement.sql @@ -1,7 +1,7 @@ -- ======================================================================== -- Copyright (C) 2001-2004 Rodolphe Quiedeville -- Copyright (C) 2004-2014 Laurent Destailleur --- Copyright (C) 2014 Alexandre Spangaro +-- Copyright (C) 2014 Alexandre Spangaro -- Copyright (C) 2017 Regis Houssin -- -- This program is free software; you can redistribute it and/or modify diff --git a/htdocs/install/mysql/tables/llx_c_tva.sql b/htdocs/install/mysql/tables/llx_c_tva.sql index 91e141ad4d1..62d5b04125f 100644 --- a/htdocs/install/mysql/tables/llx_c_tva.sql +++ b/htdocs/install/mysql/tables/llx_c_tva.sql @@ -1,7 +1,7 @@ -- ======================================================================== -- Copyright (C) 2005 Laurent Destailleur -- Copyright (C) 2010-2015 Juanjo Menent --- Copyright (C) 2011-2012 Alexandre Spangaro +-- Copyright (C) 2011-2012 Alexandre Spangaro -- -- 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 diff --git a/htdocs/install/mysql/tables/llx_c_type_fees.sql b/htdocs/install/mysql/tables/llx_c_type_fees.sql index 15c6fe52182..787aac8d2c8 100644 --- a/htdocs/install/mysql/tables/llx_c_type_fees.sql +++ b/htdocs/install/mysql/tables/llx_c_type_fees.sql @@ -1,7 +1,7 @@ -- ======================================================================== -- Copyright (C) 2001-2002,2004 Rodolphe Quiedeville -- Copyright (C) 2004 Laurent Destailleur --- Copyright (C) 2014 Alexandre Spangaro +-- Copyright (C) 2014 Alexandre Spangaro -- -- 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 diff --git a/htdocs/install/mysql/tables/llx_chargesociales.sql b/htdocs/install/mysql/tables/llx_chargesociales.sql index e1556689a29..9efef8aec68 100644 --- a/htdocs/install/mysql/tables/llx_chargesociales.sql +++ b/htdocs/install/mysql/tables/llx_chargesociales.sql @@ -1,7 +1,7 @@ -- ======================================================================== -- Copyright (C) 2001-2002 Rodolphe Quiedeville -- Copyright (C) 2005-2009 Regis Houssin --- Copyright (C) 2017 Alexandre Spangaro +-- Copyright (C) 2017 Alexandre Spangaro -- -- 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 diff --git a/htdocs/install/mysql/tables/llx_don.sql b/htdocs/install/mysql/tables/llx_don.sql index 4cb081045ee..c9948133954 100644 --- a/htdocs/install/mysql/tables/llx_don.sql +++ b/htdocs/install/mysql/tables/llx_don.sql @@ -2,7 +2,7 @@ -- Copyright (C) 2001-2002 Rodolphe Quiedeville -- Copyright (C) 2009 Regis Houssin -- Copyright (C) 2011 Laurent Destailleur --- Copyright (C) 2015 Alexandre Spangaro +-- Copyright (C) 2015 Alexandre Spangaro -- -- 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 diff --git a/htdocs/install/mysql/tables/llx_don_extrafields.key.sql b/htdocs/install/mysql/tables/llx_don_extrafields.key.sql index e8da3084d34..46a77f1c162 100644 --- a/htdocs/install/mysql/tables/llx_don_extrafields.key.sql +++ b/htdocs/install/mysql/tables/llx_don_extrafields.key.sql @@ -1,5 +1,5 @@ -- =================================================================== --- Copyright (C) 2015 Alexandre Spangaro +-- Copyright (C) 2015 Alexandre Spangaro -- -- 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 diff --git a/htdocs/install/mysql/tables/llx_don_extrafields.sql b/htdocs/install/mysql/tables/llx_don_extrafields.sql index 72b4d0a862a..a854098a20f 100644 --- a/htdocs/install/mysql/tables/llx_don_extrafields.sql +++ b/htdocs/install/mysql/tables/llx_don_extrafields.sql @@ -1,5 +1,5 @@ -- ======================================================================== --- Copyright (C) 2015 Alexandre Spangaro +-- Copyright (C) 2015 Alexandre Spangaro -- -- 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 diff --git a/htdocs/install/mysql/tables/llx_establishment.sql b/htdocs/install/mysql/tables/llx_establishment.sql index 667d512762d..cb9aa676d40 100644 --- a/htdocs/install/mysql/tables/llx_establishment.sql +++ b/htdocs/install/mysql/tables/llx_establishment.sql @@ -1,5 +1,5 @@ -- ============================================================================ --- Copyright (C) 2015 Alexandre Spangaro +-- Copyright (C) 2015 Alexandre Spangaro -- -- 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 diff --git a/htdocs/install/mysql/tables/llx_loan.sql b/htdocs/install/mysql/tables/llx_loan.sql index f153e25dd22..abb1eab0c09 100644 --- a/htdocs/install/mysql/tables/llx_loan.sql +++ b/htdocs/install/mysql/tables/llx_loan.sql @@ -1,5 +1,5 @@ -- ======================================================================== --- Copyright (C) 2014 Alexandre Spangaro +-- Copyright (C) 2014 Alexandre Spangaro -- Copyright (C) 2015 Frederic France -- -- This program is free software; you can redistribute it and/or modify diff --git a/htdocs/install/mysql/tables/llx_loan_schedule.sql b/htdocs/install/mysql/tables/llx_loan_schedule.sql index 005ae07528e..11c167ae305 100644 --- a/htdocs/install/mysql/tables/llx_loan_schedule.sql +++ b/htdocs/install/mysql/tables/llx_loan_schedule.sql @@ -1,5 +1,5 @@ -- =================================================================== --- Copyright (C) 2014 Alexandre Spangaro +-- Copyright (C) 2014 Alexandre Spangaro -- Copyright (C) 2015 Frederic France -- -- This program is free software; you can redistribute it and/or modify diff --git a/htdocs/install/mysql/tables/llx_payment_donation.sql b/htdocs/install/mysql/tables/llx_payment_donation.sql index d452d4da054..67f6eade0f0 100644 --- a/htdocs/install/mysql/tables/llx_payment_donation.sql +++ b/htdocs/install/mysql/tables/llx_payment_donation.sql @@ -1,5 +1,5 @@ -- =================================================================== --- Copyright (C) 2015 Alexandre Spangaro +-- Copyright (C) 2015 Alexandre Spangaro -- -- 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 diff --git a/htdocs/install/mysql/tables/llx_payment_expensereport.sql b/htdocs/install/mysql/tables/llx_payment_expensereport.sql index deeb82f615c..aadd0a090fd 100644 --- a/htdocs/install/mysql/tables/llx_payment_expensereport.sql +++ b/htdocs/install/mysql/tables/llx_payment_expensereport.sql @@ -1,5 +1,5 @@ -- =================================================================== --- Copyright (C) 2015 Alexandre Spangaro +-- Copyright (C) 2015 Alexandre Spangaro -- -- 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 diff --git a/htdocs/install/mysql/tables/llx_payment_loan.sql b/htdocs/install/mysql/tables/llx_payment_loan.sql index 10801fc7454..28edaf6cb37 100644 --- a/htdocs/install/mysql/tables/llx_payment_loan.sql +++ b/htdocs/install/mysql/tables/llx_payment_loan.sql @@ -1,5 +1,5 @@ -- =================================================================== --- Copyright (C) 2014 Alexandre Spangaro +-- Copyright (C) 2014 Alexandre Spangaro -- Copyright (C) 2015 Frederic France -- -- This program is free software; you can redistribute it and/or modify diff --git a/htdocs/install/mysql/tables/llx_payment_salary.sql b/htdocs/install/mysql/tables/llx_payment_salary.sql index c56e6459aa0..3540725173b 100644 --- a/htdocs/install/mysql/tables/llx_payment_salary.sql +++ b/htdocs/install/mysql/tables/llx_payment_salary.sql @@ -1,5 +1,5 @@ -- =================================================================== --- Copyright (C) 2011-2018 Alexandre Spangaro +-- Copyright (C) 2011-2018 Alexandre Spangaro -- -- 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 diff --git a/htdocs/install/mysql/tables/llx_payment_various.sql b/htdocs/install/mysql/tables/llx_payment_various.sql index d3351287e58..880fb4b5698 100644 --- a/htdocs/install/mysql/tables/llx_payment_various.sql +++ b/htdocs/install/mysql/tables/llx_payment_various.sql @@ -1,5 +1,5 @@ -- =================================================================== --- Copyright (C) 2017 Alexandre Spangaro +-- Copyright (C) 2017 Alexandre Spangaro -- -- 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 diff --git a/htdocs/install/mysql/tables/llx_user_rib.sql b/htdocs/install/mysql/tables/llx_user_rib.sql index 05738ce4582..d6d397c5787 100644 --- a/htdocs/install/mysql/tables/llx_user_rib.sql +++ b/htdocs/install/mysql/tables/llx_user_rib.sql @@ -1,5 +1,5 @@ -- ============================================================================= --- Copyright (C) 2015 Alexandre Spangaro +-- Copyright (C) 2015 Alexandre Spangaro -- -- 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 diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index 144caf49dde..a118151355c 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -84,7 +84,8 @@ ChangeAndLoad=Change and load Addanaccount=Add an accounting account AccountAccounting=Accounting account AccountAccountingShort=Account -SubledgerAccount=Subledger Account +SubledgerAccount=Subledger account +SubledgerAccountLabel=Subledger account label ShowAccountingAccount=Show accounting account ShowAccountingJournal=Show accounting journal AccountAccountingSuggest=Accounting account suggested @@ -166,6 +167,7 @@ LabelOperation=Label operation Sens=Sens LetteringCode=Lettering code Codejournal=Journal +JournalLabel=Journal label NumPiece=Piece number TransactionNumShort=Num. transaction AccountingCategory=Personalized groups diff --git a/htdocs/langs/en_US/assets.lang b/htdocs/langs/en_US/assets.lang index 6fb40755fdb..293d9b205f6 100644 --- a/htdocs/langs/en_US/assets.lang +++ b/htdocs/langs/en_US/assets.lang @@ -1,4 +1,4 @@ -# Copyright (C) 2018 Alexandre Spangaro +# Copyright (C) 2018 Alexandre Spangaro # # 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 diff --git a/htdocs/langs/fr_FR/assets.lang b/htdocs/langs/fr_FR/assets.lang index 356245e8761..847e5a6cb15 100644 --- a/htdocs/langs/fr_FR/assets.lang +++ b/htdocs/langs/fr_FR/assets.lang @@ -1,4 +1,4 @@ -# Copyright (C) 2018 Alexandre Spangaro +# Copyright (C) 2018 Alexandre Spangaro # # 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 diff --git a/htdocs/langs/lv_LV/assets.lang b/htdocs/langs/lv_LV/assets.lang index f632913c15e..7afddf85d74 100644 --- a/htdocs/langs/lv_LV/assets.lang +++ b/htdocs/langs/lv_LV/assets.lang @@ -1,4 +1,4 @@ -# Copyright (C) 2018 Alexandre Spangaro +# Copyright (C) 2018 Alexandre Spangaro # # 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 diff --git a/htdocs/langs/pt_BR/assets.lang b/htdocs/langs/pt_BR/assets.lang index 877bd41ecd1..56f4a48c9fc 100644 --- a/htdocs/langs/pt_BR/assets.lang +++ b/htdocs/langs/pt_BR/assets.lang @@ -1,4 +1,4 @@ -# Copyright (C) 2018 Alexandre Spangaro +# Copyright (C) 2018 Alexandre Spangaro # # 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 diff --git a/htdocs/loan/card.php b/htdocs/loan/card.php index 4e76c3af593..c5d38d1148d 100644 --- a/htdocs/loan/card.php +++ b/htdocs/loan/card.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2014-2018 Alexandre Spangaro * Copyright (C) 2015 Frederic France * Copyright (C) 2017 Laurent Destailleur * diff --git a/htdocs/loan/class/loan.class.php b/htdocs/loan/class/loan.class.php index 15c85fe155e..c1e421d5ef9 100644 --- a/htdocs/loan/class/loan.class.php +++ b/htdocs/loan/class/loan.class.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2014-2018 Alexandre Spangaro * Copyright (C) 2015-2018 Frédéric France * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/loan/class/paymentloan.class.php b/htdocs/loan/class/paymentloan.class.php index 4d4bb2b78ba..e4568246c9d 100644 --- a/htdocs/loan/class/paymentloan.class.php +++ b/htdocs/loan/class/paymentloan.class.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2014-2018 Alexandre Spangaro * Copyright (C) 2015-2018 Frederic France * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/loan/createschedule.php b/htdocs/loan/createschedule.php index 2ee31d1c7a0..76bbaef715c 100644 --- a/htdocs/loan/createschedule.php +++ b/htdocs/loan/createschedule.php @@ -1,6 +1,6 @@ - * Copyright (C) 2018 Alexandre Spangaro + * Copyright (C) 2018 Alexandre Spangaro * * 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 diff --git a/htdocs/loan/document.php b/htdocs/loan/document.php index 0cd359052da..8d3d59209f7 100644 --- a/htdocs/loan/document.php +++ b/htdocs/loan/document.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2014-2018 Alexandre Spangaro * Copyright (C) 2017 Ferran Marcet * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/loan/info.php b/htdocs/loan/info.php index b405f6c4253..a6f7b12a9de 100644 --- a/htdocs/loan/info.php +++ b/htdocs/loan/info.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2014-2018 Alexandre Spangaro * Copyright (C) 2017 Ferran Marcet * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/loan/list.php b/htdocs/loan/list.php index bd6f45ab7c0..be3de3a81d1 100644 --- a/htdocs/loan/list.php +++ b/htdocs/loan/list.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2014-2018 Alexandre Spangaro * Copyright (C) 2015 Frederic France * Copyright (C) 2015 Juanjo Menent * Copyright (C) 2016 Laurent Destailleur diff --git a/htdocs/loan/note.php b/htdocs/loan/note.php index 7fc60446381..b0f8a8c9c0a 100644 --- a/htdocs/loan/note.php +++ b/htdocs/loan/note.php @@ -4,7 +4,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2013 Florian Henry * Copyright (C) 2015 Frederic France - * Copyright (C) 2016-2018 Alexandre Spangaro + * Copyright (C) 2016-2018 Alexandre Spangaro * Copyright (C) 2017 Ferran Marcet * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/loan/payment/card.php b/htdocs/loan/payment/card.php index 2dc0e7d0383..23251c21375 100644 --- a/htdocs/loan/payment/card.php +++ b/htdocs/loan/payment/card.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2014-2018 Alexandre Spangaro * * 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 diff --git a/htdocs/loan/payment/payment.php b/htdocs/loan/payment/payment.php index 08f5d5aad77..db858c95ed8 100644 --- a/htdocs/loan/payment/payment.php +++ b/htdocs/loan/payment/payment.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2014-2018 Alexandre Spangaro * Copyright (C) 2015-2018 Frédéric France * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/loan/schedule.php b/htdocs/loan/schedule.php index b132601f7d5..2041445b24b 100644 --- a/htdocs/loan/schedule.php +++ b/htdocs/loan/schedule.php @@ -1,6 +1,6 @@ - * Copyright (C) 2018 Alexandre Spangaro + * Copyright (C) 2018 Alexandre Spangaro * * 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 diff --git a/htdocs/opensurvey/wizard/create_survey.php b/htdocs/opensurvey/wizard/create_survey.php index 1ad9cf17e5e..0c746fcf8b2 100644 --- a/htdocs/opensurvey/wizard/create_survey.php +++ b/htdocs/opensurvey/wizard/create_survey.php @@ -1,7 +1,7 @@ * Copyright (C) 2014 Marcos García - * Copyright (C) 2015-2016 Alexandre Spangaro + * Copyright (C) 2015-2016 Alexandre Spangaro * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 95a72bbb8c2..c99129473c7 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -8,7 +8,7 @@ * Copyright (C) 2012 Cedric Salvador * Copyright (C) 2013-2014 Cedric GROSS * Copyright (C) 2013-2016 Marcos García - * Copyright (C) 2011-2017 Alexandre Spangaro + * Copyright (C) 2011-2017 Alexandre Spangaro * Copyright (C) 2014 Henry Florian * Copyright (C) 2014-2016 Philippe Grand * Copyright (C) 2014 Ion agorria diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index c43d1b2e53f..2f1fdd4184e 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -6,7 +6,7 @@ * Copyright (C) 2010-2012 Juanjo Menent * Copyright (C) 2012 Christophe Battarel * Copyright (C) 2014 Ion Agorria - * Copyright (C) 2015 Alexandre Spangaro + * Copyright (C) 2015 Alexandre Spangaro * Copyright (C) 2016 Ferran Marcet * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 1150d9cd10e..ec1987d4764 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -8,7 +8,7 @@ * Copyright (C) 2014-2018 Juanjo Menent * Copyright (C) 2014-2019 Philippe Grand * Copyright (C) 2014 Ion agorria - * Copyright (C) 2015 Alexandre Spangaro + * Copyright (C) 2015 Alexandre Spangaro * Copyright (C) 2015 Marcos García * Copyright (C) 2016 Ferran Marcet * Copyright (C) 2018 Frédéric France diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 2ff54dac3b4..d9d1ac4a603 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2015 Laurent Destailleur * Copyright (C) 2005-2010 Regis Houssin * Copyright (C) 2012-2016 Juanjo Menent - * Copyright (C) 2015-2018 Alexandre Spangaro + * Copyright (C) 2015-2018 Alexandre Spangaro * Copyright (C) 2015 Marcos García * Copyright (C) 2016 Josep Lluís Amador * diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index 1d7554914bc..6ff856ed238 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -5,7 +5,7 @@ * Copyright (C) 2012 Regis Houssin * Copyright (C) 2012 J. Fernando Lagrange * Copyright (C) 2018 Frédéric France - * Copyright (C) 2018 Alexandre Spangaro + * Copyright (C) 2018 Alexandre Spangaro * * 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 diff --git a/htdocs/public/members/public_card.php b/htdocs/public/members/public_card.php index 4f69f55e919..2cc23ad1508 100644 --- a/htdocs/public/members/public_card.php +++ b/htdocs/public/members/public_card.php @@ -3,7 +3,7 @@ * Copyright (C) 2002-2003 Jean-Louis Bergamo * Copyright (C) 2007-2012 Laurent Destailleur * Copyright (C) 2012 Regis Houssin - * Copyright (C) 2018 Alexandre Spangaro + * Copyright (C) 2018 Alexandre Spangaro * * 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 diff --git a/htdocs/public/stripe/newpayment.php b/htdocs/public/stripe/newpayment.php index b127dd71107..38f76865cb7 100644 --- a/htdocs/public/stripe/newpayment.php +++ b/htdocs/public/stripe/newpayment.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2017 Alexandre Spangaro * Copyright (C) 2017 Saasprov * Copyright (C) 2017 Laurent Destailleur * Copyright (C) 2017 Ferran Marcet diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 5e04b67f797..bde8dffbb8f 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -6,7 +6,7 @@ * Copyright (C) 2005-2017 Regis Houssin * Copyright (C) 2008 Patrick Raguin * Copyright (C) 2010-2016 Juanjo Menent - * Copyright (C) 2011-2013 Alexandre Spangaro + * Copyright (C) 2011-2013 Alexandre Spangaro * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2015 Marcos García * Copyright (C) 2015 Raphaël Doursenaud diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 992d44a7053..518179a8a7c 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -8,7 +8,7 @@ * Copyright (C) 2008 Patrick Raguin * Copyright (C) 2010-2018 Juanjo Menent * Copyright (C) 2013 Florian Henry - * Copyright (C) 2013 Alexandre Spangaro + * Copyright (C) 2013 Alexandre Spangaro * Copyright (C) 2013 Peter Fontaine * Copyright (C) 2014-2015 Marcos García * Copyright (C) 2015 Raphaël Doursenaud diff --git a/htdocs/societe/contact.php b/htdocs/societe/contact.php index a96d7e9de7c..62ba944eabb 100644 --- a/htdocs/societe/contact.php +++ b/htdocs/societe/contact.php @@ -6,7 +6,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2008 Patrick Raguin * Copyright (C) 2010-2016 Juanjo Menent - * Copyright (C) 2011-2013 Alexandre Spangaro + * Copyright (C) 2011-2013 Alexandre Spangaro * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2015 Marcos García * Copyright (C) 2015 Raphaël Doursenaud diff --git a/htdocs/stripe/admin/stripe.php b/htdocs/stripe/admin/stripe.php index f9075c7cc8a..04368ddfc13 100644 --- a/htdocs/stripe/admin/stripe.php +++ b/htdocs/stripe/admin/stripe.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2017 Alexandre Spangaro * Copyright (C) 2017 Olivier Geffroy * Copyright (C) 2017 Saasprov * Copyright (C) 2018 ptibogxiv diff --git a/htdocs/stripe/config.php b/htdocs/stripe/config.php index e5a3705cce3..fb0ef25f8bd 100644 --- a/htdocs/stripe/config.php +++ b/htdocs/stripe/config.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2017 Alexandre Spangaro * Copyright (C) 2017 Saasprov * Copyright (C) 2017 Ferran Marcet * diff --git a/htdocs/stripe/lib/stripe.lib.php b/htdocs/stripe/lib/stripe.lib.php index 03b205bff94..3e916761d9b 100644 --- a/htdocs/stripe/lib/stripe.lib.php +++ b/htdocs/stripe/lib/stripe.lib.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2017 Alexandre Spangaro * * 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 diff --git a/htdocs/stripe/payout.php b/htdocs/stripe/payout.php new file mode 100644 index 00000000000..db2d2f4f7d7 --- /dev/null +++ b/htdocs/stripe/payout.php @@ -0,0 +1,230 @@ + + * + * 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 + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +// Put here all includes required by your class file + +require '../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; +require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; +require_once DOL_DOCUMENT_ROOT.'/stripe/class/stripe.class.php'; +//require_once DOL_DOCUMENT_ROOT.'/core/lib/stripe.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; +require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; +if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingjournal.class.php'; + +// Load translation files required by the page +$langs->loadLangs(array('compta', 'salaries', 'bills', 'hrm', 'stripe')); + +// Security check +$socid = GETPOST("socid","int"); +if ($user->societe_id) $socid=$user->societe_id; +//$result = restrictedArea($user, 'salaries', '', '', ''); + +$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; +$rowid = GETPOST("rowid",'alpha'); +$sortfield = GETPOST("sortfield",'alpha'); +$sortorder = GETPOST("sortorder",'alpha'); +$page = GETPOST("page",'int'); +if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 +$offset = $conf->liste_limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; + + + +/* + * View + */ + +$form = new Form($db); +$societestatic = new Societe($db); +$memberstatic = new Adherent($db); +$acc = new Account($db); +$stripe = new Stripe($db); + +llxHeader('', $langs->trans("StripePayoutList")); + +if (! empty($conf->stripe->enabled) && (empty($conf->global->STRIPE_LIVE) || GETPOST('forcesandbox','alpha'))) +{ + $service = 'StripeTest'; + $servicestatus = '0'; + dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), '', 'warning'); +} +else +{ + $service = 'StripeLive'; + $servicestatus = '1'; +} + +$stripeacc = $stripe->getStripeAccount($service); +/*if (empty($stripeaccount)) +{ + print $langs->trans('ErrorStripeAccountNotDefined'); +}*/ + +if (! $rowid) { + + print '
'; + if ($optioncss != '') + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + + $title=$langs->trans("StripePayoutList"); + $title.=($stripeaccount?' (Stripe connection with Stripe OAuth Connect account '.$stripeacc.')':' (Stripe connection with keys from Stripe module setup)'); + + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $totalnboflines, 'title_accountancy.png', 0, '', '', $limit); + + print '
'; + print '' . "\n"; + + print ''; + print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "", "", "", "", $sortfield, $sortorder); + //print_liste_field_titre("StripeCustomerId",$_SERVER["PHP_SELF"],"","","","",$sortfield,$sortorder); + //print_liste_field_titre("CustomerId", $_SERVER["PHP_SELF"], "", "", "", "", $sortfield, $sortorder); + //print_liste_field_titre("Origin", $_SERVER["PHP_SELF"], "", "", "", "", $sortfield, $sortorder); + print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "", "", "", 'align="center"', $sortfield, $sortorder); + print_liste_field_titre("DateOperation", $_SERVER["PHP_SELF"], "", "", "", 'align="center"', $sortfield, $sortorder); + print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "", "", "", 'align="left"', $sortfield, $sortorder); + print_liste_field_titre("Paid", $_SERVER["PHP_SELF"], "", "", "", 'align="right"', $sortfield, $sortorder); + print_liste_field_titre("Fee", $_SERVER["PHP_SELF"], "", "", "", 'align="right"', $sortfield, $sortorder); + print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "", "", "", 'align="right"'); + print "\n"; + + print "\n"; + + if ($stripeacc) + { + $payout = \Stripe\Payout::all(array("limit" => $limit), array("stripe_account" => $stripeacc)); + } + else + { + $payout = \Stripe\Payout::all(array("limit" => $limit)); + } + + foreach ($payout->data as $payout) + { + //$charge = $payout; + //var_dump($payout); + + // The metadata FULLTAG is defined by the online payment page + /*$FULLTAG=$charge->metadata->FULLTAG; + + // Save into $tmparray all metadata + $tmparray = dolExplodeIntoArray($FULLTAG,'.','='); + // Load origin object according to metadata + if (! empty($tmparray['CUS'])) + { + $societestatic->fetch($tmparray['CUS']); + } + else + { + $societestatic->id = 0; + } + if (! empty($tmparray['MEM'])) + { + $memberstatic->fetch($tmparray['MEM']); + } + else + { + $memberstatic->id = 0; + }*/ + + $societestatic->fetch($charge->metadata->idcustomer); + $societestatic->id = $charge->metadata->idcustomer; + $societestatic->lastname = $obj->lastname; + $societestatic->firstname = $obj->firstname; + $societestatic->admin = $obj->admin; + $societestatic->login = $obj->login; + $societestatic->email = $obj->email; + $societestatic->societe_id = $obj->fk_soc; + + print ''; + + // Ref + if (!empty($stripeacc)) $connect=$stripeacc.'/'; + + $url='https://dashboard.stripe.com/'.$connect.'test/payouts/'.$payout->id; + if ($servicestatus) { + $url='https://dashboard.stripe.com/'.$connect.'/payouts/'.$payout->id; + } + + print "\n"; + + + // Stripe customer + //print "\n"; + // Link + /*print "\n";*/ + // Origine + //print "\n"; + // Date payment + print '\n"; + // Date payment + print '\n"; + // Type + print ''; + // Amount + print ""; + print ""; + // Status + print "'; + print "\n"; + } + print "
".img_picto($langs->trans('ShowInStripe'), 'object_globe')." " . $payout->id . "".$charge->customer.""; + if ($societestatic->id > 0) + { + print $societestatic->getNomUrl(1); + } + if ($memberstatic->id > 0) + { + print $memberstatic->getNomUrl(1); + } + print ""; + ////if ($charge->metadata->dol_type=="order"){ + // $object = new Commande($db); + // $object->fetch($charge->metadata->dol_id); + // print "".img_picto('', 'object_order')." ".$object->ref.""; + //} elseif ($charge->metadata->dol_type=="invoice"){ + // $object = new Facture($db); + // $object->fetch($charge->metadata->dol_id); + // print "".img_picto('', 'object_invoice')." ".$object->ref.""; + //} + //print "' . dol_print_date($payout->created, '%d/%m/%Y %H:%M') . "' . dol_print_date($payout->arrival_date, '%d/%m/%Y %H:%M') . "' . $payout->description . '" . price(($payout->amount) / 100, 0, '', 1, - 1, - 1, strtoupper($payout->currency)) . "" . price(($payout->fee) / 100, 0, '', 1, - 1, - 1, strtoupper($payout->currency)) . ""; + if ($payout->status=='paid') + {print img_picto($langs->trans("".$payout->status.""),'statut4');} + elseif ($payout->status=='pending') + {print img_picto($langs->trans("".$payout->status.""),'statut7');} + elseif ($payout->status=='in_transit') + {print img_picto($langs->trans("".$payout->status.""),'statut7');} + elseif ($payout->status=='failed') + {print img_picto($langs->trans("".$payout->status.""),'statut7');} + elseif ($payout->status=='canceled') + {print img_picto($langs->trans("".$payout->status.""),'statut8');} + print '
"; + print '
'; + print '
'; +} + +// End of page +llxFooter(); +$db->close(); diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 1be14f46345..c7485d7fd99 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -4,7 +4,7 @@ * Copyright (C) 2007-2017 Regis Houssin * Copyright (C) 2011 Philippe Grand * Copyright (C) 2012 Juanjo Menent - * Copyright (C) 2015 Alexandre Spangaro + * Copyright (C) 2015 Alexandre Spangaro * Copyright (C) 2018 Ferran Marcet * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/user/bank.php b/htdocs/user/bank.php index 8001f59feb3..5229654f2b4 100644 --- a/htdocs/user/bank.php +++ b/htdocs/user/bank.php @@ -5,7 +5,7 @@ * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2013 Peter Fontaine * Copyright (C) 2015-2016 Marcos García - * Copyright (C) 2015 Alexandre Spangaro + * Copyright (C) 2015 Alexandre Spangaro * * 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 diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 685159114ea..a639f49ba36 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -8,7 +8,7 @@ * Copyright (C) 2011 Herve Prot * Copyright (C) 2012-2018 Juanjo Menent * Copyright (C) 2013 Florian Henry - * Copyright (C) 2013-2016 Alexandre Spangaro + * Copyright (C) 2013-2016 Alexandre Spangaro * Copyright (C) 2015-2017 Jean-François Ferry * Copyright (C) 2015 Ari Elbaz (elarifr) * Copyright (C) 2015-2018 Charlene Benke diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 176aaa0e4e0..d25364178e5 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -8,7 +8,7 @@ * Copyright (C) 2005 Lionel Cousteix * Copyright (C) 2011 Herve Prot * Copyright (C) 2013-2018 Philippe Grand - * Copyright (C) 2013-2015 Alexandre Spangaro + * Copyright (C) 2013-2015 Alexandre Spangaro * Copyright (C) 2015 Marcos García * Copyright (C) 2018 charlene Benke * Copyright (C) 2018 Nicolas ZABOURI diff --git a/htdocs/user/class/userbankaccount.class.php b/htdocs/user/class/userbankaccount.class.php index d18ece1f89e..8e9ad2745c3 100644 --- a/htdocs/user/class/userbankaccount.class.php +++ b/htdocs/user/class/userbankaccount.class.php @@ -3,7 +3,7 @@ * Copyright (C) 2010-2013 Laurent Destailleur * Copyright (C) 2012 Regis Houssin * Copyright (C) 2013 Peter Fontaine - * Copyright (C) 2015 Alexandre Spangaro + * Copyright (C) 2015 Alexandre Spangaro * Copyright (C) 2016 Marcos García * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/user/list.php b/htdocs/user/list.php index 22601df793f..fca26b78101 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -2,7 +2,7 @@ /* Copyright (C) 2002-2005 Rodolphe Quiedeville * Copyright (C) 2004-2017 Laurent Destailleur * Copyright (C) 2005-2017 Regis Houssin - * Copyright (C) 2015 Alexandre Spangaro + * Copyright (C) 2015 Alexandre Spangaro * Copyright (C) 2016 Marcos García * * This program is free software; you can redistribute it and/or modify diff --git a/scripts/accountancy/export-thirdpartyaccount.php b/scripts/accountancy/export-thirdpartyaccount.php index 7d5c87a8ca5..bfd7cdefc2f 100755 --- a/scripts/accountancy/export-thirdpartyaccount.php +++ b/scripts/accountancy/export-thirdpartyaccount.php @@ -1,7 +1,7 @@ #!/usr/bin/env php - * Copyright (C) 2013-2014 Alexandre Spangaro + * Copyright (C) 2013-2014 Alexandre Spangaro * Copyright (C) 2014 Florian Henry * Copyright (C) 2018 Frédéric France *