diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php
index a73fd2b5f2c..5332150dfb4 100644
--- a/htdocs/compta/bank/class/account.class.php
+++ b/htdocs/compta/bank/class/account.class.php
@@ -1748,6 +1748,39 @@ class Account extends CommonObject
return false;
}
}
+
+ /**
+ * 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 = '
';
+ // Action column
+ if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
+ print '';
+ if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
+ $selected = 0;
+ if (in_array($objecttmp->id, $arrayofselected)) {
+ $selected = 1;
+ }
+ print ' ';
}
- print ' ';
+ print ' ';
}
- print '';
- }
- // Ref
- if (!empty($arrayfields['b.ref']['checked'])) {
- print ''.$objecttmp->getNomUrl(1).' ';
- if (!$i) {
- $totalarray['nbfield']++;
- }
- }
-
- // Label
- if (!empty($arrayfields['b.label']['checked'])) {
- print ''.dol_escape_htmltag($objecttmp->label).' ';
- if (!$i) {
- $totalarray['nbfield']++;
- }
- }
-
- // Account type
- if (!empty($arrayfields['accountype']['checked'])) {
- print '';
- print $objecttmp->type_lib[$objecttmp->type];
- print ' ';
- if (!$i) {
- $totalarray['nbfield']++;
- }
- }
-
- // Number
- if (!empty($arrayfields['b.number']['checked'])) {
- print ''.dol_escape_htmltag($objecttmp->number).' ';
- if (!$i) {
- $totalarray['nbfield']++;
- }
- }
-
- // Account number
- if (!empty($arrayfields['b.account_number']['checked'])) {
- print '';
- if (isModEnabled('accounting') && !empty($objecttmp->account_number)) {
- $accountingaccount = new AccountingAccount($db);
- $accountingaccount->fetch('', $objecttmp->account_number, 1);
- print '';
- print $accountingaccount->getNomUrl(0, 1, 1, '', 0);
- print ' ';
- } else {
- print ''.$objecttmp->account_number.' ';
- }
- print ' ';
- if (!$i) {
- $totalarray['nbfield']++;
- }
- }
-
- // Accountancy journal
- if (!empty($arrayfields['b.fk_accountancy_journal']['checked'])) {
- print '';
- if (isModEnabled('accounting')) {
- if (empty($objecttmp->fk_accountancy_journal)) {
- print img_warning($langs->trans("Mandatory"));
- } else {
- $accountingjournal = new AccountingJournal($db);
- $accountingjournal->fetch($objecttmp->fk_accountancy_journal);
- print $accountingjournal->getNomUrl(0, 1, 1, '', 1);
+ // Ref
+ if (!empty($arrayfields['b.ref']['checked'])) {
+ print ' '.$objecttmp->getNomUrl(1).' ';
+ if (!$i) {
+ $totalarray['nbfield']++;
}
- } else {
- print '';
- }
- print '';
- if (!$i) {
- $totalarray['nbfield']++;
- }
- }
-
- // Currency
- if (!empty($arrayfields['b.currency_code']['checked'])) {
- print '';
- print $objecttmp->currency_code;
- print ' ';
- if (!$i) {
- $totalarray['nbfield']++;
- }
- }
-
- // Transactions to reconcile
- if (!empty($arrayfields['toreconcile']['checked'])) {
- $conciliate = $objecttmp->canBeConciliated();
-
- $labeltoshow = '';
- if ($conciliate == -2) {
- $labeltoshow = $langs->trans("CashAccount");
- } elseif ($conciliate == -3) {
- $labeltoshow = $langs->trans("Closed");
- } elseif (empty($objecttmp->rappro)) {
- $labeltoshow = $langs->trans("ConciliationDisabled");
}
- print '';
- if ($conciliate == -2) {
- print ''.$langs->trans("CashAccount").' ';
- } elseif ($conciliate == -3) {
- print ''.$langs->trans("Closed").' ';
- } elseif (empty($objecttmp->rappro)) {
- print ''.$langs->trans("ConciliationDisabled").' ';
- } else {
- $result = $objecttmp->load_board($user, $objecttmp->id);
- if (is_numeric($result) && $result < 0) {
- setEventMessages($objecttmp->error, $objecttmp->errors, 'errors');
- } else {
- print '';
- print '';
- print $result->nbtodo;
+ // Label
+ if (!empty($arrayfields['b.label']['checked'])) {
+ print ' '.dol_escape_htmltag($objecttmp->label).' ';
+ if (!$i) {
+ $totalarray['nbfield']++;
+ }
+ }
+
+ // Account type
+ if (!empty($arrayfields['accountype']['checked'])) {
+ print '';
+ print $objecttmp->type_lib[$objecttmp->type];
+ print ' ';
+ if (!$i) {
+ $totalarray['nbfield']++;
+ }
+ }
+
+ // Number
+ if (!empty($arrayfields['b.number']['checked'])) {
+ print ''.dol_escape_htmltag($objecttmp->number).' ';
+ if (!$i) {
+ $totalarray['nbfield']++;
+ }
+ }
+
+ // Account number
+ if (!empty($arrayfields['b.account_number']['checked'])) {
+ print '';
+ if (isModEnabled('accounting') && !empty($objecttmp->account_number)) {
+ $accountingaccount = new AccountingAccount($db);
+ $accountingaccount->fetch('', $objecttmp->account_number, 1);
+ print '';
+ print $accountingaccount->getNomUrl(0, 1, 1, '', 0);
print ' ';
- print '';
- if ($result->nbtodolate) {
- print '';
- print ' '.$result->nbtodolate;
+ } else {
+ print ''.$objecttmp->account_number.' ';
+ }
+ print ' ';
+ if (!$i) {
+ $totalarray['nbfield']++;
+ }
+ }
+
+ // Accountancy journal
+ if (!empty($arrayfields['b.fk_accountancy_journal']['checked'])) {
+ print '';
+ if (isModEnabled('accounting')) {
+ if (empty($objecttmp->fk_accountancy_journal)) {
+ print img_warning($langs->trans("Mandatory"));
+ } else {
+ $accountingjournal = new AccountingJournal($db);
+ $accountingjournal->fetch($objecttmp->fk_accountancy_journal);
+ print $accountingjournal->getNomUrl(0, 1, 1, '', 1);
+ }
+ } else {
+ print '';
+ }
+ print ' ';
+ if (!$i) {
+ $totalarray['nbfield']++;
+ }
+ }
+
+ // Currency
+ if (!empty($arrayfields['b.currency_code']['checked'])) {
+ print '';
+ print $objecttmp->currency_code;
+ print ' ';
+ if (!$i) {
+ $totalarray['nbfield']++;
+ }
+ }
+
+ // Transactions to reconcile
+ if (!empty($arrayfields['toreconcile']['checked'])) {
+ $conciliate = $objecttmp->canBeConciliated();
+
+ $labeltoshow = '';
+ if ($conciliate == -2) {
+ $labeltoshow = $langs->trans("CashAccount");
+ } elseif ($conciliate == -3) {
+ $labeltoshow = $langs->trans("Closed");
+ } elseif (empty($objecttmp->rappro)) {
+ $labeltoshow = $langs->trans("ConciliationDisabled");
+ }
+
+ print '';
+ if ($conciliate == -2) {
+ print ''.$langs->trans("CashAccount").' ';
+ } elseif ($conciliate == -3) {
+ print ''.$langs->trans("Closed").' ';
+ } elseif (empty($objecttmp->rappro)) {
+ print ''.$langs->trans("ConciliationDisabled").' ';
+ } else {
+ $result = $objecttmp->load_board($user, $objecttmp->id);
+ if (is_numeric($result) && $result < 0) {
+ setEventMessages($objecttmp->error, $objecttmp->errors, 'errors');
+ } else {
+ print '';
+ print '';
+ print $result->nbtodo;
print ' ';
+ print ' ';
+ if ($result->nbtodolate) {
+ print '';
+ print ' '.$result->nbtodolate;
+ print ' ';
+ }
}
}
- }
- print ' ';
- if (!$i) {
- $totalarray['nbfield']++;
- }
- }
-
- // Extra fields
- if (is_array($objecttmp->array_options)) {
- $obj = new stdClass();
- foreach ($objecttmp->array_options as $k => $v) {
- $obj->$k = $v;
- }
- }
- include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
- // Fields from hook
- $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
- $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $objecttmp, $action); // Note that $action and $objecttmpect may have been modified by hook
- print $hookmanager->resPrint;
- // Date creation
- if (!empty($arrayfields['b.datec']['checked'])) {
- print '';
- print dol_print_date($objecttmp->date_creation, 'dayhour');
- print ' ';
- if (!$i) {
- $totalarray['nbfield']++;
- }
- }
- // Date modification
- if (!empty($arrayfields['b.tms']['checked'])) {
- print '';
- print dol_print_date($objecttmp->date_update, 'dayhour');
- print ' ';
- if (!$i) {
- $totalarray['nbfield']++;
- }
- }
-
- // Status
- if (!empty($arrayfields['b.clos']['checked'])) {
- print ''.$objecttmp->getLibStatut(5).' ';
- if (!$i) {
- $totalarray['nbfield']++;
- }
- }
-
- // Balance
- if (!empty($arrayfields['balance']['checked'])) {
- print '';
- print '';
- print ''.price($solde, 0, $langs, 1, -1, -1, $objecttmp->currency_code).' ';
- print ' ';
- print ' ';
- if (!$i) {
- $totalarray['nbfield']++;
- }
- if (!$i) {
- $totalarray['pos'][$totalarray['nbfield']] = 'balance';
- }
- $totalarray['val']['balance'] += $solde;
- }
-
- // Action column
- if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
- print '';
- if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
- $selected = 0;
- if (in_array($objecttmp->id, $arrayofselected)) {
- $selected = 1;
+ print ' ';
+ if (!$i) {
+ $totalarray['nbfield']++;
}
- print ' ';
}
- print '';
- }
- if (!$i) {
- $totalarray['nbfield']++;
- }
- print ' ';
+ // Extra fields
+ if (is_array($objecttmp->array_options)) {
+ $obj = new stdClass();
+ foreach ($objecttmp->array_options as $k => $v) {
+ $obj->$k = $v;
+ }
+ }
+ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
+ // Fields from hook
+ $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
+ $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $objecttmp, $action); // Note that $action and $objecttmpect may have been modified by hook
+ print $hookmanager->resPrint;
+ // Date creation
+ if (!empty($arrayfields['b.datec']['checked'])) {
+ print '