diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php
index 4c2cd368aac..f212c4efbdf 100644
--- a/htdocs/commande/class/commande.class.php
+++ b/htdocs/commande/class/commande.class.php
@@ -3456,60 +3456,60 @@ class Commande extends CommonOrder
if (!$user->rights->commande->lire)
$option = 'nolink';
- if ($option !== 'nolink')
+ 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';
+ }
+
+ if ($short) return $url;
+
+ $label = '';
+
+ if ($user->rights->commande->lire) {
+ $label = ''.$langs->trans("ShowOrder").'';
+ $label .= '
'.$langs->trans('Ref').': '.$this->ref;
+ $label .= '
'.$langs->trans('RefCustomer').': '.($this->ref_customer ? $this->ref_customer : $this->ref_client);
+ if (!empty($this->total_ht)) {
+ $label .= '
'.$langs->trans('AmountHT').': '.price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency);
+ }
+ if (!empty($this->total_tva)) {
+ $label .= '
'.$langs->trans('VAT').': '.price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency);
+ }
+ if (!empty($this->total_ttc)) {
+ $label .= '
'.$langs->trans('AmountTTC').': '.price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency);
+ }
+ }
+
+ $linkclose='';
+ if (empty($notooltip) && $user->rights->commande->lire)
+ {
+ if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
{
- // 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';
+ $label=$langs->trans("ShowOrder");
+ $linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"';
}
+ $linkclose.= ' title="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose.=' class="classfortooltip"';
+ }
- if ($short) return $url;
+ $linkstart = '';
+ $linkend='';
- $label = '';
+ if ($option === 'nolink') {
+ $linkstart = '';
+ $linkend = '';
+ }
- if ($user->rights->commande->lire) {
- $label = ''.$langs->trans("ShowOrder").'';
- $label .= '
'.$langs->trans('Ref').': '.$this->ref;
- $label .= '
'.$langs->trans('RefCustomer').': '.($this->ref_customer ? $this->ref_customer : $this->ref_client);
- if (!empty($this->total_ht)) {
- $label .= '
'.$langs->trans('AmountHT').': '.price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency);
- }
- if (!empty($this->total_tva)) {
- $label .= '
'.$langs->trans('VAT').': '.price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency);
- }
- if (!empty($this->total_ttc)) {
- $label .= '
'.$langs->trans('AmountTTC').': '.price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency);
- }
- }
+ $result .= $linkstart;
+ if ($withpicto) $result.=img_object(($notooltip?'':$label), $this->picto, ($notooltip?(($withpicto != 2) ? 'class="paddingright"' : ''):'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip?0:1);
+ if ($withpicto != 2) $result.= $this->ref;
+ $result .= $linkend;
- $linkclose='';
- if (empty($notooltip) && $user->rights->commande->lire)
- {
- if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
- {
- $label=$langs->trans("ShowOrder");
- $linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"';
- }
- $linkclose.= ' title="'.dol_escape_htmltag($label, 1).'"';
- $linkclose.=' class="classfortooltip"';
- }
-
- $linkstart = '';
- $linkend='';
-
- if ($option === 'nolink') {
- $linkstart = '';
- $linkend = '';
- }
-
- $result .= $linkstart;
- if ($withpicto) $result.=img_object(($notooltip?'':$label), $this->picto, ($notooltip?(($withpicto != 2) ? 'class="paddingright"' : ''):'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip?0:1);
- if ($withpicto != 2) $result.= $this->ref;
- $result .= $linkend;
-
- return $result;
+ return $result;
}
diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php
index da0d66b2784..395d8b24c38 100644
--- a/htdocs/compta/facture/class/facture.class.php
+++ b/htdocs/compta/facture/class/facture.class.php
@@ -57,12 +57,12 @@ class Facture extends CommonInvoice
* @var string ID to identify managed object
*/
public $element='facture';
-
+
/**
* @var string Name of table without prefix where object is stored
*/
public $table_element='facture';
-
+
public $table_element_line = 'facturedet';
public $fk_element = 'fk_facture';
public $picto='bill';
@@ -1178,6 +1178,8 @@ class Facture extends CommonInvoice
if ($add_save_lastsearch_values) $url.='&save_lastsearch_values=1';
}
+ if ($short) return $url;
+
$picto='bill';
if ($this->type == self::TYPE_REPLACEMENT) $picto.='r'; // Replacement invoice
if ($this->type == self::TYPE_CREDIT_NOTE) $picto.='a'; // Credit note
@@ -4262,7 +4264,7 @@ class FactureLigne extends CommonInvoiceLine
* @var string ID to identify managed object
*/
public $element='facturedet';
-
+
/**
* @var string Name of table without prefix where object is stored
*/