From 435b416f939b7d906abb246c711acca8a8d25914 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 24 Feb 2019 11:50:06 +0100 Subject: [PATCH 01/12] fix #10656 --- htdocs/fourn/facture/list.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 98a6956a809..4d2c81dbbfa 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -387,6 +387,7 @@ if (! $search_all) $sql.= " f.total_ht, f.total_ttc, f.total_tva, f.paye, f.fk_statut, f.libelle, f.datec, f.tms,"; $sql.= " f.localtax1, f.localtax2,"; $sql.= ' s.rowid, s.nom, s.email, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur,'; + $sql .= ' p.title,'; $sql.= " typent.code,"; $sql.= " state.code_departement, state.nom,"; $sql.= ' country.code,'; From ca2eba866c641d799f378a834ef99ccd652f9179 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 24 Feb 2019 11:56:17 +0100 Subject: [PATCH 02/12] Update list.php --- htdocs/fourn/facture/list.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 4d2c81dbbfa..4b208a99af7 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -387,11 +387,10 @@ if (! $search_all) $sql.= " f.total_ht, f.total_ttc, f.total_tva, f.paye, f.fk_statut, f.libelle, f.datec, f.tms,"; $sql.= " f.localtax1, f.localtax2,"; $sql.= ' s.rowid, s.nom, s.email, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur,'; - $sql .= ' p.title,'; $sql.= " typent.code,"; $sql.= " state.code_departement, state.nom,"; $sql.= ' country.code,'; - $sql.= " p.rowid, p.ref"; + $sql.= " p.rowid, p.ref, p.title"; foreach ($extrafields->attribute_label as $key => $val) //prevent error with sql_mode=only_full_group_by { From 2ad91213b2dd5c2bcd136b51f8a281f688df6378 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 24 Feb 2019 12:09:57 +0100 Subject: [PATCH 03/12] Update combinations.php --- htdocs/variants/combinations.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/variants/combinations.php b/htdocs/variants/combinations.php index 04f53e55d21..8c8f669c0e0 100644 --- a/htdocs/variants/combinations.php +++ b/htdocs/variants/combinations.php @@ -1,6 +1,7 @@ * Copyright (C) 2017 Laurent Destailleur + * Copyright (C) 2019 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -30,9 +31,9 @@ $langs->load("other"); $var = false; $id = GETPOST('id', 'int'); $valueid = GETPOST('valueid', 'int'); -$ref = GETPOST('ref'); -$weight_impact = (float) GETPOST('weight_impact'); -$price_impact = (float) GETPOST('price_impact'); +$ref = GETPOST('ref', 'alpha'); +$weight_impact = GETPOST('weight_impact', 'alpha'); +$price_impact = GETPOST('price_impact', 'alpha'); $price_impact_percent = (bool) GETPOST('price_impact_percent'); $form = new Form($db); From 46a6bbe62cf7049672d318461a22a8cbc5d553a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 24 Feb 2019 14:16:29 +0100 Subject: [PATCH 04/12] phpcs fix in 9.0 --- htdocs/compta/facture/class/facture.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index fd050297fe5..cab95ff7a97 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1324,7 +1324,7 @@ class Facture extends CommonInvoice $sql.= ', p.code as mode_reglement_code, p.libelle as mode_reglement_libelle'; $sql.= ', c.code as cond_reglement_code, c.libelle as cond_reglement_libelle, c.libelle_facture as cond_reglement_libelle_doc'; $sql.= ', f.fk_incoterms, f.location_incoterms'; - $sql.= ', f.module_source, f.pos_source'; + $sql.= ', f.module_source, f.pos_source'; $sql.= ", i.libelle as libelle_incoterms"; $sql.= ' FROM '.MAIN_DB_PREFIX.'facture as f'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_payment_term as c ON f.fk_cond_reglement = c.rowid'; @@ -1402,7 +1402,7 @@ class Facture extends CommonInvoice $this->libelle_incoterms = $obj->libelle_incoterms; $this->module_source = $obj->module_source; - $this->pos_source = $obj->pos_source; + $this->pos_source = $obj->pos_source; // Multicurrency $this->fk_multicurrency = $obj->fk_multicurrency; From 47f5ff3303393a0a025a791ddf7d695de764463b Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sun, 24 Feb 2019 16:11:52 +0100 Subject: [PATCH 05/12] Fix declare functions2.lib.php for donations API --- htdocs/core/lib/functions2.lib.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index aae70adfb62..faa149305a2 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -2260,6 +2260,9 @@ function getModuleDirForApiClass($module) elseif ($module == 'adherent' || $module == 'members' || $module == 'memberstypes' || $module == 'subscriptions') { $moduledirforclass = 'adherents'; } + elseif ($module == 'don' || $module == 'donations') { + $moduledirforclass = 'don'; + } elseif ($module == 'banque' || $module == 'bankaccounts') { $moduledirforclass = 'compta/bank'; } From c781eeb17d46cfb74b723c81fda1d99e50edf618 Mon Sep 17 00:00:00 2001 From: Cristian Torres Date: Wed, 20 Feb 2019 11:45:07 -0600 Subject: [PATCH 06/12] [FIX] ORDER BY before custom filters for where When filtering data "and cac.libelle" would be appended after ORDER BY --- 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 2324bfad616..86157eb98f6 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_end[$r] .=' ORDER BY ac.datep'; + $this->export_sql_order[$r] .=' ORDER BY ac.datep'; } } From c0be66b5e5c496b4f18ca7df2f62ab617f801735 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 25 Feb 2019 14:55:29 +0100 Subject: [PATCH 07/12] FXI Remove duplicate record before trying to create unique key --- htdocs/install/mysql/migration/8.0.0-9.0.0.sql | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/8.0.0-9.0.0.sql b/htdocs/install/mysql/migration/8.0.0-9.0.0.sql index 8e9d82c5fd1..966058e88d7 100644 --- a/htdocs/install/mysql/migration/8.0.0-9.0.0.sql +++ b/htdocs/install/mysql/migration/8.0.0-9.0.0.sql @@ -266,8 +266,12 @@ CREATE TABLE llx_pos_cash_fence( UPDATE llx_const set name = 'PRELEVEMENT_END_TO_END' where name = 'END_TO_END'; UPDATE llx_const set name = 'PRELEVEMENT_USTRD' where name = 'USTRD'; --- Delete duplicate accounting account not used +-- Delete duplicate accounting account, but only if not used +DROP TABLE tmp_llx_accouting_account; +CREATE TABLE tmp_llx_accouting_account AS SELECT MIN(rowid) as MINID, account_number, entity, fk_pcg_version, count(*) AS NB FROM llx_accounting_account group BY account_number, entity, fk_pcg_version HAVING count(*) >= 2 order by account_number, entity, fk_pcg_version; +--SELECT * from tmp_llx_accouting_account; +DELETE from llx_accounting_account where rowid in (select minid from tmp_llx_accouting_account where minid NOT IN (SELECT fk_code_ventilation from llx_facturedet) AND minid NOT IN (SELECT fk_code_ventilation from llx_facture_fourn_det) AND minid NOT IN (SELECT fk_code_ventilation from llx_expensereport_det)) ALTER TABLE llx_accounting_account DROP INDEX uk_accounting_account; From 1be1ee16709c7ff16ea99868c8e2e32636d760e0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 25 Feb 2019 14:56:28 +0100 Subject: [PATCH 08/12] Remove duplicate record --- htdocs/install/mysql/migration/repair.sql | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/htdocs/install/mysql/migration/repair.sql b/htdocs/install/mysql/migration/repair.sql index 22409441eac..6a2fe099fdd 100755 --- a/htdocs/install/mysql/migration/repair.sql +++ b/htdocs/install/mysql/migration/repair.sql @@ -376,6 +376,16 @@ update llx_bank_url as bu set url_id = (select e.fk_user_author from tmp_bank_ur drop table tmp_bank_url_expense_user; +-- Delete duplicate accounting account, but only if not used +DROP TABLE tmp_llx_accouting_account; +CREATE TABLE tmp_llx_accouting_account AS SELECT MIN(rowid) as MINID, account_number, entity, fk_pcg_version, count(*) AS NB FROM llx_accounting_account group BY account_number, entity, fk_pcg_version HAVING count(*) >= 2 order by account_number, entity, fk_pcg_version; +--SELECT * from tmp_llx_accouting_account; +DELETE from llx_accounting_account where rowid in (select minid from tmp_llx_accouting_account where minid NOT IN (SELECT fk_code_ventilation from llx_facturedet) AND minid NOT IN (SELECT fk_code_ventilation from llx_facture_fourn_det) AND minid NOT IN (SELECT fk_code_ventilation from llx_expensereport_det)) + +ALTER TABLE llx_accounting_account DROP INDEX uk_accounting_account; +ALTER TABLE llx_accounting_account ADD UNIQUE INDEX uk_accounting_account (account_number, entity, fk_pcg_version); + + -- VMYSQL4.1 update llx_projet_task_time set task_datehour = task_date where task_datehour < task_date or task_datehour > DATE_ADD(task_date, interval 1 day); From 3ba69fc93a182ef3bba70256900f753b20fc3b28 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 25 Feb 2019 15:06:55 +0100 Subject: [PATCH 09/12] Fix missing ; after sql request --- htdocs/install/mysql/migration/8.0.0-9.0.0.sql | 2 +- htdocs/install/mysql/migration/repair.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/install/mysql/migration/8.0.0-9.0.0.sql b/htdocs/install/mysql/migration/8.0.0-9.0.0.sql index 966058e88d7..31689120cfc 100644 --- a/htdocs/install/mysql/migration/8.0.0-9.0.0.sql +++ b/htdocs/install/mysql/migration/8.0.0-9.0.0.sql @@ -271,7 +271,7 @@ UPDATE llx_const set name = 'PRELEVEMENT_USTRD' where name = 'USTRD'; DROP TABLE tmp_llx_accouting_account; CREATE TABLE tmp_llx_accouting_account AS SELECT MIN(rowid) as MINID, account_number, entity, fk_pcg_version, count(*) AS NB FROM llx_accounting_account group BY account_number, entity, fk_pcg_version HAVING count(*) >= 2 order by account_number, entity, fk_pcg_version; --SELECT * from tmp_llx_accouting_account; -DELETE from llx_accounting_account where rowid in (select minid from tmp_llx_accouting_account where minid NOT IN (SELECT fk_code_ventilation from llx_facturedet) AND minid NOT IN (SELECT fk_code_ventilation from llx_facture_fourn_det) AND minid NOT IN (SELECT fk_code_ventilation from llx_expensereport_det)) +DELETE from llx_accounting_account where rowid in (select minid from tmp_llx_accouting_account where minid NOT IN (SELECT fk_code_ventilation from llx_facturedet) AND minid NOT IN (SELECT fk_code_ventilation from llx_facture_fourn_det) AND minid NOT IN (SELECT fk_code_ventilation from llx_expensereport_det)); ALTER TABLE llx_accounting_account DROP INDEX uk_accounting_account; diff --git a/htdocs/install/mysql/migration/repair.sql b/htdocs/install/mysql/migration/repair.sql index 6a2fe099fdd..b678cab18b7 100755 --- a/htdocs/install/mysql/migration/repair.sql +++ b/htdocs/install/mysql/migration/repair.sql @@ -380,7 +380,7 @@ drop table tmp_bank_url_expense_user; DROP TABLE tmp_llx_accouting_account; CREATE TABLE tmp_llx_accouting_account AS SELECT MIN(rowid) as MINID, account_number, entity, fk_pcg_version, count(*) AS NB FROM llx_accounting_account group BY account_number, entity, fk_pcg_version HAVING count(*) >= 2 order by account_number, entity, fk_pcg_version; --SELECT * from tmp_llx_accouting_account; -DELETE from llx_accounting_account where rowid in (select minid from tmp_llx_accouting_account where minid NOT IN (SELECT fk_code_ventilation from llx_facturedet) AND minid NOT IN (SELECT fk_code_ventilation from llx_facture_fourn_det) AND minid NOT IN (SELECT fk_code_ventilation from llx_expensereport_det)) +DELETE from llx_accounting_account where rowid in (select minid from tmp_llx_accouting_account where minid NOT IN (SELECT fk_code_ventilation from llx_facturedet) AND minid NOT IN (SELECT fk_code_ventilation from llx_facture_fourn_det) AND minid NOT IN (SELECT fk_code_ventilation from llx_expensereport_det)); ALTER TABLE llx_accounting_account DROP INDEX uk_accounting_account; ALTER TABLE llx_accounting_account ADD UNIQUE INDEX uk_accounting_account (account_number, entity, fk_pcg_version); From 35762c0d4e01b0a940c104be378cf4b387532f9d Mon Sep 17 00:00:00 2001 From: atm-quentin Date: Tue, 26 Feb 2019 10:22:20 +0100 Subject: [PATCH 10/12] add data elem on task list --- htdocs/core/tpl/extrafields_list_print_fields.tpl.php | 7 ++++--- htdocs/core/tpl/extrafields_list_search_title.tpl.php | 2 +- htdocs/projet/tasks/list.php | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php index 6b6d22cf822..739126cd2a8 100644 --- a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php +++ b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php @@ -20,9 +20,10 @@ if (! empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_ { $align=$extrafields->getAlignFlag($key, $extrafieldsobjectkey); print ''; - $tmpkey='options_'.$key; + if ($align) print ' align="'.$align.'"'; + print ' data-key="'.$key.'"'; + print '>'; + $tmpkey='options_'.$key; if (in_array($extrafields->attributes[$extrafieldsobjectkey]['type'][$key], array('date', 'datetime', 'timestamp')) && !is_numeric($obj->$tmpkey)) { $datenotinstring = $obj->$tmpkey; diff --git a/htdocs/core/tpl/extrafields_list_search_title.tpl.php b/htdocs/core/tpl/extrafields_list_search_title.tpl.php index 8020739d5cb..36bdf662b54 100644 --- a/htdocs/core/tpl/extrafields_list_search_title.tpl.php +++ b/htdocs/core/tpl/extrafields_list_search_title.tpl.php @@ -22,7 +22,7 @@ if (! empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_ $sortonfield = "ef.".$key; if (! empty($extrafields->attributes[$extrafieldsobjectkey]['computed'][$key])) $sortonfield=''; if ($extrafields->attributes[$extrafieldsobjectkey]['type'][$key] == 'separate') print ''; - else print getTitleFieldOfList($langs->trans($extralabels[$key]), 0, $_SERVER["PHP_SELF"], $sortonfield, "", $param, ($align?'align="'.$align.'"':''), $sortfield, $sortorder)."\n"; + else print getTitleFieldOfList($langs->trans($extralabels[$key]), 0, $_SERVER["PHP_SELF"], $sortonfield, "", $param, ($align?'align="'.$align.'" data-titlekey="'.$key.'"':'data-titlekey="'.$key.'"'), $sortfield, $sortorder)."\n"; } } } diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index e1a77f0b824..17d4bf60df7 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -625,7 +625,7 @@ while ($i < min($num,$limit)) $userAccess = $projectstatic->restrictedProjectArea($user); // why this ? if ($userAccess >= 0) { - print ''; + print ''; // Ref if (! empty($arrayfields['t.ref']['checked'])) From e0c7c32faed5e10a98616bd6cd8fc12bf9df8ce0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 26 Feb 2019 11:44:16 +0100 Subject: [PATCH 11/12] Fix preselection when key is '0' --- htdocs/core/class/html.form.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index ee0c35ac3a9..bd87fda5799 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6095,7 +6095,7 @@ class Form foreach ($array as $key => $value) { $out.= '