Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2020-02-05 21:47:54 +01:00
commit 0e790bd8fc
2 changed files with 43 additions and 19 deletions

View File

@ -3549,10 +3549,10 @@ class Propal extends CommonObject
* @param string $get_params Parametres added to url * @param string $get_params Parametres added to url
* @param int $notooltip 1=Disable tooltip * @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 $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 * @param int $addlinktonotes -1=Disable, 0=Just add label show notes, 1=Add private note (only internal user), 2=Add public note (internal or external user), 3=Add private (internal user) and public note (internal and external user)
* @return string String with URL * @return string String with URL
*/ */
public function getNomUrl($withpicto = 0, $option = '', $get_params = '', $notooltip = 0, $save_lastsearch_value = -1, $addlinktonotes = 0) public function getNomUrl($withpicto = 0, $option = '', $get_params = '', $notooltip = 0, $save_lastsearch_value = -1, $addlinktonotes = -1)
{ {
global $langs, $conf, $user; global $langs, $conf, $user;
@ -3618,21 +3618,45 @@ class Propal extends CommonObject
if ($withpicto != 2) $result .= $this->ref; if ($withpicto != 2) $result .= $this->ref;
$result .= $linkend; $result .= $linkend;
if ($addlinktonotes) if ($addlinktonotes >= 0) {
{ $txttoshow = '';
$txttoshow = ($user->socid > 0 ? $this->note_public : $this->note_private);
if ($txttoshow) if ($addlinktonotes == 0) {
{ if (!empty($this->note_private) || !empty($this->note_public)) {
$notetoshow = $langs->trans("ViewPrivateNote").':<br>'.dol_string_nohtmltag($txttoshow, 1); $txttoshow = $langs->trans('ViewPrivateNote');
$result .= ' <span class="note inline-block">'; }
$result .= '<a href="'.DOL_URL_ROOT.'/comm/propal/note.php?id='.$this->id.'" class="classfortooltip" title="'.dol_escape_htmltag($notetoshow).'">'; } elseif ($addlinktonotes == 1) {
$result .= img_picto('', 'note'); if (!empty($this->note_private)) {
$result .= '</a>'; $txttoshow .= ($user->socid > 0 ? '' : dol_string_nohtmltag($this->note_private, 1));
//$result.=img_picto($langs->trans("ViewNote"),'object_generic'); }
//$result.='</a>'; } elseif ($addlinktonotes == 2) {
$result .= '</span>'; if (!empty($this->note_public)) {
} $txttoshow .= dol_string_nohtmltag($this->note_public, 1);
} }
} elseif ($addlinktonotes == 3) {
if ($user->socid > 0) {
if (!empty($this->note_public)) {
$txttoshow .= dol_string_nohtmltag($this->note_public, 1);
}
} else {
if (!empty($this->note_public)) {
$txttoshow .= dol_string_nohtmltag($this->note_public, 1);
}
if (!empty($this->note_private)) {
if (!empty($txttoshow)) $txttoshow .= '<br><br>';
$txttoshow .= dol_string_nohtmltag($this->note_private, 1);
}
}
}
if ($txttoshow) {
$result .= ' <span class="note inline-block">';
$result .= '<a href="'.DOL_URL_ROOT.'/comm/propal/note.php?id='.$this->id.'" class="classfortooltip" title="'.dol_escape_htmltag($txttoshow).'">';
$result .= img_picto('', 'note');
$result .= '</a>';
$result .= '</span>';
}
}
return $result; return $result;
} }

View File

@ -776,8 +776,8 @@ if ($resql)
$objectstatic->id = $obj->rowid; $objectstatic->id = $obj->rowid;
$objectstatic->ref = $obj->ref; $objectstatic->ref = $obj->ref;
$objectstatic->note_public = $obj->note_public;
$objectstatic->note_private = $obj->note_private; $objectstatic->note_private = $obj->note_private;
$objectstatic->note_public = $obj->note_public;
$companystatic->id = $obj->socid; $companystatic->id = $obj->socid;
$companystatic->name = $obj->name; $companystatic->name = $obj->name;
@ -798,7 +798,7 @@ if ($resql)
print '<table class="nobordernopadding"><tr class="nocellnopadd">'; print '<table class="nobordernopadding"><tr class="nocellnopadd">';
// Picto + Ref // Picto + Ref
print '<td class="nobordernopadding nowrap">'; print '<td class="nobordernopadding nowrap">';
print $objectstatic->getNomUrl(1, '', '', 0, 1, 1); print $objectstatic->getNomUrl(1, '', '', 0, 1, (isset($conf->global->PROPAL_LIST_SHOW_NOTES) ? $conf->global->PROPAL_LIST_SHOW_NOTES : 1));
print '</td>'; print '</td>';
// Warning // Warning
$warnornote = ''; $warnornote = '';