Fix phpcs

This commit is contained in:
Laurent Destailleur 2020-05-20 23:25:10 +02:00
parent 6f52c62f2a
commit 650bddde0d

View File

@ -1047,76 +1047,79 @@ class Project extends CommonObject
if ($option != 'nolink') $label = '<u>'.$langs->trans("ShowProject").'</u>'; if ($option != 'nolink') $label = '<u>'.$langs->trans("ShowProject").'</u>';
$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 $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
$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 $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 (!empty($this->thirdparty_name)) if (!empty($this->thirdparty_name)) {
$label .= ($label ? '<br>' : '').'<b>'.$langs->trans('ThirdParty').': </b>'.$this->thirdparty_name; // The space must be after the : to not being explode when showing the title in img_picto $label .= ($label ? '<br>' : '').'<b>'.$langs->trans('ThirdParty').': </b>'.$this->thirdparty_name; // The space must be after the : to not being explode when showing the title in img_picto
if (!empty($this->dateo)) }
$label .= ($label ? '<br>' : '').'<b>'.$langs->trans('DateStart').': </b>'.dol_print_date($this->dateo, 'day'); // The space must be after the : to not being explode when showing the title in img_picto if (!empty($this->dateo)) {
if (!empty($this->datee)) $label .= ($label ? '<br>' : '').'<b>'.$langs->trans('DateStart').': </b>'.dol_print_date($this->dateo, 'day'); // The space must be after the : to not being explode when showing the title in img_picto
$label .= ($label ? '<br>' : '').'<b>'.$langs->trans('DateEnd').': </b>'.dol_print_date($this->datee, 'day'); // The space must be after the : to not being explode when showing the title in img_picto }
if ($moreinpopup) $label .= '<br>'.$moreinpopup; if (!empty($this->datee)) {
$label .= ($label ? '<br>' : '').'<b>'.$langs->trans('DateEnd').': </b>'.dol_print_date($this->datee, 'day'); // The space must be after the : to not being explode when showing the title in img_picto
}
if ($moreinpopup) $label .= '<br>'.$moreinpopup;
$url = ''; $url = '';
if ($option != 'nolink') if ($option != 'nolink')
{ {
if (preg_match('/\.php$/', $option)) { if (preg_match('/\.php$/', $option)) {
$url = dol_buildpath($option, 1).'?id='.$this->id; $url = dol_buildpath($option, 1).'?id='.$this->id;
} }
elseif ($option == 'task') elseif ($option == 'task')
{ {
$url = DOL_URL_ROOT.'/projet/tasks.php?id='.$this->id; $url = DOL_URL_ROOT.'/projet/tasks.php?id='.$this->id;
} }
else else
{ {
$url = DOL_URL_ROOT.'/projet/card.php?id='.$this->id; $url = DOL_URL_ROOT.'/projet/card.php?id='.$this->id;
} }
// Add param to save lastsearch_values or not // Add param to save lastsearch_values or not
$add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0); $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
if ($save_lastsearch_value == -1 && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) $add_save_lastsearch_values = 1; if ($save_lastsearch_value == -1 && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) $add_save_lastsearch_values = 1;
if ($add_save_lastsearch_values) $url .= '&save_lastsearch_values=1'; if ($add_save_lastsearch_values) $url .= '&save_lastsearch_values=1';
} }
$linkclose = ''; $linkclose = '';
if (empty($notooltip) && $user->rights->projet->lire) if (empty($notooltip) && $user->rights->projet->lire)
{ {
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
{ {
$label = $langs->trans("ShowProject"); $label = $langs->trans("ShowProject");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
} }
$linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"'; $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
$linkclose .= ' class="classfortooltip"'; $linkclose .= ' class="classfortooltip"';
/* /*
$hookmanager->initHooks(array('projectdao')); $hookmanager->initHooks(array('projectdao'));
$parameters=array('id'=>$this->id); $parameters=array('id'=>$this->id);
// Note that $action and $object may have been modified by some hooks // Note that $action and $object may have been modified by some hooks
$reshook=$hookmanager->executeHooks('getnomurltooltip',$parameters,$this,$action); $reshook=$hookmanager->executeHooks('getnomurltooltip',$parameters,$this,$action);
if ($reshook > 0) if ($reshook > 0)
$linkclose = $hookmanager->resPrint; $linkclose = $hookmanager->resPrint;
*/ */
} }
$picto = 'projectpub'; $picto = 'projectpub';
if (!$this->public) $picto = 'project'; if (!$this->public) $picto = 'project';
$linkstart = '<a href="'.$url.'"'; $linkstart = '<a href="'.$url.'"';
$linkstart .= $linkclose.'>'; $linkstart .= $linkclose.'>';
$linkend = '</a>'; $linkend = '</a>';
$result .= $linkstart; $result .= $linkstart;
if ($withpicto) $result .= img_object(($notooltip ? '' : $label), $picto, ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1); if ($withpicto) $result .= img_object(($notooltip ? '' : $label), $picto, ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
if ($withpicto != 2) $result .= $this->ref; if ($withpicto != 2) $result .= $this->ref;
$result .= $linkend; $result .= $linkend;
if ($withpicto != 2) $result .= (($addlabel && $this->title) ? $sep.dol_trunc($this->title, ($addlabel > 1 ? $addlabel : 0)) : ''); if ($withpicto != 2) $result .= (($addlabel && $this->title) ? $sep.dol_trunc($this->title, ($addlabel > 1 ? $addlabel : 0)) : '');
global $action; global $action;
$hookmanager->initHooks(array('projectdao')); $hookmanager->initHooks(array('projectdao'));
$parameters = array('id'=>$this->id, 'getnomurl'=>$result); $parameters = array('id'=>$this->id, 'getnomurl'=>$result);
$reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook > 0) $result = $hookmanager->resPrint; if ($reshook > 0) $result = $hookmanager->resPrint;
else $result .= $hookmanager->resPrint; else $result .= $hookmanager->resPrint;
return $result; return $result;
} }
/** /**