From 1669d497b43f08143791d81c93cc593be32c45d4 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio Date: Tue, 16 Apr 2019 17:36:03 +0200 Subject: [PATCH 1/5] FIX: actioncomm: sort events by date after external calendars and hook --- htdocs/comm/action/index.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 4a909f1adeb..3145fc649ef 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -1001,6 +1001,11 @@ if (! empty($hookmanager->resArray['eventarray'])) { } } +// Sort events +foreach($eventarray as $keyDate => &$dateeventarray) +{ + usort($dateeventarray, 'sort_events_by_date'); +} $maxnbofchar=0; @@ -1630,3 +1635,22 @@ function dol_color_minus($color, $minus, $minusunit = 16) } return $newcolor; } + + +/** + * Sort events by date + * + * @param object $a Event A + * @param object $b Event B + * @return int < 0 if event A should be before event B, > 0 otherwise, 0 if they have the exact same time slot + */ +function sort_events_by_date($a, $b) +{ + if($a->datep != $b->datep) + { + return $a->datep - $b->datep; + } + + // If both events have the same start time, longest first + return $b->datef - $a->datef; +} \ No newline at end of file From c0defe3965a7b65607d89e3e55b8dc7f162238b1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 16 Apr 2019 23:27:45 +0200 Subject: [PATCH 2/5] Update index.php --- htdocs/comm/action/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 3145fc649ef..358da27b07b 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -1653,4 +1653,4 @@ function sort_events_by_date($a, $b) // If both events have the same start time, longest first return $b->datef - $a->datef; -} \ No newline at end of file +} From 70017da95ac0db4c16ad4041f0bdd5ea5fea28f7 Mon Sep 17 00:00:00 2001 From: atm-greg Date: Wed, 24 Apr 2019 14:59:54 +0200 Subject: [PATCH 3/5] testing if customer invoice module is activated doesn't make sense on supplier commande card... --- htdocs/fourn/commande/card.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index a6629b9bd25..7b3561a0bf0 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -2342,14 +2342,11 @@ elseif (! empty($object->id)) } // Create bill - if (! empty($conf->facture->enabled)) + if (! empty($conf->fournisseur->enabled) && ($object->statut >= 2 && $object->statut != 7 && $object->billed != 1)) // statut 2 means approved, 7 means canceled { - if (! empty($conf->fournisseur->enabled) && ($object->statut >= 2 && $object->statut != 7 && $object->billed != 1)) // statut 2 means approved, 7 means canceled + if ($user->rights->fournisseur->facture->creer) { - if ($user->rights->fournisseur->facture->creer) - { - print ''.$langs->trans("CreateBill").''; - } + print ''.$langs->trans("CreateBill").''; } } From 31897f54ac24b267924f5ced5cc3ce0037daecd1 Mon Sep 17 00:00:00 2001 From: gauthier Date: Thu, 25 Apr 2019 12:37:05 +0200 Subject: [PATCH 4/5] Fix prev situation invoice selection (backport fix 8.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 4efedc2544e..92a999463f8 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3242,7 +3242,7 @@ class Form if ($obj->situation_final != 1) { //Not prov? if (substr($obj->facnumber, 1, 4) != 'PROV') { - if ($selected == $obj->situation_final) { + if ($selected == $obj->rowid) { $opt .= ''; } else { $opt .= ''; From 50b1a54dca17aa67a705eeac0cf18f2403ce74c7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 1 May 2019 14:06:30 +0200 Subject: [PATCH 5/5] FIX Update/delete currency on same languages --- htdocs/admin/multicurrency.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/htdocs/admin/multicurrency.php b/htdocs/admin/multicurrency.php index 467ffffeb41..4e06f7a5edf 100644 --- a/htdocs/admin/multicurrency.php +++ b/htdocs/admin/multicurrency.php @@ -108,9 +108,7 @@ elseif ($action == 'update_currency') { $error = 0; - $submit = GETPOST('submit', 'alpha'); - - if ($submit == $langs->trans('Modify')) + if (GETPOST('updatecurrency', 'alpha')) { $fk_multicurrency = GETPOST('fk_multicurrency', 'int'); $rate = price2num(GETPOST('rate', 'alpha')); @@ -129,7 +127,7 @@ elseif ($action == 'update_currency') } } } - elseif ($submit == $langs->trans('Delete')) + elseif (GETPOST('deletecurrency', 'alpha')) { $fk_multicurrency = GETPOST('fk_multicurrency', 'int'); $currency = new MultiCurrency($db); @@ -357,8 +355,8 @@ foreach ($TCurrency as &$currency) print ''; print '1 '.$conf->currency.' = '; print ' '.$currency->code.' '; - print ' '; - print ''; + print ' '; + print ''; print ''; print '';