kanban mode for list of expensereport payments
This commit is contained in:
parent
6af49ff216
commit
070128367d
@ -713,4 +713,41 @@ class PaymentExpenseReport extends CommonObject
|
|||||||
dol_print_error($this->db);
|
dol_print_error($this->db);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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, 'datep')) {
|
||||||
|
$return .= '<br><span class="opacitymedium">'.$langs->trans("Date").'</span> : <span class="info-box-label">'.dol_print_date($this->db->jdate($this->datep), 'dayhour').'</span>';
|
||||||
|
}
|
||||||
|
if (property_exists($this, 'fk_typepayment')) {
|
||||||
|
$return .= '<br><span class="opacitymedium">'.$langs->trans("Type").'</span> : <span class="info-box-label">'.$this->fk_typepayment.'</span>';
|
||||||
|
}
|
||||||
|
if (property_exists($this, 'fk_bank') && !is_null($this->fk_bank)) {
|
||||||
|
$return .= '<br><span class="opacitymedium">'.$langs->trans("Account").'</span> : <span class="info-box-label">'.$this->fk_bank.'</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>';
|
||||||
|
}
|
||||||
|
if (method_exists($this, 'getLibStatut')) {
|
||||||
|
$return .= '<br><div class="info-box-status margintoponly">'.$this->getLibStatut(5).'</div>';
|
||||||
|
}
|
||||||
|
$return .= '</div>';
|
||||||
|
$return .= '</div>';
|
||||||
|
$return .= '</div>';
|
||||||
|
return $return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -48,6 +48,7 @@ $action = GETPOST('action', 'alpha');
|
|||||||
$massaction = GETPOST('massaction', 'alpha');
|
$massaction = GETPOST('massaction', 'alpha');
|
||||||
$optioncss = GETPOST('optioncss', 'alpha');
|
$optioncss = GETPOST('optioncss', 'alpha');
|
||||||
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'vendorpaymentlist';
|
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'vendorpaymentlist';
|
||||||
|
$mode = GETPOST('mode', 'alpha');
|
||||||
|
|
||||||
$socid = GETPOST('socid', 'int');
|
$socid = GETPOST('socid', 'int');
|
||||||
|
|
||||||
@ -254,6 +255,9 @@ $num = $db->num_rows($resql);
|
|||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
$param = '';
|
$param = '';
|
||||||
|
if (!empty($mode)) {
|
||||||
|
$param .= '&mode='.urlencode($mode);
|
||||||
|
}
|
||||||
if (!empty($contextpage) && $contextpage != $_SERVER['PHP_SELF']) {
|
if (!empty($contextpage) && $contextpage != $_SERVER['PHP_SELF']) {
|
||||||
$param .= '&contextpage='.urlencode($contextpage);
|
$param .= '&contextpage='.urlencode($contextpage);
|
||||||
}
|
}
|
||||||
@ -315,8 +319,13 @@ print '<input type="hidden" name="formfilteraction" id="formfilteraction" value=
|
|||||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||||
|
print '<input type="hidden" name="mode" value="'.$mode.'">';
|
||||||
|
|
||||||
print_barre_liste($langs->trans('ExpenseReportPayments'), $page, $_SERVER['PHP_SELF'], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'expensereport', 0, '', '', $limit, 0, 0, 1);
|
$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'));
|
||||||
|
|
||||||
|
print_barre_liste($langs->trans('ExpenseReportPayments'), $page, $_SERVER['PHP_SELF'], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'expensereport', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
||||||
|
|
||||||
if ($search_all) {
|
if ($search_all) {
|
||||||
foreach ($fieldstosearchall as $key => $val) {
|
foreach ($fieldstosearchall as $key => $val) {
|
||||||
@ -473,12 +482,33 @@ while ($i < min($num, $limit)) {
|
|||||||
|
|
||||||
$paymentexpensereportstatic->id = $objp->rowid;
|
$paymentexpensereportstatic->id = $objp->rowid;
|
||||||
$paymentexpensereportstatic->ref = $objp->ref;
|
$paymentexpensereportstatic->ref = $objp->ref;
|
||||||
$paymentexpensereportstatic->datepaye = $objp->datep;
|
$paymentexpensereportstatic->datep = $objp->datep;
|
||||||
|
$paymentexpensereportstatic->amount = $objp->pamount;
|
||||||
|
$paymentexpensereportstatic->fk_typepayment = $objp->paiement_type;
|
||||||
|
|
||||||
|
if ($objp->bid) {
|
||||||
|
$accountstatic->fetch($objp->bid);
|
||||||
|
$paymentexpensereportstatic->fk_bank = $accountstatic->getNomUrl(1);
|
||||||
|
} else {
|
||||||
|
$paymentexpensereportstatic->fk_bank = null;
|
||||||
|
}
|
||||||
|
|
||||||
$userstatic->id = $objp->userid;
|
$userstatic->id = $objp->userid;
|
||||||
$userstatic->lastname = $objp->lastname;
|
$userstatic->lastname = $objp->lastname;
|
||||||
$userstatic->firstname = $objp->firstname;
|
$userstatic->firstname = $objp->firstname;
|
||||||
|
|
||||||
|
if ($mode == 'kanban') {
|
||||||
|
if ($i == 0) {
|
||||||
|
print '<tr><td colspan="12">';
|
||||||
|
print '<div class="box-flex-container">';
|
||||||
|
}
|
||||||
|
// Output Kanban
|
||||||
|
print $paymentexpensereportstatic->getKanbanView('');
|
||||||
|
if ($i == (min($num, $limit) - 1)) {
|
||||||
|
print '</div>';
|
||||||
|
print '</td></tr>';
|
||||||
|
}
|
||||||
|
} else {
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
|
|
||||||
// No
|
// No
|
||||||
@ -583,6 +613,7 @@ while ($i < min($num, $limit)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
}
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user