NEW add public and private notes in propal list
This commit is contained in:
parent
4909a21f8a
commit
668bb0cb86
@ -3536,9 +3536,10 @@ class Propal extends CommonObject
|
||||
* @param string $get_params Parametres added to url
|
||||
* @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 -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
|
||||
*/
|
||||
public function getNomUrl($withpicto = 0, $option = '', $get_params = '', $notooltip = 0, $save_lastsearch_value = -1)
|
||||
public function getNomUrl($withpicto = 0, $option = '', $get_params = '', $notooltip = 0, $save_lastsearch_value = -1, $addlinktonotes = -1)
|
||||
{
|
||||
global $langs, $conf, $user;
|
||||
|
||||
@ -3604,6 +3605,46 @@ class Propal extends CommonObject
|
||||
if ($withpicto != 2) $result.= $this->ref;
|
||||
$result .= $linkend;
|
||||
|
||||
if ($addlinktonotes >= 0) {
|
||||
$txttoshow = '';
|
||||
|
||||
if ($addlinktonotes == 0) {
|
||||
if (!empty($this->note_private) || !empty($this->note_public)) {
|
||||
$txttoshow = $langs->trans('ViewPrivateNote');
|
||||
}
|
||||
} elseif ($addlinktonotes == 1) {
|
||||
if (!empty($this->note_private)) {
|
||||
$txttoshow .= ($user->socid > 0 ? '' : dol_string_nohtmltag($this->note_private, 1));
|
||||
}
|
||||
} elseif ($addlinktonotes == 2) {
|
||||
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_private)) {
|
||||
$txttoshow .= dol_string_nohtmltag($this->note_private, 1);
|
||||
}
|
||||
if (!empty($this->note_public)) {
|
||||
if (!empty($txttoshow)) $txttoshow .= '<br />';
|
||||
$txttoshow .= dol_string_nohtmltag($this->note_public, 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;
|
||||
}
|
||||
|
||||
|
||||
@ -273,7 +273,7 @@ $sql.= ' s.rowid as socid, s.nom as name, s.email, s.town, s.zip, s.fk_pays, s.c
|
||||
$sql.= " typent.code as typent_code,";
|
||||
$sql.= " ava.rowid as availability,";
|
||||
$sql.= " state.code_departement as state_code, state.nom as state_name,";
|
||||
$sql.= ' p.rowid, p.entity, p.note_private, p.total_ht, p.tva as total_vat, p.total as total_ttc, p.localtax1, p.localtax2, p.ref, p.ref_client, p.fk_statut, p.fk_user_author, p.datep as dp, p.fin_validite as dfv,p.date_livraison as ddelivery,';
|
||||
$sql.= ' p.rowid, p.entity, p.note_private, p.note_public, p.total_ht, p.tva as total_vat, p.total as total_ttc, p.localtax1, p.localtax2, p.ref, p.ref_client, p.fk_statut, p.fk_user_author, p.datep as dp, p.fin_validite as dfv,p.date_livraison as ddelivery,';
|
||||
$sql.= ' p.datec as date_creation, p.tms as date_update, p.date_cloture as date_cloture,';
|
||||
$sql.= " pr.rowid as project_id, pr.ref as project_ref, pr.title as project_label,";
|
||||
$sql.= ' u.login';
|
||||
@ -764,6 +764,8 @@ if ($resql)
|
||||
|
||||
$objectstatic->id=$obj->rowid;
|
||||
$objectstatic->ref=$obj->ref;
|
||||
$objectstatic->note_private=$obj->note_private;
|
||||
$objectstatic->note_public=$obj->note_public;
|
||||
|
||||
$companystatic->id=$obj->socid;
|
||||
$companystatic->name=$obj->name;
|
||||
@ -784,18 +786,11 @@ if ($resql)
|
||||
print '<table class="nobordernopadding"><tr class="nocellnopadd">';
|
||||
// Picto + Ref
|
||||
print '<td class="nobordernopadding nowrap">';
|
||||
print $objectstatic->getNomUrl(1, '', '', 0, 1);
|
||||
print $objectstatic->getNomUrl(1, '', '', 0, 1, $conf->global->PROPAL_LIST_SHOW_NOTES);
|
||||
print '</td>';
|
||||
// Warning
|
||||
$warnornote='';
|
||||
if ($obj->fk_statut == 1 && $db->jdate($obj->dfv) < ($now - $conf->propal->cloture->warning_delay)) $warnornote.=img_warning($langs->trans("Late"));
|
||||
if (! empty($obj->note_private))
|
||||
{
|
||||
$warnornote.=($warnornote?' ':'');
|
||||
$warnornote.= '<span class="note">';
|
||||
$warnornote.= '<a href="note.php?id='.$obj->rowid.'">'.img_picto($langs->trans("ViewPrivateNote"), 'object_generic').'</a>';
|
||||
$warnornote.= '</span>';
|
||||
}
|
||||
if ($warnornote)
|
||||
{
|
||||
print '<td style="min-width: 20px" class="nobordernopadding nowrap">';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user