kanban mode for list of prelevement orders
This commit is contained in:
parent
aea48e87de
commit
7124a59110
@ -2397,4 +2397,38 @@ class BonPrelevement extends CommonObject
|
||||
*/
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return clicable link of object (with eventually picto)
|
||||
*
|
||||
* @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link)
|
||||
* @return string HTML Code for Kanban thumb.
|
||||
*/
|
||||
public function getKanbanView($option = '')
|
||||
{
|
||||
global $langs;
|
||||
|
||||
|
||||
$return = '<div class="box-flex-item box-flex-grow-zero">';
|
||||
$return .= '<div class="info-box info-box-sm">';
|
||||
$return .= '<span class="info-box-icon bg-infobox-action">';
|
||||
$return .= img_picto('', $this->picto);
|
||||
$return .= '</span>';
|
||||
$return .= '<div class="info-box-content">';
|
||||
$return .= '<span class="info-box-ref">'.(method_exists($this, 'getNomUrl') ? $this->getNomUrl(1) : $this->ref).'</span>';
|
||||
|
||||
if (property_exists($this, 'date_echeance')) {
|
||||
$return .= '<br><span class="opacitymedium">'.$langs->trans("Date").'</span> : <span class="info-box-label">'.dol_print_date($this->db->jdate($this->date_echeance), 'day').'</span>';
|
||||
}
|
||||
if (property_exists($this, 'total')) {
|
||||
$return .= '<br><span class="opacitymedium">'.$langs->trans("Amount").'</span> : <span class="amount">'.price($this->total).'</span>';
|
||||
}
|
||||
if (method_exists($this, 'LibStatut')) {
|
||||
$return .= '<br><div class="info-box-status margintoponly">'.$this->LibStatut($this->statut, 5).'</div>';
|
||||
}
|
||||
$return .= '</div>';
|
||||
$return .= '</div>';
|
||||
$return .= '</div>';
|
||||
return $return;
|
||||
}
|
||||
}
|
||||
|
||||
@ -54,6 +54,8 @@ if (!$sortfield) {
|
||||
}
|
||||
|
||||
$optioncss = GETPOST('optioncss', 'alpha');
|
||||
$mode = GETPOST('mode', 'alpha');
|
||||
|
||||
|
||||
// Get supervariables
|
||||
$statut = GETPOST('statut', 'int');
|
||||
@ -147,6 +149,9 @@ if ($result) {
|
||||
$i = 0;
|
||||
|
||||
$param = '';
|
||||
if (!empty($mode)) {
|
||||
$param .= '&mode='.urlencode($mode);
|
||||
}
|
||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
||||
$param .= '&contextpage='.urlencode($contextpage);
|
||||
}
|
||||
@ -161,6 +166,8 @@ if ($result) {
|
||||
$selectedfields = '';
|
||||
|
||||
$newcardbutton = '';
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition'));
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition'));
|
||||
if ($usercancreate) {
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('NewStandingOrder'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/prelevement/create.php?type='.urlencode($type));
|
||||
}
|
||||
@ -176,6 +183,8 @@ if ($result) {
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||
print '<input type="hidden" name="mode" value="'.$mode.'">';
|
||||
|
||||
if ($type != '') {
|
||||
print '<input type="hidden" name="type" value="'.$type.'">';
|
||||
}
|
||||
@ -220,27 +229,41 @@ if ($result) {
|
||||
|
||||
$directdebitorder->id = $obj->rowid;
|
||||
$directdebitorder->ref = $obj->ref;
|
||||
$directdebitorder->datec = $obj->datec;
|
||||
$directdebitorder->amount = $obj->amount;
|
||||
$directdebitorder->date_echeance = $obj->datec;
|
||||
$directdebitorder->total = $obj->amount;
|
||||
$directdebitorder->statut = $obj->statut;
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
if ($mode == 'kanban') {
|
||||
if ($i == 0) {
|
||||
print '<tr><td colspan="12">';
|
||||
print '<div class="box-flex-container">';
|
||||
}
|
||||
// Output Kanban
|
||||
|
||||
print '<td>';
|
||||
print $directdebitorder->getNomUrl(1);
|
||||
print "</td>\n";
|
||||
print $directdebitorder->getKanbanView('');
|
||||
if ($i == (min($num, $limit) - 1)) {
|
||||
print '</div>';
|
||||
print '</td></tr>';
|
||||
}
|
||||
} else {
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
print '<td class="center">'.dol_print_date($db->jdate($obj->datec), 'day')."</td>\n";
|
||||
print '<td>';
|
||||
print $directdebitorder->getNomUrl(1);
|
||||
print "</td>\n";
|
||||
|
||||
print '<td class="right"><span class="amount">'.price($obj->amount)."</span></td>\n";
|
||||
print '<td class="center">'.dol_print_date($db->jdate($obj->datec), 'day')."</td>\n";
|
||||
|
||||
print '<td class="right">';
|
||||
print $bon->LibStatut($obj->statut, 5);
|
||||
print '</td>';
|
||||
print '<td class="right"><span class="amount">'.price($obj->amount)."</span></td>\n";
|
||||
|
||||
print '<td class="right"></td>'."\n";
|
||||
print '<td class="right">';
|
||||
print $bon->LibStatut($obj->statut, 5);
|
||||
print '</td>';
|
||||
|
||||
print "</tr>\n";
|
||||
print '<td class="right"></td>'."\n";
|
||||
|
||||
print "</tr>\n";
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
} else {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user