kanban view for localtax list
This commit is contained in:
parent
aea48e87de
commit
e820bb91c2
@ -629,4 +629,38 @@ class Localtax extends CommonObject
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* 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, $db;
|
||||
$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() : $this->ref).'</span>';
|
||||
if (property_exists($this, 'label')) {
|
||||
$return .= ' | <span class="info-box-label">'.$this->label.'</span>';
|
||||
}
|
||||
if (property_exists($this, 'datev')) {
|
||||
$return .= '<br><span class="opacitymedium">'.$langs->trans("DateEnd").'</span> : <span class="info-box-label">'.dol_print_date($db->jdate($this->datev), 'day').'</span>';
|
||||
}
|
||||
if (property_exists($this, 'datep')) {
|
||||
$return .= '<br><span class="opacitymedium">'.$langs->trans("DatePayment", '', '', '', '', 5).'</span> : <span class="info-box-label">'.dol_print_date($db->jdate($this->datep), 'day').'</span>';
|
||||
}
|
||||
if (property_exists($this, 'amount')) {
|
||||
$return .= '<br><span class="opacitymedium">'.$langs->trans("Amount").'</span> : <span class="info-box-label amount">'.price($this->amount).'</span>';
|
||||
}
|
||||
$return .= '</div>';
|
||||
$return .= '</div>';
|
||||
$return .= '</div>';
|
||||
return $return;
|
||||
}
|
||||
}
|
||||
|
||||
@ -35,7 +35,7 @@ if ($user->socid) {
|
||||
}
|
||||
$result = restrictedArea($user, 'tax', '', '', 'charges');
|
||||
$ltt = GETPOST("localTaxType", 'int');
|
||||
|
||||
$mode = GETPOST('mode', 'alpha');
|
||||
|
||||
/*
|
||||
* View
|
||||
@ -49,7 +49,14 @@ $url = DOL_URL_ROOT.'/compta/localtax/card.php?action=create&localTaxType='.$ltt
|
||||
if (!empty($socid)) {
|
||||
$url .= '&socid='.$socid;
|
||||
}
|
||||
$newcardbutton = dolGetButtonTitle($langs->trans('NewLocalTaxPayment', ($ltt + 1)), '', 'fa fa-plus-circle', $url, '', $user->rights->tax->charges->creer);
|
||||
$param = '';
|
||||
if (!empty($mode)) {
|
||||
$param .= '&mode='.urlencode($mode);
|
||||
}
|
||||
$newcardbutton = '';
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?localTaxType='.$ltt.'&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"].'?localTaxType='.$ltt.'&mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition'));
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('NewLocalTaxPayment', ($ltt + 1)), '', 'fa fa-plus-circle', $url, '', $user->rights->tax->charges->creer);
|
||||
|
||||
print load_fiche_titre($langs->transcountry($ltt == 2 ? "LT2Payments" : "LT1Payments", $mysoc->country_code), $newcardbutton, 'title_accountancy');
|
||||
|
||||
@ -77,19 +84,36 @@ if ($result) {
|
||||
while ($i < $num) {
|
||||
$obj = $db->fetch_object($result);
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
$localtax_static->label = $obj->label;
|
||||
$localtax_static->id = $obj->rowid;
|
||||
$localtax_static->ref = $obj->rowid;
|
||||
print "<td>".$localtax_static->getNomUrl(1)."</td>\n";
|
||||
print "<td>".dol_trunc($obj->label, 40)."</td>\n";
|
||||
print '<td class="left">'.dol_print_date($db->jdate($obj->datev), 'day')."</td>\n";
|
||||
print '<td class="left">'.dol_print_date($db->jdate($obj->datep), 'day')."</td>\n";
|
||||
$localtax_static->datev = $obj->datev;
|
||||
$localtax_static->datep = $obj->datep;
|
||||
$localtax_static->amount = $obj->amount;
|
||||
|
||||
$total = $total + $obj->amount;
|
||||
|
||||
print '<td class="right nowraponall"><span class="amount">'.price($obj->amount).'</span></td>';
|
||||
print "</tr>\n";
|
||||
if ($mode == 'kanban') {
|
||||
if ($i == 0) {
|
||||
print '<tr><td colspan="12">';
|
||||
print '<div class="box-flex-container">';
|
||||
}
|
||||
// Output Kanban
|
||||
print $localtax_static->getKanbanView('');
|
||||
if ($i == ($num - 1)) {
|
||||
print '</div>';
|
||||
print '</td></tr>';
|
||||
}
|
||||
} else {
|
||||
print '<tr class="oddeven">';
|
||||
print "<td>".$localtax_static->getNomUrl(1)."</td>\n";
|
||||
print "<td>".dol_trunc($obj->label, 40)."</td>\n";
|
||||
print '<td class="left">'.dol_print_date($db->jdate($obj->datev), 'day')."</td>\n";
|
||||
print '<td class="left">'.dol_print_date($db->jdate($obj->datep), 'day')."</td>\n";
|
||||
|
||||
print '<td class="right nowraponall"><span class="amount">'.price($obj->amount).'</span></td>';
|
||||
print "</tr>\n";
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
print '<tr class="liste_total"><td colspan="4">'.$langs->trans("Total").'</td>';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user