Add method getKanbanView()

This commit is contained in:
Laurent Destailleur 2020-02-16 12:05:00 +01:00
parent ed778bd28f
commit dc3a15945d
2 changed files with 23 additions and 1 deletions

View File

@ -3568,7 +3568,7 @@ class Commande extends CommonOrder
* @param int $short ???
* @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 Add linkt to notes
* @param int $addlinktonotes Add link to notes
* @return string String with URL
*/
public function getNomUrl($withpicto = 0, $option = '', $max = 0, $short = 0, $notooltip = 0, $save_lastsearch_value = -1, $addlinktonotes = 0)

View File

@ -491,6 +491,7 @@ abstract class CommonObject
return $this->error.(is_array($this->errors) ? (($this->error != '' ? ', ' : '').join(', ', $this->errors)) : '');
}
/**
* Return customer ref for screen output.
*
@ -559,6 +560,27 @@ abstract class CommonObject
return dol_trunc($ret, $maxlen);
}
/**
* Return clicable link of object (with eventually picto)
*
* @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link)
*/
public function getKanbanView($option = '')
{
$return = '<div class="box-flex-item">';
$return .= '<div class="info-box info-box-sm">';
$return .= '<span class="info-box-icon bg-infoxbox-action">';
$return .= '<i class="fa fa-dol-action"></i>'; // Can be image
$return .= '</span>';
$return .= '<div class="info-box-content">';
$return .= '<span class="info-box-title">'.(method_exists($this, 'getNomUrl') ? $this->getNomUrl() : $this->ref).'</span>';
$return .= '</div>';
$return .= '</div>';
$return .= '</div>';
return $return;
}
/**
* Return full address of contact
*