From 5d06e53f1b38732e081faf9ff3306707daad7229 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Fri, 8 Mar 2019 09:11:56 +0100 Subject: [PATCH 01/44] NEW: Accounting - More comprehensive menu --- htdocs/core/menus/standard/eldy.lib.php | 191 ++++++++++++------------ htdocs/langs/en_US/accountancy.lang | 3 +- 2 files changed, 101 insertions(+), 93 deletions(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 04f379b746f..7bba891f113 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1191,69 +1191,40 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM $permtoshowmenu=(! empty($conf->accounting->enabled) || $user->rights->accounting->bind->write || $user->rights->compta->resultat->lire); //$newmenu->add("/accountancy/index.php?leftmenu=accountancy", $langs->trans("MenuAccountancy"), 0, $permtoshowmenu, '', $mainmenu, 'accountancy'); - // Chart of account - $newmenu->add("/accountancy/index.php?leftmenu=accountancy_admin", $langs->trans("Setup"), 0, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin', 1); - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/', $leftmenu)) { - $newmenu->add("/accountancy/admin/index.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("General"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_general', 10); - $newmenu->add("/accountancy/admin/journals_list.php?id=35&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("AccountingJournals"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_journal', 20); - $newmenu->add("/accountancy/admin/accountmodel.php?id=31&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("Pcg_version"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_chartmodel', 30); - $newmenu->add("/accountancy/admin/account.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("Chartofaccounts"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_chart', 40); - $newmenu->add("/accountancy/admin/categories_list.php?id=32&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("AccountingCategory"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_chart', 41); - $newmenu->add("/accountancy/admin/defaultaccounts.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuDefaultAccounts"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 50); - if (! empty($conf->banque->enabled)) { - $newmenu->add("/compta/bank/list.php?mainmenu=accountancy&leftmenu=accountancy_admin&search_status=-1", $langs->trans("MenuBankAccounts"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_bank', 51); - } - if (! empty($conf->facture->enabled) || ! empty($conf->fournisseur->enabled)) { - $newmenu->add("/admin/dict.php?id=10&from=accountancy&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuVatAccounts"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 52); - } - if (! empty($conf->tax->enabled)) { - $newmenu->add("/admin/dict.php?id=7&from=accountancy&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuTaxAccounts"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 53); - } - if (! empty($conf->expensereport->enabled)) { - $newmenu->add("/admin/dict.php?id=17&from=accountancy&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuExpenseReportAccounts"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 54); - } - $newmenu->add("/accountancy/admin/productaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuProductsAccounts"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_product', 55); - $newmenu->add("/accountancy/admin/export.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("ExportOptions"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_export', 60); - $newmenu->add("/accountancy/admin/closure.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuClosureAccounts"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_closure', 70); + // Transfer in accounting + $newmenu->add("/accountancy/index.php?leftmenu=accountancy_transfer", $langs->trans("TransferInAccounting"), 0, $user->rights->accounting->bind->write, '', $mainmenu, 'transfer', 1); - // Fiscal year - if ($conf->global->MAIN_FEATURES_LEVEL > 1) { - // Not yet used. In a future will lock some periods. - $newmenu->add("/accountancy/admin/fiscalyear.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("FiscalPeriod"), 1, $user->rights->accounting->fiscalyear, '', $mainmenu, 'fiscalyear'); + // Binding + // $newmenu->add("", $langs->trans("Binding"), 0, $user->rights->accounting->bind->write, '', $mainmenu, 'dispatch'); + if (! empty($conf->facture->enabled)) + { + $newmenu->add("/accountancy/customer/index.php?leftmenu=accountancy_dispatch_customer&mainmenu=accountancy", $langs->trans("CustomersVentilation"), 1, $user->rights->accounting->bind->write, '', $mainmenu, 'dispatch_customer'); + if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_customer/', $leftmenu)) { + $newmenu->add("/accountancy/customer/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_customer", $langs->trans("ToBind"), 2, $user->rights->accounting->bind->write); + $newmenu->add("/accountancy/customer/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_customer", $langs->trans("Binded"), 2, $user->rights->accounting->bind->write); + } } - } - - // Binding - $newmenu->add("", $langs->trans("Binding"), 0, $user->rights->accounting->bind->write, '', $mainmenu, 'dispatch'); - if (! empty($conf->facture->enabled)) - { - $newmenu->add("/accountancy/customer/index.php?leftmenu=accountancy_dispatch_customer&mainmenu=accountancy", $langs->trans("CustomersVentilation"), 1, $user->rights->accounting->bind->write, '', $mainmenu, 'dispatch_customer'); - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_customer/', $leftmenu)) { - $newmenu->add("/accountancy/customer/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_customer", $langs->trans("ToBind"), 2, $user->rights->accounting->bind->write); - $newmenu->add("/accountancy/customer/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_customer", $langs->trans("Binded"), 2, $user->rights->accounting->bind->write); + if (! empty($conf->supplier_invoice->enabled)) + { + $newmenu->add("/accountancy/supplier/index.php?leftmenu=accountancy_dispatch_supplier&mainmenu=accountancy", $langs->trans("SuppliersVentilation"), 1, $user->rights->accounting->bind->write, '', $mainmenu, 'dispatch_supplier'); + if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_supplier/', $leftmenu)) { + $newmenu->add("/accountancy/supplier/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_supplier", $langs->trans("ToBind"), 2, $user->rights->accounting->bind->write); + $newmenu->add("/accountancy/supplier/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_supplier", $langs->trans("Binded"), 2, $user->rights->accounting->bind->write); + } } - } - if (! empty($conf->supplier_invoice->enabled)) - { - $newmenu->add("/accountancy/supplier/index.php?leftmenu=accountancy_dispatch_supplier&mainmenu=accountancy", $langs->trans("SuppliersVentilation"), 1, $user->rights->accounting->bind->write, '', $mainmenu, 'dispatch_supplier'); - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_supplier/', $leftmenu)) { - $newmenu->add("/accountancy/supplier/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_supplier", $langs->trans("ToBind"), 2, $user->rights->accounting->bind->write); - $newmenu->add("/accountancy/supplier/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_supplier", $langs->trans("Binded"), 2, $user->rights->accounting->bind->write); + if (! empty($conf->expensereport->enabled)) + { + $newmenu->add("/accountancy/expensereport/index.php?leftmenu=accountancy_dispatch_expensereport&mainmenu=accountancy", $langs->trans("ExpenseReportsVentilation"), 1, $user->rights->accounting->bind->write, '', $mainmenu, 'dispatch_expensereport'); + if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_expensereport/', $leftmenu)) { + $newmenu->add("/accountancy/expensereport/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_expensereport", $langs->trans("ToBind"), 2, $user->rights->accounting->bind->write); + $newmenu->add("/accountancy/expensereport/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_expensereport", $langs->trans("Binded"), 2, $user->rights->accounting->bind->write); + } } - } - if (! empty($conf->expensereport->enabled)) - { - $newmenu->add("/accountancy/expensereport/index.php?leftmenu=accountancy_dispatch_expensereport&mainmenu=accountancy", $langs->trans("ExpenseReportsVentilation"), 1, $user->rights->accounting->bind->write, '', $mainmenu, 'dispatch_expensereport'); - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_expensereport/', $leftmenu)) { - $newmenu->add("/accountancy/expensereport/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_expensereport", $langs->trans("ToBind"), 2, $user->rights->accounting->bind->write); - $newmenu->add("/accountancy/expensereport/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_expensereport", $langs->trans("Binded"), 2, $user->rights->accounting->bind->write); - } - } // Journals if(! empty($conf->accounting->enabled) && ! empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') { - $newmenu->add('', $langs->trans("Journalization"), 0, $user->rights->accounting->comptarapport->lire); + $newmenu->add('', $langs->trans("RegistrationInAccounting"), 1, $user->rights->accounting->comptarapport->lire); // Multi journal $sql = "SELECT rowid, code, label, nature"; @@ -1295,7 +1266,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM { $langs->load('accountancy'); $journallabel=$langs->transnoentities($objp->label); // Labels in this table are set by loading llx_accounting_abc.sql. Label can be 'ACCOUNTING_SELL_JOURNAL', 'InventoryJournal', ... - $newmenu->add('/accountancy/journal/'.$nature.'journal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal='.$objp->rowid, $journallabel, 1, $user->rights->accounting->comptarapport->lire); + $newmenu->add('/accountancy/journal/'.$nature.'journal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal='.$objp->rowid, $journallabel, 2, $user->rights->accounting->comptarapport->lire); } $i++; } @@ -1310,22 +1281,26 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM $db->free($resql); } - // General Ledger - $newmenu->add("/accountancy/bookkeeping/list.php?mainmenu=accountancy&leftmenu=accountancy_generalledger", $langs->trans("Bookkeeping"), 0, $user->rights->accounting->mouvements->lire); + // Accounting + $newmenu->add("/accountancy/index.php?leftmenu=accountancy_accountancy", $langs->trans("Accountancy"), 0, $user->rights->accounting->mouvements->lire, '', $mainmenu, 'accountancy', 1); + + + // General Ledger + $newmenu->add("/accountancy/bookkeeping/list.php?mainmenu=accountancy&leftmenu=accountancy_accountancy", $langs->trans("Bookkeeping"), 1, $user->rights->accounting->mouvements->lire); // Balance - $newmenu->add("/accountancy/bookkeeping/balance.php?mainmenu=accountancy&leftmenu=accountancy_balance", $langs->trans("AccountBalance"), 0, $user->rights->accounting->mouvements->lire); + $newmenu->add("/accountancy/bookkeeping/balance.php?mainmenu=accountancy&leftmenu=accountancy_accountancy", $langs->trans("AccountBalance"), 1, $user->rights->accounting->mouvements->lire); // Files if (! empty($conf->global->MAIN_FEATURES_LEVEL) && $conf->global->MAIN_FEATURES_LEVEL >= 2) { - $newmenu->add("/compta/compta-files.php?mainmenu=accountancy&leftmenu=accountancy_files", $langs->trans("AccountantFiles"), 0, $user->rights->accounting->mouvements->lire); + $newmenu->add("/compta/compta-files.php?mainmenu=accountancy&leftmenu=accountancy_files", $langs->trans("AccountantFiles"), 1, $user->rights->accounting->mouvements->lire); } // Reports $langs->load("compta"); - $newmenu->add("/compta/resultat/index.php?mainmenu=accountancy&leftmenu=accountancy_report", $langs->trans("Reportings"), 0, $user->rights->accounting->comptarapport->lire, '', $mainmenu, 'ca'); + $newmenu->add("/compta/resultat/index.php?mainmenu=accountancy&leftmenu=accountancy_report", $langs->trans("Reportings"), 1, $user->rights->accounting->comptarapport->lire, '', $mainmenu, 'ca'); if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/', $leftmenu)) { $newmenu->add("/compta/resultat/index.php?leftmenu=accountancy_report", $langs->trans("MenuReportInOut"), 2, $user->rights->accounting->comptarapport->lire); @@ -1351,49 +1326,81 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM if ($modecompta) { if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/', $leftmenu)) { - $newmenu->add("/compta/stats/index.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportTurnoverCollected"), 2, $user->rights->accounting->comptarapport->lire); + $newmenu->add("/compta/stats/index.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportTurnoverCollected"), 2, $user->rights->accounting->comptarapport->lire); $newmenu->add("/compta/stats/casoc.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 3, $user->rights->accounting->comptarapport->lire); $newmenu->add("/compta/stats/cabyuser.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByUsers"), 3, $user->rights->accounting->comptarapport->lire); //$newmenu->add("/compta/stats/cabyprodserv.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByProductsAndServices"),3,$user->rights->accounting->comptarapport->lire); //$newmenu->add("/compta/stats/byratecountry.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByVatRate"),3,$user->rights->accounting->comptarapport->lire); } } - } - // Accountancy (simple) - if (! empty($conf->comptabilite->enabled)) - { - $langs->load("compta"); + // Accountancy (simple) + if (! empty($conf->comptabilite->enabled)) + { + $langs->load("compta"); - // Bilan, resultats - $newmenu->add("/compta/resultat/index.php?leftmenu=report&mainmenu=accountancy", $langs->trans("Reportings"), 0, $user->rights->compta->resultat->lire, '', $mainmenu, 'ca'); + // Bilan, resultats + $newmenu->add("/compta/resultat/index.php?leftmenu=report&mainmenu=accountancy", $langs->trans("Reportings"), 0, $user->rights->compta->resultat->lire, '', $mainmenu, 'ca'); - if ($usemenuhider || empty($leftmenu) || preg_match('/report/', $leftmenu)) { - $newmenu->add("/compta/resultat/index.php?leftmenu=report", $langs->trans("MenuReportInOut"), 1, $user->rights->compta->resultat->lire); - $newmenu->add("/compta/resultat/clientfourn.php?leftmenu=report", $langs->trans("ByCompanies"), 2, $user->rights->compta->resultat->lire); - /* On verra ca avec module compabilite expert - $newmenu->add("/compta/resultat/compteres.php?leftmenu=report","Compte de resultat",2,$user->rights->compta->resultat->lire); - $newmenu->add("/compta/resultat/bilan.php?leftmenu=report","Bilan",2,$user->rights->compta->resultat->lire); - */ - $newmenu->add("/compta/stats/index.php?leftmenu=report", $langs->trans("ReportTurnover"), 1, $user->rights->compta->resultat->lire); + if ($usemenuhider || empty($leftmenu) || preg_match('/report/', $leftmenu)) { + $newmenu->add("/compta/resultat/index.php?leftmenu=report", $langs->trans("MenuReportInOut"), 1, $user->rights->compta->resultat->lire); + $newmenu->add("/compta/resultat/clientfourn.php?leftmenu=report", $langs->trans("ByCompanies"), 2, $user->rights->compta->resultat->lire); + /* On verra ca avec module compabilite expert + $newmenu->add("/compta/resultat/compteres.php?leftmenu=report","Compte de resultat",2,$user->rights->compta->resultat->lire); + $newmenu->add("/compta/resultat/bilan.php?leftmenu=report","Bilan",2,$user->rights->compta->resultat->lire); + */ + $newmenu->add("/compta/stats/index.php?leftmenu=report", $langs->trans("ReportTurnover"), 1, $user->rights->compta->resultat->lire); - /* - $newmenu->add("/compta/stats/cumul.php?leftmenu=report","Cumule",2,$user->rights->compta->resultat->lire); - if (! empty($conf->propal->enabled)) { - $newmenu->add("/compta/stats/prev.php?leftmenu=report","Previsionnel",2,$user->rights->compta->resultat->lire); - $newmenu->add("/compta/stats/comp.php?leftmenu=report","Transforme",2,$user->rights->compta->resultat->lire); - } - */ - $newmenu->add("/compta/stats/casoc.php?leftmenu=report", $langs->trans("ByCompanies"), 2, $user->rights->compta->resultat->lire); - $newmenu->add("/compta/stats/cabyuser.php?leftmenu=report", $langs->trans("ByUsers"), 2, $user->rights->compta->resultat->lire); - $newmenu->add("/compta/stats/cabyprodserv.php?leftmenu=report", $langs->trans("ByProductsAndServices"), 2, $user->rights->compta->resultat->lire); - $newmenu->add("/compta/stats/byratecountry.php?leftmenu=report", $langs->trans("ByVatRate"), 2, $user->rights->compta->resultat->lire); + /* + $newmenu->add("/compta/stats/cumul.php?leftmenu=report","Cumule",2,$user->rights->compta->resultat->lire); + if (! empty($conf->propal->enabled)) { + $newmenu->add("/compta/stats/prev.php?leftmenu=report","Previsionnel",2,$user->rights->compta->resultat->lire); + $newmenu->add("/compta/stats/comp.php?leftmenu=report","Transforme",2,$user->rights->compta->resultat->lire); + } + */ + $newmenu->add("/compta/stats/casoc.php?leftmenu=report", $langs->trans("ByCompanies"), 2, $user->rights->compta->resultat->lire); + $newmenu->add("/compta/stats/cabyuser.php?leftmenu=report", $langs->trans("ByUsers"), 2, $user->rights->compta->resultat->lire); + $newmenu->add("/compta/stats/cabyprodserv.php?leftmenu=report", $langs->trans("ByProductsAndServices"), 2, $user->rights->compta->resultat->lire); + $newmenu->add("/compta/stats/byratecountry.php?leftmenu=report", $langs->trans("ByVatRate"), 2, $user->rights->compta->resultat->lire); - // Journaux - $newmenu->add("/compta/journal/sellsjournal.php?leftmenu=report", $langs->trans("SellsJournal"), 1, $user->rights->compta->resultat->lire, '', '', '', 50); - $newmenu->add("/compta/journal/purchasesjournal.php?leftmenu=report", $langs->trans("PurchasesJournal"), 1, $user->rights->compta->resultat->lire, '', '', '', 51); + // Journaux + $newmenu->add("/compta/journal/sellsjournal.php?leftmenu=report", $langs->trans("SellsJournal"), 1, $user->rights->compta->resultat->lire, '', '', '', 50); + $newmenu->add("/compta/journal/purchasesjournal.php?leftmenu=report", $langs->trans("PurchasesJournal"), 1, $user->rights->compta->resultat->lire, '', '', '', 51); + } + //if ($leftmenu=="ca") $newmenu->add("/compta/journaux/index.php?leftmenu=ca",$langs->trans("Journaux"),1,$user->rights->compta->resultat->lire||$user->rights->accounting->comptarapport->lire); + } + + // Configuration + $newmenu->add("/accountancy/index.php?leftmenu=accountancy_admin", $langs->trans("Setup"), 0, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin', 1); + if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/', $leftmenu)) { + $newmenu->add("/accountancy/admin/index.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("General"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_general', 10); + + // Fiscal year - Not really yet used. In a future will lock some periods. + if ($conf->global->MAIN_FEATURES_LEVEL > 1) { + $newmenu->add("/accountancy/admin/fiscalyear.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("FiscalPeriod"), 1, $user->rights->accounting->fiscalyear, '', $mainmenu, 'fiscalyear', 20); + } + + $newmenu->add("/accountancy/admin/journals_list.php?id=35&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("AccountingJournals"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_journal', 30); + $newmenu->add("/accountancy/admin/accountmodel.php?id=31&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("Pcg_version"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_chartmodel', 40); + $newmenu->add("/accountancy/admin/account.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("Chartofaccounts"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_chart', 41); + $newmenu->add("/accountancy/admin/categories_list.php?id=32&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("AccountingCategory"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_chart', 50); + $newmenu->add("/accountancy/admin/defaultaccounts.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuDefaultAccounts"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 60); + if (! empty($conf->banque->enabled)) { + $newmenu->add("/compta/bank/list.php?mainmenu=accountancy&leftmenu=accountancy_admin&search_status=-1", $langs->trans("MenuBankAccounts"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_bank', 70); + } + if (! empty($conf->facture->enabled) || ! empty($conf->fournisseur->enabled)) { + $newmenu->add("/admin/dict.php?id=10&from=accountancy&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuVatAccounts"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 80); + } + if (! empty($conf->tax->enabled)) { + $newmenu->add("/admin/dict.php?id=7&from=accountancy&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuTaxAccounts"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 90); + } + if (! empty($conf->expensereport->enabled)) { + $newmenu->add("/admin/dict.php?id=17&from=accountancy&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuExpenseReportAccounts"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 100); + } + $newmenu->add("/accountancy/admin/productaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuProductsAccounts"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_product', 110); + $newmenu->add("/accountancy/admin/closure.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuClosureAccounts"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_closure', 120); + $newmenu->add("/accountancy/admin/export.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("ExportOptions"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_export', 130); } - //if ($leftmenu=="ca") $newmenu->add("/compta/journaux/index.php?leftmenu=ca",$langs->trans("Journaux"),1,$user->rights->compta->resultat->lire||$user->rights->accounting->comptarapport->lire); } // Assets diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index 524979e610d..fc2cb928903 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -98,7 +98,8 @@ MenuLoanAccounts=Loan accounts MenuProductsAccounts=Product accounts MenuClosureAccounts=Closure accounts ProductsBinding=Products accounts -Ventilation=Binding to accounts +TransferInAccounting=Transfer in accounting +RegistrationInAccounting=Registration in accounting Binding=Binding to accounts CustomersVentilation=Customer invoice binding SuppliersVentilation=Vendor invoice binding From d92665753495b317e5b8b05addd35a1f82c316be Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Fri, 8 Mar 2019 10:57:14 +0100 Subject: [PATCH 02/44] FIX: Accountancy - Format EBP import Add doc --- .../iso-normes/Accountancy-format_Ebp_txt.pdf | Bin 0 -> 18984 bytes .../class/accountancyexport.class.php | 11 ++++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 dev/resources/iso-normes/Accountancy-format_Ebp_txt.pdf diff --git a/dev/resources/iso-normes/Accountancy-format_Ebp_txt.pdf b/dev/resources/iso-normes/Accountancy-format_Ebp_txt.pdf new file mode 100644 index 0000000000000000000000000000000000000000..24e6fca05e972989f059b0853f8215b3fc1048d8 GIT binary patch literal 18984 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 literal 0 HcmV?d00001 diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index 52b5f1c411f..6cad9372701 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -517,14 +517,19 @@ class AccountancyExport print $line->id . $separator; print $date . $separator; print $line->code_journal . $separator; - print length_accountg($line->numero_compte) . $separator; - print substr(length_accountg($line->numero_compte),0,2) . $separator; + + if (empty($line->subledger_account)) { + print $line->numero_compte . $separator; + } else { + print $line->subledger_account . $separator; + } + //print substr(length_accountg($line->numero_compte),0,2) . $separator; print '"'.dol_trunc($line->label_operation,40,'right','UTF-8',1).'"' . $separator; print '"'.dol_trunc($line->piece_num,15,'right','UTF-8',1).'"'.$separator; print price2num($line->montant).$separator; print $line->sens.$separator; print $date . $separator; - print 'EUR'; + //print 'EUR'; print $end_line; } } From 4de4f2ec6fd6fdb222dcb04e49c2e2d34b052a35 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 10 Mar 2019 21:03:51 +0100 Subject: [PATCH 03/44] Correct language --- htdocs/core/menus/standard/eldy.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 7bba891f113..b485d2604e5 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1282,7 +1282,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM } // Accounting - $newmenu->add("/accountancy/index.php?leftmenu=accountancy_accountancy", $langs->trans("Accountancy"), 0, $user->rights->accounting->mouvements->lire, '', $mainmenu, 'accountancy', 1); + $newmenu->add("/accountancy/index.php?leftmenu=accountancy_accountancy", $langs->trans("MenuAccountancy"), 0, $user->rights->accounting->mouvements->lire, '', $mainmenu, 'accountancy', 1); // General Ledger From 717cfb350a1f696b9e3725e7d0a21f3a675501ba Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Mar 2019 15:45:34 +0100 Subject: [PATCH 04/44] Typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6cb38b4bb1d..fb9126fe4ed 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ You can use a Web server and a supported database (MariaDB, MySQL or PostgreSQL) git clone https://github.com/dolibarr/dolibarr -b x.y (where x.y is main version like 3.6, 9.0, ...) -- Set up your web server to use "*dolibarr/htdocs*" as root if you'r web server does not have directory to point to already defined. +- Set up your web server to use "*dolibarr/htdocs*" as root if your web server does not have an already defined directory to point to. - Create an empty `htdocs/conf/conf.php` file and set *write* permissions for your web server user (*write* permission will be removed once install is finished) From 53a76e91b4a74c46452009af6610bb33bec63735 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Mon, 11 Mar 2019 21:25:51 +0100 Subject: [PATCH 05/44] fix missing test on method result --- htdocs/compta/resultat/result.php | 427 +++++++++++++++--------------- 1 file changed, 208 insertions(+), 219 deletions(-) diff --git a/htdocs/compta/resultat/result.php b/htdocs/compta/resultat/result.php index bd9f25bb0b8..59984ee444c 100644 --- a/htdocs/compta/resultat/result.php +++ b/htdocs/compta/resultat/result.php @@ -288,262 +288,251 @@ elseif ($modecompta=="BOOKKEEPING") $j=1; $sommes = array(); $totPerAccount = array(); - - foreach ($cats as $cat) // Loop on each group - { - if (!empty($cat['category_type'])) // category calculed + if (!is_array($cats) && $cats<0) { + setEventMessages(null,$AccCat->errors,'errors'); + } elseif (is_array($cats) && count($cats)>0) { + foreach ($cats as $cat) // Loop on each group { - // When we enter here, $sommes was filled by group of accounts + if (!empty($cat['category_type'])) // category calculed + { + // When we enter here, $sommes was filled by group of accounts - $formula = $cat['formula']; + $formula = $cat['formula']; - print ''; + print ''; - // Year NP - print ''; - print $cat['code']; - print ''; - print $cat['label']; - print ''; + // Year NP + print ''; + print $cat['code']; + print ''; + print $cat['label']; + print ''; - $vars = array(); + $vars = array(); - // Previous Fiscal year (N-1) - foreach($sommes as $code => $det){ - $vars[$code] = $det['NP']; - } - - - $result = strtr($formula, $vars); - - //var_dump($result); - //$r = $AccCat->calculate($result); - $r = dol_eval($result, 1); - //var_dump($r); - - print '' . price($r) . ''; - - // Year N - $code = $cat['code']; // code of categorie ('VTE', 'MAR', ...) - $sommes[$code]['NP'] += $r; - - // Current fiscal year (N) - if (is_array($sommes) && ! empty($sommes)){ - foreach($sommes as $code => $det){ - $vars[$code] = $det['N']; + // Previous Fiscal year (N-1) + foreach ($sommes as $code => $det) { + $vars[$code] = $det['NP']; } - } - $result = strtr($formula, $vars); - //$r = $AccCat->calculate($result); - $r = dol_eval($result, 1); + $result = strtr($formula, $vars); - print '' . price($r) . ''; - $sommes[$code]['N'] += $r; + //var_dump($result); + //$r = $AccCat->calculate($result); + $r = dol_eval($result, 1); + //var_dump($r); - // Detail by month - foreach($months as $k => $v) - { - if (($k+1) >= $date_startmonth) - { - foreach($sommes as $code => $det){ - $vars[$code] = $det['M'][$k]; - } - $result = strtr($formula, $vars); + print '' . price($r) . ''; - //$r = $AccCat->calculate($result); - $r = dol_eval($result, 1); + // Year N + $code = $cat['code']; // code of categorie ('VTE', 'MAR', ...) + $sommes[$code]['NP'] += $r; - print '' . price($r) . ''; - $sommes[$code]['M'][$k] += $r; - } - } - foreach($months as $k => $v) - { - if (($k+1) < $date_startmonth) - { - foreach($sommes as $code => $det){ - $vars[$code] = $det['M'][$k]; - } - $result = strtr($formula, $vars); - - //$r = $AccCat->calculate($result); - $r = dol_eval($result, 1); - - print '' . price($r) . ''; - $sommes[$code]['M'][$k] += $r; - } - } - - print "\n"; - - //var_dump($sommes); - } - else // normal category - { - $code = $cat['code']; // Category code we process - - $totCat = array(); - $totCat['NP'] = 0; - $totCat['N'] = 0; - $totCat['M'] = array(); - foreach($months as $k => $v) - { - $totCat['M'][$k] = 0; - } - - // Set $cpts with array of accounts in the category/group - $cpts = $AccCat->getCptsCat($cat['rowid']); - - $arrayofaccountforfilter=array(); - foreach($cpts as $i => $cpt) // Loop on each account. - { - $arrayofaccountforfilter[]=$cpt['account_number']; - } - - // N-1 - if (! empty($arrayofaccountforfilter)) - { - $return = $AccCat->getSumDebitCredit($arrayofaccountforfilter, $date_start_previous, $date_end_previous, $cat['dc']?$cat['dc']:0); - - if ($return < 0) { - setEventMessages(null, $AccCat->errors, 'errors'); - $resultNP=0; - } else { - foreach($cpts as $i => $cpt) // Loop on each account. - { - $resultNP = empty($AccCat->sdcperaccount[$cpt['account_number']])?0:$AccCat->sdcperaccount[$cpt['account_number']]; - - $totCat['NP'] += $resultNP; - $sommes[$code]['NP'] += $resultNP; - $totPerAccount[$cpt['account_number']]['NP'] = $resultNP; + // Current fiscal year (N) + if (is_array($sommes) && !empty($sommes)) { + foreach ($sommes as $code => $det) { + $vars[$code] = $det['N']; } } - } - // Set value into column N and month M ($totCat) - // This make 12 calls for each accountancy account (12 monthes M) - foreach($cpts as $i => $cpt) // Loop on each account. + $result = strtr($formula, $vars); + + //$r = $AccCat->calculate($result); + $r = dol_eval($result, 1); + + print '' . price($r) . ''; + $sommes[$code]['N'] += $r; + + // Detail by month + foreach ($months as $k => $v) { + if (($k + 1) >= $date_startmonth) { + foreach ($sommes as $code => $det) { + $vars[$code] = $det['M'][$k]; + } + $result = strtr($formula, $vars); + + //$r = $AccCat->calculate($result); + $r = dol_eval($result, 1); + + print '' . price($r) . ''; + $sommes[$code]['M'][$k] += $r; + } + } + foreach ($months as $k => $v) { + if (($k + 1) < $date_startmonth) { + foreach ($sommes as $code => $det) { + $vars[$code] = $det['M'][$k]; + } + $result = strtr($formula, $vars); + + //$r = $AccCat->calculate($result); + $r = dol_eval($result, 1); + + print '' . price($r) . ''; + $sommes[$code]['M'][$k] += $r; + } + } + + print "\n"; + + //var_dump($sommes); + } else // normal category { - // We make 1 loop for each account because we may want detail per account. - // @TODO Optimize to ask a 'group by' account and a filter with account in (..., ...) in request + $code = $cat['code']; // Category code we process - // Each month - $resultN = 0; - foreach($months as $k => $v) + $totCat = array(); + $totCat['NP'] = 0; + $totCat['N'] = 0; + $totCat['M'] = array(); + foreach ($months as $k => $v) { + $totCat['M'][$k] = 0; + } + + // Set $cpts with array of accounts in the category/group + $cpts = $AccCat->getCptsCat($cat['rowid']); + + $arrayofaccountforfilter = array(); + foreach ($cpts as $i => $cpt) // Loop on each account. { - $monthtoprocess = $k+1; // ($k+1) is month 1, 2, ..., 12 - $yeartoprocess = $start_year; - if (($k+1) < $start_month) $yeartoprocess++; + $arrayofaccountforfilter[] = $cpt['account_number']; + } + + // N-1 + if (!empty($arrayofaccountforfilter)) { + $return = $AccCat->getSumDebitCredit($arrayofaccountforfilter, $date_start_previous, $date_end_previous, $cat['dc'] ? $cat['dc'] : 0); - //var_dump($monthtoprocess.'_'.$yeartoprocess); - $return = $AccCat->getSumDebitCredit($cpt['account_number'], $date_start, $date_end, $cat['dc']?$cat['dc']:0, 'nofilter', $monthtoprocess, $yeartoprocess); if ($return < 0) { setEventMessages(null, $AccCat->errors, 'errors'); - $resultM=0; + $resultNP = 0; } else { - $resultM=$AccCat->sdc; - } - $totCat['M'][$k] += $resultM; - $sommes[$code]['M'][$k] += $resultM; - $totPerAccount[$cpt['account_number']]['M'][$k] = $resultM; + foreach ($cpts as $i => $cpt) // Loop on each account. + { + $resultNP = empty($AccCat->sdcperaccount[$cpt['account_number']]) ? 0 : $AccCat->sdcperaccount[$cpt['account_number']]; - $resultN += $resultM; + $totCat['NP'] += $resultNP; + $sommes[$code]['NP'] += $resultNP; + $totPerAccount[$cpt['account_number']]['NP'] = $resultNP; + } + } } - $totCat['N'] += $resultN; - $sommes[$code]['N'] += $resultN; - $totPerAccount[$cpt['account_number']]['N'] = $resultN; - } - - - // Now output columns for row $code ('VTE', 'MAR', ...) - - print ""; - - // Column group - print ''; - print $cat['code']; - print ''; - - // Label of group - print ''; - print $cat['label']; - if (count($cpts) > 0) // Show example of 5 first accounting accounts - { - $i=0; - foreach($cpts as $cpt) + // Set value into column N and month M ($totCat) + // This make 12 calls for each accountancy account (12 monthes M) + foreach ($cpts as $i => $cpt) // Loop on each account. { - if ($i > 5) - { - print '...)'; - break; + // We make 1 loop for each account because we may want detail per account. + // @TODO Optimize to ask a 'group by' account and a filter with account in (..., ...) in request + + // Each month + $resultN = 0; + foreach ($months as $k => $v) { + $monthtoprocess = $k + 1; // ($k+1) is month 1, 2, ..., 12 + $yeartoprocess = $start_year; + if (($k + 1) < $start_month) + $yeartoprocess++; + + //var_dump($monthtoprocess.'_'.$yeartoprocess); + $return = $AccCat->getSumDebitCredit($cpt['account_number'], $date_start, $date_end, $cat['dc'] ? $cat['dc'] : 0, 'nofilter', $monthtoprocess, $yeartoprocess); + if ($return < 0) { + setEventMessages(null, $AccCat->errors, 'errors'); + $resultM = 0; + } else { + $resultM = $AccCat->sdc; + } + $totCat['M'][$k] += $resultM; + $sommes[$code]['M'][$k] += $resultM; + $totPerAccount[$cpt['account_number']]['M'][$k] = $resultM; + + $resultN += $resultM; } - if ($i > 0) print ', '; - else print ' ('; - print $cpt['account_number']; - $i++; + + $totCat['N'] += $resultN; + $sommes[$code]['N'] += $resultN; + $totPerAccount[$cpt['account_number']]['N'] = $resultN; } - if ($i <= 5) print ')'; - } - else - { - print ' - '.$langs->trans("GroupIsEmptyCheckSetup").''; - } - print ''; - print '' . price($totCat['NP']) . ''; - print '' . price($totCat['N']) . ''; - // Each month - foreach($totCat['M'] as $k => $v){ - if (($k+1) >= $date_startmonth) print '' . price($v) . ''; - } - foreach($totCat['M'] as $k => $v){ - if (($k+1) < $date_startmonth) print '' . price($v) . ''; - } + // Now output columns for row $code ('VTE', 'MAR', ...) - print "\n"; + print ""; - // Loop on detail of all accounts to output the detail - if ($showaccountdetail != 'no') - { - foreach($cpts as $i => $cpt) + // Column group + print ''; + print $cat['code']; + print ''; + + // Label of group + print ''; + print $cat['label']; + if (count($cpts) > 0) // Show example of 5 first accounting accounts { - $resultNP=$totPerAccount[$cpt['account_number']]['NP']; - $resultN=$totPerAccount[$cpt['account_number']]['N']; - - if ($showaccountdetail == 'all' || $resultN > 0) - { - print ''; - print ''; - print ''; - print '     ' . length_accountg($cpt['account_number']); - print ' - '; - print $cpt['account_label']; - print ''; - print '' . price($resultNP) . ''; - print '' . price($resultN) . ''; - - // Make one call for each month - foreach($months as $k => $v) - { - if (($k+1) >= $date_startmonth) - { - $resultM=$totPerAccount[$cpt['account_number']]['M'][$k]; - print '' . price($resultM) . ''; - } + $i = 0; + foreach ($cpts as $cpt) { + if ($i > 5) { + print '...)'; + break; } - foreach($months as $k => $v) - { - if (($k+1) < $date_startmonth) - { - $resultM=$totPerAccount[$cpt['account_number']]['M'][$k]; - print '' . price($resultM) . ''; + if ($i > 0) + print ', '; + else print ' ('; + print $cpt['account_number']; + $i++; + } + if ($i <= 5) + print ')'; + } else { + print ' - ' . $langs->trans("GroupIsEmptyCheckSetup") . ''; + } + print ''; + + print '' . price($totCat['NP']) . ''; + print '' . price($totCat['N']) . ''; + + // Each month + foreach ($totCat['M'] as $k => $v) { + if (($k + 1) >= $date_startmonth) + print '' . price($v) . ''; + } + foreach ($totCat['M'] as $k => $v) { + if (($k + 1) < $date_startmonth) + print '' . price($v) . ''; + } + + print "\n"; + + // Loop on detail of all accounts to output the detail + if ($showaccountdetail != 'no') { + foreach ($cpts as $i => $cpt) { + $resultNP = $totPerAccount[$cpt['account_number']]['NP']; + $resultN = $totPerAccount[$cpt['account_number']]['N']; + + if ($showaccountdetail == 'all' || $resultN > 0) { + print ''; + print ''; + print ''; + print '     ' . length_accountg($cpt['account_number']); + print ' - '; + print $cpt['account_label']; + print ''; + print '' . price($resultNP) . ''; + print '' . price($resultN) . ''; + + // Make one call for each month + foreach ($months as $k => $v) { + if (($k + 1) >= $date_startmonth) { + $resultM = $totPerAccount[$cpt['account_number']]['M'][$k]; + print '' . price($resultM) . ''; + } } + foreach ($months as $k => $v) { + if (($k + 1) < $date_startmonth) { + $resultM = $totPerAccount[$cpt['account_number']]['M'][$k]; + print '' . price($resultM) . ''; + } + } + print "\n"; } - print "\n"; } } } From f326c75be7120b2b45e0330d297437c9d4245c59 Mon Sep 17 00:00:00 2001 From: Joan Louis Date: Mon, 11 Mar 2019 14:22:04 +0100 Subject: [PATCH 06/44] Update call to extrafields from cards --- htdocs/comm/propal/card.php | 4 ++-- htdocs/commande/card.php | 4 ++-- htdocs/compta/facture/card.php | 4 ++-- htdocs/compta/facture/fiche-rec.php | 4 ++-- htdocs/contrat/card.php | 4 ++-- htdocs/fichinter/card.php | 6 +++--- htdocs/fourn/commande/card.php | 4 ++-- htdocs/fourn/facture/card.php | 4 ++-- htdocs/supplier_proposal/card.php | 4 ++-- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index ed1c5c627ee..01c28fdcd31 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -763,7 +763,7 @@ if (empty($reshook)) // Extrafields $extrafieldsline = new ExtraFields($db); $extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line); - $array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline, $predef); + $array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line, $predef); // Unset extrafield if (is_array($extralabelsline)) { // Get extra fields @@ -1131,7 +1131,7 @@ if (empty($reshook)) // Extrafields $extrafieldsline = new ExtraFields($db); $extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line); - $array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline); + $array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line); // Unset extrafield if (is_array($extralabelsline)) { // Get extra fields diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 547b3803f7f..10629ec3452 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -662,7 +662,7 @@ if (empty($reshook)) // Extrafields $extrafieldsline = new ExtraFields($db); $extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line); - $array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline, $predef); + $array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line, $predef); // Unset extrafield if (is_array($extralabelsline)) { // Get extra fields @@ -1025,7 +1025,7 @@ if (empty($reshook)) // Extrafields Lines $extrafieldsline = new ExtraFields($db); $extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line); - $array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline); + $array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line); // Unset extrafield POST Data if (is_array($extralabelsline)) { foreach ($extralabelsline as $key => $value) { diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index e37d2c3d2a9..9627aa54f24 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1686,7 +1686,7 @@ if (empty($reshook)) // Extrafields $extrafieldsline = new ExtraFields($db); $extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line); - $array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline, $predef); + $array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line, $predef); // Unset extrafield if (is_array($extralabelsline)) { // Get extra fields @@ -2095,7 +2095,7 @@ if (empty($reshook)) // Extrafields $extrafieldsline = new ExtraFields($db); $extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line); - $array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline); + $array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line); // Unset extrafield if (is_array($extralabelsline)) { // Get extra fields diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php index a96e2f5017e..8c45012085d 100644 --- a/htdocs/compta/facture/fiche-rec.php +++ b/htdocs/compta/facture/fiche-rec.php @@ -452,7 +452,7 @@ if (empty($reshook)) // Extrafields $extrafieldsline = new ExtraFields($db); $extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line); - $array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline, $predef); + $array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line, $predef); // Unset extrafield if (is_array($extralabelsline)) { @@ -773,7 +773,7 @@ if (empty($reshook)) // Extrafields $extrafieldsline = new ExtraFields($db); $extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line); - $array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline); + $array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line); $objectline = new FactureLigneRec($db); if ($objectline->fetch(GETPOST('lineid'))) diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 6362759e6d0..6654d50d8ac 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -457,7 +457,7 @@ if (empty($reshook)) // Extrafields $extrafieldsline = new ExtraFields($db); $extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line); - $array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline, $predef); + $array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line, $predef); // Unset extrafield if (is_array($extralabelsline)) { // Get extra fields @@ -738,7 +738,7 @@ if (empty($reshook)) // Extrafields $extrafieldsline = new ExtraFields($db); $extralabelsline = $extrafieldsline->fetch_name_optionals_label($objectline->table_element); - $array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline, $predef); + $array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line, $predef); $objectline->array_options=$array_options; // TODO verifier price_min si fk_product et multiprix diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 756613d6a8f..4c1b414122a 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -363,7 +363,7 @@ if (empty($reshook)) // Extrafields $extrafieldsline = new ExtraFields($db); $extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line); - $array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline, $predef); + $array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line, $predef); $result = $object->addline( $user, @@ -508,7 +508,7 @@ if (empty($reshook)) // Extrafields $extrafieldsline = new ExtraFields($db); $extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line); - $array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline); + $array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line); $result=$object->addline( $user, @@ -621,7 +621,7 @@ if (empty($reshook)) // Extrafields $extrafieldsline = new ExtraFields($db); $extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line); - $array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline); + $array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line); $objectline->array_options = $array_options; $result = $objectline->update($user); diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 47cdf4a3c53..67acd23b633 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -308,7 +308,7 @@ if (empty($reshook)) // Extrafields $extrafieldsline = new ExtraFields($db); $extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line); - $array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline, $predef); + $array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line, $predef); // Unset extrafield if (is_array($extralabelsline)) { // Get extra fields @@ -618,7 +618,7 @@ if (empty($reshook)) // Extrafields Lines $extrafieldsline = new ExtraFields($db); $extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line); - $array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline); + $array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line); // Unset extrafield POST Data if (is_array($extralabelsline)) { foreach ($extralabelsline as $key => $value) { diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 2f95dc82eab..a7b6fe32fb1 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -1054,7 +1054,7 @@ if (empty($reshook)) // Extrafields Lines $extrafieldsline = new ExtraFields($db); $extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line); - $array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline); + $array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line); // Unset extrafield POST Data if (is_array($extralabelsline)) { foreach ($extralabelsline as $key => $value) { @@ -1131,7 +1131,7 @@ if (empty($reshook)) // Extrafields $extrafieldsline = new ExtraFields($db); $extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line); - $array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline, $predef); + $array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line, $predef); // Unset extrafield if (is_array($extralabelsline)) { // Get extra fields diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 5f53e8de6c8..85297634ec3 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -551,7 +551,7 @@ if (empty($reshook)) // Extrafields $extrafieldsline = new ExtraFields($db); $extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line); - $array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline, $predef); + $array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line, $predef); // Unset extrafield if (is_array($extralabelsline)) { // Get extra fields @@ -819,7 +819,7 @@ if (empty($reshook)) // Extrafields $extrafieldsline = new ExtraFields($db); $extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line); - $array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline); + $array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line); // Unset extrafield if (is_array($extralabelsline)) { // Get extra fields From 94c58072d74cc7f671448dfd92c8ba587144228d Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 12 Mar 2019 07:29:29 +0100 Subject: [PATCH 07/44] FIX possibility to set up payment mode when invoice module is disabled --- htdocs/admin/facture.php | 24 +++---- htdocs/admin/propal.php | 132 +++++++++++++++++++++++++++++++++++++-- 2 files changed, 138 insertions(+), 18 deletions(-) diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php index 46a11e363fd..0764f86dfb1 100644 --- a/htdocs/admin/facture.php +++ b/htdocs/admin/facture.php @@ -78,7 +78,7 @@ if ($action == 'updateMask') } } -if ($action == 'specimen') +else if ($action == 'specimen') { $modele=GETPOST('module','alpha'); @@ -164,7 +164,7 @@ else if ($action == 'setmod') dolibarr_set_const($db, "FACTURE_ADDON",$value,'chaine',0,'',$conf->entity); } -if ($action == 'setribchq') +else if ($action == 'setribchq') { $rib = GETPOST('rib','alpha'); $chq = GETPOST('chq','alpha'); @@ -184,7 +184,7 @@ if ($action == 'setribchq') } } -if ($action == 'set_FACTURE_DRAFT_WATERMARK') +else if ($action == 'set_FACTURE_DRAFT_WATERMARK') { $draft = GETPOST('FACTURE_DRAFT_WATERMARK','alpha'); @@ -202,7 +202,7 @@ if ($action == 'set_FACTURE_DRAFT_WATERMARK') } } -if ($action == 'set_INVOICE_FREE_TEXT') +else if ($action == 'set_INVOICE_FREE_TEXT') { $freetext = GETPOST('INVOICE_FREE_TEXT','none'); // No alpha here, we want exact string @@ -220,7 +220,7 @@ if ($action == 'set_INVOICE_FREE_TEXT') } } -if ($action == 'setforcedate') +else if ($action == 'setforcedate') { $forcedate = GETPOST('forcedate','alpha'); @@ -238,20 +238,20 @@ if ($action == 'setforcedate') } } -if ($action == 'setDefaultPDFModulesByType') +else if ($action == 'setDefaultPDFModulesByType') { $invoicetypemodels = GETPOST('invoicetypemodels'); - + if(!empty($invoicetypemodels) && is_array($invoicetypemodels)) { $error = 0; - + foreach ($invoicetypemodels as $type => $value) { $res = dolibarr_set_const($db, 'FACTURE_ADDON_PDF_'.intval($type),$value,'chaine',0,'',$conf->entity); if (! $res > 0) $error++; } - + if (! $error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); @@ -621,7 +621,7 @@ if(!empty($conf->global->INVOICE_USE_DEFAULT_DOCUMENT)) // Hidden conf print ''.$langs->trans("Name").''; print ''; print "\n"; - + $listtype=array( Facture::TYPE_STANDARD=>$langs->trans("InvoiceStandard"), Facture::TYPE_REPLACEMENT=>$langs->trans("InvoiceReplacement"), @@ -632,7 +632,7 @@ if(!empty($conf->global->INVOICE_USE_DEFAULT_DOCUMENT)) // Hidden conf { $listtype[Facture::TYPE_SITUATION] = $langs->trans("InvoiceSituation"); } - + foreach ($listtype as $type => $trans) { $thisTypeConfName = 'FACTURE_ADDON_PDF_'.$type; @@ -642,7 +642,7 @@ if(!empty($conf->global->INVOICE_USE_DEFAULT_DOCUMENT)) // Hidden conf print ''.$form->selectarray('invoicetypemodels['.$type.']', ModelePDFFactures::liste_modeles($db), $current,0,0, 0).''; print "\n"; } - + print ''; print ""; } diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php index cf860cd64ba..81fdd4d534e 100644 --- a/htdocs/admin/propal.php +++ b/htdocs/admin/propal.php @@ -70,7 +70,7 @@ if ($action == 'updateMask') } } -if ($action == 'specimen') +else if ($action == 'specimen') { $modele=GETPOST('module','alpha'); @@ -115,7 +115,27 @@ if ($action == 'specimen') } } -if ($action == 'set_PROPALE_DRAFT_WATERMARK') +else if ($action == 'setribchq') +{ + $rib = GETPOST('rib','alpha'); + $chq = GETPOST('chq','alpha'); + + $res = dolibarr_set_const($db, "FACTURE_RIB_NUMBER",$rib,'chaine',0,'',$conf->entity); + $res = dolibarr_set_const($db, "FACTURE_CHQ_NUMBER",$chq,'chaine',0,'',$conf->entity); + + if (! $res > 0) $error++; + + if (! $error) + { + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } + else + { + setEventMessages($langs->trans("Error"), null, 'errors'); + } +} + +else if ($action == 'set_PROPALE_DRAFT_WATERMARK') { $draft = GETPOST('PROPALE_DRAFT_WATERMARK','alpha'); @@ -132,7 +152,7 @@ if ($action == 'set_PROPALE_DRAFT_WATERMARK') } } -if ($action == 'set_PROPOSAL_FREE_TEXT') +else if ($action == 'set_PROPOSAL_FREE_TEXT') { $freetext = GETPOST('PROPOSAL_FREE_TEXT','none'); // No alpha here, we want exact string @@ -150,7 +170,7 @@ if ($action == 'set_PROPOSAL_FREE_TEXT') } } -if ($action == 'setdefaultduration') +else if ($action == 'setdefaultduration') { $res = dolibarr_set_const($db, "PROPALE_VALIDITY_DURATION",$value,'chaine',0,'',$conf->entity); @@ -166,7 +186,7 @@ if ($action == 'setdefaultduration') } } -if ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL') +else if ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL') { $res = dolibarr_set_const($db, "BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL",$value,'chaine',0,'',$conf->entity); @@ -183,7 +203,7 @@ if ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL') } // Activate a model -if ($action == 'set') +else if ($action == 'set') { $ret = addDocumentModel($value, $type, $label, $scandir); } @@ -499,6 +519,106 @@ foreach ($dirmodels as $reldir) } print ''; + +/* + * Payment mode + */ +if (! empty($conf->banque->enabled) && empty($conf->facture->enabled)) +{ + print '
'; + print load_fiche_titre($langs->trans("SuggestedPaymentModesIfNotDefinedInInvoice"),'',''); + + print '
'; + print ''; + + print ''; + + print ''; + print ''; + print ''; + print "\n"; + + print ''; + print ""; + print ""; + + print ''; + print ""; + print ""; + print "
'; + print ''; + print $langs->trans("PaymentMode").'
".$langs->trans("SuggestPaymentByRIBOnAccount").""; + if (! empty($conf->banque->enabled)) + { + $sql = "SELECT rowid, label"; + $sql.= " FROM ".MAIN_DB_PREFIX."bank_account"; + $sql.= " WHERE clos = 0"; + $sql.= " AND courant = 1"; + $sql.= " AND entity IN (".getEntity('bank_account').")"; + $resql=$db->query($sql); + if ($resql) + { + $num = $db->num_rows($resql); + $i = 0; + if ($num > 0) + { + print '"; + } + else + { + print "".$langs->trans("NoActiveBankAccountDefined").""; + } + } + } + else + { + print $langs->trans("BankModuleNotActive"); + } + print "
".$langs->trans("SuggestPaymentByChequeToAddress").""; + print '"; + print "
"; + print "
"; +} + print '
'; From 259fa0ac812b5a2bedd9d29116b239d49728e824 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 12 Mar 2019 07:42:25 +0100 Subject: [PATCH 08/44] FIX check only if invoice module is enabled (bank is check after) --- htdocs/admin/propal.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php index 81fdd4d534e..df0583d1803 100644 --- a/htdocs/admin/propal.php +++ b/htdocs/admin/propal.php @@ -523,7 +523,7 @@ print ''; /* * Payment mode */ -if (! empty($conf->banque->enabled) && empty($conf->facture->enabled)) +if (empty($conf->facture->enabled)) { print '
'; print load_fiche_titre($langs->trans("SuggestedPaymentModesIfNotDefinedInInvoice"),'',''); From 47057b431d427443cd5f59f451198d2c00ea561b Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 12 Mar 2019 07:56:22 +0100 Subject: [PATCH 09/44] FIX translation --- htdocs/admin/propal.php | 2 +- htdocs/langs/en_US/admin.lang | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php index df0583d1803..eca6aaab778 100644 --- a/htdocs/admin/propal.php +++ b/htdocs/admin/propal.php @@ -526,7 +526,7 @@ print ''; if (empty($conf->facture->enabled)) { print '
'; - print load_fiche_titre($langs->trans("SuggestedPaymentModesIfNotDefinedInInvoice"),'',''); + print load_fiche_titre($langs->trans("SuggestedPaymentModesIfNotDefinedInProposal"),'',''); print '
'; print ''; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 9c8c3d60854..b50e25f50d4 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1245,6 +1245,7 @@ SupplierPaymentSetup=Suppliers payments setup PropalSetup=Commercial proposals module setup ProposalsNumberingModules=Commercial proposal numbering models ProposalsPDFModules=Commercial proposal documents models +SuggestedPaymentModesIfNotDefinedInProposal=Suggested payments mode on proposal by default if not defined for proposal FreeLegalTextOnProposal=Free text on commercial proposals WatermarkOnDraftProposal=Watermark on draft commercial proposals (none if empty) BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL=Ask for bank account destination of proposal From 281bde5461e51190fa38d728a2b4a49aeb858eba Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Mar 2019 11:03:11 +0100 Subject: [PATCH 10/44] Debug modulebuilder --- htdocs/modulebuilder/admin/setup.php | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/htdocs/modulebuilder/admin/setup.php b/htdocs/modulebuilder/admin/setup.php index be644a1f2e4..14bfbba347c 100644 --- a/htdocs/modulebuilder/admin/setup.php +++ b/htdocs/modulebuilder/admin/setup.php @@ -81,10 +81,7 @@ $form = new Form($db); llxHeader('', $langs->trans("ModulebuilderSetup")); -$linkback = ''; -if (GETPOST('withtab', 'alpha')) { - $linkback = '' . $langs->trans("BackToModuleList") . ''; -} +$linkback = '' . $langs->trans("BackToModuleList") . ''; print ''; print ''; @@ -103,7 +100,7 @@ print '
'; print ''; print ''; -print ''; +print ''; print ''; print "\n"; @@ -125,20 +122,6 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) } } print ''; - - print ''; - print ''; - print ''; } print ''; From da2aba96eb4663f587472271932137d3decc20f8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Mar 2019 11:51:20 +0100 Subject: [PATCH 11/44] Can setup tool to build html or pdf for module builder documentation --- htdocs/core/class/utils.class.php | 23 ++++++++++++++++++----- htdocs/modulebuilder/admin/setup.php | 26 +++++++++++++++++++++++--- 2 files changed, 41 insertions(+), 8 deletions(-) diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php index a5a3bd8aca9..4e6a989e12f 100644 --- a/htdocs/core/class/utils.class.php +++ b/htdocs/core/class/utils.class.php @@ -611,7 +611,8 @@ class Utils if (count($arrayversion)) { $FILENAMEASCII=strtolower($module).'.asciidoc'; - $FILENAMEDOC=strtolower($module).'.html'; // TODO Use/text PDF + $FILENAMEDOC=strtolower($module).'.html'; + $FILENAMEDOCPDF=strtolower($module).'.pdf'; $dirofmodule = dol_buildpath(strtolower($module), 0); $dirofmoduledoc = dol_buildpath(strtolower($module), 0).'/doc'; @@ -627,8 +628,7 @@ class Utils return -1; } - $conf->global->MODULEBUILDER_ASCIIDOCTOR='asciidoctor'; - if (empty($conf->global->MODULEBUILDER_ASCIIDOCTOR)) + if (empty($conf->global->MODULEBUILDER_ASCIIDOCTOR) && empty($conf->global->MODULEBUILDER_ASCIIDOCTORPDF)) { $this->error = 'Setup of module ModuleBuilder not complete'; return -1; @@ -690,11 +690,13 @@ class Utils $currentdir = getcwd(); chdir($dirofmodule); + require_once DOL_DOCUMENT_ROOT.'/core/class/utils.class.php'; + $utils = new Utils($db); + + // Build HTML doc $command=$conf->global->MODULEBUILDER_ASCIIDOCTOR.' '.$destfile.' -n -o '.$dirofmoduledoc.'/'.$FILENAMEDOC; $outfile=$dirofmoduletmp.'/out.tmp'; - require_once DOL_DOCUMENT_ROOT.'/core/class/utils.class.php'; - $utils = new Utils($db); $resarray = $utils->executeCLI($command, $outfile); if ($resarray['result'] != '0') { @@ -702,6 +704,17 @@ class Utils } $result = ($resarray['result'] == 0) ? 1 : 0; + // Build PDF doc + $command=$conf->global->MODULEBUILDER_ASCIIDOCTORPDF.' '.$destfile.' -n -o '.$dirofmoduledoc.'/'.$FILENAMEDOC; + $outfile=$dirofmoduletmp.'/outpdf.tmp'; + + $resarray = $utils->executeCLI($command, $outfile); + if ($resarray['result'] != '0') + { + $this->error = $resarray['error'].' '.$resarray['output']; + } + $result = ($resarray['result'] == 0) ? 1 : 0; + chdir($currentdir); } else diff --git a/htdocs/modulebuilder/admin/setup.php b/htdocs/modulebuilder/admin/setup.php index 14bfbba347c..dfe8f681985 100644 --- a/htdocs/modulebuilder/admin/setup.php +++ b/htdocs/modulebuilder/admin/setup.php @@ -35,9 +35,12 @@ $backtopage = GETPOST('backtopage', 'alpha'); /* * Actions */ -if ($action=="update"){ - $res1=dolibarr_set_const($db, 'MODULEBUILDER_SPECIFIC_README', GETPOST('MODULEBUILDER_SPECIFIC_README'), 'chaine', 0, '', $conf->entity); - if ($res1 < 0) { +if ($action=="update") +{ + $res1=dolibarr_set_const($db, 'MODULEBUILDER_SPECIFIC_README', GETPOST('MODULEBUILDER_SPECIFIC_README', 'none'), 'chaine', 0, '', $conf->entity); + $res2=dolibarr_set_const($db, 'MODULEBUILDER_ASCIIDOCTOR', GETPOST('MODULEBUILDER_ASCIIDOCTOR', 'nohtml'), 'chaine', 0, '', $conf->entity); + $res3=dolibarr_set_const($db, 'MODULEBUILDER_ASCIIDOCTORPDF', GETPOST('MODULEBUILDER_ASCIIDOCTORPDF', 'nohtml'), 'chaine', 0, '', $conf->entity); + if ($res1 < 0 || $res2 < 0 || $res3 < 0) { setEventMessages('ErrorFailedToSaveDate', null, 'errors'); $db->rollback(); } @@ -130,6 +133,23 @@ print ''; print ''; + +print ''; +print ''; +print ''; +print ''; + +print ''; +print ''; +print ''; +print ''; + print '
' . $langs->trans("Key") . '' . $langs->trans("Key") . '' . $langs->trans("Value") . '
' . $langs->trans("UseDocFolder") . ''; - if ($conf->use_javascript_ajax) { - print ajax_constantonoff('MODULEBUILDER_USE_DOCFOLDER'); - } else { - if (empty($conf->global->MODULEBUILDER_USE_DOCFOLDER)) { - print '' . img_picto($langs->trans("Disabled"), 'off') . ''; - } else { - print '' . img_picto($langs->trans("Enabled"), 'on') . ''; - } - } - print '
'; print ''; print '
' . $langs->trans("AsciiToHtmlConverter") . ''; +print ''; +print ' '.$langs->trans("Example").': asciidoc, asciidoctor'; +print '
' . $langs->trans("AsciiToPdfConverter") . ''; +print ''; +print ' '.$langs->trans("Example").': asciidoctor-pdf'; +print '
'; print '
'; From 7d82073eaba857adf7b2d12a9cb1a8a2eedbf302 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Mar 2019 11:57:55 +0100 Subject: [PATCH 12/44] Use fontawesome for icon "setup". --- htdocs/core/lib/functions.lib.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index f223982ba6e..2a3410eae56 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2980,7 +2980,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ //if (in_array($picto, array('switch_off', 'switch_on', 'off', 'on'))) if (empty($srconly) && in_array($pictowithoutext, array( 'bank', 'close_title', 'delete', 'edit', 'ellipsis-h', 'filter', 'grip', 'grip_title', 'list', 'listlight', 'off', 'on', 'play', 'playdisabled', 'printer', 'resize', - 'note', 'sign-out', 'split', 'switch_off', 'switch_on', 'unlink', 'uparrow', '1downarrow', '1uparrow', '1leftarrow', '1rightarrow', + 'note', 'setup', 'sign-out', 'split', 'switch_off', 'switch_on', 'unlink', 'uparrow', '1downarrow', '1uparrow', '1leftarrow', '1rightarrow', 'jabber','skype','twitter','facebook','linkedin' ) )) { @@ -2989,7 +2989,11 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ $fakey = $pictowithoutext; $facolor = ''; $fasize = ''; $marginleftonlyshort = 2; - if ($pictowithoutext == 'switch_off') { + if ($pictowithoutext == 'setup') { + $fakey = 'fa-cog'; + $fasize = '1.4em'; + } + elseif ($pictowithoutext == 'switch_off') { $fakey = 'fa-toggle-off'; $facolor = '#999'; $fasize = '2em'; From a50e2898ebf58e626db31d71a34683572ddfa96d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Mar 2019 13:09:31 +0100 Subject: [PATCH 13/44] Fix bom --- htdocs/bom/bom_card.php | 2 +- htdocs/bom/bom_document.php | 4 ++-- htdocs/bom/bom_list.php | 2 +- htdocs/bom/bom_note.php | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index 19d7fdaa60b..3a1c3295bbd 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -27,7 +27,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/bom/class/bom.class.php'; -require_once DOL_DOCUMENT_ROOT.'/bom/lib/bom_bom.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/bom/lib/bom.lib.php'; // Load translation files required by the page $langs->loadLangs(array("mrp","other")); diff --git a/htdocs/bom/bom_document.php b/htdocs/bom/bom_document.php index ff8887bb4e8..197b9779988 100644 --- a/htdocs/bom/bom_document.php +++ b/htdocs/bom/bom_document.php @@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/bom/class/bom.class.php'; -require_once DOL_DOCUMENT_ROOT.'/bom/lib/bom_bom.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/bom/lib/bom.lib.php'; // Load translation files required by the page $langs->loadLangs(array("mrp","companies","other","mails")); @@ -58,7 +58,7 @@ if (! $sortfield) $sortfield="name"; //if (! $sortfield) $sortfield="position_name"; // Initialize technical objects -$object=new BillOfMaterials($db); +$object=new BOM($db); $extrafields = new ExtraFields($db); $diroutputmassaction=$conf->bom->dir_output . '/temp/massgeneration/'.$user->id; $hookmanager->initHooks(array('bomdocument', 'globalcard')); // Note that conf->hooks_modules contains array diff --git a/htdocs/bom/bom_list.php b/htdocs/bom/bom_list.php index cf9ad7ffaf2..9d7c00caf67 100644 --- a/htdocs/bom/bom_list.php +++ b/htdocs/bom/bom_list.php @@ -332,7 +332,7 @@ print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sort // Add code for pre mass action (confirmation or email presend form) $topicmail="SendBillOfMaterialsRef"; $modelmail="bom"; -$objecttmp=new BillOfMaterials($db); +$objecttmp=new BOM($db); $trackid='xxxx'.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; diff --git a/htdocs/bom/bom_note.php b/htdocs/bom/bom_note.php index 4c45512c064..75232a74d42 100644 --- a/htdocs/bom/bom_note.php +++ b/htdocs/bom/bom_note.php @@ -25,7 +25,7 @@ // Load Dolibarr environment require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/bom/class/bom.class.php'; -require_once DOL_DOCUMENT_ROOT.'/bom/lib/bom_bom.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/bom/lib/bom.lib.php'; // Load translation files required by the page $langs->loadLangs(array("mrp","companies")); @@ -38,7 +38,7 @@ $cancel = GETPOST('cancel', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); // Initialize technical objects -$object=new BillOfMaterials($db); +$object=new BOM($db); $extrafields = new ExtraFields($db); $diroutputmassaction=$conf->bom->dir_output . '/temp/massgeneration/'.$user->id; $hookmanager->initHooks(array('bomnote','globalcard')); // Note that conf->hooks_modules contains array From 30c327c702281a782e4537fefe3fb0e6e91c57e7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Mar 2019 17:19:58 +0100 Subject: [PATCH 14/44] CSS --- htdocs/societe/list.php | 46 ++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 28a9b283d6d..7e106f387ae 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -662,76 +662,76 @@ if (! empty($arrayfields['s.nom']['checked'])) { print ''; if (! empty($search_nom_only) && empty($search_nom)) $search_nom=$search_nom_only; - print ''; + print ''; print ''; } if (! empty($arrayfields['s.name_alias']['checked'])) { print ''; - print ''; + print ''; print ''; } // Barcode if (! empty($arrayfields['s.barcode']['checked'])) { print ''; - print ''; + print ''; print ''; } // Customer code if (! empty($arrayfields['s.code_client']['checked'])) { print ''; - print ''; + print ''; print ''; } // Supplier code if (! empty($arrayfields['s.code_fournisseur']['checked'])) { print ''; - print ''; + print ''; print ''; } // Account Customer code if (! empty($arrayfields['s.code_compta']['checked'])) { print ''; - print ''; + print ''; print ''; } // Account Supplier code if (! empty($arrayfields['s.code_compta_fournisseur']['checked'])) { print ''; - print ''; + print ''; print ''; } // Town if (! empty($arrayfields['s.town']['checked'])) { print ''; - print ''; + print ''; print ''; } // Zip if (! empty($arrayfields['s.zip']['checked'])) { print ''; - print ''; + print ''; print ''; } // State if (! empty($arrayfields['state.nom']['checked'])) { print ''; - print ''; + print ''; print ''; } // Region if (! empty($arrayfields['region.nom']['checked'])) { print ''; - print ''; + print ''; print ''; } // Country @@ -759,77 +759,77 @@ if (! empty($arrayfields['s.email']['checked'])) { // Email print ''; - print ''; + print ''; print ''; } if (! empty($arrayfields['s.phone']['checked'])) { // Phone print ''; - print ''; + print ''; print ''; } if (! empty($arrayfields['s.fax']['checked'])) { // Fax print ''; - print ''; + print ''; print ''; } if (! empty($arrayfields['s.url']['checked'])) { // Url print ''; - print ''; + print ''; print ''; } if (! empty($arrayfields['s.siren']['checked'])) { // IdProf1 print ''; - print ''; + print ''; print ''; } if (! empty($arrayfields['s.siret']['checked'])) { // IdProf2 print ''; - print ''; + print ''; print ''; } if (! empty($arrayfields['s.ape']['checked'])) { // IdProf3 print ''; - print ''; + print ''; print ''; } if (! empty($arrayfields['s.idprof4']['checked'])) { // IdProf4 print ''; - print ''; + print ''; print ''; } if (! empty($arrayfields['s.idprof5']['checked'])) { // IdProf5 print ''; - print ''; + print ''; print ''; } if (! empty($arrayfields['s.idprof6']['checked'])) { // IdProf6 print ''; - print ''; + print ''; print ''; } if (! empty($arrayfields['s.tva_intra']['checked'])) { // Vat number print ''; - print ''; + print ''; print ''; } @@ -863,7 +863,7 @@ if (! empty($arrayfields['s.fk_stcomm']['checked'])) if (! empty($arrayfields['s2.nom']['checked'])) { print ''; - print ''; + print ''; print ''; } // Extra fields From fe6b682ec0f8700e534c446112b0cad8de4d1100 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Mar 2019 17:45:19 +0100 Subject: [PATCH 15/44] NEW Add visibility with value 4 in framework to define fields to show on forms and list but not on creation forms. --- htdocs/bom/bom_card.php | 2 -- htdocs/bom/class/bom.class.php | 4 ++-- htdocs/core/menus/standard/eldy.lib.php | 4 ++-- htdocs/core/tpl/commonfields_edit.tpl.php | 2 +- htdocs/core/tpl/commonfields_view.tpl.php | 2 +- htdocs/langs/en_US/modulebuilder.lang | 2 +- htdocs/langs/en_US/mrp.lang | 5 +++-- htdocs/modulebuilder/template/class/myobject.class.php | 2 +- 8 files changed, 11 insertions(+), 12 deletions(-) diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index 3a1c3295bbd..7605dcae9c5 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -72,8 +72,6 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be inclu /* * Actions - * - * Put here all code to do according to value of "action" parameter */ $parameters=array(); diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index 606693bbed6..349d4b03552 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -64,7 +64,7 @@ class BOM extends CommonObject * 'type' if the field format. * 'label' the translation key. * 'enabled' is a condition when the field must be managed. - * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only. Using a negative value means field is not shown by default on list but can be selected for viewing) + * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). Using a negative value means field is not shown by default on list but can be selected for viewing) * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0). * 'default' is a default value for creation (can still be replaced by the global setup of default values) * 'index' if we want an index in database. @@ -85,7 +85,7 @@ class BOM extends CommonObject */ public $fields=array( 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'position'=>1, 'notnull'=>1, 'index'=>1, 'comment'=>"Id",), - 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'position'=>10, 'notnull'=>1, 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of BOM", 'showoncombobox'=>'1',), + 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>4, 'position'=>10, 'notnull'=>1, 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of BOM", 'showoncombobox'=>'1',), 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'notnull'=>1, 'searchall'=>1, 'showoncombobox'=>'1',), 'description' => array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>-1, 'position'=>60, 'notnull'=>-1,), 'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>-1, 'position'=>61, 'notnull'=>-1,), diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 968abcb0687..2c32517285a 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1587,7 +1587,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM $newmenu->add("/expedition/stats/index.php?leftmenu=sendings", $langs->trans("Statistics"), 1, $user->rights->expedition->lire); } - // Receptions + // Receptions if (! empty($conf->reception->enabled)) { $langs->load("receptions"); @@ -1611,7 +1611,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM { $langs->load("mrp"); - $newmenu->add("", $langs->trans("BOM"), 0, $user->rights->service->lire, '', $mainmenu, 'service'); + $newmenu->add("", $langs->trans("MenuBOM"), 0, $user->rights->service->lire, '', $mainmenu, 'service'); $newmenu->add("/bom/bom_card.php?leftmenu=bom&action=create", $langs->trans("NewBOM"), 1, $user->rights->bom->write); $newmenu->add("/bom/bom_list.php?leftmenu=bom", $langs->trans("List"), 1, $user->rights->bom->read); } diff --git a/htdocs/core/tpl/commonfields_edit.tpl.php b/htdocs/core/tpl/commonfields_edit.tpl.php index 4984c2d938e..d6b70d86a2d 100644 --- a/htdocs/core/tpl/commonfields_edit.tpl.php +++ b/htdocs/core/tpl/commonfields_edit.tpl.php @@ -38,7 +38,7 @@ $object->fields = dol_sort_array($object->fields, 'position'); foreach($object->fields as $key => $val) { // Discard if extrafield is a hidden field on form - if (abs($val['visible']) != 1) continue; + if (abs($val['visible']) != 1 && abs($val['visible']) != 4) continue; if (array_key_exists('enabled', $val) && isset($val['enabled']) && ! verifCond($val['enabled'])) continue; // We don't want this field diff --git a/htdocs/core/tpl/commonfields_view.tpl.php b/htdocs/core/tpl/commonfields_view.tpl.php index b6b2e572e49..c7a61328c68 100644 --- a/htdocs/core/tpl/commonfields_view.tpl.php +++ b/htdocs/core/tpl/commonfields_view.tpl.php @@ -40,7 +40,7 @@ $object->fields = dol_sort_array($object->fields, 'position'); foreach($object->fields as $key => $val) { // Discard if extrafield is a hidden field on form - if (abs($val['visible']) != 1) continue; + if (abs($val['visible']) != 1 && abs($val['visible']) != 4) continue; if (array_key_exists('enabled', $val) && isset($val['enabled']) && ! verifCond($val['enabled'])) continue; // We don't want this field if (in_array($key, array('ref','status'))) continue; // Ref and status are already in dol_banner diff --git a/htdocs/langs/en_US/modulebuilder.lang b/htdocs/langs/en_US/modulebuilder.lang index a8af38d5240..371bc0c6ee5 100644 --- a/htdocs/langs/en_US/modulebuilder.lang +++ b/htdocs/langs/en_US/modulebuilder.lang @@ -76,7 +76,7 @@ ListOfMenusEntries=List of menu entries ListOfPermissionsDefined=List of defined permissions SeeExamples=See examples here EnabledDesc=Condition to have this field active (Examples: 1 or $conf->global->MYMODULE_MYOPTION) -VisibleDesc=Is the field visible ? (Examples: 0=Never visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only. Using a negative value means field is not shown by default on list but can be selected for viewing). It can be an expression, for example: preg_match('/public/', $_SERVER['PHP_SELF'])?0:1 +VisibleDesc=Is the field visible ? (Examples: 0=Never visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). Using a negative value means field is not shown by default on list but can be selected for viewing). It can be an expression, for example: preg_match('/public/', $_SERVER['PHP_SELF'])?0:1 IsAMeasureDesc=Can the value of field be cumulated to get a total into list? (Examples: 1 or 0) SearchAllDesc=Is the field used to make a search from the quick search tool? (Examples: 1 or 0) SpecDefDesc=Enter here all documentation you want to provide with your module that is not already defined by other tabs. You can use .md or better, the rich .asciidoc syntax. diff --git a/htdocs/langs/en_US/mrp.lang b/htdocs/langs/en_US/mrp.lang index 68e84aee8e3..77975a4333a 100644 --- a/htdocs/langs/en_US/mrp.lang +++ b/htdocs/langs/en_US/mrp.lang @@ -1,6 +1,7 @@ +MenuBOM=Bills Of Materials BOMsSetup=Setup of module BOM -ListOfBOMs=List of BOMs -NewBOM=New BOM +ListOfBOMs=List of Bills Of Materials +NewBOM=New bill of material ProductBOMHelp=Product to create with this BOM BOMsNumberingModules=BOMs numbering templates BOMsModelModule=BOMS document templates diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index e23177dca11..bb29c13f46f 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -62,7 +62,7 @@ class MyObject extends CommonObject * 'type' if the field format. * 'label' the translation key. * 'enabled' is a condition when the field must be managed. - * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only. Using a negative value means field is not shown by default on list but can be selected for viewing) + * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). Using a negative value means field is not shown by default on list but can be selected for viewing) * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0). * 'default' is a default value for creation (can still be replaced by the global setup of default values) * 'index' if we want an index in database. From c2063c5d0b4eaddb8d189700228d12db8d3a6ebb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Mar 2019 18:24:55 +0100 Subject: [PATCH 16/44] Fix bad translation --- htdocs/langs/fr_FR/main.lang | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang index 1c0c44406be..c36882a2ad1 100644 --- a/htdocs/langs/fr_FR/main.lang +++ b/htdocs/langs/fr_FR/main.lang @@ -269,12 +269,12 @@ DatePayment=Date paiement DateApprove=Date approbation DateApprove2=Date approbation (deuxième approbation) RegistrationDate=Date d'inscription -UserCreation=Création de l'utilisateur -UserModification=Modification de l'utilisateur -UserValidation=Validation de l'utilisateur -UserCreationShort=Création de l'utilisateur -UserModificationShort=Modification de l'utilisateur -UserValidationShort=Utilisateur actif +UserCreation=Utilisateur de création +UserModification=Utilisateur de modification +UserValidation=Utilisateur de validation +UserCreationShort=Util. de création +UserModificationShort=Util. de modification +UserValidationShort=Util. de validation DurationYear=an DurationMonth=mois DurationWeek=semaine From 6ae36ce6a7f4515d0ce2a29f6c5ea319f40f49c1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Mar 2019 19:20:01 +0100 Subject: [PATCH 17/44] Work on BOM --- htdocs/bom/bom_card.php | 10 +- htdocs/bom/bom_list.php | 2 + htdocs/bom/class/bom.class.php | 225 ++++++++++++++++-- htdocs/core/actions_addupdatedelete.inc.php | 6 +- htdocs/core/class/commonobject.class.php | 15 ++ .../install/mysql/migration/9.0.0-10.0.0.sql | 2 + htdocs/install/mysql/tables/llx_bom_bom.sql | 2 + htdocs/langs/en_US/mrp.lang | 1 + .../template/class/myobject.class.php | 28 ++- .../modulebuilder/template/myobject_card.php | 2 +- 10 files changed, 250 insertions(+), 43 deletions(-) diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index 7605dcae9c5..e31276ff652 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -89,20 +89,20 @@ if (empty($reshook)) if (empty($id)) $backtopage = $backurlforlist; else $backtopage = DOL_URL_ROOT.'/bom/bom_card.php?id='.$id; } - $triggermodname = 'BILLOFMATERIALS_BILLOFMATERIALS_MODIFY'; // Name of trigger action code to execute when we modify record + $triggermodname = 'BOM_MODIFY'; // Name of trigger action code to execute when we modify record // Actions cancel, add, update, delete or clone include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php'; // Actions when linking object each other - include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Actions when printing a doc from card include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; // Actions to send emails - $trigger_name='BILLOFMATERIALS_SENTBYMAIL'; - $autocopy='MAIN_MAIL_AUTOCOPY_BILLOFMATERIALS_TO'; + $trigger_name='BOM_SENTBYMAIL'; + $autocopy='MAIN_MAIL_AUTOCOPY_BOM_TO'; $trackid='bom'.$object->id; include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; } @@ -208,7 +208,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $res = $object->fetch_optionals(); $head = bomPrepareHead($object); - dol_fiche_head($head, 'card', $langs->trans("NewBOM"), -1, 'bom'); + dol_fiche_head($head, 'card', $langs->trans("BillOfMaterials"), -1, 'bom'); $formconfirm = ''; diff --git a/htdocs/bom/bom_list.php b/htdocs/bom/bom_list.php index 9d7c00caf67..b9b8168fd62 100644 --- a/htdocs/bom/bom_list.php +++ b/htdocs/bom/bom_list.php @@ -375,7 +375,9 @@ foreach($object->fields as $key => $val) $cssforfield=''; if (in_array($val['type'], array('date','datetime','timestamp'))) $cssforfield.=($cssforfield?' ':'').'center'; if (in_array($val['type'], array('timestamp'))) $cssforfield.=($cssforfield?' ':'').'nowrap'; + if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real'))) $cssforfield.=($cssforfield?' ':'').'right'; if ($key == 'status') $cssforfield.=($cssforfield?' ':'').'center'; + var_dump($val); if (! empty($arrayfields['t.'.$key]['checked'])) print ''; } // Extra fields diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index 349d4b03552..47aae86db04 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -60,6 +60,11 @@ class BOM extends CommonObject public $table_element_line = 'bom_bomline'; + const STATUS_DRAFT = 0; + const STATUS_VALIDATED = 1; + const STATUS_DISABLED = -1; + + /** * 'type' if the field format. * 'label' the translation key. @@ -85,18 +90,20 @@ class BOM extends CommonObject */ public $fields=array( 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'position'=>1, 'notnull'=>1, 'index'=>1, 'comment'=>"Id",), - 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>4, 'position'=>10, 'notnull'=>1, 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of BOM", 'showoncombobox'=>'1',), + 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>4, 'position'=>10, 'notnull'=>1, 'default'=>'(PROV)', 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of BOM", 'showoncombobox'=>'1',), 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'notnull'=>1, 'searchall'=>1, 'showoncombobox'=>'1',), 'description' => array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>-1, 'position'=>60, 'notnull'=>-1,), 'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>-1, 'position'=>61, 'notnull'=>-1,), 'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>-1, 'position'=>62, 'notnull'=>-1,), 'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'position'=>500, 'notnull'=>1,), 'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-2, 'position'=>501, 'notnull'=>1,), - 'fk_user_creat' => array('type'=>'integer', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-2, 'position'=>510, 'notnull'=>1, 'foreignkey'=>'llx_user.rowid',), + 'date_valid' => array('type'=>'datetime', 'label'=>'DateValid', 'enabled'=>1, 'visible'=>-2, 'position'=>502, 'notnull'=>0,), + 'fk_user_creat' => array('type'=>'integer', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-2, 'position'=>510, 'notnull'=>1, 'foreignkey'=>'llx_user.rowid',), 'fk_user_modif' => array('type'=>'integer', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'position'=>511, 'notnull'=>-1,), - 'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>1000, 'notnull'=>-1,), + 'fk_user_valid' => array('type'=>'integer', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-2, 'position'=>512, 'notnull'=>0,), + 'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>1000, 'notnull'=>-1,), 'fk_product' => array('type'=>'integer:Product:product/class/product.class.php', 'label'=>'Product', 'enabled'=>1, 'visible'=>1, 'position'=>50, 'notnull'=>1, 'index'=>1, 'help'=>'ProductBOMHelp'), - 'qty' => array('type'=>'double(24,8)', 'label'=>'Quantity', 'enabled'=>1, 'visible'=>1, 'default'=>1, 'position'=>55, 'notnull'=>1, 'isameasure'=>'1',), + 'qty' => array('type'=>'real', 'label'=>'Quantity', 'enabled'=>1, 'visible'=>1, 'default'=>1, 'position'=>55, 'notnull'=>1, 'isameasure'=>'1',), 'status' => array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>2, 'position'=>1000, 'notnull'=>1, 'default'=>0, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Draft', '1'=>'Enabled', '-1'=>'Disabled')), ); public $rowid; @@ -116,7 +123,6 @@ class BOM extends CommonObject // END MODULEBUILDER PROPERTIES - // If this object has a subtable with lines /** @@ -278,14 +284,14 @@ class BOM extends CommonObject * * @return int <0 if KO, 0 if not found, >0 if OK */ - /*public function fetchLines() + public function fetchLines() { $this->lines=array(); - // Load lines with object BillOfMaterialsLine + // Load lines with object BOMLine return count($this->lines)?1:0; - }*/ + } /** * Load list of objects in memory from the database. @@ -390,6 +396,189 @@ class BOM extends CommonObject //return $this->deleteCommon($user, $notrigger, 1); } + + /** + * Validate bom + * + * @param User $user User making status change + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @return int <=0 if OK, 0=Nothing done, >0 if KO + */ + public function valid($user, $notrigger = 0) + { + global $conf, $langs; + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + + $error=0; + + // Protection + if ($this->statut == self::STATUS_VALIDATED) + { + dol_syslog(get_class($this)."::valid action abandonned: already validated", LOG_WARNING); + return 0; + } + + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->bom->create)) + || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->bom->bom_advance->validate)))) + { + $this->error='NotEnoughPermissions'; + dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR); + return -1; + }*/ + + $now=dol_now(); + + $this->db->begin(); + + // Define new ref + if (! $error && (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref))) // empty should not happened, but when it occurs, the test save life + { + $num = $this->getNextNumRef(); + } + else + { + $num = $this->ref; + } + $this->newref = $num; + + // Validate + $sql = "UPDATE ".MAIN_DB_PREFIX."bom_bom"; + $sql.= " SET ref = '".$this->db->escape($num)."',"; + $sql.= " status = ".self::STATUS_VALIDATED.","; + $sql.= " date_valid='".$this->db->idate($now)."',"; + $sql.= " fk_user_valid = ".$user->id; + $sql.= " WHERE rowid = ".$this->id; + + dol_syslog(get_class($this)."::valid()", LOG_DEBUG); + $resql=$this->db->query($sql); + if (! $resql) + { + dol_print_error($this->db); + $this->error=$this->db->lasterror(); + $error++; + } + + if (! $error && ! $notrigger) + { + // Call trigger + $result=$this->call_trigger('BOM_VALIDATE', $user); + if ($result < 0) $error++; + // End call triggers + } + + if (! $error) + { + $this->oldref = $this->ref; + + // Rename directory if dir was a temporary ref + if (preg_match('/^[\(]?PROV/i', $this->ref)) + { + // On renomme repertoire ($this->ref = ancienne ref, $num = nouvelle ref) + // in order not to lose the attachments + $oldref = dol_sanitizeFileName($this->ref); + $newref = dol_sanitizeFileName($num); + $dirsource = $conf->bom->dir_output.'/'.$oldref; + $dirdest = $conf->bom->dir_output.'/'.$newref; + if (file_exists($dirsource)) + { + dol_syslog(get_class($this)."::valid() rename dir ".$dirsource." into ".$dirdest); + + if (@rename($dirsource, $dirdest)) + { + dol_syslog("Rename ok"); + // Rename docs starting with $oldref with $newref + $listoffiles=dol_dir_list($conf->bom->dir_output.'/'.$newref, 'files', 1, '^'.preg_quote($oldref, '/')); + foreach($listoffiles as $fileentry) + { + $dirsource=$fileentry['name']; + $dirdest=preg_replace('/^'.preg_quote($oldref, '/').'/', $newref, $dirsource); + $dirsource=$fileentry['path'].'/'.$dirsource; + $dirdest=$fileentry['path'].'/'.$dirdest; + @rename($dirsource, $dirdest); + } + } + } + } + } + + // Set new ref and current status + if (! $error) + { + $this->ref = $num; + $this->status = self::STATUS_VALIDATED; + } + + if (! $error) + { + $this->db->commit(); + return 1; + } + else + { + $this->db->rollback(); + return -1; + } + } + + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Set draft status + * + * @param User $user Object user that modify + * @return int <0 if KO, >0 if OK + */ + public function setDraft($user) + { + //phpcs:enable + global $conf,$langs; + + $error=0; + + // Protection + if ($this->status <= self::STATUS_DRAFT) + { + return 0; + } + + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->bom->write)) + || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->bom->bom_advance->validate)))) + { + $this->error='Permission denied'; + return -1; + }*/ + + $this->db->begin(); + + $sql = "UPDATE ".MAIN_DB_PREFIX."bom"; + $sql.= " SET status = ".self::STATUS_DRAFT; + $sql.= " WHERE rowid = ".$this->id; + + dol_syslog(get_class($this)."::setDraft", LOG_DEBUG); + if ($this->db->query($sql)) + { + if (!$error) { + // Call trigger + $result=$this->call_trigger('BOM_UNVALIDATE', $user); + if ($result < 0) $error++; + } + + if (!$error) { + $this->status=self::STATUS_DRAFT; + $this->db->commit(); + return 1; + }else { + $this->db->rollback(); + return -1; + } + } + else + { + $this->error=$this->db->error(); + $this->db->rollback(); + return -1; + } + } + /** * Return a link to the object card (with optionaly the picto) * @@ -628,9 +817,9 @@ class BOM extends CommonObject /** - * Class for BillOfMaterialsLine + * Class for BOMLine */ -class BillOfMaterialsLine extends CommonObject +class BOMLine extends CommonObject { /** * @var string ID to identify managed object @@ -853,24 +1042,10 @@ class BillOfMaterialsLine extends CommonObject public function fetch($id, $ref = null) { $result = $this->fetchCommon($id, $ref); - if ($result > 0 && ! empty($this->table_element_line)) $this->fetchLines(); + //if ($result > 0 && ! empty($this->table_element_line)) $this->fetchLines(); return $result; } - /** - * Load object lines in memory from the database - * - * @return int <0 if KO, 0 if not found, >0 if OK - */ - /*public function fetchLines() - { - $this->lines=array(); - - // Load lines with object BillOfMaterialsLineLine - - return count($this->lines)?1:0; - }*/ - /** * Load list of objects in memory from the database. * diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index e36b80ce8ed..85d89c08e4b 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -63,6 +63,10 @@ if ($action == 'add' && ! empty($permissiontoadd)) if (! empty($object->fields[$key]['foreignkey']) && $value == '-1') $value=''; // This is an explicit foreign key field $object->$key=$value; + if ($val['notnull'] > 0 && $object->$key == '' && ! is_null($val['default']) && $val['default'] == '(PROV)') + { + $object->$key = '(PROV)'; + } if ($val['notnull'] > 0 && $object->$key == '' && is_null($val['default'])) { $error++; @@ -75,7 +79,7 @@ if ($action == 'add' && ! empty($permissiontoadd)) $result=$object->create($user); if ($result > 0) { - // Creation OK + // Creation OK $urltogo=$backtopage?str_replace('__ID__', $result, $backtopage):$backurlforlist; header("Location: ".$urltogo); exit; diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 367fae984b6..73002dfceb4 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -7222,6 +7222,21 @@ abstract class CommonObject $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . $this->table_element); } + // If we have a field ref with a default value of (PROV) + if (! $error) + { + if (key_exists('ref', $this->fields) && $this->fields['ref']['notnull'] > 0 && ! is_null($this->fields['ref']['default']) && $this->fields['ref']['default'] == '(PROV)') + { + $sql="UPDATE ".MAIN_DB_PREFIX.$this->table_element." SET ref = '(PROV".$this->id.")' WHERE ref = '(PROV)' AND rowid = ".$this->id; + $resqlupdate = $this->db->query($sql); + if ($resqlupdate===false) + { + $error++; + $this->errors[] = $this->db->lasterror(); + } + } + } + // Create extrafields if (! $error) { diff --git a/htdocs/install/mysql/migration/9.0.0-10.0.0.sql b/htdocs/install/mysql/migration/9.0.0-10.0.0.sql index 4b6a511d0e5..f88b7113037 100644 --- a/htdocs/install/mysql/migration/9.0.0-10.0.0.sql +++ b/htdocs/install/mysql/migration/9.0.0-10.0.0.sql @@ -186,8 +186,10 @@ CREATE TABLE llx_bom_bom( note_private text, date_creation datetime NOT NULL, tms timestamp NOT NULL, + date_valid datetime, fk_user_creat integer NOT NULL, fk_user_modif integer, + fk_user_valid integer, import_key varchar(14), status integer NOT NULL, fk_product integer, diff --git a/htdocs/install/mysql/tables/llx_bom_bom.sql b/htdocs/install/mysql/tables/llx_bom_bom.sql index 2bca889c970..89a2f8e8bab 100644 --- a/htdocs/install/mysql/tables/llx_bom_bom.sql +++ b/htdocs/install/mysql/tables/llx_bom_bom.sql @@ -25,8 +25,10 @@ CREATE TABLE llx_bom_bom( note_private text, date_creation datetime NOT NULL, tms timestamp NOT NULL, + date_valid datetime, fk_user_creat integer NOT NULL, fk_user_modif integer, + fk_user_valid integer, import_key varchar(14), status integer NOT NULL, fk_product integer, diff --git a/htdocs/langs/en_US/mrp.lang b/htdocs/langs/en_US/mrp.lang index 77975a4333a..de156055335 100644 --- a/htdocs/langs/en_US/mrp.lang +++ b/htdocs/langs/en_US/mrp.lang @@ -1,4 +1,5 @@ MenuBOM=Bills Of Materials +BillOfMaterials=Bill of Materials BOMsSetup=Setup of module BOM ListOfBOMs=List of Bills Of Materials NewBOM=New bill of material diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index bb29c13f46f..00cb961fc90 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -58,8 +58,13 @@ class MyObject extends CommonObject public $picto = 'myobject@mymodule'; + const STATUS_DRAFT = 0; + const STATUS_VALIDATED = 1; + const STATUS_DISABLED = -1; + + /** - * 'type' if the field format. + * 'type' if the field format ('integer', 'integer:Class:pathtoclass', 'varchar(x)', 'double(24,8)', 'text', 'html', 'datetime', 'timestamp', 'float') * 'label' the translation key. * 'enabled' is a condition when the field must be managed. * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). Using a negative value means field is not shown by default on list but can be selected for viewing) @@ -82,23 +87,24 @@ class MyObject extends CommonObject * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields=array( - 'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'index'=>1, 'position'=>1, 'comment'=>'Id'), - 'ref' =>array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1, 'comment'=>'Reference of object'), - 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'default'=>1, 'notnull'=>1, 'index'=>1, 'position'=>20), - 'label' =>array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'searchall'=>1, 'css'=>'minwidth200', 'help'=>'Help text', 'showoncombobox'=>1), - 'amount' =>array('type'=>'double(24,8)', 'label'=>'Amount', 'enabled'=>1, 'visible'=>1, 'default'=>'null', 'position'=>40, 'searchall'=>0, 'isameasure'=>1, 'help'=>'Help text'), - 'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'visible'=>1, 'enabled'=>1, 'position'=>50, 'notnull'=>-1, 'index'=>1, 'help'=>'LinkToThirparty'), + 'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'notnull'=> 1, 'index'=>1, 'position'=>1, 'comment'=>'Id'), + 'ref' =>array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'notnull'=> 1, 'default'=>'(PROV)', 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1, 'comment'=>'Reference of object'), + 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'notnull'=> 1, 'default'=>1, 'index'=>1, 'position'=>20), + 'label' =>array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'searchall'=>1, 'css'=>'minwidth200', 'help'=>'Help text', 'showoncombobox'=>1), + 'amount' =>array('type'=>'double(24,8)', 'label'=>'Amount', 'enabled'=>1, 'visible'=>1, 'default'=>'null', 'position'=>40, 'searchall'=>0, 'isameasure'=>1, 'help'=>'Help text for amount'), + 'qty' =>array('type'=>'real', 'label'=>'Qty', 'enabled'=>1, 'visible'=>1, 'default'=>'0', 'position'=>45, 'searchall'=>0, 'isameasure'=>1, 'help'=>'Help text for quantity'), + 'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'visible'=> 1, 'enabled'=>1, 'position'=>50, 'notnull'=>-1, 'index'=>1, 'help'=>'LinkToThirparty'), 'description' =>array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>0, 'position'=>60), 'note_public' =>array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>61), 'note_private' =>array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>62), - 'date_creation' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>500), - 'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>501), + 'date_creation' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'notnull'=> 1, 'position'=>500), + 'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-2, 'notnull'=> 1, 'position'=>501), //'date_validation' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'position'=>502), - 'fk_user_creat' =>array('type'=>'integer', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>510, 'foreignkey'=>'llx_user.rowid'), + 'fk_user_creat' =>array('type'=>'integer', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-2, 'notnull'=> 1, 'position'=>510, 'foreignkey'=>'llx_user.rowid'), 'fk_user_modif' =>array('type'=>'integer', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>511), //'fk_user_valid' =>array('type'=>'integer', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>512), 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'index'=>0, 'position'=>1000), - 'status' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'default'=>0, 'index'=>1, 'position'=>1000, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Active', -1=>'Canceled')), + 'status' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=> 1, 'default'=>0, 'index'=>1, 'position'=>1000, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Active', -1=>'Canceled')), ); /** diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index de3b2ec8b99..2cf6d6d4a6a 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -130,7 +130,7 @@ if (empty($reshook)) include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php'; // Actions when linking object each other - include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Actions when printing a doc from card include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; From d33fb9eff09383161a803649ce0994ea05a0f725 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Mar 2019 19:30:32 +0100 Subject: [PATCH 18/44] Work on BOM module --- htdocs/bom/bom_list.php | 4 ++-- htdocs/modulebuilder/template/myobject_list.php | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/bom/bom_list.php b/htdocs/bom/bom_list.php index b9b8168fd62..b078c29c99b 100644 --- a/htdocs/bom/bom_list.php +++ b/htdocs/bom/bom_list.php @@ -377,7 +377,6 @@ foreach($object->fields as $key => $val) if (in_array($val['type'], array('timestamp'))) $cssforfield.=($cssforfield?' ':'').'nowrap'; if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real'))) $cssforfield.=($cssforfield?' ':'').'right'; if ($key == 'status') $cssforfield.=($cssforfield?' ':'').'center'; - var_dump($val); if (! empty($arrayfields['t.'.$key]['checked'])) print ''; } // Extra fields @@ -403,6 +402,7 @@ foreach($object->fields as $key => $val) $cssforfield=''; if (in_array($val['type'], array('date','datetime','timestamp'))) $cssforfield.=($cssforfield?' ':'').'center'; if (in_array($val['type'], array('timestamp'))) $cssforfield.=($cssforfield?' ':'').'nowrap'; + if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real'))) $cssforfield.=($cssforfield?' ':'').'right'; if ($key == 'status') $cssforfield.=($cssforfield?' ':'').'center'; if (! empty($arrayfields['t.'.$key]['checked'])) { @@ -454,9 +454,9 @@ while ($i < min($num, $limit)) $cssforfield=''; if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) $cssforfield.=($cssforfield?' ':'').'center'; elseif ($key == 'status') $cssforfield.=($cssforfield?' ':'').'center'; - if (in_array($val['type'], array('timestamp'))) $cssforfield.=($cssforfield?' ':'').'nowrap'; elseif ($key == 'ref') $cssforfield.=($cssforfield?' ':'').'nowrap'; + if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real'))) $cssforfield.=($cssforfield?' ':'').'right'; if (! empty($arrayfields['t.'.$key]['checked'])) { diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index a310f4258e9..d4193118c75 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -409,6 +409,7 @@ foreach($object->fields as $key => $val) $cssforfield=''; if (in_array($val['type'], array('date','datetime','timestamp'))) $cssforfield.=($cssforfield?' ':'').'center'; if (in_array($val['type'], array('timestamp'))) $cssforfield.=($cssforfield?' ':'').'nowrap'; + if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real'))) $cssforfield.=($cssforfield?' ':'').'right'; if ($key == 'status') $cssforfield.=($cssforfield?' ':'').'center'; if (! empty($arrayfields['t.'.$key]['checked'])) print ''; } @@ -435,6 +436,7 @@ foreach($object->fields as $key => $val) $cssforfield=''; if (in_array($val['type'], array('date','datetime','timestamp'))) $cssforfield.=($cssforfield?' ':'').'center'; if (in_array($val['type'], array('timestamp'))) $cssforfield.=($cssforfield?' ':'').'nowrap'; + if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real'))) $cssforfield.=($cssforfield?' ':'').'right'; if ($key == 'status') $cssforfield.=($cssforfield?' ':'').'center'; if (! empty($arrayfields['t.'.$key]['checked'])) { @@ -490,6 +492,8 @@ while ($i < min($num, $limit)) if (in_array($val['type'], array('timestamp'))) $cssforfield.=($cssforfield?' ':'').'nowrap'; elseif ($key == 'ref') $cssforfield.=($cssforfield?' ':'').'nowrap'; + if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real'))) $cssforfield.=($cssforfield?' ':'').'right'; + if (! empty($arrayfields['t.'.$key]['checked'])) { print ' Date: Tue, 12 Mar 2019 19:44:59 +0100 Subject: [PATCH 19/44] Reduce quantity of string to translates --- htdocs/admin/emailcollector_card.php | 2 +- htdocs/bom/bom_card.php | 2 +- htdocs/comm/action/card.php | 2 +- htdocs/comm/mailing/card.php | 2 +- htdocs/comm/propal/card.php | 2 +- htdocs/commande/card.php | 2 +- htdocs/compta/facture/card.php | 2 +- htdocs/compta/sociales/card.php | 2 +- htdocs/contrat/card.php | 2 +- htdocs/expensereport/card.php | 2 +- htdocs/fichinter/card.php | 2 +- htdocs/fourn/commande/card.php | 2 +- htdocs/fourn/facture/card.php | 2 +- htdocs/langs/en_US/agenda.lang | 1 - htdocs/langs/en_US/bills.lang | 1 - htdocs/langs/en_US/compta.lang | 1 - htdocs/langs/en_US/contracts.lang | 1 - htdocs/langs/en_US/interventions.lang | 1 - htdocs/langs/en_US/mails.lang | 1 - htdocs/langs/en_US/mrp.lang | 1 + htdocs/langs/en_US/orders.lang | 1 - htdocs/langs/en_US/products.lang | 1 - htdocs/langs/en_US/projects.lang | 1 - htdocs/langs/en_US/propal.lang | 1 - htdocs/langs/en_US/supplier_proposal.lang | 1 - htdocs/langs/en_US/trips.lang | 1 - htdocs/modulebuilder/template/myobject_card.php | 2 +- htdocs/product/card.php | 2 +- htdocs/supplier_proposal/card.php | 2 +- htdocs/variants/combinations.php | 17 +---------------- 30 files changed, 18 insertions(+), 44 deletions(-) diff --git a/htdocs/admin/emailcollector_card.php b/htdocs/admin/emailcollector_card.php index de4959354db..fd74938d802 100644 --- a/htdocs/admin/emailcollector_card.php +++ b/htdocs/admin/emailcollector_card.php @@ -307,7 +307,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if ($action == 'clone') { // Create an array for form $formquestion = array(); - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('CloneMyObject'), $langs->trans('ConfirmCloneMyObject', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneEmailCollector', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); } // Confirmation of action process diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index e31276ff652..25bcb8a1b15 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -222,7 +222,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if ($action == 'clone') { // Create an array for form $formquestion = array(); - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('CloneBillOfMaterials'), $langs->trans('ConfirmCloneBillOfMaterials', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneBillOfMaterials', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); } // Confirmation of action xxxx diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 6ad881d141c..c6a4c3d225c 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -1391,7 +1391,7 @@ if ($id > 0) // Clone event if($action == 'clone') { - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . GETPOST('id'), $langs->trans('CloneAction'), $langs->trans('ConfirmCloneEvent', $object->label), 'confirm_clone', $formquestion, 'yes', 1); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . GETPOST('id'), $langs->trans('ToClone'), $langs->trans('ConfirmCloneEvent', $object->label), 'confirm_clone', $formquestion, 'yes', 1); print $formconfirm; } diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index 9e8fb3a9964..b710ba4656b 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -961,7 +961,7 @@ else array('type' => 'checkbox', 'name' => 'clone_receivers', 'label' => $langs->trans("CloneReceivers"), 'value' => 0) ); // Paiement incomplet. On demande si motif = escompte ou autre - print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('CloneEMailing'), $langs->trans('ConfirmCloneEMailing', $object->ref), 'confirm_clone', $formquestion, 'yes', 2, 240); + print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneEMailing', $object->ref), 'confirm_clone', $formquestion, 'yes', 2, 240); } /* diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 32b802a941e..eb8ba5f0520 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -1880,7 +1880,7 @@ if ($action == 'create') $formquestion[] = array('type' => 'date','name' => 'date_delivery','label' => $langs->trans("DeliveryDate"),'value' => $object->date_livraison); } // Paiement incomplet. On demande si motif = escompte ou autre - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ClonePropal'), $langs->trans('ConfirmClonePropal', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ToClone'), $langs->trans('ConfirmClonePropal', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); } if ($action == 'statut') diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 4df831f9793..33dc913fe45 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -2047,7 +2047,7 @@ if ($action == 'create' && $user->rights->commande->creer) // array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' // => 1), array('type' => 'other','name' => 'socid','label' => $langs->trans("SelectThirdParty"),'value' => $form->select_company(GETPOST('socid', 'int'), 'socid', '(s.client=1 OR s.client=3)'))); - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('CloneOrder'), $langs->trans('ConfirmCloneOrder', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneOrder', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); } // Call Hook formConfirm diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 59fcb22d96d..ecd776ea75f 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -3608,7 +3608,7 @@ elseif ($id > 0 || ! empty($ref)) // array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1) array('type' => 'other','name' => 'socid','label' => $langs->trans("SelectThirdParty"),'value' => $form->select_company($object->socid, 'socid', '(s.client=1 OR s.client=2 OR s.client=3)', 1))); // Paiement incomplet. On demande si motif = escompte ou autre - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?facid=' . $object->id, $langs->trans('CloneInvoice'), $langs->trans('ConfirmCloneInvoice', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?facid=' . $object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneInvoice', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); } // Call Hook formConfirm diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php index fe29e133edc..d3093a6f374 100644 --- a/htdocs/compta/sociales/card.php +++ b/htdocs/compta/sociales/card.php @@ -419,7 +419,7 @@ if ($id > 0) ); - print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('CloneTax'), $langs->trans('ConfirmCloneTax', $object->ref), 'confirm_clone', $formclone, 'yes'); + print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneTax', $object->ref), 'confirm_clone', $formclone, 'yes'); } // Confirmation de la suppression de la charge diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index ea74e0a73db..4f0022a7796 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -1364,7 +1364,7 @@ else } elseif ($action == 'clone') { // Clone confirmation $formquestion = array(array('type' => 'other','name' => 'socid','label' => $langs->trans("SelectThirdParty"),'value' => $form->select_company(GETPOST('socid', 'int'), 'socid', '(s.client=1 OR s.client=2 OR s.client=3)'))); - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('CloneContract'), $langs->trans('ConfirmCloneContract', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneContract', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); } diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index b7cb41f389a..15494a51758 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -1606,7 +1606,7 @@ else array('type' => 'other','name' => 'fk_user_author','label' => $langs->trans("SelectTargetUser"),'value' => $form->select_dolusers((GETPOST('fk_user_author', 'int')> 0 ? GETPOST('fk_user_author', 'int') : $user->id), 'fk_user_author', 0, null, 0, $criteriaforfilter)) ); // Paiement incomplet. On demande si motif = escompte ou autre - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('CloneExpenseReport'), $langs->trans('ConfirmCloneExpenseReport', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneExpenseReport', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); } if ($action == 'save') diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 3230092b541..485a04b6a02 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -1170,7 +1170,7 @@ elseif ($id > 0 || ! empty($ref)) // => 1), array('type' => 'other','name' => 'socid','label' => $langs->trans("SelectThirdParty"),'value' => $form->select_company(GETPOST('socid', 'int'), 'socid', '', '', 0, 0, null, 0, 'minwidth200'))); // Paiement incomplet. On demande si motif = escompte ou autre - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('CloneIntervention'), $langs->trans('ConfirmCloneIntervention', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneIntervention', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); } if (!$formconfirm) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 045beb3bb0c..971c745886f 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -1705,7 +1705,7 @@ elseif (! empty($object->id)) //array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1) ); // Paiement incomplet. On demande si motif = escompte ou autre - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('CloneOrder'), $langs->trans('ConfirmCloneOrder', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneOrder', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); } // Confirmation de la validation diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 03f3442351d..b6e971bd4f5 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2232,7 +2232,7 @@ else //array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1) ); // Paiement incomplet. On demande si motif = escompte ou autre - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('CloneInvoice'), $langs->trans('ConfirmCloneInvoice', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneInvoice', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); } // Confirmation de la validation diff --git a/htdocs/langs/en_US/agenda.lang b/htdocs/langs/en_US/agenda.lang index a38f3d23932..d4cce020d00 100644 --- a/htdocs/langs/en_US/agenda.lang +++ b/htdocs/langs/en_US/agenda.lang @@ -126,7 +126,6 @@ AddEvent=Create event MyAvailability=My availability ActionType=Event type DateActionBegin=Start event date -CloneAction=Clone event ConfirmCloneEvent=Are you sure you want to clone the event %s? RepeatEvent=Repeat event EveryWeek=Every week diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index 17853434ea9..0934b4c1e46 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -322,7 +322,6 @@ PaymentNumber=Payment number RemoveDiscount=Remove discount WatermarkOnDraftBill=Watermark on draft invoices (nothing if empty) InvoiceNotChecked=No invoice selected -CloneInvoice=Clone invoice ConfirmCloneInvoice=Are you sure you want to clone this invoice %s? DisabledBecauseReplacedInvoice=Action disabled because invoice has been replaced DescTaxAndDividendsArea=This area presents a summary of all payments made for special expenses. Only records with payments during the fixed year are included here. diff --git a/htdocs/langs/en_US/compta.lang b/htdocs/langs/en_US/compta.lang index c6c3921edea..02feb47ccb9 100644 --- a/htdocs/langs/en_US/compta.lang +++ b/htdocs/langs/en_US/compta.lang @@ -232,7 +232,6 @@ ACCOUNTING_ACCOUNT_CUSTOMER=Accounting account used for customer third parties ACCOUNTING_ACCOUNT_CUSTOMER_Desc=The dedicated accounting account defined on third party card will be used for Subledger accounting only. This one will be used for General Ledger and as default value of Subledger accounting if dedicated customer accounting account on third party is not defined. ACCOUNTING_ACCOUNT_SUPPLIER=Accounting account used for vendor third parties ACCOUNTING_ACCOUNT_SUPPLIER_Desc=The dedicated accounting account defined on third party card will be used for Subledger accounting only. This one will be used for General Ledger and as default value of Subledger accounting if dedicated vendor accounting account on third party is not defined. -CloneTax=Clone a social/fiscal tax ConfirmCloneTax=Confirm the clone of a social/fiscal tax CloneTaxForNextMonth=Clone it for next month SimpleReport=Simple report diff --git a/htdocs/langs/en_US/contracts.lang b/htdocs/langs/en_US/contracts.lang index b4e8d7c96d9..51b73423fb0 100644 --- a/htdocs/langs/en_US/contracts.lang +++ b/htdocs/langs/en_US/contracts.lang @@ -85,7 +85,6 @@ NoteListOfYourExpiredServices=This list contains only services of contracts for StandardContractsTemplate=Standard contracts template ContactNameAndSignature=For %s, name and signature: OnlyLinesWithTypeServiceAreUsed=Only lines with type "Service" will be cloned. -CloneContract=Clone contract ConfirmCloneContract=Are you sure you want to clone the contract %s? LowerDateEndPlannedShort=Lower planned end date of active services SendContractRef=Contract information __REF__ diff --git a/htdocs/langs/en_US/interventions.lang b/htdocs/langs/en_US/interventions.lang index 2025fb03181..e7667ef6946 100644 --- a/htdocs/langs/en_US/interventions.lang +++ b/htdocs/langs/en_US/interventions.lang @@ -15,7 +15,6 @@ DeleteIntervention=Delete intervention ValidateIntervention=Validate intervention ModifyIntervention=Modify intervention DeleteInterventionLine=Delete intervention line -CloneIntervention=Clone intervention ConfirmDeleteIntervention=Are you sure you want to delete this intervention? ConfirmValidateIntervention=Are you sure you want to validate this intervention under name %s? ConfirmModifyIntervention=Are you sure you want to modify this intervention? diff --git a/htdocs/langs/en_US/mails.lang b/htdocs/langs/en_US/mails.lang index b055b38268a..b50faffe2fa 100644 --- a/htdocs/langs/en_US/mails.lang +++ b/htdocs/langs/en_US/mails.lang @@ -58,7 +58,6 @@ EMailTestSubstitutionReplacedByGenericValues=When using test mode, substitutions MailingAddFile=Attach this file NoAttachedFiles=No attached files BadEMail=Bad value for Email -CloneEMailing=Clone Emailing ConfirmCloneEMailing=Are you sure you want to clone this emailing? CloneContent=Clone message CloneReceivers=Cloner recipients diff --git a/htdocs/langs/en_US/mrp.lang b/htdocs/langs/en_US/mrp.lang index de156055335..dfc8437d08a 100644 --- a/htdocs/langs/en_US/mrp.lang +++ b/htdocs/langs/en_US/mrp.lang @@ -8,3 +8,4 @@ BOMsNumberingModules=BOMs numbering templates BOMsModelModule=BOMS document templates FreeLegalTextOnBOMs=Free text on document of BOMs WatermarkOnDraftBOMs=Watermark on draft BOMs +ConfirmCloneBillOfMaterials diff --git a/htdocs/langs/en_US/orders.lang b/htdocs/langs/en_US/orders.lang index 1f53d0c050a..ad895845488 100644 --- a/htdocs/langs/en_US/orders.lang +++ b/htdocs/langs/en_US/orders.lang @@ -110,7 +110,6 @@ OrderMode=Order method AuthorRequest=Request author UserWithApproveOrderGrant=Users granted with "approve orders" permission. PaymentOrderRef=Payment of order %s -CloneOrder=Clone order ConfirmCloneOrder=Are you sure you want to clone this order %s? DispatchSupplierOrder=Receiving purchase order %s FirstApprovalAlreadyDone=First approval already done diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index 401ccc5462e..325297b6d1f 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -144,7 +144,6 @@ ListProductByPopularity=List of products by popularity ListServiceByPopularity=List of services by popularity Finished=Manufactured product RowMaterial=Raw Material -CloneProduct=Clone product or service ConfirmCloneProduct=Are you sure you want to clone product or service %s? CloneContentProduct=Clone all main information of product/service ClonePricesProduct=Clone prices diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang index 8cb78975066..4f395925cdd 100644 --- a/htdocs/langs/en_US/projects.lang +++ b/htdocs/langs/en_US/projects.lang @@ -131,7 +131,6 @@ TaskIsNotAssignedToUser=Task not assigned to user. Use button '%s%s tasks at the moment) and all inputs of time spent. IfNeedToUseOtherObjectKeepEmpty=If some objects (invoice, order, ...), belonging to another third party, must be linked to the project to create, keep this empty to have the project being multi third parties. -CloneProject=Clone project CloneTasks=Clone tasks CloneContacts=Clone contacts CloneNotes=Clone notes diff --git a/htdocs/langs/en_US/propal.lang b/htdocs/langs/en_US/propal.lang index 44da81357ef..7fce5107356 100644 --- a/htdocs/langs/en_US/propal.lang +++ b/htdocs/langs/en_US/propal.lang @@ -56,7 +56,6 @@ CopyPropalFrom=Create commercial proposal by copying existing proposal CreateEmptyPropal=Create empty commercial proposal or from list of products/services DefaultProposalDurationValidity=Default commercial proposal validity duration (in days) UseCustomerContactAsPropalRecipientIfExist=Use contact/address with type 'Contact following-up proposal' if defined instead of third party address as proposal recipient address -ClonePropal=Clone commercial proposal ConfirmClonePropal=Are you sure you want to clone the commercial proposal %s? ConfirmReOpenProp=Are you sure you want to open back the commercial proposal %s? ProposalsAndProposalsLines=Commercial proposal and lines diff --git a/htdocs/langs/en_US/supplier_proposal.lang b/htdocs/langs/en_US/supplier_proposal.lang index 501b6d907e3..ff738a949a6 100644 --- a/htdocs/langs/en_US/supplier_proposal.lang +++ b/htdocs/langs/en_US/supplier_proposal.lang @@ -34,7 +34,6 @@ SupplierProposalStatusSignedShort=Accepted SupplierProposalStatusNotSignedShort=Refused CopyAskFrom=Create price request by copying existing a request CreateEmptyAsk=Create blank request -CloneAsk=Clone price request ConfirmCloneAsk=Are you sure you want to clone the price request %s? ConfirmReOpenAsk=Are you sure you want to open back the price request %s? SendAskByMail=Send price request by mail diff --git a/htdocs/langs/en_US/trips.lang b/htdocs/langs/en_US/trips.lang index 3072dae1df6..19710e8915d 100644 --- a/htdocs/langs/en_US/trips.lang +++ b/htdocs/langs/en_US/trips.lang @@ -109,7 +109,6 @@ NoTripsToExportCSV=No expense report to export for this period. ExpenseReportPayment=Expense report payment ExpenseReportsToApprove=Expense reports to approve ExpenseReportsToPay=Expense reports to pay -CloneExpenseReport=Clone expense report ConfirmCloneExpenseReport=Are you sure you want to clone this expense report ? ExpenseReportsIk=Expense report milles index ExpenseReportsRules=Expense report rules diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index 2cf6d6d4a6a..283e0a29749 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -257,7 +257,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if ($action == 'clone') { // Create an array for form $formquestion = array(); - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('CloneMyObject'), $langs->trans('ConfirmCloneMyObject', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneMyObject', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); } // Confirmation of action xxxx diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 18ea87cb03a..dc286faa36c 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -2000,7 +2000,7 @@ if (($action == 'delete' && (empty($conf->use_javascript_ajax) || ! empty($conf- if (($action == 'clone' && (empty($conf->use_javascript_ajax) || ! empty($conf->dol_use_jmobile))) // Output when action = clone if jmobile or no js || (! empty($conf->use_javascript_ajax) && empty($conf->dol_use_jmobile))) // Always output when not jmobile nor js { - print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('CloneProduct'), $langs->trans('ConfirmCloneProduct', $object->ref), 'confirm_clone', $formquestionclone, 'yes', 'action-clone', 260, 600); + print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneProduct', $object->ref), 'confirm_clone', $formquestionclone, 'yes', 'action-clone', 260, 600); } diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 933faf3b34a..d60175e3639 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -1328,7 +1328,7 @@ if ($action == 'create') // 1), array('type' => 'other','name' => 'socid','label' => $langs->trans("SelectThirdParty"),'value' => $form->select_company(GETPOST('socid', 'int'), 'socid', 's.fournisseur=1'))); // Paiement incomplet. On demande si motif = escompte ou autre - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('CloneAsk'), $langs->trans('ConfirmCloneAsk', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneAsk', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); } // Confirm delete diff --git a/htdocs/variants/combinations.php b/htdocs/variants/combinations.php index c53193411ff..278d3656a6f 100644 --- a/htdocs/variants/combinations.php +++ b/htdocs/variants/combinations.php @@ -640,22 +640,7 @@ if (! empty($id) || ! empty($ref)) ); } } elseif ($action === 'copy') { - - print $form->formconfirm( - 'combinations.php?id='.$id, - $langs->trans('CloneCombinationsProduct'), - $langs->trans('ConfirmCloneProductCombinations'), - 'confirm_copycombination', - array( - array( - 'type' => 'text', - 'label' => $langs->trans('CloneDestinationReference'), - 'name' => 'dest_product' - ) - ), - 0, - 1 - ); + print $form->formconfirm('combinations.php?id='.$id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneProductCombinations'), 'confirm_copycombination', array(array('type' => 'text', 'label' => $langs->trans('CloneDestinationReference'), 'name' => 'dest_product')), 0, 1); } $comb2val = new ProductCombination2ValuePair($db); From b651b7ec07a0e8a2fac92bf0e9b66ba6abea852d Mon Sep 17 00:00:00 2001 From: wdammak <26695620+wdammak@users.noreply.github.com> Date: Wed, 13 Mar 2019 01:03:12 +0100 Subject: [PATCH 20/44] Fix Warning: Invalid argument - dynamic_price --- .../dynamic_price/class/price_parser.class.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/htdocs/product/dynamic_price/class/price_parser.class.php b/htdocs/product/dynamic_price/class/price_parser.class.php index 8e8b8e4fcc9..d7c066d01c9 100644 --- a/htdocs/product/dynamic_price/class/price_parser.class.php +++ b/htdocs/product/dynamic_price/class/price_parser.class.php @@ -157,10 +157,13 @@ class PriceParser $extrafields = new ExtraFields($this->db); $extralabels = $extrafields->fetch_name_optionals_label('product', true); $product->fetch_optionals(); - foreach ($extrafields->attributes[$product->table_element]['label'] as $key=>$label) - { - $values["extrafield_".$key] = $product->array_options['options_'.$key]; - } + if (is_array($extrafields->attributes[$product->table_element]['label'])) + { + foreach ($extrafields->attributes[$product->table_element]['label'] as $key=>$label) + { + $values["extrafield_".$key] = $product->array_options['options_'.$key]; + } + } //Process any pending updaters $price_updaters = new PriceGlobalVariableUpdater($this->db); From 5e7890729250285abad8d26a16bcc4e07ee94144 Mon Sep 17 00:00:00 2001 From: BENKE Charlene <1179011+defrance@users.noreply.github.com> Date: Wed, 13 Mar 2019 10:09:17 +0100 Subject: [PATCH 21/44] replace "brouillonner" by "setdraft" --- htdocs/expensereport/card.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 15494a51758..d52c1886f87 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -933,7 +933,7 @@ if (empty($reshook)) } } - if ($action == "confirm_brouillonner" && GETPOST('confirm', 'alpha')=="yes" && $id > 0 && $user->rights->expensereport->creer) + if ($action == "confirm_setdraft" && GETPOST('confirm', 'alpha')=="yes" && $id > 0 && $user->rights->expensereport->creer) { $object = new ExpenseReport($db); $object->fetch($id); @@ -1640,7 +1640,7 @@ else $formconfirm=$form->formconfirm($_SEVER["PHP_SELF"]."?id=".$id, $langs->trans("Cancel"), "", "confirm_cancel", $array_input, "", 1); } - if ($action == 'brouillonner') + if ($action == 'setdraft') { $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id, $langs->trans("BrouillonnerTrip"), $langs->trans("ConfirmBrouillonnerTrip"), "confirm_brouillonner", "", "", 1); } @@ -2443,7 +2443,7 @@ if ($action != 'create' && $action != 'edit') if ($user->id == $object->fk_user_author || $user->id == $object->fk_user_valid) { // Brouillonner - print ''; + print ''; } } @@ -2457,7 +2457,7 @@ if ($action != 'create' && $action != 'edit') if (in_array($object->fk_user_author, $user->getAllChildIds(1))) { // Brouillonner - print ''; + print ''; } } From 79bb6132858a6fd3c2521f84bc9fb39a7ea3801d Mon Sep 17 00:00:00 2001 From: BENKE Charlene <1179011+defrance@users.noreply.github.com> Date: Wed, 13 Mar 2019 10:12:25 +0100 Subject: [PATCH 22/44] Update card.php --- htdocs/expensereport/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index d52c1886f87..4c4780696ac 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -1642,7 +1642,7 @@ else if ($action == 'setdraft') { - $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id, $langs->trans("BrouillonnerTrip"), $langs->trans("ConfirmBrouillonnerTrip"), "confirm_brouillonner", "", "", 1); + $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id, $langs->trans("BrouillonnerTrip"), $langs->trans("ConfirmBrouillonnerTrip"), "confirm_setdraft", "", "", 1); } if ($action == 'refuse') // Deny From fef1f06d147d42d7ff36c8efeceb02d9695177c3 Mon Sep 17 00:00:00 2001 From: BENKE Charlene <1179011+defrance@users.noreply.github.com> Date: Wed, 13 Mar 2019 10:15:32 +0100 Subject: [PATCH 23/44] Update card.php --- htdocs/expensereport/card.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 4c4780696ac..c6d87acef4d 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -2431,7 +2431,7 @@ if ($action != 'create' && $action != 'edit') // Modify print ''; - // Brouillonner (le statut refusée est identique à brouillon) + // setdraft (le statut refusée est identique à brouillon) //print ''.$langs->trans('BROUILLONNER').''; // Enregistrer depuis le statut "Refusée" print ''; @@ -2442,7 +2442,7 @@ if ($action != 'create' && $action != 'edit') { if ($user->id == $object->fk_user_author || $user->id == $object->fk_user_valid) { - // Brouillonner + // setdraft print ''; } } @@ -2456,7 +2456,7 @@ if ($action != 'create' && $action != 'edit') { if (in_array($object->fk_user_author, $user->getAllChildIds(1))) { - // Brouillonner + // set draft print ''; } } From 0e1479ef4ea7320fcc26395f511cd611f94e75ed Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 Mar 2019 11:04:14 +0100 Subject: [PATCH 24/44] Lang --- htdocs/langs/en_US/mrp.lang | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/langs/en_US/mrp.lang b/htdocs/langs/en_US/mrp.lang index dfc8437d08a..fcfcaba700a 100644 --- a/htdocs/langs/en_US/mrp.lang +++ b/htdocs/langs/en_US/mrp.lang @@ -1,11 +1,11 @@ -MenuBOM=Bills Of Materials -BillOfMaterials=Bill of Materials +MenuBOM=Bills of material +BillOfMaterials=Bill of Material BOMsSetup=Setup of module BOM -ListOfBOMs=List of Bills Of Materials +ListOfBOMs=List of bills of material (BOM) NewBOM=New bill of material ProductBOMHelp=Product to create with this BOM -BOMsNumberingModules=BOMs numbering templates +BOMsNumberingModules=BOM numbering templates BOMsModelModule=BOMS document templates -FreeLegalTextOnBOMs=Free text on document of BOMs -WatermarkOnDraftBOMs=Watermark on draft BOMs -ConfirmCloneBillOfMaterials +FreeLegalTextOnBOMs=Free text on document of BOM +WatermarkOnDraftBOMs=Watermark on draft BOM +ConfirmCloneBillOfMaterials=Are you sure you want to clone this bill of material ? From 10f572b4004b138b012addf66c2404ac402bdae8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 Mar 2019 11:13:03 +0100 Subject: [PATCH 25/44] Remove warning --- htdocs/datapolicy/class/actions_datapolicy.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/datapolicy/class/actions_datapolicy.class.php b/htdocs/datapolicy/class/actions_datapolicy.class.php index e336e8d6df6..1243b5d057e 100644 --- a/htdocs/datapolicy/class/actions_datapolicy.class.php +++ b/htdocs/datapolicy/class/actions_datapolicy.class.php @@ -448,6 +448,8 @@ class ActionsDatapolicy } } - echo $jsscript; + $this->resprint = $jsscript; + + return 0; } } From 88c02143fac8043ce2befc7f6d80758c951cf707 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 Mar 2019 13:40:57 +0100 Subject: [PATCH 26/44] Fix missing fields --- htdocs/install/mysql/migration/3.8.0-3.9.0.sql | 6 +++--- htdocs/install/mysql/migration/8.0.0-9.0.0.sql | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/htdocs/install/mysql/migration/3.8.0-3.9.0.sql b/htdocs/install/mysql/migration/3.8.0-3.9.0.sql index d72777db230..f749e57b432 100644 --- a/htdocs/install/mysql/migration/3.8.0-3.9.0.sql +++ b/htdocs/install/mysql/migration/3.8.0-3.9.0.sql @@ -42,9 +42,9 @@ ALTER TABLE llx_product_customer_price_log ADD COLUMN localtax2_type varchar(10) UPDATE llx_user set api_key = null where api_key = ''; -ALTER TABLE llx_actioncomm ADD COLUMN email_subject varchar(256) after email_msgid; -ALTER TABLE llx_actioncomm ADD COLUMN email_tocc varchar(256) after email_to; -ALTER TABLE llx_actioncomm ADD COLUMN email_tobcc varchar(256) after email_tocc; +ALTER TABLE llx_actioncomm ADD COLUMN email_subject varchar(255) after email_msgid; +ALTER TABLE llx_actioncomm ADD COLUMN email_tocc varchar(255) after email_to; +ALTER TABLE llx_actioncomm ADD COLUMN email_tobcc varchar(255) after email_tocc; ALTER TABLE llx_user MODIFY COLUMN pass varchar(128); diff --git a/htdocs/install/mysql/migration/8.0.0-9.0.0.sql b/htdocs/install/mysql/migration/8.0.0-9.0.0.sql index 31689120cfc..643e411ee5e 100644 --- a/htdocs/install/mysql/migration/8.0.0-9.0.0.sql +++ b/htdocs/install/mysql/migration/8.0.0-9.0.0.sql @@ -48,6 +48,9 @@ create table llx_facture_rec_extrafields import_key varchar(14) ) ENGINE=innodb; +ALTER TABLE llx_actioncomm ADD COLUMN email_subject varchar(255) after email_msgid; +ALTER TABLE llx_actioncomm ADD COLUMN email_tocc varchar(255) after email_to; +ALTER TABLE llx_actioncomm ADD COLUMN email_tobcc varchar(255) after email_tocc; -- For 9.0 ALTER TABLE llx_extrafields ADD COLUMN help text NULL; From c32551cb6238a3e4aaed77b5e0f5a3ef3b8ff326 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 Mar 2019 13:42:14 +0100 Subject: [PATCH 27/44] Fix size of varchar --- htdocs/install/mysql/migration/3.3.0-3.4.0.sql | 2 +- htdocs/install/mysql/migration/3.7.0-3.8.0.sql | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/install/mysql/migration/3.3.0-3.4.0.sql b/htdocs/install/mysql/migration/3.3.0-3.4.0.sql index 0d48fa89718..0f84c92ef22 100644 --- a/htdocs/install/mysql/migration/3.3.0-3.4.0.sql +++ b/htdocs/install/mysql/migration/3.3.0-3.4.0.sql @@ -111,7 +111,7 @@ ALTER TABLE llx_c_shipment_mode ADD COLUMN tracking VARCHAR(255) NOT NULL DEFAUL -- VMYSQL4.3 ALTER TABLE llx_c_shipment_mode CHANGE COLUMN rowid rowid INTEGER NOT NULL AUTO_INCREMENT; -- VPGSQL8.2 DROP table llx_c_shipment_mode; --- VPGSQL8.2 CREATE TABLE llx_c_shipment_mode (rowid SERIAL PRIMARY KEY, tms timestamp, code varchar(30) NOT NULL, libelle varchar(50) NOT NULL, description text, tracking varchar(256) NOT NULL, active integer DEFAULT 0, module varchar(32) NULL); +-- VPGSQL8.2 CREATE TABLE llx_c_shipment_mode (rowid SERIAL PRIMARY KEY, tms timestamp, code varchar(30) NOT NULL, libelle varchar(50) NOT NULL, description text, tracking varchar(255) NOT NULL, active integer DEFAULT 0, module varchar(32) NULL); -- VPGSQL8.2 INSERT INTO llx_c_shipment_mode (rowid,code,libelle,description,tracking,active) VALUES (1,'CATCH','Catch','Catch by client','',1); -- VPGSQL8.2 INSERT INTO llx_c_shipment_mode (rowid,code,libelle,description,tracking,active) VALUES (2,'TRANS','Transporter','Generic transporter','',1); -- VPGSQL8.2 INSERT INTO llx_c_shipment_mode (rowid,code,libelle,description,tracking,active) VALUES (3,'COLSUI','Colissimo Suivi','Colissimo Suivi','',0); diff --git a/htdocs/install/mysql/migration/3.7.0-3.8.0.sql b/htdocs/install/mysql/migration/3.7.0-3.8.0.sql index 891f79edc0f..ebcca580870 100755 --- a/htdocs/install/mysql/migration/3.7.0-3.8.0.sql +++ b/htdocs/install/mysql/migration/3.7.0-3.8.0.sql @@ -666,11 +666,11 @@ ALTER TABLE llx_actioncomm DROP INDEX idx_actioncomm_datea; ALTER TABLE llx_actioncomm DROP COLUMN datea2; -- Email tracking -ALTER TABLE llx_actioncomm ADD COLUMN email_msgid varchar(256); -ALTER TABLE llx_actioncomm ADD COLUMN email_from varchar(256); -ALTER TABLE llx_actioncomm ADD COLUMN email_sender varchar(256); -ALTER TABLE llx_actioncomm ADD COLUMN email_to varchar(256); -ALTER TABLE llx_actioncomm ADD COLUMN errors_to varchar(256); +ALTER TABLE llx_actioncomm ADD COLUMN email_msgid varchar(255); +ALTER TABLE llx_actioncomm ADD COLUMN email_from varchar(255); +ALTER TABLE llx_actioncomm ADD COLUMN email_sender varchar(255); +ALTER TABLE llx_actioncomm ADD COLUMN email_to varchar(255); +ALTER TABLE llx_actioncomm ADD COLUMN errors_to varchar(255); -- Recurring events ALTER TABLE llx_actioncomm ADD COLUMN recurid varchar(128); From 68cc7f0e8969cbb6898da868acff4e72ab05160d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 Mar 2019 13:53:29 +0100 Subject: [PATCH 28/44] Fix css --- htdocs/theme/eldy/badges.inc.php | 26 ++++++++++++++------------ htdocs/theme/eldy/theme_vars.inc.php | 2 +- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/htdocs/theme/eldy/badges.inc.php b/htdocs/theme/eldy/badges.inc.php index 7384fffed5f..ab4be871d7c 100644 --- a/htdocs/theme/eldy/badges.inc.php +++ b/htdocs/theme/eldy/badges.inc.php @@ -25,13 +25,13 @@ if (! defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?> .badge-pill, .tabs .badge { padding-right: .6em; padding-left: .6em; - border-radius: 10rem; + border-radius: 0.25rem; } .badge-dot { padding: 0; border-radius: 50%; - padding: 0.6em; + padding: 0.25rem; vertical-align: middle; } @@ -39,8 +39,10 @@ a.badge:focus, a.badge:hover { text-decoration: none; } - - +.liste_titre .badge { + background-color: ; + color: #fff; +} /* PRIMARY */ @@ -155,7 +157,7 @@ a.badge-dark:focus, a.badge-dark:hover { background-color: ; } -/* +/* * STATUS BADGES */ @@ -164,32 +166,32 @@ a.badge-dark:focus, a.badge-dark:hover { Date: Wed, 13 Mar 2019 14:05:32 +0100 Subject: [PATCH 29/44] Fix measure unit id in select options --- htdocs/product/class/html.formproduct.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/class/html.formproduct.class.php b/htdocs/product/class/html.formproduct.class.php index 3070515b020..efe6b261e83 100644 --- a/htdocs/product/class/html.formproduct.class.php +++ b/htdocs/product/class/html.formproduct.class.php @@ -337,8 +337,8 @@ class FormProduct $return .= ''; foreach ($measuringUnits->records as $lines) { - $return .= ''; From eeafc3c630d37964bc4d90b4ca4a9e43432d280f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 Mar 2019 14:10:36 +0100 Subject: [PATCH 30/44] Standardize translation of amount --- htdocs/comm/propal/card.php | 13 ++++++++++--- htdocs/commande/card.php | 12 ++++++------ htdocs/compta/facture/card.php | 6 +++--- htdocs/fichinter/card.php | 12 ++++++------ htdocs/fourn/commande/card.php | 12 ++++++------ htdocs/fourn/facture/card.php | 12 ++++++------ htdocs/supplier_proposal/card.php | 12 ++++++------ 7 files changed, 43 insertions(+), 36 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index eb8ba5f0520..44c05629744 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -1764,8 +1764,8 @@ if ($action == 'create') $newclassname = 'Intervention'; print '' . $langs->trans($newclassname) . '' . $objectsrc->getNomUrl(1) . ''; - print '' . $langs->trans('TotalHT') . '' . price($objectsrc->total_ht, 0, $langs, 1, -1, -1, $conf->currency) . ''; - print '' . $langs->trans('TotalVAT') . '' . price($objectsrc->total_tva, 0, $langs, 1, -1, -1, $conf->currency) . ""; + print '' . $langs->trans('AmountHT') . '' . price($objectsrc->total_ht, 0, $langs, 1, -1, -1, $conf->currency) . ''; + print '' . $langs->trans('AmountVAT') . '' . price($objectsrc->total_tva, 0, $langs, 1, -1, -1, $conf->currency) . ""; if ($mysoc->localtax1_assuj == "1" || $objectsrc->total_localtax1 != 0 ) // Localtax1 { print '' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '' . price($objectsrc->total_localtax1, 0, $langs, 1, -1, -1, $conf->currency) . ""; @@ -1775,7 +1775,14 @@ if ($action == 'create') { print '' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '' . price($objectsrc->total_localtax2, 0, $langs, 1, -1, -1, $conf->currency) . ""; } - print '' . $langs->trans('TotalTTC') . '' . price($objectsrc->total_ttc, 0, $langs, 1, -1, -1, $conf->currency) . ""; + print '' . $langs->trans('AmountTTC') . '' . price($objectsrc->total_ttc, 0, $langs, 1, -1, -1, $conf->currency) . ""; + + if (!empty($conf->multicurrency->enabled)) + { + print '' . $langs->trans('MulticurrencyAmountHT') . '' . price($objectsrc->multicurrency_total_ht) . ''; + print '' . $langs->trans('MulticurrencyAmountVAT') . '' . price($objectsrc->multicurrency_total_tva) . ""; + print '' . $langs->trans('MulticurrencyAmountTTC') . '' . price($objectsrc->multicurrency_total_ttc) . ""; + } } print "\n"; diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 33dc913fe45..65dba5049f4 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1836,8 +1836,8 @@ if ($action == 'create' && $user->rights->commande->creer) print '' . $langs->trans($newclassname) . '' . $objectsrc->getNomUrl(1) . ''; // Amount - print '' . $langs->trans('TotalHT') . '' . price($objectsrc->total_ht) . ''; - print '' . $langs->trans('TotalVAT') . '' . price($objectsrc->total_tva) . ""; + print '' . $langs->trans('AmountHT') . '' . price($objectsrc->total_ht) . ''; + print '' . $langs->trans('AmountVAT') . '' . price($objectsrc->total_tva) . ""; if ($mysoc->localtax1_assuj == "1" || $objectsrc->total_localtax1 != 0) // Localtax1 RE { print '' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '' . price($objectsrc->total_localtax1) . ""; @@ -1848,13 +1848,13 @@ if ($action == 'create' && $user->rights->commande->creer) print '' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '' . price($objectsrc->total_localtax2) . ""; } - print '' . $langs->trans('TotalTTC') . '' . price($objectsrc->total_ttc) . ""; + print '' . $langs->trans('AmountTTC') . '' . price($objectsrc->total_ttc) . ""; if (!empty($conf->multicurrency->enabled)) { - print '' . $langs->trans('MulticurrencyTotalHT') . '' . price($objectsrc->multicurrency_total_ht) . ''; - print '' . $langs->trans('MulticurrencyTotalVAT') . '' . price($objectsrc->multicurrency_total_tva) . ""; - print '' . $langs->trans('MulticurrencyTotalTTC') . '' . price($objectsrc->multicurrency_total_ttc) . ""; + print '' . $langs->trans('MulticurrencyAmountHT') . '' . price($objectsrc->multicurrency_total_ht) . ''; + print '' . $langs->trans('MulticurrencyAmountVAT') . '' . price($objectsrc->multicurrency_total_tva) . ""; + print '' . $langs->trans('MulticurrencyAmountTTC') . '' . price($objectsrc->multicurrency_total_ttc) . ""; } } diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index ecd776ea75f..e3fea0200dc 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -3245,8 +3245,8 @@ if ($action == 'create') echo ' ('.$langs->trans('LatestRelatedBill').end($objectsrc->linkedObjects['facture'])->getNomUrl(1).')'; } echo ''; - print '' . $langs->trans('TotalHT') . '' . price($objectsrc->total_ht) . ''; - print '' . $langs->trans('TotalVAT') . '' . price($objectsrc->total_tva) . ""; + print '' . $langs->trans('AmountHT') . '' . price($objectsrc->total_ht) . ''; + print '' . $langs->trans('AmountVAT') . '' . price($objectsrc->total_tva) . ""; if ($mysoc->localtax1_assuj == "1" || $objectsrc->total_localtax1 != 0) // Localtax1 { print '' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '' . price($objectsrc->total_localtax1) . ""; @@ -3256,7 +3256,7 @@ if ($action == 'create') { print '' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '' . price($objectsrc->total_localtax2) . ""; } - print '' . $langs->trans('TotalTTC') . '' . price($objectsrc->total_ttc) . ""; + print '' . $langs->trans('AmountTTC') . '' . price($objectsrc->total_ttc) . ""; if (!empty($conf->multicurrency->enabled)) { diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 485a04b6a02..d9434d018c3 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -1013,8 +1013,8 @@ if ($action == 'create') // Amount /* Hide amount because we only copy services so amount may differ than source - print '' . $langs->trans('TotalHT') . '' . price($objectsrc->total_ht) . ''; - print '' . $langs->trans('TotalVAT') . '' . price($objectsrc->total_tva) . ""; + print '' . $langs->trans('AmountHT') . '' . price($objectsrc->total_ht) . ''; + print '' . $langs->trans('AmountVAT') . '' . price($objectsrc->total_tva) . ""; if ($mysoc->localtax1_assuj == "1" || $objectsrc->total_localtax1 != 0) // Localtax1 RE { print '' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '' . price($objectsrc->total_localtax1) . ""; @@ -1025,13 +1025,13 @@ if ($action == 'create') print '' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '' . price($objectsrc->total_localtax2) . ""; } - print '' . $langs->trans('TotalTTC') . '' . price($objectsrc->total_ttc) . ""; + print '' . $langs->trans('AmountTTC') . '' . price($objectsrc->total_ttc) . ""; if (!empty($conf->multicurrency->enabled)) { - print '' . $langs->trans('MulticurrencyTotalHT') . '' . price($objectsrc->multicurrency_total_ht) . ''; - print '' . $langs->trans('MulticurrencyTotalVAT') . '' . price($objectsrc->multicurrency_total_tva) . ""; - print '' . $langs->trans('MulticurrencyTotalTTC') . '' . price($objectsrc->multicurrency_total_ttc) . ""; + print '' . $langs->trans('MulticurrencyAmountHT') . '' . price($objectsrc->multicurrency_total_ht) . ''; + print '' . $langs->trans('MulticurrencyAmountVAT') . '' . price($objectsrc->multicurrency_total_tva) . ""; + print '' . $langs->trans('MulticurrencyAmountTTC') . '' . price($objectsrc->multicurrency_total_ttc) . ""; } */ } diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 971c745886f..7c4b09a6f6c 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -1611,8 +1611,8 @@ if ($action=='create') $newclassname = $classname; print '' . $langs->trans($newclassname) . '' . $objectsrc->getNomUrl(1) . ''; - print '' . $langs->trans('TotalHT') . '' . price($objectsrc->total_ht) . ''; - print '' . $langs->trans('TotalVAT') . '' . price($objectsrc->total_tva) . ""; + print '' . $langs->trans('AmountHT') . '' . price($objectsrc->total_ht) . ''; + print '' . $langs->trans('AmountVAT') . '' . price($objectsrc->total_tva) . ""; if ($mysoc->localtax1_assuj == "1" || $objectsrc->total_localtax1 != 0) // Localtax1 RE { print '' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '' . price($objectsrc->total_localtax1) . ""; @@ -1623,13 +1623,13 @@ if ($action=='create') print '' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '' . price($objectsrc->total_localtax2) . ""; } - print '' . $langs->trans('TotalTTC') . '' . price($objectsrc->total_ttc) . ""; + print '' . $langs->trans('AmountTTC') . '' . price($objectsrc->total_ttc) . ""; if (!empty($conf->multicurrency->enabled)) { - print '' . $langs->trans('MulticurrencyTotalHT') . '' . price($objectsrc->multicurrency_total_ht) . ''; - print '' . $langs->trans('MulticurrencyTotalVAT') . '' . price($objectsrc->multicurrency_total_tva) . ''; - print '' . $langs->trans('MulticurrencyTotalTTC') . '' . price($objectsrc->multicurrency_total_ttc) . ''; + print '' . $langs->trans('MulticurrencyAmountHT') . '' . price($objectsrc->multicurrency_total_ht) . ''; + print '' . $langs->trans('MulticurrencyAmountVAT') . '' . price($objectsrc->multicurrency_total_tva) . ''; + print '' . $langs->trans('MulticurrencyAmountTTC') . '' . price($objectsrc->multicurrency_total_ttc) . ''; } } diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index b6e971bd4f5..2fc36516bc6 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2093,8 +2093,8 @@ if ($action == 'create') echo ' ('.$langs->trans('LatestRelatedBill').end($objectsrc->linkedObjects['invoice_supplier'])->getNomUrl(1).')'; } echo ''; - print ''.$langs->trans('TotalHT').''.price($objectsrc->total_ht).''; - print ''.$langs->trans('TotalVAT').''.price($objectsrc->total_tva).""; + print ''.$langs->trans('AmountHT').''.price($objectsrc->total_ht).''; + print ''.$langs->trans('AmountVAT').''.price($objectsrc->total_tva).""; if ($mysoc->localtax1_assuj=="1" || $object->total_localtax1 != 0) //Localtax1 { print ''.$langs->transcountry("AmountLT1", $mysoc->country_code).''.price($objectsrc->total_localtax1).""; @@ -2104,13 +2104,13 @@ if ($action == 'create') { print ''.$langs->transcountry("AmountLT2", $mysoc->country_code).''.price($objectsrc->total_localtax2).""; } - print ''.$langs->trans('TotalTTC').''.price($objectsrc->total_ttc).""; + print ''.$langs->trans('AmountTTC').''.price($objectsrc->total_ttc).""; if (!empty($conf->multicurrency->enabled)) { - print '' . $langs->trans('MulticurrencyTotalHT') . '' . price($objectsrc->multicurrency_total_ht) . ''; - print '' . $langs->trans('MulticurrencyTotalVAT') . '' . price($objectsrc->multicurrency_total_tva) . ""; - print '' . $langs->trans('MulticurrencyTotalTTC') . '' . price($objectsrc->multicurrency_total_ttc) . ""; + print '' . $langs->trans('MulticurrencyAmountHT') . '' . price($objectsrc->multicurrency_total_ht) . ''; + print '' . $langs->trans('MulticurrencyAmountVAT') . '' . price($objectsrc->multicurrency_total_tva) . ""; + print '' . $langs->trans('MulticurrencyAmountTTC') . '' . price($objectsrc->multicurrency_total_ttc) . ""; } } diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index d60175e3639..d5370a7361e 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -1209,8 +1209,8 @@ if ($action == 'create') print ''; print '' . $langs->trans('CommRequest') . '' . $objectsrc->getNomUrl(1) . ''; - print '' . $langs->trans('TotalHT') . '' . price($objectsrc->total_ht) . ''; - print '' . $langs->trans('TotalVAT') . '' . price($objectsrc->total_tva) . ""; + print '' . $langs->trans('AmountHT') . '' . price($objectsrc->total_ht) . ''; + print '' . $langs->trans('AmountVAT') . '' . price($objectsrc->total_tva) . ""; if ($mysoc->localtax1_assuj == "1" || $objectsrc->total_localtax1 != 0 ) // Localtax1 { print '' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '' . price($objectsrc->total_localtax1) . ""; @@ -1220,13 +1220,13 @@ if ($action == 'create') { print '' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '' . price($objectsrc->total_localtax2) . ""; } - print '' . $langs->trans('TotalTTC') . '' . price($objectsrc->total_ttc) . ""; + print '' . $langs->trans('AmountTTC') . '' . price($objectsrc->total_ttc) . ""; if (!empty($conf->multicurrency->enabled)) { - print '' . $langs->trans('MulticurrencyTotalHT') . '' . price($objectsrc->multicurrency_total_ht) . ''; - print '' . $langs->trans('MulticurrencyTotalVAT') . '' . price($objectsrc->multicurrency_total_tva) . ""; - print '' . $langs->trans('MulticurrencyTotalTTC') . '' . price($objectsrc->multicurrency_total_ttc) . ""; + print '' . $langs->trans('MulticurrencyAmountHT') . '' . price($objectsrc->multicurrency_total_ht) . ''; + print '' . $langs->trans('MulticurrencyAmountVAT') . '' . price($objectsrc->multicurrency_total_tva) . ""; + print '' . $langs->trans('MulticurrencyAmountTTC') . '' . price($objectsrc->multicurrency_total_ttc) . ""; } } From 9da84f68c7e466cd5ca5e2bcb94c3f8fc17c5075 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 Mar 2019 14:23:27 +0100 Subject: [PATCH 31/44] Bad language file for civility order --- htdocs/core/class/notify.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php index e7cd7cabe53..3ae3c9acf32 100644 --- a/htdocs/core/class/notify.class.php +++ b/htdocs/core/class/notify.class.php @@ -459,7 +459,7 @@ class Notify $dir_output = $conf->fournisseur->commande->dir_output; $object_type = 'order_supplier'; $mesg = $outputlangs->transnoentitiesnoconv("Hello").",\n\n"; - $mesg.= $outputlangs->transnoentitiesnoconv("EMailTextOrderValidatedBy",$newref,$user->getFullName($langs)); + $mesg.= $outputlangs->transnoentitiesnoconv("EMailTextOrderValidatedBy",$newref,$user->getFullName($outputlangs)); $mesg.= "\n\n".$outputlangs->transnoentitiesnoconv("Sincerely").".\n\n"; break; case 'ORDER_SUPPLIER_APPROVE': @@ -467,7 +467,7 @@ class Notify $dir_output = $conf->fournisseur->commande->dir_output; $object_type = 'order_supplier'; $mesg = $outputlangs->transnoentitiesnoconv("Hello").",\n\n"; - $mesg.= $outputlangs->transnoentitiesnoconv("EMailTextOrderApprovedBy",$newref,$user->getFullName($langs)); + $mesg.= $outputlangs->transnoentitiesnoconv("EMailTextOrderApprovedBy",$newref,$user->getFullName($outputlangs)); $mesg.= "\n\n".$outputlangs->transnoentitiesnoconv("Sincerely").".\n\n"; break; case 'ORDER_SUPPLIER_REFUSE': @@ -475,7 +475,7 @@ class Notify $dir_output = $conf->fournisseur->commande->dir_output; $object_type = 'order_supplier'; $mesg = $outputlangs->transnoentitiesnoconv("Hello").",\n\n"; - $mesg.= $outputlangs->transnoentitiesnoconv("EMailTextOrderRefusedBy",$newref,$user->getFullName($langs)); + $mesg.= $outputlangs->transnoentitiesnoconv("EMailTextOrderRefusedBy",$newref,$user->getFullName($outputlangs)); $mesg.= "\n\n".$outputlangs->transnoentitiesnoconv("Sincerely").".\n\n"; break; case 'SHIPPING_VALIDATE': From 1bd9d6a8e5ebad40b3b1aedaf19965791dfb7565 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 Mar 2019 15:02:43 +0100 Subject: [PATCH 32/44] Fix font awesome 5 picto for notes --- htdocs/core/lib/functions.lib.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 2a3410eae56..53bac454c8c 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2979,7 +2979,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ //if (in_array($picto, array('switch_off', 'switch_on', 'off', 'on'))) if (empty($srconly) && in_array($pictowithoutext, array( - 'bank', 'close_title', 'delete', 'edit', 'ellipsis-h', 'filter', 'grip', 'grip_title', 'list', 'listlight', 'off', 'on', 'play', 'playdisabled', 'printer', 'resize', + 'bank', 'close_title', 'delete', 'edit', 'ellipsis-h', 'filter', 'grip', 'grip_title', 'list', 'listlight', 'note', 'off', 'on', 'play', 'playdisabled', 'printer', 'resize', 'note', 'setup', 'sign-out', 'split', 'switch_off', 'switch_on', 'unlink', 'uparrow', '1downarrow', '1uparrow', '1leftarrow', '1rightarrow', 'jabber','skype','twitter','facebook','linkedin' ) @@ -3050,6 +3050,10 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ } elseif ($pictowithoutext == 'note') { $fakey = 'fa-sticky-note-o'; + if (empty($conf->global->MAIN_DISABLE_FONT_AWESOME_5)) + { + $fakey = 'fa-sticky-note'; $fa = 'far'; + } $facolor = '#999'; $marginleftonlyshort=1; } From ae6b672204bddd187bf3d8d2fea0ff62fee89e8e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 Mar 2019 15:04:38 +0100 Subject: [PATCH 33/44] Look and feel v10 --- htdocs/admin/menus.php | 2 +- htdocs/admin/menus/index.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/menus.php b/htdocs/admin/menus.php index f18b09b7d05..4c3c306cc59 100644 --- a/htdocs/admin/menus.php +++ b/htdocs/admin/menus.php @@ -155,7 +155,7 @@ print ''; dol_fiche_head($head, 'handler', $langs->trans("Menus"), -1); -print $langs->trans("MenusDesc")."
\n"; +print ''.$langs->trans("MenusDesc")."
\n"; print "
\n"; diff --git a/htdocs/admin/menus/index.php b/htdocs/admin/menus/index.php index 7fda7fca2ec..5283d9a3aca 100644 --- a/htdocs/admin/menus/index.php +++ b/htdocs/admin/menus/index.php @@ -237,7 +237,7 @@ $h++; dol_fiche_head($head, 'editor', $langs->trans("Menus"), -1); -print $langs->trans("MenusEditorDesc")."
\n"; +print ''.$langs->trans("MenusEditorDesc")."
\n"; print "
\n"; From 869f6680da99a0f7b5f8162c8bfe1e42639e122f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josep=20Llu=C3=ADs?= Date: Wed, 13 Mar 2019 15:43:34 +0100 Subject: [PATCH 34/44] FIX: free product description not printed The description of a free product/service is not printed on receipt. --- htdocs/takepos/receipt.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/takepos/receipt.php b/htdocs/takepos/receipt.php index d43c3195b92..ec1474828b9 100644 --- a/htdocs/takepos/receipt.php +++ b/htdocs/takepos/receipt.php @@ -3,6 +3,7 @@ * Copyright (C) 2011 Laurent Destailleur * Copyright (C) 2012 Marcos García * Copyright (C) 2018 Andreu Bisquerra + * Copyright (C) 2019 Josep Lluís Amador * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -84,7 +85,9 @@ print $object->ref; { ?> - product_label;?> + product_label)) echo $line->product_label; + else echo $line->description;?> + qty;?> total_ttc/$line->qty;?> total_ttc);?> From e0208cb3d66ae1c921e91feb222f5015a324d591 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 Mar 2019 18:11:15 +0100 Subject: [PATCH 35/44] Generation of PDF doc --- htdocs/core/class/utils.class.php | 3 +-- htdocs/langs/en_US/modulebuilder.lang | 2 +- htdocs/modulebuilder/index.php | 23 ++++++++++++++++++++--- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php index 4e6a989e12f..d3f8e55832a 100644 --- a/htdocs/core/class/utils.class.php +++ b/htdocs/core/class/utils.class.php @@ -705,9 +705,8 @@ class Utils $result = ($resarray['result'] == 0) ? 1 : 0; // Build PDF doc - $command=$conf->global->MODULEBUILDER_ASCIIDOCTORPDF.' '.$destfile.' -n -o '.$dirofmoduledoc.'/'.$FILENAMEDOC; + $command=$conf->global->MODULEBUILDER_ASCIIDOCTORPDF.' '.$destfile.' -n -o '.$dirofmoduledoc.'/'.$FILENAMEDOCPDF; $outfile=$dirofmoduletmp.'/outpdf.tmp'; - $resarray = $utils->executeCLI($command, $outfile); if ($resarray['result'] != '0') { diff --git a/htdocs/langs/en_US/modulebuilder.lang b/htdocs/langs/en_US/modulebuilder.lang index 371bc0c6ee5..329c4921ca3 100644 --- a/htdocs/langs/en_US/modulebuilder.lang +++ b/htdocs/langs/en_US/modulebuilder.lang @@ -40,7 +40,7 @@ PageForAgendaTab=PHP page for event tab PageForDocumentTab=PHP page for document tab PageForNoteTab=PHP page for note tab PathToModulePackage=Path to zip of module/application package -PathToModuleDocumentation=Path to file of module/application documentation +PathToModuleDocumentation=Path to file of module/application documentation (%s) SpaceOrSpecialCharAreNotAllowed=Spaces or special characters are not allowed. FileNotYetGenerated=File not yet generated RegenerateClassAndSql=Erase and regenerate class and sql files diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index af51071d674..b5559534a3b 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -930,7 +930,7 @@ if ($dirins && $action == 'generatepackage') if ($dirins && $action == 'generatedoc') { - $FILENAMEDOC=strtolower($module).'.html'; // TODO Use/text PDF + $FILENAMEDOC=strtolower($module).'.html'; $dirofmodule = dol_buildpath(strtolower($module), 0).'/doc'; $outputfiledoc = $dirofmodule.'/'.$FILENAMEDOC; @@ -947,6 +947,7 @@ if ($dirins && $action == 'generatedoc') } } + // Save file if ($action == 'savefile' && empty($cancel)) { @@ -2814,9 +2815,11 @@ elseif (! empty($module)) $outputfilezip = dol_buildpath($modulelowercase, 0).'/bin/'.$FILENAMEZIP; $FILENAMEDOC=$modulelowercase.'.html'; + $FILENAMEDOCPDF=$modulelowercase.'.pdf'; $outputfiledoc = dol_buildpath($modulelowercase, 0).'/doc/'.$FILENAMEDOC; $outputfiledocurl = dol_buildpath($modulelowercase, 1).'/doc/'.$FILENAMEDOC; - // TODO Use/test PDF + $outputfiledocpdf = dol_buildpath($modulelowercase, 0).'/doc/'.$FILENAMEDOCPDF; + $outputfiledocurlpdf = dol_buildpath($modulelowercase, 1).'/doc/'.$FILENAMEDOCPDF; } print '
'; @@ -2842,7 +2845,8 @@ elseif (! empty($module)) print '


