From 1cf46f9ae94293f603a3b56d5716fdc4dd2bcb58 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 7 May 2021 15:11:28 +0200 Subject: [PATCH 01/12] cast int --- htdocs/societe/class/societe.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 9b224200060..011dd3dcce5 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1518,7 +1518,7 @@ class Societe extends CommonObject $sql .= ' WHERE s.entity IN ('.getEntity($this->element).')'; if ($rowid) { - $sql .= ' AND s.rowid = '.$rowid; + $sql .= ' AND s.rowid = '.((int) $rowid); } if ($ref) { $sql .= " AND s.nom = '".$this->db->escape($ref)."'"; From 97ca6895d867d1c8d98b471dbdb4ebe262fa897d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 7 May 2021 15:50:07 +0200 Subject: [PATCH 02/12] Missing profid1 and 2 in get API --- htdocs/webservices/server_thirdparty.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/htdocs/webservices/server_thirdparty.php b/htdocs/webservices/server_thirdparty.php index c81b6bc6f63..1d8446f1659 100644 --- a/htdocs/webservices/server_thirdparty.php +++ b/htdocs/webservices/server_thirdparty.php @@ -210,7 +210,7 @@ $styleuse = 'encoded'; // encoded/literal/literal wrapped $server->register( 'getThirdParty', // Entry values - array('authentication'=>'tns:authentication', 'id'=>'xsd:string', 'ref'=>'xsd:string', 'ref_ext'=>'xsd:string'), + array('authentication'=>'tns:authentication', 'id'=>'xsd:string', 'ref'=>'xsd:string', 'ref_ext'=>'xsd:string', 'barcode'=>'xsd:string', 'profid1'=>'xsd:string', 'profid2'=>'xsd:string'), // Exit values array('result'=>'tns:result', 'thirdparty'=>'tns:thirdparty'), $ns, @@ -286,13 +286,16 @@ $server->register( * @param string $id internal id * @param string $ref internal reference * @param string $ref_ext external reference + * @param string $barcode barcode + * @param string $profid1 profid1 + * @param string $profid2 profid2 * @return array Array result */ -function getThirdParty($authentication, $id = '', $ref = '', $ref_ext = '') +function getThirdParty($authentication, $id = '', $ref = '', $ref_ext = '', $barcode = '', $profid1 = '', $profid2 = '') { global $db, $conf; - dol_syslog("Function: getThirdParty login=".$authentication['login']." id=".$id." ref=".$ref." ref_ext=".$ref_ext); + dol_syslog("Function: getThirdParty login=".$authentication['login']." id=".$id." ref=".$ref." ref_ext=".$ref_ext." barcode=".$barcode." profid1=".$profid1." profid2=".$profid2); if ($authentication['entity']) $conf->entity = $authentication['entity']; @@ -317,7 +320,7 @@ function getThirdParty($authentication, $id = '', $ref = '', $ref_ext = '') if ($fuser->rights->societe->lire) { $thirdparty = new Societe($db); - $result = $thirdparty->fetch($id, $ref, $ref_ext); + $result = $thirdparty->fetch($id, $ref, $ref_ext, $barcode, $profid1, $profid2); if ($result > 0) { $thirdparty_result_fields = array( 'id' => $thirdparty->id, From 907ea1a8bdd253b5f5aa93e981246aee9cab9aed Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 7 May 2021 18:21:11 +0200 Subject: [PATCH 03/12] Fix sql error --- htdocs/compta/bank/class/account.class.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 75738abc3d4..a35fa9e0f14 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -1689,8 +1689,7 @@ class Account extends CommonObject { $sql = "UPDATE ".MAIN_DB_PREFIX."bank_url SET url_id = ".((int) $dest_id)." WHERE url_id = ".((int) $origin_id)." AND type='company'"; - if (!$db->query($sql)) - { + if (! $db->query($sql)) { //if ($ignoreerrors) return true; // TODO Not enough. If there is A-B on kept thirdarty and B-C on old one, we must get A-B-C after merge. Not A-B. //$this->errors = $db->lasterror(); return false; From f5e1cd5fccd7a3bc0602c36de1383141d446da39 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 7 May 2021 18:22:18 +0200 Subject: [PATCH 04/12] Fix phpunit --- test/phpunit/CodingPhpTest.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/phpunit/CodingPhpTest.php b/test/phpunit/CodingPhpTest.php index c18987b8931..847021620bf 100644 --- a/test/phpunit/CodingPhpTest.php +++ b/test/phpunit/CodingPhpTest.php @@ -191,7 +191,8 @@ class CodingPhpTest extends PHPUnit\Framework\TestCase 'multicurrency.class.php', 'productbatch.class.php', 'reception.class.php', - 'societe.class.php' + 'societe.class.php', + 'account.class.php' ))) { // Must must not found $db-> $ok=true; From d04c741a3b40bf6c994930f837bab17f5fd0ba20 Mon Sep 17 00:00:00 2001 From: Alexis LAURIER Date: Sat, 8 May 2021 09:12:17 +0200 Subject: [PATCH 05/12] add payment_fourn delete proper check into security.lib --- htdocs/core/lib/security.lib.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index a9c6435348e..1607f8df28c 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -372,6 +372,9 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f } elseif ($feature == 'salaries') { if (!$user->rights->salaries->delete) $deleteok = 0; + } elseif ($feature == 'payment_supplier') + { + if (!$user->rights->fournisseur->facture->creer) { $deleteok = 0; } } elseif (!empty($feature2)) // This is for permissions on 2 levels { foreach ($feature2 as $subfeature) From e4a430f638046be74b430ef8e591bb7f16a14528 Mon Sep 17 00:00:00 2001 From: Alexis LAURIER Date: Sat, 8 May 2021 10:24:08 +0200 Subject: [PATCH 06/12] add entity check on verif_dispo mod_codeclient_elephant --- htdocs/core/modules/societe/mod_codeclient_elephant.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/modules/societe/mod_codeclient_elephant.php b/htdocs/core/modules/societe/mod_codeclient_elephant.php index 18947732b16..ed1cf31216b 100644 --- a/htdocs/core/modules/societe/mod_codeclient_elephant.php +++ b/htdocs/core/modules/societe/mod_codeclient_elephant.php @@ -330,6 +330,7 @@ class mod_codeclient_elephant extends ModeleThirdPartyCode if ($type == 1) $sql .= " WHERE code_fournisseur = '".$db->escape($code)."'"; else $sql .= " WHERE code_client = '".$db->escape($code)."'"; if ($soc->id > 0) $sql .= " AND rowid <> ".$soc->id; + $sql .= " AND entity IN (".getEntity('societe').")"; $resql = $db->query($sql); if ($resql) From 2fda3b1b46af161950b5e2a5e62553fcec4e475a Mon Sep 17 00:00:00 2001 From: John BOTELLA Date: Sat, 8 May 2021 13:53:20 +0200 Subject: [PATCH 07/12] FIX ; var case On this page $datePrint is not used but $dateprint yes --- htdocs/societe/consumption.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php index 420282c4cef..aad5b004f9b 100644 --- a/htdocs/societe/consumption.php +++ b/htdocs/societe/consumption.php @@ -218,7 +218,7 @@ if ($type_element == 'propal') $where = " WHERE c.fk_soc = s.rowid AND s.rowid = ".$socid; $where.= " AND d.fk_propal = c.rowid"; $where.= " AND c.entity = ".$conf->entity; - $datePrint = 'c.datep'; + $dateprint = 'c.datep'; $doc_number='c.ref'; $thirdTypeSelect='customer'; } From 107374748ea4ef674914fe2f776e52da7cc465ed Mon Sep 17 00:00:00 2001 From: ksar <35605507+ksar-ksar@users.noreply.github.com> Date: Mon, 10 May 2021 15:42:24 +0200 Subject: [PATCH 08/12] FIX #13955 --- htdocs/accountancy/customer/lines.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php index a5c603c2504..e084bdcfc5b 100644 --- a/htdocs/accountancy/customer/lines.php +++ b/htdocs/accountancy/customer/lines.php @@ -197,7 +197,7 @@ $sql .= " AND f.fk_statut > 0"; if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { $sql .= " AND f.type IN (".Facture::TYPE_STANDARD.",".Facture::TYPE_REPLACEMENT.",".Facture::TYPE_CREDIT_NOTE.",".Facture::TYPE_SITUATION.")"; } else { - $sql .= " AND f.type IN (".Facture::TYPE_STANDARD.",".Facture::TYPE_STANDARD.",".Facture::TYPE_CREDIT_NOTE.",".Facture::TYPE_DEPOSIT.",".Facture::TYPE_SITUATION.")"; + $sql .= " AND f.type IN (".Facture::TYPE_STANDARD.",".Facture::TYPE_REPLACEMENT.",".Facture::TYPE_CREDIT_NOTE.",".Facture::TYPE_DEPOSIT.",".Facture::TYPE_SITUATION.")"; } // Add search filter like if ($search_societe) { From 4417792b2f778f725d818eec9612dd44c80866e9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 10 May 2021 21:04:38 +0200 Subject: [PATCH 09/12] Prepare 13.0.3 --- htdocs/filefunc.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index 7a68d2c3099..e6c0ef4a176 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -31,7 +31,7 @@ */ if (!defined('DOL_APPLICATION_TITLE')) define('DOL_APPLICATION_TITLE', 'Dolibarr'); -if (!defined('DOL_VERSION')) define('DOL_VERSION', '13.0.2'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c +if (!defined('DOL_VERSION')) define('DOL_VERSION', '13.0.3'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c if (!defined('EURO')) define('EURO', chr(128)); From 837c828b1dd78c2829e89b0a366e02d4fa1bdf2b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 10 May 2021 21:04:38 +0200 Subject: [PATCH 10/12] Prepare 13.0.3 --- ChangeLog | 57 +++++++++++++++++++++++++++++++++++++++++ htdocs/filefunc.inc.php | 2 +- 2 files changed, 58 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index e685669f01d..972a27bc896 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,63 @@ English Dolibarr ChangeLog -------------------------------------------------------------- +***** ChangeLog for 13.0.3 compared to 13.0.2 ***** + +FIX: 13.0 warning - missing quotes around 'label' +FIX: #16143 Old PG requires "()" on DROP FUNCTION +FIX: #16843 +FIX: #17060 +FIX: #17192 - With tz < 0, event is show in bad day on calendar views +FIX: #17363 +FIX: #17476 releve.php: Fix SQL statement +FIX: Accountancy - Import in general ledger +FIX: Accountancy - Quadra export - wrong data on credit +FIX: Accountancy - Warning on the pages of the preparatory statements of accounting entries +FIX: Add function price2num for rounding values in productAlertStock box +FIX: Add parameter to function price2num() +FIX: Cannot delete a batch material from item receipts +FIX: cast int +FIX: Change parameters MF to MS for price2num() function +FIX: create event from contact card preselect contact correctly +FIX: create sociales : keep values error form +FIX: dol_print_date for %a and %b with some timezone +FIX: email is not case sensitive +FIX: error for duplicate thirdparty found correctly returned by ws +FIX: Espadon PDF shippment model with long public note now wroking +FIX: esupplier order: error 500 when using packaging with product where it is not defined +FIX: Filter on debit/credit +FIX: Filter on supplier payment list +FIX: fix checkbox displayed according to module project setup parameters - work in progress +FIX: inconsistency in margin recording with option "Force to sale price" +FIX: invoice PDF generation after payment +FIX: mask selector fournisseur if module not activate +FIX: merge thirparty also work for bank URL entry +FIX: Missing extrafields into export of agenda record +FIX: missing parameter in select for POP +FIX: missing return edit if update error +FIX: missing token on dolGetButtonAction for action delete +FIX: payment creation: re-generate invoice PDF with correct display options +FIX: payment validation: invoices PDF were no re-generated, make it with correct display options +FIX: Periodicity by default on fiscal year, according to the now date, we have plus 1 year added +FIX: pgsql: prevent 'WHERE 1' +FIX: PHP version requirement in composer.json +FIX: project visibility field with two option +FIX: saving template email +FIX: search accented words in product description (consumption page) +FIX: Search on date in accountancy +FIX: selection of project for reception must use +FIX: shhhhhh ! There is nothing here... +FIX: Show input field checkbox selection +FIX: Show Ref.Supplier in LinkToObjectBlock +FIX: SQL Error show_contacts : socialnetworks +FIX: Start hour on ACCOUNTING_DATE_START_BINDING +FIX: supplier order: error 500 when using packaging with product where it is not defined +FIX: test must be === and not == +FIX: test on link type +FIX: type link extrafield case for advanced target emailing +FIX: Write right on document + + ***** ChangeLog for 13.0.2 compared to 13.0.1 ***** FIX: 11.0 - $this->socid injected in query without checking for empty value diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index 7a68d2c3099..e6c0ef4a176 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -31,7 +31,7 @@ */ if (!defined('DOL_APPLICATION_TITLE')) define('DOL_APPLICATION_TITLE', 'Dolibarr'); -if (!defined('DOL_VERSION')) define('DOL_VERSION', '13.0.2'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c +if (!defined('DOL_VERSION')) define('DOL_VERSION', '13.0.3'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c if (!defined('EURO')) define('EURO', chr(128)); From 8fb474c6873cd23c9361febee6d1d7e56a8dce97 Mon Sep 17 00:00:00 2001 From: atm-lena Date: Tue, 11 May 2021 11:35:54 +0200 Subject: [PATCH 11/12] Add Hook Extrafields Update - init extrafieldssdao --- htdocs/core/class/extrafields.class.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index d657c519650..f37d2e1932c 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -603,6 +603,8 @@ class ExtraFields */ public function update($attrname, $label, $type, $length, $elementtype, $unique = 0, $required = 0, $pos = 0, $param = '', $alwayseditable = 0, $perms = '', $list = '', $help = '', $default = '', $computed = '', $entity = '', $langfile = '', $enabled = '1', $totalizable = 0, $printable = 0) { + global $hookmanager; + if ($elementtype == 'thirdparty') $elementtype = 'societe'; if ($elementtype == 'contact') $elementtype = 'socpeople'; @@ -643,6 +645,18 @@ class ExtraFields } $field_desc = array('type'=>$typedb, 'value'=>$lengthdb, 'null'=>($required ? 'NOT NULL' : 'NULL'), 'default'=>$default); + if (is_object($hookmanager)) + { + $hookmanager->initHooks(array('extrafieldsdao')); + $parameters = array('field_desc'=>&$field_desc, 'table'=>$table, 'attr_name'=>$attrname, 'label'=>$label, 'type'=>$type, 'length'=>$length, 'unique'=>$unique, 'required'=>$required, 'pos'=>$pos, 'param'=>$param, 'alwayseditable'=>$alwayseditable, 'perms'=>$perms, 'list'=>$list, 'help'=>$help, 'default'=>$default, 'computed'=>$computed, 'entity'=>$entity, 'langfile'=>$langfile, 'enabled'=>$enabled, 'totalizable'=>$totalizable, 'printable'=>$printable); + $reshook = $hookmanager->executeHooks('updateExtrafields', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks + + if ($reshook < 0) { + $this->error = $this->db->lasterror(); + return -1; + } + } + if ($type != 'separate') // No table update when separate type { $result = $this->db->DDLUpdateField(MAIN_DB_PREFIX.$table, $attrname, $field_desc); From c2fa19a0b4c4ed66d671c947d02f630644ecfa63 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 11 May 2021 20:15:20 +0200 Subject: [PATCH 12/12] fix phpcs --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 1002216b7cb..dff10e73049 100644 --- a/.travis.yml +++ b/.travis.yml @@ -43,7 +43,7 @@ jobs: include: - if: type = push php: '5.5' - env: DB=postgresql + env: DB=mysql - if: type = pull_request OR type = push php: '7.4' env: DB=mysql