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/dev/initdata/generate-order.php b/dev/initdata/generate-order.php index 5e53fa752a2..e0adb2a256e 100755 --- a/dev/initdata/generate-order.php +++ b/dev/initdata/generate-order.php @@ -220,4 +220,3 @@ for ($s = 0 ; $s < GEN_NUMBER_COMMANDE ; $s++) dol_print_error($db,$object->error); } } - diff --git a/dev/initdata/generate-product.php b/dev/initdata/generate-product.php index 393d5c5ce3d..f1b6c25e92a 100755 --- a/dev/initdata/generate-product.php +++ b/dev/initdata/generate-product.php @@ -96,5 +96,3 @@ for ($s = 0 ; $s < GEN_NUMBER_PRODUIT ; $s++) if ($ret < 0) print "Error $ret - ".$produit->error."\n"; else print " OK with ref ".$produit->ref."\n"; } - - diff --git a/dev/initdata/generate-thirdparty.php b/dev/initdata/generate-thirdparty.php index 7f2c3e2055d..3744abeae7c 100755 --- a/dev/initdata/generate-thirdparty.php +++ b/dev/initdata/generate-thirdparty.php @@ -127,5 +127,3 @@ for ($s = 0 ; $s < GEN_NUMBER_SOCIETE ; $s++) print "Error: ".$soc->error."\n"; } } - - diff --git a/dev/initdata/purge-data.php b/dev/initdata/purge-data.php index 2bdf200225b..63a10d84bc5 100755 --- a/dev/initdata/purge-data.php +++ b/dev/initdata/purge-data.php @@ -275,4 +275,3 @@ else } $db->close(); - diff --git a/dev/setup/codesniffer/ruleset.xml b/dev/setup/codesniffer/ruleset.xml index 72eecacef3c..b5c1ae5b6a9 100644 --- a/dev/setup/codesniffer/ruleset.xml +++ b/dev/setup/codesniffer/ruleset.xml @@ -429,4 +429,8 @@ + + + + diff --git a/dev/translation/sanity_check_en_langfiles.php b/dev/translation/sanity_check_en_langfiles.php index cfc51e210f4..556a0fce254 100755 --- a/dev/translation/sanity_check_en_langfiles.php +++ b/dev/translation/sanity_check_en_langfiles.php @@ -388,4 +388,3 @@ if ($web) } exit; - diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index 45ecb5cd6e6..6a6e1f44a6a 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 @@ -298,7 +298,7 @@ if ($resql) if (! empty($arrayfields['aa.pcg_type']['checked'])) print ''; if (! empty($arrayfields['aa.pcg_subtype']['checked'])) print ''; if (! empty($arrayfields['aa.active']['checked'])) print ' '; - print ''; + print ''; $searchpicto=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1); print $searchpicto; print ''; diff --git a/htdocs/accountancy/admin/accountmodel.php b/htdocs/accountancy/admin/accountmodel.php index 0d1d5625958..637d9548eb9 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 * @@ -517,7 +517,7 @@ if ($id) // dans les dictionnaires de donnees $valuetoshow=ucfirst($fieldlist[$field]); // Par defaut $valuetoshow=$langs->trans($valuetoshow); // try to translate - $align="left"; + $class="left"; if ($fieldlist[$field]=='code') { $valuetoshow=$langs->trans("Code"); } if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') { @@ -573,7 +573,7 @@ if ($id) fieldListAccountModel($fieldlist,$obj,$tabname[$id],'add'); } - print ''; + print ''; print ''; print ''; print ""; @@ -606,7 +606,7 @@ if ($id) // There is several pages if ($num > $listlimit) { - print ''; + print ''; print_fleche_navigation($page, $_SERVER["PHP_SELF"], $paramwithsearch, ($num > $listlimit), ''); print ''; } @@ -634,7 +634,7 @@ if ($id) } } print ''; - print ''; + print ''; $searchpicto=$form->showFilterAndCheckAddButtons(0); print $searchpicto; print ''; @@ -647,7 +647,7 @@ if ($id) // Determine le nom du champ par rapport aux noms possibles // dans les dictionnaires de donnees $showfield=1; // By defaut - $align="left"; + $class="left"; $sortable=1; $valuetoshow=''; /* @@ -702,7 +702,7 @@ if ($id) if (empty($reshook)) fieldListAccountModel($fieldlist,$obj,$tabname[$id],'edit'); - print ' '; + print ' '; print ' '; } else @@ -719,7 +719,7 @@ if ($id) { $showfield=1; - $align="left"; + $class="left"; $valuetoshow=$obj->{$fieldlist[$field]}; if ($value == 'type_template') { @@ -874,4 +874,3 @@ function fieldListAccountModel($fieldlist, $obj = '', $tabname = '', $context = } } } - diff --git a/htdocs/accountancy/admin/card.php b/htdocs/accountancy/admin/card.php index b8e6945b632..449d425b846 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 290aa93c0b7..14eec9fa58a 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 ebd8011469e..e18be1b8d60 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 @@ -467,7 +467,7 @@ if ($id) // dans les dictionnaires de donnees $valuetoshow=ucfirst($fieldlist[$field]); // Par defaut $valuetoshow=$langs->trans($valuetoshow); // try to translate - $align="left"; + $class="left"; if ($fieldlist[$field]=='type') { if ($tabname[$id] == MAIN_DB_PREFIX."c_paiement") $valuetoshow=$form->textwithtooltip($langs->trans("Type"),$langs->trans("TypePaymentDesc"),2,1,img_help(1,'')); else $valuetoshow=$langs->trans("Type"); @@ -531,7 +531,7 @@ if ($id) fieldListAccountingCategories($fieldlist,$obj,$tabname[$id],'add'); } - print ''; + print ''; print ''; print ''; print ""; @@ -559,7 +559,7 @@ if ($id) // There is several pages if ($num > $listlimit) { - print ''; + print ''; print_fleche_navigation($page, $_SERVER["PHP_SELF"], $paramwithsearch, ($num > $listlimit), ''); print ''; } @@ -607,7 +607,7 @@ if ($id) // Determine le nom du champ par rapport aux noms possibles // dans les dictionnaires de donnees $showfield=1; // By defaut - $align="left"; + $class="left"; $sortable=1; $valuetoshow=''; @@ -693,7 +693,7 @@ if ($id) { $showfield=1; - $align="left"; + $class="left"; $valuetoshow=$obj->{$fieldlist[$field]}; if ($value == 'category_type') { @@ -873,4 +873,3 @@ function fieldListAccountingCategories($fieldlist, $obj = '', $tabname = '', $co } } } - diff --git a/htdocs/accountancy/admin/defaultaccounts.php b/htdocs/accountancy/admin/defaultaccounts.php index 2f41dfa4bfd..1cd00627aa3 100644 --- a/htdocs/accountancy/admin/defaultaccounts.php +++ b/htdocs/accountancy/admin/defaultaccounts.php @@ -1,7 +1,7 @@ * Copyright (C) 2013-2014 Florian Henry - * Copyright (C) 2013-2018 Alexandre Spangaro + * Copyright (C) 2013-2019 Alexandre Spangaro * Copyright (C) 2014-2015 Ari Elbaz (elarifr) * Copyright (C) 2014 Marcos García * Copyright (C) 2014 Juanjo Menent @@ -55,6 +55,8 @@ $list_account_main = array ( $list_account = array ( 'ACCOUNTING_PRODUCT_BUY_ACCOUNT', 'ACCOUNTING_PRODUCT_SOLD_ACCOUNT', + 'ACCOUNTING_PRODUCT_SOLD_INTRA_ACCOUNT', + 'ACCOUNTING_PRODUCT_SOLD_EXPORT_ACCOUNT', 'ACCOUNTING_SERVICE_BUY_ACCOUNT', 'ACCOUNTING_SERVICE_SOLD_ACCOUNT', 'ACCOUNTING_VAT_BUY_ACCOUNT', 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 26620c635e2..06641d7d0a9 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 42a6710c3c1..19f6da0c922 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 3141a624194..9dfa7a681e2 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 d3a62b5a6ab..236ca09cfee 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 f26aba437e5..f8f7a5f7a54 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 @@ -429,7 +429,7 @@ if ($id) // dans les dictionnaires de donnees $valuetoshow=ucfirst($fieldlist[$field]); // Par defaut $valuetoshow=$langs->trans($valuetoshow); // try to translate - $align="left"; + $class="left"; if ($fieldlist[$field]=='code') { $valuetoshow=$langs->trans("Code"); } if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') { @@ -480,7 +480,7 @@ if ($id) fieldListJournal($fieldlist,$obj,$tabname[$id],'add'); } - print ''; + print ''; print ''; print ''; print ""; @@ -508,7 +508,7 @@ if ($id) // There is several pages if ($num > $listlimit) { - print ''; + print ''; print_fleche_navigation($page, $_SERVER["PHP_SELF"], $paramwithsearch, ($num > $listlimit), ''); print ''; } @@ -537,7 +537,7 @@ if ($id) // Determine le nom du champ par rapport aux noms possibles // dans les dictionnaires de donnees $showfield=1; // By defaut - $align="left"; + $class="left"; $sortable=1; $valuetoshow=''; /* @@ -606,7 +606,7 @@ if ($id) { $showfield=1; - $align="left"; + $class="left"; $valuetoshow=$obj->{$fieldlist[$field]}; if ($valuetoshow=='all') { $valuetoshow=$langs->trans('All'); diff --git a/htdocs/accountancy/admin/productaccount.php b/htdocs/accountancy/admin/productaccount.php index bce4f12e559..78d2ac08e14 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 6a323121a6e..86d513d059a 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 @@ -235,7 +235,7 @@ if ($action != 'export_csv') print $langs->trans('to'); print $formaccounting->select_account($search_accountancy_code_end, 'search_accountancy_code_end', 1, array(), 1, 1, ''); print ''; - print ''; + print ''; $searchpicto=$form->showFilterAndCheckAddButtons(0); print $searchpicto; print ''; @@ -245,9 +245,9 @@ if ($action != 'export_csv') print ''; print_liste_field_titre("AccountAccounting", $_SERVER['PHP_SELF'], "t.numero_compte", "", $param, "", $sortfield, $sortorder); print_liste_field_titre("Label", $_SERVER['PHP_SELF'], "t.label_operation", "", $param, "", $sortfield, $sortorder); - print_liste_field_titre("Debit", $_SERVER['PHP_SELF'], "t.debit", "", $param, 'align="right"', $sortfield, $sortorder); - print_liste_field_titre("Credit", $_SERVER['PHP_SELF'], "t.credit", "", $param, 'align="right"', $sortfield, $sortorder); - print_liste_field_titre("Balance", $_SERVER["PHP_SELF"], "", $param, "", 'align="right"', $sortfield, $sortorder); + print_liste_field_titre("Debit", $_SERVER['PHP_SELF'], "t.debit", "", $param, 'class="right"', $sortfield, $sortorder); + print_liste_field_titre("Credit", $_SERVER['PHP_SELF'], "t.credit", "", $param, 'class="right"', $sortfield, $sortorder); + print_liste_field_titre("Balance", $_SERVER["PHP_SELF"], "", $param, "", 'class="right"', $sortfield, $sortorder); print_liste_field_titre('', $_SERVER["PHP_SELF"], "", $param, "", 'width="60" align="center"', $sortfield, $sortorder); print "\n"; @@ -274,7 +274,7 @@ if ($action != 'export_csv') { // Affiche un Sous-Total par compte comptable if ($displayed_account != "") { - print '' . $langs->trans("SubTotal") . ':' . price($sous_total_debit) . '' . price($sous_total_credit) . '' . price(price2num($sous_total_credit - $sous_total_debit)) . ''; + print '' . $langs->trans("SubTotal") . ':' . price($sous_total_debit) . '' . price($sous_total_credit) . '' . price(price2num($sous_total_credit - $sous_total_debit)) . ''; print " \n"; print ''; } @@ -305,11 +305,11 @@ if ($action != 'export_csv') $sous_total_credit += $line->credit; } - print '' . $langs->trans("SubTotal") . ':' . price($sous_total_debit) . '' . price($sous_total_credit) . '' . price(price2num($sous_total_credit - $sous_total_debit)) . ''; + print '' . $langs->trans("SubTotal") . ':' . price($sous_total_debit) . '' . price($sous_total_credit) . '' . price(price2num($sous_total_credit - $sous_total_debit)) . ''; print " \n"; print ''; - print '' . $langs->trans("AccountBalance") . ':' . price($total_debit) . '' . price($total_credit) . '' . price(price2num($total_credit - $total_debit)) . ''; + print '' . $langs->trans("AccountBalance") . ':' . price($total_debit) . '' . price($total_credit) . '' . price(price2num($total_credit - $total_debit)) . ''; print " \n"; print ''; diff --git a/htdocs/accountancy/bookkeeping/balancebymonth.php b/htdocs/accountancy/bookkeeping/balancebymonth.php index a01c42b285a..c2e34270438 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 * @@ -117,19 +117,19 @@ if ($resql) { $row = $db->fetch_row($resql); print '' . length_accountg($row[0]) . ''; - print '' . price($row[1]) . ''; - print '' . price($row[2]) . ''; - print '' . price($row[3]) . ''; - print '' . price($row[4]) . ''; - print '' . price($row[5]) . ''; - print '' . price($row[6]) . ''; - print '' . price($row[7]) . ''; - print '' . price($row[8]) . ''; - print '' . price($row[9]) . ''; - print '' . price($row[10]) . ''; - print '' . price($row[11]) . ''; - print '' . price($row[12]) . ''; - print '' . price($row[13]) . ''; + print '' . price($row[1]) . ''; + print '' . price($row[2]) . ''; + print '' . price($row[3]) . ''; + print '' . price($row[4]) . ''; + print '' . price($row[5]) . ''; + print '' . price($row[6]) . ''; + print '' . price($row[7]) . ''; + print '' . price($row[8]) . ''; + print '' . price($row[9]) . ''; + print '' . price($row[10]) . ''; + print '' . price($row[11]) . ''; + print '' . price($row[12]) . ''; + print '' . price($row[13]) . ''; print ''; $i ++; diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index 4cc03f7a529..105c87409c1 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 509dcd88abe..41939ffd0ce 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 c2991ce2598..34481d7680d 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 19e0dcbaaac..7ca432bbbc1 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 27d04962e1b..f9489040c36 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 6f9c0534d2f..d61932884dc 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 38f4e49f2a6..681073332d7 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 94cfbf3bd66..2a2d050af7b 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 047628a7b96..2aaf918b197 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 1130020b01d..83a018a24cc 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 @@ -314,4 +314,3 @@ class Lettering extends BookKeeping } } } - 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 36f840315aa..9c9d0db38a4 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 4a4cfa928ac..0a4065762aa 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 f34456a95b9..81b1f81416a 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 c6fa1202171..12182bdaa43 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 078a91bc96e..c0d77fc753a 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 cb58737b6f5..34a8d219b90 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 2ff45e51bd5..54024fe6471 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 09bc9a18e9a..9526bc763ec 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 d63f8ee52fa..fcc6bbecd81 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 585c8400680..cf5d36d6e80 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 1a315897f02..e04be12df3b 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/admin/website.php b/htdocs/adherents/admin/website.php index cad250a60d0..02364a3a1d8 100644 --- a/htdocs/adherents/admin/website.php +++ b/htdocs/adherents/admin/website.php @@ -136,7 +136,7 @@ if ($conf->use_javascript_ajax) } -print $langs->trans("BlankSubscriptionFormDesc").'

'; +print ''.$langs->trans("BlankSubscriptionFormDesc").'

