29require
'../../main.inc.php';
30require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
31require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent_type.class.php';
32require_once DOL_DOCUMENT_ROOT.
'/adherents/class/subscription.class.php';
33require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
35$langs->loadLangs(array(
"members",
"companies",
"banks"));
37$action =
GETPOST(
'action',
'aZ09') ?
GETPOST(
'action',
'aZ09') :
'view';
38$massaction =
GETPOST(
'massaction',
'alpha');
40$confirm =
GETPOST(
'confirm',
'alpha');
41$cancel =
GETPOST(
'cancel',
'alpha');
42$toselect =
GETPOST(
'toselect',
'array');
43$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') : str_replace(
'_',
'', basename(dirname(__FILE__)).basename(__FILE__,
'.php'));
44$backtopage =
GETPOST(
'backtopage',
'alpha');
45$optioncss =
GETPOST(
'optioncss',
'aZ');
48$statut = (GETPOSTISSET(
"statut") ?
GETPOST(
"statut",
"alpha") : 1);
49$search_ref =
GETPOST(
'search_ref',
'alpha');
51$search_lastname =
GETPOST(
'search_lastname',
'alpha');
52$search_firstname =
GETPOST(
'search_firstname',
'alpha');
53$search_login =
GETPOST(
'search_login',
'alpha');
54$search_note =
GETPOST(
'search_note',
'alpha');
55$search_account =
GETPOST(
'search_account',
'alpha');
56$search_amount =
GETPOST(
'search_amount',
'alpha');
59$date_select =
GETPOST(
"date_select",
'alpha');
63$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
64$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
66if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
70$offset = $limit * $page;
77 $sortfield =
"c.dateadh";
83$hookmanager->initHooks(array(
'subscriptionlist'));
86$extrafields->fetch_name_optionals_label(
$object->table_element);
88$search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
91$fieldstosearchall = array(
94 'd.ref' => array(
'label' =>
"Ref",
'checked' => 1),
95 'd.fk_type' => array(
'label' =>
"Type",
'checked' => 1),
96 'd.lastname' => array(
'label' =>
"Lastname",
'checked' => 1),
97 'd.firstname' => array(
'label' =>
"Firstname",
'checked' => 1),
98 'd.login' => array(
'label' =>
"Login",
'checked' => 1),
99 't.libelle' => array(
'label' =>
"Label",
'checked' => 1),
100 'd.bank' => array(
'label' =>
"BankAccount",
'checked' => 1,
'enabled' => (isModEnabled(
'bank'))),
103 'c.dateadh' => array(
'label' =>
"DateSubscription",
'checked' => 1,
'position' => 100),
104 'c.datef' => array(
'label' =>
"EndSubscription",
'checked' => 1,
'position' => 101),
105 'd.amount' => array(
'label' =>
"Amount",
'checked' => 1,
'position' => 102),
106 'c.datec' => array(
'label' =>
"DateCreation",
'checked' => 0,
'position' => 500),
107 'c.tms' => array(
'label' =>
"DateModificationShort",
'checked' => 0,
'position' => 500),
114$permissiontodelete = $user->hasRight(
'adherent',
'cotisation',
'creer');
121if (
GETPOST(
'cancel',
'alpha')) {
125if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
129$parameters = array(
'socid' => isset($socid) ? $socid : null);
130$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
135if (empty($reshook)) {
137 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
140 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
143 $search_lastname =
"";
144 $search_firstname =
"";
148 $search_account =
"";
150 $search_array_options = array();
152 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')
153 ||
GETPOST(
'button_search_x',
'alpha') ||
GETPOST(
'button_search.x',
'alpha') ||
GETPOST(
'button_search',
'alpha')) {
158 $objectclass =
'Subscription';
159 $objectlabel =
'Subscription';
160 $uploaddir = $conf->adherent->dir_output;
161 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
169$form =
new Form($db);
173$accountstatic =
new Account($db);
178$sql =
"SELECT d.rowid, d.login, d.firstname, d.lastname, d.societe, d.photo, d.statut as status,";
179$sql .=
" d.gender, d.email, d.morphy,";
180$sql .=
" c.rowid as crowid, c.fk_type, c.subscription,";
181$sql .=
" c.dateadh, c.datef, c.datec as date_creation, c.tms as date_modification,";
182$sql .=
" c.fk_bank as bank, c.note as note_private,";
183$sql .=
" b.fk_account";
185if (!empty($extrafields->attributes[
$object->table_element][
'label'])) {
186 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
187 $sql .= ($extrafields->attributes[
$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
191$parameters = array();
192$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object, $action);
193$sql .= $hookmanager->resPrint;
194$sql = preg_replace(
'/,\s*$/',
'', $sql);
198$sql .=
" FROM ".MAIN_DB_PREFIX.
"adherent as d";
199$sql .=
" JOIN ".MAIN_DB_PREFIX.
"subscription as c on d.rowid = c.fk_adherent";
200$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"adherent_extrafields as ef on (d.rowid = ef.fk_object)";
201$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"bank as b ON c.fk_bank = b.rowid";
202$sql .=
" WHERE d.entity IN (".getEntity(
'adherent').
")";
203if (isset($date_select) && $date_select !=
'') {
204 $sql .=
" AND c.dateadh >= '".((int) $date_select).
"-01-01 00:00:00'";
205 $sql .=
" AND c.dateadh < '".((int) $date_select + 1).
"-01-01 00:00:00'";
208 if (is_numeric($search_ref)) {
209 $sql .=
" AND c.rowid = ".((int) $search_ref);
211 $sql .=
" AND 1 = 2";
214if ($search_type > 0) {
217if ($search_lastname) {
218 $sql .=
natural_search(array(
'd.lastname',
'd.societe'), $search_lastname);
220if ($search_firstname) {
229if ($search_account > 0) {
230 $sql .=
" AND b.fk_account = ".((int) $search_account);
236 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
239include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
241$parameters = array();
242$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
243$sql .= $hookmanager->resPrint;
246$nbtotalofrecords =
'';
249 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
250 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
251 $resql = $db->query($sqlforcount);
253 $objforcount = $db->fetch_object($resql);
254 $nbtotalofrecords = $objforcount->nbtotalofrecords;
259 if (($page * $limit) > $nbtotalofrecords) {
267$sql .= $db->order($sortfield, $sortorder);
269 $sql .= $db->plimit($limit + 1, $offset);
272$resql = $db->query($sql);
278$num = $db->num_rows($resql);
282if ($num == 1 &&
getDolGlobalString(
'MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
283 $obj = $db->fetch_object($resql);
285 header(
"Location: ".DOL_URL_ROOT.
'/adherents/subscription/card.php?id='.
$id);
292$title = $langs->trans(
"Subscriptions");
293if (!empty($date_select)) {
294 $title .=
' ('.$langs->trans(
"Year").
' '.$date_select.
')';
296$help_url =
'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder';
298llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'mod-member page-subscription-list bodyforlist');
300$arrayofselected = is_array($toselect) ? $toselect : array();
304 $param .=
'&mode='.urlencode($mode);
306if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
307 $param .=
'&contextpage='.urlencode($contextpage);
309if ($limit > 0 && $limit != $conf->liste_limit) {
310 $param .=
'&limit='.((int) $limit);
313 $param .=
"&statut=".urlencode($statut);
316 $param .=
"&search_type=".((int) $search_type);
319 $param .=
"&date_select=".urlencode($date_select);
321if ($search_lastname) {
322 $param .=
"&search_lastname=".urlencode($search_lastname);
325 $param .=
"&search_login=".urlencode($search_login);
327if ($search_account) {
328 $param .=
"&search_account=".urlencode($search_account);
331 $param .=
"&search_amount=".urlencode($search_amount);
333if ($optioncss !=
'') {
334 $param .=
'&optioncss='.urlencode($optioncss);
337include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
339$parameters = array(
'param' => &$param);
340$reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object, $action);
341$param .= $hookmanager->resPrint;
344$arrayofmassactions = array(
348if (!empty($permissiontodelete)) {
349 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
351if (
GETPOSTINT(
'nomassaction') || in_array($massaction, array(
'presend',
'predelete'))) {
352 $arrayofmassactions = array();
354$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
356print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
357if ($optioncss !=
'') {
358 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
360print
'<input type="hidden" name="token" value="'.newToken().
'">';
361print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
362print
'<input type="hidden" name="action" value="list">';
363print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
364print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
365print
'<input type="hidden" name="page" value="'.$page.
'">';
366print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
367print
'<input type="hidden" name="date_select" value="'.$date_select.
'">';
368print
'<input type="hidden" name="page_y" value="">';
369print
'<input type="hidden" name="mode" value="'.$mode.
'">';
372$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'));
373$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'));
374if ($user->hasRight(
'adherent',
'cotisation',
'creer')) {
376 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewSubscription'),
'',
'fa fa-plus-circle', DOL_URL_ROOT.
'/adherents/list.php?status=-1,1');
379print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $subscription->picto, 0, $newcardbutton,
'', $limit, 0, 0, 1);
381$topicmail =
"Information";
382$modelmail =
"subscription";
384$trackid =
'sub'.$object->id;
385include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
390 foreach ($fieldstosearchall as $key => $val) {
391 $fieldstosearchall[$key] = $langs->trans($val);
392 $setupstring .= $key.
"=".$val.
";";
394 print
'<!-- Search done like if MYOBJECT_QUICKSEARCH_ON_FIELDS = '.$setupstring.
' -->'.
"\n";
395 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).implode(
', ', $fieldstosearchall).
'</div>'.
"\n";
403$parameters = array();
404$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
405if (empty($reshook)) {
406 $moreforfilter .= $hookmanager->resPrint;
408 $moreforfilter = $hookmanager->resPrint;
411if (!empty($moreforfilter)) {
412 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
413 print $moreforfilter;
417$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
418$htmlofselectarray = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));
419$selectedfields = ($mode !=
'kanban' ? $htmlofselectarray :
'');
420$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
422print
'<div class="div-table-responsive">';
423print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
427print
'<tr class="liste_titre_filter">';
430 print
'<td class="liste_titre center maxwidthsearch">';
431 $searchpicto = $form->showFilterButtons(
'left');
437 print
'<td class="liste_titre"> </td>';
441if (!empty($arrayfields[
'd.ref'][
'checked'])) {
442 print
'<td class="liste_titre left">';
443 print
'<input class="flat maxwidth50" type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref).
'"></td>';
447if (!empty($arrayfields[
'd.fk_type'][
'checked'])) {
448 print
'<td class="liste_titre left">';
449 print $form->selectarray(
"search_type", $adht->liste_array(), $search_type, 1);
453if (!empty($arrayfields[
'd.lastname'][
'checked'])) {
454 print
'<td class="liste_titre left">';
455 print
'<input class="flat maxwidth75" type="text" name="search_lastname" value="'.dol_escape_htmltag($search_lastname).
'"></td>';
458if (!empty($arrayfields[
'd.firstname'][
'checked'])) {
459 print
'<td class="liste_titre left">';
460 print
'<input class="flat maxwidth75" type="text" name="search_firstname" value="'.dol_escape_htmltag($search_firstname).
'"></td>';
463if (!empty($arrayfields[
'd.login'][
'checked'])) {
464 print
'<td class="liste_titre left">';
465 print
'<input class="flat maxwidth75" type="text" name="search_login" value="'.dol_escape_htmltag($search_login).
'"></td>';
468if (!empty($arrayfields[
't.libelle'][
'checked'])) {
469 print
'<td class="liste_titre">';
474if (!empty($arrayfields[
'd.bank'][
'checked'])) {
475 print
'<td class="liste_titre">';
476 $form->select_comptes($search_account,
'search_account', 0,
'', 1,
'', 0,
'maxwidth100');
480if (!empty($arrayfields[
'c.dateadh'][
'checked'])) {
481 print
'<td class="liste_titre"> </td>';
484if (!empty($arrayfields[
'c.datef'][
'checked'])) {
485 print
'<td class="liste_titre"> </td>';
488if (!empty($arrayfields[
'd.amount'][
'checked'])) {
489 print
'<td class="liste_titre right">';
490 print
'<input class="flat" type="text" name="search_amount" value="'.dol_escape_htmltag($search_amount).
'" size="4">';
494include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
497$parameters = array(
'arrayfields' => $arrayfields);
498$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object, $action);
499print $hookmanager->resPrint;
501if (!empty($arrayfields[
'c.datec'][
'checked'])) {
502 print
'<td class="liste_titre">';
506if (!empty($arrayfields[
'c.tms'][
'checked'])) {
507 print
'<td class="liste_titre">';
513 print
'<td class="liste_titre center maxwidthsearch">';
514 $searchpicto = $form->showFilterButtons();
520$totalarray = array();
521$totalarray[
'nbfield'] = 0;
525print
'<tr class="liste_titre">';
528 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'align="center"', $sortfield, $sortorder,
'maxwidthsearch ');
529 $totalarray[
'nbfield']++;
531if (!empty($arrayfields[
'd.ref'][
'checked'])) {
532 print_liste_field_titre($arrayfields[
'd.ref'][
'label'], $_SERVER[
"PHP_SELF"],
"c.rowid", $param,
"",
"", $sortfield, $sortorder);
533 $totalarray[
'nbfield']++;
535if (!empty($arrayfields[
'd.fk_type'][
'checked'])) {
536 print_liste_field_titre($arrayfields[
'd.fk_type'][
'label'], $_SERVER[
"PHP_SELF"],
"c.fk_type", $param,
"",
"", $sortfield, $sortorder);
537 $totalarray[
'nbfield']++;
539if (!empty($arrayfields[
'd.lastname'][
'checked'])) {
540 print_liste_field_titre($arrayfields[
'd.lastname'][
'label'], $_SERVER[
"PHP_SELF"],
"d.lastname", $param,
"",
"", $sortfield, $sortorder);
541 $totalarray[
'nbfield']++;
543if (!empty($arrayfields[
'd.firstname'][
'checked'])) {
544 print_liste_field_titre($arrayfields[
'd.firstname'][
'label'], $_SERVER[
"PHP_SELF"],
"d.firstname", $param,
"",
"", $sortfield, $sortorder);
545 $totalarray[
'nbfield']++;
547if (!empty($arrayfields[
'd.login'][
'checked'])) {
548 print_liste_field_titre($arrayfields[
'd.login'][
'label'], $_SERVER[
"PHP_SELF"],
"d.login", $param,
"",
"", $sortfield, $sortorder);
549 $totalarray[
'nbfield']++;
551if (!empty($arrayfields[
't.libelle'][
'checked'])) {
552 print_liste_field_titre($arrayfields[
't.libelle'][
'label'], $_SERVER[
"PHP_SELF"],
"c.note", $param,
"",
'', $sortfield, $sortorder);
553 $totalarray[
'nbfield']++;
555if (!empty($arrayfields[
'd.bank'][
'checked'])) {
556 print_liste_field_titre($arrayfields[
'd.bank'][
'label'], $_SERVER[
"PHP_SELF"],
"b.fk_account", $param,
"",
"", $sortfield, $sortorder);
557 $totalarray[
'nbfield']++;
559if (!empty($arrayfields[
'c.dateadh'][
'checked'])) {
560 print_liste_field_titre($arrayfields[
'c.dateadh'][
'label'], $_SERVER[
"PHP_SELF"],
"c.dateadh", $param,
"",
'', $sortfield, $sortorder,
'center nowraponall ');
561 $totalarray[
'nbfield']++;
563if (!empty($arrayfields[
'c.datef'][
'checked'])) {
564 print_liste_field_titre($arrayfields[
'c.datef'][
'label'], $_SERVER[
"PHP_SELF"],
"c.datef", $param,
"",
'', $sortfield, $sortorder,
'center nowraponall ');
565 $totalarray[
'nbfield']++;
567if (!empty($arrayfields[
'd.amount'][
'checked'])) {
568 print_liste_field_titre($arrayfields[
'd.amount'][
'label'], $_SERVER[
"PHP_SELF"],
"c.subscription", $param,
"",
'', $sortfield, $sortorder,
'right ');
569 $totalarray[
'nbfield']++;
573include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
576$parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder,
'totalarray' => &$totalarray);
577$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object, $action);
578print $hookmanager->resPrint;
579if (!empty($arrayfields[
'c.datec'][
'checked'])) {
580 print_liste_field_titre($arrayfields[
'c.datec'][
'label'], $_SERVER[
"PHP_SELF"],
"c.datec",
"", $param,
'align="center" class="nowrap"', $sortfield, $sortorder);
582if (!empty($arrayfields[
'c.tms'][
'checked'])) {
583 print_liste_field_titre($arrayfields[
'c.tms'][
'label'], $_SERVER[
"PHP_SELF"],
"c.tms",
"", $param,
'align="center" class="nowrap"', $sortfield, $sortorder);
587 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
588 $totalarray[
'nbfield']++;
595$savnbfield = $totalarray[
'nbfield'];
596$totalarray = array();
597$totalarray[
'nbfield'] = 0;
598$imaxinloop = ($limit ? min($num, $limit) : $num);
599while ($i < $imaxinloop) {
600 $obj = $db->fetch_object($resql);
605 $subscription->ref = $obj->crowid;
606 $subscription->id = $obj->crowid;
607 $subscription->dateh = $db->jdate($obj->dateadh);
608 $subscription->datef = $db->jdate($obj->datef);
609 $subscription->amount = $obj->subscription;
610 $subscription->fk_adherent = $obj->rowid;
612 $adherent->lastname = $obj->lastname;
613 $adherent->firstname = $obj->firstname;
614 $adherent->ref = $obj->rowid;
615 $adherent->id = $obj->rowid;
616 $adherent->statut = $obj->status;
617 $adherent->status = $obj->status;
618 $adherent->login = $obj->login;
619 $adherent->photo = $obj->photo;
620 $adherent->gender = $obj->gender;
621 $adherent->morphy = $obj->morphy;
622 $adherent->email = $obj->email;
623 $adherent->typeid = $obj->fk_type;
624 $adherent->datefin = $db->jdate($obj->datef);
626 $typeid = ($obj->fk_type > 0 ? $obj->fk_type : $adherent->typeid);
628 $adht->fetch($typeid);
630 $adherent->need_subscription = $adht->subscription;
632 if ($mode ==
'kanban') {
634 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
635 print
'<div class="box-flex-container kanban">';
638 if ($massactionbutton || $massaction) {
640 if (in_array(
$object->id, $arrayofselected)) {
647 if ($obj->fk_account > 0) {
648 $accountstatic->id = $obj->fk_account;
649 $accountstatic->fetch($obj->fk_account);
652 print $subscription->getKanbanView(
'', array(
'selected' => in_array(
$object->id, $arrayofselected),
'adherent_type' => $adht,
'member' => $adherent,
'bank' => ($obj->fk_account > 0 ? $accountstatic : null)));
653 if ($i == ($imaxinloop - 1)) {
660 print
'<tr data-rowid="'.$object->id.
'" class="oddeven">';
663 print
'<td class="nowrap center">';
664 if ($massactionbutton || $massaction) {
666 if (in_array($obj->crowid, $arrayofselected)) {
669 print
'<input id="cb'.$obj->crowid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->crowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
673 $totalarray[
'nbfield']++;
677 if (!empty($arrayfields[
'd.ref'][
'checked'])) {
678 print
'<td class="nowraponall">'.$subscription->getNomUrl(1).
'</td>';
680 $totalarray[
'nbfield']++;
684 if (!empty($arrayfields[
'd.fk_type'][
'checked'])) {
685 print
'<td class="tdoverflowmax100">';
687 print $adht->getNomUrl(1);
691 $totalarray[
'nbfield']++;
696 if (!empty($arrayfields[
'd.lastname'][
'checked'])) {
697 print
'<td class="tdoverflowmax125">'.$adherent->getNomUrl(-1, 0,
'card',
'lastname').
'</td>';
699 $totalarray[
'nbfield']++;
703 if (!empty($arrayfields[
'd.firstname'][
'checked'])) {
704 print
'<td class="tdoverflowmax125" title="'.dol_escape_htmltag($adherent->firstname).
'">'.
dol_escape_htmltag($adherent->firstname).
'</td>';
706 $totalarray[
'nbfield']++;
711 if (!empty($arrayfields[
'd.login'][
'checked'])) {
712 print
'<td class="tdoverflowmax150" title="'.dol_escape_htmltag($adherent->login).
'">'.
dol_escape_htmltag($adherent->login).
'</td>';
714 $totalarray[
'nbfield']++;
719 if (!empty($arrayfields[
't.libelle'][
'checked'])) {
720 print
'<td class="tdoverflowmax400" title="'.dol_escape_htmltag($obj->note_private).
'">';
724 $totalarray[
'nbfield']++;
729 if (!empty($arrayfields[
'd.bank'][
'checked'])) {
730 print
'<td class="tdmaxoverflow100">';
731 if ($obj->fk_account > 0) {
732 $accountstatic->id = $obj->fk_account;
733 $accountstatic->fetch($obj->fk_account);
735 print $accountstatic->getNomUrl(1);
739 $totalarray[
'nbfield']++;
744 if (!empty($arrayfields[
'c.dateadh'][
'checked'])) {
745 print
'<td class="center nowraponall">'.dol_print_date($db->jdate($obj->dateadh),
'day').
"</td>\n";
747 $totalarray[
'nbfield']++;
751 if (!empty($arrayfields[
'c.datef'][
'checked'])) {
752 print
'<td class="center nowraponall">'.dol_print_date($db->jdate($obj->datef),
'day').
"</td>\n";
754 $totalarray[
'nbfield']++;
758 if (!empty($arrayfields[
'd.amount'][
'checked'])) {
759 print
'<td class="right amount">'.price($obj->subscription).
'</td>';
761 $totalarray[
'nbfield']++;
764 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'd.amount';
766 if (empty($totalarray[
'val'][
'd.amount'])) {
767 $totalarray[
'val'][
'd.amount'] = $obj->subscription;
769 $totalarray[
'val'][
'd.amount'] += $obj->subscription;
773 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
775 $parameters = array(
'arrayfields' => $arrayfields,
'obj' => $obj,
'i' => $i,
'totalarray' => &$totalarray);
776 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters);
777 print $hookmanager->resPrint;
779 if (!empty($arrayfields[
'c.datec'][
'checked'])) {
780 print
'<td class="nowrap center">';
781 print
dol_print_date($db->jdate($obj->date_creation),
'dayhour',
'tzuser');
784 $totalarray[
'nbfield']++;
788 if (!empty($arrayfields[
'c.tms'][
'checked'])) {
789 print
'<td class="nowrap center">';
790 print
dol_print_date($db->jdate($obj->date_modification),
'dayhour',
'tzuser');
793 $totalarray[
'nbfield']++;
798 print
'<td class="nowrap center">';
799 if ($massactionbutton || $massaction) {
801 if (in_array($obj->crowid, $arrayofselected)) {
804 print
'<input id="cb'.$obj->crowid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->crowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
808 $totalarray[
'nbfield']++;
818include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
824 foreach ($arrayfields as $key => $val) {
825 if (!empty($val[
'checked'])) {
829 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
834$parameters = array(
'arrayfields' => $arrayfields,
'sql' => $sql);
835$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
836print $hookmanager->resPrint;
838print
'</table>'.
"\n";
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Class to manage bank accounts.
Class to manage members of a foundation.
Class to manage members type.
Class to manage subscriptions of foundation members.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dolGetFirstLineOfText($text, $nboflines=1, $charset='UTF-8')
Return first line of text.
dolGetButtonTitle($label, $helpText='', $iconClass='fa fa-file', $url='', $id='', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
natural_search($fields, $value, $mode=0, $nofirstand=0)
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
dol_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $disablesortlink=0, $tooltip='', $forcenowrapcolumntitle=0)
Get title line of an array.
dolGetButtonTitleSeparator($moreClass="")
Add space between dolGetButtonTitle.
print_barre_liste($title, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $hideselectlimit=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.