From 68370083985e998642eba61b7e15d925a0423582 Mon Sep 17 00:00:00 2001 From: Lamrani Abdel Date: Thu, 12 Jan 2023 18:53:27 +0100 Subject: [PATCH] kanban view for ligne prelevement --- htdocs/compta/prelevement/list.php | 117 +++++++++++++++++------------ 1 file changed, 71 insertions(+), 46 deletions(-) diff --git a/htdocs/compta/prelevement/list.php b/htdocs/compta/prelevement/list.php index 4906313cad1..8d9489bbec7 100644 --- a/htdocs/compta/prelevement/list.php +++ b/htdocs/compta/prelevement/list.php @@ -43,6 +43,7 @@ $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'directdebitcredittransferlinelist'; // To manage different context of search $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') +$mode = GETPOST('mode', 'alpha'); $type = GETPOST('type', 'aZ09'); @@ -188,12 +189,18 @@ if ($result) { $param = "&statut=".urlencode($statut); $param .= "&search_bon=".urlencode($search_bon); + if (!empty($mode)) { + $param .= '&mode='.urlencode($mode); + } if ($type == 'bank-transfer') { $param .= '&type=bank-transfer'; } if ($limit > 0 && $limit != $conf->liste_limit) { $param .= '&limit='.urlencode($limit); } + $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"\n\n"; print '
'."\n"; @@ -206,6 +213,8 @@ if ($result) { print ''; print ''; print ''; + print ''; + if ($type != '') { print ''; } @@ -214,7 +223,7 @@ if ($result) { if ($type == 'bank-transfer') { $title = $langs->trans("CreditTransferLines"); } - print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'generic', 0, '', '', $limit, 0, 0, 1); + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'generic', 0, $newcardbutton, '', $limit, 0, 0, 1); $moreforfilter = ''; @@ -262,61 +271,77 @@ if ($result) { $bon->id = $obj->rowid; $bon->ref = $obj->ref; $bon->statut = $obj->status; + $bon->date_echeance = $obj->datec; + $bon->total = $obj->amount; $company->id = $obj->socid; $company->name = $obj->name; $company->email = $obj->email; $company->code_client = $obj->code_client; - print ''; + if ($mode == 'kanban') { + if ($i == 0) { + print ''; + print '
'; + } + // Output Kanban - print ''; - print $bon->getNomUrl(1); - print "\n"; + print $bon->getKanbanView(''); + if ($i == (min($num, $limit) - 1)) { + print '
'; + print ''; + } + } else { + print ''; - print ''; - print $line->LibStatut($obj->statut_ligne, 2); - print " "; - print ''; - print substr('000000'.$obj->rowid_ligne, -6); - print ''; + print ''; + print $bon->getNomUrl(1); + print "\n"; - print ''; - $link_to_bill = '/compta/facture/card.php?facid='; - $link_title = 'Invoice'; - $link_picto = 'bill'; - if ($type == 'bank-transfer') { - $link_to_bill = '/fourn/facture/card.php?facid='; - $link_title = 'SupplierInvoice'; - $link_picto = 'supplier_invoice'; + print ''; + print $line->LibStatut($obj->statut_ligne, 2); + print " "; + print ''; + print substr('000000'.$obj->rowid_ligne, -6); + print ''; + + print ''; + $link_to_bill = '/compta/facture/card.php?facid='; + $link_title = 'Invoice'; + $link_picto = 'bill'; + if ($type == 'bank-transfer') { + $link_to_bill = '/fourn/facture/card.php?facid='; + $link_title = 'SupplierInvoice'; + $link_picto = 'supplier_invoice'; + } + print ''; + print img_object($langs->trans($link_title), $link_picto); + print ' '.$obj->invoiceref."\n"; + print ''; + print ''; + + print ''; + print $company->getNomUrl(1); + print "\n"; + + + print ''; + $link_to_tab = '/comm/card.php?socid='; + $link_code = $obj->code_client; + if ($type == 'bank-transfer') { + $link_to_tab = '/fourn/card.php?socid='; + $link_code = $obj->code_fournisseur; + } + print ''.$link_code."\n"; + + print ''.dol_print_date($db->jdate($obj->datec), 'day')."\n"; + + print ''.price($obj->amount)."\n"; + + print ' '; + + print "\n"; } - print ''; - print img_object($langs->trans($link_title), $link_picto); - print ' '.$obj->invoiceref."\n"; - print ''; - print ''; - - print ''; - print $company->getNomUrl(1); - print "\n"; - - - print ''; - $link_to_tab = '/comm/card.php?socid='; - $link_code = $obj->code_client; - if ($type == 'bank-transfer') { - $link_to_tab = '/fourn/card.php?socid='; - $link_code = $obj->code_fournisseur; - } - print ''.$link_code."\n"; - - print ''.dol_print_date($db->jdate($obj->datec), 'day')."\n"; - - print ''.price($obj->amount)."\n"; - - print ' '; - - print "\n"; $i++; } } else {