'; $enabledisablehtml = $langs->trans("EnablePublicSubscriptionForm").' '; diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 2f2c5f9dde8..7a6898da9d3 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 d12d4b31aa2..959dacba2c1 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 8a8186fcd2b..d27c2365f47 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 86c31e6cd04..0c5618ca1d9 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 b5407646359..499f41dce3e 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 92d80464088..7b24260cd8d 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/agenda_other.php b/htdocs/admin/agenda_other.php index f16226c812b..639671b4647 100644 --- a/htdocs/admin/agenda_other.php +++ b/htdocs/admin/agenda_other.php @@ -35,7 +35,7 @@ if (!$user->admin) accessforbidden(); // Load translation files required by the page -$langs->loadLangs(array('admin', 'other', 'agenda')); +$langs->loadLangs(array('admin', 'other', 'agenda', 'users')); $action = GETPOST('action','alpha'); $value = GETPOST('value','alpha'); @@ -353,7 +353,8 @@ print ''."\n"; // AGENDA_DEFAULT_VIEW print ''."\n"; -print ''.$langs->trans("AGENDA_DEFAULT_VIEW").''."\n"; +$htmltext=$langs->trans("ThisValueCanOverwrittenOnUserLevel", $langs->transnoentitiesnoconv("UserGUISetup")); +print ''.$form->textwithpicto($langs->trans("AGENDA_DEFAULT_VIEW"), $htmltext).''."\n"; print ' '."\n"; print ''."\n"; $tmplist=array(''=>' ', 'show_list'=>$langs->trans("ViewList"), 'show_month'=>$langs->trans("ViewCal"), 'show_week'=>$langs->trans("ViewWeek"), 'show_day'=>$langs->trans("ViewDay"), 'show_peruser'=>$langs->trans("ViewPerUser")); diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index 41786c2c55b..c0599a666dc 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 c57a511b3c9..8a52a4346f8 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 * @@ -1990,4 +1990,3 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') return $withentity; } - diff --git a/htdocs/admin/ldap_contacts.php b/htdocs/admin/ldap_contacts.php index cb4972e84b3..56866fdaea7 100644 --- a/htdocs/admin/ldap_contacts.php +++ b/htdocs/admin/ldap_contacts.php @@ -321,4 +321,3 @@ if (function_exists("ldap_connect")) // End of page llxFooter(); $db->close(); - diff --git a/htdocs/admin/livraison.php b/htdocs/admin/livraison.php index a7c38a95e1f..e49ef792700 100644 --- a/htdocs/admin/livraison.php +++ b/htdocs/admin/livraison.php @@ -481,4 +481,3 @@ print ''; // End of page llxFooter(); $db->close(); - diff --git a/htdocs/admin/loan.php b/htdocs/admin/loan.php index 419f6efbee9..20e0b59199a 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 35f5e5d6e72..ab79bfec0fa 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 @@ -1065,4 +1065,3 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') } } } - diff --git a/htdocs/admin/openinghours.php b/htdocs/admin/openinghours.php index 19225273bfc..da5aed70c81 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 f724bd9e50c..057c2cfa3db 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 a4446f1f8fb..b6214232971 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/supplier_proposal.php b/htdocs/admin/supplier_proposal.php index 7c18a1b8e19..430bd3b8436 100644 --- a/htdocs/admin/supplier_proposal.php +++ b/htdocs/admin/supplier_proposal.php @@ -585,4 +585,3 @@ print "\n
"; // End of page llxFooter(); $db->close(); - diff --git a/htdocs/admin/taxes.php b/htdocs/admin/taxes.php index 76e7496cc4e..b3fd9ef4359 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/admin/tools/export.php b/htdocs/admin/tools/export.php index 6b0ea790ab2..9f3caf91881 100644 --- a/htdocs/admin/tools/export.php +++ b/htdocs/admin/tools/export.php @@ -234,4 +234,3 @@ header("Location: dolibarr_export.php"); $time_end = time(); $db->close(); - diff --git a/htdocs/admin/tools/export_files.php b/htdocs/admin/tools/export_files.php index 809cea3b271..0aae9083565 100644 --- a/htdocs/admin/tools/export_files.php +++ b/htdocs/admin/tools/export_files.php @@ -163,4 +163,3 @@ header("Location: dolibarr_export.php"); $time_end = time(); $db->close(); - diff --git a/htdocs/admin/website.php b/htdocs/admin/website.php index e4cc568ea03..3f52896b631 100644 --- a/htdocs/admin/website.php +++ b/htdocs/admin/website.php @@ -695,4 +695,3 @@ function fieldListWebsites($fieldlist, $obj = '', $tabname = '', $context = '') } } } - diff --git a/htdocs/admin/website_options.php b/htdocs/admin/website_options.php index 9d724b86390..48c2bdcdd08 100644 --- a/htdocs/admin/website_options.php +++ b/htdocs/admin/website_options.php @@ -147,4 +147,3 @@ dol_fiche_end(); // End of page llxFooter(); $db->close(); - diff --git a/htdocs/api/admin/explorer.php b/htdocs/api/admin/explorer.php index c3b54e36b6c..951e88f63fc 100644 --- a/htdocs/api/admin/explorer.php +++ b/htdocs/api/admin/explorer.php @@ -221,4 +221,3 @@ print $langs->trans("OnlyActiveElementsAreExposed", DOL_URL_ROOT.'/admin/modules llxFooter(); $db->close(); - diff --git a/htdocs/asset/admin/assets_extrafields.php b/htdocs/asset/admin/assets_extrafields.php index f220d5cb849..2735981b564 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 a791078f37b..7038f6df5a0 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 57738309abd..236315b52d8 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 d8b8f3aa056..e24e6a96c83 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 93f2e88f725..aafdbacc791 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 54421b8910f..29851185391 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 c1332ed10a2..6433b30a543 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 e01316ae685..3c6260ffde7 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 fa1ef9f2760..c6710f290cc 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 f76c6ea028f..7e74ec0a805 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 861bbd2130e..31c328d9326 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/ajax/authority.php b/htdocs/blockedlog/ajax/authority.php index 1104eeb3c02..1b002dda574 100644 --- a/htdocs/blockedlog/ajax/authority.php +++ b/htdocs/blockedlog/ajax/authority.php @@ -69,5 +69,3 @@ elseif(!empty($newblock)){ else{ echo 'idontunderstandwhatihavetodo'; } - - diff --git a/htdocs/blockedlog/class/blockedlog.class.php b/htdocs/blockedlog/class/blockedlog.class.php index 2b4198eb08e..0d24b71b343 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/bookmarks/bookmarks.lib.php b/htdocs/bookmarks/bookmarks.lib.php index abe562c5ad9..5dd55a95873 100644 --- a/htdocs/bookmarks/bookmarks.lib.php +++ b/htdocs/bookmarks/bookmarks.lib.php @@ -150,4 +150,3 @@ function printBookmarksList($aDb, $aLangs) return $ret; } - diff --git a/htdocs/bookmarks/list.php b/htdocs/bookmarks/list.php index e26b38c2513..5cbd07393e3 100644 --- a/htdocs/bookmarks/list.php +++ b/htdocs/bookmarks/list.php @@ -212,5 +212,3 @@ else // End of page llxFooter(); $db->close(); - - diff --git a/htdocs/cashdesk/class/Auth.class.php b/htdocs/cashdesk/class/Auth.class.php index 78b76e20d11..343204e7870 100644 --- a/htdocs/cashdesk/class/Auth.class.php +++ b/htdocs/cashdesk/class/Auth.class.php @@ -139,4 +139,3 @@ class Auth return $ret; } } - diff --git a/htdocs/cashdesk/deconnexion.php b/htdocs/cashdesk/deconnexion.php index 0602b577378..67fc4e9cbb6 100644 --- a/htdocs/cashdesk/deconnexion.php +++ b/htdocs/cashdesk/deconnexion.php @@ -34,4 +34,3 @@ unset($_SESSION['uid']); header('Location: '.DOL_URL_ROOT.'/cashdesk/index.php'); exit; - diff --git a/htdocs/cashdesk/facturation_verif.php b/htdocs/cashdesk/facturation_verif.php index 960ddddb18a..a643a9197e2 100644 --- a/htdocs/cashdesk/facturation_verif.php +++ b/htdocs/cashdesk/facturation_verif.php @@ -233,4 +233,3 @@ $_SESSION['serObjFacturation'] = serialize($obj_facturation); //var_dump($_SESSION['serObjFacturation']); header('Location: '.$redirection); exit; - diff --git a/htdocs/cashdesk/include/environnement.php b/htdocs/cashdesk/include/environnement.php index 4490d4cf405..6442d1776e3 100644 --- a/htdocs/cashdesk/include/environnement.php +++ b/htdocs/cashdesk/include/environnement.php @@ -49,4 +49,3 @@ $conf_nbr_car_listes = 60; // Nombre max de caracteres par ligne dans les listes // Add hidden option to force decrease of stock whatever is user setup if (! empty($conf->global->CASHDESK_FORCE_STOCK_ON_BILL)) $conf->global->STOCK_CALCULATE_ON_BILL=1; - diff --git a/htdocs/cashdesk/index_verif.php b/htdocs/cashdesk/index_verif.php index cd354293022..8976434b559 100644 --- a/htdocs/cashdesk/index_verif.php +++ b/htdocs/cashdesk/index_verif.php @@ -140,4 +140,3 @@ else header('Location: '.DOL_URL_ROOT.'/cashdesk/index.php?err='.urlencode($retour).'&user='.$username.'&socid='.$thirdpartyid.'&warehouseid='.$warehouseid); exit; } - diff --git a/htdocs/cashdesk/validation.php b/htdocs/cashdesk/validation.php index ff1219861e2..f52802f1f5d 100644 --- a/htdocs/cashdesk/validation.php +++ b/htdocs/cashdesk/validation.php @@ -25,4 +25,3 @@ $form=new Form($db); // Affichage des templates require 'tpl/validation1.tpl.php'; - diff --git a/htdocs/cashdesk/validation_ok.php b/htdocs/cashdesk/validation_ok.php index c8c83a91f18..78b66a3e502 100644 --- a/htdocs/cashdesk/validation_ok.php +++ b/htdocs/cashdesk/validation_ok.php @@ -23,4 +23,3 @@ // Affichage des templates require 'tpl/validation2.tpl.php'; - diff --git a/htdocs/cashdesk/validation_ticket.php b/htdocs/cashdesk/validation_ticket.php index a98b50b0bc9..9efad161821 100644 --- a/htdocs/cashdesk/validation_ticket.php +++ b/htdocs/cashdesk/validation_ticket.php @@ -40,4 +40,3 @@ if (empty($reshook)) $_SESSION['serObjFacturation'] = serialize($obj_facturation); - diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 0c2bbb2e10f..053d6809c40 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 916143b896a..cc5a0e6e29a 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/commande/class/commandestats.class.php b/htdocs/commande/class/commandestats.class.php index edd072854d3..0300eb51df0 100644 --- a/htdocs/commande/class/commandestats.class.php +++ b/htdocs/commande/class/commandestats.class.php @@ -223,4 +223,3 @@ class CommandeStats extends Stats return $this->_getAllByProduct($sql); } } - diff --git a/htdocs/commande/customer.php b/htdocs/commande/customer.php index 575c7985e3a..0b420eabac6 100644 --- a/htdocs/commande/customer.php +++ b/htdocs/commande/customer.php @@ -193,4 +193,3 @@ else // End of page llxFooter(); $db->close(); - diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index a3928cbc0ca..67e6deace4c 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 b63136c8581..d20802dabbd 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 9e94d262c18..7c72ad8c362 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 cb8f21ecc5a..e126937e95c 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 d359a5c814f..f73073f2fe1 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 d2adc857ec7..d9fa5c3c9a1 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 c255ef19c16..6b864c09f81 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 d9f8709b155..34be85c6975 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 91608666601..c6e5d95e3db 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 01c5aed49e7..85ef39a6c97 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 66dc955aee7..9fe05e57bd9 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/deplacement/class/deplacementstats.class.php b/htdocs/compta/deplacement/class/deplacementstats.class.php index e7277b0ca58..af704c1ad56 100644 --- a/htdocs/compta/deplacement/class/deplacementstats.class.php +++ b/htdocs/compta/deplacement/class/deplacementstats.class.php @@ -166,4 +166,3 @@ class DeplacementStats extends Stats return $this->_getAllByYear($sql); } } - diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 14d01419037..9ed5e234882 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/class/facturestats.class.php b/htdocs/compta/facture/class/facturestats.class.php index ea065d81636..a6a6fd07e84 100644 --- a/htdocs/compta/facture/class/facturestats.class.php +++ b/htdocs/compta/facture/class/facturestats.class.php @@ -225,4 +225,3 @@ class FactureStats extends Stats return $this->_getAllByProduct($sql); } } - diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php index 7cc63b10e72..c0dd351f009 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 1b70c50c8f4..a025829f274 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 2ab17905715..e979e297dd7 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 42b2c8a95af..5aec70b1dec 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 e186dfce4cd..f710ff2615e 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 d84b26f78b2..ab074e58541 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 12669947cff..9234ca1e68d 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/prelevement/stats.php b/htdocs/compta/prelevement/stats.php index e7bd8622fa2..ea4d91d6022 100644 --- a/htdocs/compta/prelevement/stats.php +++ b/htdocs/compta/prelevement/stats.php @@ -228,4 +228,3 @@ else // End of page llxFooter(); $db->close(); - diff --git a/htdocs/compta/resultat/result.php b/htdocs/compta/resultat/result.php index 16d2631686c..85f38cb9905 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 474fcd0a6cb..91c0e169b5d 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 8f55b5804cc..21423f85e87 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 1a96fbc56aa..c34d7713901 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 @@ -164,4 +164,3 @@ class SalariesStats extends Stats return $this->_getAllByYear($sql); } } - diff --git a/htdocs/compta/salaries/document.php b/htdocs/compta/salaries/document.php index 33e92ecaf3b..0ce0fb66e52 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 87d24ceb406..c7a180346fb 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 c7f5970723e..761d40a5227 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 6471f66cf57..5b1d5c1b973 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 6a0d53d6987..b31339a8d5f 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 1828e750914..fe6a3be96ee 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 @@ -303,13 +303,15 @@ class ChargeSociales extends CommonObject /** - * Met a jour une charge sociale + * Update social or fiscal contribution * - * @param User $user Utilisateur qui modifie - * @return int <0 si erreur, >0 si ok + * @param User $user User that modify + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int <0 if KO, >0 if OK */ - function update($user) + function update($user, $notrigger = 0) { + $error=0; $this->db->begin(); $sql = "UPDATE ".MAIN_DB_PREFIX."chargesociales"; @@ -323,16 +325,37 @@ class ChargeSociales extends CommonObject dol_syslog(get_class($this)."::update", LOG_DEBUG); $resql=$this->db->query($sql); - if ($resql) + + if (! $resql) { + $error++; $this->errors[]="Error ".$this->db->lasterror(); + } + + if (! $error) { - $this->db->commit(); - return 1; + if (! $notrigger) + { + // Call trigger + $result=$this->call_trigger('SOCIALCHARGES_MODIFY',$user); + if ($result < 0) $error++; + // End call triggers + } + } + + // Commit or rollback + if ($error) + { + foreach($this->errors as $errmsg) + { + dol_syslog(get_class($this)."::update ".$errmsg, LOG_ERR); + $this->error.=($this->error?', '.$errmsg:$errmsg); + } + $this->db->rollback(); + return -1*$error; } else { - $this->error=$this->db->error(); - $this->db->rollback(); - return -1; + $this->db->commit(); + return 1; } } diff --git a/htdocs/compta/sociales/payments.php b/htdocs/compta/sociales/payments.php index efdd39d2205..bb194f8cb3e 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 d5779266661..985c0b834a5 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 5da7b0e144c..fba25b0e752 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 4a2308bd0bd..feea451f1db 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 0d3b7ec135d..d54a99acc76 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 fbd3e46b9a7..3df7945a08e 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 9371f1e3200..6b6bc9f69da 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 4dbd78f5085..bd7819ee299 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 d118c4de3b9..3dbf5f660a7 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 087db5ddea6..8ca5ce040ac 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_builddoc.inc.php b/htdocs/core/actions_builddoc.inc.php index d585ace7cd2..30576329d1c 100644 --- a/htdocs/core/actions_builddoc.inc.php +++ b/htdocs/core/actions_builddoc.inc.php @@ -133,4 +133,3 @@ if ($action == 'remove_file' && $permissioncreate) header('Location: '.$urltoredirect); exit; } - diff --git a/htdocs/core/actions_changeselectedfields.inc.php b/htdocs/core/actions_changeselectedfields.inc.php index 6d39272f74e..4cfc29209b1 100644 --- a/htdocs/core/actions_changeselectedfields.inc.php +++ b/htdocs/core/actions_changeselectedfields.inc.php @@ -44,5 +44,3 @@ if (GETPOST('formfilteraction') == 'listafterchangingselectedfields') //$action='list'; //var_dump($tabparam);exit; } - - diff --git a/htdocs/core/actions_dellink.inc.php b/htdocs/core/actions_dellink.inc.php index 7d20f124277..d2b8019a5e0 100644 --- a/htdocs/core/actions_dellink.inc.php +++ b/htdocs/core/actions_dellink.inc.php @@ -43,4 +43,3 @@ if ($action == 'dellink' && ! empty($permissiondellink) && ! GETPOST('cancel','a $result=$object->deleteObjectLinked(0, '', 0, '', $dellinkid); if ($result < 0) setEventMessages($object->error,$object->errors,'errors'); } - diff --git a/htdocs/core/actions_extrafields.inc.php b/htdocs/core/actions_extrafields.inc.php index bae5001b256..a50fadec1af 100644 --- a/htdocs/core/actions_extrafields.inc.php +++ b/htdocs/core/actions_extrafields.inc.php @@ -402,4 +402,3 @@ if ($action == 'delete') $mesg=$langs->trans("ErrorFieldCanNotContainSpecialCharacters",$langs->transnoentities("AttributeCode")); } } - diff --git a/htdocs/core/actions_lineupdown.inc.php b/htdocs/core/actions_lineupdown.inc.php index bcf251e0763..8b5e3e3a24c 100644 --- a/htdocs/core/actions_lineupdown.inc.php +++ b/htdocs/core/actions_lineupdown.inc.php @@ -70,4 +70,3 @@ if ($action == 'down' && $permissiontoedit) header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '#' . GETPOST('rowid')); exit(); } - diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index ba94300ae22..36e6c4956bf 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,1055 +46,1054 @@ 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'; + $resaction = ''; + $nbsent = 0; + $nbignored = 0; + $langs->load("mails"); + include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - $listofobjectid=array(); - $listofobjectthirdparties=array(); - $listofobjectref=array(); + $listofobjectid=array(); + $listofobjectthirdparties=array(); + $listofobjectref=array(); - if (! $error) - { - $thirdparty=new Societe($db); + 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); + $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; + 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; + $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; - } - } - } + $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'; - } + // 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'; - } + $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'; - } + 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; - } + // 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(); + $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 $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); + // 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(); + //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 - } + 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; - } - } + // 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 (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 ($_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; - } - } + 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; + // Object of thirdparty qualified, we add it + $listofqualifiedobj[$objectid]=$objectobj; + $listofqualifiedref[$objectid]=$objectobj->ref; - //var_dump($listofqualifiedref); - } + //var_dump($listofqualifiedref); + } - // Send email if there is at least one qualified object for current thirdparty - if (count($listofqualifiedobj) > 0) - { - $langs->load("commercial"); + // 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'] .'>'; - } + $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'); + $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)); + $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; + // $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__'] = ''; + 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'); + $parameters=array('mode'=>'formemail'); - if ( ! empty( $listofobjectthirdparties ) ) { - $parameters['listofobjectthirdparties'] = $listofobjectthirdparties; - } - if ( ! empty( $listofobjectref ) ) { - $parameters['listofobjectref'] = $listofobjectref; - } + if ( ! empty( $listofobjectthirdparties ) ) { + $parameters['listofobjectthirdparties'] = $listofobjectthirdparties; + } + if ( ! empty( $listofobjectref ) ) { + $parameters['listofobjectref'] = $listofobjectref; + } - complete_substitutions_array($substitutionarray, $langs, $objecttmp, $parameters); + complete_substitutions_array($substitutionarray, $langs, $objecttmp, $parameters); - $subject=make_substitutions($subject, $substitutionarray); - $message=make_substitutions($message, $substitutionarray); + $subject=make_substitutions($subject, $substitutionarray); + $message=make_substitutions($message, $substitutionarray); - $filepath = $attachedfiles['paths']; - $filename = $attachedfiles['names']; - $mimetype = $attachedfiles['mimes']; + $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'; + // 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; + $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 " + // 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; + $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 + // 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)); + 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';*/ + /*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=''; + $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; + // 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'; + $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 (! 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); - } - } - } + 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
'; - } - } - } - } - } - } + $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
"; + $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'); - } + 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=''; - } + $action='list'; + $massaction=''; + } } -if ($massaction == 'confirm_createbills') +if ($massaction == 'confirm_createbills') // Create bills from orders { - $orders = GETPOST('toselect','array'); - $createbills_onebythird = GETPOST('createbills_onebythird', 'int'); - $validate_invoices = GETPOST('valdate_invoices', 'int'); + $orders = GETPOST('toselect','array'); + $createbills_onebythird = GETPOST('createbills_onebythird', 'int'); + $validate_invoices = GETPOST('valdate_invoices', 'int'); - $TFact = array(); - $TFactThird = array(); + $TFact = array(); + $TFactThird = array(); - $nb_bills_created = 0; + $nb_bills_created = 0; - $db->begin(); + $db->begin(); - foreach($orders as $id_order) - { - $cmd = new Commande($db); - if ($cmd->fetch($id_order) <= 0) continue; + 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 = 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; + $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")); - } + $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->date = $datefacture; + $objecttmp->origin = 'commande'; + $objecttmp->origin_id = $id_order; - $objecttmp->array_options = $cmd->array_options; // Copy extrafields + $objecttmp->array_options = $cmd->array_options; // Copy extrafields - $res = $objecttmp->create($user); + $res = $objecttmp->create($user); - if($res > 0) $nb_bills_created++; - } + 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 ($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 (! $db->query($sql)) + { + $error++; + } - if (! $error) - { - $lines = $cmd->lines; - if (empty($lines) && method_exists($cmd, 'fetch_lines')) - { - $cmd->fetch_lines(); - $lines = $cmd->lines; - } + 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); + $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; - } + 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; - } + // 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; - } - } - } - } - } + $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. + //$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; - } + 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(); + // Build doc with all invoices + $TAllFact = empty($createbills_onebythird) ? $TFact : $TFactThird; + $toselect = array(); - if (! $error && $validate_invoices) - { - $massaction = $action = 'builddoc'; + 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; - } + 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; + $id = $objecttmp->id; // For builddoc action + $object = $objecttmp; - // Builddoc - $donotredirect = 1; - $upload_dir = $conf->facture->dir_output; - $permissioncreate=$user->rights->facture->creer; + // 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; - } + // Call action to build doc + $savobject = $object; + $object = $objecttmp; + include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; + $object = $savobject; + } - $massaction = $action = 'confirm_createbills'; - } + $massaction = $action = 'confirm_createbills'; + } - if (! $error) - { - $db->commit(); - setEventMessages($langs->trans('BillCreated', $nb_bills_created), null, 'mesgs'); + 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); + // 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++; - } + 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(); - $db->begin(); - - $nbok = 0; + $nbok = 0; - $orders = GETPOST('toselect', 'array'); - foreach ($orders as $id_order) - { + $orders = GETPOST('toselect', 'array'); + foreach ($orders as $id_order) + { - $cmd = new Commande($db); - if ($cmd->fetch($id_order) <= 0) - continue; + $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 ($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 ($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; - } + 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'; + 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; - } - } + $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); + $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; - } - } - } + // 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); - } + // 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); + 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); + // 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; + // 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'; + 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); - } + $input_files = ''; + foreach($files as $f) { + $input_files.=' '.escapeshellarg($f); + } - $cmd = 'pdftk '.escapeshellarg($input_files).' cat output '.escapeshellarg($file); - exec($cmd); + $cmd = 'pdftk '.escapeshellarg($input_files).' cat output '.escapeshellarg($file); + exec($cmd); - if (! empty($conf->global->MAIN_UMASK)) - @chmod($file, octdec($conf->global->MAIN_UMASK)); + 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); + $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); + $pdf=pdf_getInstance($format); - if (class_exists('TCPDF')) - { - $pdf->setPrintHeader(false); - $pdf->setPrintFooter(false); - } - $pdf->SetFont(pdf_getPDFFont($outputlangs)); + 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); + 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); - } - } + // 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); + // 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); + // 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)); + // 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'); - } - } + $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'; + 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=''; + $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); + $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(); + 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; - } - } + $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; - } + 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) { @@ -1123,9 +1122,9 @@ if (!$error && $massaction == 'closed' && $objectclass == "Propal" && $permtoclo 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(); @@ -1134,127 +1133,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(); + $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; - } + $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 ($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 (!$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 (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 ($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; + 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(); + $db->begin(); - $objecttmp=new $objectclass($db); - $nbok = 0; - foreach($toselect as $toselectid) - { - $result=$objecttmp->fetch($toselectid); - if ($result > 0) - { - $outputlangs = $langs; - $newlang=''; + $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); - } + 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; + // 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); + $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 ($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(); - } + 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; @@ -1262,6 +1261,3 @@ $parameters['uploaddir']=$uploaddir; $reshook=$hookmanager->executeHooks('doMassActions',$parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); - - - diff --git a/htdocs/core/actions_setmoduleoptions.inc.php b/htdocs/core/actions_setmoduleoptions.inc.php index 03ff1491e49..fec4ef08c11 100644 --- a/htdocs/core/actions_setmoduleoptions.inc.php +++ b/htdocs/core/actions_setmoduleoptions.inc.php @@ -114,4 +114,3 @@ if ($action == 'setModuleOptions') if (empty($nomessageinsetmoduleoptions)) setEventMessages($langs->trans("SetupNotSaved"), null, 'errors'); } } - diff --git a/htdocs/core/ajax/ajaxdirtree.php b/htdocs/core/ajax/ajaxdirtree.php index 1e4dde7e0a4..422cf455704 100644 --- a/htdocs/core/ajax/ajaxdirtree.php +++ b/htdocs/core/ajax/ajaxdirtree.php @@ -491,4 +491,3 @@ function treeOutputForAbsoluteDir($sqltree, $selecteddir, $fullpathselecteddir, else print "PermissionDenied"; } } - diff --git a/htdocs/core/ajax/bankconciliate.php b/htdocs/core/ajax/bankconciliate.php index e5bfb674e8f..47e86864d89 100644 --- a/htdocs/core/ajax/bankconciliate.php +++ b/htdocs/core/ajax/bankconciliate.php @@ -94,4 +94,3 @@ if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $ exit; } - diff --git a/htdocs/core/ajax/box.php b/htdocs/core/ajax/box.php index 93b317a43c9..664af93822b 100644 --- a/htdocs/core/ajax/box.php +++ b/htdocs/core/ajax/box.php @@ -77,4 +77,3 @@ if ($boxorder && $zone != '' && $userid > 0) } } } - diff --git a/htdocs/core/ajax/check_notifications.php b/htdocs/core/ajax/check_notifications.php index a5c73655bab..35d465ae632 100644 --- a/htdocs/core/ajax/check_notifications.php +++ b/htdocs/core/ajax/check_notifications.php @@ -116,4 +116,3 @@ if ($time >= $_SESSION['auto_check_events_not_before']) } print json_encode($eventfound); - diff --git a/htdocs/core/ajax/constantonoff.php b/htdocs/core/ajax/constantonoff.php index 4977b526cc2..4a7d9fc5bd1 100644 --- a/htdocs/core/ajax/constantonoff.php +++ b/htdocs/core/ajax/constantonoff.php @@ -64,4 +64,3 @@ if (! empty($action) && ! empty($name)) } } } - diff --git a/htdocs/core/ajax/contacts.php b/htdocs/core/ajax/contacts.php index 777fa076639..b1c9d7a82fa 100644 --- a/htdocs/core/ajax/contacts.php +++ b/htdocs/core/ajax/contacts.php @@ -54,4 +54,3 @@ if (! empty($id) && ! empty($action) && ! empty($htmlname)) echo json_encode($return); } - diff --git a/htdocs/core/ajax/extraparams.php b/htdocs/core/ajax/extraparams.php index 5d06bb338ef..0dd7f3ff016 100644 --- a/htdocs/core/ajax/extraparams.php +++ b/htdocs/core/ajax/extraparams.php @@ -74,4 +74,3 @@ if(! empty($id) && ! empty($element) && ! empty($htmlelement) && ! empty($type)) $result=$object->setExtraParameters(); } - diff --git a/htdocs/core/ajax/fileupload.php b/htdocs/core/ajax/fileupload.php index 1cf5678cb00..dd7fcd88131 100644 --- a/htdocs/core/ajax/fileupload.php +++ b/htdocs/core/ajax/fileupload.php @@ -73,4 +73,3 @@ switch ($_SERVER['REQUEST_METHOD']) { } $db->close(); - diff --git a/htdocs/core/ajax/getaccountcurrency.php b/htdocs/core/ajax/getaccountcurrency.php index d58c81efdba..46244f8ec7a 100644 --- a/htdocs/core/ajax/getaccountcurrency.php +++ b/htdocs/core/ajax/getaccountcurrency.php @@ -54,4 +54,3 @@ if (! empty($id)) echo json_encode($return); } - diff --git a/htdocs/core/ajax/loadinplace.php b/htdocs/core/ajax/loadinplace.php index 918d1920759..5123d5e6202 100644 --- a/htdocs/core/ajax/loadinplace.php +++ b/htdocs/core/ajax/loadinplace.php @@ -112,4 +112,3 @@ if (! empty($field) && ! empty($element) && ! empty($table_element) && ! empty($ echo $langs->transnoentities('NotEnoughPermissions'); } } - diff --git a/htdocs/core/ajax/price.php b/htdocs/core/ajax/price.php index 3b5585837d6..614bad5e161 100644 --- a/htdocs/core/ajax/price.php +++ b/htdocs/core/ajax/price.php @@ -63,4 +63,3 @@ if (! empty($output) && isset($amount) && isset($tva_tx)) echo json_encode($return); } - diff --git a/htdocs/core/ajax/row.php b/htdocs/core/ajax/row.php index 5348f36976d..11c1d614304 100644 --- a/htdocs/core/ajax/row.php +++ b/htdocs/core/ajax/row.php @@ -73,4 +73,3 @@ if ((! empty($_POST['roworder'])) && (! empty($_POST['table_element_line'])) $result=$row->line_order(true); } } - diff --git a/htdocs/core/ajax/saveinplace.php b/htdocs/core/ajax/saveinplace.php index 8715997d778..a3546f8f782 100644 --- a/htdocs/core/ajax/saveinplace.php +++ b/htdocs/core/ajax/saveinplace.php @@ -229,4 +229,3 @@ if (! empty($field) && ! empty($element) && ! empty($table_element) && ! empty($ echo $langs->trans('NotEnoughPermissions'); } } - diff --git a/htdocs/core/ajax/security.php b/htdocs/core/ajax/security.php index d6bfe51b45c..0ed7545b4cf 100644 --- a/htdocs/core/ajax/security.php +++ b/htdocs/core/ajax/security.php @@ -49,4 +49,3 @@ if (isset($_GET['action']) && ! empty($_GET['action'])) echo getRandomPassword($generic); } } - diff --git a/htdocs/core/ajax/selectsearchbox.php b/htdocs/core/ajax/selectsearchbox.php index 8d6c4fe0c31..c8ca10b21b4 100644 --- a/htdocs/core/ajax/selectsearchbox.php +++ b/htdocs/core/ajax/selectsearchbox.php @@ -170,4 +170,3 @@ if (! isset($usedbyinclude) || empty($usedbyinclude)) print json_encode($arrayresult); if (is_object($db)) $db->close(); } - diff --git a/htdocs/core/ajax/vatrates.php b/htdocs/core/ajax/vatrates.php index 8fe38d02552..29070c57985 100644 --- a/htdocs/core/ajax/vatrates.php +++ b/htdocs/core/ajax/vatrates.php @@ -67,4 +67,3 @@ if (! empty($id) && ! empty($action) && ! empty($htmlname)) echo json_encode($return); } - diff --git a/htdocs/core/ajax/ziptown.php b/htdocs/core/ajax/ziptown.php index c1af6a2ac22..a7d40a69aba 100644 --- a/htdocs/core/ajax/ziptown.php +++ b/htdocs/core/ajax/ziptown.php @@ -135,4 +135,3 @@ else } $db->close(); - diff --git a/htdocs/core/antispamimage.php b/htdocs/core/antispamimage.php index 7f0f2bde12f..9d0f8e46ad2 100644 --- a/htdocs/core/antispamimage.php +++ b/htdocs/core/antispamimage.php @@ -65,4 +65,3 @@ $background_color = imagecolorallocate($img, 250, 250, 250); $ecriture_color = imagecolorallocate($img, 0, 0, 0); imagestring($img, 4, 24, 8, $string, $ecriture_color); imagepng($img); - diff --git a/htdocs/core/boxes/box_actions.php b/htdocs/core/boxes/box_actions.php index 55804430113..0c2e6651848 100644 --- a/htdocs/core/boxes/box_actions.php +++ b/htdocs/core/boxes/box_actions.php @@ -260,4 +260,3 @@ class box_actions extends ModeleBoxes return ''; } } - diff --git a/htdocs/core/boxes/box_bookmarks.php b/htdocs/core/boxes/box_bookmarks.php index ec091956701..7213019754c 100644 --- a/htdocs/core/boxes/box_bookmarks.php +++ b/htdocs/core/boxes/box_bookmarks.php @@ -162,4 +162,3 @@ class box_bookmarks extends ModeleBoxes return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } } - diff --git a/htdocs/core/boxes/box_clients.php b/htdocs/core/boxes/box_clients.php index c4e34a72e9b..1fb09668799 100644 --- a/htdocs/core/boxes/box_clients.php +++ b/htdocs/core/boxes/box_clients.php @@ -178,4 +178,3 @@ class box_clients extends ModeleBoxes return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } } - diff --git a/htdocs/core/boxes/box_commandes.php b/htdocs/core/boxes/box_commandes.php index 795bf36bd0b..26f15f9cf13 100644 --- a/htdocs/core/boxes/box_commandes.php +++ b/htdocs/core/boxes/box_commandes.php @@ -203,4 +203,3 @@ class box_commandes extends ModeleBoxes return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } } - diff --git a/htdocs/core/boxes/box_comptes.php b/htdocs/core/boxes/box_comptes.php index 0f0d0f83fed..a5566fad1db 100644 --- a/htdocs/core/boxes/box_comptes.php +++ b/htdocs/core/boxes/box_comptes.php @@ -189,4 +189,3 @@ class box_comptes extends ModeleBoxes return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } } - diff --git a/htdocs/core/boxes/box_contacts.php b/htdocs/core/boxes/box_contacts.php index 2654607e2eb..9ba8fc02cf9 100644 --- a/htdocs/core/boxes/box_contacts.php +++ b/htdocs/core/boxes/box_contacts.php @@ -190,4 +190,3 @@ class box_contacts extends ModeleBoxes return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } } - diff --git a/htdocs/core/boxes/box_contracts.php b/htdocs/core/boxes/box_contracts.php index bd499855cc4..8f0161fee9c 100644 --- a/htdocs/core/boxes/box_contracts.php +++ b/htdocs/core/boxes/box_contracts.php @@ -194,4 +194,3 @@ class box_contracts extends ModeleBoxes return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } } - diff --git a/htdocs/core/boxes/box_external_rss.php b/htdocs/core/boxes/box_external_rss.php index d7165198201..644eff9ae4c 100644 --- a/htdocs/core/boxes/box_external_rss.php +++ b/htdocs/core/boxes/box_external_rss.php @@ -200,4 +200,3 @@ class box_external_rss extends ModeleBoxes return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } } - diff --git a/htdocs/core/boxes/box_factures_fourn.php b/htdocs/core/boxes/box_factures_fourn.php index cc8cd3bd1da..611f71578b7 100644 --- a/htdocs/core/boxes/box_factures_fourn.php +++ b/htdocs/core/boxes/box_factures_fourn.php @@ -219,4 +219,3 @@ class box_factures_fourn extends ModeleBoxes return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } } - diff --git a/htdocs/core/boxes/box_factures_fourn_imp.php b/htdocs/core/boxes/box_factures_fourn_imp.php index 181994fc1e3..9957fb9cbf7 100644 --- a/htdocs/core/boxes/box_factures_fourn_imp.php +++ b/htdocs/core/boxes/box_factures_fourn_imp.php @@ -206,4 +206,3 @@ class box_factures_fourn_imp extends ModeleBoxes return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } } - diff --git a/htdocs/core/boxes/box_ficheinter.php b/htdocs/core/boxes/box_ficheinter.php index b4016bb3758..d76340023d3 100644 --- a/htdocs/core/boxes/box_ficheinter.php +++ b/htdocs/core/boxes/box_ficheinter.php @@ -171,4 +171,3 @@ class box_ficheinter extends ModeleBoxes return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } } - diff --git a/htdocs/core/boxes/box_fournisseurs.php b/htdocs/core/boxes/box_fournisseurs.php index aa04d312f54..a5e8ed77228 100644 --- a/htdocs/core/boxes/box_fournisseurs.php +++ b/htdocs/core/boxes/box_fournisseurs.php @@ -165,4 +165,3 @@ class box_fournisseurs extends ModeleBoxes return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } } - diff --git a/htdocs/core/boxes/box_goodcustomers.php b/htdocs/core/boxes/box_goodcustomers.php index 0cca908f5d8..adba592f516 100644 --- a/htdocs/core/boxes/box_goodcustomers.php +++ b/htdocs/core/boxes/box_goodcustomers.php @@ -174,4 +174,3 @@ class box_goodcustomers extends ModeleBoxes return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } } - diff --git a/htdocs/core/boxes/box_graph_invoices_permonth.php b/htdocs/core/boxes/box_graph_invoices_permonth.php index b288912915d..0bac498a1b6 100644 --- a/htdocs/core/boxes/box_graph_invoices_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_permonth.php @@ -280,4 +280,3 @@ class box_graph_invoices_permonth extends ModeleBoxes return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } } - diff --git a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php index be4b8722cf2..eb6b443c546 100644 --- a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php @@ -279,4 +279,3 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } } - diff --git a/htdocs/core/boxes/box_graph_orders_permonth.php b/htdocs/core/boxes/box_graph_orders_permonth.php index 390499bd359..8ca192c189f 100644 --- a/htdocs/core/boxes/box_graph_orders_permonth.php +++ b/htdocs/core/boxes/box_graph_orders_permonth.php @@ -278,4 +278,3 @@ class box_graph_orders_permonth extends ModeleBoxes return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } } - diff --git a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php index 098cbb4d038..7c59ecb6de1 100644 --- a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php +++ b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php @@ -277,4 +277,3 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } } - diff --git a/htdocs/core/boxes/box_graph_product_distribution.php b/htdocs/core/boxes/box_graph_product_distribution.php index 704a0922472..494f6cd98f9 100644 --- a/htdocs/core/boxes/box_graph_product_distribution.php +++ b/htdocs/core/boxes/box_graph_product_distribution.php @@ -417,4 +417,3 @@ class box_graph_product_distribution extends ModeleBoxes return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } } - diff --git a/htdocs/core/boxes/box_graph_propales_permonth.php b/htdocs/core/boxes/box_graph_propales_permonth.php index 4abd3a8725a..ddf95f8076e 100644 --- a/htdocs/core/boxes/box_graph_propales_permonth.php +++ b/htdocs/core/boxes/box_graph_propales_permonth.php @@ -281,4 +281,3 @@ class box_graph_propales_permonth extends ModeleBoxes return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } } - diff --git a/htdocs/core/boxes/box_members.php b/htdocs/core/boxes/box_members.php index 8ffa90de5a4..1d569302256 100644 --- a/htdocs/core/boxes/box_members.php +++ b/htdocs/core/boxes/box_members.php @@ -183,4 +183,3 @@ class box_members extends ModeleBoxes return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } } - diff --git a/htdocs/core/boxes/box_produits.php b/htdocs/core/boxes/box_produits.php index bb64e46ecc4..13b24352978 100644 --- a/htdocs/core/boxes/box_produits.php +++ b/htdocs/core/boxes/box_produits.php @@ -231,4 +231,3 @@ class box_produits extends ModeleBoxes return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } } - diff --git a/htdocs/core/boxes/box_produits_alerte_stock.php b/htdocs/core/boxes/box_produits_alerte_stock.php index b14cc2e659f..1b58320992c 100644 --- a/htdocs/core/boxes/box_produits_alerte_stock.php +++ b/htdocs/core/boxes/box_produits_alerte_stock.php @@ -243,4 +243,3 @@ class box_produits_alerte_stock extends ModeleBoxes return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } } - diff --git a/htdocs/core/boxes/box_project.php b/htdocs/core/boxes/box_project.php index 3784294298a..1edcce79b0f 100644 --- a/htdocs/core/boxes/box_project.php +++ b/htdocs/core/boxes/box_project.php @@ -200,4 +200,3 @@ class box_project extends ModeleBoxes return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } } - diff --git a/htdocs/core/boxes/box_propales.php b/htdocs/core/boxes/box_propales.php index aa3a9f8fb00..b99c389af63 100644 --- a/htdocs/core/boxes/box_propales.php +++ b/htdocs/core/boxes/box_propales.php @@ -193,4 +193,3 @@ class box_propales extends ModeleBoxes return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } } - diff --git a/htdocs/core/boxes/box_prospect.php b/htdocs/core/boxes/box_prospect.php index 2c58bdbe1c3..4861a5e2a8a 100644 --- a/htdocs/core/boxes/box_prospect.php +++ b/htdocs/core/boxes/box_prospect.php @@ -181,4 +181,3 @@ class box_prospect extends ModeleBoxes return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } } - diff --git a/htdocs/core/boxes/box_services_contracts.php b/htdocs/core/boxes/box_services_contracts.php index 264b95d5c65..513a9db79d9 100644 --- a/htdocs/core/boxes/box_services_contracts.php +++ b/htdocs/core/boxes/box_services_contracts.php @@ -246,4 +246,3 @@ class box_services_contracts extends ModeleBoxes return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } } - diff --git a/htdocs/core/boxes/box_services_expired.php b/htdocs/core/boxes/box_services_expired.php index 0bae23fef95..596b585eab9 100644 --- a/htdocs/core/boxes/box_services_expired.php +++ b/htdocs/core/boxes/box_services_expired.php @@ -190,4 +190,3 @@ class box_services_expired extends ModeleBoxes return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } } - diff --git a/htdocs/core/boxes/box_supplier_orders.php b/htdocs/core/boxes/box_supplier_orders.php index 142fd2820be..8e2e1b6e8e3 100644 --- a/htdocs/core/boxes/box_supplier_orders.php +++ b/htdocs/core/boxes/box_supplier_orders.php @@ -189,4 +189,3 @@ class box_supplier_orders extends ModeleBoxes return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } } - diff --git a/htdocs/core/boxes/box_task.php b/htdocs/core/boxes/box_task.php index bfcf5d2c301..5f576c3a83d 100644 --- a/htdocs/core/boxes/box_task.php +++ b/htdocs/core/boxes/box_task.php @@ -1,6 +1,6 @@ - * Copyright (C) 2015 Frederic France + * Copyright (C) 2015-2019 Frederic France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -104,12 +104,10 @@ class box_task extends ModeleBoxes $sql.= $db->plimit($max, 0); $result = $db->query($sql); - if ($result) - { + $i = 0; + if ($result) { $num = $db->num_rows($result); - $i = 0; - while ($i < $num) - { + while ($i < $num) { $objp = $db->fetch_object($result); $this->info_box_contents[$i][] = array( 'td' => '', @@ -131,11 +129,11 @@ class box_task extends ModeleBoxes $i++; } - } - else dol_print_error($this->db); + } else { + dol_print_error($this->db); + } } - // Add the sum at the bottom of the boxes $this->info_box_contents[$i][] = array('tr' => 'class="liste_total"', 'td' => '', 'text' => $langs->trans("Total")." ".$textHead); $this->info_box_contents[$i][] = array('td' => 'align="right" ', 'text' => number_format($totalnb, 0, ',', ' ')." ".$langs->trans("Tasks")); diff --git a/htdocs/core/boxes/modules_boxes.php b/htdocs/core/boxes/modules_boxes.php index 971c04848c7..2624599ba66 100644 --- a/htdocs/core/boxes/modules_boxes.php +++ b/htdocs/core/boxes/modules_boxes.php @@ -503,5 +503,3 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty" box return $widget; } } - - diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 649b9d317b7..26094c4cc49 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/commonorder.class.php b/htdocs/core/class/commonorder.class.php index 199b29b87cd..9d9445df91c 100644 --- a/htdocs/core/class/commonorder.class.php +++ b/htdocs/core/class/commonorder.class.php @@ -145,4 +145,3 @@ abstract class CommonOrderLine extends CommonObjectLine public $special_code = 0; } - diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index d25d3b13f36..2de814fd14a 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -694,4 +694,3 @@ class Conf } } } - diff --git a/htdocs/core/class/fiscalyear.class.php b/htdocs/core/class/fiscalyear.class.php index cf6a3cf345d..e3f52f703b3 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 bb710c5e29f..9401dce5622 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 @@ -2004,7 +2004,7 @@ class Form } else { - print $this->select_produits_list($selected,$htmlname,$filtertype,$limit,$price_level,'',$status,$finished,0,$socid,$showempty,$forcecombo,$morecss,$hidepriceinlabel, $warehouseStatus); + print $this->select_produits_list($selected, $htmlname, $filtertype, $limit, $price_level, '', $status, $finished, 0, $socid, $showempty, $forcecombo, $morecss, $hidepriceinlabel, $warehouseStatus); } } @@ -2225,6 +2225,10 @@ class Form if ($showempty && ! is_numeric($showempty)) $textifempty=$langs->trans($showempty); else $textifempty.=$langs->trans("All"); } + else + { + if ($showempty && ! is_numeric($showempty)) $textifempty=$langs->trans($showempty); + } if ($showempty) $out.=''; $i = 0; diff --git a/htdocs/core/class/html.formaccounting.class.php b/htdocs/core/class/html.formaccounting.class.php index 41476fb4966..8b4c4e5390d 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..b86c5262e07 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 @@ -79,4 +79,3 @@ class FormBank return 'IBANNumber'; } } - diff --git a/htdocs/core/class/html.formmargin.class.php b/htdocs/core/class/html.formmargin.class.php index 8492237d68f..6d6ff82d5dd 100644 --- a/htdocs/core/class/html.formmargin.class.php +++ b/htdocs/core/class/html.formmargin.class.php @@ -281,4 +281,3 @@ class FormMargin print ''; } } - diff --git a/htdocs/core/class/html.formorder.class.php b/htdocs/core/class/html.formorder.class.php index c16f292d10d..6fc9f6f2046 100644 --- a/htdocs/core/class/html.formorder.class.php +++ b/htdocs/core/class/html.formorder.class.php @@ -101,4 +101,3 @@ class FormOrder extends Form return 1; } } - diff --git a/htdocs/core/class/infobox.class.php b/htdocs/core/class/infobox.class.php index 0a97429be44..2a818eb9596 100644 --- a/htdocs/core/class/infobox.class.php +++ b/htdocs/core/class/infobox.class.php @@ -282,4 +282,3 @@ class InfoBox } } } - diff --git a/htdocs/core/class/stats.class.php b/htdocs/core/class/stats.class.php index eab2ef70e8a..bbdebab81b0 100644 --- a/htdocs/core/class/stats.class.php +++ b/htdocs/core/class/stats.class.php @@ -605,4 +605,3 @@ abstract class Stats return $result; } } - diff --git a/htdocs/core/db/DoliDB.class.php b/htdocs/core/db/DoliDB.class.php index da1c3cd74fb..59a81537004 100644 --- a/htdocs/core/db/DoliDB.class.php +++ b/htdocs/core/db/DoliDB.class.php @@ -298,4 +298,3 @@ abstract class DoliDB implements Database return $this->lastqueryerror; } } - diff --git a/htdocs/core/filemanagerdol/connectors/php/config.php b/htdocs/core/filemanagerdol/connectors/php/config.php index 8df350ef150..84f3b6cc41c 100644 --- a/htdocs/core/filemanagerdol/connectors/php/config.php +++ b/htdocs/core/filemanagerdol/connectors/php/config.php @@ -173,4 +173,3 @@ $Config['FileTypesPath']['Media'] = $Config['UserFilesPath'] . 'media/' ; $Config['FileTypesAbsolutePath']['Media']= ($Config['UserFilesAbsolutePath'] == '') ? '' : $Config['UserFilesAbsolutePath'].'media/' ; $Config['QuickUploadPath']['Media'] = $Config['UserFilesPath'] ; $Config['QuickUploadAbsolutePath']['Media']= $Config['UserFilesAbsolutePath'] ; - diff --git a/htdocs/core/filemanagerdol/connectors/php/upload.php b/htdocs/core/filemanagerdol/connectors/php/upload.php index 90230504705..3e019e38062 100644 --- a/htdocs/core/filemanagerdol/connectors/php/upload.php +++ b/htdocs/core/filemanagerdol/connectors/php/upload.php @@ -68,5 +68,3 @@ $CKEcallback = $_GET['CKEditorFuncNum']; //modify the next line adding in the new param FileUpload($sType, $sCurrentFolder, $sCommand, $CKEcallback); - - diff --git a/htdocs/core/filemanagerdol/connectors/php/util.php b/htdocs/core/filemanagerdol/connectors/php/util.php index 0b39003f494..42a673516a4 100644 --- a/htdocs/core/filemanagerdol/connectors/php/util.php +++ b/htdocs/core/filemanagerdol/connectors/php/util.php @@ -238,4 +238,3 @@ function IsImageValid($filePath, $extension) return true; } - diff --git a/htdocs/core/lib/accounting.lib.php b/htdocs/core/lib/accounting.lib.php index 30ace607536..754652c36b1 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 @@ -226,4 +226,3 @@ function journalHead($nom, $variante, $period, $periodlink, $description, $build print "\n\n\n"; } - diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 77a21100f48..a3f2772c6c1 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -1358,18 +1358,23 @@ function complete_elementList_with_modules(&$elementList) * * @param array $tableau Array of constants array('key'=>array('type'=>type, 'label'=>label) * where type can be 'string', 'text', 'textarea', 'html', 'yesno', 'emailtemplate:xxx', ... - * @param int $strictw3c 0=Include form into table (deprecated), 1=Form is outside table to respect W3C (no form into table), 2=No form nor button at all + * @param int $strictw3c 0=Include form into table (deprecated), 1=Form is outside table to respect W3C (no form into table), 2=No form nor button at all (form is output by caller, recommanded) * @param string $helptext Help * @return void */ function form_constantes($tableau, $strictw3c = 0, $helptext = '') { - global $db,$bc,$langs,$conf,$user; + global $db,$langs,$conf,$user; global $_Avery_Labels; $form = new Form($db); - if (! empty($strictw3c) && $strictw3c == 1) print "\n".'
'; + if (! empty($strictw3c) && $strictw3c == 1) + { + print "\n".''; + print ''; + print ''; + } print ''; print ''; @@ -1382,7 +1387,6 @@ function form_constantes($tableau, $strictw3c = 0, $helptext = '') print "\n"; $label=''; - $listofparam=array(); foreach($tableau as $key => $const) // Loop on each param { $label=''; @@ -1550,6 +1554,7 @@ function form_constantes($tableau, $strictw3c = 0, $helptext = '') print ""; } print "\n"; + if (empty($strictw3c)) print "\n"; } } diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index 9b7481af7af..b168539f091 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -561,4 +561,3 @@ function calendars_prepare_head($param) return $head; } - diff --git a/htdocs/core/lib/asset.lib.php b/htdocs/core/lib/asset.lib.php index b0a4a6b81a9..2a7fbba5fc1 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 c03cd09ff16..15a2e90e7bf 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/barcode.lib.php b/htdocs/core/lib/barcode.lib.php index bdeff0555a4..b36a8bfe7ab 100644 --- a/htdocs/core/lib/barcode.lib.php +++ b/htdocs/core/lib/barcode.lib.php @@ -412,4 +412,3 @@ function barcode_outimage($text, $bars, $scale = 1, $mode = "png", $total_y = 0, imagepng($im); } } - diff --git a/htdocs/core/lib/categories.lib.php b/htdocs/core/lib/categories.lib.php index 769613f6b6c..f814c091c46 100644 --- a/htdocs/core/lib/categories.lib.php +++ b/htdocs/core/lib/categories.lib.php @@ -103,5 +103,3 @@ function categoriesadmin_prepare_head() return $head; } - - diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 55b4d80ac68..8b8bfb923f0 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 @@ -1836,6 +1836,3 @@ function show_subsidiaries($conf, $langs, $db, $object) return $i; } - - - diff --git a/htdocs/core/lib/contact.lib.php b/htdocs/core/lib/contact.lib.php index 98a0065ae00..cfd65825dc2 100644 --- a/htdocs/core/lib/contact.lib.php +++ b/htdocs/core/lib/contact.lib.php @@ -116,4 +116,3 @@ function contact_prepare_head(Contact $object) return $head; } - diff --git a/htdocs/core/lib/contract.lib.php b/htdocs/core/lib/contract.lib.php index c7434e80878..9c30e9cbef0 100644 --- a/htdocs/core/lib/contract.lib.php +++ b/htdocs/core/lib/contract.lib.php @@ -128,4 +128,3 @@ function contract_admin_prepare_head() return $head; } - diff --git a/htdocs/core/lib/cron.lib.php b/htdocs/core/lib/cron.lib.php index 3392785a571..d865a9c6748 100644 --- a/htdocs/core/lib/cron.lib.php +++ b/htdocs/core/lib/cron.lib.php @@ -132,5 +132,3 @@ function dol_print_cron_urls() return 0; } - - diff --git a/htdocs/core/lib/doc.lib.php b/htdocs/core/lib/doc.lib.php index 57cadc28e72..2b9b782bb0b 100644 --- a/htdocs/core/lib/doc.lib.php +++ b/htdocs/core/lib/doc.lib.php @@ -165,4 +165,3 @@ function doc_getlinedesc($line, $outputlangs, $hideref = 0, $hidedesc = 0, $issu return $libelleproduitservice; } - diff --git a/htdocs/core/lib/doleditor.lib.php b/htdocs/core/lib/doleditor.lib.php index 5ed80465428..17d7212f7ad 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 @@ -131,4 +131,3 @@ function show_skin($fuser, $edit = 0) print '
'; } - diff --git a/htdocs/core/lib/donation.lib.php b/htdocs/core/lib/donation.lib.php index 665ff7cb4e3..77de332f5e3 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/ecm.lib.php b/htdocs/core/lib/ecm.lib.php index a1ec2bc4eba..f0f96091573 100644 --- a/htdocs/core/lib/ecm.lib.php +++ b/htdocs/core/lib/ecm.lib.php @@ -140,4 +140,3 @@ function ecm_prepare_head_fm($object) return $head; } - diff --git a/htdocs/core/lib/emailing.lib.php b/htdocs/core/lib/emailing.lib.php index 06ceb2c96b0..dd12385e313 100644 --- a/htdocs/core/lib/emailing.lib.php +++ b/htdocs/core/lib/emailing.lib.php @@ -67,4 +67,3 @@ function emailing_prepare_head(Mailing $object) return $head; } - diff --git a/htdocs/core/lib/expedition.lib.php b/htdocs/core/lib/expedition.lib.php index 275970c41c1..c8023ebb75f 100644 --- a/htdocs/core/lib/expedition.lib.php +++ b/htdocs/core/lib/expedition.lib.php @@ -138,5 +138,3 @@ function expedition_admin_prepare_head() return $head; } - - diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 1d82cb81122..a5c01214a34 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -2973,4 +2973,3 @@ function getFilesUpdated(&$file_list, SimpleXMLElement $dir, $path = '', $pathre return $file_list; } - diff --git a/htdocs/core/lib/fiscalyear.lib.php b/htdocs/core/lib/fiscalyear.lib.php index 083930ee9f9..6ea24bfacc2 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/format_cards.lib.php b/htdocs/core/lib/format_cards.lib.php index ecfce2108dd..5aa3856f21c 100644 --- a/htdocs/core/lib/format_cards.lib.php +++ b/htdocs/core/lib/format_cards.lib.php @@ -66,4 +66,3 @@ foreach($_Avery_Labels as $key => $val) { $_Avery_Labels[$key]['name'].=' ('.$_Avery_Labels[$key]['paper-size'].' - '.$_Avery_Labels[$key]['NX'].'x'.$_Avery_Labels[$key]['NY'].')'; } - diff --git a/htdocs/core/lib/fourn.lib.php b/htdocs/core/lib/fourn.lib.php index 4f3351a4d86..996d27a058a 100644 --- a/htdocs/core/lib/fourn.lib.php +++ b/htdocs/core/lib/fourn.lib.php @@ -227,5 +227,3 @@ function supplierorder_admin_prepare_head() return $head; } - - diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 81a3adecdd6..52e5257907d 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/geturl.lib.php b/htdocs/core/lib/geturl.lib.php index ad67ec5e51b..580eb6533dc 100644 --- a/htdocs/core/lib/geturl.lib.php +++ b/htdocs/core/lib/geturl.lib.php @@ -208,4 +208,3 @@ function removeHtmlComment($content) $content = preg_replace('//', '', $content); return $content; } - diff --git a/htdocs/core/lib/hrm.lib.php b/htdocs/core/lib/hrm.lib.php index 08b0e3be01a..32010914b9d 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 @@ -88,4 +88,3 @@ function hrm_admin_prepare_head() return $head; } - diff --git a/htdocs/core/lib/import.lib.php b/htdocs/core/lib/import.lib.php index 71e47554ac4..d8295d5ac5f 100644 --- a/htdocs/core/lib/import.lib.php +++ b/htdocs/core/lib/import.lib.php @@ -52,4 +52,3 @@ function import_prepare_head($param, $maxstep = 0) return $head; } - diff --git a/htdocs/core/lib/invoice2.lib.php b/htdocs/core/lib/invoice2.lib.php index 227d9ee24ec..60ed0a388d2 100644 --- a/htdocs/core/lib/invoice2.lib.php +++ b/htdocs/core/lib/invoice2.lib.php @@ -280,4 +280,3 @@ function rebuild_merge_pdf($db, $langs, $conf, $diroutputpdf, $newlangid, $filte if ($error) return -1; else return $result; } - diff --git a/htdocs/core/lib/ldap.lib.php b/htdocs/core/lib/ldap.lib.php index 4cb3f534162..a01a688e801 100644 --- a/htdocs/core/lib/ldap.lib.php +++ b/htdocs/core/lib/ldap.lib.php @@ -184,4 +184,3 @@ function show_ldap_content($result, $level, $count, $var, $hide = 0, $subcount = } return 1; } - diff --git a/htdocs/core/lib/loan.lib.php b/htdocs/core/lib/loan.lib.php index 0b617bb0d5c..0624a7df072 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/mailmanspip.lib.php b/htdocs/core/lib/mailmanspip.lib.php index ce7f2927630..5658e5b0e01 100644 --- a/htdocs/core/lib/mailmanspip.lib.php +++ b/htdocs/core/lib/mailmanspip.lib.php @@ -43,4 +43,3 @@ function mailmanspip_admin_prepare_head() ) ); } - diff --git a/htdocs/core/lib/member.lib.php b/htdocs/core/lib/member.lib.php index a5016579cd4..7a6ed21cb4a 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/memory.lib.php b/htdocs/core/lib/memory.lib.php index 8087f34b43c..3bd4991f612 100644 --- a/htdocs/core/lib/memory.lib.php +++ b/htdocs/core/lib/memory.lib.php @@ -270,4 +270,3 @@ function dol_getshmop($memoryid) } return $data; } - diff --git a/htdocs/core/lib/order.lib.php b/htdocs/core/lib/order.lib.php index 93a7aaa71e0..3bdb5adf305 100644 --- a/htdocs/core/lib/order.lib.php +++ b/htdocs/core/lib/order.lib.php @@ -148,5 +148,3 @@ function order_admin_prepare_head() return $head; } - - diff --git a/htdocs/core/lib/parsemd.lib.php b/htdocs/core/lib/parsemd.lib.php index 8fb3a1eecca..3c86b979107 100644 --- a/htdocs/core/lib/parsemd.lib.php +++ b/htdocs/core/lib/parsemd.lib.php @@ -53,4 +53,3 @@ function dolMd2Html($content, $parser = 'parsedown', $replaceimagepath = null) return $content; } - diff --git a/htdocs/core/lib/prelevement.lib.php b/htdocs/core/lib/prelevement.lib.php index e6393326c71..1f7fc427d01 100644 --- a/htdocs/core/lib/prelevement.lib.php +++ b/htdocs/core/lib/prelevement.lib.php @@ -83,4 +83,3 @@ function prelevement_check_config() if(empty($conf->global->PRELEVEMENT_USER)) return -1; return 0; } - diff --git a/htdocs/core/lib/price.lib.php b/htdocs/core/lib/price.lib.php index 38a45fd96f1..ff56b90a0b8 100644 --- a/htdocs/core/lib/price.lib.php +++ b/htdocs/core/lib/price.lib.php @@ -410,4 +410,3 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt return $result; } - diff --git a/htdocs/core/lib/propal.lib.php b/htdocs/core/lib/propal.lib.php index 3fc37196c71..385b69fe2ab 100644 --- a/htdocs/core/lib/propal.lib.php +++ b/htdocs/core/lib/propal.lib.php @@ -141,5 +141,3 @@ function propal_admin_prepare_head() return $head; } - - diff --git a/htdocs/core/lib/receiptprinter.lib.php b/htdocs/core/lib/receiptprinter.lib.php index d440acc5403..6e161c8c4af 100644 --- a/htdocs/core/lib/receiptprinter.lib.php +++ b/htdocs/core/lib/receiptprinter.lib.php @@ -68,5 +68,3 @@ function receiptprinteradmin_prepare_head($mode) return $head; } - - diff --git a/htdocs/core/lib/reception.lib.php b/htdocs/core/lib/reception.lib.php index 0fc71c555dd..a0498468052 100644 --- a/htdocs/core/lib/reception.lib.php +++ b/htdocs/core/lib/reception.lib.php @@ -125,5 +125,3 @@ function reception_admin_prepare_head() return $head; } - - diff --git a/htdocs/core/lib/report.lib.php b/htdocs/core/lib/report.lib.php index e920b1a9909..6939d558a8d 100644 --- a/htdocs/core/lib/report.lib.php +++ b/htdocs/core/lib/report.lib.php @@ -122,4 +122,3 @@ function report_header($reportname, $notused, $period, $periodlink, $description print "\n\n\n"; } - diff --git a/htdocs/core/lib/sendings.lib.php b/htdocs/core/lib/sendings.lib.php index 8ad2a91d3ea..8984ef9cbf8 100644 --- a/htdocs/core/lib/sendings.lib.php +++ b/htdocs/core/lib/sendings.lib.php @@ -435,4 +435,3 @@ function show_list_sending_receive($origin, $origin_id, $filter = '') return 1; } - diff --git a/htdocs/core/lib/stock.lib.php b/htdocs/core/lib/stock.lib.php index 579944117ab..b9ce743c458 100644 --- a/htdocs/core/lib/stock.lib.php +++ b/htdocs/core/lib/stock.lib.php @@ -78,4 +78,3 @@ function stock_prepare_head($object) return $head; } - diff --git a/htdocs/core/lib/supplier_proposal.lib.php b/htdocs/core/lib/supplier_proposal.lib.php index 53dcf1c443f..01dd1187440 100644 --- a/htdocs/core/lib/supplier_proposal.lib.php +++ b/htdocs/core/lib/supplier_proposal.lib.php @@ -130,5 +130,3 @@ function supplier_proposal_admin_prepare_head() return $head; } - - diff --git a/htdocs/core/lib/tax.lib.php b/htdocs/core/lib/tax.lib.php index 6d945c6df42..51a27ec7f99 100644 --- a/htdocs/core/lib/tax.lib.php +++ b/htdocs/core/lib/tax.lib.php @@ -1008,4 +1008,3 @@ function tax_by_rate($type, $db, $y, $q, $date_start, $date_end, $modetax, $dire return $list; } - diff --git a/htdocs/core/lib/treeview.lib.php b/htdocs/core/lib/treeview.lib.php index d8242521f70..2a0f7396e92 100644 --- a/htdocs/core/lib/treeview.lib.php +++ b/htdocs/core/lib/treeview.lib.php @@ -227,4 +227,3 @@ function tree_recur($tab, $pere, $rang, $iddivjstree = 'iddivjstree', $donoreset if ($rang == 0) print ''; } - diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index 224d8407c48..70566cc8e0e 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 1cb564da4ac..9ba4a1617ae 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/lib/ws.lib.php b/htdocs/core/lib/ws.lib.php index 58157e99bce..6d785612483 100644 --- a/htdocs/core/lib/ws.lib.php +++ b/htdocs/core/lib/ws.lib.php @@ -95,4 +95,3 @@ function check_authentication($authentication, &$error, &$errorcode, &$errorlabe return $fuser; } - diff --git a/htdocs/core/login/functions_ldap.php b/htdocs/core/login/functions_ldap.php index baedc488674..225c2d1f722 100644 --- a/htdocs/core/login/functions_ldap.php +++ b/htdocs/core/login/functions_ldap.php @@ -245,4 +245,3 @@ function check_user_password_ldap($usertotest, $passwordtotest, $entitytotest) return $login; } - diff --git a/htdocs/core/menus/standard/auguria_menu.php b/htdocs/core/menus/standard/auguria_menu.php index 8b44046b8b9..2fe3b0bbeff 100644 --- a/htdocs/core/menus/standard/auguria_menu.php +++ b/htdocs/core/menus/standard/auguria_menu.php @@ -317,4 +317,3 @@ class MenuManager unset($this->menu); } } - diff --git a/htdocs/core/menus/standard/eldy_menu.php b/htdocs/core/menus/standard/eldy_menu.php index 834cef65447..346d2695161 100644 --- a/htdocs/core/menus/standard/eldy_menu.php +++ b/htdocs/core/menus/standard/eldy_menu.php @@ -337,4 +337,3 @@ class MenuManager return 0; } } - diff --git a/htdocs/core/menus/standard/empty.php b/htdocs/core/menus/standard/empty.php index 78417b9bd60..9d308354c56 100644 --- a/htdocs/core/menus/standard/empty.php +++ b/htdocs/core/menus/standard/empty.php @@ -602,4 +602,3 @@ function print_end_menu_array_empty() print ''; print "\n"; } - diff --git a/htdocs/core/modules/barcode/modules_barcode.class.php b/htdocs/core/modules/barcode/modules_barcode.class.php index 81481d11dcf..e5d07fac2a4 100644 --- a/htdocs/core/modules/barcode/modules_barcode.class.php +++ b/htdocs/core/modules/barcode/modules_barcode.class.php @@ -177,4 +177,3 @@ abstract class ModeleNumRefBarCode return $s; } } - diff --git a/htdocs/core/modules/contract/mod_contract_olive.php b/htdocs/core/modules/contract/mod_contract_olive.php index 2d8cfba3282..799bd297633 100644 --- a/htdocs/core/modules/contract/mod_contract_olive.php +++ b/htdocs/core/modules/contract/mod_contract_olive.php @@ -121,4 +121,3 @@ class mod_contract_olive extends ModelNumRefContracts return $result; } } - diff --git a/htdocs/core/modules/dons/html_cerfafr.modules.php b/htdocs/core/modules/dons/html_cerfafr.modules.php index faf5b00d2c7..0673ed304e3 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 ec65dd80f93..db1c5c51bd2 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/expensereport/mod_expensereport_sand.php b/htdocs/core/modules/expensereport/mod_expensereport_sand.php index 95cc3d39c95..a1b1c716917 100644 --- a/htdocs/core/modules/expensereport/mod_expensereport_sand.php +++ b/htdocs/core/modules/expensereport/mod_expensereport_sand.php @@ -156,4 +156,3 @@ class mod_expensereport_sand extends ModeleNumRefExpenseReport return $numFinal; } } - diff --git a/htdocs/core/modules/facture/mod_facture_mars.php b/htdocs/core/modules/facture/mod_facture_mars.php index 1c02c646f9f..6abfc734b49 100644 --- a/htdocs/core/modules/facture/mod_facture_mars.php +++ b/htdocs/core/modules/facture/mod_facture_mars.php @@ -228,4 +228,3 @@ class mod_facture_mars extends ModeleNumRefFactures return $this->getNextValue($objsoc,$objforref,$mode); } } - diff --git a/htdocs/core/modules/facture/mod_facture_terre.php b/htdocs/core/modules/facture/mod_facture_terre.php index 7e8671cc652..7d34e47538f 100644 --- a/htdocs/core/modules/facture/mod_facture_terre.php +++ b/htdocs/core/modules/facture/mod_facture_terre.php @@ -243,4 +243,3 @@ class mod_facture_terre extends ModeleNumRefFactures return $this->getNextValue($objsoc,$objforref,$mode); } } - diff --git a/htdocs/core/modules/fichinter/mod_arctic.php b/htdocs/core/modules/fichinter/mod_arctic.php index dc0a607ad5e..0b1932013cf 100644 --- a/htdocs/core/modules/fichinter/mod_arctic.php +++ b/htdocs/core/modules/fichinter/mod_arctic.php @@ -157,4 +157,3 @@ class mod_arctic extends ModeleNumRefFicheinter return $this->getNextValue($objsoc,$objforref); } } - 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 006c529fc02..192ed2ae953 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/modApi.class.php b/htdocs/core/modules/modApi.class.php index 515ec4296b1..80b924f89c9 100644 --- a/htdocs/core/modules/modApi.class.php +++ b/htdocs/core/modules/modApi.class.php @@ -252,4 +252,3 @@ class modApi extends DolibarrModules return $this->_remove($sql, $options); } } - diff --git a/htdocs/core/modules/modAsset.class.php b/htdocs/core/modules/modAsset.class.php index fc123cb3cd6..2cb6f7031dc 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 10665c91b93..f92c1cea2a5 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/modECM.class.php b/htdocs/core/modules/modECM.class.php index 593f702ac52..b172376996f 100644 --- a/htdocs/core/modules/modECM.class.php +++ b/htdocs/core/modules/modECM.class.php @@ -179,4 +179,3 @@ class modECM extends DolibarrModules $r++; } } - diff --git a/htdocs/core/modules/modExternalSite.class.php b/htdocs/core/modules/modExternalSite.class.php index 088e93955ef..260524df139 100644 --- a/htdocs/core/modules/modExternalSite.class.php +++ b/htdocs/core/modules/modExternalSite.class.php @@ -115,4 +115,3 @@ class modExternalSite extends DolibarrModules $r++; } } - diff --git a/htdocs/core/modules/modFTP.class.php b/htdocs/core/modules/modFTP.class.php index bdd745437e1..089f33c6e2d 100644 --- a/htdocs/core/modules/modFTP.class.php +++ b/htdocs/core/modules/modFTP.class.php @@ -125,4 +125,3 @@ class modFTP extends DolibarrModules $r++; } } - diff --git a/htdocs/core/modules/modGravatar.class.php b/htdocs/core/modules/modGravatar.class.php index 7e1aec3efaa..9dbf4ee124f 100644 --- a/htdocs/core/modules/modGravatar.class.php +++ b/htdocs/core/modules/modGravatar.class.php @@ -194,4 +194,3 @@ class modGravatar extends DolibarrModules // $r++; } } - diff --git a/htdocs/core/modules/modHRM.class.php b/htdocs/core/modules/modHRM.class.php index 9c2559f1218..4a083f272c0 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/modHoliday.class.php b/htdocs/core/modules/modHoliday.class.php index 5b26a795dda..19f333c5ffa 100644 --- a/htdocs/core/modules/modHoliday.class.php +++ b/htdocs/core/modules/modHoliday.class.php @@ -257,4 +257,3 @@ class modHoliday extends DolibarrModules // $r++; } } - diff --git a/htdocs/core/modules/modLoan.class.php b/htdocs/core/modules/modLoan.class.php index 2c098961cc1..2624d6075a8 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/modMargin.class.php b/htdocs/core/modules/modMargin.class.php index 58de64c8aad..e4cd53c49a0 100644 --- a/htdocs/core/modules/modMargin.class.php +++ b/htdocs/core/modules/modMargin.class.php @@ -145,4 +145,3 @@ class modMargin extends DolibarrModules $this->rights[$r][5] = 'all'; } } - diff --git a/htdocs/core/modules/modMultiCurrency.class.php b/htdocs/core/modules/modMultiCurrency.class.php index a12ddea6cb0..32bd1bd5980 100644 --- a/htdocs/core/modules/modMultiCurrency.class.php +++ b/htdocs/core/modules/modMultiCurrency.class.php @@ -315,4 +315,3 @@ class modMultiCurrency extends DolibarrModules } } } - diff --git a/htdocs/core/modules/modOpenSurvey.class.php b/htdocs/core/modules/modOpenSurvey.class.php index 7b6fa688192..cf818715638 100644 --- a/htdocs/core/modules/modOpenSurvey.class.php +++ b/htdocs/core/modules/modOpenSurvey.class.php @@ -183,4 +183,3 @@ class modOpenSurvey extends DolibarrModules return $this->_init($sql,$options); } } - diff --git a/htdocs/core/modules/modPaybox.class.php b/htdocs/core/modules/modPaybox.class.php index 5b1d96332da..6358fae8833 100644 --- a/htdocs/core/modules/modPaybox.class.php +++ b/htdocs/core/modules/modPaybox.class.php @@ -189,4 +189,3 @@ class modPayBox extends DolibarrModules // $r++; } } - diff --git a/htdocs/core/modules/modPaypal.class.php b/htdocs/core/modules/modPaypal.class.php index 01f90842ec5..8ca87fb01cc 100644 --- a/htdocs/core/modules/modPaypal.class.php +++ b/htdocs/core/modules/modPaypal.class.php @@ -195,4 +195,3 @@ class modPaypal extends DolibarrModules // $r++; } } - diff --git a/htdocs/core/modules/modProductBatch.class.php b/htdocs/core/modules/modProductBatch.class.php index 1c5f08b55a4..3aceedd9fc6 100644 --- a/htdocs/core/modules/modProductBatch.class.php +++ b/htdocs/core/modules/modProductBatch.class.php @@ -130,4 +130,3 @@ class modProductBatch extends DolibarrModules return $this->_init($sql, $options); } } - diff --git a/htdocs/core/modules/modSalaries.class.php b/htdocs/core/modules/modSalaries.class.php index 9fe00cead73..a35070ef303 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 137547bfb15..dfc325d3e68 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 9a1584da477..256271553c1 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,9 +150,20 @@ 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/oauth/github_oauthcallback.php b/htdocs/core/modules/oauth/github_oauthcallback.php index 052964eca66..ef61eaca1f0 100644 --- a/htdocs/core/modules/oauth/github_oauthcallback.php +++ b/htdocs/core/modules/oauth/github_oauthcallback.php @@ -172,4 +172,3 @@ else // If entry on page with no parameter, we arrive here // No view at all, just actions $db->close(); - diff --git a/htdocs/core/modules/oauth/google_oauthcallback.php b/htdocs/core/modules/oauth/google_oauthcallback.php index b63aca5bdf6..df7127eb847 100644 --- a/htdocs/core/modules/oauth/google_oauthcallback.php +++ b/htdocs/core/modules/oauth/google_oauthcallback.php @@ -167,4 +167,3 @@ else // If entry on page with no parameter, we arrive here // No view at all, just actions $db->close(); - diff --git a/htdocs/core/modules/oauth/stripetest_oauthcallback.php b/htdocs/core/modules/oauth/stripetest_oauthcallback.php index 3a663cd7162..c811af92f33 100644 --- a/htdocs/core/modules/oauth/stripetest_oauthcallback.php +++ b/htdocs/core/modules/oauth/stripetest_oauthcallback.php @@ -177,4 +177,3 @@ else // If entry on page with no parameter, we arrive here // No view at all, just actions $db->close(); - diff --git a/htdocs/core/modules/product/mod_codeproduct_leopard.php b/htdocs/core/modules/product/mod_codeproduct_leopard.php index 8f4e5eb5051..1cf17fef6e7 100644 --- a/htdocs/core/modules/product/mod_codeproduct_leopard.php +++ b/htdocs/core/modules/product/mod_codeproduct_leopard.php @@ -140,4 +140,3 @@ class mod_codeproduct_leopard extends ModeleProductCode return $result; } } - diff --git a/htdocs/core/modules/security/generate/modGeneratePassNone.class.php b/htdocs/core/modules/security/generate/modGeneratePassNone.class.php index d0e8c617217..b0caa7d0b15 100644 --- a/htdocs/core/modules/security/generate/modGeneratePassNone.class.php +++ b/htdocs/core/modules/security/generate/modGeneratePassNone.class.php @@ -109,4 +109,3 @@ class modGeneratePassNone extends ModeleGenPassword return 1; } } - diff --git a/htdocs/core/modules/security/generate/modGeneratePassStandard.class.php b/htdocs/core/modules/security/generate/modGeneratePassStandard.class.php index 0ecf7d7ef38..124ecf32321 100644 --- a/htdocs/core/modules/security/generate/modGeneratePassStandard.class.php +++ b/htdocs/core/modules/security/generate/modGeneratePassStandard.class.php @@ -135,4 +135,3 @@ class modGeneratePassStandard extends ModeleGenPassword return 1; } } - diff --git a/htdocs/core/modules/security/generate/modules_genpassword.php b/htdocs/core/modules/security/generate/modules_genpassword.php index e1f73b134be..a22d19e0845 100644 --- a/htdocs/core/modules/security/generate/modules_genpassword.php +++ b/htdocs/core/modules/security/generate/modules_genpassword.php @@ -90,4 +90,3 @@ abstract class ModeleGenPassword return 1; } } - diff --git a/htdocs/core/modules/societe/mod_codeclient_leopard.php b/htdocs/core/modules/societe/mod_codeclient_leopard.php index f5618172852..77be301464c 100644 --- a/htdocs/core/modules/societe/mod_codeclient_leopard.php +++ b/htdocs/core/modules/societe/mod_codeclient_leopard.php @@ -139,4 +139,3 @@ class mod_codeclient_leopard extends ModeleThirdPartyCode return $result; } } - diff --git a/htdocs/core/modules/stock/doc/pdf_standard.modules.php b/htdocs/core/modules/stock/doc/pdf_standard.modules.php index db1fda75219..1b148aeed89 100644 --- a/htdocs/core/modules/stock/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/stock/doc/pdf_standard.modules.php @@ -22,7 +22,7 @@ * \brief File of class to build PDF documents for stocks/services */ -require_once DOL_DOCUMENT_ROOT.'/core/modules/stock/modules_stock.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/modules/stock/modules_stock.php'; require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; diff --git a/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php b/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php index 45895a6e44d..447075ee5ef 100644 --- a/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php +++ b/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php @@ -22,7 +22,7 @@ * \brief File of class to build PDF documents for stocks movements */ -require_once DOL_DOCUMENT_ROOT.'/core/modules/stock/modules_stock.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/modules/stock/modules_movement.php'; require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php'; 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 b4954a1dd9b..6add111b236 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 @@ -248,4 +248,3 @@ class mod_facture_fournisseur_cactus extends ModeleNumRefSuppliersInvoices return $this->getNextValue($objsoc,$objforref,$mode); } } - 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 39efa7d676b..3daf25a1c31 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 @@ -197,4 +197,3 @@ class mod_facture_fournisseur_tulip extends ModeleNumRefSuppliersInvoices return $this->getNextValue($objsoc,$objforref,$mode); } } - diff --git a/htdocs/core/search.php b/htdocs/core/search.php index 8e6017cdf3b..2fb0efdbe48 100644 --- a/htdocs/core/search.php +++ b/htdocs/core/search.php @@ -152,4 +152,3 @@ else { print 'The wrapper search.php was called without any search criteria'; } - diff --git a/htdocs/core/tpl/admin_extrafields_view.tpl.php b/htdocs/core/tpl/admin_extrafields_view.tpl.php index 79f5a0bad5c..d056f03cd75 100644 --- a/htdocs/core/tpl/admin_extrafields_view.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_view.tpl.php @@ -39,7 +39,7 @@ $langs->load("modulebuilder"); trans("DefineHereComplementaryAttributes",$textobject).'
'."\n"; +print ''.$langs->trans("DefineHereComplementaryAttributes",$textobject).'
'."\n"; print '
'; // Load attribute_label diff --git a/htdocs/core/tpl/card_presend.tpl.php b/htdocs/core/tpl/card_presend.tpl.php index 5eb2d629a66..7a135d6477e 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']; } } @@ -228,4 +242,3 @@ if ($action == 'presend') dol_fiche_end(); } - diff --git a/htdocs/core/tpl/object_discounts.tpl.php b/htdocs/core/tpl/object_discounts.tpl.php index 70698bfa7eb..4b0c8489a04 100644 --- a/htdocs/core/tpl/object_discounts.tpl.php +++ b/htdocs/core/tpl/object_discounts.tpl.php @@ -105,4 +105,3 @@ if($absolute_discount <= 0 && $absolute_creditnote <= 0) { print ' (' . $addabsolutediscount . ')'; } } - diff --git a/htdocs/core/tpl/objectline_edit.tpl.php b/htdocs/core/tpl/objectline_edit.tpl.php index 1c10930de7b..33e6ab1070b 100644 --- a/htdocs/core/tpl/objectline_edit.tpl.php +++ b/htdocs/core/tpl/objectline_edit.tpl.php @@ -100,7 +100,7 @@ $coldisplay=-1; // We remove first td } // Do not allow editing during a situation cycle - if (empty($this->situation_cycle_ref) || $this->situation_counter == 1) + if ($line->fk_prev_id == null ) { // editeur wysiwyg require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; @@ -138,15 +138,15 @@ $coldisplay=-1; // We remove first td } $coldisplay++; - if ($this->situation_counter == 1 || !$this->situation_cycle_ref) { - print '' . $form->load_tva('tva_tx', $line->tva_tx.($line->vat_src_code?(' ('.$line->vat_src_code.')'):''), $seller, $buyer, 0, $line->info_bits, $line->product_type, false, 1) . ''; + if ($line->fk_prev_id == null) { + print '' . $form->load_tva('tva_tx', $line->tva_tx.($line->vat_src_code?(' ('.$line->vat_src_code.')'):''), $seller, $buyer, 0, $line->info_bits, $line->product_type, false, 1) . ''; } else { print '%'; } $coldisplay++; - print 'situation_counter > 1) print ' readonly'; + print 'fk_prev_id != null) print ' readonly'; print '>'; if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) { @@ -156,8 +156,8 @@ $coldisplay=-1; // We remove first td if ($inputalsopricewithtax) { $coldisplay++; - print 'situation_counter > 1) print ' readonly'; + print 'fk_prev_id != null) print ' readonly'; print '>'; } ?> @@ -168,7 +168,7 @@ $coldisplay=-1; // We remove first td // 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;"')." "; print 'situation_counter > 1) print ' readonly'; + if ($line->fk_prev_id != null ) print ' readonly'; print '>'; } else { ?>   @@ -187,7 +187,7 @@ $coldisplay=-1; // We remove first td info_bits & 2) != 2) { print 'situation_counter > 1) print ' readonly'; + if ($line->fk_prev_id != null ) print ' readonly'; print '>%'; } else { ?>   diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index a40fe09624c..4240789caa4 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 ' '; ?> @@ -283,7 +283,7 @@ $domData .= ' data-product_type="'.$line->product_type.'"'; situation_counter == 1 || !$this->situation_cycle_ref) && empty($disableremove)) { + if (($line->fk_prev_id == null ) && empty($disableremove)) { //La suppression n'est autorisée que si il n'y a pas de ligne dans une précédente situation print 'id . '">'; print img_delete(); print ''; diff --git a/htdocs/core/tpl/onlinepaymentlinks.tpl.php b/htdocs/core/tpl/onlinepaymentlinks.tpl.php index 37639a5f8e6..0a3603fbc80 100644 --- a/htdocs/core/tpl/onlinepaymentlinks.tpl.php +++ b/htdocs/core/tpl/onlinepaymentlinks.tpl.php @@ -161,5 +161,3 @@ if (! empty($conf->use_javascript_ajax)) print info_admin($langs->trans("YouCanAddTagOnUrl")); print ''; - - diff --git a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php index e203b9aad1e..a157bd1df2e 100644 --- a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php +++ b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php @@ -184,7 +184,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers dol_syslog( "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id ); // First classify billed the order to allow the proposal classify process - if (! empty($conf->fournisseur->commande->enabled) && ! empty($conf->global->WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER)) + if (! empty($conf->fournisseur->enabled) && ! empty($conf->global->WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER)) { $object->fetchObjectLinked('','order_supplier',$object->id,$object->element); if (! empty($object->linkedObjects)) diff --git a/htdocs/dav/dav.lib.php b/htdocs/dav/dav.lib.php index 719fc2a5c99..a212209d81d 100644 --- a/htdocs/dav/dav.lib.php +++ b/htdocs/dav/dav.lib.php @@ -69,4 +69,3 @@ function dav_admin_prepare_head() return $head; } - diff --git a/htdocs/document.php b/htdocs/document.php index ff6c6f6e635..1df59c07a16 100644 --- a/htdocs/document.php +++ b/htdocs/document.php @@ -74,7 +74,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $encoding = ''; $action=GETPOST('action','alpha'); -$original_file=GETPOST('file','alpha'); // Do not use urldecode here ($_GET are already decoded by PHP). +$original_file=GETPOST('file','alphanohtml'); // Do not use urldecode here ($_GET are already decoded by PHP). $hashp=GETPOST('hashp','aZ09'); $modulepart=GETPOST('modulepart','alpha'); $urlsource=GETPOST('urlsource','alpha'); diff --git a/htdocs/don/admin/donation.php b/htdocs/don/admin/donation.php index 99a801e9e25..7fda34c1508 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 c819cde1e08..82e3a92c2b0 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 0efcd09f2f0..ef7dd8cf84c 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 ec0e3006974..d62b81708a6 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 ba322f9fe08..7012a7f6601 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 cdcb5648501..fa738702b80 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 30c2129b6c6..a57070190ad 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 60bf2c1939f..be95e0db0d1 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 bf9c2768815..c18c3bc1790 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 e016bb80a8e..948646996a2 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 56657694f80..383a57fd59d 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/ajax/ecmdatabase.php b/htdocs/ecm/ajax/ecmdatabase.php index 9c4b9ffa952..2ab1060e3e6 100644 --- a/htdocs/ecm/ajax/ecmdatabase.php +++ b/htdocs/ecm/ajax/ecmdatabase.php @@ -180,4 +180,3 @@ if (isset($action) && ! empty($action)) $db->query($sql); } } - diff --git a/htdocs/ecm/class/htmlecm.form.class.php b/htdocs/ecm/class/htmlecm.form.class.php index 698ddd57bfe..7877b85b0a5 100644 --- a/htdocs/ecm/class/htmlecm.form.class.php +++ b/htdocs/ecm/class/htmlecm.form.class.php @@ -105,4 +105,3 @@ class FormEcm return $output; } } - diff --git a/htdocs/ecm/dir_add_card.php b/htdocs/ecm/dir_add_card.php index a2c0762321c..c1aba1b628b 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 a3390475f44..3c13a221e2b 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/emailcollector/class/emailcollectorfilter.class.php b/htdocs/emailcollector/class/emailcollectorfilter.class.php index 61e65245630..7fe40d201b3 100644 --- a/htdocs/emailcollector/class/emailcollectorfilter.class.php +++ b/htdocs/emailcollector/class/emailcollectorfilter.class.php @@ -490,4 +490,3 @@ class EmailCollectorFilter extends CommonObject $this->initAsSpecimenCommon(); } } - diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 4f08da56365..9bf2ff4e33d 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,13 +838,13 @@ 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(); } @@ -1752,7 +1751,7 @@ elseif ($id || $ref) print '
'; print '
'; - print ''; + print '
'; // Linked documents if ($typeobject == 'commande' && $object->$typeobject->id && ! empty($conf->commande->enabled)) diff --git a/htdocs/expedition/class/expeditionstats.class.php b/htdocs/expedition/class/expeditionstats.class.php index dd18cdb4019..37b33018f17 100644 --- a/htdocs/expedition/class/expeditionstats.class.php +++ b/htdocs/expedition/class/expeditionstats.class.php @@ -143,4 +143,3 @@ class ExpeditionStats extends Stats return $this->_getAllByYear($sql); } } - diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index a2713bd836f..ac4b86c172a 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 de310fe0516..52768896073 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/expensereportstats.class.php b/htdocs/expensereport/class/expensereportstats.class.php index 1ad0f22bce7..b525dfb6838 100644 --- a/htdocs/expensereport/class/expensereportstats.class.php +++ b/htdocs/expensereport/class/expensereportstats.class.php @@ -177,4 +177,3 @@ class ExpenseReportStats extends Stats return $this->_getAllByYear($sql); } } - diff --git a/htdocs/expensereport/class/paymentexpensereport.class.php b/htdocs/expensereport/class/paymentexpensereport.class.php index b18eae8c514..0762a8c0cf5 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 4748bd2c2a4..516f4a5a534 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 7e94a10418a..0278c2d37c8 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 7e1a1bf0d61..4593129a7fc 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 6c7f8dd99c6..2de6684cf1b 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 a4346ce34bc..3985f813edd 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/fichinter/class/fichinterstats.class.php b/htdocs/fichinter/class/fichinterstats.class.php index 340c59b0cb5..2260ab4041e 100644 --- a/htdocs/fichinter/class/fichinterstats.class.php +++ b/htdocs/fichinter/class/fichinterstats.class.php @@ -211,4 +211,3 @@ class FichinterStats extends Stats return $this->_getAllByProduct($sql); } } - diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index 472af9f14d9..3327cb41805 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -294,4 +294,3 @@ if (preg_match('/crypted:/i',$dolibarr_main_db_pass) || ! empty($dolibarr_main_d } else $dolibarr_main_db_pass = dol_decode($dolibarr_main_db_encrypted_pass); } - diff --git a/htdocs/fourn/ajax/getSupplierPrices.php b/htdocs/fourn/ajax/getSupplierPrices.php index ae407d5544d..3224fbbce51 100644 --- a/htdocs/fourn/ajax/getSupplierPrices.php +++ b/htdocs/fourn/ajax/getSupplierPrices.php @@ -97,4 +97,3 @@ if ($idprod > 0) } echo json_encode($prices); - diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index e4463d7ba65..1f8b7b3ba8b 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/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index 427d7223609..4814af72b19 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -680,11 +680,12 @@ class ProductFournisseur extends Product $sql.= " ,pfp.multicurrency_price, pfp.multicurrency_unitprice, pfp.multicurrency_tx, pfp.fk_multicurrency, pfp.multicurrency_code"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."product_fournisseur_price as pfp"; $sql.= " WHERE s.entity IN (".getEntity('societe').")"; + $sql.= " AND pfp.entity = ".$conf->entity; // only current entity $sql.= " AND pfp.fk_product = ".$prodid; $sql.= " AND pfp.fk_soc = s.rowid"; $sql.= " AND s.status = 1"; // only enabled society if ($qty > 0) $sql.= " AND pfp.quantity <= ".$qty; - if ($socid > 0) $sql.= ' AND pfp.fk_soc = '.$socid; + if ($socid > 0) $sql.= ' AND pfp.fk_soc = '.$socid; dol_syslog(get_class($this)."::find_min_price_product_fournisseur", LOG_DEBUG); diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 5c616a70b0e..a2a96762d9d 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 c13be230789..6954473ee43 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 dfca394c7cb..4fd287b1eb5 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 c5194aa7344..377407831de 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 f6b6586a9ec..3360a150959 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/holiday/common.inc.php b/htdocs/holiday/common.inc.php index 96111cf6df0..b9a42c55e58 100644 --- a/htdocs/holiday/common.inc.php +++ b/htdocs/holiday/common.inc.php @@ -40,4 +40,3 @@ if (empty($conf->holiday->enabled)) llxFooter(); exit(); } - diff --git a/htdocs/hrm/admin/admin_establishment.php b/htdocs/hrm/admin/admin_establishment.php index 98221ce6594..bd6e5b012cd 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 7e967176582..e686a93aefd 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 4343e3a2c50..0bb32c4f4c3 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 35e4f483e3d..7fee0e8bc79 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 3129760bc7a..af334e3c456 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/index.php b/htdocs/install/index.php index 46e60be52ec..3c66a317c3d 100644 --- a/htdocs/install/index.php +++ b/htdocs/install/index.php @@ -66,4 +66,3 @@ print '

