diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php
index 432fc888d65..091d20c24d6 100644
--- a/htdocs/projet/card.php
+++ b/htdocs/projet/card.php
@@ -1006,13 +1006,13 @@ if ($action == 'create' && $user->rights->projet->creer) {
$morehtmlref .= dol_escape_htmltag($object->title);
// Thirdparty
$morehtmlref .= '
'.$langs->trans('ThirdParty').' : ';
- if ($object->thirdparty->id > 0) {
+ if (!empty($object->thirdparty->id) && $object->thirdparty->id > 0) {
$morehtmlref .= $object->thirdparty->getNomUrl(1, 'project');
}
$morehtmlref .= '';
// Define a complementary filter for search of next/prev ref.
- if (!$user->rights->projet->all->lire) {
+ if (empty($user->rights->projet->all->lire)) {
$objectsListId = $object->getProjectsAuthorizedForUser($user, 0, 0);
$object->next_prev_filter = " rowid IN (".$db->sanitize(count($objectsListId) ? join(',', array_keys($objectsListId)) : '0').")";
}
diff --git a/htdocs/projet/contact.php b/htdocs/projet/contact.php
index 68d12df3bcd..48f12e23ec4 100644
--- a/htdocs/projet/contact.php
+++ b/htdocs/projet/contact.php
@@ -294,13 +294,13 @@ if ($id > 0 || !empty($ref)) {
// Title
$morehtmlref .= $object->title;
// Thirdparty
- if ($object->thirdparty->id > 0) {
+ if (!empty($object->thirdparty->id) && $object->thirdparty->id > 0) {
$morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'project');
}
$morehtmlref .= '';
// Define a complementary filter for search of next/prev ref.
- if (!$user->rights->projet->all->lire) {
+ if (empty($user->rights->projet->all->lire)) {
$objectsListId = $object->getProjectsAuthorizedForUser($user, 0, 0);
$object->next_prev_filter = " rowid IN (".$db->sanitize(count($objectsListId) ?join(',', array_keys($objectsListId)) : '0').")";
}
diff --git a/htdocs/projet/document.php b/htdocs/projet/document.php
index df31724d07c..9ac87b46084 100644
--- a/htdocs/projet/document.php
+++ b/htdocs/projet/document.php
@@ -134,7 +134,7 @@ if ($object->id > 0) {
// Title
$morehtmlref .= $object->title;
// Thirdparty
- if ($object->thirdparty->id > 0) {
+ if (!empty($object->thirdparty->id) && $object->thirdparty->id > 0) {
$morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'project');
}
$morehtmlref .= '';
diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php
index 252dafddb5d..66288159f39 100644
--- a/htdocs/projet/element.php
+++ b/htdocs/projet/element.php
@@ -164,7 +164,7 @@ if ($id == '' && $ref == '') {
exit();
}
-$mine = $_REQUEST['mode'] == 'mine' ? 1 : 0;
+$mine = (!empty($_REQUEST['mode']) && $_REQUEST['mode'] == 'mine') ? 1 : 0;
//if (! $user->rights->projet->all->lire) $mine=1; // Special for projects
$object = new Project($db);
@@ -216,13 +216,13 @@ $morehtmlref = '
';
// Title
$morehtmlref .= $object->title;
// Thirdparty
-if ($object->thirdparty->id > 0) {
+if (!empty($object->thirdparty->id) && $object->thirdparty->id > 0) {
$morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'project');
}
$morehtmlref .= '
';
// Define a complementary filter for search of next/prev ref.
-if (!$user->rights->projet->all->lire) {
+if (empty($user->rights->projet->all->lire)) {
$objectsListId = $object->getProjectsAuthorizedForUser($user, 0, 0);
$object->next_prev_filter = " te.rowid IN (".$db->sanitize(count($objectsListId) ?join(',', array_keys($objectsListId)) : '0').")";
}
diff --git a/htdocs/projet/note.php b/htdocs/projet/note.php
index 9fee6615c40..3c32bd528a4 100644
--- a/htdocs/projet/note.php
+++ b/htdocs/projet/note.php
@@ -33,7 +33,7 @@ $action = GETPOST('action', 'aZ09');
$id = GETPOST('id', 'int');
$ref = GETPOST('ref', 'alpha');
-$mine = $_REQUEST['mode'] == 'mine' ? 1 : 0;
+$mine = (isset($_REQUEST['mode']) && $_REQUEST['mode'] == 'mine') ? 1 : 0;
//if (! $user->rights->projet->all->lire) $mine=1; // Special for projects
$object = new Project($db);
@@ -100,7 +100,7 @@ if ($id > 0 || !empty($ref)) {
// Title
$morehtmlref .= $object->title;
// Thirdparty
- if ($object->thirdparty->id > 0) {
+ if (!empty($object->thirdparty->id) && $object->thirdparty->id > 0) {
$morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'project');
}
$morehtmlref .= '';
diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php
index 666f7d8343a..80d39cf08d4 100644
--- a/htdocs/projet/tasks.php
+++ b/htdocs/projet/tasks.php
@@ -550,13 +550,13 @@ if ($id > 0 || !empty($ref)) {
// Title
$morehtmlref .= $object->title;
// Thirdparty
- if ($object->thirdparty->id > 0) {
+ if (!empty($object->thirdparty->id) && $object->thirdparty->id > 0) {
$morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'project');
}
$morehtmlref .= '';
// Define a complementary filter for search of next/prev ref.
- if (!$user->rights->projet->all->lire) {
+ if (empty($user->rights->projet->all->lire)) {
$objectsListId = $object->getProjectsAuthorizedForUser($user, 0, 0);
$object->next_prev_filter = " rowid IN (".$db->sanitize(count($objectsListId) ?join(',', array_keys($objectsListId)) : '0').")";
}
diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php
index d171d130a41..4bb5ab8e503 100644
--- a/htdocs/projet/tasks/time.php
+++ b/htdocs/projet/tasks/time.php
@@ -719,7 +719,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) {
$head = project_prepare_head($projectstatic);
print dol_get_fiche_head($head, $tab, $langs->trans("Project"), -1, ($projectstatic->public ? 'projectpub' : 'project'));
- $param = ($mode == 'mine' ? '&mode=mine' : '');
+ $param = ((!empty($mode) && $mode == 'mine') ? '&mode=mine' : '');
// Project card
@@ -729,13 +729,13 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) {
// Title
$morehtmlref .= $projectstatic->title;
// Thirdparty
- if ($projectstatic->thirdparty->id > 0) {
+ if (!empty($projectstatic->thirdparty->id) && $projectstatic->thirdparty->id > 0) {
$morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$projectstatic->thirdparty->getNomUrl(1, 'project');
}
$morehtmlref .= '';
// Define a complementary filter for search of next/prev ref.
- if (!$user->rights->projet->all->lire) {
+ if (empty($user->rights->projet->all->lire)) {
$objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0);
$projectstatic->next_prev_filter = " rowid IN (".$db->sanitize(count($objectsListId) ?join(',', array_keys($objectsListId)) : '0').")";
}