From d92604f6462a803825b93e01fc9fe72d6aff925d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur <eldy@destailleur.fr> Date: Tue, 6 Oct 2015 00:46:26 +0200 Subject: [PATCH] FIX Link of project must be cickable if user has permission to read all projects FIX Missing information into the alt of project picto --- htdocs/core/lib/project.lib.php | 2 +- htdocs/projet/class/project.class.php | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 89d658fa01a..15c4627c4d7 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -348,7 +348,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t $projectstatic->id=$lines[$i]->fk_project; $projectstatic->ref=$lines[$i]->projectref; $projectstatic->public=$lines[$i]->public; - if ($lines[$i]->public || in_array($lines[$i]->fk_project,$projectsArrayId)) print $projectstatic->getNomUrl(1); + if ($lines[$i]->public || in_array($lines[$i]->fk_project,$projectsArrayId) || ! empty($user->rights->projet->all->lire)) print $projectstatic->getNomUrl(1); else print $projectstatic->getNomUrl(1,'nolink'); if ($showlineingray) print '</i>'; print "</td>"; diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 094ae60c59e..68aa963ca8c 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -882,15 +882,17 @@ class Project extends CommonObject $result = ''; $link = ''; $linkend = ''; - $label = '<u>' . $langs->trans("ShowProject") . '</u>'; + $label=''; + if ($option != 'nolink') $label = '<u>' . $langs->trans("ShowProject") . '</u>'; if (! empty($this->ref)) - $label .= '<br><b>' . $langs->trans('Ref') . ':</b> ' . $this->ref; + $label .= ($label?'<br>':'').'<b>' . $langs->trans('Ref') . ': </b>' . $this->ref; // The space must be after the : to not being explode when showing the title in img_picto if (! empty($this->title)) - $label .= '<br><b>' . $langs->trans('Label') . ':</b> ' . $this->title; + $label .= ($label?'<br>':'').'<b>' . $langs->trans('Label') . ': </b>' . $this->title; // The space must be after the : to not being explode when showing the title in img_picto if ($moreinpopup) $label.='<br>'.$moreinpopup; $linkclose = '" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">'; - if ($option != 'nolink') { + if ($option != 'nolink') + { if (preg_match('/\.php$/',$option)) { $link = '<a href="' . dol_buildpath($option,1) . '?id=' . $this->id . $linkclose; $linkend = '</a>'; -- GitLab