From 7da1b215f36508062c22d12559f8297d2a6c7a1b Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 23 Aug 2017 21:01:14 +0200 Subject: [PATCH 1/3] Fix: avoid error "A non-numeric value encountered" --- htdocs/compta/bank/document.php | 16 +++++++--------- htdocs/core/class/dolgraph.class.php | 5 +++-- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/htdocs/compta/bank/document.php b/htdocs/compta/bank/document.php index 084cddf51cd..befccb3c4d3 100644 --- a/htdocs/compta/bank/document.php +++ b/htdocs/compta/bank/document.php @@ -3,7 +3,7 @@ /* Copyright (C) 2003-2007 Rodolphe Quiedeville * Copyright (C) 2004-2008 Laurent Destailleur * Copyright (C) 2005 Marc Barilley / Ocebo - * Copyright (C) 2005-2011 Regis Houssin + * Copyright (C) 2005-2017 Regis Houssin * * 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 @@ -62,9 +62,7 @@ $result = restrictedArea($user, 'banque', $fieldvalue, 'bank_account', '', '', $sortfield = GETPOST("sortfield", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha'); $page = GETPOST("page", 'int'); -if ($page == -1) { - $page = 0; -} +if (empty($page) || $page == -1) { $page = 0; } $offset = $conf->liste_limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; @@ -122,21 +120,21 @@ if ($id > 0 || !empty($ref)) { $linkback = ''.$langs->trans("BackToList").''; dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); - - + + print '
'; print '
'; - + print ''; print ''; print ''; print "
' . $langs->trans("NbOfAttachedFiles") . '' . count($filearray) . '
' . $langs->trans("TotalSizeOfAttachedFiles") . '' . $totalsize . ' ' . $langs->trans("bytes") . '
\n"; print '
'; - + dol_fiche_end(); - + $modulepart = 'bank'; $permission = $user->rights->banque->modifier; $permtoedit = $user->rights->banque->modifier; diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php index 4fad0149a5b..d603d1b6cc1 100644 --- a/htdocs/core/class/dolgraph.class.php +++ b/htdocs/core/class/dolgraph.class.php @@ -25,7 +25,7 @@ /** * Class to build graphs. - * Usage is: + * Usage is: * $dolgraph=new DolGraph(); * $dolgraph->SetTitle($langs->transnoentities('Tracking_Projects_Pourcent').'
'.$langs->transnoentities('Tracking_IndicatorDefGraph').'%'); * $dolgraph->SetMaxValue(50); @@ -570,6 +570,7 @@ class DolGraph function GetFloorMinValue() { $min = $this->GetMinValueInData(); + if ($min == '') $min=0; if ($min != 0) $min--; $size=dol_strlen(abs(floor($min))); $factor=1; @@ -868,7 +869,7 @@ class DolGraph return; } $this->stringtoshow.='
'."\n"; - + $this->stringtoshow.='