From 3d076d8bf91d3b0512de2d34588144afcace2757 Mon Sep 17 00:00:00 2001 From: ATM-Nicolas Date: Fri, 5 Jul 2019 11:15:43 +0200 Subject: [PATCH 01/28] FIX : We must save code instead of value in database for template invoice modelpdf --- htdocs/compta/facture/fiche-rec.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php index 8c45012085d..31a4affb95d 100644 --- a/htdocs/compta/facture/fiche-rec.php +++ b/htdocs/compta/facture/fiche-rec.php @@ -1423,8 +1423,8 @@ else include_once DOL_DOCUMENT_ROOT . '/core/modules/facture/modules_facture.php'; $list = array(); $models = ModelePDFFactures::liste_modeles($db); - foreach ($models as $model) { - $list[] = $model . ':' . $model; + foreach ($models as $k => $model) { + $list[] = $k . ':' . $model; } $select = 'select;'.implode(',', $list); print $form->editfieldval($langs->trans("Model"), 'modelpdf', $object->modelpdf, $object, $user->rights->facture->creer, $select); From e5d34de877fe194c096fa83b5cb62f5b10aded42 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 9 Jul 2019 00:14:01 +0200 Subject: [PATCH 02/28] FIX compatibility mysql 8. rank is reserved FIX Permission for BOM menu --- htdocs/bom/class/bom.class.php | 6 +++--- htdocs/core/class/commonobject.class.php | 4 ++-- htdocs/core/menus/standard/eldy.lib.php | 2 +- htdocs/install/mysql/migration/9.0.0-10.0.0.sql | 3 ++- htdocs/install/mysql/tables/llx_bom_bomline.sql | 2 +- htdocs/modulebuilder/template/class/myobject.class.php | 4 ++-- 6 files changed, 11 insertions(+), 10 deletions(-) diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index 73682c7698c..10601303a61 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -889,7 +889,7 @@ class BOM extends CommonObject $this->lines=array(); $objectline = new BOMLine($this->db); - $result = $objectline->fetchAll('ASC', 'rank', 0, 0, array('customsql'=>'fk_bom = '.$this->id)); + $result = $objectline->fetchAll('ASC', 'position', 0, 0, array('customsql'=>'fk_bom = '.$this->id)); if (is_numeric($result)) { @@ -1044,7 +1044,7 @@ class BOMLine extends CommonObject 'description' => array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>-1, 'position'=>60, 'notnull'=>-1,), 'qty' => array('type'=>'double(24,8)', 'label'=>'Quantity', 'enabled'=>1, 'visible'=>1, 'position'=>100, 'notnull'=>1, 'isameasure'=>'1',), 'efficiency' => array('type'=>'double(8,4)', 'label'=>'ManufacturingEfficiency', 'enabled'=>1, 'visible'=>1, 'default'=>1, 'position'=>110, 'notnull'=>1, 'css'=>'maxwidth50imp', 'help'=>'ValueOfMeansLoss'), - 'rank' => array('type'=>'integer', 'label'=>'Rank', 'enabled'=>1, 'visible'=>0, 'position'=>200, 'notnull'=>1,), + 'position' => array('type'=>'integer', 'label'=>'Rank', 'enabled'=>1, 'visible'=>0, 'position'=>200, 'notnull'=>1,), 'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>1000, 'notnull'=>-1,), ); public $rowid; @@ -1053,7 +1053,7 @@ class BOMLine extends CommonObject public $description; public $qty; public $efficiency; - public $rank; + public $position; public $import_key; // END MODULEBUILDER PROPERTIES diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index c966f39680b..b6fa5e419b1 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2443,9 +2443,9 @@ abstract class CommonObject */ public function updateRangOfLine($rowid, $rang) { - $fieldposition = 'rang'; // @TODO Rename 'rang' and 'position' into 'rank' + $fieldposition = 'rang'; // @TODO Rename 'rang' into 'position' if (in_array($this->table_element_line, array('ecm_files', 'emailcollector_emailcollectoraction'))) $fieldposition = 'position'; - if (in_array($this->table_element_line, array('bom_bomline'))) $fieldposition = 'rank'; + if (in_array($this->table_element_line, array('bom_bomline'))) $fieldposition = 'position'; $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element_line.' SET '.$fieldposition.' = '.$rang; $sql.= ' WHERE rowid = '.$rowid; diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 7518093bf77..88595cd366a 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1579,7 +1579,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM { $langs->load("mrp"); - $newmenu->add("", $langs->trans("MenuBOM"), 0, $user->rights->service->lire, '', $mainmenu, 'service'); + $newmenu->add("", $langs->trans("MenuBOM"), 0, $user->rights->bom->read, '', $mainmenu, 'bom'); $newmenu->add("/bom/bom_card.php?leftmenu=bom&action=create", $langs->trans("NewBOM"), 1, $user->rights->bom->write); $newmenu->add("/bom/bom_list.php?leftmenu=bom", $langs->trans("List"), 1, $user->rights->bom->read); } diff --git a/htdocs/install/mysql/migration/9.0.0-10.0.0.sql b/htdocs/install/mysql/migration/9.0.0-10.0.0.sql index bf08e794a65..c2d4809f958 100644 --- a/htdocs/install/mysql/migration/9.0.0-10.0.0.sql +++ b/htdocs/install/mysql/migration/9.0.0-10.0.0.sql @@ -252,12 +252,13 @@ CREATE TABLE llx_bom_bomline( import_key varchar(14), qty double(24,8) NOT NULL, efficiency double(8,4) NOT NULL DEFAULT 1, - rank integer NOT NULL + position integer NOT NULL -- END MODULEBUILDER FIELDS ) ENGINE=innodb; ALTER TABLE llx_bom_bomline ADD COLUMN efficiency double(8,4) DEFAULT 1; ALTER TABLE llx_bom_bomline ADD COLUMN fk_bom_child integer NULL; +ALTER TABLE llx_bom_bomline ADD COLUMN position integer NOT NULL; create table llx_bom_bomline_extrafields ( diff --git a/htdocs/install/mysql/tables/llx_bom_bomline.sql b/htdocs/install/mysql/tables/llx_bom_bomline.sql index bafaaf73694..4b0aa515950 100644 --- a/htdocs/install/mysql/tables/llx_bom_bomline.sql +++ b/htdocs/install/mysql/tables/llx_bom_bomline.sql @@ -23,6 +23,6 @@ CREATE TABLE llx_bom_bomline( import_key varchar(14), qty double(24,8) NOT NULL, efficiency double(8,4) NOT NULL DEFAULT 1, - rank integer NOT NULL + position integer NOT NULL -- END MODULEBUILDER FIELDS ) ENGINE=innodb; diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index 13157b2c18f..f6020882502 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -696,7 +696,7 @@ class MyObject extends CommonObject $this->lines=array(); $objectline = new MyObjectLine($this->db); - $result = $objectline->fetchAll('ASC', 'rank', 0, 0, array('customsql'=>'fk_myobject = '.$this->id)); + $result = $objectline->fetchAll('ASC', 'position', 0, 0, array('customsql'=>'fk_myobject = '.$this->id)); if (is_numeric($result)) { @@ -781,5 +781,5 @@ class MyObject extends CommonObject class MyObjectLine { // To complete with content of an object MyObjectLine - // We should have a field rowid, fk_myobject and rank + // We should have a field rowid, fk_myobject and position } From 0aa42fefae40fabaff529fde7a082e4ff20da613 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Tue, 9 Jul 2019 18:13:06 +0200 Subject: [PATCH 03/28] Fix : use RUM if defined in bank account --- htdocs/compta/prelevement/class/bonprelevement.class.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 2187b99eaf3..89aa09523e7 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -1349,7 +1349,7 @@ class BonPrelevement extends CommonObject $sql = "SELECT soc.code_client as code, soc.address, soc.zip, soc.town, c.code as country_code,"; $sql.= " pl.client_nom as nom, pl.code_banque as cb, pl.code_guichet as cg, pl.number as cc, pl.amount as somme,"; - $sql.= " f.facnumber as fac, pf.fk_facture as idfac, rib.datec, rib.iban_prefix as iban, rib.bic as bic, rib.rowid as drum"; + $sql.= " f.facnumber as fac, pf.fk_facture as idfac, rib.datec, rib.iban_prefix as iban, rib.bic as bic, rib.rowid as drum, rib.rum"; $sql.= " FROM"; $sql.= " ".MAIN_DB_PREFIX."prelevement_lignes as pl,"; $sql.= " ".MAIN_DB_PREFIX."facture as f,"; @@ -1375,7 +1375,7 @@ class BonPrelevement extends CommonObject while ($i < $num) { $obj = $this->db->fetch_object($resql); - $fileDebiteurSection .= $this->EnregDestinataireSEPA($obj->code, $obj->nom, $obj->address, $obj->zip, $obj->town, $obj->country_code, $obj->cb, $obj->cg, $obj->cc, $obj->somme, $obj->fac, $obj->idfac, $obj->iban, $obj->bic, $this->db->jdate($obj->datec), $obj->drum); + $fileDebiteurSection .= $this->EnregDestinataireSEPA($obj->code, $obj->nom, $obj->address, $obj->zip, $obj->town, $obj->country_code, $obj->cb, $obj->cg, $obj->cc, $obj->somme, $obj->fac, $obj->idfac, $obj->iban, $obj->bic, $this->db->jdate($obj->datec), $obj->drum, $obj->rum); $this->total = $this->total + $obj->somme; $i++; } @@ -1586,9 +1586,10 @@ class BonPrelevement extends CommonObject * @param string $row_bic rib.bic AS bic, * @param string $row_datec rib.datec, * @param string $row_drum rib.rowid used to generate rum + * @param string $row_rum rib.rum Rum defined on company bank account * @return string Return string with SEPA part DrctDbtTxInf */ - function EnregDestinataireSEPA($row_code_client, $row_nom, $row_address, $row_zip, $row_town, $row_country_code, $row_cb, $row_cg, $row_cc, $row_somme, $row_facnumber, $row_idfac, $row_iban, $row_bic, $row_datec, $row_drum) + function EnregDestinataireSEPA($row_code_client, $row_nom, $row_address, $row_zip, $row_town, $row_country_code, $row_cb, $row_cg, $row_cc, $row_somme, $row_facnumber, $row_idfac, $row_iban, $row_bic, $row_datec, $row_drum, $row_rum) { // phpcs:enable global $conf; @@ -1597,7 +1598,7 @@ class BonPrelevement extends CommonObject // Define value for RUM // Example: RUMCustomerCode-CustomerBankAccountId-01424448606 (note: Date is date of creation of CustomerBankAccountId) - $Rum = $this->buildRumNumber($row_code_client, $row_datec, $row_drum); + $Rum = empty($row_rum) ? $this->buildRumNumber($row_code_client, $row_datec, $row_drum) : $row_rum; // Define date of RUM signature $DtOfSgntr = dol_print_date($row_datec, '%Y-%m-%d'); From 41b004c2b837806eaaa29ffa4b63204e3c7a230e Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 10 Jul 2019 12:16:32 +0200 Subject: [PATCH 04/28] FIX better compatibility with multicompany transverse mode --- htdocs/core/class/html.formother.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index 1883ffd0304..28683d23771 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -421,7 +421,7 @@ class FormOther if (! empty($user->admin) && empty($user->entity) && $conf->entity == 1) { $sql_usr.= " WHERE u.entity IS NOT NULL"; // Show all users } else { - $sql_usr.= " WHERE EXISTS (SELECT ug.fk_user FROM ".MAIN_DB_PREFIX."usergroup_user as ug WHERE u.rowid = ug.fk_user AND ug.entity IN (".getEntity('user')."))"; + $sql_usr.= " WHERE EXISTS (SELECT ug.fk_user FROM ".MAIN_DB_PREFIX."usergroup_user as ug WHERE u.rowid = ug.fk_user AND ug.entity IN (".getEntity('usergroup')."))"; $sql_usr.= " OR u.entity = 0"; // Show always superadmin } } @@ -444,7 +444,7 @@ class FormOther if (! empty($user->admin) && empty($user->entity) && $conf->entity == 1) { $sql_usr.= " WHERE u2.entity IS NOT NULL"; // Show all users } else { - $sql_usr.= " WHERE EXISTS (SELECT ug2.fk_user FROM ".MAIN_DB_PREFIX."usergroup_user as ug2 WHERE u2.rowid = ug2.fk_user AND ug2.entity IN (".getEntity('user')."))"; + $sql_usr.= " WHERE EXISTS (SELECT ug2.fk_user FROM ".MAIN_DB_PREFIX."usergroup_user as ug2 WHERE u2.rowid = ug2.fk_user AND ug2.entity IN (".getEntity('usergroup')."))"; } } else From cebf81a5146a6d02b4c9f1ebd736e6298e29b769 Mon Sep 17 00:00:00 2001 From: atm-lena Date: Wed, 10 Jul 2019 15:18:25 +0200 Subject: [PATCH 05/28] FIX helpp text --- htdocs/core/tpl/commonfields_edit.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/commonfields_edit.tpl.php b/htdocs/core/tpl/commonfields_edit.tpl.php index ce41cff24d0..d23b9f09c2a 100644 --- a/htdocs/core/tpl/commonfields_edit.tpl.php +++ b/htdocs/core/tpl/commonfields_edit.tpl.php @@ -47,7 +47,7 @@ foreach($object->fields as $key => $val) if ($val['notnull'] > 0) print ' fieldrequired'; if ($val['type'] == 'text' || $val['type'] == 'html') print ' tdtop'; print '">'; - if (! empty($val['help'])) print $form->textwithpicto($langs->trans($val['label']), $val['help']); + if (! empty($val['help'])) print $form->textwithpicto($langs->trans($val['label']), $langs->trans($val['help'])); else print $langs->trans($val['label']); print ''; print ''; From a3f5397988c7437e34d1435ff86feec19104e0e6 Mon Sep 17 00:00:00 2001 From: atm-lena Date: Wed, 10 Jul 2019 15:55:50 +0200 Subject: [PATCH 06/28] FIX help text 2 --- htdocs/core/tpl/commonfields_view.tpl.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/tpl/commonfields_view.tpl.php b/htdocs/core/tpl/commonfields_view.tpl.php index b6b2e572e49..86a58d346fe 100644 --- a/htdocs/core/tpl/commonfields_view.tpl.php +++ b/htdocs/core/tpl/commonfields_view.tpl.php @@ -52,7 +52,7 @@ foreach($object->fields as $key => $val) if ($val['notnull'] > 0) print ' fieldrequired'; if ($val['type'] == 'text' || $val['type'] == 'html') print ' tdtop'; print '">'; - if (! empty($val['help'])) print $form->textwithpicto($langs->trans($val['label']), $val['help']); + if (! empty($val['help'])) print $form->textwithpicto($langs->trans($val['label']), $langs->trans($val['help'])); else print $langs->trans($val['label']); print ''; print ''; @@ -91,7 +91,7 @@ foreach($object->fields as $key => $val) if ($val['notnull'] > 0) print ' fieldrequired'; if ($val['type'] == 'text' || $val['type'] == 'html') print ' tdtop'; print '">'; - if (! empty($val['help'])) print $form->textwithpicto($langs->trans($val['label']), $val['help']); + if (! empty($val['help'])) print $form->textwithpicto($langs->trans($val['label']), $langs->trans($val['help'])); else print $langs->trans($val['label']); print ''; print ''; From cce8f98afc7638becb92e2a4e9344c7de40c2b21 Mon Sep 17 00:00:00 2001 From: gauthier Date: Wed, 10 Jul 2019 16:33:03 +0200 Subject: [PATCH 07/28] FIX : accounting mode must be taken from global conf, because there's no way to choose a mode with interface --- htdocs/compta/stats/byratecountry.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/stats/byratecountry.php b/htdocs/compta/stats/byratecountry.php index 2c43db42d13..cd41649cc89 100644 --- a/htdocs/compta/stats/byratecountry.php +++ b/htdocs/compta/stats/byratecountry.php @@ -37,7 +37,7 @@ require_once DOL_DOCUMENT_ROOT.'/expensereport/class/paymentexpensereport.class. // Load translation files required by the page $langs->loadLangs(array("other","compta","banks","bills","companies","product","trips","admin","accountancy")); -$modecompta = GETPOST('modecompta','alpha'); +$modecompta = $conf->global->ACCOUNTING_MODE; // Date range $year=GETPOST("year",'int'); From abd0abf11531b196fe07e8bac545ea95071b95ef Mon Sep 17 00:00:00 2001 From: Nicolas ZABOURI Date: Wed, 10 Jul 2019 18:36:12 +0200 Subject: [PATCH 08/28] FIX element name in update_price --- htdocs/core/class/commonobject.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index f0fe7bf437c..43f78b571de 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -12,7 +12,7 @@ * Copyright (C) 2015 Alexandre Spangaro * Copyright (C) 2016 Bahfir abbes * Copyright (C) 2017 ATM Consulting - * Copyright (C) 2017 Nicolas ZABOURI + * Copyright (C) 2017-2019 Nicolas ZABOURI * Copyright (C) 2017 Rui Strecht * Copyright (C) 2018 Frederic France * @@ -2615,7 +2615,7 @@ abstract class CommonObject $MODULE = ""; if ($this->element == 'propal') $MODULE = "MODULE_DISALLOW_UPDATE_PRICE_PROPOSAL"; - elseif ($this->element == 'order') + elseif ($this->element == 'commande') $MODULE = "MODULE_DISALLOW_UPDATE_PRICE_ORDER"; elseif ($this->element == 'facture') $MODULE = "MODULE_DISALLOW_UPDATE_PRICE_INVOICE"; From 694be619b26adfa705b2fd92675a4599da1f3fe7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 11 Jul 2019 22:16:32 +0200 Subject: [PATCH 09/28] Fix doxygen --- htdocs/product/class/product.class.php | 30 +++++++++++++++----------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index fc966f7f19a..9c515d619c6 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -272,13 +272,26 @@ class Product extends CommonObject public $accountancy_code_buy; /** - * Main barcode - * barcode value + * Main Barcode value * * @var string */ public $barcode; + /** + * Main Barcode type ID + * + * @var int + */ + public $barcode_type; + + /** + * Main Barcode type code + * + * @var string + */ + public $barcode_type_code; + /** * Additional barcodes (Some products have different barcodes according to the country of origin of manufacture) * @@ -294,7 +307,7 @@ class Product extends CommonObject public $multilangs=array(); - //! Taille de l'image + //! Size of image public $imgWidth; public $imgHeight; @@ -348,16 +361,7 @@ class Product extends CommonObject public $fields = array( - 'rowid' => array( - 'type'=>'integer', - 'label'=>'TechnicalID', - 'enabled'=>1, - 'visible'=>-2, - 'notnull'=>1, - 'index'=>1, - 'position'=>1, - 'comment'=>'Id', - ), + 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'index'=>1, 'position'=>1, 'comment'=>'Id'), 'ref' =>array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1, 'comment'=>'Reference of object'), 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'default'=>1, 'notnull'=>1, 'index'=>1, 'position'=>20), 'note_public' =>array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>61), From b1e21ed5fc302ebef8fe6b63dc336074ec997233 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 11 Jul 2019 22:18:44 +0200 Subject: [PATCH 10/28] FIX Computed field were not calculated into lists. --- htdocs/core/class/extrafields.class.php | 2 ++ .../core/tpl/extrafields_list_print_fields.tpl.php | 12 +++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index eeb653aec8a..9e83a1d836b 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1627,6 +1627,8 @@ class ExtraFields if ($hidden) return ''; // This is a protection. If field is hidden, we should just not call this method. + //if ($computed) $value = // $value is already calculated into $value before calling this method + $showsize=0; if ($type == 'date') { diff --git a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php index 1dad8a6739d..35aefb9f719 100644 --- a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php +++ b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php @@ -40,7 +40,17 @@ if (! empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_ { $value = $obj->$tmpkey; } - + // If field is a computed field, we make computation to get value + if ($extrafields->attributes[$extrafieldsobjectkey]['computed'][$key]) + { + //global $obj, $object; + //var_dump($extrafields->attributes[$extrafieldsobjectkey]['computed'][$key]); + //var_dump($obj); + //var_dump($extrafields->attributes[$extrafieldsobjectkey]['computed'][$key]); + $value = dol_eval($extrafields->attributes[$extrafieldsobjectkey]['computed'][$key], 1); + //var_dump($value); + } + print $extrafields->showOutputField($key, $value, '', $extrafieldsobjectkey); print ''; if (! $i) $totalarray['nbfield']++; From 332abd2a9f845ab0cfe969698ac0dbf38759853c Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 13 Jul 2019 11:02:45 +0200 Subject: [PATCH 11/28] FIX __INFOS__ tag not exists --- htdocs/install/mysql/data/llx_c_email_templates.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/data/llx_c_email_templates.sql b/htdocs/install/mysql/data/llx_c_email_templates.sql index 0c64fcf7d0d..87741d1054b 100644 --- a/htdocs/install/mysql/data/llx_c_email_templates.sql +++ b/htdocs/install/mysql/data/llx_c_email_templates.sql @@ -24,7 +24,7 @@ INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_u INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingEmailOnAutoSubscription)' ,10,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipRequestWasReceived)__','__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(ThisIsContentOfYourMembershipRequestWasReceived)__
\n
__ONLINE_PAYMENT_TEXT_AND_URL__
\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 0); -INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingEmailOnMemberValidation)' ,20,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipWasValidated)__', '__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(ThisIsContentOfYourMembershipWasValidated)__
__INFOS__
\n
__ONLINE_PAYMENT_TEXT_AND_URL__
\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 0); +INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingEmailOnMemberValidation)' ,20,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipWasValidated)__', '__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(ThisIsContentOfYourMembershipWasValidated)__
__(FirstName)__ : __MEMBER_FIRSTNAME__
__(LastName)__ : __MEMBER_LASTNAME__
__(ID)__ : __MEMBER_ID__
\n
__ONLINE_PAYMENT_TEXT_AND_URL__
\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 0); INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingEmailOnNewSubscription)' ,30,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourSubscriptionWasRecorded)__', '__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(ThisIsContentOfYourSubscriptionWasRecorded)__
\n\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 1); INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingReminderForExpiredSubscription)',40,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(SubscriptionReminderEmail)__', '__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(ThisIsContentOfSubscriptionReminderEmail)__
\n
__ONLINE_PAYMENT_TEXT_AND_URL__
\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 0); INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingEmailOnCancelation)' ,50,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipWasCanceled)__', '__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(YourMembershipWasCanceled)__
\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 0); From b7df4a2cd04b6b8c13f78162e85a3ee660355dc6 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 13 Jul 2019 11:21:07 +0200 Subject: [PATCH 12/28] FIX this function can not be private --- htdocs/adherents/class/adherent.class.php | 2 +- htdocs/contact/class/contact.class.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 115d1fb8ab4..2001959240d 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -2447,7 +2447,7 @@ class Adherent extends CommonObject * 2=Return key only (uid=qqq) * @return string DN */ - private function _load_ldap_dn($info, $mode = 0) + public function _load_ldap_dn($info, $mode = 0) { // phpcs:enable global $conf; diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index de9494fca8b..74ff7bf5fb4 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -507,7 +507,7 @@ class Contact extends CommonObject * 2=Return key only (uid=qqq) * @return string DN */ - private function _load_ldap_dn($info, $mode = 0) + public function _load_ldap_dn($info, $mode = 0) { // phpcs:enable global $conf; From 4dab57b4947a4d965f253a824582db656239fd24 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 13 Jul 2019 11:24:25 +0200 Subject: [PATCH 13/28] FIX phpcs --- htdocs/adherents/class/adherent.class.php | 1 + htdocs/contact/class/contact.class.php | 1 + 2 files changed, 2 insertions(+) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 2001959240d..d20fc34ec9d 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -2438,6 +2438,7 @@ class Adherent extends CommonObject // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore /** * Retourne chaine DN complete dans l'annuaire LDAP pour l'objet * diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 74ff7bf5fb4..d6053a46b35 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -498,6 +498,7 @@ class Contact extends CommonObject // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore /** * Retourne chaine DN complete dans l'annuaire LDAP pour l'objet * From f041110a7ef88cd8057d515bce96946c0242bf3f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 13 Jul 2019 22:29:50 +0200 Subject: [PATCH 14/28] Update commonobject.class.php --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 43f78b571de..579deec88e3 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2615,7 +2615,7 @@ abstract class CommonObject $MODULE = ""; if ($this->element == 'propal') $MODULE = "MODULE_DISALLOW_UPDATE_PRICE_PROPOSAL"; - elseif ($this->element == 'commande') + elseif ($this->element == 'commande' || $this->element == 'order') $MODULE = "MODULE_DISALLOW_UPDATE_PRICE_ORDER"; elseif ($this->element == 'facture') $MODULE = "MODULE_DISALLOW_UPDATE_PRICE_INVOICE"; From b6571d9fc3a27f147ace6d6794f6d58a9690a749 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 13 Jul 2019 22:39:25 +0200 Subject: [PATCH 15/28] Update byratecountry.php --- htdocs/compta/stats/byratecountry.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/stats/byratecountry.php b/htdocs/compta/stats/byratecountry.php index cd41649cc89..045f5e6429c 100644 --- a/htdocs/compta/stats/byratecountry.php +++ b/htdocs/compta/stats/byratecountry.php @@ -37,7 +37,7 @@ require_once DOL_DOCUMENT_ROOT.'/expensereport/class/paymentexpensereport.class. // Load translation files required by the page $langs->loadLangs(array("other","compta","banks","bills","companies","product","trips","admin","accountancy")); -$modecompta = $conf->global->ACCOUNTING_MODE; +$modecompta = (GETPOST('modecompta', 'alpha') ? GETPOST('modecompta', 'alpha') : $conf->global->ACCOUNTING_MODE); // Date range $year=GETPOST("year",'int'); From 8090a8abb66619753ea5cca54d04ce92d71eae1c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 14 Jul 2019 00:07:27 +0200 Subject: [PATCH 16/28] Fix param [] -> null --- htdocs/adherents/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 0fbee667522..f0d8df454cf 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -646,7 +646,7 @@ if (empty($reshook)) if (empty($labeltouse) || (int) $labeltouse === -1) { //fallback on the old configuration. - setEventMessages('WarningMandatorySetupNotComplete', [], 'errors'); + setEventMessages('WarningMandatorySetupNotComplete', null, 'errors'); $error++; } else { From b66ad24d85577a95b2280285c6dc946fecffe0c1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 14 Jul 2019 00:10:15 +0200 Subject: [PATCH 17/28] Fix save of doc template for recuring invoices. --- htdocs/compta/facture/fiche-rec.php | 2 +- htdocs/core/class/html.form.class.php | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php index 31a4affb95d..f195ab84324 100644 --- a/htdocs/compta/facture/fiche-rec.php +++ b/htdocs/compta/facture/fiche-rec.php @@ -1424,7 +1424,7 @@ else $list = array(); $models = ModelePDFFactures::liste_modeles($db); foreach ($models as $k => $model) { - $list[] = $k . ':' . $model; + $list[] = str_replace(':', '|', $k) . ':' . $model; } $select = 'select;'.implode(',', $list); print $form->editfieldval($langs->trans("Model"), 'modelpdf', $object->modelpdf, $object, $user->rights->facture->creer, $select); diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index a462f40ebdc..d2130e24291 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -152,7 +152,7 @@ class Form * @param string $value Value to show/edit * @param object $object Object * @param boolean $perm Permission to allow button to edit parameter - * @param string $typeofdata Type of data ('string' by default, 'email', 'amount:99', 'numeric:99', 'text' or 'textarea:rows:cols%', 'datepicker' ('day' do not work, don't know why), 'dayhour' or 'datepickerhour', 'ckeditor:dolibarr_zzz:width:height:savemethod:toolbarstartexpanded:rows:cols', 'select:xxx'...) + * @param string $typeofdata Type of data ('string' by default, 'email', 'amount:99', 'numeric:99', 'text' or 'textarea:rows:cols%', 'datepicker' ('day' do not work, don't know why), 'dayhour' or 'datepickerhour', 'ckeditor:dolibarr_zzz:width:height:savemethod:toolbarstartexpanded:rows:cols', 'select;xkey:xval,ykey:yval,...') * @param string $editvalue When in edit mode, use this value as $value instead of value (for example, you can provide here a formated price instead of value). Use '' to use same than $value * @param object $extObject External object * @param mixed $custommsg String or Array of custom messages : eg array('success' => 'MyMessage', 'error' => 'MyMessage') @@ -172,7 +172,7 @@ class Form if (empty($typeofdata)) return 'ErrorBadParameter'; // When option to edit inline is activated - if (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE) && ! preg_match('/^select;|datehourpicker/',$typeofdata)) // TODO add jquery timepicker + if (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE) && ! preg_match('/^select;|datehourpicker/',$typeofdata)) // TODO add jquery timepicker and support select { $ret.=$this->editInPlace($object, $value, $htmlname, $perm, $typeofdata, $editvalue, $extObject, $custommsg); } @@ -229,7 +229,8 @@ class Form foreach($arraydata as $val) { $tmp=explode(':',$val); - $arraylist[$tmp[0]]=$tmp[1]; + $tmpkey=str_replace('|', ':', $tmp[0]); + $arraylist[$tmpkey]=$tmp[1]; } $ret.=$this->selectarray($htmlname,$arraylist,$value); } @@ -298,7 +299,7 @@ class Form * @param string $value Value to show/edit * @param string $htmlname DIV ID (field name) * @param int $condition Condition to edit - * @param string $inputType Type of input ('string', 'numeric', 'datepicker' ('day' do not work, don't know why), 'textarea:rows:cols', 'ckeditor:dolibarr_zzz:width:height:?:1:rows:cols', 'select:xxx') + * @param string $inputType Type of input ('string', 'numeric', 'datepicker' ('day' do not work, don't know why), 'textarea:rows:cols', 'ckeditor:dolibarr_zzz:width:height:?:1:rows:cols', 'select:loadmethod:savemethod:buttononly') * @param string $editvalue When in edit mode, use this value as $value instead of value * @param object $extObject External object * @param mixed $custommsg String or Array of custom messages : eg array('success' => 'MyMessage', 'error' => 'MyMessage') From 2a05164bb119520e8a68c43aea99c399d10a8e43 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 14 Jul 2019 00:31:28 +0200 Subject: [PATCH 18/28] FIX Better PHP compatibility --- htdocs/adherents/card.php | 2 +- .../class/DataCollector/DolLogsCollector.php | 6 +++--- htdocs/public/stripe/confirm_payment.php | 20 ++++++++++--------- .../societe/class/api_thirdparties.class.php | 16 +++++++-------- htdocs/societe/paymentmodes.php | 2 +- htdocs/stripe/class/stripe.class.php | 2 +- 6 files changed, 25 insertions(+), 23 deletions(-) diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 1e777d003d9..373e8b953f6 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -734,7 +734,7 @@ if (empty($reshook)) if (empty($labeltouse) || (int) $labeltouse === -1) { //fallback on the old configuration. - setEventMessages('WarningMandatorySetupNotComplete', [], 'errors'); + setEventMessages('WarningMandatorySetupNotComplete', null, 'errors'); $error++; } else { diff --git a/htdocs/debugbar/class/DataCollector/DolLogsCollector.php b/htdocs/debugbar/class/DataCollector/DolLogsCollector.php index 8e39c68b6b7..dd6fabd508f 100644 --- a/htdocs/debugbar/class/DataCollector/DolLogsCollector.php +++ b/htdocs/debugbar/class/DataCollector/DolLogsCollector.php @@ -144,7 +144,7 @@ class DolLogsCollector extends MessagesCollector $linecounter = $lines; $pos = -2; $beginning = false; - $text = []; + $text = array(); while ($linecounter > 0) { $t = " "; while ($t != "\n") { @@ -179,12 +179,12 @@ class DolLogsCollector extends MessagesCollector $pattern = "/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}.*/"; $log_levels = $this->getLevels(); preg_match_all($pattern, $file, $matches); - $log = []; + $log = array(); foreach ($matches as $lines) { foreach ($lines as $line) { foreach ($log_levels as $level_key => $level) { if (strpos(strtolower($line), strtolower($level_key)) == 20) { - $log[] = ['level' => $level, 'line' => $line]; + $log[] = array('level' => $level, 'line' => $line); } } } diff --git a/htdocs/public/stripe/confirm_payment.php b/htdocs/public/stripe/confirm_payment.php index ea59b13dcb9..9ff9662ff84 100644 --- a/htdocs/public/stripe/confirm_payment.php +++ b/htdocs/public/stripe/confirm_payment.php @@ -15,6 +15,8 @@ * along with this program. If not, see . */ +// TODO Do we really need this page. We alread have a ipn.php page ! + define("NOLOGIN", 1); // This means this output page does not require to be logged. define("NOCSRFCHECK", 1); // We accept to go on this page from external web site. @@ -105,13 +107,13 @@ $intent = null; try { if (isset($json_obj->payment_method_id)) { // Create the PaymentIntent - $intent = \Stripe\PaymentIntent::create([ + $intent = \Stripe\PaymentIntent::create(array( 'payment_method' => $json_obj->payment_method_id, 'amount' => 1099, 'currency' => 'eur', 'confirmation_method' => 'manual', 'confirm' => true, - ]); + )); } if (isset($json_obj->payment_intent_id)) { $intent = \Stripe\PaymentIntent::retrieve( @@ -122,9 +124,9 @@ try { generatePaymentResponse($intent); } catch (\Stripe\Error\Base $e) { // Display error on client - echo json_encode([ + echo json_encode(array( 'error' => $e->getMessage() - ]); + )); } /* @@ -138,22 +140,22 @@ function generatePaymentResponse($intent) if ($intent->status == 'requires_source_action' && $intent->next_action->type == 'use_stripe_sdk') { // Tell the client to handle the action - echo json_encode([ + echo json_encode(array( 'requires_action' => true, 'payment_intent_client_secret' => $intent->client_secret - ]); + )); } elseif ($intent->status == 'succeeded') { // The payment didn’t need any additional actions and completed! // Handle post-payment fulfillment // TODO - echo json_encode([ + echo json_encode(array( "success" => true - ]); + )); } else { // Invalid status http_response_code(500); - echo json_encode(['error' => 'Invalid PaymentIntent status']); + echo json_encode(array('error' => 'Invalid PaymentIntent status')); } } diff --git a/htdocs/societe/class/api_thirdparties.class.php b/htdocs/societe/class/api_thirdparties.class.php index adae31e7677..95aad3a003b 100644 --- a/htdocs/societe/class/api_thirdparties.class.php +++ b/htdocs/societe/class/api_thirdparties.class.php @@ -1041,7 +1041,7 @@ $reshook = $hookmanager->executeHooks('replaceThirdparty', array( $i=0; - $accounts =[]; + $accounts = array(); if ($result) { @@ -1061,12 +1061,12 @@ $reshook = $hookmanager->executeHooks('replaceThirdparty', array( } - $fields = ['socid', 'default_rib', 'frstrecur', '1000110000001', 'datec', 'datem', 'label', 'bank', 'bic', 'iban', 'id', 'rum']; + $fields = array('socid', 'default_rib', 'frstrecur', '1000110000001', 'datec', 'datem', 'label', 'bank', 'bic', 'iban', 'id', 'rum'); - $returnAccounts = []; + $returnAccounts = array(); foreach($accounts as $account){ - $object= []; + $object= array(); foreach($account as $key => $value) if(in_array($key, $fields)){ $object[$key] = $value; @@ -1308,7 +1308,7 @@ $reshook = $hookmanager->executeHooks('replaceThirdparty', array( $i=0; - $accounts =[]; + $accounts = array(); $num = $db->num_rows($result); while ($i < $num) @@ -1322,12 +1322,12 @@ $reshook = $hookmanager->executeHooks('replaceThirdparty', array( $i++; } - $fields = ['id', 'fk_soc', 'key_account', 'site', 'date_creation', 'tms']; + $fields = array('id', 'fk_soc', 'key_account', 'site', 'date_creation', 'tms'); - $returnAccounts = []; + $returnAccounts = array(); foreach($accounts as $account){ - $object= []; + $object= array(); foreach($account as $key => $value) if(in_array($key, $fields)){ $object[$key] = $value; diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index 0e41e11cbaa..51a7ccb24bb 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -639,7 +639,7 @@ if (empty($reshook)) try { if (preg_match('/pm_/', $source)) { - $payment_method = \Stripe\PaymentMethod::retrieve($source, ["stripe_account" => $stripeacc]); + $payment_method = \Stripe\PaymentMethod::retrieve($source, array("stripe_account" => $stripeacc)); if ($payment_method) { $payment_method->detach(); diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index d8d0c656dab..6b910236e96 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -389,7 +389,7 @@ class Stripe extends CommonObject "confirmation_method" => $mode, "amount" => $stripeamount, "currency" => $currency_code, - "payment_method_types" => ["card"], + "payment_method_types" => array("card"), "description" => $description, "statement_descriptor" => dol_trunc($tag, 10, 'right', 'UTF-8', 1), // 22 chars that appears on bank receipt (company + description) //"save_payment_method" => true, From e1d49177040c197c6027e53bd302e031ee46ab12 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 14 Jul 2019 00:39:42 +0200 Subject: [PATCH 19/28] FIX Missing field "Conciliated" into bank transaction export --- htdocs/core/modules/modBanque.class.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/core/modules/modBanque.class.php b/htdocs/core/modules/modBanque.class.php index fb2c818043e..21c33d35170 100644 --- a/htdocs/core/modules/modBanque.class.php +++ b/htdocs/core/modules/modBanque.class.php @@ -150,14 +150,15 @@ class modBanque extends DolibarrModules $this->export_fields_array[$r]=array( 'b.rowid'=>'IdTransaction','ba.ref'=>'AccountRef','ba.label'=>'AccountLabel','b.datev'=>'DateValue','b.dateo'=>'DateOperation','b.label'=>'Label', 'b.num_chq'=>'ChequeOrTransferNumber','b.fk_bordereau'=>'ChequeBordereau','-b.amount'=>'Debit','b.amount'=>'Credit', - 'b.num_releve'=>'AccountStatement','b.datec'=>"DateCreation","bu.url_id"=>"IdThirdParty","s.nom"=>"ThirdParty", - "s.code_compta"=>"CustomerAccountancyCode","s.code_compta_fournisseur"=>"SupplierAccountancyCode" + 'b.num_releve'=>'AccountStatement','b.rappro'=>'Conciliated','b.datec'=>"DateCreation","bu.url_id"=>"IdThirdParty", + "s.nom"=>"ThirdParty","s.code_compta"=>"CustomerAccountancyCode","s.code_compta_fournisseur"=>"SupplierAccountancyCode" ); - $this->export_TypeFields_array[$r]=array('ba.ref'=>'Text','ba.label'=>'Text','b.datev'=>'Date','b.dateo'=>'Date','b.label'=>'Text','b.num_chq'=>'Text','b.fk_bordereau'=>'Text','-b.amount'=>'Numeric','b.amount'=>'Numeric','b.num_releve'=>'Text','b.datec'=>"Date","bu.url_id"=>"Text","s.nom"=>"Text","s.code_compta"=>"Text","s.code_compta_fournisseur"=>"Text"); + $this->export_TypeFields_array[$r]=array('ba.ref'=>'Text','ba.label'=>'Text','b.datev'=>'Date','b.dateo'=>'Date','b.label'=>'Text','b.num_chq'=>'Text','b.fk_bordereau'=>'Text','-b.amount'=>'Numeric','b.amount'=>'Numeric','b.num_releve'=>'Text','b.rappro'=>'Boolean','b.datec'=>"Date","bu.url_id"=>"Text","s.nom"=>"Text","s.code_compta"=>"Text","s.code_compta_fournisseur"=>"Text"); $this->export_entities_array[$r]=array( 'b.rowid'=>'account','ba.ref'=>'account','ba.label'=>'account','b.datev'=>'account','b.dateo'=>'account','b.label'=>'account', - 'b.num_chq'=>'account','b.fk_bordereau'=>'account','-b.amount'=>'account','b.amount'=>'account','b.num_releve'=>'account', - 'b.datec'=>"account","bu.url_id"=>"company","s.nom"=>"company","s.code_compta"=>"company","s.code_compta_fournisseur"=>"company" + 'b.num_chq'=>'account','b.fk_bordereau'=>'account','-b.amount'=>'account','b.amount'=>'account', + 'b.num_releve'=>'account','b.rappro'=>'account','b.datec'=>"account","bu.url_id"=>"company", + "s.nom"=>"company","s.code_compta"=>"company","s.code_compta_fournisseur"=>"company" ); $this->export_special_array[$r]=array('-b.amount'=>'NULLIFNEG','b.amount'=>'NULLIFNEG'); if (empty($conf->fournisseur->enabled)) From 294bc5dcb5e0fedca685b6976e4d7e042fa03067 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 15 Jul 2019 10:19:06 +0200 Subject: [PATCH 20/28] FIX avoid conflict with "$classname" in card.php --- htdocs/commande/card.php | 4 ++-- htdocs/core/tpl/object_discounts.tpl.php | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 10629ec3452..96ea54c5c84 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1436,11 +1436,11 @@ if ($action == 'create' && $user->rights->commande->creer) if ($element == 'order' || $element == 'commande') { $element = $subelement = 'commande'; } - if ($element == 'propal') { + elseif ($element == 'propal') { $element = 'comm/propal'; $subelement = 'propal'; } - if ($element == 'contract') { + elseif ($element == 'contract') { $element = $subelement = 'contrat'; } diff --git a/htdocs/core/tpl/object_discounts.tpl.php b/htdocs/core/tpl/object_discounts.tpl.php index 70698bfa7eb..3d02d3c5a73 100644 --- a/htdocs/core/tpl/object_discounts.tpl.php +++ b/htdocs/core/tpl/object_discounts.tpl.php @@ -24,7 +24,7 @@ * $backtopage URL to come back to from discount modification pages */ -$classname = get_class($object); +$objclassname = get_class($object); $isInvoice = in_array($object->element, array('facture', 'invoice', 'facture_fourn', 'invoice_supplier')); $isNewObject = empty($object->id) && empty($object->rowid); @@ -53,11 +53,11 @@ if($isNewObject) print ' ('.$addrelativediscount.')'; // Is there is commercial discount or down payment available ? if ($absolute_discount > 0) { - if ($cannotApplyDiscount || ! $isInvoice || $isNewObject || $object->statut > $classname::STATUS_DRAFT || $object->type == $classname::TYPE_CREDIT_NOTE || $object->type == $classname::TYPE_DEPOSIT) { + if ($cannotApplyDiscount || ! $isInvoice || $isNewObject || $object->statut > $objclassname::STATUS_DRAFT || $object->type == $objclassname::TYPE_CREDIT_NOTE || $object->type == $objclassname::TYPE_DEPOSIT) { $translationKey = ! empty($discount_type) ? 'HasAbsoluteDiscountFromSupplier' : 'CompanyHasAbsoluteDiscount'; $text = $langs->trans($translationKey, price($absolute_discount), $langs->transnoentities("Currency" . $conf->currency)).'.'; - if ($isInvoice && ! $isNewObject && $object->statut > $classname::STATUS_DRAFT && $object->type != $classname::TYPE_CREDIT_NOTE && $object->type != $classname::TYPE_DEPOSIT) { + if ($isInvoice && ! $isNewObject && $object->statut > $objclassname::STATUS_DRAFT && $object->type != $objclassname::TYPE_CREDIT_NOTE && $object->type != $objclassname::TYPE_DEPOSIT) { $text = $form->textwithpicto($text, $langs->trans('AbsoluteDiscountUse')); } @@ -77,11 +77,11 @@ if ($absolute_discount > 0) { if ($absolute_creditnote > 0) { // If validated, we show link "add credit note to payment" - if ($cannotApplyDiscount || ! $isInvoice || $isNewObject || $object->statut != $classname::STATUS_VALIDATED || $object->type == $classname::TYPE_CREDIT_NOTE) { + if ($cannotApplyDiscount || ! $isInvoice || $isNewObject || $object->statut != $objclassname::STATUS_VALIDATED || $object->type == $objclassname::TYPE_CREDIT_NOTE) { $translationKey = ! empty($discount_type) ? 'HasCreditNoteFromSupplier' : 'CompanyHasCreditNote'; $text = $langs->trans($translationKey, price($absolute_creditnote), $langs->transnoentities("Currency" . $conf->currency)) . '.'; - if ($isInvoice && ! $isNewObject && $object->statut == $classname::STATUS_DRAFT && $object->type != $classname::TYPE_DEPOSIT) { + if ($isInvoice && ! $isNewObject && $object->statut == $objclassname::STATUS_DRAFT && $object->type != $objclassname::TYPE_DEPOSIT) { $text = $form->textwithpicto($text, $langs->trans('CreditNoteDepositUse')); } @@ -101,7 +101,7 @@ if($absolute_discount <= 0 && $absolute_creditnote <= 0) { $translationKey = ! empty($discount_type) ? 'HasNoAbsoluteDiscountFromSupplier' : 'CompanyHasNoAbsoluteDiscount'; print '
'.$langs->trans($translationKey).'.'; - if ($isInvoice && $object->statut == $classname::STATUS_DRAFT && $object->type != $classname::TYPE_CREDIT_NOTE && $object->type != $classname::TYPE_DEPOSIT) { + if ($isInvoice && $object->statut == $objclassname::STATUS_DRAFT && $object->type != $objclassname::TYPE_CREDIT_NOTE && $object->type != $objclassname::TYPE_DEPOSIT) { print ' (' . $addabsolutediscount . ')'; } } From b0d46d492fdd738cab5b15202abb4414da373828 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 15 Jul 2019 18:40:42 +0200 Subject: [PATCH 21/28] FIX #11509 --- htdocs/adherents/subscription/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/subscription/list.php b/htdocs/adherents/subscription/list.php index e3eb9b595ee..e7967aa4782 100644 --- a/htdocs/adherents/subscription/list.php +++ b/htdocs/adherents/subscription/list.php @@ -229,7 +229,7 @@ if ($search_type) $param.="&search_type=".urlencode($search_type); if ($date_select) $param.="&date_select=".urlencode($date_select); if ($search_lastname) $param.="&search_lastname=".urlencode($search_lastname); if ($search_login) $param.="&search_login=".urlencode($search_login); -if ($search_acount) $param.="&search_account=".urlencode($search_account); +if ($search_account) $param.="&search_account=".urlencode($search_account); if ($search_amount) $param.="&search_amount=".urlencode($search_amount); if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss); // Add $param from extra fields From 5778a02ee1f195ad457a07de6b4f986d6e4cb49a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 15 Jul 2019 18:44:33 +0200 Subject: [PATCH 22/28] FIX #11505 --- htdocs/accountancy/journal/bankjournal.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index d4a9ff0d3f6..8003cf1c523 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -964,7 +964,7 @@ if (empty($action) || $action == 'view') { $varlink = 'id_journal=' . $id_journal; - journalHead($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array('action' => ''), '', $varlink); + journalHead($nom, '', $period, $periodlink, $description, $builddate, $exportlink, array('action' => ''), '', $varlink); // Test that setup is complete From e3968241335b6dea66c1b5b2e7ed0d7768c40ae1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 15 Jul 2019 19:08:57 +0200 Subject: [PATCH 23/28] FIX #11507 --- htdocs/accountancy/admin/productaccount.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/admin/productaccount.php b/htdocs/accountancy/admin/productaccount.php index 562dfd1505b..1c72ea61abd 100644 --- a/htdocs/accountancy/admin/productaccount.php +++ b/htdocs/accountancy/admin/productaccount.php @@ -462,7 +462,7 @@ if ($result) // print '' . $obj->description . ''; // TODO: we shoul set a user defined value to adjust user square / wide screen size $trunclengh = empty($conf->global->ACCOUNTING_LENGTH_DESCRIPTION) ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION; - print '' . nl2br(dol_trunc($obj->description, $trunclengh)) . ''; + print '' . nl2br(dol_trunc($obj->description, $trunclengh)) . ''; } if ($accounting_product_mode == 'ACCOUNTANCY_SELL' || $accounting_product_mode == 'ACCOUNTANCY_SELL_INTRA' || $accounting_product_mode == 'ACCOUNTANCY_SELL_EXPORT') From 6c23154a91f683f300bac2b114acce2aa4c2d201 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 15 Jul 2019 22:59:18 +0200 Subject: [PATCH 24/28] FIX #11506 --- htdocs/accountancy/admin/journals_list.php | 20 +++++++++----------- htdocs/langs/en_US/accountancy.lang | 2 +- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/htdocs/accountancy/admin/journals_list.php b/htdocs/accountancy/admin/journals_list.php index cac81bfbcae..78cd92f90e0 100644 --- a/htdocs/accountancy/admin/journals_list.php +++ b/htdocs/accountancy/admin/journals_list.php @@ -162,7 +162,7 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) { if ($fieldnamekey == 'libelle' || ($fieldnamekey == 'label')) $fieldnamekey='Label'; if ($fieldnamekey == 'code') $fieldnamekey = 'Code'; - if ($fieldnamekey == 'nature') $fieldnamekey = 'Nature'; + if ($fieldnamekey == 'nature') $fieldnamekey = 'NatureOfJournal'; } // Other checks if (isset($_POST["code"])) @@ -437,7 +437,7 @@ if ($id) $valuetoshow=$langs->trans("Label"); } if ($fieldlist[$field]=='nature') { - $valuetoshow=$langs->trans("Nature"); + $valuetoshow=$langs->trans("NatureOfJournal"); } if ($valuetoshow != '') { @@ -516,7 +516,7 @@ if ($id) } // Title line with search boxes - print ''; + /*print ''; print ''; print ''; print ''; @@ -524,16 +524,14 @@ if ($id) print ''; print ''; print ''; - if ($filterfound) - { - $searchpicto=$form->showFilterAndCheckAddButtons(0); - print $searchpicto; - } + $searchpicto=$form->showFilterButtons(); + print $searchpicto; print ''; print ''; - + */ + // Title of lines - print ''; + print ''; foreach ($fieldlist as $field => $value) { // Determine le nom du champ par rapport aux noms possibles @@ -558,7 +556,7 @@ if ($id) $valuetoshow=$langs->trans("Label"); } if ($fieldlist[$field]=='nature') { - $valuetoshow=$langs->trans("Nature"); + $valuetoshow=$langs->trans("NatureOfJournal"); } // Affiche nom du champ diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index 6dfe4fc8c4f..4b22f512826 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -265,7 +265,7 @@ AccountingJournals=Accounting journals AccountingJournal=Accounting journal NewAccountingJournal=New accounting journal ShowAccoutingJournal=Show accounting journal -Nature=Nature +NatureOfJournal=Nature of Journal AccountingJournalType1=Miscellaneous operations AccountingJournalType2=Sales AccountingJournalType3=Purchases From ea349de0818dddff6859aaca349d0878d9a57cf3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 15 Jul 2019 23:25:42 +0200 Subject: [PATCH 25/28] FIX #11498 --- dev/dolibarr_changes.txt | 9 +++++++++ htdocs/includes/mike42/escpos-php/Escpos.php | 6 ++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/dev/dolibarr_changes.txt b/dev/dolibarr_changes.txt index 5bad55fd4d2..e87b082dd06 100644 --- a/dev/dolibarr_changes.txt +++ b/dev/dolibarr_changes.txt @@ -27,6 +27,15 @@ With +ESCPOS: +------- +Replace + private $connector; +With + protected $connector; + + + NUSOAP: ------- * In file nusoap.php, to avoid a warning, diff --git a/htdocs/includes/mike42/escpos-php/Escpos.php b/htdocs/includes/mike42/escpos-php/Escpos.php index 57e7eb2c8ac..b8568260738 100644 --- a/htdocs/includes/mike42/escpos-php/Escpos.php +++ b/htdocs/includes/mike42/escpos-php/Escpos.php @@ -144,9 +144,11 @@ class Escpos { /** * @var PrintConnector + * @CHANGE */ - private $connector; - + protected $connector; + // private $connector; + /** * @var AbstractCapabilityProfile */ From d694360c66bea525997c471f535948864574ece4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 15 Jul 2019 23:46:54 +0200 Subject: [PATCH 26/28] Fix warning --- htdocs/core/modules/modAgenda.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modAgenda.class.php b/htdocs/core/modules/modAgenda.class.php index 3b7c05c5ad1..f84ad6cbcfa 100644 --- a/htdocs/core/modules/modAgenda.class.php +++ b/htdocs/core/modules/modAgenda.class.php @@ -418,6 +418,6 @@ class modAgenda extends DolibarrModules $this->export_sql_end[$r] .=' WHERE ac.entity IN ('.getEntity('agenda').')'; if (empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .=' AND (sc.fk_user = '.(empty($user)?0:$user->id).' OR ac.fk_soc IS NULL)'; if (empty($user->rights->agenda->allactions->read)) $this->export_sql_end[$r] .=' AND acr.fk_element = '.(empty($user)?0:$user->id); - $this->export_sql_order[$r] .=' ORDER BY ac.datep'; + $this->export_sql_order[$r] =' ORDER BY ac.datep'; } } From fb5af65f4d1bdb6925e95bca0f1ddb02f01355a7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 15 Jul 2019 23:56:05 +0200 Subject: [PATCH 27/28] FIX #11466 --- htdocs/product/price.php | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 26970f1dd13..6bc7033ec23 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -1711,20 +1711,18 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) } print ''; - // Update all child soc - print ''; - print $langs->trans('ForceUpdateChildPriceSoc'); - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; dol_fiche_end(); print '
'; + + // Update all child soc + print '
'; + print ' '; + print $langs->trans('ForceUpdateChildPriceSoc'); + print '
'; + print ''; print '     '; print ''; @@ -1804,10 +1802,8 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) // Update all child soc print ''; - print $langs->trans('ForceUpdateChildPriceSoc'); print ''; print ''; - print ''; print ''; print ''; @@ -1816,6 +1812,11 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) dol_fiche_end(); print '
'; + print '
'; + print ' '; + print $langs->trans('ForceUpdateChildPriceSoc'); + print "
"; + print ''; print '     '; print ''; @@ -2162,7 +2163,7 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) // Action if ($user->rights->produit->supprimer || $user->rights->service->supprimer) { - print ''; + print ''; print 'id . '&socid=' . $line->fk_soc . '">'; print img_info($langs->trans('PriceByCustomerLog')); print ''; From f826e9631cafe5e54cc6918714b81445713d4ea0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 16 Jul 2019 00:12:22 +0200 Subject: [PATCH 28/28] FIX #11463 --- htdocs/societe/agenda.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/agenda.php b/htdocs/societe/agenda.php index 13838812d9d..53a1ee5d7ed 100644 --- a/htdocs/societe/agenda.php +++ b/htdocs/societe/agenda.php @@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; -$langs->load(array("companies", "bills", "propal", "orders")); +$langs->loadLangs(array("companies", "bills", "propal", "orders")); if (GETPOST('actioncode', 'array')) {