From adc78296aa7eae9745cfa90b089a067b23b08995 Mon Sep 17 00:00:00 2001 From: arnaud Date: Mon, 11 Sep 2017 16:56:50 +0200 Subject: [PATCH 1/2] FIX time.php crashed without project id in param --- htdocs/projet/tasks/time.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 74ec47549a2..72ad74df871 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -442,7 +442,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) else $object->next_prev_filter=" fk_projet = ".$projectstatic->id; $morehtmlref=''; - + // Project if (empty($withproject)) { @@ -450,10 +450,12 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) $morehtmlref.=$langs->trans("Project").': '; $morehtmlref.=$projectstatic->getNomUrl(1); $morehtmlref.='
'; - + // Third party - $morehtmlref.=$langs->trans("ThirdParty").': '; - $morehtmlref.=$projectstatic->thirdparty->getNomUrl(1); + $morehtmlref.=$langs->trans("ThirdParty").': '; + if (!empty($projectstatic->thirdparty)) { + $morehtmlref.=$projectstatic->thirdparty->getNomUrl(1); + } $morehtmlref.=''; } From 14d000f011d879f0af7cf0ee221d906c2c409baf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 Sep 2017 12:01:32 +0200 Subject: [PATCH 2/2] Update time.php --- htdocs/projet/tasks/time.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 72ad74df871..8b85c299fdc 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -453,7 +453,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) // Third party $morehtmlref.=$langs->trans("ThirdParty").': '; - if (!empty($projectstatic->thirdparty)) { + if (is_object($projectstatic->thirdparty)) { $morehtmlref.=$projectstatic->thirdparty->getNomUrl(1); } $morehtmlref.=''; @@ -464,7 +464,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) print '
'; print '
'; - print '
'; + print '
'; print ''; // Date start - Date end