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); diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index bebd4b8fbec..71c3f98420a 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"); @@ -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'); - diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index 6dab036193d..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=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'; 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 ''; }