diff --git a/.editorconfig b/.editorconfig index 3e3bd16bb34..7df89a90eb3 100644 --- a/.editorconfig +++ b/.editorconfig @@ -9,8 +9,6 @@ charset = utf-8 end_of_line = lf insert_final_newline = true -# PHP PSR-2 Coding Standards -# http://www.php-fig.org/psr/psr-2/ [*.php] indent_style = tab indent_size = 4 diff --git a/.scrutinizer.yml b/.scrutinizer.yml index 7c43ab24aef..6dbf39bde26 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -194,22 +194,6 @@ tools: - 'test/*' - 'htdocs/includes/*' paths: { } - - php_changetracking: - enabled: false - bug_patterns: - - '\bfix(?:es|ed)?\b' - feature_patterns: - - '\badd(?:s|ed)?\b' - - '\bimplement(?:s|ed)?\b' - filter: - excluded_paths: - - 'build/*' - - 'dev/*' - - 'doc/*' - - 'test/*' - - 'htdocs/includes/*' - paths: { } # Coding-Style / Bug Detection js_hint: diff --git a/README.md b/README.md index 3f329c678a7..f611f333e6a 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ Other licenses apply for some included dependencies. See [COPYRIGHT](https://git If you have low technical skills and you're looking to install Dolibarr ERP/CRM in just a few clicks, you can use one of the packaged versions: - [DoliWamp for Windows](https://wiki.dolibarr.org/index.php/Dolibarr_for_Windows_(DoliWamp) -- DoliDeb for Debian or Ubuntu +- [DoliDeb for Debian](https://wiki.dolibarr.org/index.php/Dolibarr_for_Ubuntu_or_Debian - DoliRpm for Redhat, Fedora, OpenSuse, Mandriva or Mageia Releases can be downloaded from [official website](https://www.dolibarr.org/). diff --git a/dev/setup/codesniffer/ruleset.xml b/dev/setup/codesniffer/ruleset.xml index e4bdefaecd4..ad26c7f0bdc 100644 --- a/dev/setup/codesniffer/ruleset.xml +++ b/dev/setup/codesniffer/ruleset.xml @@ -23,13 +23,12 @@ - - 0 - + - + + @@ -38,8 +37,7 @@ - - + @@ -69,19 +67,11 @@ - + - - - @@ -101,19 +91,33 @@ + + + + 0 - - + + + @@ -129,7 +133,7 @@ - + @@ -183,6 +187,13 @@ + + + + + @@ -192,13 +203,10 @@ - - 0 - - - 0 - - + + + + 0 @@ -210,7 +218,6 @@ - 0 @@ -222,23 +229,16 @@ + - - - - - - 0 - + - - 0 - + 0 @@ -247,67 +247,38 @@ 0 - 0 - 0 - 0 - - - - - - 5 - - - - + 0 - 0 - - - - 0 - + - 0 + + + + 0 @@ -344,6 +315,7 @@ 0 + 0 diff --git a/dev/tools/test/testdiv.php b/dev/tools/test/testdiv.php deleted file mode 100644 index 438df80b69e..00000000000 --- a/dev/tools/test/testdiv.php +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - -Login Dolibarr 3.4.0-alpha - - - - - - - - - - - -
- - - -
- - - - diff --git a/doc/images/background_dolibarr.jpg b/doc/images/background_dolibarr.jpg new file mode 100644 index 00000000000..6c4cc11460d Binary files /dev/null and b/doc/images/background_dolibarr.jpg differ diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php index 22813024328..45b0c909016 100644 --- a/htdocs/accountancy/customer/lines.php +++ b/htdocs/accountancy/customer/lines.php @@ -1,6 +1,6 @@ - * Copyright (C) 2013-2016 Alexandre Spangaro + * Copyright (C) 2013-2020 Alexandre Spangaro * Copyright (C) 2014-2015 Ari Elbaz (elarifr) * Copyright (C) 2014-2016 Florian Henry * Copyright (C) 2014 Juanjo Menent @@ -27,10 +27,11 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; @@ -42,6 +43,7 @@ $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' $account_parent = GETPOST('account_parent'); $changeaccount = GETPOST('changeaccount'); // Search Getpost +$search_societe = GETPOST('search_societe', 'alpha'); $search_lineid = GETPOST('search_lineid', 'int'); $search_ref = GETPOST('search_ref', 'alpha'); $search_invoice = GETPOST('search_invoice', 'alpha'); @@ -89,6 +91,7 @@ $formaccounting = new FormAccounting($db); // Purge search criteria if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers { + $search_societe=''; $search_lineid = ''; $search_ref = ''; $search_invoice = ''; @@ -175,7 +178,7 @@ $sql .= " s.rowid as socid, s.nom as name, s.code_compta, s.code_client,"; $sql .= " p.rowid as product_id, p.fk_product_type as product_type, p.ref as product_ref, p.label as product_label, p.accountancy_code_sell, aa.rowid as fk_compte, aa.account_number, aa.label as label_compte,"; $sql .= " fd.situation_percent,"; $sql .= " co.code as country_code, co.label as country,"; -$sql .= " s.tva_intra"; +$sql .= " s.rowid as socid, s.nom as name, s.tva_intra, s.email, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta as code_compta_client, s.code_compta_fournisseur"; $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; @@ -193,6 +196,10 @@ if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { } else { $sql .= " AND f.type IN (".Facture::TYPE_STANDARD.",".Facture::TYPE_STANDARD.",".Facture::TYPE_CREDIT_NOTE.",".Facture::TYPE_DEPOSIT.",".Facture::TYPE_SITUATION.")"; } +// Add search filter like +if ($search_societe) { + $sql .= natural_search('s.nom', $search_societe); +} if ($search_lineid) { $sql .= natural_search("fd.rowid", $search_lineid, 1); } @@ -262,6 +269,7 @@ if ($result) { $param = ''; if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage); if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit); + if ($search_societe) $param .= "&search_societe=".urlencode($search_societe); if ($search_invoice) $param .= "&search_invoice=".urlencode($search_invoice); if ($search_ref) $param .= "&search_ref=".urlencode($search_ref); if ($search_label) $param .= "&search_label=".urlencode($search_label); @@ -296,7 +304,7 @@ if ($result) { print ''."\n"; print ''; - print ''; + print ''; print ''; print ''; print ''; print ''; + print ''; print '\n"; + $thirdpartystatic=new Societe($db); $facture_static = new Facture($db); $product_static = new Product($db); @@ -347,6 +358,17 @@ if ($result) { $facture_static->id = $objp->facid; $facture_static->type = $objp->ftype; + $thirdpartystatic->id = $objp->socid; + $thirdpartystatic->name = $objp->name; + $thirdpartystatic->client = $objp->client; + $thirdpartystatic->fournisseur = $objp->fournisseur; + $thirdpartystatic->code_client = $objp->code_client; + $thirdpartystatic->code_compta_client = $objp->code_compta_client; + $thirdpartystatic->code_fournisseur = $objp->code_fournisseur; + $thirdpartystatic->code_compta_fournisseur = $objp->code_compta_fournisseur; + $thirdpartystatic->email = $objp->email; + $thirdpartystatic->country_code = $objp->country_code; + $product_static->ref = $objp->product_ref; $product_static->id = $objp->product_id; $product_static->label = $objp->product_label; @@ -380,6 +402,9 @@ if ($result) { print ''; + // Thirdparty + print ''; + // Country print ''; - print ''; + print ''; print ''; print ''; print ''; print ''; + print ''; print '\n"; + $thirdpartystatic = new Societe($db); $facture_static = new Facture($db); $product_static = new Product($db); @@ -421,6 +431,17 @@ if ($result) { $objp->code_sell_l = ''; $objp->code_sell_p = ''; + $thirdpartystatic->id = $objp->socid; + $thirdpartystatic->name = $objp->name; + $thirdpartystatic->client = $objp->client; + $thirdpartystatic->fournisseur = $objp->fournisseur; + $thirdpartystatic->code_client = $objp->code_client; + $thirdpartystatic->code_compta_client = $objp->code_compta_client; + $thirdpartystatic->code_fournisseur = $objp->code_fournisseur; + $thirdpartystatic->code_compta_fournisseur = $objp->code_compta_fournisseur; + $thirdpartystatic->email = $objp->email; + $thirdpartystatic->country_code = $objp->country_code; + $product_static->ref = $objp->product_ref; $product_static->id = $objp->product_id; $product_static->type = $objp->type; @@ -558,6 +579,9 @@ if ($result) { print vatrate($objp->tva_tx_line.($objp->vat_src_code ? ' ('.$objp->vat_src_code.')' : '')); print ''; + // Thirdparty + print ''; + // Country print ''; print ''; print ''; + if (! empty($conf->global->ACCOUNTANCY_USE_EXPENSE_REPORT_VALIDATION_DATE)) { + print ''; + } print ''; print_liste_field_titre("LineId", $_SERVER["PHP_SELF"], "erd.rowid", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("ExpenseReport", $_SERVER["PHP_SELF"], "er.ref", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "erd.date, erd.rowid", "", $param, '', $sortfield, $sortorder, 'center '); + if (! empty($conf->global->ACCOUNTANCY_USE_EXPENSE_REPORT_VALIDATION_DATE)) { + print_liste_field_titre("DateValidation", $_SERVER["PHP_SELF"], "er.date_valid", "", $param, '', $sortfield, $sortorder, 'center '); + } + print_liste_field_titre("DateOfLine", $_SERVER["PHP_SELF"], "erd.date, erd.rowid", "", $param, '', $sortfield, $sortorder, 'center '); print_liste_field_titre("TypeFees", $_SERVER["PHP_SELF"], "f.label", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "erd.comments", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "erd.total_ht", "", $param, '', $sortfield, $sortorder, 'right '); @@ -299,6 +305,11 @@ if ($result) { // Ref Invoice print ''; + // Date validation + if (! empty($conf->global->ACCOUNTANCY_USE_EXPENSE_REPORT_VALIDATION_DATE)) { + print ''; + } + print ''; print ''; diff --git a/htdocs/accountancy/expensereport/list.php b/htdocs/accountancy/expensereport/list.php index e03c717039f..96eebd49b36 100644 --- a/htdocs/accountancy/expensereport/list.php +++ b/htdocs/accountancy/expensereport/list.php @@ -42,6 +42,9 @@ $massaction = GETPOST('massaction', 'alpha'); $show_files = GETPOST('show_files', 'int'); $confirm = GETPOST('confirm', 'alpha'); $toselect = GETPOST('toselect', 'array'); +$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'myobjectlist'; // To manage different context of search +$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') + // Select Box $mesCasesCochees = GETPOST('toselect', 'array'); @@ -183,7 +186,7 @@ if (empty($chartaccountcode)) } // Expense report lines -$sql = "SELECT er.ref, er.rowid as erid, er.date_debut,"; +$sql = "SELECT er.ref, er.rowid as erid, er.date_debut, er.date_valid,"; $sql .= " erd.rowid, erd.fk_c_type_fees, erd.comments, erd.total_ht as price, erd.fk_code_ventilation, erd.tva_tx as tva_tx_line, erd.vat_src_code, erd.date,"; $sql .= " f.id as type_fees_id, f.code as type_fees_code, f.label as type_fees_label, f.accountancy_code as code_buy,"; $sql .= " aa.rowid as aarowid"; @@ -240,8 +243,8 @@ if ($result) { $arrayofselected = is_array($toselect) ? $toselect : array(); $param = ''; - if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.$contextpage; - if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.$limit; + if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage); + if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit); if ($search_lineid) $param .= '&search_lineid='.urlencode($search_lineid); if ($search_day) $param .= '&search_day='.urlencode($search_day); if ($search_month) $param .= '&search_month='.urlencode($search_month); @@ -288,6 +291,9 @@ if ($result) { print ''; print ''; print ''; + if (! empty($conf->global->ACCOUNTANCY_USE_EXPENSE_REPORT_VALIDATION_DATE)) { + print ''; + } print ''; print_liste_field_titre("LineId", $_SERVER["PHP_SELF"], "erd.rowid", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("ExpenseReport", $_SERVER["PHP_SELF"], "er.ref", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "erd.date, erd.rowid", "", $param, '', $sortfield, $sortorder, 'center '); + if (! empty($conf->global->ACCOUNTANCY_USE_EXPENSE_REPORT_VALIDATION_DATE)) { + print_liste_field_titre("DateValidation", $_SERVER["PHP_SELF"], "er.date_valid", "", $param, '', $sortfield, $sortorder, 'center '); + } + print_liste_field_titre("DateOfLine", $_SERVER["PHP_SELF"], "erd.date, erd.rowid", "", $param, '', $sortfield, $sortorder, 'center '); print_liste_field_titre("TypeFees", $_SERVER["PHP_SELF"], "f.label", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "erd.comments", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "erd.total_ht", "", $param, '', $sortfield, $sortorder, 'right maxwidth50 '); @@ -341,6 +350,11 @@ if ($result) { // Ref Expense report print ''; + // Date validation + if (! empty($conf->global->ACCOUNTANCY_USE_EXPENSE_REPORT_VALIDATION_DATE)) { + print ''; + } + // Date print ''; diff --git a/htdocs/accountancy/supplier/lines.php b/htdocs/accountancy/supplier/lines.php index 0c062b95057..f3a4b255f3e 100644 --- a/htdocs/accountancy/supplier/lines.php +++ b/htdocs/accountancy/supplier/lines.php @@ -1,6 +1,6 @@ - * Copyright (C) 2013-2017 Alexandre Spangaro + * Copyright (C) 2013-2020 Alexandre Spangaro * Copyright (C) 2014-2015 Ari Elbaz (elarifr) * Copyright (C) 2013-2016 Florian Henry * Copyright (C) 2014 Juanjo Menent @@ -27,12 +27,13 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; @@ -44,6 +45,7 @@ $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' $account_parent = GETPOST('account_parent'); $changeaccount = GETPOST('changeaccount'); // Search Getpost +$search_societe = GETPOST('search_societe', 'alpha'); $search_lineid = GETPOST('search_lineid', 'int'); $search_ref = GETPOST('search_ref', 'alpha'); $search_invoice = GETPOST('search_invoice', 'alpha'); @@ -91,6 +93,7 @@ $formaccounting = new FormAccounting($db); // Purge search criteria if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers { + $search_societe = ''; $search_lineid = ''; $search_ref = ''; $search_invoice = ''; @@ -177,7 +180,7 @@ $sql .= " l.rowid, l.fk_product, l.product_type as line_type, l.description, l.t $sql .= " aa.label, aa.account_number, "; $sql .= " p.rowid as product_id, p.fk_product_type as product_type, p.ref as product_ref, p.label as product_label, p.fk_product_type as type,"; $sql .= " co.code as country_code, co.label as country,"; -$sql .= " s.tva_intra"; +$sql .= " s.rowid as socid, s.nom as name, s.tva_intra, s.email, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta as code_compta_client, s.code_compta_fournisseur"; $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; @@ -188,6 +191,10 @@ $sql .= " INNER JOIN ".MAIN_DB_PREFIX."facture_fourn as f ON f.rowid = l.fk_fact $sql .= " INNER JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = f.fk_soc"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as co ON co.rowid = s.fk_pays "; $sql .= " WHERE f.rowid = l.fk_facture_fourn and f.fk_statut >= 1 AND l.fk_code_ventilation <> 0 "; +// Add search filter like +if ($search_societe) { + $sql .= natural_search('s.nom', $search_societe); +} if ($search_lineid) { $sql .= natural_search("l.rowid", $search_lineid, 1); } @@ -264,6 +271,7 @@ if ($result) { $param = ''; if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage); if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit); + if ($search_societe) $param .= "&search_societe=" . urlencode($search_societe); if ($search_invoice) $param .= "&search_invoice=".urlencode($search_invoice); if ($search_ref) $param .= "&search_ref=".urlencode($search_ref); if ($search_label) $param .= "&search_label=".urlencode($search_label); @@ -300,7 +308,7 @@ if ($result) { // We add search filter print ''; - print ''; + print ''; print ''; print ''; print ''; print ''; print ''; + print ''; print '\n"; + $thirdpartystatic = new Societe($db); $facturefournisseur_static = new FactureFournisseur($db); $product_static = new ProductFournisseur($db); @@ -352,6 +363,17 @@ if ($result) { $facturefournisseur_static->ref = $objp->ref; $facturefournisseur_static->id = $objp->facid; + $thirdpartystatic->id = $objp->socid; + $thirdpartystatic->name = $objp->name; + $thirdpartystatic->client = $objp->client; + $thirdpartystatic->fournisseur = $objp->fournisseur; + $thirdpartystatic->code_client = $objp->code_client; + $thirdpartystatic->code_compta_client = $objp->code_compta_client; + $thirdpartystatic->code_fournisseur = $objp->code_fournisseur; + $thirdpartystatic->code_compta_fournisseur = $objp->code_compta_fournisseur; + $thirdpartystatic->email = $objp->email; + $thirdpartystatic->country_code = $objp->country_code; + $product_static->ref = $objp->product_ref; $product_static->id = $objp->product_id; $product_static->label = $objp->product_label; @@ -390,6 +412,10 @@ if ($result) { print ''; + // Thirdparty + print ''; + + // Country print ''; - print ''; + print ''; print ''; print ''; print ''; print ''; print ''; + print ''; print '\n"; + $thirdpartystatic=new Societe($db); $facturefourn_static = new FactureFournisseur($db); $product_static = new Product($db); @@ -424,6 +434,17 @@ if ($result) { $objp->code_buy_l = ''; $objp->code_buy_p = ''; + $thirdpartystatic->id = $objp->socid; + $thirdpartystatic->name = $objp->name; + $thirdpartystatic->client = $objp->client; + $thirdpartystatic->fournisseur = $objp->fournisseur; + $thirdpartystatic->code_client = $objp->code_client; + $thirdpartystatic->code_compta_client = $objp->code_compta_client; + $thirdpartystatic->code_fournisseur = $objp->code_fournisseur; + $thirdpartystatic->code_compta_fournisseur = $objp->code_compta_fournisseur; + $thirdpartystatic->email = $objp->email; + $thirdpartystatic->country_code = $objp->country_code; + $product_static->ref = $objp->product_ref; $product_static->id = $objp->product_id; $product_static->type = $objp->type; @@ -543,6 +564,9 @@ if ($result) { print vatrate($objp->tva_tx_line.($objp->vat_src_code ? ' ('.$objp->vat_src_code.')' : '')); print ''; + // Thirdparty + print ''; + // Country print ''; + // ThirdParty Type + print ''; + // Category + print ''; // User print ''; +// ThirdParty Type +print ''; +// Category +if ($mode == 'customer') +{ + $cat_type = Categorie::TYPE_CUSTOMER; + $cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("Customer")); +} +if ($mode == 'supplier') +{ + $cat_type = Categorie::TYPE_SUPPLIER; + $cat_label = $langs->trans("Supplier").' '.lcfirst($langs->trans("Customer")); +} +print ''; // User print ''; print ''; print ''; - print ''; + print ''; print ''; } } diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index a64cac0e97c..71be89f30f5 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -748,8 +748,8 @@ class FactureRec extends CommonInvoice $error = 0; $this->db->begin(); - $main = MAIN_DB_PREFIX . 'facturedet_rec'; - $ef = $main . "_extrafields"; + $main = MAIN_DB_PREFIX.'facturedet_rec'; + $ef = $main."_extrafields"; $sqlef = "DELETE FROM $ef WHERE fk_object IN (SELECT rowid FROM $main WHERE fk_facture = $rowid)"; dol_syslog($sqlef); $sql = "DELETE FROM ".MAIN_DB_PREFIX."facturedet_rec WHERE fk_facture = ".$rowid; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 8e415658a98..90ed560b3cf 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -2187,8 +2187,8 @@ class Facture extends CommonInvoice } // Invoice line extrafileds - $main = MAIN_DB_PREFIX . 'facturedet'; - $ef = $main . "_extrafields"; + $main = MAIN_DB_PREFIX.'facturedet'; + $ef = $main."_extrafields"; $sqlef = "DELETE FROM $ef WHERE fk_object IN (SELECT rowid FROM $main WHERE fk_facture = $rowid)"; // Delete invoice line $sql = 'DELETE FROM '.MAIN_DB_PREFIX.'facturedet WHERE fk_facture = '.$rowid; diff --git a/htdocs/compta/facture/class/facturestats.class.php b/htdocs/compta/facture/class/facturestats.class.php index ea0b17bc59a..6b95c939e2a 100644 --- a/htdocs/compta/facture/class/facturestats.class.php +++ b/htdocs/compta/facture/class/facturestats.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2003 Rodolphe Quiedeville * Copyright (c) 2005-2013 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2020 Maxime DEMAREST * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -43,6 +44,7 @@ class FactureStats extends Stats public $from; public $field; public $where; + public $join; /** @@ -52,8 +54,10 @@ class FactureStats extends Stats * @param int $socid Id third party for filter. This value must be forced during the new to external user company if user is an external user. * @param string $mode Option ('customer', 'supplier') * @param int $userid Id user for filter (creation user) + * @param int $typentid Id typent of thirdpary for filter + * @param int $categid Id category of thirdpary for filter */ - public function __construct($db, $socid, $mode, $userid = 0) + public function __construct($db, $socid, $mode, $userid = 0, $typentid = 0, $categid = 0) { global $user, $conf; @@ -61,6 +65,7 @@ class FactureStats extends Stats $this->socid = ($socid > 0 ? $socid : 0); $this->userid = $userid; $this->cachefilesuffix = $mode; + $this->join = ''; if ($mode == 'customer') { @@ -79,6 +84,7 @@ class FactureStats extends Stats $this->field_line = 'total_ht'; } + $this->where = " f.fk_statut >= 0"; $this->where .= " AND f.entity IN (".getEntity('invoice').")"; if (!$user->rights->societe->client->voir && !$this->socid) $this->where .= " AND f.fk_soc = sc.fk_soc AND sc.fk_user = ".$user->id; @@ -90,6 +96,19 @@ class FactureStats extends Stats if ($this->userid > 0) $this->where .= ' AND f.fk_user_author = '.$this->userid; if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $this->where .= " AND f.type IN (0,1,2,5)"; else $this->where .= " AND f.type IN (0,1,2,3,5)"; + + if ($typentid) + { + $this->join .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s ON s.rowid = f.fk_soc'; + $this->where .= ' AND s.fk_typent = '.$typentid; + } + + if ($categid) + { + $this->join .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_societe as cs ON cs.fk_soc = f.fk_soc'; + $this->join .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie as c ON c.rowid = cs.fk_categorie'; + $this->where .= ' AND c.rowid = '.$categid; + } } @@ -107,6 +126,7 @@ class FactureStats extends Stats $sql = "SELECT date_format(f.datef,'%m') as dm, COUNT(*) as nb"; $sql .= " FROM ".$this->from; if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql .= $this->join; $sql .= " WHERE f.datef BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'"; $sql .= " AND ".$this->where; $sql .= " GROUP BY dm"; @@ -130,6 +150,7 @@ class FactureStats extends Stats $sql = "SELECT date_format(f.datef,'%Y') as dm, COUNT(*), SUM(c.".$this->field.")"; $sql .= " FROM ".$this->from; if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql .= $this->join; $sql .= " WHERE ".$this->where; $sql .= " GROUP BY dm"; $sql .= $this->db->order('dm', 'DESC'); @@ -152,6 +173,7 @@ class FactureStats extends Stats $sql = "SELECT date_format(datef,'%m') as dm, SUM(f.".$this->field.")"; $sql .= " FROM ".$this->from; if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql .= $this->join; $sql .= " WHERE f.datef BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'"; $sql .= " AND ".$this->where; $sql .= " GROUP BY dm"; @@ -175,6 +197,7 @@ class FactureStats extends Stats $sql = "SELECT date_format(datef,'%m') as dm, AVG(f.".$this->field.")"; $sql .= " FROM ".$this->from; if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql .= $this->join; $sql .= " WHERE f.datef BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'"; $sql .= " AND ".$this->where; $sql .= " GROUP BY dm"; @@ -195,6 +218,7 @@ class FactureStats extends Stats $sql = "SELECT date_format(datef,'%Y') as year, COUNT(*) as nb, SUM(f.".$this->field.") as total, AVG(f.".$this->field.") as avg"; $sql .= " FROM ".$this->from; if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql .= $this->join; $sql .= " WHERE ".$this->where; $sql .= " GROUP BY year"; $sql .= $this->db->order('year', 'DESC'); @@ -216,6 +240,7 @@ class FactureStats extends Stats $sql = "SELECT product.ref, COUNT(product.ref) as nb, SUM(tl.".$this->field_line.") as total, AVG(tl.".$this->field_line.") as avg"; $sql .= " FROM ".$this->from.", ".$this->from_line.", ".MAIN_DB_PREFIX."product as product"; if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql .= $this->join; $sql .= " WHERE ".$this->where; $sql .= " AND f.rowid = tl.fk_facture AND tl.fk_product = product.rowid"; $sql .= " AND f.datef BETWEEN '".$this->db->idate(dol_get_first_day($year, 1, false))."' AND '".$this->db->idate(dol_get_last_day($year, 12, false))."'"; diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index ed773b038bb..c5a3d60f99c 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -297,7 +297,15 @@ if (empty($reshook)) include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } -if ($massaction == 'withdrawrequest') +if ($massaction == 'makepayment'){ + $arrayofselected=is_array($toselect)?$toselect:array(); + + $loc = dol_buildpath('/compta/paiement.php', 2).'?action=create&facids='.implode(',', $arrayofselected); + + header('Location: '.$loc); + exit; +} +elseif ($massaction == 'withdrawrequest') { $langs->load("withdrawals"); @@ -657,6 +665,7 @@ if ($resql) 'generate_doc'=>$langs->trans("ReGeneratePDF"), 'builddoc'=>$langs->trans("PDFMerge"), 'presend'=>$langs->trans("SendByMail"), + //'makepayment'=>$langs->trans("InvoicePaymentsLimits"), TODO Blank page when using this ); if ($conf->prelevement->enabled) { $langs->load("withdrawals"); diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php index 36dfab5a3c4..f5472196cc2 100644 --- a/htdocs/compta/facture/stats/index.php +++ b/htdocs/compta/facture/stats/index.php @@ -4,6 +4,7 @@ * Copyright (C) 2012 Marcos García * Copyright (C) 2013 Juanjo Menent * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2020 Maxime DEMAREST * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -27,6 +28,9 @@ require '../../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; +require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facturestats.class.php'; $WIDTH = DolGraph::getDefaultGraphSizeForStats('width'); @@ -40,6 +44,8 @@ if ($mode == 'customer' && !$user->rights->facture->lire) accessforbidden(); if ($mode == 'supplier' && !$user->rights->fournisseur->facture->lire) accessforbidden(); $object_status = GETPOST('object_status'); +$typent_id = GETPOST('typent_id', 'int'); +$categ_id = GETPOST('categ_id', 'categ_id'); $userid = GETPOST('userid', 'int'); $socid = GETPOST('socid', 'int'); @@ -62,6 +68,8 @@ $endyear = $year; */ $form = new Form($db); +$formcompany = new FormCompany($db); +$formother = new FormOther($db); llxHeader(); @@ -81,7 +89,7 @@ print load_fiche_titre($title, '', $picto); dol_mkdir($dir); -$stats = new FactureStats($db, $socid, $mode, ($userid > 0 ? $userid : 0)); +$stats = new FactureStats($db, $socid, $mode, ($userid > 0 ? $userid : 0), ($typent_id > 0 ? $typent_id : 0), ($categ_id > 0 ? $categ_id : 0)); if ($mode == 'customer') { if ($object_status != '' && $object_status >= 0) $stats->where .= ' AND f.fk_statut IN ('.$db->escape($object_status).')'; @@ -248,6 +256,26 @@ if ($mode == 'customer') $filter = 's.client in (1,2,3)'; if ($mode == 'supplier') $filter = 's.fournisseur = 1'; print $form->selectarray('socid', $companies, $socid, 1, 0, 0, 'style="width: 95%"', 0, 0, 0, '', '', 1); print ''; +// ThirdParty Type +print ''; +// Category +if ($mode == 'customer') +{ + $cat_type = Categorie::TYPE_CUSTOMER; + $cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("Customer")); +} +if ($mode == 'supplier') +{ + $cat_type = Categorie::TYPE_SUPPLIER; + $cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("Supplier")); +} +print ''; // User print ''; print ''; - print ''; - print ''; - print ''; - print ''; + + // Ref if (!empty($arrayfields['c.ref']['checked'])) { - print ''; } + if (!empty($arrayfields['c.ref_customer']['checked'])) { print ''; diff --git a/htdocs/contrat/services_list.php b/htdocs/contrat/services_list.php index b8ab4cfe1ce..b250ea23378 100644 --- a/htdocs/contrat/services_list.php +++ b/htdocs/contrat/services_list.php @@ -247,22 +247,31 @@ if ($search_name) $sql .= " AND s.nom LIKE '%".$db->escape($search_name)."%' if ($search_contract) $sql .= " AND c.ref LIKE '%".$db->escape($search_contract)."%' "; if ($search_service) $sql .= " AND (p.ref LIKE '%".$db->escape($search_service)."%' OR p.description LIKE '%".$db->escape($search_service)."%' OR cd.description LIKE '%".$db->escape($search_service)."%')"; if ($socid > 0) $sql .= " AND s.rowid = ".$socid; -$filter_dateouvertureprevue = dol_mktime(0, 0, 0, $opouvertureprevuemonth, $opouvertureprevueday, $opouvertureprevueyear); -if ($filter_dateouvertureprevue != '' && $filter_opouvertureprevue == -1) $filter_opouvertureprevue = '='; -$filter_date1 = dol_mktime(0, 0, 0, $op1month, $op1day, $op1year); -if ($filter_date1 != '' && $filter_op1 == -1) $filter_op1 = '='; +$filter_dateouvertureprevue_start=dol_mktime(0, 0, 0, $opouvertureprevuemonth, $opouvertureprevueday, $opouvertureprevueyear); +$filter_dateouvertureprevue_end=dol_mktime(23, 59, 59, $opouvertureprevuemonth, $opouvertureprevueday, $opouvertureprevueyear); +if ($filter_dateouvertureprevue_start != '' && $filter_opouvertureprevue == -1) $filter_opouvertureprevue = ' BETWEEN '; -$filter_date2 = dol_mktime(0, 0, 0, $op2month, $op2day, $op2year); -if ($filter_date2 != '' && $filter_op2 == -1) $filter_op2 = '='; +$filter_date1_start =dol_mktime(0, 0, 0, $op1month, $op1day, $op1year); +$filter_date1_end =dol_mktime(23, 59, 59, $op1month, $op1day, $op1year); +if ($filter_date1_start != '' && $filter_op1 == -1) $filter_op1 = ' BETWEEN '; -$filter_datecloture = dol_mktime(0, 0, 0, $opcloturemonth, $opclotureday, $opclotureyear); -if ($filter_datecloture != '' && $filter_opcloture == -1) $filter_opcloture = '='; +$filter_date2_start=dol_mktime(0, 0, 0, $op2month, $op2day, $op2year); +$filter_date2_end=dol_mktime(23, 59, 59, $op2month, $op2day, $op2year); +if ($filter_date2_start != '' && $filter_op2 == -1) $filter_op2 = ' BETWEEN '; -if (!empty($filter_opouvertureprevue) && $filter_opouvertureprevue != -1 && $filter_dateouvertureprevue != '') $sql .= " AND cd.date_ouverture_prevue ".$filter_opouvertureprevue." '".$db->idate($filter_dateouvertureprevue)."'"; -if (!empty($filter_op1) && $filter_op1 != -1 && $filter_date1 != '') $sql .= " AND cd.date_ouverture ".$filter_op1." '".$db->idate($filter_date1)."'"; -if (!empty($filter_op2) && $filter_op2 != -1 && $filter_date2 != '') $sql .= " AND cd.date_fin_validite ".$filter_op2." '".$db->idate($filter_date2)."'"; -if (!empty($filter_opcloture) && $filter_opcloture != -1 && $filter_datecloture != '') $sql .= " AND cd.date_cloture ".$filter_opcloture." '".$db->idate($filter_datecloture)."'"; +$filter_datecloture_start=dol_mktime(0, 0, 0, $opcloturemonth, $opclotureday, $opclotureyear); +$filter_datecloture_end=dol_mktime(23, 59, 59, $opcloturemonth, $opclotureday, $opclotureyear); +if ($filter_datecloture_start != '' && $filter_opcloture == -1) $filter_opcloture = ' BETWEEN '; + +if (! empty($filter_opouvertureprevue) && $filter_opouvertureprevue != -1 && $filter_opouvertureprevue != ' BETWEEN ' && $filter_dateouvertureprevue_start != '') $sql.= " AND cd.date_ouverture_prevue ".$filter_opouvertureprevue." '".$db->idate($filter_dateouvertureprevue_start)."'"; +if (! empty($filter_opouvertureprevue) && $filter_opouvertureprevue == ' BETWEEN ') $sql.= " AND '".$db->idate($filter_dateouvertureprevue_end)."'"; +if (! empty($filter_op1) && $filter_op1 != -1 && $filter_op1 != ' BETWEEN ' && $filter_date1_start != '') $sql.= " AND cd.date_ouverture ".$filter_op1." '".$db->idate($filter_date1_start)."'"; +if (! empty($filter_op1) && $filter_op1==' BETWEEN ') $sql.= " AND '".$db->idate($filter_date1_end)."'"; +if (! empty($filter_op2) && $filter_op2 != -1 && $filter_op2 != ' BETWEEN ' && $filter_date2_start != '') $sql.= " AND cd.date_fin_validite ".$filter_op2." '".$db->idate($filter_date2_start)."'"; +if (! empty($filter_op2) && $filter_op2==' BETWEEN ') $sql.= " AND '".$db->idate($filter_date2_end)."'"; +if (! empty($filter_opcloture) && $filter_opcloture != ' BETWEEN ' && $filter_opcloture != -1 && $filter_datecloture_start != '') $sql.= " AND cd.date_cloture ".$filter_opcloture." '".$db->idate($filter_datecloture_start)."'"; +if (! empty($filter_opcloture) && $filter_opcloture==' BETWEEN ') $sql.= " AND '".$db->idate($filter_datecloture_end)."'"; // Add where from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; $sql .= $db->order($sortfield, $sortorder); diff --git a/htdocs/core/ajax/selectsearchbox.php b/htdocs/core/ajax/selectsearchbox.php index bc5287a51f9..2f8ad4ab5f7 100644 --- a/htdocs/core/ajax/selectsearchbox.php +++ b/htdocs/core/ajax/selectsearchbox.php @@ -56,7 +56,7 @@ $arrayresult = array(); if (!empty($conf->adherent->enabled) && empty($conf->global->MAIN_SEARCHFORM_ADHERENT_DISABLED) && $user->rights->adherent->lire) { - $arrayresult['searchintomember'] = array('position'=>8, 'shortcut'=>'M', 'img'=>'object_user', 'label'=>$langs->trans("SearchIntoMembers", $search_boxvalue), 'text'=>img_picto('', 'object_user').' '.$langs->trans("SearchIntoMembers", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/adherents/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : '')); + $arrayresult['searchintomember'] = array('position'=>8, 'shortcut'=>'M', 'img'=>'object_member', 'label'=>$langs->trans("SearchIntoMembers", $search_boxvalue), 'text'=>img_picto('', 'object_member').' '.$langs->trans("SearchIntoMembers", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/adherents/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : '')); } if (((!empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || !empty($conf->fournisseur->enabled)) && empty($conf->global->MAIN_SEARCHFORM_SOCIETE_DISABLED) && $user->rights->societe->lire) @@ -75,13 +75,18 @@ if (((!empty($conf->product->enabled) && $user->rights->produit->lire) || (!empt $arrayresult['searchintoproduct'] = array('position'=>30, 'shortcut'=>'P', 'img'=>'object_product', 'label'=>$langs->trans("SearchIntoProductsOrServices", $search_boxvalue), 'text'=>img_picto('', 'object_product').' '.$langs->trans("SearchIntoProductsOrServices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/product/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : '')); } +if (!empty($conf->mrp->enabled) && $user->rights->mrp->read && empty($conf->global->MAIN_SEARCHFORM_MRP_DISABLED)) +{ + $arrayresult['searchintomo'] = array('position'=>35, 'shortcut'=>'', 'img'=>'object_mrp', 'label'=>$langs->trans("SearchIntoMO", $search_boxvalue), 'text'=>img_picto('', 'object_mrp').' '.$langs->trans("SearchIntoMO", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/mrp/mo_list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : '')); +} + if (!empty($conf->projet->enabled) && empty($conf->global->MAIN_SEARCHFORM_PROJECT_DISABLED) && $user->rights->projet->lire) { - $arrayresult['searchintoprojects'] = array('position'=>40, 'shortcut'=>'Q', 'img'=>'object_projectpub', 'label'=>$langs->trans("SearchIntoProjects", $search_boxvalue), 'text'=>img_picto('', 'object_projectpub').' '.$langs->trans("SearchIntoProjects", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/projet/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : '')); + $arrayresult['searchintoprojects'] = array('position'=>40, 'shortcut'=>'Q', 'img'=>'object_projectpub', 'label'=>$langs->trans("SearchIntoProjects", $search_boxvalue), 'text'=>img_picto('', 'object_project').' '.$langs->trans("SearchIntoProjects", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/projet/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : '')); } if (!empty($conf->projet->enabled) && empty($conf->global->MAIN_SEARCHFORM_TASK_DISABLED) && $user->rights->projet->lire) { - $arrayresult['searchintotasks'] = array('position'=>45, 'img'=>'object_task', 'label'=>$langs->trans("SearchIntoTasks", $search_boxvalue), 'text'=>img_picto('', 'object_task').' '.$langs->trans("SearchIntoTasks", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/projet/tasks/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : '')); + $arrayresult['searchintotasks'] = array('position'=>45, 'img'=>'object_projecttask', 'label'=>$langs->trans("SearchIntoTasks", $search_boxvalue), 'text'=>img_picto('', 'object_projecttask').' '.$langs->trans("SearchIntoTasks", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/projet/tasks/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : '')); } if (!empty($conf->propal->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_PROPAL_DISABLED) && $user->rights->propal->lire) @@ -103,15 +108,15 @@ if (!empty($conf->facture->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUST if (!empty($conf->supplier_proposal->enabled) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_PROPAL_DISABLED) && $user->rights->supplier_proposal->lire) { - $arrayresult['searchintosupplierpropal'] = array('position'=>100, 'img'=>'object_propal', 'label'=>$langs->trans("SearchIntoSupplierProposals", $search_boxvalue), 'text'=>img_picto('', 'object_propal').' '.$langs->trans("SearchIntoSupplierProposals", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/supplier_proposal/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : '')); + $arrayresult['searchintosupplierpropal'] = array('position'=>100, 'img'=>'object_propal', 'label'=>$langs->trans("SearchIntoSupplierProposals", $search_boxvalue), 'text'=>img_picto('', 'object_supplier_proposal').' '.$langs->trans("SearchIntoSupplierProposals", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/supplier_proposal/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : '')); } if ((! empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_ORDER_DISABLED) || ! empty($conf->supplier_order->enabled)) && $user->rights->fournisseur->commande->lire) { - $arrayresult['searchintosupplierorder'] = array('position'=>110, 'img'=>'object_order', 'label'=>$langs->trans("SearchIntoSupplierOrders", $search_boxvalue), 'text'=>img_picto('', 'object_order').' '.$langs->trans("SearchIntoSupplierOrders", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fourn/commande/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : '')); + $arrayresult['searchintosupplierorder'] = array('position'=>110, 'img'=>'object_order', 'label'=>$langs->trans("SearchIntoSupplierOrders", $search_boxvalue), 'text'=>img_picto('', 'object_supplier_order').' '.$langs->trans("SearchIntoSupplierOrders", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fourn/commande/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : '')); } if ((! empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_INVOICE_DISABLED) || ! empty($conf->supplier_invoice->enabled)) && $user->rights->fournisseur->facture->lire) { - $arrayresult['searchintosupplierinvoice'] = array('position'=>120, 'img'=>'object_bill', 'label'=>$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'text'=>img_picto('', 'object_bill').' '.$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fourn/facture/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : '')); + $arrayresult['searchintosupplierinvoice'] = array('position'=>120, 'img'=>'object_bill', 'label'=>$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'text'=>img_picto('', 'object_supplier_invoice').' '.$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fourn/facture/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : '')); } if (!empty($conf->contrat->enabled) && empty($conf->global->MAIN_SEARCHFORM_CONTRACT_DISABLED) && $user->rights->contrat->lire) @@ -122,6 +127,10 @@ if (!empty($conf->ficheinter->enabled) && empty($conf->global->MAIN_SEARCHFORM_F { $arrayresult['searchintointervention'] = array('position'=>140, 'img'=>'object_intervention', 'label'=>$langs->trans("SearchIntoInterventions", $search_boxvalue), 'text'=>img_picto('', 'object_intervention').' '.$langs->trans("SearchIntoInterventions", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fichinter/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : '')); } +if (!empty($conf->ticket->enabled) && empty($conf->global->MAIN_SEARCHFORM_TICKET_DISABLED) && $user->rights->ticket->read) +{ + $arrayresult['searchintotickets'] = array('position'=>145, 'img'=>'object_ticket', 'label'=>$langs->trans("SearchIntoTickets", $search_boxvalue), 'text'=>img_picto('', 'object_ticket').' '.$langs->trans("SearchIntoTickets", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/ticket/list.php?mainmenu=ticket'.($search_boxvalue ? '&sall='.urlencode($search_boxvalue) : '')); +} // HR if (!empty($conf->user->enabled) && empty($conf->global->MAIN_SEARCHFORM_USER_DISABLED) && $user->rights->user->user->lire) @@ -136,10 +145,6 @@ if (!empty($conf->holiday->enabled) && empty($conf->global->MAIN_SEARCHFORM_HOLI { $arrayresult['searchintoleaves'] = array('position'=>220, 'img'=>'object_holiday', 'label'=>$langs->trans("SearchIntoLeaves", $search_boxvalue), 'text'=>img_picto('', 'object_holiday').' '.$langs->trans("SearchIntoLeaves", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/holiday/list.php?mainmenu=hrm'.($search_boxvalue ? '&sall='.urlencode($search_boxvalue) : '')); } -if (!empty($conf->ticket->enabled) && empty($conf->global->MAIN_SEARCHFORM_TICKET_DISABLED) && $user->rights->ticket->read) -{ - $arrayresult['searchintotickets'] = array('position'=>220, 'img'=>'object_ticket', 'label'=>$langs->trans("SearchIntoTickets", $search_boxvalue), 'text'=>img_picto('', 'object_ticket').' '.$langs->trans("SearchIntoTickets", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/ticket/list.php?mainmenu=ticket'.($search_boxvalue ? '&sall='.urlencode($search_boxvalue) : '')); -} /* Do we really need this. We already have a select for users, and we should be able to filter into user list on employee flag diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 4bcfbafa9d8..df80aab7a1f 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -325,7 +325,7 @@ abstract class CommonDocGenerator foreach ($conf->global as $key => $val) { - if (preg_match('/(_pass|password|secret|_key|key$)/i', $key)) $newval = '*****forbidden*****'; + if (preg_match('/(_pass|_pw|password|secret|_key|key$)/i', $key)) $newval = '*****forbidden*****'; else $newval = $val; $array_other['__['.$key.']__'] = $newval; } @@ -1295,7 +1295,7 @@ abstract class CommonDocGenerator if (!empty($fields)) { // Sort extrafields by rank - uasort($fields, function($a, $b) { + uasort($fields, function ($a, $b) { return ($a->rank > $b->rank) ? -1 : 1; }); diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index adb6d21a828..f3f1b9eaee3 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3077,10 +3077,10 @@ abstract class CommonObject if (empty($reshook) && $forcedroundingmode == '0') // Check if data on line are consistent. This may solve lines that were not consistent because set with $forcedroundingmode='auto' { // This part of code is to fix data. We should not call it too often. - $localtax_array = array($obj->localtax1_type,$obj->localtax1_tx,$obj->localtax2_type,$obj->localtax2_tx); + $localtax_array = array($obj->localtax1_type, $obj->localtax1_tx, $obj->localtax2_type, $obj->localtax2_tx); $tmpcal = calcul_price_total($obj->qty, $obj->up, $obj->remise_percent, $obj->vatrate, $obj->localtax1_tx, $obj->localtax2_tx, 0, 'HT', $obj->info_bits, $obj->product_type, $seller, $localtax_array, (isset($obj->situation_percent) ? $obj->situation_percent : 100), $multicurrency_tx); - $diff_when_using_price_ht = price2num($tmpcal[1] - $obj->total_tva, 'MT', 1); // If price was set with tax price adn unit price HT has a low number of digits, then we may have a diff on recalculation from unit price HT. + $diff_when_using_price_ht = price2num($tmpcal[1] - $obj->total_tva, 'MT', 1); // If price was set with tax price adn unit price HT has a low number of digits, then we may have a diff on recalculation from unit price HT. $diff_on_current_total = price2num($obj->total_ttc - $obj->total_ht - $obj->total_tva - $obj->total_localtax1 - $obj->total_localtax2, 'MT', 1); //var_dump($obj->total_ht.' '.$obj->total_tva.' '.$obj->total_localtax1.' '.$obj->total_localtax2.' =? '.$obj->total_ttc); //var_dump($diff_when_using_price_ht.' '.$diff_on_current_total); @@ -3090,7 +3090,7 @@ abstract class CommonObject $sqlfix = "UPDATE ".MAIN_DB_PREFIX.$this->table_element_line." SET ".$fieldtva." = ".$tmpcal[1].", total_ttc = ".$tmpcal[2]." WHERE rowid = ".$obj->rowid; dol_syslog('We found unconsistent data into detailed line (diff_when_using_price_ht = '.$diff_when_using_price_ht.' and diff_on_current_total = '.$diff_on_current_total.') for line rowid = '.$obj->rowid." (total vat of line calculated=".$tmpcal[1].", database=".$obj->total_tva."). We fix the total_vat and total_ttc of line by running sqlfix = ".$sqlfix, LOG_WARNING); $resqlfix = $this->db->query($sqlfix); - if (! $resqlfix) dol_print_error($this->db, 'Failed to update line'); + if (!$resqlfix) dol_print_error($this->db, 'Failed to update line'); $obj->total_tva = $tmpcal[1]; $obj->total_ttc = $tmpcal[2]; } diff --git a/htdocs/core/class/cunits.class.php b/htdocs/core/class/cunits.class.php index a25250516f4..096ae47a7b8 100644 --- a/htdocs/core/class/cunits.class.php +++ b/htdocs/core/class/cunits.class.php @@ -386,4 +386,77 @@ class CUnits // extends CommonObject return 1; } } + + + /** + * Get unit from code + * @param string $code code of unit + * @param string $mode 0= id , short_label=Use short label as value, code=use code + * @return int <0 if KO, Id of code if OK + */ + public function getUnitFromCode($code, $mode = 'code') + { + + if($mode == 'short_label'){ + return dol_getIdFromCode($this->db, $code, 'c_units', 'short_label', 'rowid'); + } + elseif($mode == 'code'){ + return dol_getIdFromCode($this->db, $code, 'c_units', 'code', 'rowid'); + } + + return $code; + } + + /** + * Unit converter + * @param double $value value to convert + * @param int $fk_unit current unit id of value + * @param int $fk_new_unit the id of unit to convert in + * @return double + */ + public function unitConverter($value, $fk_unit, $fk_new_unit = 0) + { + $value = doubleval(price2num($value)); + $fk_unit = intval($fk_unit); + + // Calcul en unité de base + $scaleUnitPow = $this->scaleOfUnitPow($fk_unit); + + // convert to standard unit + $value = $value * $scaleUnitPow; + if($fk_new_unit !=0 ){ + // Calcul en unité de base + $scaleUnitPow = $this->scaleOfUnitPow($fk_new_unit); + if(!empty($scaleUnitPow)) + { + // convert to new unit + $value = $value / $scaleUnitPow; + } + } + return round($value, 2); + } + + + + /** + * get scale of unit factor + * @param $id int id of unit in dictionary + * @return float|int + */ + public function scaleOfUnitPow($id) + { + $base = 10; + // TODO : add base col into unit dictionary table + $unit = $this->db->getRow('SELECT scale, unit_type from '.MAIN_DB_PREFIX.'c_units WHERE rowid = '.intval($id)); + if($unit){ + // TODO : if base exist in unit dictionary table remove this convertion exception and update convertion infos in database exemple time hour currently scale 3600 will become scale 2 base 60 + if($unit->unit_type == 'time'){ + return doubleval($unit->scale); + } + + return pow($base, doubleval($unit->scale)); + } + + return 0; + } } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 25ed9f86625..7073fd41989 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1298,11 +1298,11 @@ class Form // Construct $out and $outarray $out .= ''; if (($showempty == 1 || ($showempty == 3 && $num > 1)) && !$multiple) $out .= ''; - if ($showempty == 2) $out .= ''; + if ($showempty == 2) $out .= ''; $num = $this->db->num_rows($resql); $i = 0; @@ -1669,24 +1669,24 @@ class Form /** * Return select list of users * - * @param string $selected User id or user object of user preselected. If 0 or < -2, we use id of current user. If -1, keep unselected (if empty is allowed) - * @param string $htmlname Field name in form - * @param int $show_empty 0=list with no empty value, 1=add also an empty value into list - * @param array $exclude Array list of users id to exclude - * @param int $disabled If select list must be disabled - * @param array|string $include Array list of users id to include or 'hierarchy' to have only supervised users or 'hierarchyme' to have supervised + me - * @param array $enableonly Array list of users id to be enabled. If defined, it means that others will be disabled - * @param string $force_entity '0' or Ids of environment to force - * @param int $maxlength Maximum length of string into list (0=no limit) - * @param int $showstatus 0=show user status only if status is disabled, 1=always show user status into label, -1=never show user status - * @param string $morefilter Add more filters into sql request (Example: 'employee = 1') - * @param integer $show_every 0=default list, 1=add also a value "Everybody" at beginning of list - * @param string $enableonlytext If option $enableonlytext is set, we use this text to explain into label why record is disabled. Not used if enableonly is empty. - * @param string $morecss More css - * @param int $noactive Show only active users (this will also happened whatever is this option if USER_HIDE_INACTIVE_IN_COMBOBOX is on). - * @param int $outputmode 0=HTML select string, 1=Array - * @param bool $multiple add [] in the name of element and add 'multiple' attribut - * @return string HTML select string + * @param string $selected User id or user object of user preselected. If 0 or < -2, we use id of current user. If -1, keep unselected (if empty is allowed) + * @param string $htmlname Field name in form + * @param int $show_empty 0=list with no empty value, 1=add also an empty value into list + * @param array $exclude Array list of users id to exclude + * @param int $disabled If select list must be disabled + * @param array|string $include Array list of users id to include. User '' for all users or 'hierarchy' to have only supervised users or 'hierarchyme' to have supervised + me + * @param array $enableonly Array list of users id to be enabled. If defined, it means that others will be disabled + * @param string $force_entity '0' or Ids of environment to force + * @param int $maxlength Maximum length of string into list (0=no limit) + * @param int $showstatus 0=show user status only if status is disabled, 1=always show user status into label, -1=never show user status + * @param string $morefilter Add more filters into sql request (Example: 'employee = 1') + * @param integer $show_every 0=default list, 1=add also a value "Everybody" at beginning of list + * @param string $enableonlytext If option $enableonlytext is set, we use this text to explain into label why record is disabled. Not used if enableonly is empty. + * @param string $morecss More css + * @param int $noactive Show only active users (this will also happened whatever is this option if USER_HIDE_INACTIVE_IN_COMBOBOX is on). + * @param int $outputmode 0=HTML select string, 1=Array + * @param bool $multiple add [] in the name of element and add 'multiple' attribut + * @return string HTML select string * @see select_dolgroups() */ public function select_dolusers($selected = '', $htmlname = 'userid', $show_empty = 0, $exclude = null, $disabled = 0, $include = '', $enableonly = '', $force_entity = '0', $maxlength = 0, $showstatus = 0, $morefilter = '', $show_every = 0, $enableonlytext = '', $morecss = '', $noactive = 0, $outputmode = 0, $multiple = false) @@ -2507,7 +2507,7 @@ class Form $label = $objp->label; if (!empty($objp->label_translated)) $label = $objp->label_translated; - if (!empty($filterkey) && $filterkey != '') $label = preg_replace('/('.preg_quote($filterkey).')/i', '$1', $label, 1); + if (!empty($filterkey) && $filterkey != '') $label = preg_replace('/('.preg_quote($filterkey, '/').')/i', '$1', $label, 1); $outkey = $objp->rowid; $outref = $objp->ref; @@ -2579,7 +2579,7 @@ class Form if ($outorigin && !empty($conf->global->PRODUCT_SHOW_ORIGIN_IN_COMBO)) $opt .= ' ('.getCountry($outorigin, 1).')'; $objRef = $objp->ref; - if (!empty($filterkey) && $filterkey != '') $objRef = preg_replace('/('.preg_quote($filterkey).')/i', '$1', $objRef, 1); + if (!empty($filterkey) && $filterkey != '') $objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '$1', $objRef, 1); $outval .= $objRef; if ($outbarcode) $outval .= ' ('.$outbarcode.')'; $outval .= ' - '.dol_trunc($label, $maxlengtharticle); @@ -2948,11 +2948,11 @@ class Form } $objRef = $objp->ref; - if ($filterkey && $filterkey != '') $objRef = preg_replace('/('.preg_quote($filterkey).')/i', '$1', $objRef, 1); + if ($filterkey && $filterkey != '') $objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '$1', $objRef, 1); $objRefFourn = $objp->ref_fourn; - if ($filterkey && $filterkey != '') $objRefFourn = preg_replace('/('.preg_quote($filterkey).')/i', '$1', $objRefFourn, 1); + if ($filterkey && $filterkey != '') $objRefFourn = preg_replace('/('.preg_quote($filterkey, '/').')/i', '$1', $objRefFourn, 1); $label = $objp->label; - if ($filterkey && $filterkey != '') $label = preg_replace('/('.preg_quote($filterkey).')/i', '$1', $label, 1); + if ($filterkey && $filterkey != '') $label = preg_replace('/('.preg_quote($filterkey, '/').')/i', '$1', $label, 1); $optlabel = $objp->ref; if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) { @@ -6634,11 +6634,11 @@ class Form // Add code for jquery to use multiselect if (!empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined('REQUIRE_JQUERY_MULTISELECT')) { - $out .= "\n".' - @@ -175,10 +191,13 @@ if ($conf->global->TAKEPOS_NUM_TERMINALS != "1" && $_SESSION["takeposterminal"] ?>
- - - - + '.strtoupper(substr($langs->trans('Floors'), 0, 3)).''; + print ''; + print ''; + print ''; + if ($_SESSION["publicterminal"]) print ''; + ?>
diff --git a/htdocs/takepos/public/auto_order.php b/htdocs/takepos/public/auto_order.php new file mode 100644 index 00000000000..c97edfdc0e7 --- /dev/null +++ b/htdocs/takepos/public/auto_order.php @@ -0,0 +1,29 @@ + + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/takepos/public/auto_order.php + * \ingroup takepos + * \brief Public orders for customers + */ + +if (!defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session) +if (!defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip + +$_SESSION["basiclayout"] = 1; +$_SESSION["publicterminal"] = true; // Is a public customer +require '../phone.php'; diff --git a/htdocs/takepos/receipt.php b/htdocs/takepos/receipt.php index c025f504d73..90b3a5c1fee 100644 --- a/htdocs/takepos/receipt.php +++ b/htdocs/takepos/receipt.php @@ -25,7 +25,7 @@ * \brief Page to show a receipt. */ -require '../main.inc.php'; // Load $user and permissions +if (!isset($action)) require '../main.inc.php'; // If this file is called from send.php avoid load again include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; $langs->loadLangs(array("main", "cashdesk", "companies")); diff --git a/htdocs/takepos/send.php b/htdocs/takepos/send.php index 5774c9bbaf1..3f59d4069b5 100644 --- a/htdocs/takepos/send.php +++ b/htdocs/takepos/send.php @@ -1,5 +1,6 @@ +/* Copyright (C) 2019 Thibault FOUCART + * Copyright (C) 2020 Andreu Bisquerra Gaya * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -35,123 +36,73 @@ require '../main.inc.php'; // Load $user and permissions require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; -$invoiceid = GETPOST('facid', 'int'); +$facid = GETPOST('facid', 'int'); +$action = GETPOST('action', 'alpha'); +$email = GETPOST('email', 'alpha'); if (empty($user->rights->takepos->run)) { accessforbidden(); } - -/* - * View - */ - -$invoice = new Facture($db); -if ($invoiceid > 0) -{ - $invoice->fetch($invoiceid); -} -else -{ - $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."facture where ref='(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")'"; - $resql = $db->query($sql); - $obj = $db->fetch_object($resql); - if ($obj) - { - $invoiceid = $obj->rowid; - } - if (!$invoiceid) - { - $invoiceid = 0; // Invoice does not exist yet - } - else - { - $invoice->fetch($invoiceid); - } -} - $langs->loadLangs(array("main", "bills", "cashdesk")); +$invoice = new Facture($db); +$invoice->fetch($facid); +$customer = new Societe($db); +$customer->fetch($invoice->socid); + +if ($action=="send") +{ + include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $formmail = new FormMail($db); + $outputlangs = new Translate('', $conf); + $model_id = $conf->global->TAKEPOS_EMAIL_TEMPLATE_INVOICE; + $arraydefaultmessage = $formmail->getEMailTemplate($db, 'facture_send', $user, $outputlangs, $model_id); + $subject = $arraydefaultmessage->topic; + ob_start(); // turn on output receipt + include 'receipt.php'; + $receipt = ob_get_contents(); // get the contents of the output buffer + ob_end_clean(); + $msg="".$arraydefaultmessage->content."
".$receipt.""; + $sendto=$email; + $from=$mysoc->email; + $mail = new CMailFile($subject, $sendto, $from, $msg, array(), array(), array(), '', '', 0, 1); + if ($mail->error || $mail->errors) { + setEventMessages($mail->error, $mail->errors, 'errors'); + } else { + $result = $mail->sendfile(); + } + exit; +} +$arrayofcss = array('/takepos/css/pos.css.php'); +$arrayofjs = array(); +top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); ?> -
-
+
+

- +
diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index c559fcec9ad..9e099c6953d 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1132,6 +1132,9 @@ table[summary="list_of_modules"] .fa-cog { padding-left: 5px; padding-right: 5px; } + + .hideonsmartphone { display: none; } + .hideonsmartphoneimp { display: none !important; } } /* Force values for small screen 570 */ @@ -1189,8 +1192,6 @@ table[summary="list_of_modules"] .fa-cog { max-width: 138px; /* length of input text in the quick search box when using a smartphone and without dolidroid */ } - .hideonsmartphone { display: none; } - .hideonsmartphoneimp { display: none !important; } .noenlargeonsmartphone { width : 50px !important; display: inline !important; } .maxwidthonsmartphone, #search_newcompany.ui-autocomplete-input { max-width: 100px; } .maxwidth50onsmartphone { max-width: 40px; } @@ -3364,6 +3365,7 @@ tr.liste_titre th, th.liste_titre, tr.liste_titre td, td.liste_titre, form.liste } tr.liste_titre th a, th.liste_titre a, tr.liste_titre td a, td.liste_titre a, form.liste_titre div a, div.liste_titre a { text-shadow: none !important; + color: rgb(); } tr.liste_titre_topborder td { border-top-width: px; diff --git a/htdocs/theme/eldy/info-box.inc.php b/htdocs/theme/eldy/info-box.inc.php index 028039f6c8b..7f62fe39689 100644 --- a/htdocs/theme/eldy/info-box.inc.php +++ b/htdocs/theme/eldy/info-box.inc.php @@ -6,6 +6,11 @@ if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?> * Component: Info Box * ------------------- */ + +.info-box-module-external span.info-box-icon-version { + background: #999; +} + .info-box { display: block; position: relative; diff --git a/htdocs/theme/eldy/progress.inc.php b/htdocs/theme/eldy/progress.inc.php index b0bd96df1d2..71f25ff35ba 100644 --- a/htdocs/theme/eldy/progress.inc.php +++ b/htdocs/theme/eldy/progress.inc.php @@ -123,7 +123,7 @@ if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?> width: 3px; } .progress-group .progress-text { - font-weight: 600; + /* font-weight: 600; */ } .progress-group .progress-number { float: right; diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 39fcd003335..927d29e1919 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -128,6 +128,7 @@ $colorbacklinebreak = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (emp $colorbackbody = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_BACKBODY) ? $colorbackbody : $conf->global->THEME_ELDY_BACKBODY) : (empty($user->conf->THEME_ELDY_BACKBODY) ? $colorbackbody : $user->conf->THEME_ELDY_BACKBODY); $colortexttitlenotab = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_TEXTTITLENOTAB) ? $colortexttitlenotab : $conf->global->THEME_ELDY_TEXTTITLENOTAB) : (empty($user->conf->THEME_ELDY_TEXTTITLENOTAB) ? $colortexttitlenotab : $user->conf->THEME_ELDY_TEXTTITLENOTAB); $colortexttitle = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_TEXTTITLE) ? $colortexttitle : $conf->global->THEME_ELDY_TEXTTITLE) : (empty($user->conf->THEME_ELDY_TEXTTITLE) ? $colortexttitle : $user->conf->THEME_ELDY_TEXTTITLE); +$colortexttitlelink = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_TEXTTITLELINK) ? $colortexttitlelink : $conf->global->THEME_ELDY_TEXTTITLELINK) : (empty($user->conf->THEME_ELDY_TEXTTITLELINK) ? $colortexttitlelink : $user->conf->THEME_ELDY_TEXTTITLELINK); $colortext = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_TEXT) ? $colortext : $conf->global->THEME_ELDY_TEXT) : (empty($user->conf->THEME_ELDY_TEXT) ? $colortext : $user->conf->THEME_ELDY_TEXT); $colortextlink = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_TEXTLINK) ? $colortextlink : $conf->global->THEME_ELDY_TEXTLINK) : (empty($user->conf->THEME_ELDY_TEXTLINK) ? $colortextlink : $user->conf->THEME_ELDY_TEXTLINK); $fontsize = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_FONT_SIZE1) ? $fontsize : $conf->global->THEME_ELDY_FONT_SIZE1) : (empty($user->conf->THEME_ELDY_FONT_SIZE1) ? $fontsize : $user->conf->THEME_ELDY_FONT_SIZE1); diff --git a/htdocs/theme/eldy/theme_vars.inc.php b/htdocs/theme/eldy/theme_vars.inc.php index f6324f0146f..823b8168b4c 100644 --- a/htdocs/theme/eldy/theme_vars.inc.php +++ b/htdocs/theme/eldy/theme_vars.inc.php @@ -69,6 +69,7 @@ $colorbacklinebreak = '233,228,230'; // line break $colorbackbody = '255,255,255'; $colortexttitlenotab = '0,113,120'; // 150,90,121 140,80,10 or 10,140,80 #875a7b green=0,113,120, violet: 0,50,120 $colortexttitle = '0,0,0'; +$colortexttitlelink = '10, 20, 100'; $colortext = '0,0,0'; $colortextlink = '10, 20, 100'; $fontsize = '0.86em'; diff --git a/htdocs/theme/md/info-box.inc.php b/htdocs/theme/md/info-box.inc.php index d9b467f130b..d866cab96a6 100644 --- a/htdocs/theme/md/info-box.inc.php +++ b/htdocs/theme/md/info-box.inc.php @@ -7,6 +7,10 @@ if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?> * ------------------- */ +.info-box-module-external span.info-box-icon-version { + background: #999; +} + span.info-box-icon-text { /* hide box text number due to problems */ display: none; } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index dfcc413986f..c995426edd9 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -130,6 +130,7 @@ $colorbacklinebreak = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (emp $colorbackbody = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_BACKBODY) ? $colorbackbody : $conf->global->THEME_ELDY_BACKBODY) : (empty($user->conf->THEME_ELDY_BACKBODY) ? $colorbackbody : $user->conf->THEME_ELDY_BACKBODY); $colortexttitlenotab = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_TEXTTITLENOTAB) ? $colortexttitlenotab : $conf->global->THEME_ELDY_TEXTTITLENOTAB) : (empty($user->conf->THEME_ELDY_TEXTTITLENOTAB) ? $colortexttitlenotab : $user->conf->THEME_ELDY_TEXTTITLENOTAB); $colortexttitle = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_TEXTTITLE) ? $colortext : $conf->global->THEME_ELDY_TEXTTITLE) : (empty($user->conf->THEME_ELDY_TEXTTITLE) ? $colortexttitle : $user->conf->THEME_ELDY_TEXTTITLE); +$colortexttitlelink = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_TEXTTITLELINK) ? $colortexttitlelink : $conf->global->THEME_ELDY_TEXTTITLELINK) : (empty($user->conf->THEME_ELDY_TEXTTITLELINK) ? $colortexttitlelink : $user->conf->THEME_ELDY_TEXTTITLELINK); $colortext = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_TEXT) ? $colortext : $conf->global->THEME_ELDY_TEXT) : (empty($user->conf->THEME_ELDY_TEXT) ? $colortext : $user->conf->THEME_ELDY_TEXT); $colortextlink = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_TEXTLINK) ? $colortext : $conf->global->THEME_ELDY_TEXTLINK) : (empty($user->conf->THEME_ELDY_TEXTLINK) ? $colortextlink : $user->conf->THEME_ELDY_TEXTLINK); $fontsize = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_FONT_SIZE1) ? $fontsize : $conf->global->THEME_ELDY_FONT_SIZE1) : (empty($user->conf->THEME_ELDY_FONT_SIZE1) ? $fontsize : $user->conf->THEME_ELDY_FONT_SIZE1); @@ -3398,6 +3399,7 @@ tr.liste_titre th, th.liste_titre, tr.liste_titre td, td.liste_titre, form.liste } tr.liste_titre th a, th.liste_titre a, tr.liste_titre td a, td.liste_titre a, form.liste_titre div a, div.liste_titre a { text-shadow: none !important; + color: rgb(); } tr.liste_titre_topborder td { border-top-width: px; diff --git a/htdocs/theme/md/theme_vars.inc.php b/htdocs/theme/md/theme_vars.inc.php index d15444acb6c..6cdd37fe913 100644 --- a/htdocs/theme/md/theme_vars.inc.php +++ b/htdocs/theme/md/theme_vars.inc.php @@ -65,6 +65,7 @@ $colorbacklinebreak = '214,218,220'; $colorbackbody = '248,248,248'; $colortexttitlenotab = '80,71,5'; $colortexttitle = '20,20,20'; +$colortexttitlelink = '0,0,120'; $colortext = '0,0,0'; $colortextlink = '0,0,120'; $fontsize = '14'; diff --git a/htdocs/ticket/class/utils_diff.class.php b/htdocs/ticket/class/utils_diff.class.php index 03dff5506b4..84075d395ab 100644 --- a/htdocs/ticket/class/utils_diff.class.php +++ b/htdocs/ticket/class/utils_diff.class.php @@ -20,24 +20,21 @@ class Diff const DELETED = 1; const INSERTED = 2; - /* Returns the diff for two strings. The return value is an array, each of + /** + * Returns the diff for two strings. The return value is an array, each of * whose values is an array containing two values: a line (or character, if * $compareCharacters is true), and one of the constants DIFF::UNMODIFIED (the * line or character is in both strings), DIFF::DELETED (the line or character * is only in the first string), and DIFF::INSERTED (the line or character is * only in the second string). The parameters are: * - * $string1 - the first string - * $string2 - the second string - * $compareCharacters - true to compare characters, and false to compare - * lines; this optional parameter defaults to false + * @param string $string1 First string + * @param string $string2 Second string + * @param string $compareCharacters true to compare characters, and false to compare lines; this optional parameter defaults to false + * @return array Array of diff */ - public static function compare( - $string1, - $string2, - $compareCharacters = false - ) { - + public static function compare($string1, $string2, $compareCharacters = false) + { // initialise the sequences and comparison start and end positions $start = 0; if ($compareCharacters) { @@ -90,12 +87,13 @@ class Diff return $diff; } - /* Returns the diff for two files. The parameters are: + /** + * Returns the diff for two files. The parameters are: * - * $file1 - the path to the first file - * $file2 - the path to the second file - * $compareCharacters - true to compare characters, and false to compare - * lines; this optional parameter defaults to false + * @param string $file1 Path to the first file + * @param string $file2 Path to the second file + * @param boolean $compareCharacters true to compare characters, and false to compare lines; this optional parameter defaults to false + * @return array Array of diff */ public static function compareFiles( $file1, @@ -111,23 +109,18 @@ class Diff ); } - /* Returns the table of longest common subsequence lengths for the specified - * sequences. The parameters are: + /** + * Returns the table of longest common subsequence lengths for the specified sequences. The parameters are: * - * $sequence1 - the first sequence - * $sequence2 - the second sequence - * $start - the starting index - * $end1 - the ending index for the first sequence - * $end2 - the ending index for the second sequence + * @param string $sequence1 the first sequence + * @param string $sequence2 the second sequence + * @param string $start the starting index + * @param string $end1 the ending index for the first sequence + * @param string $end2 the ending index for the second sequence + * @return array array of diff */ - private static function computeTable( - $sequence1, - $sequence2, - $start, - $end1, - $end2 - ) { - + private static function computeTable($sequence1, $sequence2, $start, $end1, $end2) + { // determine the lengths to be compared $length1 = $end1 - $start + 1; $length2 = $end2 - $start + 1; @@ -156,21 +149,18 @@ class Diff return $table; } - /* Returns the partial diff for the specificed sequences, in reverse order. - * The parameters are: + /** + * Returns the partial diff for the specificed sequences, in reverse order. + * The parameters are: * - * $table - the table returned by the computeTable function - * $sequence1 - the first sequence - * $sequence2 - the second sequence - * $start - the starting index + * @param string $table the table returned by the computeTable function + * @param string $sequence1 the first sequence + * @param string $sequence2 the second sequence + * @param string $start the starting index + * @return array array of diff */ - private static function generatePartialDiff( - $table, - $sequence1, - $sequence2, - $start - ) { - + private static function generatePartialDiff($table, $sequence1, $sequence2, $start) + { // initialise the diff $diff = array(); @@ -205,17 +195,17 @@ class Diff return $diff; } - /* Returns a diff as a string, where unmodified lines are prefixed by ' ', + /** + * Returns a diff as a string, where unmodified lines are prefixed by ' ', * deletions are prefixed by '- ', and insertions are prefixed by '+ '. The * parameters are: * - * $diff - the diff array - * $separator - the separator between lines; this optional parameter defaults - * to "\n" + * @param array $diff the diff array + * @param string $separator the separator between lines; this optional parameter defaults to "\n" + * @return string String */ public static function toString($diff, $separator = "\n") { - // initialise the string $string = ''; @@ -242,17 +232,17 @@ class Diff return $string; } - /* Returns a diff as an HTML string, where unmodified lines are contained + /** + * Returns a diff as an HTML string, where unmodified lines are contained * within 'span' elements, deletions are contained within 'del' elements, and * insertions are contained within 'ins' elements. The parameters are: * - * $diff - the diff array - * $separator - the separator between lines; this optional parameter defaults - * to '
' + * @param string $diff the diff array + * @param string $separator the separator between lines; this optional parameter defaults to '
' + * @return string HTML string */ public static function toHTML($diff, $separator = '
') { - // initialise the HTML $html = ''; @@ -283,17 +273,16 @@ class Diff return $html; } - /* Returns a diff as an HTML table. The parameters are: + /** + * Returns a diff as an HTML table. The parameters are: * - * $diff - the diff array - * $indentation - indentation to add to every line of the generated HTML; this - * optional parameter defaults to '' - * $separator - the separator between lines; this optional parameter - * defaults to '
' + * @param string $diff the diff array + * @param string $indentation indentation to add to every line of the generated HTML; this optional parameter defaults to '' + * @param string $separator the separator between lines; this optional parameter defaults to '
' + * @return string HTML string */ public static function toTable($diff, $indentation = '', $separator = '
') { - // initialise the HTML $html = $indentation."
'; if (!empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) { @@ -310,6 +318,7 @@ if ($result) { print ''; print $form->select_country($search_country, 'search_country', '', 0, 'maxwidth150', 'code2', 1, 0, 1); //print ''; @@ -330,6 +339,7 @@ if ($result) { print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "fd.description", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "fd.total_ht", "", $param, '', $sortfield, $sortorder, 'right '); print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "fd.tva_tx", "", $param, '', $sortfield, $sortorder, 'right '); + print_liste_field_titre("ThirdParty", $_SERVER["PHP_SELF"], "s.nom", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("VATIntra", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "aa.account_number", "", $param, '', $sortfield, $sortorder); @@ -337,6 +347,7 @@ if ($result) { print_liste_field_titre($clickpicto, '', '', '', '', '', '', '', 'center '); print "
'.vatrate($objp->tva_tx.($objp->vat_src_code ? ' ('.$objp->vat_src_code.')' : '')).'' . $thirdpartystatic->getNomUrl(1, 'customer') . ''; if ($objp->country_code) diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index 8d09587ca5a..1d93a0fea17 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -1,6 +1,6 @@ - * Copyright (C) 2013-2019 Alexandre Spangaro + * Copyright (C) 2013-2020 Alexandre Spangaro * Copyright (C) 2014-2015 Ari Elbaz (elarifr) * Copyright (C) 2013-2014 Florian Henry * Copyright (C) 2014 Juanjo Menent @@ -27,12 +27,13 @@ */ require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php'; require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; @@ -49,6 +50,7 @@ $toselect = GETPOST('toselect', 'array'); $mesCasesCochees = GETPOST('toselect', 'array'); // Search Getpost +$search_societe = GETPOST('search_societe', 'alpha'); $search_lineid = GETPOST('search_lineid', 'int'); $search_ref = GETPOST('search_ref', 'alpha'); $search_invoice = GETPOST('search_invoice', 'alpha'); @@ -112,6 +114,7 @@ if (empty($reshook)) // Purge search criteria if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All test are required to be compatible with all browsers { + $search_societe=''; $search_lineid = ''; $search_ref = ''; $search_invoice = ''; @@ -212,7 +215,7 @@ $sql .= " p.accountancy_code_buy as code_buy, p.accountancy_code_buy_intra as co $sql .= " p.tosell as status, p.tobuy as status_buy,"; $sql .= " aa.rowid as aarowid, aa2.rowid as aarowid_intra, aa3.rowid as aarowid_export,"; $sql .= " co.code as country_code, co.label as country_label,"; -$sql .= " s.tva_intra"; +$sql .= " s.rowid as socid, s.nom as name, s.tva_intra, s.email, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta as code_compta_client, s.code_compta_fournisseur"; $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; @@ -227,6 +230,9 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa3 ON p.accountancy $sql .= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0"; $sql .= " AND l.product_type <= 2"; // Add search filter like +if ($search_societe) { + $sql .= natural_search('s.nom', $search_societe); +} if ($search_lineid) { $sql .= natural_search("l.rowid", $search_lineid, 1); } @@ -314,6 +320,7 @@ if ($result) { $param = ''; if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage); if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit); + if ($search_societe) $param .= '&search_societe='.urlencode($search_societe); if ($search_lineid) $param .= '&search_lineid='.urlencode($search_lineid); if ($search_day) $param .= '&search_day='.urlencode($search_day); if ($search_month) $param .= '&search_month='.urlencode($search_month); @@ -363,7 +370,7 @@ if ($result) { // We add search filter print '
'; if (!empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) { @@ -377,6 +384,7 @@ if ($result) { print ''; print $form->select_country($search_country, 'search_country', '', 0, 'maxwidth150', 'code2', 1, 0, 1); //print ''; @@ -399,6 +407,7 @@ if ($result) { print_liste_field_titre("ProductDescription", $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "l.total_ht", "", $param, '', $sortfield, $sortorder, 'right maxwidth50 '); print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, '', $sortfield, $sortorder, 'right '); + print_liste_field_titre("ThirdParty", $_SERVER["PHP_SELF"], "s.nom", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("VATIntra", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("AccountAccountingSuggest", '', '', '', '', '', '', '', 'nowraponall '); @@ -408,6 +417,7 @@ if ($result) { print_liste_field_titre($checkpicto, '', '', '', '', '', '', '', 'center '); print "
' . $thirdpartystatic->getNomUrl(1, 'customer') . ''; $labelcountry = ($objp->country_code && ($langs->trans("Country".$objp->country_code) != "Country".$objp->country_code)) ? $langs->trans("Country".$objp->country_code) : $objp->country_label; diff --git a/htdocs/accountancy/expensereport/lines.php b/htdocs/accountancy/expensereport/lines.php index 8cc398a00bf..4cd51fb3a63 100644 --- a/htdocs/accountancy/expensereport/lines.php +++ b/htdocs/accountancy/expensereport/lines.php @@ -252,6 +252,9 @@ if ($result) { print '
'; if (!empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; print ''; @@ -272,7 +275,10 @@ if ($result) { print '
'.$expensereport_static->getNomUrl(1).''.dol_print_date($db->jdate($objp->date_valid), 'day').''.dol_print_date($db->jdate($objp->date), 'day').''.($langs->trans($objp->type_fees_code) == $objp->type_fees_code ? $objp->type_fees_label : $langs->trans(($objp->type_fees_code))).'
'; if (!empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; print ''; @@ -308,7 +314,10 @@ if ($result) { print '
'.$expensereport_static->getNomUrl(1).''.dol_print_date($db->jdate($objp->date_valid), 'day').''.dol_print_date($db->jdate($objp->date), 'day').'
'; @@ -312,6 +320,7 @@ if ($result) { print ''; print $form->select_country($search_country, 'search_country', '', 0, 'maxwidth150', 'code2', 1, 0, 1); // print ''; @@ -334,6 +343,7 @@ if ($result) { print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "l.total_ht", "", $param, '', $sortfield, $sortorder, 'right '); print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, '', $sortfield, $sortorder, 'right '); + print_liste_field_titre("ThirdParty", $_SERVER["PHP_SELF"], "s.nom", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("VATIntra", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "aa.account_number", "", $param, '', $sortfield, $sortorder); @@ -341,6 +351,7 @@ if ($result) { print_liste_field_titre($checkpicto, '', '', '', '', '', '', '', 'center '); print "
'.vatrate($objp->tva_tx.($objp->vat_src_code ? ' ('.$objp->vat_src_code.')' : '')).'' . $thirdpartystatic->getNomUrl(1, 'supplier') . ''; if ($objp->country_code) { diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php index 7daf526c658..6ef942bea89 100644 --- a/htdocs/accountancy/supplier/list.php +++ b/htdocs/accountancy/supplier/list.php @@ -27,12 +27,13 @@ */ require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php'; require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; @@ -49,6 +50,7 @@ $toselect = GETPOST('toselect', 'array'); $mesCasesCochees = GETPOST('toselect', 'array'); // Search Getpost +$search_societe = GETPOST('search_societe', 'alpha'); $search_lineid = GETPOST('search_lineid', 'int'); $search_invoice = GETPOST('search_invoice', 'alpha'); $search_ref = GETPOST('search_ref', 'alpha'); @@ -116,6 +118,7 @@ if (empty($reshook)) // Purge search criteria if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All test are required to be compatible with all browsers { + $search_societe=''; $search_lineid = ''; $search_ref = ''; $search_invoice = ''; @@ -216,7 +219,7 @@ $sql .= " p.accountancy_code_buy as code_buy, p.accountancy_code_buy_intra as co $sql .= " p.tosell as status, p.tobuy as status_buy,"; $sql .= " aa.rowid as aarowid, aa2.rowid as aarowid_intra, aa3.rowid as aarowid_export,"; $sql .= " co.code as country_code, co.label as country_label,"; -$sql .= " s.tva_intra"; +$sql .= " s.rowid as socid, s.nom as name, s.tva_intra, s.email, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta as code_compta_client, s.code_compta_fournisseur"; $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; @@ -231,6 +234,9 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa3 ON p.accountancy $sql .= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0"; $sql .= " AND l.product_type <= 2"; // Add search filter like +if ($search_societe) { + $sql .= natural_search('s.nom', $search_societe); +} if ($search_lineid) { $sql .= natural_search("l.rowid", $search_lineid, 1); } @@ -314,6 +320,7 @@ if ($result) { $param = ''; if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage); if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit); + if ($search_societe) $param.='&search_societe='.urlencode($search_societe); if ($search_lineid) $param .= '&search_lineid='.urlencode($search_lineid); if ($search_day) $param .= '&search_day='.urlencode($search_day); if ($search_month) $param .= '&search_month='.urlencode($search_month); @@ -364,7 +371,7 @@ if ($result) { // We add search filter print '
'; @@ -376,6 +383,7 @@ if ($result) { print ''; print $form->select_country($search_country, 'search_country', '', 0, 'maxwidth150', 'code2', 1, 0, 1); //print ''; @@ -399,6 +407,7 @@ if ($result) { print_liste_field_titre("ProductDescription", $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "l.total_ht", "", $param, '', $sortfield, $sortorder, 'right maxwidth50 '); print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, '', $sortfield, $sortorder, 'right '); + print_liste_field_titre("ThirdParty", $_SERVER["PHP_SELF"], "s.nom", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("VATIntra", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("AccountAccountingSuggest", '', '', '', '', '', '', '', 'nowraponall '); @@ -408,6 +417,7 @@ if ($result) { print_liste_field_titre($checkpicto, '', '', '', '', '', '', '', 'center '); print "
' . $thirdpartystatic->getNomUrl(1, 'supplier') . ''; $labelcountry = ($objp->country_code && ($langs->trans("Country".$objp->country_code) != "Country".$objp->country_code)) ? $langs->trans("Country".$objp->country_code) : $objp->country_label; diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index d4664a13de1..f33a3ea6f93 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -693,7 +693,7 @@ print '
'; // Sales taxes (VAT, IRPF, ...) -print load_fiche_titre($langs->trans("TypeOfSaleTaxes")); +print load_fiche_titre($langs->trans("TypeOfSaleTaxes"), '', 'object_payment'); print ''; print ''; diff --git a/htdocs/admin/const.php b/htdocs/admin/const.php index 9f3accfe549..bc22a2020fb 100644 --- a/htdocs/admin/const.php +++ b/htdocs/admin/const.php @@ -328,10 +328,10 @@ if ($conf->use_javascript_ajax) { print '
'; print '
'; - print ''; + print ''; print '
'; print '
'; - print ''; + print ''; print '
'; } diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 3c19121d424..15cfd9ed9db 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -503,7 +503,7 @@ $tabhelp[33] = array('code'=>$langs->trans("EnterAnyCode")); $tabhelp[34] = array('code'=>$langs->trans("EnterAnyCode")); $tabhelp[35] = array(); $tabhelp[36] = array('range_ik'=>$langs->trans('PrevRangeToThisRange')); -$tabhelp[37] = array('code'=>$langs->trans("EnterAnyCode")); +$tabhelp[37] = array('code'=>$langs->trans("EnterAnyCode"), 'unit_type' => $langs->trans('MeasuringUnitTypeDesc'), 'scale' => $langs->trans('MeasuringScaleDesc')); $tabhelp[38] = array('code'=>$langs->trans("EnterAnyCode"), 'url' => $langs->trans('UrlSocialNetworksDesc'), 'icon' => $langs->trans('FafaIconSocialNetworksDesc')); // List of check for fields (NOT USED YET) diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index 68ab91c4638..1b088f0c2b9 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -122,6 +122,10 @@ if ($action == 'update') if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_TEXTTITLE', $conf->entity); else dolibarr_set_const($db, 'THEME_ELDY_TEXTTITLE', $val, 'chaine', 0, '', $conf->entity); + $val=(implode(',', (colorStringToArray(GETPOST('THEME_ELDY_TEXTTITLELINK'), array())))); + if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_TEXTTITLELINK', $conf->entity); + else dolibarr_set_const($db, 'THEME_ELDY_TEXTTITLELINK', $val, 'chaine', 0, '', $conf->entity); + $val = (implode(',', (colorStringToArray(GETPOST('THEME_ELDY_LINEIMPAIR1'), array())))); if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_LINEIMPAIR1', $conf->entity); else dolibarr_set_const($db, 'THEME_ELDY_LINEIMPAIR1', $val, 'chaine', 0, '', $conf->entity); diff --git a/htdocs/admin/menus/index.php b/htdocs/admin/menus/index.php index 56251e48f7b..97f0246ac88 100644 --- a/htdocs/admin/menus/index.php +++ b/htdocs/admin/menus/index.php @@ -277,8 +277,8 @@ print '
'; print ''; print ''; -print ''; +print ''; print ''; print ''; diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 926a4c34f70..6a0ff450346 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -412,11 +412,13 @@ foreach ($modulesdir as $dir) } $familyposition = $familyinfo[$familykey]['position']; - if ($external) + $listOfOfficialModuleGroups = array('hr', 'technic', 'interface', 'technic', 'portal', 'financial', 'crm', 'base', 'products', 'srm', 'ecm', 'projects', 'other'); + if ($external && ! in_array($familykey, $listOfOfficialModuleGroups)) { - // TODO Find a solution so modules with their own family are always at end - //var_dump($familyposition); - //$familyposition += 100; + // If module is extern and into a custom group (not into an official predefined one), it must appear at end (custom groups should not be before official groups). + if (is_numeric($familyposition)) { + $familyposition = sprintf("%03d", (int) $familyposition + 100); + } } $orders[$i] = $familyposition."_".$familykey."_".$moduleposition."_".$j; // Sort by family, then by module position then number diff --git a/htdocs/admin/notification.php b/htdocs/admin/notification.php index 97b09861a42..ba92aa1ec21 100644 --- a/htdocs/admin/notification.php +++ b/htdocs/admin/notification.php @@ -34,10 +34,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/triggers/interface_50_modNotification_Noti $langs->loadLangs(array('admin', 'other', 'orders', 'propal', 'bills', 'errors', 'mails')); // Security check -if (!$user->admin) - accessforbidden(); +if (!$user->admin) { + accessforbidden(); +} $action = GETPOST('action', 'aZ09'); +$error = 0; /* @@ -45,27 +47,48 @@ $action = GETPOST('action', 'aZ09'); */ // Action to update or add a constant -if ($action == 'update' || $action == 'add') +if ($action == 'settemplates') { - $constlineid = GETPOST('rowid', 'int'); - $constname = GETPOST('constname', 'alpha'); + $db->begin(); - $constvalue = (GETPOSTISSET('constvalue_'.$constname) ? GETPOST('constvalue_'.$constname, 'alpha') : GETPOST('constvalue')); - $consttype = (GETPOSTISSET('consttype_'.$constname) ? GETPOST('consttype_'.$constname, 'alphanohtml') : GETPOST('consttype')); - $constnote = (GETPOSTISSET('constnote_'.$constname) ? GETPOST('constnote_'.$constname, 'none') : GETPOST('constnote')); + if (!$error && is_array($_POST)) + { + $reg = array(); + foreach ($_POST as $key => $val) + { + if (!preg_match('/^constvalue_(.*)_TEMPLATE/', $key, $reg)) continue; - $typetouse = empty($oldtypetonewone[$consttype]) ? $consttype : $oldtypetonewone[$consttype]; + $triggername = $reg[1]; + $constvalue = GETPOST($key, 'alpha'); + $consttype = 'emailtemplate:xxx'; + $tmparray=explode(':', $constvalue); + if (! empty($tmparray[0]) && ! empty($tmparray[1])) { + $constvalue = $tmparray[0]; + $consttype = 'emailtemplate:'.$tmparray[1]; + //var_dump($constvalue); + //var_dump($consttype); + $res = dolibarr_set_const($db, $triggername.'_TEMPLATE', $constvalue, $consttype, 0, '', $conf->entity); + if ($res < 0) { + $error++; + break; + } + } else { + $res = dolibarr_del_const($db, $triggername.'_TEMPLATE', $conf->entity); + } + } + } - $res = dolibarr_set_const($db, $constname, $constvalue, $typetouse, 0, $constnote, $conf->entity); - - if (!$res > 0) $error++; if (!$error) { + $db->commit(); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { + $db->rollback(); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -74,12 +97,31 @@ if ($action == 'setvalue' && $user->admin) { $db->begin(); - $result = dolibarr_set_const($db, "NOTIFICATION_EMAIL_FROM", $_POST["email_from"], 'chaine', 0, '', $conf->entity); + $result = dolibarr_set_const($db, "NOTIFICATION_EMAIL_FROM", GETPOST("email_from", "none"), 'chaine', 0, '', $conf->entity); if ($result < 0) $error++; + + if (!$error) + { + $db->commit(); + + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } + else + { + $db->rollback(); + + setEventMessages($langs->trans("Error"), null, 'errors'); + } +} + + +if ($action == 'setfixednotif' && $user->admin) +{ + $db->begin(); + if (!$error && is_array($_POST)) { - //var_dump($_POST); $reg = array(); foreach ($_POST as $key => $val) { @@ -101,7 +143,7 @@ if ($action == 'setvalue' && $user->admin) } elseif (preg_match('/^NOTIF_(.*)_new_key/', $key, $reg)) { - // Add a new entry + // Add a new entry $newkey = 'NOTIFICATION_FIXEDEMAIL_'.$reg[1].'_THRESHOLD_HIGHER_'.((int) GETPOST($shortkey.'_amount')); $newval = GETPOST($shortkey.'_key'); } @@ -168,9 +210,18 @@ print ''; print ''; print '
'.$langs->trans("TreeMenuPersonalized").'
'; +print '
'; + +print ''; + + print '

