Fix look and feel v11

This commit is contained in:
Laurent Destailleur 2020-01-20 12:39:25 +01:00
parent 18f2b09fb1
commit 5f64531e9b
3 changed files with 52 additions and 23 deletions

View File

@ -226,7 +226,7 @@ if ($object->id > 0)
print '<div class="fichehalfleft">';
print '<div class="underbanner clearboth"></div>';
print '<table class="border centpercent">';
print '<table class="border centpercent tableforfield">';
// Type
print '<tr><td class="titlefield">'.$langs->trans('Type').'</td><td colspan="3">';
@ -282,7 +282,7 @@ if ($object->id > 0)
// Date invoice
print '<tr><td>';
print '<table class="nobordernopadding" width="100%"><tr><td>';
print '<table class="nobordernopadding centpercent"><tr><td>';
print $langs->trans('DateInvoice');
print '</td>';
if ($object->type != Facture::TYPE_CREDIT_NOTE && $action != 'editinvoicedate' && !empty($object->brouillon) && $user->rights->facture->creer) print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editinvoicedate&amp;id='.$object->id.'">'.img_edit($langs->trans('SetDate'), 1).'</a></td>';
@ -309,7 +309,7 @@ if ($object->id > 0)
// Payment condition
print '<tr><td>';
print '<table class="nobordernopadding" width="100%"><tr><td>';
print '<table class="nobordernopadding centpercent"><tr><td>';
print $langs->trans('PaymentConditionsShort');
print '</td>';
if ($object->type != Facture::TYPE_CREDIT_NOTE && $action != 'editconditions' && !empty($object->brouillon) && $user->rights->facture->creer) print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editconditions&amp;id='.$object->id.'">'.img_edit($langs->trans('SetConditions'), 1).'</a></td>';
@ -334,7 +334,7 @@ if ($object->id > 0)
// Date payment term
print '<tr><td>';
print '<table class="nobordernopadding" width="100%"><tr><td>';
print '<table class="nobordernopadding centpercent"><tr><td>';
print $langs->trans('DateMaxPayment');
print '</td>';
if ($object->type != Facture::TYPE_CREDIT_NOTE && $action != 'editpaymentterm' && !empty($object->brouillon) && $user->rights->facture->creer) print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editpaymentterm&amp;id='.$object->id.'">'.img_edit($langs->trans('SetDate'), 1).'</a></td>';
@ -362,7 +362,7 @@ if ($object->id > 0)
// Payment mode
print '<tr><td>';
print '<table class="nobordernopadding" width="100%"><tr><td>';
print '<table class="nobordernopadding centpercent"><tr><td>';
print $langs->trans('PaymentMode');
print '</td>';
if ($action != 'editmode' && !empty($object->brouillon) && $user->rights->facture->creer) print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmode&amp;id='.$object->id.'">'.img_edit($langs->trans('SetMode'), 1).'</a></td>';
@ -409,7 +409,7 @@ if ($object->id > 0)
print '<div class="ficheaddleft">';
print '<div class="underbanner clearboth"></div>';
print '<table class="border centpercent">';
print '<table class="border centpercent tableforfield">';
if (!empty($conf->multicurrency->enabled) && ($object->multicurrency_code != $conf->currency))
{

View File

@ -306,7 +306,7 @@ if ($action == 'create' || $object->fetch($id, $ref) > 0)
print $formconfirm;
$linkback = '<a href="'.DOL_URL_ROOT.'/resource/list.php'.(!empty($socid) ? '?id='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
$linkback = '<a href="'.DOL_URL_ROOT.'/resource/list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&id='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
$morehtmlref = '<div class="refidno">';

View File

@ -938,29 +938,58 @@ class Dolresource extends CommonObject
/**
* Return clicable link of object (with eventually picto)
*
* @param int $withpicto Add picto into link
* @param string $option Where point the link ('compta', 'expedition', 'document', ...)
* @param string $get_params Parametres added to url
* @param int $notooltip 1=Disable tooltip
* @return string String with URL
* @param int $withpicto Add picto into link
* @param string $option Where point the link ('compta', 'expedition', 'document', ...)
* @param string $get_params Parametres added to url
* @param int $notooltip 1=Disable tooltip
* @param string $morecss Add more css on link
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
* @return string String with URL
*/
public function getNomUrl($withpicto = 0, $option = '', $get_params = '', $notooltip = 0)
public function getNomUrl($withpicto = 0, $option = '', $get_params = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1)
{
global $langs;
$result = '';
$label = $langs->trans("ShowResource").': '.$this->ref;
$linkstart = '';
$linkend = '';
if ($option == '')
{
$linkstart = '<a href="'.dol_buildpath('/resource/card.php', 1).'?id='.$this->id.$get_params.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$picto = 'resource';
$label = $langs->trans("ShowResource").': '.$this->ref;
$linkend = '</a>';
$label = '<u>'.$langs->trans("ShowResource").'</u>';
$label .= '<br>';
$label .= '<b>'.$langs->trans('Ref').':</b> '.$this->ref;
/*if (isset($this->status)) {
$label.= '<br><b>' . $langs->trans("Status").":</b> ".$this->getLibStatut(5);
}*/
if (isset($this->type_label)) {
$label.= '<br><b>' . $langs->trans("ResourceType").":</b> ".$this->type_label;
}
$url = DOL_URL_ROOT.'/resource/card.php?id='.$this->id;
if ($option != 'nolink')
{
// Add param to save lastsearch_values or not
$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 ($add_save_lastsearch_values) $url .= '&save_lastsearch_values=1';
}
$linkclose = '';
if (empty($notooltip))
{
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
{
$label = $langs->trans("ShowMyObject");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
}
$linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
$linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"';
}
else $linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
$linkstart = '<a href="'.$url.$get_params.'"';
$linkstart .= $linkclose.'>';
$linkend = '</a>';
/*$linkstart = '<a href="'.dol_buildpath('/resource/card.php', 1).'?id='.$this->id.$get_params.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$linkend = '</a>';*/
$result .= $linkstart;
if ($withpicto) $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
if ($withpicto != 2) $result .= $this->ref;