From cb2c1f3ecef1537f40617b4c2796b2a5a7c5f923 Mon Sep 17 00:00:00 2001 From: atm-lena Date: Wed, 16 Dec 2020 10:54:32 +0100 Subject: [PATCH 1/8] FIX Facture Situation Out : status condition --- htdocs/compta/facture/card.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index fb5f7a6ac98..aa07de4867e 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -2534,7 +2534,7 @@ if (empty($reshook)) { $object->fetch($id, '', '', '', true); - if ($object->statut == Facture::STATUS_VALIDATED + if (in_array($object->statut, array(Facture::STATUS_CLOSED, Facture::STATUS_VALIDATED)) && $object->type == Facture::TYPE_SITUATION && $usercancreate && !$objectidnext @@ -3872,7 +3872,7 @@ elseif ($id > 0 || !empty($ref)) $label = $langs->trans("ConfirmOuting"); $formquestion = array(); // remove situation from cycle - if ($object->statut == Facture::STATUS_VALIDATED + if (in_array($object->statut, array(Facture::STATUS_CLOSED, Facture::STATUS_VALIDATED)) && $usercancreate && !$objectidnext && $object->is_last_in_cycle() @@ -5387,7 +5387,7 @@ elseif ($id > 0 || !empty($ref)) } // Remove situation from cycle - if ($object->statut > Facture::STATUS_DRAFT + if (in_array($object->statut, array(Facture::STATUS_CLOSED, Facture::STATUS_VALIDATED)) && $object->type == Facture::TYPE_SITUATION && $usercancreate && !$objectidnext From 10ac74162e71e9463883feb46293e74c18ad4e17 Mon Sep 17 00:00:00 2001 From: Haldarys <49756127+Haldarys@users.noreply.github.com> Date: Thu, 17 Dec 2020 10:19:21 +0100 Subject: [PATCH 2/8] Fix PRELEVEMENT_ADDDAYS check If we used a positive value in PRELEVEMENT_ADDDAYS it couldn't submit the changes to database --- htdocs/admin/prelevement.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/htdocs/admin/prelevement.php b/htdocs/admin/prelevement.php index 144ec744d41..2f942410787 100644 --- a/htdocs/admin/prelevement.php +++ b/htdocs/admin/prelevement.php @@ -92,11 +92,10 @@ if ($action == "set") if (! $res > 0) $error++; } - if (GETPOST("PRELEVEMENT_ADDDAYS") || GETPOST("PRELEVEMENT_ADDDAYS")=="") - { - $res = dolibarr_set_const($db, "PRELEVEMENT_ADDDAYS", GETPOST("PRELEVEMENT_ADDDAYS"), 'chaine', 0, '', $conf->entity); - if (! $res > 0) $error++; - } elseif (! $error) + $res = dolibarr_set_const($db, "PRELEVEMENT_ADDDAYS", GETPOST("PRELEVEMENT_ADDDAYS"), 'chaine', 0, '', $conf->entity); + if (! $res > 0) $error++; + + if (! $error) { $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); From 36d6b472ce90480130bcece86d3ba7448c9fb855 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 17 Dec 2020 13:52:03 +0100 Subject: [PATCH 3/8] Update prelevement.php --- htdocs/admin/prelevement.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/admin/prelevement.php b/htdocs/admin/prelevement.php index 2f942410787..4fba501b305 100644 --- a/htdocs/admin/prelevement.php +++ b/htdocs/admin/prelevement.php @@ -250,9 +250,10 @@ print ''; //ADDDAYS print ''.$langs->trans("ADDDAYS").''; print ''; -if (! $conf->global->PRELEVEMENT_ADDDAYS) $conf->global->PRELEVEMENT_ADDDAYS=0; +if (empty($conf->global->PRELEVEMENT_ADDDAYS)) $conf->global->PRELEVEMENT_ADDDAYS=0; print ''; print ''; + print ''; print '
'; From 27542ed8ed6f19924106e01789a67ec37738c6a0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 17 Dec 2020 13:53:09 +0100 Subject: [PATCH 4/8] Update prelevement.php --- htdocs/admin/prelevement.php | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/htdocs/admin/prelevement.php b/htdocs/admin/prelevement.php index 4fba501b305..122ec26f1c6 100644 --- a/htdocs/admin/prelevement.php +++ b/htdocs/admin/prelevement.php @@ -74,34 +74,31 @@ if ($action == "set") else $error++; $res = dolibarr_set_const($db, "PRELEVEMENT_ICS", GETPOST("PRELEVEMENT_ICS"), 'chaine', 0, '', $conf->entity); - if (! $res > 0) $error++; + if (! ($res > 0)) $error++; if (GETPOST("PRELEVEMENT_USER") > 0) { $res = dolibarr_set_const($db, "PRELEVEMENT_USER", GETPOST("PRELEVEMENT_USER"), 'chaine', 0, '', $conf->entity); - if (! $res > 0) $error++; + if (! ($res > 0)) $error++; } if (GETPOST("PRELEVEMENT_END_TO_END") || GETPOST("PRELEVEMENT_END_TO_END")=="") { $res = dolibarr_set_const($db, "PRELEVEMENT_END_TO_END", GETPOST("PRELEVEMENT_END_TO_END"), 'chaine', 0, '', $conf->entity); - if (! $res > 0) $error++; + if (! ($res > 0)) $error++; } if (GETPOST("PRELEVEMENT_USTRD") || GETPOST("PRELEVEMENT_USTRD")=="") { $res = dolibarr_set_const($db, "PRELEVEMENT_USTRD", GETPOST("PRELEVEMENT_USTRD"), 'chaine', 0, '', $conf->entity); - if (! $res > 0) $error++; + if (! ($res > 0)) $error++; } $res = dolibarr_set_const($db, "PRELEVEMENT_ADDDAYS", GETPOST("PRELEVEMENT_ADDDAYS"), 'chaine', 0, '', $conf->entity); - if (! $res > 0) $error++; + if (! ($res > 0)) $error++; - if (! $error) - { + if (! $error) { $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else - { + } else { $db->rollback(); setEventMessages($langs->trans("Error"), null, 'errors'); } From 73dfa7d44a115b153b4b421e23ba6ae5da2c769d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 17 Dec 2020 14:37:02 +0100 Subject: [PATCH 5/8] Try a better fix for #15770 --- htdocs/product/price.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 12029ea7cdc..dd56aa42318 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -1457,11 +1457,11 @@ if ((empty($conf->global->PRODUIT_CUSTOMER_PRICES) || $action == 'showlog_defaul // Il doit au moins y avoir la ligne de prix initial. // On l'ajoute donc pour remettre a niveau (pb vieilles versions) - //$object->updatePrice($object->price, $object->price_base_type, $user, $object->tva_tx, $object->price_min); + // We emulate the change of the price from interface with the same value than the one into table llx_product if (!empty($conf->global->PRODUIT_MULTIPRICES)) { - $object->updatePrice($object->multiprices[1], $object->multiprices_base_type[1], $user, (empty($object->multiprices_tva_tx[1]) ? 0 : $object->multiprices_tva_tx[1]), $object->multiprices_min[1], 1); + $object->updatePrice(($object->multiprices_base_type[1] == 'TTC' ? $object->multiprices_ttc[1] : $object->multiprices[1]), $object->multiprices_base_type[1], $user, (empty($object->multiprices_tva_tx[1]) ? 0 : $object->multiprices_tva_tx[1]), ($object->multiprices_base_type[1] == 'TTC' ? $object->multiprices_min_ttc[1] : $object->multiprices_min[1]), 1); } else { - $object->updatePrice($object->price, $object->price_base_type, $user, $object->tva_tx, $object->price_min); + $object->updatePrice(($object->price_base_type == 'TTC' ? $object->price_ttc : $object->price), $object->price_base_type, $user, $object->tva_tx, ($object->price_base_type == 'TTC' ? $object->price_min_ttc : $object->price_min)); } $result = $db->query($sql); From b5db5f7474fc8f7fff3e044236cf05beb28f747f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 17 Dec 2020 21:11:44 +0100 Subject: [PATCH 6/8] Better responsive --- htdocs/theme/eldy/global.inc.php | 18 ++++++++++++++++++ htdocs/theme/md/dropdown.inc.php | 19 +++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 3bd0e560ce5..e5db84f9719 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -6471,6 +6471,24 @@ div.tabsElem a.tab { } } +@media only screen and (max-width: 320px) +{ + .dropdown dd ul { + max-width: 270px; /* must always be 50 slower than width */ + } +} +@media only screen and (max-width: 300px) +{ + .dropdown dd ul { + max-width: 250px; + } +} +@media only screen and (max-width: 280px) +{ + .dropdown dd ul { + max-width: 230px; + } +} Date: Thu, 17 Dec 2020 21:41:39 +0100 Subject: [PATCH 7/8] Better fix select2 bug https://github.com/select2/select2/issues/5832 --- dev/dolibarr_changes.txt | 2 +- htdocs/includes/jquery/plugins/select2/dist/css/select2.css | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dev/dolibarr_changes.txt b/dev/dolibarr_changes.txt index cdb0999e53f..ecd25ce692b 100644 --- a/dev/dolibarr_changes.txt +++ b/dev/dolibarr_changes.txt @@ -320,7 +320,7 @@ SELECT2 Edit CSS to restore line removed between 4.0.5 and 4.0.6. It generates this bug: https://github.com/select2/select2/issues/5832 .select2-hidden-accessible { - margin: -1px !important; /* line to restore */ + margin: -10000px !important; /* line to restore */ } diff --git a/htdocs/includes/jquery/plugins/select2/dist/css/select2.css b/htdocs/includes/jquery/plugins/select2/dist/css/select2.css index c4c42ea3cc6..eb341de9d83 100644 --- a/htdocs/includes/jquery/plugins/select2/dist/css/select2.css +++ b/htdocs/includes/jquery/plugins/select2/dist/css/select2.css @@ -121,7 +121,7 @@ -webkit-clip-path: inset(50%) !important; clip-path: inset(50%) !important; height: 1px !important; - margin: -1px !important; + margin: -10000px !important; overflow: hidden !important; padding: 0 !important; position: absolute !important; From f10c69680c370f4ff6c580074188d8f045e4872a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 17 Dec 2020 21:42:10 +0100 Subject: [PATCH 8/8] Ajax combo at a better place (after select) --- htdocs/core/class/html.form.class.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 450ed7364ca..cd808157045 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6191,12 +6191,6 @@ class Form $resql = $this->db->query($sql); if ($resql) { - if (!$forcecombo) - { - include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; - $out .= ajax_combobox($htmlname, null, $conf->global->$confkeyforautocompletemode); - } - // Construct $out and $outarray $out .= ''."\n"; + + if (!$forcecombo) + { + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; + $out .= ajax_combobox($htmlname, null, $conf->global->$confkeyforautocompletemode); + } } else {