diff --git a/htdocs/adherents/class/subscription.class.php b/htdocs/adherents/class/subscription.class.php
index b3cfe027197..411fdb2181f 100644
--- a/htdocs/adherents/class/subscription.class.php
+++ b/htdocs/adherents/class/subscription.class.php
@@ -505,4 +505,36 @@ class Subscription extends CommonObject
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 = '')
+ {
+ $return = '
';
+ print '';
}
- }
- // Type
- if (!empty($arrayfields['d.fk_type']['checked'])) {
- print '
';
- if ($typeid > 0) {
- print $adht->getNomUrl(1);
- }
- print ' ';
- if (!$i) {
- $totalarray['nbfield']++;
- }
- }
-
- // Lastname
- if (!empty($arrayfields['d.lastname']['checked'])) {
- print ''.$adherent->getNomUrl(-1, 0, 'card', 'lastname').' ';
- if (!$i) {
- $totalarray['nbfield']++;
- }
- }
- // Firstname
- if (!empty($arrayfields['d.firstname']['checked'])) {
- print ''.$adherent->firstname.' ';
- if (!$i) {
- $totalarray['nbfield']++;
- }
- }
-
- // Login
- if (!empty($arrayfields['d.login']['checked'])) {
- print ''.$adherent->login.' ';
- if (!$i) {
- $totalarray['nbfield']++;
- }
- }
-
- // Label
- if (!empty($arrayfields['t.libelle']['checked'])) {
- print '';
- print $obj->note;
- print ' ';
- if (!$i) {
- $totalarray['nbfield']++;
- }
- }
-
- // Banque
- if (!empty($arrayfields['d.bank']['checked'])) {
- print '';
+
+ //fetch informations needs on this mode
+ $subscription->fk_adherent = $adherent->getNomUrl(1);
+ $subscription->fk_type = $adht->getNomUrl(1);
+ $subscription->amount = $obj->subscription;
if ($obj->fk_account > 0) {
$accountstatic->id = $obj->fk_account;
$accountstatic->fetch($obj->fk_account);
- //$accountstatic->label=$obj->label;
- print $accountstatic->getNomUrl(1);
+ $subscription->fk_bank = $accountstatic->getNomUrl(1);
}
- print " \n";
- if (!$i) {
- $totalarray['nbfield']++;
+ // Output Kanban
+ print $subscription->getKanbanView('');
+ if ($i == (min($num, $limit) - 1)) {
+ print '';
+ print ' ';
}
}
- // Date start
- if (!empty($arrayfields['c.dateadh']['checked'])) {
- print '';
+
+ // Ref
+ if (!empty($arrayfields['d.ref']['checked'])) {
+ print ''.$subscription->getNomUrl(1).' ';
+ if (!$i) {
+ $totalarray['nbfield']++;
+ }
}
- }
- // Date end
- if (!empty($arrayfields['c.datef']['checked'])) {
- print ''.dol_print_date($db->jdate($obj->datef), 'day')." \n";
- if (!$i) {
- $totalarray['nbfield']++;
+ // Type
+ if (!empty($arrayfields['d.fk_type']['checked'])) {
+ print '';
+ if ($typeid > 0) {
+ print $adht->getNomUrl(1);
+ }
+ print ' ';
+ if (!$i) {
+ $totalarray['nbfield']++;
+ }
}
- }
- // Price
- if (!empty($arrayfields['d.amount']['checked'])) {
- print ''.price($obj->subscription).' ';
- if (!$i) {
- $totalarray['nbfield']++;
+
+ // Lastname
+ if (!empty($arrayfields['d.lastname']['checked'])) {
+ print ''.$adherent->getNomUrl(-1, 0, 'card', 'lastname').' ';
+ if (!$i) {
+ $totalarray['nbfield']++;
+ }
}
- if (!$i) {
- $totalarray['pos'][$totalarray['nbfield']] = 'd.amount';
+ // Firstname
+ if (!empty($arrayfields['d.firstname']['checked'])) {
+ print ''.$adherent->firstname.' ';
+ if (!$i) {
+ $totalarray['nbfield']++;
+ }
}
- if (empty($totalarray['val']['d.amount'])) {
- $totalarray['val']['d.amount'] = $obj->subscription;
- } else {
- $totalarray['val']['d.amount'] += $obj->subscription;
+
+ // Login
+ if (!empty($arrayfields['d.login']['checked'])) {
+ print ''.$adherent->login.' ';
+ if (!$i) {
+ $totalarray['nbfield']++;
+ }
+ }
+
+ // Label
+ if (!empty($arrayfields['t.libelle']['checked'])) {
+ print '';
+ print $obj->note;
+ print ' ';
+ if (!$i) {
+ $totalarray['nbfield']++;
+ }
+ }
+
+ // Banque
+ if (!empty($arrayfields['d.bank']['checked'])) {
+ print '';
+ if ($obj->fk_account > 0) {
+ $accountstatic->id = $obj->fk_account;
+ $accountstatic->fetch($obj->fk_account);
+ //$accountstatic->label=$obj->label;
+ print $accountstatic->getNomUrl(1);
+ }
+ print " \n";
+ if (!$i) {
+ $totalarray['nbfield']++;
+ }
+ }
+
+ // Date start
+ if (!empty($arrayfields['c.dateadh']['checked'])) {
+ print ''.dol_print_date($db->jdate($obj->dateadh), 'day')." \n";
+ if (!$i) {
+ $totalarray['nbfield']++;
+ }
+ }
+ // Date end
+ if (!empty($arrayfields['c.datef']['checked'])) {
+ print ''.dol_print_date($db->jdate($obj->datef), 'day')." \n";
+ if (!$i) {
+ $totalarray['nbfield']++;
+ }
+ }
+ // Price
+ if (!empty($arrayfields['d.amount']['checked'])) {
+ print ''.price($obj->subscription).' ';
+ if (!$i) {
+ $totalarray['nbfield']++;
+ }
+ if (!$i) {
+ $totalarray['pos'][$totalarray['nbfield']] = 'd.amount';
+ }
+ if (empty($totalarray['val']['d.amount'])) {
+ $totalarray['val']['d.amount'] = $obj->subscription;
+ } else {
+ $totalarray['val']['d.amount'] += $obj->subscription;
+ }
+ }
+ // Extra fields
+ 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); // Note that $action and $object may have been modified by hook
+ print $hookmanager->resPrint;
+ // Date creation
+ if (!empty($arrayfields['c.datec']['checked'])) {
+ print '';
+ print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser');
+ print ' ';
+ if (!$i) {
+ $totalarray['nbfield']++;
+ }
+ }
+ // Date modification
+ if (!empty($arrayfields['c.tms']['checked'])) {
+ print '';
+ print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser');
+ print ' ';
+ if (!$i) {
+ $totalarray['nbfield']++;
+ }
+ }
+ // Action 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($obj->crowid, $arrayofselected)) {
+ $selected = 1;
+ }
+ print ' ';
}
- }
- // Extra fields
- 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); // Note that $action and $object may have been modified by hook
- print $hookmanager->resPrint;
- // Date creation
- if (!empty($arrayfields['c.datec']['checked'])) {
- print ' ';
- print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser');
print ' ';
if (!$i) {
$totalarray['nbfield']++;
}
- }
- // Date modification
- if (!empty($arrayfields['c.tms']['checked'])) {
- print '';
- print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser');
- print ' ';
- if (!$i) {
- $totalarray['nbfield']++;
- }
- }
- // Action 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($obj->crowid, $arrayofselected)) {
- $selected = 1;
- }
- print ' ';
- }
- print ' ';
- if (!$i) {
- $totalarray['nbfield']++;
- }
- print " \n";
+ print "\n";
+ }
$i++;
}