Fix linkg to public notes

This commit is contained in:
Laurent Destailleur
2020-01-15 19:49:45 +01:00
parent 28d5901da4
commit 98eda68afb
12 changed files with 112 additions and 38 deletions

View File

@@ -3559,9 +3559,10 @@ class Commande extends CommonOrder
* @param int $short ???
* @param int $notooltip 1=Disable tooltip
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
* @param int $addlinktonotes Add linkt to notes
* @return string String with URL
*/
public function getNomUrl($withpicto = 0, $option = '', $max = 0, $short = 0, $notooltip = 0, $save_lastsearch_value = -1)
public function getNomUrl($withpicto = 0, $option = '', $max = 0, $short = 0, $notooltip = 0, $save_lastsearch_value = -1, $addlinktonotes = 0)
{
global $conf, $langs, $user;
@@ -3628,6 +3629,22 @@ class Commande extends CommonOrder
if ($withpicto != 2) $result .= $this->ref;
$result .= $linkend;
if ($addlinktonotes)
{
$txttoshow = ($user->socid > 0 ? $this->note_public : $this->note_private);
if ($txttoshow)
{
$notetoshow = $langs->trans("ViewPrivateNote").':<br>'.dol_string_nohtmltag($txttoshow, 1);
$result .= ' <span class="note inline-block">';
$result .= '<a href="'.DOL_URL_ROOT.'/commande/note.php?id='.$this->id.'" class="classfortooltip" title="'.dol_escape_htmltag($notetoshow).'">';
$result .= img_picto('', 'note');
$result .= '</a>';
//$result.=img_picto($langs->trans("ViewNote"),'object_generic');
//$result.='</a>';
$result .= '</span>';
}
}
return $result;
}