'.$langs->trans("SomeTranslationAreUncomplete"); // If there's no error, we display the next step button if ($err == 0) pFooter(0); - diff --git a/htdocs/install/lib/repair.lib.php b/htdocs/install/lib/repair.lib.php index eb4a87ee8c2..df6d2b640e4 100644 --- a/htdocs/install/lib/repair.lib.php +++ b/htdocs/install/lib/repair.lib.php @@ -142,4 +142,3 @@ function clean_data_ecm_directories() return; } - 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/install/phpinfo.php b/htdocs/install/phpinfo.php index b3817dcbde2..895436c2069 100644 --- a/htdocs/install/phpinfo.php +++ b/htdocs/install/phpinfo.php @@ -24,4 +24,3 @@ include_once 'inc.php'; phpinfo(); - diff --git a/htdocs/install/step5.php b/htdocs/install/step5.php index b39f67dd3ba..9a548928834 100644 --- a/htdocs/install/step5.php +++ b/htdocs/install/step5.php @@ -469,4 +469,3 @@ pFooter(1,$setuplang); // Return code if ran from command line if ($ret) exit($ret); - diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index 1e8dc536404..47d87886066 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -4924,4 +4924,3 @@ On les corrige: update llx_facture set paye=1, fk_statut=2 where close_code is null and rowid in (...) */ - diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index 144caf49dde..67f30b27db8 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 @@ -155,6 +156,8 @@ ADHERENT_SUBSCRIPTION_ACCOUNTINGACCOUNT=Accounting account to register subscript ACCOUNTING_PRODUCT_BUY_ACCOUNT=Accounting account by default for bought products (used if not defined in the product sheet) ACCOUNTING_PRODUCT_SOLD_ACCOUNT=Accounting account by default for the sold products (used if not defined in the product sheet) +ACCOUNTING_PRODUCT_SOLD_ACCOUNT_INTRA=Accounting account by default for the sold products in EEC (used if not defined in the product sheet) +ACCOUNTING_PRODUCT_SOLD_ACCOUNT_EXPORT=Accounting account by default for the sold products export out of EEC (used if not defined in the product sheet) ACCOUNTING_SERVICE_BUY_ACCOUNT=Accounting account by default for the bought services (used if not defined in the service sheet) ACCOUNTING_SERVICE_SOLD_ACCOUNT=Accounting account by default for the sold services (used if not defined in the service sheet) @@ -166,6 +169,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/admin.lang b/htdocs/langs/en_US/admin.lang index 77b5894b709..d92a0b47bcc 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1853,4 +1853,5 @@ ConfirmUnactivation=Confirm module reset OnMobileOnly=On small screen (smartphone) only DisableProspectCustomerType=Disable the "Prospect + Customer" third party type (so third party must be Prospect or Customer but can't be both) MAIN_OPTIMIZEFORTEXTBROWSER=Simplify interface for blind person -MAIN_OPTIMIZEFORTEXTBROWSERDesc=Enable this option if you are a blind person, or if you use the application from a text browser like Lynx or Links. \ No newline at end of file +MAIN_OPTIMIZEFORTEXTBROWSERDesc=Enable this option if you are a blind person, or if you use the application from a text browser like Lynx or Links. +ThisValueCanOverwrittenOnUserLevel=This value can be overwritten by each user from its user page - tab '%s' \ No newline at end of file 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/livraison/card.php b/htdocs/livraison/card.php index 183810b7ab0..f18915bdf4e 100644 --- a/htdocs/livraison/card.php +++ b/htdocs/livraison/card.php @@ -346,7 +346,7 @@ else print ''; print ''; - dol_fiche_head($head, 'delivery', $langs->trans("Shipment"), 0, 'sending'); + dol_fiche_head($head, 'delivery', $langs->trans("Shipment"), -1, 'sending'); /* * Confirmation de la suppression @@ -434,7 +434,7 @@ else print '
'; print '
'; - print '
'; + print '
'; // Shipment /* diff --git a/htdocs/loan/card.php b/htdocs/loan/card.php index 3bab5474b08..9edb77dee7f 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 09fddcb5599..6f99adb5cbd 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 f11842bf0c1..8f65617d2a2 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 7a68d3e38a8..203ab1d8c19 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 553bbc258e8..e24a77c82cf 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 cc923b17fea..276528fc721 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 780d28df081..707ae473358 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 e066ef07a8e..8f4079fc92d 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 @@ -132,4 +132,3 @@ if ($id > 0) // End of page llxFooter(); $db->close(); - diff --git a/htdocs/loan/payment/card.php b/htdocs/loan/payment/card.php index 017f6a26254..cd916c6e868 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 2ca310a1689..f09ae3d1cce 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 30ba126aefb..7f5b0cf53bc 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/margin/index.php b/htdocs/margin/index.php index 04a2ba0d544..c223caf775b 100644 --- a/htdocs/margin/index.php +++ b/htdocs/margin/index.php @@ -33,4 +33,3 @@ if ($user->rights->produit->lire) { } header('Location: '.dol_buildpath('/margin/'.$page.'.php', 1)); - diff --git a/htdocs/master.inc.php b/htdocs/master.inc.php index 80e9e8c4e2e..7e01f8abd19 100644 --- a/htdocs/master.inc.php +++ b/htdocs/master.inc.php @@ -246,4 +246,3 @@ $hookmanager=new HookManager($db); if (! defined('MAIN_LABEL_MENTION_NPR') ) define('MAIN_LABEL_MENTION_NPR','NPR'); - diff --git a/htdocs/modulebuilder/template/admin/setup.php b/htdocs/modulebuilder/template/admin/setup.php index 6e0be4d0011..68fccf07445 100644 --- a/htdocs/modulebuilder/template/admin/setup.php +++ b/htdocs/modulebuilder/template/admin/setup.php @@ -144,4 +144,3 @@ dol_fiche_end(); llxFooter(); $db->close(); - diff --git a/htdocs/opensurvey/wizard/create_survey.php b/htdocs/opensurvey/wizard/create_survey.php index 8664e616c55..7add3ffc425 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/paybox/lib/paybox.lib.php b/htdocs/paybox/lib/paybox.lib.php index 5ccc09b6bc3..9e7020f034f 100644 --- a/htdocs/paybox/lib/paybox.lib.php +++ b/htdocs/paybox/lib/paybox.lib.php @@ -196,4 +196,3 @@ function print_paybox_redirect($PRICE, $CURRENCY, $EMAIL, $urlok, $urlko, $TAG) return; } - diff --git a/htdocs/paypal/lib/paypal.lib.php b/htdocs/paypal/lib/paypal.lib.php index 5dcf57dca66..d2a3724fb56 100644 --- a/htdocs/paypal/lib/paypal.lib.php +++ b/htdocs/paypal/lib/paypal.lib.php @@ -739,4 +739,3 @@ function getApiError() return $errors; } - diff --git a/htdocs/paypal/lib/paypalfunctions.lib.php b/htdocs/paypal/lib/paypalfunctions.lib.php index 00f67bfa1f0..63d19f9ded2 100644 --- a/htdocs/paypal/lib/paypalfunctions.lib.php +++ b/htdocs/paypal/lib/paypalfunctions.lib.php @@ -75,4 +75,3 @@ $PROXY_PORT = $conf->global->MAIN_PROXY_PORT; $PROXY_USER = $conf->global->MAIN_PROXY_USER; $PROXY_PASS = $conf->global->MAIN_PROXY_PASS; $USE_PROXY = empty($conf->global->MAIN_PROXY_USE)?false:true; - diff --git a/htdocs/product/admin/product.php b/htdocs/product/admin/product.php index 124b7af40ee..51b1ee4f061 100644 --- a/htdocs/product/admin/product.php +++ b/htdocs/product/admin/product.php @@ -746,4 +746,3 @@ print ''; // End of page llxFooter(); $db->close(); - diff --git a/htdocs/product/ajax/products.php b/htdocs/product/ajax/products.php index 6a286d6e7d2..196b4b609aa 100644 --- a/htdocs/product/ajax/products.php +++ b/htdocs/product/ajax/products.php @@ -197,4 +197,3 @@ else if ($outjson) print json_encode($arrayresult); } - diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 512a5caa322..46f57193eb2 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1176,7 +1176,13 @@ else // Accountancy_code_sell print ''; print ''; // Accountancy_code_sell_intra @@ -1184,20 +1190,32 @@ else { print ''; print ''; + if($type = 0) + { + $accountancy_code_sell_intra = (GETPOST('accountancy_code_sell_intra','alpha')?(GETPOST('accountancy_code_sell_intra','alpha')):$conf->global->ACCOUNTING_PRODUCT_SOLD_INTRA_ACCOUNT); + } else { + $accountancy_code_sell_intra = GETPOST('accountancy_code_sell_intra','alpha'); + } + print $formaccounting->select_account($accountancy_code_sell_intra, 'accountancy_code_sell_intra', 1, null, 1, 1, ''); + print ''; } // Accountancy_code_sell_export print ''; print ''; + if($type = 0) + { + $accountancy_code_sell_export = (GETPOST('accountancy_code_sell_export','alpha')?(GETPOST('accountancy_code_sell_export','alpha')):$conf->global->ACCOUNTING_PRODUCT_SOLD_EXPORT_ACCOUNT); + } else { + $accountancy_code_sell_export = GETPOST('accountancy_code_sell_export','alpha'); + } + print $formaccounting->select_account($accountancy_code_sell_export, 'accountancy_code_sell_export', 1, null, 1, 1, ''); + print ''; // Accountancy_code_buy print ''; print ''; } else // For external software diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 9e07dc90d46..8205b54c0b7 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 e190e3a55d1..1e643c7f192 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/index.php b/htdocs/product/index.php index f3e8ce50037..807c7c46346 100644 --- a/htdocs/product/index.php +++ b/htdocs/product/index.php @@ -182,7 +182,7 @@ elseif ($type == '1') else { print $statProducts.$statServices; - $total=round($prodser[1][0])+round($prodser[1][1])+round($prodser[1][2])+round($prodser[0][0])+round($prodser[0][1])+round($prodser[0][2]); + $total=round($prodser[0][0])+round($prodser[0][1])+round($prodser[0][2])+round($prodser[0][3])+round($prodser[1][0])+round($prodser[1][1])+round($prodser[1][2])+round($prodser[1][3]); //Calcul du Total des Produits et Services } print '
'.$langs->trans("ProductAccountancySellCode").''; - print $formaccounting->select_account(GETPOST('accountancy_code_sell'), 'accountancy_code_sell', 1, null, 1, 1, ''); + if($type = 0) + { + $accountancy_code_sell = (GETPOST('accountancy_code_sell','alpha')?(GETPOST('accountancy_code_sell','alpha')):$conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT); + } else { + $accountancy_code_sell = (GETPOST('accountancy_code_sell','alpha')?(GETPOST('accountancy_code_sell','alpha')):$conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT); + } + print $formaccounting->select_account($accountancy_code_sell, 'accountancy_code_sell', 1, null, 1, 1, ''); print '
'.$langs->trans("ProductAccountancySellIntraCode").''; - print $formaccounting->select_account(GETPOST('accountancy_code_sell_intra'), 'accountancy_code_sell_intra', 1, null, 1, 1, ''); - print '
'.$langs->trans("ProductAccountancySellExportCode").''; - print $formaccounting->select_account(GETPOST('accountancy_code_sell_export'), 'accountancy_code_sell_export', 1, null, 1, 1, ''); - print '
'.$langs->trans("ProductAccountancyBuyCode").''; - print $formaccounting->select_account(GETPOST('accountancy_code_buy'), 'accountancy_code_buy', 1, null, 1, 1, ''); + print $formaccounting->select_account(GETPOST('accountancy_code_buy','alpha'), 'accountancy_code_buy', 1, null, 1, 1, ''); print '
'.$langs->trans("Total").''; print $total; @@ -507,4 +507,3 @@ function activitytrim($product_type) print '
'; } } - diff --git a/htdocs/product/note.php b/htdocs/product/note.php index e77360b46be..a595d344e37 100644 --- a/htdocs/product/note.php +++ b/htdocs/product/note.php @@ -118,4 +118,3 @@ if ($id > 0 || ! empty($ref)) // End of page llxFooter(); $db->close(); - diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 1c73758c5f2..804dabe7e4f 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/product/stock/lib/replenishment.lib.php b/htdocs/product/stock/lib/replenishment.lib.php index 86cb1a3d7ba..13d1b749fc0 100644 --- a/htdocs/product/stock/lib/replenishment.lib.php +++ b/htdocs/product/stock/lib/replenishment.lib.php @@ -172,4 +172,3 @@ function getProducts($order_id) } return $products; } - diff --git a/htdocs/projet/ajax/projects.php b/htdocs/projet/ajax/projects.php index 46699ba01dd..cbc57ca6f3f 100644 --- a/htdocs/projet/ajax/projects.php +++ b/htdocs/projet/ajax/projects.php @@ -70,4 +70,3 @@ $arrayresult=$form->select_projects_list($socid, '', $htmlname, 0, 0, 1, $discar $db->close(); print json_encode($arrayresult); - diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index d4b0e4c8dae..66eeeedc97f 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/projet/tasks/time.php b/htdocs/projet/tasks/time.php index e2025812e65..bbb04cc3d76 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -98,6 +98,7 @@ $extralabels_task=$extrafields_task->fetch_name_optionals_label($object->table_e */ if (GETPOST('cancel','alpha')) { $action=''; } +if (! GETPOST('confirmmassaction','alpha') && $massaction != 'presend' && $massaction != 'confirm_presend' && $massaction != 'confirm_generateinvoice') { $massaction=''; } $parameters=array('socid'=>$socid, 'projectid'=>$projectid); $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks @@ -300,7 +301,7 @@ elseif (GETPOST('project_ref','alpha')) $withproject=1; } -if ($massaction == 'generateinvoice') +if ($massaction == 'confirm_generateinvoice') { if (! empty($projectstatic->socid)) $projectstatic->fetch_thirdparty(); @@ -754,7 +755,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) $arrayfields['t.note']=array('label'=>$langs->trans("Note"), 'checked'=>1); $arrayfields['t.task_duration']=array('label'=>$langs->trans("Duration"), 'checked'=>1); $arrayfields['value'] =array('label'=>$langs->trans("Value"), 'checked'=>1, 'enabled'=>(empty($conf->salaries->enabled)?0:1)); - $arrayfields['valuebilled'] =array('label'=>$langs->trans("Billed"), 'checked'=>1, 'enabled'=>((! empty($conf->global->PROJECT_HIDE_TASKS) || empty($conf->global->PROJECT_BILL_TIME_SPENT))?0:1)); + $arrayfields['valuebilled'] =array('label'=>$langs->trans("Billed"), 'checked'=>1, 'enabled'=>(((! empty($conf->global->PROJECT_HIDE_TASKS) || empty($conf->global->PROJECT_BILL_TIME_SPENT))?0:1) && $projectstatic->bill_time)); // Extra fields if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) { @@ -771,7 +772,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) //'builddoc'=>$langs->trans("PDFMerge"), ); //if ($user->rights->projet->creer) $arrayofmassactions['predelete']=$langs->trans("Delete"); - if (in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array(); + if (in_array($massaction, array('presend','predelete','generateinvoice'))) $arrayofmassactions=array(); $massactionbutton=$form->selectMassAction('', $arrayofmassactions); } @@ -810,6 +811,51 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) print ''; print ''; + if ($massaction == 'generateinvoice') + { + $langs->load("bills"); + + //var_dump($_REQUEST); + print ''; + + print ''; + print ''; + print ''; + print ''; + print ''; + if ($conf->service->enabled) + { + print ''; + print ''; + print ''; + print ''; + } + /*print ''; + print ''; + print ''; + print '';*/ + print '
'; + print $langs->trans('DateInvoice'); + print ''; + print $form->selectDate('', '', '', '', '', '', 1, 1); + print '
'; + print $langs->trans('Service'); + print ''; + print $form->select_produits('', 'productid', '1', 0, 0, 1, 2, '', 0, array(), 0, 'None', 0, 'maxwidth500'); + print '
'; + print $langs->trans('ValidateInvoices'); + print ''; + print $form->selectyesno('valdate_invoices', 0, 1); + print '
'; + + print '
'; + print '
'; + print ' '; + print ''; + print '
'; + print '
'; + } + /* * List of time spent */ diff --git a/htdocs/public/agenda/index.php b/htdocs/public/agenda/index.php index 1c06e10b06d..112a07951b8 100644 --- a/htdocs/public/agenda/index.php +++ b/htdocs/public/agenda/index.php @@ -25,4 +25,3 @@ require '../../master.inc.php'; header("Location: ".DOL_URL_ROOT.'/public/error-404.php'); - diff --git a/htdocs/public/demo/index.php b/htdocs/public/demo/index.php index 0409e849df0..15926df3df2 100644 --- a/htdocs/public/demo/index.php +++ b/htdocs/public/demo/index.php @@ -482,4 +482,3 @@ function llxFooterVierge() print "
\n"; print "\n"; } - diff --git a/htdocs/public/donations/index.php b/htdocs/public/donations/index.php index 23f8e0e4cdc..08e7650a152 100644 --- a/htdocs/public/donations/index.php +++ b/htdocs/public/donations/index.php @@ -25,4 +25,3 @@ require '../../master.inc.php'; header("Location: ".DOL_URL_ROOT.'/public/error-404.php'); - diff --git a/htdocs/public/index.php b/htdocs/public/index.php index d02276ef269..e1030c9973a 100644 --- a/htdocs/public/index.php +++ b/htdocs/public/index.php @@ -25,4 +25,3 @@ require '../master.inc.php'; header("Location: ".DOL_URL_ROOT.'/public/error-404.php'); - diff --git a/htdocs/public/members/index.php b/htdocs/public/members/index.php index 1ec9a1d1833..42bfa7713cf 100644 --- a/htdocs/public/members/index.php +++ b/htdocs/public/members/index.php @@ -25,4 +25,3 @@ require '../../master.inc.php'; header("Location: ".DOL_URL_ROOT.'/public/error-404.php'); - diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index efbf449ae26..fe5116137f2 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 c2df82fb2f2..c0806d3a48d 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 @@ -156,4 +156,3 @@ function llxFooterVierge() print "\n"; print "\n"; } - diff --git a/htdocs/public/notice.php b/htdocs/public/notice.php index 6a55411ae3b..c4ab121db18 100644 --- a/htdocs/public/notice.php +++ b/htdocs/public/notice.php @@ -47,4 +47,3 @@ else if (GETPOST('transphrase','alphanohtml')) print GETPOST('transphrase','alphanohtml'); if (GETPOST('transkey','alphanohtml')) print $langs->trans(GETPOST('transkey','alphanohtml')); } - diff --git a/htdocs/public/paybox/index.php b/htdocs/public/paybox/index.php index 0b7ad1c82e4..58d748aba72 100644 --- a/htdocs/public/paybox/index.php +++ b/htdocs/public/paybox/index.php @@ -25,4 +25,3 @@ require '../../master.inc.php'; header("Location: ".DOL_URL_ROOT.'/public/error-404.php'); - diff --git a/htdocs/public/payment/index.php b/htdocs/public/payment/index.php index cc491b860d3..21786830df6 100644 --- a/htdocs/public/payment/index.php +++ b/htdocs/public/payment/index.php @@ -25,4 +25,3 @@ require '../../master.inc.php'; header("Location: ".DOL_URL_ROOT.'/public/error-404.php'); - diff --git a/htdocs/public/paypal/index.php b/htdocs/public/paypal/index.php index 2e7f2772687..0cba12e6aa2 100644 --- a/htdocs/public/paypal/index.php +++ b/htdocs/public/paypal/index.php @@ -25,4 +25,3 @@ require '../../master.inc.php'; header("Location: ".DOL_URL_ROOT.'/public/error-404.php'); - diff --git a/htdocs/public/stripe/index.php b/htdocs/public/stripe/index.php index 6a86f3ed88e..6958940ea48 100644 --- a/htdocs/public/stripe/index.php +++ b/htdocs/public/stripe/index.php @@ -25,4 +25,3 @@ require '../../master.inc.php'; header("Location: ".DOL_URL_ROOT.'/public/error-404.php'); - diff --git a/htdocs/public/stripe/newpayment.php b/htdocs/public/stripe/newpayment.php index cb22aa72cd4..25fa3365840 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/public/theme/common/index.php b/htdocs/public/theme/common/index.php index 0d25c726b33..2a9d8b8c2a9 100644 --- a/htdocs/public/theme/common/index.php +++ b/htdocs/public/theme/common/index.php @@ -26,4 +26,3 @@ require '../../../master.inc.php'; header("Location: ".DOL_URL_ROOT.'/public/error-404.php'); - diff --git a/htdocs/public/theme/index.php b/htdocs/public/theme/index.php index 1d8c522741d..6b5d38f5e94 100644 --- a/htdocs/public/theme/index.php +++ b/htdocs/public/theme/index.php @@ -26,4 +26,3 @@ require '../../master.inc.php'; header("Location: ".DOL_URL_ROOT.'/public/error-404.php'); - diff --git a/htdocs/reception/class/receptionstats.class.php b/htdocs/reception/class/receptionstats.class.php index 9a25d5944d1..029092cb923 100644 --- a/htdocs/reception/class/receptionstats.class.php +++ b/htdocs/reception/class/receptionstats.class.php @@ -139,4 +139,3 @@ class ReceptionStats extends Stats return $this->_getAllByYear($sql); } } - diff --git a/htdocs/societe/ajax/company.php b/htdocs/societe/ajax/company.php index 2cfdce9c01c..633ac22663c 100644 --- a/htdocs/societe/ajax/company.php +++ b/htdocs/societe/ajax/company.php @@ -94,4 +94,3 @@ else if ($outjson) print json_encode($arrayresult); } - diff --git a/htdocs/societe/ajaxcountries.php b/htdocs/societe/ajaxcountries.php index f67d01facce..caf93fd6972 100644 --- a/htdocs/societe/ajaxcountries.php +++ b/htdocs/societe/ajaxcountries.php @@ -75,4 +75,3 @@ if (! empty($country)) print ''; } } - diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index dbb7fbcd91b..9518e3db0c8 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/companybankaccount.class.php b/htdocs/societe/class/companybankaccount.class.php index bd41e5edad7..12b784d9f0d 100644 --- a/htdocs/societe/class/companybankaccount.class.php +++ b/htdocs/societe/class/companybankaccount.class.php @@ -415,4 +415,3 @@ class CompanyBankAccount extends Account $this->socid = 0; } } - diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 90c20ca1cf2..65a18d39679 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 @@ -1243,7 +1243,7 @@ class Societe extends CommonObject $sql .= ', s.fk_forme_juridique as forme_juridique_code'; $sql .= ', s.webservices_url, s.webservices_key'; $sql .= ', s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur, s.parent, s.barcode'; - $sql .= ', s.fk_departement, s.fk_pays as country_id, s.fk_stcomm, s.remise_client, s.remise_supplier, s.mode_reglement, s.cond_reglement, s.fk_account, s.tva_assuj'; + $sql .= ', s.fk_departement, s.fk_pays as country_id, s.fk_stcomm, s.remise_supplier, s.mode_reglement, s.cond_reglement, s.fk_account, s.tva_assuj'; $sql .= ', s.mode_reglement_supplier, s.cond_reglement_supplier, s.localtax1_assuj, s.localtax1_value, s.localtax2_assuj, s.localtax2_value, s.fk_prospectlevel, s.default_lang, s.logo'; $sql .= ', s.fk_shipping_method'; $sql .= ', s.outstanding_limit, s.import_key, s.canvas, s.fk_incoterms, s.location_incoterms'; @@ -1256,6 +1256,7 @@ class Societe extends CommonObject $sql .= ', st.libelle as stcomm'; $sql .= ', te.code as typent_code'; $sql .= ', i.libelle as libelle_incoterms'; + $sql .= ', sr.remise_client'; $sql .= ' FROM '.MAIN_DB_PREFIX.'societe as s'; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_effectif as e ON s.fk_effectif = e.id'; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c ON s.fk_pays = c.rowid'; @@ -1264,6 +1265,7 @@ class Societe extends CommonObject $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_departements as d ON s.fk_departement = d.rowid'; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_typent as te ON s.fk_typent = te.id'; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_incoterms as i ON s.fk_incoterms = i.rowid'; + $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe_remise as sr ON sr.rowid = (SELECT MAX(rowid) FROM '.MAIN_DB_PREFIX.'societe_remise WHERE fk_soc = s.rowid AND entity = '.$conf->entity.')'; $sql .= ' WHERE s.entity IN ('.getEntity($this->element).')'; if ($rowid) $sql .= ' AND s.rowid = '.$rowid; @@ -1377,7 +1379,7 @@ class Societe extends CommonObject $this->prefix_comm = $obj->prefix_comm; - $this->remise_percent = $obj->remise_client; + $this->remise_percent = price2num($obj->remise_client); // 0.000000 must be 0 $this->remise_supplier_percent = $obj->remise_supplier; $this->mode_reglement_id = $obj->mode_reglement; $this->cond_reglement_id = $obj->cond_reglement; @@ -3877,6 +3879,7 @@ class Societe extends CommonObject $sql .= " AND entity IN (".getEntity('invoice').")"; $sql .= " AND paye = 0"; $sql .= " AND fk_statut <> 0"; // Not a draft + $sql .= " AND entity IN (".getEntity('invoice').")"; //$sql .= " AND (fk_statut <> 3 OR close_code <> 'abandon')"; // Not abandonned for undefined reason $sql .= " AND fk_statut <> 3"; // Not abandonned $sql .= " AND fk_statut <> 2"; // Not clasified as paid diff --git a/htdocs/societe/contact.php b/htdocs/societe/contact.php index 4077a0b1815..112ac46900c 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/societe/note.php b/htdocs/societe/note.php index 9f1adb16fc7..139265ba3a3 100644 --- a/htdocs/societe/note.php +++ b/htdocs/societe/note.php @@ -132,4 +132,3 @@ else // End of page llxFooter(); $db->close(); - diff --git a/htdocs/societe/tpl/linesalesrepresentative.tpl.php b/htdocs/societe/tpl/linesalesrepresentative.tpl.php index c2ea3d987a5..b35f85b0f15 100644 --- a/htdocs/societe/tpl/linesalesrepresentative.tpl.php +++ b/htdocs/societe/tpl/linesalesrepresentative.tpl.php @@ -49,4 +49,3 @@ if ($nbofsalesrepresentative > 0) } else print ''.$langs->trans("NoSalesRepresentativeAffected").''; print ''; - diff --git a/htdocs/stripe/admin/stripe.php b/htdocs/stripe/admin/stripe.php index 6a4dd8713f7..a0846cdd79e 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 cea97efe0a3..b313e97b9fa 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 bafa83c21cf..2b73717ac09 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 @@ -199,4 +199,3 @@ function html_print_stripe_footer($fromcompany, $langs) print $line2; print ''."\n"; } - diff --git a/htdocs/stripe/payout.php b/htdocs/stripe/payout.php new file mode 100644 index 00000000000..8989adba058 --- /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/support/inc.php b/htdocs/support/inc.php index 9b975db5dc3..e43fb4f2476 100644 --- a/htdocs/support/inc.php +++ b/htdocs/support/inc.php @@ -250,4 +250,3 @@ function pFooter($nonext = 0, $setuplang = '') print ''."\n"; print ''."\n"; } - diff --git a/htdocs/theme/eldy/graph-color.php b/htdocs/theme/eldy/graph-color.php index 920fa7833af..49091d810b1 100644 --- a/htdocs/theme/eldy/graph-color.php +++ b/htdocs/theme/eldy/graph-color.php @@ -31,4 +31,3 @@ $theme_bordercolor = array(235,235,224); $theme_datacolor = array(array(136,102,136), array(0,130,110), array(140,140,220), array(190,120,120), array(190,190,100), array(115,125,150), array(100,170,20), array(250,190,30), array(150,135,125), array(85,135,150), array(150,135,80), array(150,80,150)); $theme_bgcolor = array(hexdec('F4'),hexdec('F4'),hexdec('F4')); $theme_bgcoloronglet = array(hexdec('DE'),hexdec('E7'),hexdec('EC')); - diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index e8dd9cbd210..4e65b1bc5ed 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -1562,7 +1562,7 @@ div#tmenu_tooltip { } -div.tmenusep { +div.topmenuimage { display: none; diff --git a/htdocs/theme/md/graph-color.php b/htdocs/theme/md/graph-color.php index 72cc839043b..78a621ada1d 100644 --- a/htdocs/theme/md/graph-color.php +++ b/htdocs/theme/md/graph-color.php @@ -31,4 +31,3 @@ $theme_bordercolor = array(235,235,224); $theme_datacolor = array(array(136,102,136), array(0,130,110), array(140,140,220), array(190,120,120), array(190,190,100), array(115,125,150), array(100,170,20), array(250,190,30), array(150,135,125), array(85,135,150), array(150,135,80), array(150,80,150)); $theme_bgcolor = array(hexdec('F4'),hexdec('F4'),hexdec('F4')); $theme_bgcoloronglet = array(hexdec('DE'),hexdec('E7'),hexdec('EC')); - diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index e20ffbe43e2..d3e2368217e 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 c76cab34f3b..527a7af5cb7 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 f4799e7b17f..f0b3aa361cc 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 fbc0237c37b..15139bd0291 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 ea8d340e0ae..4a449771a64 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/htdocs/variants/ajax/orderAttribute.php b/htdocs/variants/ajax/orderAttribute.php index 92bbcc241d5..518b41fb388 100644 --- a/htdocs/variants/ajax/orderAttribute.php +++ b/htdocs/variants/ajax/orderAttribute.php @@ -50,4 +50,3 @@ if (isset($_POST['roworder'])) { ProductAttribute::bulkUpdateOrder($db, $newrowordertab); } - diff --git a/htdocs/viewimage.php b/htdocs/viewimage.php index ea29fe0d8bd..2385a558307 100644 --- a/htdocs/viewimage.php +++ b/htdocs/viewimage.php @@ -84,7 +84,7 @@ require 'main.inc.php'; // Load $user and permissions require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $action=GETPOST('action','alpha'); -$original_file=GETPOST('file','alpha'); // Do not use urldecode here ($_GET are already decoded by PHP). +$original_file=GETPOST('file','alphanohtml'); // Do not use urldecode here ($_GET are already decoded by PHP). $hashp=GETPOST('hashp','aZ09'); $modulepart=GETPOST('modulepart','alpha'); $urlsource=GETPOST('urlsource','alpha'); diff --git a/htdocs/webservices/index.php b/htdocs/webservices/index.php index e0a1ba998c8..2f469fa95fd 100644 --- a/htdocs/webservices/index.php +++ b/htdocs/webservices/index.php @@ -54,4 +54,3 @@ print 'List of available SOAP Web services is visible on the setup area, setup p $db->close(); - diff --git a/scripts/accountancy/export-thirdpartyaccount.php b/scripts/accountancy/export-thirdpartyaccount.php index e8468d64ece..90a072ebeba 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 * diff --git a/scripts/contracts/email_expire_services_to_customers.php b/scripts/contracts/email_expire_services_to_customers.php index 9e51804857c..12a2fbd6c85 100755 --- a/scripts/contracts/email_expire_services_to_customers.php +++ b/scripts/contracts/email_expire_services_to_customers.php @@ -314,4 +314,3 @@ function envoi_mail($mode, $oldemail, $message, $total, $userlang, $oldtarget, $ return -1; } } - diff --git a/scripts/contracts/email_expire_services_to_representatives.php b/scripts/contracts/email_expire_services_to_representatives.php index 8ee56ddf2eb..bfde9ab51c6 100755 --- a/scripts/contracts/email_expire_services_to_representatives.php +++ b/scripts/contracts/email_expire_services_to_representatives.php @@ -280,4 +280,3 @@ function envoi_mail($mode, $oldemail, $message, $total, $userlang, $oldsalerepre return -1; } } - diff --git a/scripts/invoices/email_unpaid_invoices_to_customers.php b/scripts/invoices/email_unpaid_invoices_to_customers.php index 23026336347..aa9214b9ec6 100755 --- a/scripts/invoices/email_unpaid_invoices_to_customers.php +++ b/scripts/invoices/email_unpaid_invoices_to_customers.php @@ -305,4 +305,3 @@ function envoi_mail($mode, $oldemail, $message, $total, $userlang, $oldtarget) return -1; } } - diff --git a/scripts/invoices/email_unpaid_invoices_to_representatives.php b/scripts/invoices/email_unpaid_invoices_to_representatives.php index d79d402863e..70d216750c5 100755 --- a/scripts/invoices/email_unpaid_invoices_to_representatives.php +++ b/scripts/invoices/email_unpaid_invoices_to_representatives.php @@ -277,4 +277,3 @@ function envoi_mail($mode, $oldemail, $message, $total, $userlang, $oldsalerepre return -1; } } - diff --git a/scripts/members/sync_members_ldap2dolibarr.php b/scripts/members/sync_members_ldap2dolibarr.php index d7d4fbdeaaf..a82caf4cbe7 100755 --- a/scripts/members/sync_members_ldap2dolibarr.php +++ b/scripts/members/sync_members_ldap2dolibarr.php @@ -340,4 +340,3 @@ function dolValidElement($element) { return (trim($element) != ''); } - diff --git a/scripts/members/sync_members_types_ldap2dolibarr.php b/scripts/members/sync_members_types_ldap2dolibarr.php index cb85e38bd89..b9ded8436b7 100755 --- a/scripts/members/sync_members_types_ldap2dolibarr.php +++ b/scripts/members/sync_members_types_ldap2dolibarr.php @@ -216,4 +216,3 @@ function dolValidElementType($element) { return (trim($element) != ''); } - diff --git a/scripts/modulebuilder/initmodule.php b/scripts/modulebuilder/initmodule.php index bee931dc8fa..09daa1024d5 100755 --- a/scripts/modulebuilder/initmodule.php +++ b/scripts/modulebuilder/initmodule.php @@ -172,4 +172,3 @@ if (! $error) print 'Module initialized'."\n"; exit(0); - diff --git a/scripts/user/sync_groups_ldap2dolibarr.php b/scripts/user/sync_groups_ldap2dolibarr.php index d63f80f459e..be65fbb2943 100755 --- a/scripts/user/sync_groups_ldap2dolibarr.php +++ b/scripts/user/sync_groups_ldap2dolibarr.php @@ -263,4 +263,3 @@ function dolValidElement($element) { return (trim($element) != ''); } - diff --git a/scripts/user/sync_users_ldap2dolibarr.php b/scripts/user/sync_users_ldap2dolibarr.php index 6da28bc58f8..30663f53518 100755 --- a/scripts/user/sync_users_ldap2dolibarr.php +++ b/scripts/user/sync_users_ldap2dolibarr.php @@ -319,4 +319,3 @@ function dolValidElement($element) { return (trim($element) != ''); } -