'; - print ' '. $langs->trans("PathToModuleDocumentation") . ' : '; + // HTML + print ' '. $langs->trans("PathToModuleDocumentation", "HTML") . ' : '; if (! dol_is_file($outputfiledoc)) print ''.$langs->trans("FileNotYetGenerated").''; else { print ''; @@ -2854,6 +2858,19 @@ elseif (! empty($module)) } print '
'; + // PDF + print ' '. $langs->trans("PathToModuleDocumentation", "PDF") . ' : '; + if (! dol_is_file($outputfiledocpdf)) print ''.$langs->trans("FileNotYetGenerated").''; + else { + print ''; + print ''; + print $outputfiledocpdf; + print ''; + print ''; + print ' ('.$langs->trans("GeneratedOn").' '.dol_print_date(dol_filemtime($outputfiledocpdf), 'dayhour').')'; + } + print '

'; + print '
'; print ''; From e7cd8d690ce795494f0e2e4b5efa23f47b8aa14a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 Mar 2019 19:06:45 +0100 Subject: [PATCH 36/44] Remove warnings --- htdocs/comm/action/list.php | 4 ++-- htdocs/core/lib/functions.lib.php | 6 +++--- htdocs/hrm/index.php | 4 ++-- htdocs/modulebuilder/template/myobject_list.php | 4 +++- htdocs/ticket/list.php | 1 + 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index 8bf84f45cde..ded7d4fd238 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -691,11 +691,11 @@ if ($resql) // Date creation if (! empty($arrayfields['a.datec']['checked'])) { // Status/Percent - print ''.dol_print_date($obj->datec, 'dayhour').''; + print ''.dol_print_date($db->jdate($obj->datec), 'dayhour').''; } // Date update if (! empty($arrayfields['a.tms']['checked'])) { - print ''.dol_print_date($obj->datem, 'dayhour').''; + print ''.dol_print_date($db->jdate($obj->datem), 'dayhour').''; } if (! empty($arrayfields['a.percent']['checked'])) { // Status/Percent diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 53bac454c8c..dddd8506eb1 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1790,9 +1790,9 @@ function dol_print_date($time, $format = '', $tzoutput = 'tzserver', $outputlang if (preg_match('/^([0-9]+)\-([0-9]+)\-([0-9]+) ?([0-9]+)?:?([0-9]+)?:?([0-9]+)?/i', $time, $reg) || preg_match('/^([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])$/i', $time, $reg)) // Deprecated. Ex: 1970-01-01, 1970-01-01 01:00:00, 19700101010000 { - // TODO Remove this. - // This part of code should not be used. + // TODO Remove this. This part of code should not be used. dol_syslog("Functions.lib::dol_print_date function call with deprecated value of time in page ".$_SERVER["PHP_SELF"], LOG_ERR); + //if (function_exists('debug_print_backtrace')) debug_print_backtrace(); // Date has format 'YYYY-MM-DD' or 'YYYY-MM-DD HH:MM:SS' or 'YYYYMMDDHHMMSS' $syear = (! empty($reg[1]) ? $reg[1] : ''); $smonth = (! empty($reg[2]) ? $reg[2] : ''); @@ -1801,7 +1801,7 @@ function dol_print_date($time, $format = '', $tzoutput = 'tzserver', $outputlang $smin = (! empty($reg[5]) ? $reg[5] : ''); $ssec = (! empty($reg[6]) ? $reg[6] : ''); - $time=dol_mktime($shour, $smin, $ssec, $smonth, $sday, $syear, true); + $time=²($shour, $smin, $ssec, $smonth, $sday, $syear, true); $ret=adodb_strftime($format, $time+$offsettz+$offsetdst, $to_gmt); } else diff --git a/htdocs/hrm/index.php b/htdocs/hrm/index.php index 3751935b81c..2985386676f 100644 --- a/htdocs/hrm/index.php +++ b/htdocs/hrm/index.php @@ -226,8 +226,8 @@ if (! empty($conf->holiday->enabled) && $user->rights->holiday->read) $starthalfday=($obj->halfday == -1 || $obj->halfday == 2)?'afternoon':'morning'; $endhalfday=($obj->halfday == 1 || $obj->halfday == 2)?'morning':'afternoon'; - print ''.dol_print_date($obj->date_start, 'day').' '.$langs->trans($listhalfday[$starthalfday]); - print ''.dol_print_date($obj->date_end, 'day').' '.$langs->trans($listhalfday[$endhalfday]); + print ''.dol_print_date($db->jdate($obj->date_start), 'day').' '.$langs->trans($listhalfday[$starthalfday]); + print ''.dol_print_date($db->jdate($obj->date_end), 'day').' '.$langs->trans($listhalfday[$endhalfday]); print ''.dol_print_date($db->jdate($obj->dm), 'day').''; print ''.$holidaystatic->LibStatut($obj->status, 3).''; print ''; diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index d4193118c75..35c60248ccf 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -503,7 +503,9 @@ while ($i < min($num, $limit)) print $val['css']; if ($cssforfield || $val['css']) print '"'; print '>'; - print $object->showOutputField($val, $key, $obj->$key, ''); + if ($key == 'status') print $object->getLibStatut(5); + elseif (in_array($val['type'], array('date','datetime','timestamp'))) print $object->showOutputField($val, $key, $db->jdate($obj->$key), ''); + else print $object->showOutputField($val, $key, $obj->$key, ''); print ''; if (! $i) $totalarray['nbfield']++; if (! empty($val['isameasure'])) diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index 7b61bd7c1b5..02e441adba0 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -640,6 +640,7 @@ while ($i < min($num, $limit)) if ($cssforfield || $val['css']) print '"'; print '>'; if ($key == 'fk_statut') print $object->getLibStatut(5); + elseif (in_array($val['type'], array('date','datetime','timestamp'))) print $object->showOutputField($val, $key, $db->jdate($obj->$key), ''); else print $object->showOutputField($val, $key, $obj->$key, ''); print ''; if (! $i) $totalarray['nbfield']++; From fcbd39fda9966510d6d683c801be6c87c8df1749 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 Mar 2019 19:07:19 +0100 Subject: [PATCH 37/44] Fix typo --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index dddd8506eb1..305b53dc37f 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1801,7 +1801,7 @@ function dol_print_date($time, $format = '', $tzoutput = 'tzserver', $outputlang $smin = (! empty($reg[5]) ? $reg[5] : ''); $ssec = (! empty($reg[6]) ? $reg[6] : ''); - $time=²($shour, $smin, $ssec, $smonth, $sday, $syear, true); + $time=dol_mktime($shour, $smin, $ssec, $smonth, $sday, $syear, true); $ret=adodb_strftime($format, $time+$offsettz+$offsetdst, $to_gmt); } else From c3c7e3c1fb8180c169ffc2917ecc4c73d52f5839 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 Mar 2019 19:08:45 +0100 Subject: [PATCH 38/44] Remove warning on date --- htdocs/bom/bom_list.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/bom/bom_list.php b/htdocs/bom/bom_list.php index b078c29c99b..b0ffd62155c 100644 --- a/htdocs/bom/bom_list.php +++ b/htdocs/bom/bom_list.php @@ -467,7 +467,9 @@ while ($i < min($num, $limit)) print $val['css']; if ($cssforfield || $val['css']) print '"'; print '>'; - print $object->showOutputField($val, $key, $obj->$key, ''); + if ($key == 'status') print $object->getLibStatut(5); + elseif (in_array($val['type'], array('date','datetime','timestamp'))) print $object->showOutputField($val, $key, $db->jdate($obj->$key), ''); + else print $object->showOutputField($val, $key, $obj->$key, ''); print ''; if (! $i) $totalarray['nbfield']++; if (! empty($val['isameasure'])) From 965f5861b3d795ba84008c129036f28e66bce33c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 14 Mar 2019 09:10:26 +0100 Subject: [PATCH 39/44] Update commoninvoice.class.php --- htdocs/core/class/commoninvoice.class.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php index ec2f539369f..8ea15b31938 100644 --- a/htdocs/core/class/commoninvoice.class.php +++ b/htdocs/core/class/commoninvoice.class.php @@ -517,7 +517,6 @@ abstract class CommonInvoice extends CommonObject return dolGetStatus($labelstatut, $labelstatutShort, '', $statusType, $mode); - } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps From ba749ffc8cd082e4eb1a014e71d9e2a3d4c0c0a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 14 Mar 2019 09:14:29 +0100 Subject: [PATCH 40/44] Update product.class.php --- htdocs/product/class/product.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 8d446682dfd..f186c1d21da 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -4168,7 +4168,7 @@ class Product extends CommonObject case 2: return $this->LibStatut($status, 3, 2).' '.$this->LibStatut($status, 1, 2); case 3: - return dolGetStatus($langs->trans('ProductStatusNotOnBatch'), '','',empty($status)?'status5':'status4',3,'dot'); + return dolGetStatus($langs->trans('ProductStatusNotOnBatch'), '', '', empty($status)?'status5':'status4', 3, 'dot'); case 4: return $this->LibStatut($status, 3, 2).' '.$this->LibStatut($status, 0, 2); case 5: @@ -4213,11 +4213,11 @@ class Product extends CommonObject if($mode>6){ - return dolGetStatus($langs->trans('Unknown'),'', '', 'status0', 0); + return dolGetStatus($langs->trans('Unknown'), '', '', 'status0', 0); } else{ return dolGetStatus($labelstatut, $labelstatutShort, '', $statuttrans, $mode); - } + } } From bb14562f7b3cf950a5ffd7c6e49daf79f05001f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 14 Mar 2019 09:17:40 +0100 Subject: [PATCH 41/44] Update global.inc.php --- htdocs/theme/eldy/global.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 1cbda302574..ae557aeb885 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1630,7 +1630,7 @@ a.tmenuimage:hover{ else { print "/* A mainmenu entry was found but img file ".$val.".png not found (check /".$val."/img/".$val.".png), so we use a generic one */\n"; - $url=dol_buildpath($path.'/theme/'.$theme.'/img/menus/generic'.(min($generic,4))."_over.png", 1); + $url=dol_buildpath($path.'/theme/'.$theme.'/img/menus/generic'.(min($generic, 4))."_over.png", 1); print "div.mainmenu.".$val." {\n"; print " background-image: url(".$url.");\n"; print "}\n"; From 9be780f47df4622a24831d1bbed137b50d939b54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 14 Mar 2019 09:18:51 +0100 Subject: [PATCH 42/44] Update style.css.php --- htdocs/theme/md/style.css.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index a294ddf4b86..cebdaad8164 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1824,7 +1824,7 @@ foreach($mainmenuusedarray as $val) else { print "/* A mainmenu entry was found but img file ".$val.".png not found (check /".$val."/img/".$val.".png), so we use a generic one */\n"; - $url=dol_buildpath($path.'/theme/'.$theme.'/img/menus/generic'.(min($generic,4))."_over.png", 1); + $url=dol_buildpath($path.'/theme/'.$theme.'/img/menus/generic'.(min($generic, 4))."_over.png", 1); print "div.mainmenu.".$val." {\n"; print " background-image: url(".$url.");\n"; print "}\n"; From f8a4d9075ba22c8dbf52e6c2d3d7b53b25b970ef Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 Mar 2019 11:48:25 +0100 Subject: [PATCH 43/44] Fix css for fontawesome 5 --- htdocs/admin/bank.php | 62 ++++++++++----------------- htdocs/core/class/translate.class.php | 2 +- htdocs/core/lib/functions.lib.php | 12 +++++- 3 files changed, 35 insertions(+), 41 deletions(-) diff --git a/htdocs/admin/bank.php b/htdocs/admin/bank.php index 9fc256540a2..2a0a66fe269 100644 --- a/htdocs/admin/bank.php +++ b/htdocs/admin/bank.php @@ -50,8 +50,8 @@ $type = 'bankaccount'; //Order display of bank account if ($action == 'setbankorder') { - if (dolibarr_set_const($db, "BANK_SHOW_ORDER_OPTION", - GETPOST('value', 'alpha'), 'chaine', 0, '', $conf->entity) > 0) { + if (dolibarr_set_const($db, "BANK_SHOW_ORDER_OPTION", GETPOST('value', 'alpha'), 'chaine', 0, '', $conf->entity) > 0) + { header("Location: " . $_SERVER["PHP_SELF"]); exit; } @@ -62,8 +62,8 @@ if ($action == 'setbankorder') { //Auto report last num releve on conciliate if ($action == 'setreportlastnumreleve') { - if (dolibarr_set_const($db, "BANK_REPORT_LAST_NUM_RELEVE", 1, 'chaine', 0, - '', $conf->entity) > 0) { + if (dolibarr_set_const($db, "BANK_REPORT_LAST_NUM_RELEVE", 1, 'chaine', 0, '', $conf->entity) > 0) + { header("Location: " . $_SERVER["PHP_SELF"]); exit; } @@ -72,8 +72,8 @@ if ($action == 'setreportlastnumreleve') { } } elseif ($action == 'unsetreportlastnumreleve') { - if (dolibarr_set_const($db, "BANK_REPORT_LAST_NUM_RELEVE", 0, 'chaine', 0, - '', $conf->entity) > 0) { + if (dolibarr_set_const($db, "BANK_REPORT_LAST_NUM_RELEVE", 0, 'chaine', 0, '', $conf->entity) > 0) + { header("Location: " . $_SERVER["PHP_SELF"]); exit; } @@ -100,8 +100,7 @@ if ($action == 'specimen') { $filefound = 0; $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); foreach ($dirmodels as $reldir) { - $file = dol_buildpath($reldir . "core/modules/bank/doc/pdf_" . $modele . ".modules.php", - 0); + $file = dol_buildpath($reldir . "core/modules/bank/doc/pdf_" . $modele . ".modules.php", 0); if (file_exists($file)) { $filefound = 1; $classname = "pdf_" . $modele; @@ -142,8 +141,7 @@ elseif ($action == 'del') { } // Set default model elseif ($action == 'setdoc') { - if (dolibarr_set_const($db, "BANKADDON_PDF", $value, 'chaine', 0, '', - $conf->entity)) { + if (dolibarr_set_const($db, "BANKADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) { // The constant that was read before the new set // We therefore requires a variable to have a coherent view $conf->global->BANKADDON_PDF = $value; @@ -169,8 +167,7 @@ $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); llxHeader("", $langs->trans("BankSetupModule")); $linkback = '' . $langs->trans("BackToModuleList") . ''; -print load_fiche_titre($langs->trans("BankSetupModule"), $linkback, - 'title_setup'); +print load_fiche_titre($langs->trans("BankSetupModule"), $linkback, 'title_setup'); $head = bank_admin_prepare_head(null); dol_fiche_head($head, 'general', $langs->trans("BankSetupModule"), -1, 'account'); @@ -252,7 +249,7 @@ if ($resql) { while ($i < $num_rows) { $array = $db->fetch_array($resql); array_push($def, $array[0]); - $i ++; + $i++; } } else { @@ -285,8 +282,7 @@ foreach ($dirmodels as $reldir) { arsort($filelist); foreach ($filelist as $file) { - if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', - $file)) { + if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) { if (file_exists($dir . '/' . $file)) { $name = substr($file, 4, dol_strlen($file) - 16); @@ -296,11 +292,9 @@ foreach ($dirmodels as $reldir) { $module = new $classname($db); $modulequalified = 1; - if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL - < 2) + if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified = 0; - if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL - < 1) + if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified = 0; if ($modulequalified) { @@ -317,27 +311,23 @@ foreach ($dirmodels as $reldir) { if (in_array($name, $def)) { print '' . "\n"; print ''; - print img_picto($langs->trans("Enabled"), - 'switch_on'); + print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''; } else { print '' . "\n"; - print '' . img_picto($langs->trans("Disabled"), - 'switch_off') . ''; + print '' . img_picto($langs->trans("Disabled"), 'switch_off') . ''; print ""; } // Default print ''; if ($conf->global->BANKADDON_PDF == $name) { - print img_picto($langs->trans("Default"), - 'on'); + print img_picto($langs->trans("Default"), 'on'); } else { - print '' . img_picto($langs->trans("Disabled"), - 'off') . ''; + print '' . img_picto($langs->trans("Disabled"), 'off') . ''; } print ''; @@ -348,30 +338,25 @@ foreach ($dirmodels as $reldir) { $htmltooltip .= '
' . $langs->trans("Width") . '/' . $langs->trans("Height") . ': ' . $module->page_largeur . '/' . $module->page_hauteur; } $htmltooltip .= '

' . $langs->trans("FeaturesSupported") . ':'; - $htmltooltip .= '
' . $langs->trans("Logo") . ': ' . yn($module->option_logo, - 1, 1); + $htmltooltip .= '
' . $langs->trans("Logo") . ': ' . yn($module->option_logo, 1, 1); //$htmltooltip .= '
' . $langs->trans("PaymentMode") . ': ' . yn($module->option_modereg, 1, 1); //$htmltooltip .= '
' . $langs->trans("PaymentConditions") . ': ' . yn($module->option_condreg, 1, 1); - $htmltooltip .= '
' . $langs->trans("MultiLanguage") . ': ' . yn($module->option_multilang, - 1, 1); + $htmltooltip .= '
' . $langs->trans("MultiLanguage") . ': ' . yn($module->option_multilang, 1, 1); // $htmltooltip.='
'.$langs->trans("Discounts").': '.yn($module->option_escompte,1,1); // $htmltooltip.='
'.$langs->trans("CreditNote").': '.yn($module->option_credit_note,1,1); //$htmltooltip .= '
' . $langs->trans("WatermarkOnDraftOrders") . ': ' . yn($module->option_draft_watermark, 1, 1); print ''; - print $form->textwithpicto('', $htmltooltip, 1, - 0); + print $form->textwithpicto('', $htmltooltip, 1, 0); print ''; // Preview print ''; if ($module->type == 'pdf') { - print '' . img_object($langs->trans("Preview"), - 'bill') . ''; + print '' . img_object($langs->trans("Preview"), 'bill') . ''; } else { - print img_object($langs->trans("PreviewNotAvailable"), - 'generic'); + print img_object($langs->trans("PreviewNotAvailable"), 'generic'); } print ''; @@ -423,8 +408,7 @@ if ($conf->global->BANK_REPORT_LAST_NUM_RELEVE) { else { print '' . "\n"; - print '' . img_picto($langs->trans("Disabled"), - 'switch_off') . ''; + print '' . img_picto($langs->trans("Disabled"), 'switch_off') . ''; print ""; } diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index 56ae3405a98..f8cb32896f2 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -944,7 +944,7 @@ class Translate * If mb_convert_encoding is not available, return currency code. * * @param string $currency_code Currency code - * @param integer $forceloadall 1=Force to load all currencies into cache. We know we need to use all of them. By default read and cache only required currency. + * @param integer $forceloadall 1=Force to load all currencies into cache. We know we need to use all of them. By default read and cache only the requested currency. * @return string Currency symbol encoded into UTF8 */ public function getCurrencySymbol($currency_code, $forceloadall = 0) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 305b53dc37f..8750b943685 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3005,10 +3005,20 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ } elseif ($pictowithoutext == 'off') { $fakey = 'fa-square-o'; + if (empty($conf->global->MAIN_DISABLE_FONT_AWESOME_5)) + { + $fakey = 'fa-square'; + $fa='far'; + } $fasize = '1.3em'; } elseif ($pictowithoutext == 'on') { $fakey = 'fa-check-square-o'; + if (empty($conf->global->MAIN_DISABLE_FONT_AWESOME_5)) + { + $fakey = 'fa-check-square'; + $fa='far'; + } $fasize = '1.3em'; } elseif ($pictowithoutext == 'bank') { @@ -4385,7 +4395,7 @@ function price($amount, $form = 0, $outlangs = '', $trunc = 1, $rounding = -1, $ { if ($currency_code == 'auto') $currency_code=$conf->currency; - $listofcurrenciesbefore=array('USD','GBP','AUD','MXN','PEN','CNY'); + $listofcurrenciesbefore=array('USD','GBP','AUD','HKD','MXN','PEN','CNY'); $listoflanguagesbefore=array('nl_NL'); if (in_array($currency_code, $listofcurrenciesbefore) || in_array($outlangs->defaultlang, $listoflanguagesbefore)) { From d7735ff272606e9f34e425283dc9643b7797b608 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 Mar 2019 14:15:35 +0100 Subject: [PATCH 44/44] FIX #10822 --- htdocs/expedition/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 6d5d8b17ffa..6d9bba9b464 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -2121,7 +2121,7 @@ else if ($id || $ref) if ($obj) { // $obj->rowid is rowid in $origin."det" table - $alreadysent[$obj->rowid][$obj->shipmentline_id]=array('shipment_ref'=>$obj->shipment_ref, 'shipment_id'=>$obj->shipment_id, 'warehouse'=>$obj->fk_entrepot, 'qty_shipped'=>$obj->qty_shipped, 'date_valid'=>$obj->date_valid, 'date_delivery'=>$obj->date_delivery); + $alreadysent[$obj->rowid][$obj->shipmentline_id]=array('shipment_ref'=>$obj->shipment_ref, 'shipment_id'=>$obj->shipment_id, 'warehouse'=>$obj->fk_entrepot, 'qty_shipped'=>$obj->qty_shipped, 'date_valid'=>$db->jdate($obj->date_valid), 'date_delivery'=>$db->jdate($obj->date_delivery)); } $i++; }