From ca6a624112235abb2c1bd5272d6ea066118868da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 5 Jun 2019 13:55:47 +0200 Subject: [PATCH 1/6] avoid warning with php 7.2 --- htdocs/core/actions_massactions.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index bebd4b8fbec..9be0e0a4b77 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -44,7 +44,7 @@ if (empty($objectclass) || empty($uploaddir)) // Mass actions. Controls on number of lines checked. $maxformassaction=(empty($conf->global->MAIN_LIMIT_FOR_MASS_ACTIONS)?1000:$conf->global->MAIN_LIMIT_FOR_MASS_ACTIONS); -if (! empty($massaction) && count($toselect) < 1) +if (! empty($massaction) && is_array($toselect) && count($toselect) < 1) { $error++; setEventMessages($langs->trans("NoRecordSelected"), null, "warnings"); From f11db8396aa924036745f97f4cbb9b714eac4c6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 6 Jun 2019 09:49:32 +0200 Subject: [PATCH 2/6] Parameter must be array or object that implements Countable warning with php 7.2 --- htdocs/core/lib/agenda.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index 6dab036193d..94492e9430b 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -469,7 +469,7 @@ function actions_prepare_head($object) $head[$h][0] = DOL_URL_ROOT.'/resource/element_resource.php?element=action&element_id='.$object->id; $listofresourcelinked = $resource->getElementResources($object->element, $object->id); - $nbResources=count($listofresourcelinked); + $nbResources=is_array($listofresourcelinked)?count($listofresourcelinked):0; $head[$h][1] = $langs->trans("Resources"); if ($nbResources > 0) $head[$h][1].= ' '.($nbResources).''; $head[$h][2] = 'resources'; From ad95b66842b4412e83feaf1b752c01ac40162dd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 6 Jun 2019 10:12:01 +0200 Subject: [PATCH 3/6] Warning: A non-numeric value encountered --- htdocs/comm/action/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 8ced2826155..ef58eebaff9 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -7,7 +7,7 @@ * Copyright (C) 2013 Florian Henry * Copyright (C) 2014 Cedric GROSS * Copyright (C) 2015 Alexandre Spangaro - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-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 @@ -268,7 +268,7 @@ if ($action == 'add') $object->datep = $datep; $object->datef = $datef; $object->percentage = $percentage; - $object->duree=((float) (GETPOST('dureehour') * 60) + (float) GETPOST('dureemin')) * 60; + $object->duree=(((int) GETPOST('dureehour') * 60) + (int) GETPOST('dureemin')) * 60; $transparency=(GETPOST("transparency")=='on'?1:0); From c8ab7dee458fdc08dd0c6c5a02ca577c673b25a4 Mon Sep 17 00:00:00 2001 From: atm-josselin Date: Thu, 6 Jun 2019 16:34:44 +0200 Subject: [PATCH 4/6] Display the intervention button only in develop mode --- htdocs/fichinter/card.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 4c1b414122a..a2cdd76c73b 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -1648,11 +1648,10 @@ else if ($id > 0 || ! empty($ref)) } // create intervention model - if ($object->statut == Fichinter::STATUS_DRAFT && $user->rights->ficheinter->creer && (count($object->lines) > 0)) { + if ($conf->global->MAIN_FEATURE_LEVEL >=2 && $object->statut == Fichinter::STATUS_DRAFT && $user->rights->ficheinter->creer && (count($object->lines) > 0)) { print ''; } From b73d287953d44f1d7b0d7c6daf07d73498e165b9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 7 Jun 2019 18:09:43 +0200 Subject: [PATCH 5/6] Update agenda.lib.php --- htdocs/core/lib/agenda.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index 94492e9430b..4326276766b 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -469,7 +469,7 @@ function actions_prepare_head($object) $head[$h][0] = DOL_URL_ROOT.'/resource/element_resource.php?element=action&element_id='.$object->id; $listofresourcelinked = $resource->getElementResources($object->element, $object->id); - $nbResources=is_array($listofresourcelinked)?count($listofresourcelinked):0; + $nbResources=(is_array($listofresourcelinked)?count($listofresourcelinked):0); $head[$h][1] = $langs->trans("Resources"); if ($nbResources > 0) $head[$h][1].= ' '.($nbResources).''; $head[$h][2] = 'resources'; From 0ce2c2aab54bdcbce9582d34c4033f8d41ceb3b0 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Mon, 10 Jun 2019 10:11:26 +0200 Subject: [PATCH 6/6] Fix missing massaction hook params --- htdocs/core/actions_massactions.inc.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 9be0e0a4b77..71c3f98420a 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -1269,9 +1269,10 @@ if (! $error && $massaction == 'generate_doc' && $permtoread) $parameters['toselect']=$toselect; $parameters['uploaddir']=$uploaddir; +$parameters['massaction']=$massaction; +$parameters['diroutputmassaction']=$diroutputmassaction; $reshook=$hookmanager->executeHooks('doMassActions',$parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); -