'; +print '
'; +print ''; +print ''; + // Notification per contacts $title = $langs->trans("ListOfNotificationsPerUser"); if (!empty($conf->societe->enabled)) $title = $langs->trans("ListOfNotificationsPerUserOrContact"); @@ -211,7 +262,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { } $helptext = ''; - form_constantes($constantes, 0, $helptext); + form_constantes($constantes, 2, $helptext); } else { print ''; print ''; @@ -248,14 +299,18 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { print '
'; } -print '
'; -print '* '.$langs->trans("GoOntoUserCardToAddMore").'
'; -if (!empty($conf->societe->enabled)) print '** '.$langs->trans("GoOntoContactCardToAddMore").'
'; +print '
'; + +print ''; + -print '
'; print '

'; +print '
'; +print ''; +print ''; + print load_fiche_titre($langs->trans("ListOfFixedNotifications"), '', ''); print ''; @@ -333,6 +388,12 @@ foreach ($listofnotifiedevents as $notifiedevent) } print '
'; +print '
'; +print '* '.$langs->trans("GoOntoUserCardToAddMore").'
'; +if (!empty($conf->societe->enabled)) print '** '.$langs->trans("GoOntoContactCardToAddMore").'
'; + +print '
'; + print '
'; print '
'; diff --git a/htdocs/admin/tools/dolibarr_export.php b/htdocs/admin/tools/dolibarr_export.php index f88563ff512..1ad21490e4b 100644 --- a/htdocs/admin/tools/dolibarr_export.php +++ b/htdocs/admin/tools/dolibarr_export.php @@ -200,7 +200,6 @@ if (in_array($type, array('mysql', 'mysqli'))) { print '
'; print ''; print ''; - print '
'; if (!empty($conf->global->MYSQL_OLD_OPTION_DISABLE_FK)) { diff --git a/htdocs/admin/tools/purge.php b/htdocs/admin/tools/purge.php index 43cf81b41ba..9898e290ddc 100644 --- a/htdocs/admin/tools/purge.php +++ b/htdocs/admin/tools/purge.php @@ -78,7 +78,7 @@ $form = new Form($db); print load_fiche_titre($langs->trans("Purge"), '', 'title_setup'); -print $langs->trans("PurgeAreaDesc", $dolibarr_main_data_root).'
'; +print ''.$langs->trans("PurgeAreaDesc", $dolibarr_main_data_root).'
'; print '
'; diff --git a/htdocs/api/class/api_access.class.php b/htdocs/api/class/api_access.class.php index 866de6a53d2..339ddfd2ad6 100644 --- a/htdocs/api/class/api_access.class.php +++ b/htdocs/api/class/api_access.class.php @@ -18,7 +18,7 @@ // Create the autoloader for Luracast require_once DOL_DOCUMENT_ROOT.'/includes/restler/framework/Luracast/Restler/AutoLoader.php'; -call_user_func(function() { +call_user_func(function () { $loader = Luracast\Restler\AutoLoader::instance(); spl_autoload_register($loader); return $loader; diff --git a/htdocs/api/class/api_setup.class.php b/htdocs/api/class/api_setup.class.php index ec7a6b89596..fd6432b553f 100644 --- a/htdocs/api/class/api_setup.class.php +++ b/htdocs/api/class/api_setup.class.php @@ -1429,7 +1429,7 @@ class Setup extends DolibarrApi if (!preg_match('/^[a-zA-Z0-9_]+$/', $constantname) || !isset($conf->global->$constantname)) { throw new RestException(500, 'Error Bad or unknown value for constantname'); } - if (preg_match('/(_pass|password|secret|_key|key$)/i', $constantname)) { + if (preg_match('/(_pass|_pw|password|secret|_key|key$)/i', $constantname)) { throw new RestException(403, 'Forbidden'); } diff --git a/htdocs/api/index.php b/htdocs/api/index.php index d27bd39e966..c5edbc74d66 100644 --- a/htdocs/api/index.php +++ b/htdocs/api/index.php @@ -44,7 +44,7 @@ if (!$res) die("Include of main fails"); require_once DOL_DOCUMENT_ROOT.'/includes/restler/framework/Luracast/Restler/AutoLoader.php'; -call_user_func(function() { +call_user_func(function () { $loader = Luracast\Restler\AutoLoader::instance(); spl_autoload_register($loader); return $loader; diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index a9ed7ee3a00..c2c18dae6e5 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -979,7 +979,6 @@ class BOM extends CommonObject * * @return int 0 if OK, <>0 if KO (this function is used also by cron so only 0 is OK) */ - //public function doScheduledJob($param1, $param2, ...) public function doScheduledJob() { global $conf, $langs; diff --git a/htdocs/comm/mailing/class/advtargetemailing.class.php b/htdocs/comm/mailing/class/advtargetemailing.class.php index b398235e8d8..7700ca6ee43 100644 --- a/htdocs/comm/mailing/class/advtargetemailing.class.php +++ b/htdocs/comm/mailing/class/advtargetemailing.class.php @@ -570,7 +570,8 @@ class AdvanceTargetingMailing extends CommonObject //Standard Extrafield feature if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) { - $elementtype = Societe::$table_element; + $socstatic = new Societe($this->db); + $elementtype = $socstatic->table_element; $extrafields->fetch_name_optionals_label($elementtype); @@ -707,7 +708,8 @@ class AdvanceTargetingMailing extends CommonObject //Standard Extrafield feature if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) { - $elementtype = Contact::$table_element; + $contactstatic = new Contact($this->db); + $elementtype = $contactstatic->table_element; // fetch optionals attributes and labels dol_include_once('/core/class/extrafields.class.php'); @@ -809,7 +811,8 @@ class AdvanceTargetingMailing extends CommonObject //Standard Extrafield feature if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) { - $elementtype = Societe::$table_element; + $socstatic = new Societe($this->db); + $elementtype = $socstatic->table_element; // fetch optionals attributes and labels dol_include_once('/core/class/extrafields.class.php'); diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index ebd328ca171..3c7cfe0006c 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -2999,9 +2999,9 @@ class Propal extends CommonObject if (!$error) { - $main = MAIN_DB_PREFIX . 'propaldet'; - $ef = $main . "_extrafields"; - $sqlef = "DELETE FROM $ef WHERE fk_object IN (SELECT rowid FROM $main WHERE fk_propal = " . $this->id . ")"; + $main = MAIN_DB_PREFIX.'propaldet'; + $ef = $main."_extrafields"; + $sqlef = "DELETE FROM $ef WHERE fk_object IN (SELECT rowid FROM $main WHERE fk_propal = ".$this->id.")"; $sql = "DELETE FROM ".MAIN_DB_PREFIX."propaldet WHERE fk_propal = ".$this->id; if ($this->db->query($sqlef) && $this->db->query($sql)) { diff --git a/htdocs/comm/propal/class/propalestats.class.php b/htdocs/comm/propal/class/propalestats.class.php index d5c48006430..747bb75433c 100644 --- a/htdocs/comm/propal/class/propalestats.class.php +++ b/htdocs/comm/propal/class/propalestats.class.php @@ -3,6 +3,7 @@ * Copyright (c) 2005-2013 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (c) 2011 Juanjo Menent + * Copyright (C) 2020 Maxime DEMAREST * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -46,23 +47,27 @@ class PropaleStats extends Stats public $from; public $field; public $where; + public $join; /** * Constructor * - * @param DoliDB $db Database handler - * @param int $socid Id third party for filter. This value must be forced during the new to external user company if user is an external user. - * @param int $userid Id user for filter (creation user) - * @param string $mode Option ('customer', 'supplier') + * @param DoliDB $db Database handler + * @param int $socid Id third party for filter. This value must be forced during the new to external user company if user is an external user. + * @param int $userid Id user for filter (creation user) + * @param string $mode Option ('customer', 'supplier') + * @param int $typentid Id typent of thirdpary for filter + * @param int $categid Id category of thirdpary for filter */ - public function __construct($db, $socid = 0, $userid = 0, $mode = 'customer') + public function __construct($db, $socid = 0, $userid = 0, $mode = 'customer', $typentid = 0, $categid = 0) { global $user, $conf; $this->db = $db; $this->socid = ($socid > 0 ? $socid : 0); $this->userid = $userid; + $this->join = ''; if ($mode == 'customer') { @@ -96,6 +101,19 @@ class PropaleStats extends Stats $this->where .= " AND p.fk_soc = ".$this->socid; } if ($this->userid > 0) $this->where .= ' AND fk_user_author = '.$this->userid; + + if ($typentid) + { + $this->join .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s ON s.rowid = p.fk_soc'; + $this->where .= ' AND s.fk_typent = '.$typentid; + } + + if ($categid) + { + $this->join .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_societe as cs ON cs.fk_soc = p.fk_soc'; + $this->join .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie as c ON c.rowid = cs.fk_categorie'; + $this->where .= ' AND c.rowid = '.$categid; + } } @@ -113,6 +131,7 @@ class PropaleStats extends Stats $sql = "SELECT date_format(".$this->field_date.",'%m') as dm, COUNT(*) as nb"; $sql .= " FROM ".$this->from; if (!$user->rights->societe->client->voir && !$user->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql .= $this->join; $sql .= " WHERE ".$this->field_date." BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'"; $sql .= " AND ".$this->where; $sql .= " GROUP BY dm"; @@ -135,6 +154,7 @@ class PropaleStats extends Stats $sql = "SELECT date_format(".$this->field_date.",'%Y') as dm, COUNT(*) as nb, SUM(c.".$this->field.")"; $sql .= " FROM ".$this->from; if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql .= $this->join; $sql .= " WHERE ".$this->where; $sql .= " GROUP BY dm"; $sql .= $this->db->order('dm', 'DESC'); @@ -156,6 +176,7 @@ class PropaleStats extends Stats $sql = "SELECT date_format(".$this->field_date.",'%m') as dm, SUM(p.".$this->field.")"; $sql .= " FROM ".$this->from; if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql .= $this->join; $sql .= " WHERE ".$this->field_date." BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'"; $sql .= " AND ".$this->where; $sql .= " GROUP BY dm"; @@ -178,6 +199,7 @@ class PropaleStats extends Stats $sql = "SELECT date_format(".$this->field_date.",'%m') as dm, AVG(p.".$this->field.")"; $sql .= " FROM ".$this->from; if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql .= $this->join; $sql .= " WHERE ".$this->field_date." BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'"; $sql .= " AND ".$this->where; $sql .= " GROUP BY dm"; @@ -198,6 +220,7 @@ class PropaleStats extends Stats $sql = "SELECT date_format(".$this->field_date.",'%Y') as year, COUNT(*) as nb, SUM(".$this->field.") as total, AVG(".$this->field.") as avg"; $sql .= " FROM ".$this->from; if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql .= $this->join; $sql .= " WHERE ".$this->where; $sql .= " GROUP BY year"; $sql .= $this->db->order('year', 'DESC'); @@ -221,6 +244,7 @@ class PropaleStats extends Stats $sql = "SELECT product.ref, COUNT(product.ref) as nb, SUM(tl.".$this->field_line.") as total, AVG(tl.".$this->field_line.") as avg"; $sql .= " FROM ".$this->from.", ".$this->from_line.", ".MAIN_DB_PREFIX."product as product"; if (!$user->rights->societe->client->voir && !$user->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql .= $this->join; $sql .= " WHERE ".$this->where; $sql .= " AND p.rowid = tl.fk_propal AND tl.fk_product = product.rowid"; $sql .= " AND ".$this->field_date." BETWEEN '".$this->db->idate(dol_get_first_day($year, 1, false))."' AND '".$this->db->idate(dol_get_last_day($year, 12, false))."'"; diff --git a/htdocs/comm/propal/stats/index.php b/htdocs/comm/propal/stats/index.php index 3fee370c89b..add31f13f08 100644 --- a/htdocs/comm/propal/stats/index.php +++ b/htdocs/comm/propal/stats/index.php @@ -4,6 +4,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2012 Marcos García * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2020 Maxime DEMAREST * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,7 +29,10 @@ require '../../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propalestats.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; +require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formpropal.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; $WIDTH = DolGraph::getDefaultGraphSizeForStats('width'); $HEIGHT = DolGraph::getDefaultGraphSizeForStats('height'); @@ -38,6 +42,8 @@ if ($mode == 'customer' && !$user->rights->propale->lire) accessforbidden(); if ($mode == 'supplier' && !$user->rights->supplier_proposal->lire) accessforbidden(); $object_status = GETPOST('object_status'); +$typent_id = GETPOST('typent_id', 'int'); +$categ_id = GETPOST('categ_id', 'categ_id'); $userid = GETPOST('userid', 'int'); $socid = GETPOST('socid', 'int'); @@ -64,17 +70,26 @@ $langs->loadLangs(array('orders', 'companies', 'other', 'suppliers', 'supplier_p $form = new Form($db); $formpropal = new FormPropal($db); +$formcompany = new FormCompany($db); +$formother = new FormOther($db); $langs->loadLangs(array('propal', 'other', 'companies')); -$picto = 'propal'; -$title = $langs->trans("ProposalsStatistics"); -$dir = $conf->propale->dir_temp; +if ($mode == 'customer') +{ + $picto = 'propal'; + $title = $langs->trans("ProposalsStatistics"); + $dir = $conf->propale->dir_temp; + $cat_type = Categorie::TYPE_CUSTOMER; + $cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("Customer")); +} if ($mode == 'supplier') { $picto = 'supplier_proposal'; $title = $langs->trans("ProposalsStatisticsSuppliers").' ('.$langs->trans("SentToSuppliers").")"; $dir = $conf->supplier_proposal->dir_temp; + $cat_type = Categorie::TYPE_SUPPLIER; + $cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("Supplier")); } llxHeader('', $title); @@ -85,7 +100,7 @@ print load_fiche_titre($title, '', $picto); dol_mkdir($dir); -$stats = new PropaleStats($db, $socid, ($userid > 0 ? $userid : 0), $mode); +$stats = new PropaleStats($db, $socid, ($userid > 0 ? $userid : 0), $mode, ($typent_id > 0 ? $typent_id : 0), ($categ_id > 0 ? $categ_id : 0)); if ($object_status != '' && $object_status >= 0) $stats->where .= ' AND p.fk_statut IN ('.$db->escape($object_status).')'; // Build graphic number of object @@ -251,6 +266,16 @@ print '
'; $filter = 's.client IN (1,2,3)'; print $form->select_company($socid, 'socid', $filter, 1, 0, 0, array(), 0, '', 'style="width: 95%"'); print '
'.$langs->trans("ThirdPartyType").''; + $sortparam_typent = (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT); // NONE means we keep sort of original array, so we sort on position. ASC, means next function will sort on label. + print $form->selectarray("typent_id", $formcompany->typent_array(0), $typent_id, 0, 0, 0, '', 0, 0, 0, $sortparam_typent); + if ($user->admin) print ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); + print '
'.$cat_label.''; + print $formother->select_categories($cat_type, $categ_id, 'categ_id', true); + print '
'.$langs->trans("CreatedBy").''; print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 6665d738948..b911a03e3ad 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -3412,9 +3412,9 @@ class Commande extends CommonOrder if (!$error) { // Delete extrafields of order details - $main = MAIN_DB_PREFIX . 'commandedet'; - $ef = $main . "_extrafields"; - $sql = "DELETE FROM $ef WHERE fk_object IN (SELECT rowid FROM $main WHERE fk_commande = " . $this->id . ")"; + $main = MAIN_DB_PREFIX.'commandedet'; + $ef = $main."_extrafields"; + $sql = "DELETE FROM $ef WHERE fk_object IN (SELECT rowid FROM $main WHERE fk_commande = ".$this->id.")"; if (!$this->db->query($sql)) { $error++; diff --git a/htdocs/commande/class/commandestats.class.php b/htdocs/commande/class/commandestats.class.php index 8b6dc4db6ec..cbb93b940de 100644 --- a/htdocs/commande/class/commandestats.class.php +++ b/htdocs/commande/class/commandestats.class.php @@ -3,6 +3,7 @@ * Copyright (c) 2005-2013 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2012 Marcos García + * Copyright (C) 2020 Maxime DEMAREST * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -45,17 +46,20 @@ class CommandeStats extends Stats public $from; public $field; public $where; + public $join; /** * Constructor * - * @param DoliDB $db Database handler - * @param int $socid Id third party for filter. This value must be forced during the new to external user company if user is an external user. - * @param string $mode Option ('customer', 'supplier') - * @param int $userid Id user for filter (creation user) + * @param DoliDB $db Database handler + * @param int $socid Id third party for filter. This value must be forced during the new to external user company if user is an external user. + * @param string $mode Option ('customer', 'supplier') + * @param int $userid Id user for filter (creation user) + * @param int $typentid Id typent of thirdpary for filter + * @param int $categid Id category of thirdpary for filter */ - public function __construct($db, $socid, $mode, $userid = 0) + public function __construct($db, $socid, $mode, $userid = 0, $typentid = 0, $categid = 0) { global $user, $conf; @@ -64,6 +68,7 @@ class CommandeStats extends Stats $this->socid = ($socid > 0 ? $socid : 0); $this->userid = $userid; $this->cachefilesuffix = $mode; + $this->join = ''; if ($mode == 'customer') { @@ -92,6 +97,19 @@ class CommandeStats extends Stats $this->where .= " AND c.fk_soc = ".$this->socid; } if ($this->userid > 0) $this->where .= ' AND c.fk_user_author = '.$this->userid; + + if ($typentid) + { + $this->join .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s ON s.rowid = c.fk_soc'; + $this->where .= ' AND s.fk_typent = '.$typentid; + } + + if ($categid) + { + $this->join .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_societe as cats ON cats.fk_soc = c.fk_soc'; + $this->join .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie as cat ON cat.rowid = cats.fk_categorie'; + $this->where .= ' AND cat.rowid = '.$categid; + } } /** @@ -108,6 +126,7 @@ class CommandeStats extends Stats $sql = "SELECT date_format(c.date_commande,'%m') as dm, COUNT(*) as nb"; $sql .= " FROM ".$this->from; if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql .= $this->join; $sql .= " WHERE c.date_commande BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'"; $sql .= " AND ".$this->where; $sql .= " GROUP BY dm"; @@ -130,6 +149,7 @@ class CommandeStats extends Stats $sql = "SELECT date_format(c.date_commande,'%Y') as dm, COUNT(*) as nb, SUM(c.".$this->field.")"; $sql .= " FROM ".$this->from; if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql .= $this->join; $sql .= " WHERE ".$this->where; $sql .= " GROUP BY dm"; $sql .= $this->db->order('dm', 'DESC'); @@ -151,6 +171,7 @@ class CommandeStats extends Stats $sql = "SELECT date_format(c.date_commande,'%m') as dm, SUM(c.".$this->field.")"; $sql .= " FROM ".$this->from; if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql .= $this->join; $sql .= " WHERE c.date_commande BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'"; $sql .= " AND ".$this->where; $sql .= " GROUP BY dm"; @@ -173,6 +194,7 @@ class CommandeStats extends Stats $sql = "SELECT date_format(c.date_commande,'%m') as dm, AVG(c.".$this->field.")"; $sql .= " FROM ".$this->from; if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql .= $this->join; $sql .= " WHERE c.date_commande BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'"; $sql .= " AND ".$this->where; $sql .= " GROUP BY dm"; @@ -193,6 +215,7 @@ class CommandeStats extends Stats $sql = "SELECT date_format(c.date_commande,'%Y') as year, COUNT(*) as nb, SUM(c.".$this->field.") as total, AVG(".$this->field.") as avg"; $sql .= " FROM ".$this->from; if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql .= $this->join; $sql .= " WHERE ".$this->where; $sql .= " GROUP BY year"; $sql .= $this->db->order('year', 'DESC'); @@ -214,6 +237,7 @@ class CommandeStats extends Stats $sql = "SELECT product.ref, COUNT(product.ref) as nb, SUM(tl.".$this->field_line.") as total, AVG(tl.".$this->field_line.") as avg"; $sql .= " FROM ".$this->from.", ".$this->from_line.", ".MAIN_DB_PREFIX."product as product"; if (!$user->rights->societe->client->voir && !$user->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql .= $this->join; $sql .= " WHERE ".$this->where; $sql .= " AND c.rowid = tl.fk_commande AND tl.fk_product = product.rowid"; $sql .= " AND c.date_commande BETWEEN '".$this->db->idate(dol_get_first_day($year, 1, false))."' AND '".$this->db->idate(dol_get_last_day($year, 12, false))."'"; diff --git a/htdocs/commande/stats/index.php b/htdocs/commande/stats/index.php index 16cef93d228..4e7ed481882 100644 --- a/htdocs/commande/stats/index.php +++ b/htdocs/commande/stats/index.php @@ -4,6 +4,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2012 Marcos García * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2020 Maxime DEMAREST * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,7 +29,10 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; require_once DOL_DOCUMENT_ROOT.'/commande/class/commandestats.class.php'; +require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formorder.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; $WIDTH = DolGraph::getDefaultGraphSizeForStats('width'); @@ -39,6 +43,8 @@ if ($mode == 'customer' && !$user->rights->commande->lire) accessforbidden(); if ($mode == 'supplier' && !$user->rights->fournisseur->commande->lire) accessforbidden(); $object_status = GETPOST('object_status'); +$typent_id = GETPOST('typent_id', 'int'); +$categ_id = GETPOST('categ_id', 'categ_id'); $userid = GETPOST('userid', 'int'); $socid = GETPOST('socid', 'int'); @@ -65,6 +71,8 @@ $langs->loadLangs(array('orders', 'companies', 'other', 'suppliers')); $form = new Form($db); $formorder = new FormOrder($db); +$formcompany = new FormCompany($db); +$formother = new FormOther($db); $picto = 'order'; $title = $langs->trans("OrdersStatistics"); @@ -83,7 +91,7 @@ print load_fiche_titre($title, '', $picto); dol_mkdir($dir); -$stats = new CommandeStats($db, $socid, $mode, ($userid > 0 ? $userid : 0)); +$stats = new CommandeStats($db, $socid, $mode, ($userid > 0 ? $userid : 0), ($typent_id > 0 ? $typent_id : 0), ($categ_id > 0 ? $categ_id : 0)); if ($mode == 'customer') { if ($object_status != '' && $object_status >= -1) $stats->where .= ' AND c.fk_statut IN ('.$db->escape($object_status).')'; @@ -266,6 +274,26 @@ if ($mode == 'customer') $filter = 's.client IN (1,2,3)'; if ($mode == 'supplier') $filter = 's.fournisseur = 1'; print $form->select_company($socid, 'socid', $filter, 1, 0, 0, array(), 0, '', 'style="width: 95%"'); print '
'.$langs->trans("ThirdPartyType").''; +$sortparam_typent = (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT); // NONE means we keep sort of original array, so we sort on position. ASC, means next function will sort on label. +print $form->selectarray("typent_id", $formcompany->typent_array(0), $typent_id, 0, 0, 0, '', 0, 0, 0, $sortparam_typent); +if ($user->admin) print ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); +print '
'.$cat_label.''; +print $formother->select_categories($cat_type, $categ_id, 'categ_id', true); +print '
'.$langs->trans("CreatedBy").''; print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); diff --git a/htdocs/compta/bank/list.php b/htdocs/compta/bank/list.php index eaefdfb6573..457a5986dea 100644 --- a/htdocs/compta/bank/list.php +++ b/htdocs/compta/bank/list.php @@ -556,6 +556,12 @@ foreach ($accounts as $key=>$type) } // Extra fields + if (is_array($objecttmp->array_options)) { + $obj = new stdClass(); + foreach ($objecttmp->array_options as $k => $v) { + $obj->$k = $v; + } + } include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook $parameters = array('arrayfields'=>$arrayfields); diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 4aa147ebb35..300db43c10f 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -4633,7 +4633,7 @@ elseif ($id > 0 || !empty($ref)) $current_situation_counter = array(); foreach ($object->tab_previous_situation_invoice as $prev_invoice) { - $totalpaye_prev = $prev_invoice->getSommePaiement(); + $tmptotalpaidforthisinvoice = $prev_invoice->getSommePaiement(); $total_prev_ht += $prev_invoice->total_ht; $total_prev_ttc += $prev_invoice->total_ttc; $current_situation_counter[] = (($prev_invoice->type == Facture::TYPE_CREDIT_NOTE) ?-1 : 1) * $prev_invoice->situation_counter; @@ -4644,7 +4644,7 @@ elseif ($id > 0 || !empty($ref)) if (!empty($conf->banque->enabled)) print ''.price($prev_invoice->total_ht).''.price($prev_invoice->total_ttc).''.$prev_invoice->getLibStatut(3, $totalpaye_prev).''.$prev_invoice->getLibStatut(3, $tmptotalpaidforthisinvoice).'
'.$langs->trans("ThirdPartyType").''; +$sortparam_typent = (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT); // NONE means we keep sort of original array, so we sort on position. ASC, means next function will sort on label. +print $form->selectarray("typent_id", $formcompany->typent_array(0), $typent_id, 0, 0, 0, '', 0, 0, 0, $sortparam_typent); +if ($user->admin) print ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); +print '
'.$cat_label.''; +print $formother->select_categories($cat_type, $categ_id, 'categ_id', true); +print '
'.$langs->trans("CreatedBy").''; print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); @@ -256,7 +284,7 @@ print '
'.$langs->trans("Status").''; if ($mode == 'customer') { - $liststatus = array('0'=>$langs->trans("BillStatusDraft"), '1'=>$langs->trans("BillStatusNotPaid"), '2'=>$langs->trans("BillStatusPaid"), '3'=>$langs->trans("BillStatusCanceled")); + $liststatus = array('0'=>$langs->trans("BillStatusDraft"), '1'=>$langs->trans("BillStatusNotPaid"), '2'=>$langs->trans("BillStatusPaid"), '1,2'=>$langs->trans("BillStatusNotPaid").' / '.$langs->trans("BillStatusPaid"), '3'=>$langs->trans("BillStatusCanceled")); print $form->selectarray('object_status', $liststatus, $object_status, 1); } if ($mode == 'supplier') diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 3c64b627a5c..52144d44d34 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -521,7 +521,9 @@ if (empty($reshook)) } $desc = $prod->description; - $desc = dol_concatdesc($desc, $product_desc, '', !empty($conf->global->MAIN_CHANGE_ORDER_CONCAT_DESCRIPTION)); + if (!empty($product_desc) && !empty($conf->global->MAIN_NO_CONCAT_DESCRIPTION)) $desc = $product_desc; + else $desc = dol_concatdesc($desc, $product_desc, '', !empty($conf->global->MAIN_CHANGE_ORDER_CONCAT_DESCRIPTION)); + $fk_unit = $prod->fk_unit; } else @@ -1642,13 +1644,13 @@ else } if ($user->rights->contrat->creer && ($object->statut >= 0)) { - print ''; + print ''; print img_edit(); print ''; } if ($user->rights->contrat->creer && ($object->statut >= 0)) { - print ''; + print ''; print img_delete(); print ''; } diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 31655cf8033..1dec473edac 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -1255,9 +1255,9 @@ class Contrat extends CommonObject if (!$error) { // Delete contratdet extrafields - $main = MAIN_DB_PREFIX . 'contratdet'; - $ef = $main . "_extrafields"; - $sql = "DELETE FROM $ef WHERE fk_object IN (SELECT rowid FROM $main WHERE fk_contrat = " . $this->id . ")"; + $main = MAIN_DB_PREFIX.'contratdet'; + $ef = $main."_extrafields"; + $sql = "DELETE FROM $ef WHERE fk_object IN (SELECT rowid FROM $main WHERE fk_contrat = ".$this->id.")"; dol_syslog(get_class($this)."::delete contratdet_extrafields", LOG_DEBUG); $resql = $this->db->query($sql); diff --git a/htdocs/contrat/index.php b/htdocs/contrat/index.php index 1f3a9fa5b99..2a7c9c0d91a 100644 --- a/htdocs/contrat/index.php +++ b/htdocs/contrat/index.php @@ -360,7 +360,7 @@ if ($result) $obj = $db->fetch_object($result); print '
'; + print ''; $staticcontrat->ref = ($obj->ref ? $obj->ref : $obj->cid); $staticcontrat->id = $obj->cid; print $staticcontrat->getNomUrl(1, 16); @@ -425,7 +425,7 @@ if ($resql) $obj = $db->fetch_object($resql); print '
'; + print ''; $staticcontrat->ref = ($obj->ref ? $obj->ref : $obj->fk_contrat); $staticcontrat->id = $obj->fk_contrat; print $staticcontrat->getNomUrl(1, 16); @@ -506,7 +506,7 @@ if ($resql) print '
'; + print ''; $staticcontrat->ref = ($obj->ref ? $obj->ref : $obj->fk_contrat); $staticcontrat->id = $obj->fk_contrat; print $staticcontrat->getNomUrl(1, 16); @@ -586,7 +586,7 @@ if ($resql) print '
'; + print ''; $staticcontrat->ref = ($obj->ref ? $obj->ref : $obj->fk_contrat); $staticcontrat->id = $obj->fk_contrat; print $staticcontrat->getNomUrl(1, 16); diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index 70ab37c0380..4b163480035 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2019 Laurent Destailleur + * Copyright (C) 2004-2020 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2013 Cédric Salvador * Copyright (C) 2014-2019 Juanjo Menent @@ -612,9 +612,11 @@ while ($i < min($num, $limit)) } print '
'; + print ''; print $contracttmp->getNomUrl(1); if ($obj->nb_late) print img_warning($langs->trans("Late")); if (!empty($obj->note_private) || !empty($obj->note_public)) { @@ -631,6 +633,7 @@ while ($i < min($num, $limit)) print ''.$contracttmp->getFormatedCustomerRef($obj->ref_customer).'
\n"; @@ -373,14 +362,16 @@ class Diff return $html.$indentation."
\n"; } - /* Returns the content of the cell, for use in the toTable function. The + /** + * Returns the content of the cell, for use in the toTable function. The * parameters are: * - * $diff - the diff array - * $indentation - indentation to add to every line of the generated HTML - * $separator - the separator between lines - * $index - the current index, passes by reference - * $type - the type of line + * @param string $diff the diff array + * @param string $indentation indentation to add to every line of the generated HTML + * @param string $separator the separator between lines + * @param string $index the current index, passes by reference + * @param string $type the type of line + * @return string HTML string */ private static function getCellContent($diff, $indentation, $separator, &$index, $type) { diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 22b591dd53f..cd115dbe292 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -481,17 +481,22 @@ if (empty($reshook)) { if (!$error && GETPOSTISSET('contactid')) { $contactid = GETPOST('contactid', 'int'); + $socid = GETPOST('socid', 'int'); - if ($contactid > 0) { + if ($contactid > 0) { // The 'contactid' is used inpriority over the 'socid' $contact = new Contact($db); $contact->fetch($contactid); $sql = "UPDATE ".MAIN_DB_PREFIX."user"; - $sql .= " SET fk_socpeople=".$db->escape($contactid); + $sql .= " SET fk_socpeople=".((int) $contactid); if (!empty($contact->socid)) { - $sql .= ", fk_soc=".$db->escape($contact->socid); + $sql .= ", fk_soc=".((int) $contact->socid); } $sql .= " WHERE rowid=".$object->id; + } elseif ($socid > 0) { + $sql = "UPDATE ".MAIN_DB_PREFIX."user"; + $sql .= " SET fk_socpeople=NULL, fk_soc=".((int) $socid); + $sql .= " WHERE rowid=".$object->id; } else { $sql = "UPDATE ".MAIN_DB_PREFIX."user"; $sql .= " SET fk_socpeople=NULL, fk_soc=NULL"; @@ -1831,7 +1836,7 @@ else $contact->fetch($object->contactid); if ($object->socid > 0) print ' / '; else print '
'; - print ''.img_object($langs->trans("ShowContact"), 'contact').' '.dol_trunc($contact->getFullName($langs), 32).''; + print $contact->getNomUrl(1, ''); } print ''; print ''."\n"; @@ -2287,6 +2292,7 @@ else print ''; if ($user->id == $object->id || !$user->admin) { + // Read mode $type = $langs->trans("Internal"); if ($object->socid) $type = $langs->trans("External"); print $form->textwithpicto($type, $langs->trans("InternalExternalDesc")); @@ -2294,10 +2300,22 @@ else } else { + // Select mode $type = 0; if ($object->contactid) $type = $object->contactid; - print $form->selectcontacts(0, $type, 'contactid', 2, '', '', 1, '', false, 1); - if ($object->ldap_sid) print ' ('.$langs->trans("DomainUser").')'; + + if ($object->socid > 0 && ! ($object->contactid > 0)) { // external user but no link to a contact + print img_picto('', 'company').$form->select_company($object->socid, 'socid', '', ' '); + print img_picto('', 'contact').$form->selectcontacts(0, 0, 'contactid', 1, '', '', 1, '', false, 1); + if ($object->ldap_sid) print ' ('.$langs->trans("DomainUser").')'; + } elseif ($object->socid > 0 && $object->contactid > 0) { // external user with a link to a contact + print img_picto('', 'company').$form->select_company(0, 'socid', '', ' '); // We keep thirdparty empty, contact is already set + print img_picto('', 'contact').$form->selectcontacts(0, $object->contactid, 'contactid', 1, '', '', 1, '', false, 1); + if ($object->ldap_sid) print ' ('.$langs->trans("DomainUser").')'; + } else { // $object->socid is not > 0 here + print img_picto('', 'company').$form->select_company(0, 'socid', '', ' '); // We keep thirdparty empty, contact is already set + print img_picto('', 'contact').$form->selectcontacts(0, 0, 'contactid', 1, '', '', 1, '', false, 1); + } } print ''; diff --git a/htdocs/webservices/server_other.php b/htdocs/webservices/server_other.php index 3944ef5befa..4ae702ade15 100644 --- a/htdocs/webservices/server_other.php +++ b/htdocs/webservices/server_other.php @@ -137,7 +137,12 @@ $server->register( -// Full methods code +/** + * Full methods code + * + * @param string $authentication Authentication string + * @return array Array of data + */ function getVersions($authentication) { global $db, $conf, $langs; diff --git a/htdocs/website/class/website.class.php b/htdocs/website/class/website.class.php index 2691dd9ebfd..be91f6640a1 100644 --- a/htdocs/website/class/website.class.php +++ b/htdocs/website/class/website.class.php @@ -249,6 +249,13 @@ class Website extends CommonObject // } } + if (! $error) { + $stringtodolibarrfile = "# Some properties for Dolibarr web site CMS\n"; + $stringtodolibarrfile .= "param=value\n"; + //print $conf->website->dir_output.'/'.$this->ref.'/.dolibarr';exit; + file_put_contents($conf->website->dir_output.'/'.$this->ref.'/.dolibarr', $stringtodolibarrfile); + } + // Commit or rollback if ($error) { $this->db->rollback(); @@ -668,7 +675,7 @@ class Website extends CommonObject if (!$error) { - dolCopyDir($pathofwebsiteold, $pathofwebsitenew, $conf->global->MAIN_UMASK, 0); + dolCopyDir($pathofwebsiteold, $pathofwebsitenew, $conf->global->MAIN_UMASK, 0, null, 2); // Check symlink to medias and restore it if ko $pathtomedias = DOL_DATA_ROOT.'/medias'; // Target @@ -927,30 +934,34 @@ class Website extends CommonObject $arrayreplacementincss['file=logos%2Fthumbs%2F'.$mysoc->logo] = "file=logos%2Fthumbs%2F__LOGO_KEY__"; } + // Create output directories + dol_syslog("Create containers dir"); + dol_mkdir($conf->website->dir_temp.'/'.$website->ref.'/containers'); + dol_mkdir($conf->website->dir_temp.'/'.$website->ref.'/medias/image/websitekey'); + dol_mkdir($conf->website->dir_temp.'/'.$website->ref.'/medias/js/websitekey'); + + // Copy files into 'containers' $srcdir = $conf->website->dir_output.'/'.$website->ref; $destdir = $conf->website->dir_temp.'/'.$website->ref.'/containers'; - // Create containers dir - dol_syslog("Create containers dir"); - dol_mkdir($conf->website->dir_temp.'/'.$website->ref.'/containers'); - - // Copy files into medias dol_syslog("Copy content from ".$srcdir." into ".$destdir); - dolCopyDir($srcdir, $destdir, 0, 1, $arrayreplacementinfilename); + dolCopyDir($srcdir, $destdir, 0, 1, $arrayreplacementinfilename, 2); + // Copy files into medias/image $srcdir = DOL_DATA_ROOT.'/medias/image/'.$website->ref; $destdir = $conf->website->dir_temp.'/'.$website->ref.'/medias/image/websitekey'; dol_syslog("Copy content from ".$srcdir." into ".$destdir); dolCopyDir($srcdir, $destdir, 0, 1, $arrayreplacementinfilename); + // Copy files into medias/js $srcdir = DOL_DATA_ROOT.'/medias/js/'.$website->ref; $destdir = $conf->website->dir_temp.'/'.$website->ref.'/medias/js/websitekey'; - // Copy containers files dol_syslog("Copy content from ".$srcdir." into ".$destdir); dolCopyDir($srcdir, $destdir, 0, 1, $arrayreplacementinfilename); + // Make some replacement into some files $cssindestdir = $conf->website->dir_temp.'/'.$website->ref.'/containers/styles.css.php'; dolReplaceInFile($cssindestdir, $arrayreplacementincss); diff --git a/htdocs/website/index.php b/htdocs/website/index.php index a617d9ae018..690dc0efe3b 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -271,7 +271,11 @@ if (GETPOST('optioncontent')) $algo .= 'content'; if (GETPOST('optionsitefiles')) $algo .= 'sitefiles'; if (empty($sortfield)) { - $sortfield = 'pageurl'; $sortorder = 'ASC'; + if ($action == 'file_manager') { + $sortfield='name'; $sortorder = 'ASC'; + } else { + $sortfield = 'pageurl'; $sortorder = 'ASC'; + } } $searchkey = GETPOST('searchstring', 'none'); @@ -3527,9 +3531,10 @@ if ($action == 'replacesite' || $action == 'replacesiteconfirm' || $massaction = print $langs->trans("SearchString"); print ''; print '
'; - print ''; - print ''; + print ''; + + print ''; print '
'; print ''; diff --git a/htdocs/website/samples/wrapper.php b/htdocs/website/samples/wrapper.php index 84878a102f6..25483a36f53 100644 --- a/htdocs/website/samples/wrapper.php +++ b/htdocs/website/samples/wrapper.php @@ -102,9 +102,11 @@ if ($rss) { $MAXNEWS = 20; $arrayofblogs = $websitepage->fetchAll($website->id, 'DESC', 'date_creation', $MAXNEWS, 0, $filters); $eventarray = array(); - foreach ($arrayofblogs as $blog) { - $blog->fullpageurl = $website->virtualhost.'/'.$blog->pageurl.'.php'; - $eventarray[] = $blog; + if (is_array($arrayofblogs)) { + foreach ($arrayofblogs as $blog) { + $blog->fullpageurl = $website->virtualhost.'/'.$blog->pageurl.'.php'; + $eventarray[] = $blog; + } } require_once DOL_DOCUMENT_ROOT."/core/lib/xcal.lib.php"; diff --git a/htdocs/zapier/class/hook.class.php b/htdocs/zapier/class/hook.class.php index 32268b039b4..b985c77434e 100644 --- a/htdocs/zapier/class/hook.class.php +++ b/htdocs/zapier/class/hook.class.php @@ -715,7 +715,6 @@ class Hook extends CommonObject * * @return int 0 if OK, <>0 if KO (this function is used also by cron so only 0 is OK) */ - //public function doScheduledJob($param1, $param2, ...) public function doScheduledJob() { global $conf, $langs; diff --git a/test/phpunit/AccountingAccountTest.php b/test/phpunit/AccountingAccountTest.php index ea1651c5902..b4367e96f49 100644 --- a/test/phpunit/AccountingAccountTest.php +++ b/test/phpunit/AccountingAccountTest.php @@ -73,7 +73,11 @@ class AccountingAccountTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -84,7 +88,11 @@ class AccountingAccountTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/ActionCommTest.php b/test/phpunit/ActionCommTest.php index 34d67341afb..0dd4946f69c 100644 --- a/test/phpunit/ActionCommTest.php +++ b/test/phpunit/ActionCommTest.php @@ -73,7 +73,11 @@ class ActionCommTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -84,7 +88,11 @@ class ActionCommTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/AdherentTest.php b/test/phpunit/AdherentTest.php index 89e78b32bd9..f19e88c36a6 100644 --- a/test/phpunit/AdherentTest.php +++ b/test/phpunit/AdherentTest.php @@ -75,7 +75,11 @@ class AdherentTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -91,7 +95,11 @@ class AdherentTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/AdminLibTest.php b/test/phpunit/AdminLibTest.php index 7f3c9030725..e3c38c1df86 100644 --- a/test/phpunit/AdminLibTest.php +++ b/test/phpunit/AdminLibTest.php @@ -73,7 +73,11 @@ class AdminLibTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -82,7 +86,11 @@ class AdminLibTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/BOMTest.php b/test/phpunit/BOMTest.php index 41cbdd9f247..39268bdeaea 100644 --- a/test/phpunit/BOMTest.php +++ b/test/phpunit/BOMTest.php @@ -74,7 +74,11 @@ class BOMTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -83,7 +87,11 @@ class BOMTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/BankAccountTest.php b/test/phpunit/BankAccountTest.php index 416a17f0c0f..1007db02dad 100644 --- a/test/phpunit/BankAccountTest.php +++ b/test/phpunit/BankAccountTest.php @@ -75,7 +75,11 @@ class BankAccountTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -84,7 +88,11 @@ class BankAccountTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/BuildDocTest.php b/test/phpunit/BuildDocTest.php index 61d7b7f1199..de4da3790b5 100644 --- a/test/phpunit/BuildDocTest.php +++ b/test/phpunit/BuildDocTest.php @@ -103,7 +103,11 @@ class BuildDocTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -121,7 +125,11 @@ class BuildDocTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/CMailFileTest.php b/test/phpunit/CMailFileTest.php index 8029959c22b..d407b67d991 100755 --- a/test/phpunit/CMailFileTest.php +++ b/test/phpunit/CMailFileTest.php @@ -73,7 +73,11 @@ class CMailFileTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -82,7 +86,11 @@ class CMailFileTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/CategorieTest.php b/test/phpunit/CategorieTest.php index 3c81a7aee21..a62d362a972 100644 --- a/test/phpunit/CategorieTest.php +++ b/test/phpunit/CategorieTest.php @@ -74,7 +74,11 @@ class CategorieTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -83,7 +87,11 @@ class CategorieTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/ChargeSocialesTest.php b/test/phpunit/ChargeSocialesTest.php index b1a3fd87b30..33349449795 100644 --- a/test/phpunit/ChargeSocialesTest.php +++ b/test/phpunit/ChargeSocialesTest.php @@ -74,7 +74,11 @@ class ChargeSocialesTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -83,7 +87,11 @@ class ChargeSocialesTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/CodingPhpTest.php b/test/phpunit/CodingPhpTest.php index 733071c0f58..5c3c6d7d54e 100644 --- a/test/phpunit/CodingPhpTest.php +++ b/test/phpunit/CodingPhpTest.php @@ -86,7 +86,11 @@ class CodingPhpTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -95,7 +99,11 @@ class CodingPhpTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/CodingSqlTest.php b/test/phpunit/CodingSqlTest.php index b62b9befcc7..f56d00b5bcd 100644 --- a/test/phpunit/CodingSqlTest.php +++ b/test/phpunit/CodingSqlTest.php @@ -86,7 +86,11 @@ class CodingSqlTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -95,7 +99,11 @@ class CodingSqlTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/CommandeFournisseurTest.php b/test/phpunit/CommandeFournisseurTest.php index 7ccbf5d0b76..bebd65634bf 100644 --- a/test/phpunit/CommandeFournisseurTest.php +++ b/test/phpunit/CommandeFournisseurTest.php @@ -75,7 +75,11 @@ class CommandeFournisseurTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -84,7 +88,11 @@ class CommandeFournisseurTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/CommandeTest.php b/test/phpunit/CommandeTest.php index ad2920282b2..990ef41f0b7 100644 --- a/test/phpunit/CommandeTest.php +++ b/test/phpunit/CommandeTest.php @@ -73,7 +73,11 @@ class CommandeTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -84,7 +88,11 @@ class CommandeTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/CommonInvoiceTest.php b/test/phpunit/CommonInvoiceTest.php index 9f4b5998455..5e9c45825ec 100644 --- a/test/phpunit/CommonInvoiceTest.php +++ b/test/phpunit/CommonInvoiceTest.php @@ -73,7 +73,11 @@ class CommonInvoiceTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -82,7 +86,11 @@ class CommonInvoiceTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/CommonObjectTest.php b/test/phpunit/CommonObjectTest.php index e32952c167d..6c68423e8a9 100644 --- a/test/phpunit/CommonObjectTest.php +++ b/test/phpunit/CommonObjectTest.php @@ -74,7 +74,11 @@ class CommonObjectTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -83,7 +87,11 @@ class CommonObjectTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/CompanyBankAccountTest.php b/test/phpunit/CompanyBankAccountTest.php index 7410e1f15f9..1979f89fabb 100644 --- a/test/phpunit/CompanyBankAccountTest.php +++ b/test/phpunit/CompanyBankAccountTest.php @@ -74,7 +74,11 @@ class CompanyBankAccountTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -83,7 +87,11 @@ class CompanyBankAccountTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/CompanyLibTest.php b/test/phpunit/CompanyLibTest.php index c45f6ebd208..ab9eb414634 100644 --- a/test/phpunit/CompanyLibTest.php +++ b/test/phpunit/CompanyLibTest.php @@ -73,7 +73,11 @@ class CompanyLibTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -82,7 +86,11 @@ class CompanyLibTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/ContactTest.php b/test/phpunit/ContactTest.php index 8fdaea0cbe7..0c5687e67c9 100755 --- a/test/phpunit/ContactTest.php +++ b/test/phpunit/ContactTest.php @@ -82,7 +82,11 @@ class ContactTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -92,7 +96,11 @@ class ContactTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/ContratTest.php b/test/phpunit/ContratTest.php index 7c302105aa2..d364d6c9dff 100644 --- a/test/phpunit/ContratTest.php +++ b/test/phpunit/ContratTest.php @@ -74,7 +74,11 @@ class ContratTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -83,7 +87,11 @@ class ContratTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/CoreTest.php b/test/phpunit/CoreTest.php index c34bbffba95..87c43798a0f 100644 --- a/test/phpunit/CoreTest.php +++ b/test/phpunit/CoreTest.php @@ -76,7 +76,11 @@ class CoreTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -85,7 +89,11 @@ class CoreTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/DateLibTest.php b/test/phpunit/DateLibTest.php index dd32e02cee6..062bdb6dd11 100644 --- a/test/phpunit/DateLibTest.php +++ b/test/phpunit/DateLibTest.php @@ -74,7 +74,11 @@ class DateLibTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -83,7 +87,11 @@ class DateLibTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/DateLibTzFranceTest.php b/test/phpunit/DateLibTzFranceTest.php index 895599becde..7e96e39030e 100644 --- a/test/phpunit/DateLibTzFranceTest.php +++ b/test/phpunit/DateLibTzFranceTest.php @@ -74,7 +74,11 @@ class DateLibTzFranceTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -88,7 +92,11 @@ class DateLibTzFranceTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/DiscountTest.php b/test/phpunit/DiscountTest.php index 202c41958d0..9eba2460655 100644 --- a/test/phpunit/DiscountTest.php +++ b/test/phpunit/DiscountTest.php @@ -74,7 +74,11 @@ class DiscountTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -83,7 +87,11 @@ class DiscountTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/EntrepotTest.php b/test/phpunit/EntrepotTest.php index 2ab2fc2aff3..27fd3dabbf3 100644 --- a/test/phpunit/EntrepotTest.php +++ b/test/phpunit/EntrepotTest.php @@ -74,7 +74,11 @@ class EntrepotTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -86,7 +90,11 @@ class EntrepotTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/ExpenseReportTest.php b/test/phpunit/ExpenseReportTest.php index 67467ac6c81..3f6402262c3 100644 --- a/test/phpunit/ExpenseReportTest.php +++ b/test/phpunit/ExpenseReportTest.php @@ -74,7 +74,11 @@ class ExpenseReportTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -83,7 +87,11 @@ class ExpenseReportTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/ExportTest.php b/test/phpunit/ExportTest.php index 3abec2ee0e1..590accccbed 100644 --- a/test/phpunit/ExportTest.php +++ b/test/phpunit/ExportTest.php @@ -78,7 +78,11 @@ class ExportTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -87,7 +91,11 @@ class ExportTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/FactureFournisseurTest.php b/test/phpunit/FactureFournisseurTest.php index b277ba5c1b3..d9cd44a40d2 100644 --- a/test/phpunit/FactureFournisseurTest.php +++ b/test/phpunit/FactureFournisseurTest.php @@ -75,7 +75,11 @@ class FactureFournisseurTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -84,7 +88,11 @@ class FactureFournisseurTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/FactureRecTest.php b/test/phpunit/FactureRecTest.php index 71caddeb491..f89ab4b1f13 100644 --- a/test/phpunit/FactureRecTest.php +++ b/test/phpunit/FactureRecTest.php @@ -75,7 +75,11 @@ class FactureRecTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -84,7 +88,11 @@ class FactureRecTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/FactureTest.php b/test/phpunit/FactureTest.php index 4e361895fcc..47f3a639b29 100644 --- a/test/phpunit/FactureTest.php +++ b/test/phpunit/FactureTest.php @@ -74,7 +74,11 @@ class FactureTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -87,7 +91,11 @@ class FactureTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/FactureTestRounding.php b/test/phpunit/FactureTestRounding.php index 59ecc240461..f0165a88d0b 100644 --- a/test/phpunit/FactureTestRounding.php +++ b/test/phpunit/FactureTestRounding.php @@ -74,7 +74,11 @@ class FactureTestRounding extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -83,7 +87,11 @@ class FactureTestRounding extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/FichinterTest.php b/test/phpunit/FichinterTest.php index ba9408441a1..f78e9250471 100644 --- a/test/phpunit/FichinterTest.php +++ b/test/phpunit/FichinterTest.php @@ -74,7 +74,11 @@ class FichinterTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -83,7 +87,11 @@ class FichinterTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/FilesLibTest.php b/test/phpunit/FilesLibTest.php index fb3ce8f5814..9d476953381 100644 --- a/test/phpunit/FilesLibTest.php +++ b/test/phpunit/FilesLibTest.php @@ -75,7 +75,11 @@ class FilesLibTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -84,7 +88,11 @@ class FilesLibTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/FormAdminTest.php b/test/phpunit/FormAdminTest.php index e6b92b698d9..a434841930c 100644 --- a/test/phpunit/FormAdminTest.php +++ b/test/phpunit/FormAdminTest.php @@ -74,7 +74,11 @@ class FormAdminTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -83,7 +87,11 @@ class FormAdminTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/FormTest.php b/test/phpunit/FormTest.php index 59cfeb3fa3d..bec23048e9f 100644 --- a/test/phpunit/FormTest.php +++ b/test/phpunit/FormTest.php @@ -74,7 +74,11 @@ class FormTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -83,7 +87,11 @@ class FormTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/Functions2LibTest.php b/test/phpunit/Functions2LibTest.php index 4304251d7f1..21fa1f29257 100644 --- a/test/phpunit/Functions2LibTest.php +++ b/test/phpunit/Functions2LibTest.php @@ -77,7 +77,11 @@ class Functions2LibTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -86,7 +90,11 @@ class Functions2LibTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/FunctionsLibTest.php b/test/phpunit/FunctionsLibTest.php index dff6b3a7d06..e3dabff6df9 100644 --- a/test/phpunit/FunctionsLibTest.php +++ b/test/phpunit/FunctionsLibTest.php @@ -77,7 +77,11 @@ class FunctionsLibTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -88,7 +92,11 @@ class FunctionsLibTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/GetUrlLibTest.php b/test/phpunit/GetUrlLibTest.php index ba074459f44..268122c8d48 100644 --- a/test/phpunit/GetUrlLibTest.php +++ b/test/phpunit/GetUrlLibTest.php @@ -75,7 +75,11 @@ class GetUrlLibTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -84,7 +88,11 @@ class GetUrlLibTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/HolidayTest.php b/test/phpunit/HolidayTest.php index cd5a9f28138..e7e3e8749cd 100644 --- a/test/phpunit/HolidayTest.php +++ b/test/phpunit/HolidayTest.php @@ -76,7 +76,11 @@ class HolidayTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -86,7 +90,11 @@ class HolidayTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/ImagesLibTest.php b/test/phpunit/ImagesLibTest.php index 71474ba1847..3bfb676f3be 100644 --- a/test/phpunit/ImagesLibTest.php +++ b/test/phpunit/ImagesLibTest.php @@ -75,7 +75,11 @@ class ImagesLibTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -84,7 +88,11 @@ class ImagesLibTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/ImportTest.php b/test/phpunit/ImportTest.php index 9e6b973500a..ce689fda4a4 100644 --- a/test/phpunit/ImportTest.php +++ b/test/phpunit/ImportTest.php @@ -76,7 +76,11 @@ class ImportTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -85,7 +89,11 @@ class ImportTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/JsonLibTest.php b/test/phpunit/JsonLibTest.php index 0b5d3dd53e6..7d2678b0ec7 100644 --- a/test/phpunit/JsonLibTest.php +++ b/test/phpunit/JsonLibTest.php @@ -76,7 +76,11 @@ class JsonLibTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -85,7 +89,11 @@ class JsonLibTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/LangTest.php b/test/phpunit/LangTest.php index 3ff2917a9f2..f4a14373ebe 100644 --- a/test/phpunit/LangTest.php +++ b/test/phpunit/LangTest.php @@ -86,7 +86,11 @@ class LangTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -95,7 +99,11 @@ class LangTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/LesscTest.php b/test/phpunit/LesscTest.php index ca64853b381..a4ce302c540 100644 --- a/test/phpunit/LesscTest.php +++ b/test/phpunit/LesscTest.php @@ -86,7 +86,11 @@ class LesscTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -95,7 +99,11 @@ class LesscTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/LoanTest.php b/test/phpunit/LoanTest.php index 71a61c80ae0..253e779ac03 100644 --- a/test/phpunit/LoanTest.php +++ b/test/phpunit/LoanTest.php @@ -74,7 +74,11 @@ class LoanTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -83,7 +87,11 @@ class LoanTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/MarginsLibTest.php b/test/phpunit/MarginsLibTest.php index fc25d929b38..e451262546d 100644 --- a/test/phpunit/MarginsLibTest.php +++ b/test/phpunit/MarginsLibTest.php @@ -74,7 +74,11 @@ class MarginsLibTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -83,7 +87,11 @@ class MarginsLibTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/ModulesTest.php b/test/phpunit/ModulesTest.php index 5a43de21167..f8feaa8f829 100755 --- a/test/phpunit/ModulesTest.php +++ b/test/phpunit/ModulesTest.php @@ -73,7 +73,11 @@ class ModulesTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -82,7 +86,11 @@ class ModulesTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/MouvementStockTest.php b/test/phpunit/MouvementStockTest.php index 85137234a3b..23b6b2b0111 100644 --- a/test/phpunit/MouvementStockTest.php +++ b/test/phpunit/MouvementStockTest.php @@ -76,7 +76,11 @@ class MouvementStockTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -85,7 +89,11 @@ class MouvementStockTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/NumberingModulesTest.php b/test/phpunit/NumberingModulesTest.php index 099d6d2052c..089a2c2f4cf 100644 --- a/test/phpunit/NumberingModulesTest.php +++ b/test/phpunit/NumberingModulesTest.php @@ -73,7 +73,11 @@ class NumberingModulesTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -83,7 +87,11 @@ class NumberingModulesTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/PaypalTest.php b/test/phpunit/PaypalTest.php index 96bfbefdf17..47d8341f501 100644 --- a/test/phpunit/PaypalTest.php +++ b/test/phpunit/PaypalTest.php @@ -75,7 +75,11 @@ class PaypalTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -87,7 +91,11 @@ class PaypalTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/PdfDocTest.php b/test/phpunit/PdfDocTest.php index 9c9c0bb666f..276deada0c6 100644 --- a/test/phpunit/PdfDocTest.php +++ b/test/phpunit/PdfDocTest.php @@ -77,7 +77,11 @@ class PdfDocTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -86,7 +90,11 @@ class PdfDocTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/PgsqlTest.php b/test/phpunit/PgsqlTest.php index 4b2a5f98746..5a09e7fc55a 100644 --- a/test/phpunit/PgsqlTest.php +++ b/test/phpunit/PgsqlTest.php @@ -76,7 +76,11 @@ class PgsqlTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -86,7 +90,11 @@ class PgsqlTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/PricesTest.php b/test/phpunit/PricesTest.php index d7f9e310088..0c47ec4f275 100755 --- a/test/phpunit/PricesTest.php +++ b/test/phpunit/PricesTest.php @@ -81,7 +81,11 @@ class PricesTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -90,7 +94,11 @@ class PricesTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/ProductTest.php b/test/phpunit/ProductTest.php index 8a848416318..650d8a93e37 100644 --- a/test/phpunit/ProductTest.php +++ b/test/phpunit/ProductTest.php @@ -74,7 +74,11 @@ class ProductTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -85,7 +89,12 @@ class ProductTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // teardownafterclass + + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/ProjectTest.php b/test/phpunit/ProjectTest.php index 84a6411082f..8a7e0540b9a 100644 --- a/test/phpunit/ProjectTest.php +++ b/test/phpunit/ProjectTest.php @@ -75,7 +75,11 @@ class ProjectTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -84,7 +88,11 @@ class ProjectTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/PropalTest.php b/test/phpunit/PropalTest.php index 709c5bbcfb7..068fb53b052 100644 --- a/test/phpunit/PropalTest.php +++ b/test/phpunit/PropalTest.php @@ -74,7 +74,11 @@ class PropalTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -83,7 +87,11 @@ class PropalTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/RestAPIDocumentTest.php b/test/phpunit/RestAPIDocumentTest.php index 9ce14a4ac92..65b8c206c9d 100644 --- a/test/phpunit/RestAPIDocumentTest.php +++ b/test/phpunit/RestAPIDocumentTest.php @@ -76,7 +76,11 @@ class RestAPIDocumentTest extends PHPUnit\Framework\TestCase echo "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -85,7 +89,11 @@ class RestAPIDocumentTest extends PHPUnit\Framework\TestCase echo __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/RestAPIUserTest.php b/test/phpunit/RestAPIUserTest.php index ea3970e5a4b..9d49d10af73 100644 --- a/test/phpunit/RestAPIUserTest.php +++ b/test/phpunit/RestAPIUserTest.php @@ -80,7 +80,11 @@ class RestAPIUserTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -89,7 +93,11 @@ class RestAPIUserTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/ScriptsTest.php b/test/phpunit/ScriptsTest.php index e490054edfa..16884214418 100644 --- a/test/phpunit/ScriptsTest.php +++ b/test/phpunit/ScriptsTest.php @@ -86,7 +86,11 @@ class ScriptsTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -95,7 +99,11 @@ class ScriptsTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/SecurityTest.php b/test/phpunit/SecurityTest.php index 4130426d806..5a248006498 100644 --- a/test/phpunit/SecurityTest.php +++ b/test/phpunit/SecurityTest.php @@ -86,7 +86,11 @@ class SecurityTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -95,7 +99,11 @@ class SecurityTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/SocieteTest.php b/test/phpunit/SocieteTest.php index 070a8999bb2..4ed0771d668 100755 --- a/test/phpunit/SocieteTest.php +++ b/test/phpunit/SocieteTest.php @@ -74,7 +74,11 @@ class SocieteTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -88,7 +92,11 @@ class SocieteTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/SupplierProposalTest.php b/test/phpunit/SupplierProposalTest.php index 42d7e5842a6..27414ecab0a 100644 --- a/test/phpunit/SupplierProposalTest.php +++ b/test/phpunit/SupplierProposalTest.php @@ -77,7 +77,11 @@ class SupplierProposalTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -88,7 +92,11 @@ class SupplierProposalTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/TicketTest.php b/test/phpunit/TicketTest.php index fa7ea8df98f..c13bdcfb959 100644 --- a/test/phpunit/TicketTest.php +++ b/test/phpunit/TicketTest.php @@ -74,7 +74,11 @@ class TicketTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -83,7 +87,11 @@ class TicketTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/UserGroupTest.php b/test/phpunit/UserGroupTest.php index fe08af2bce7..7e3cdd24b3a 100644 --- a/test/phpunit/UserGroupTest.php +++ b/test/phpunit/UserGroupTest.php @@ -73,7 +73,11 @@ class UserGroupTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -82,7 +86,11 @@ class UserGroupTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/UserTest.php b/test/phpunit/UserTest.php index 3c89bd52d06..10b0bd7b0b7 100644 --- a/test/phpunit/UserTest.php +++ b/test/phpunit/UserTest.php @@ -73,7 +73,11 @@ class UserTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -85,7 +89,11 @@ class UserTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/UtilsTest.php b/test/phpunit/UtilsTest.php index a1b9eafa45e..dd5ba68ca8f 100644 --- a/test/phpunit/UtilsTest.php +++ b/test/phpunit/UtilsTest.php @@ -73,7 +73,11 @@ class UtilsTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -83,7 +87,11 @@ class UtilsTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/WebservicesOrdersTest.php b/test/phpunit/WebservicesOrdersTest.php index 8afd50a0394..33d842f6d39 100644 --- a/test/phpunit/WebservicesOrdersTest.php +++ b/test/phpunit/WebservicesOrdersTest.php @@ -77,7 +77,11 @@ class WebservicesOrdersTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -86,7 +90,11 @@ class WebservicesOrdersTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/WebservicesOtherTest.php b/test/phpunit/WebservicesOtherTest.php index 7304e2bf367..34686cbec92 100644 --- a/test/phpunit/WebservicesOtherTest.php +++ b/test/phpunit/WebservicesOtherTest.php @@ -77,7 +77,11 @@ class WebservicesOtherTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -86,7 +90,11 @@ class WebservicesOtherTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/WebservicesProductsTest.php b/test/phpunit/WebservicesProductsTest.php index 3d74deb721c..70a8c12a498 100644 --- a/test/phpunit/WebservicesProductsTest.php +++ b/test/phpunit/WebservicesProductsTest.php @@ -84,7 +84,11 @@ class WebservicesProductsTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -92,7 +96,12 @@ class WebservicesProductsTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/WebservicesThirdpartyTest.php b/test/phpunit/WebservicesThirdpartyTest.php index 9aefd6c5ce6..1106164b4ee 100644 --- a/test/phpunit/WebservicesThirdpartyTest.php +++ b/test/phpunit/WebservicesThirdpartyTest.php @@ -94,7 +94,11 @@ class WebservicesThirdpartyTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -103,7 +107,11 @@ class WebservicesThirdpartyTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/WebservicesUserTest.php b/test/phpunit/WebservicesUserTest.php index de51431b046..bb68f413741 100644 --- a/test/phpunit/WebservicesUserTest.php +++ b/test/phpunit/WebservicesUserTest.php @@ -77,7 +77,11 @@ class WebservicesUserTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -86,7 +90,11 @@ class WebservicesUserTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/XCalLibTest.php b/test/phpunit/XCalLibTest.php index 26d5e25c54b..9fb1975a1fd 100644 --- a/test/phpunit/XCalLibTest.php +++ b/test/phpunit/XCalLibTest.php @@ -73,7 +73,11 @@ class XCalLibTest extends PHPUnit\Framework\TestCase print "\n"; } - // Static methods + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { global $conf,$user,$langs,$db; @@ -82,7 +86,11 @@ class XCalLibTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - // tear down after class + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db;