From 0f51aa15d867b5c4a1235966b5e6f767d36f5f35 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 10 Jan 2018 10:52:30 +0100 Subject: [PATCH] Fix: avoid Warning: A non-numeric value encountered --- htdocs/contact/document.php | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/htdocs/contact/document.php b/htdocs/contact/document.php index da8ef616a4f..eb66ae21a4f 100644 --- a/htdocs/contact/document.php +++ b/htdocs/contact/document.php @@ -58,9 +58,7 @@ $result = restrictedArea($user, 'contact', $id, 'socpeople&societe', '', '', 'ro $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); -if ($page == -1) { - $page = 0; -} +if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 $offset = $conf->liste_limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; @@ -108,7 +106,7 @@ if ($object->id) } $linkback = ''.$langs->trans("BackToList").''; - + $morehtmlref='
'; if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) { @@ -120,11 +118,11 @@ if ($object->id) else $morehtmlref.=$langs->trans("ContactNotLinkedToCompany"); } $morehtmlref.='
'; - + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref); - + print '
'; - + print '
'; print ''; @@ -147,7 +145,7 @@ if ($object->id) print ''; } }*/ - + // Civility print '
'.$langs->trans("UserTitle").''; print $object->getCivilityLabel(); @@ -160,7 +158,7 @@ if ($object->id) print ''; dol_fiche_end(); - + $modulepart = 'contact'; $permission = $user->rights->societe->contact->creer; $permtoedit = $user->rights->societe->contact->creer;