28require
'../../main.inc.php';
29require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
30require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent_type.class.php';
31require_once DOL_DOCUMENT_ROOT.
'/adherents/class/subscription.class.php';
32require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
34$langs->loadLangs(array(
"members",
"companies",
"banks"));
36$action =
GETPOST(
'action',
'aZ09') ?
GETPOST(
'action',
'aZ09') :
'view';
37$massaction =
GETPOST(
'massaction',
'alpha');
39$confirm =
GETPOST(
'confirm',
'alpha');
40$cancel =
GETPOST(
'cancel',
'alpha');
41$toselect =
GETPOST(
'toselect',
'array');
42$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') : str_replace(
'_',
'', basename(dirname(__FILE__)).basename(__FILE__,
'.php'));
43$backtopage =
GETPOST(
'backtopage',
'alpha');
44$optioncss =
GETPOST(
'optioncss',
'aZ');
47$statut = (GETPOSTISSET(
"statut") ?
GETPOST(
"statut",
"alpha") : 1);
48$search_ref =
GETPOST(
'search_ref',
'alpha');
50$search_lastname =
GETPOST(
'search_lastname',
'alpha');
51$search_firstname =
GETPOST(
'search_firstname',
'alpha');
52$search_login =
GETPOST(
'search_login',
'alpha');
53$search_note =
GETPOST(
'search_note',
'alpha');
54$search_account =
GETPOST(
'search_account',
'alpha');
55$search_amount =
GETPOST(
'search_amount',
'alpha');
58$date_select =
GETPOST(
"date_select",
'alpha');
62$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
63$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
65if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
69$offset = $limit * $page;
76 $sortfield =
"c.dateadh";
82$hookmanager->initHooks(array(
'subscriptionlist'));
85$extrafields->fetch_name_optionals_label(
$object->table_element);
87$search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
90$fieldstosearchall = array(
93 'd.ref' => array(
'label' =>
"Ref",
'checked' => 1),
94 'd.fk_type' => array(
'label' =>
"Type",
'checked' => 1),
95 'd.lastname' => array(
'label' =>
"Lastname",
'checked' => 1),
96 'd.firstname' => array(
'label' =>
"Firstname",
'checked' => 1),
97 'd.login' => array(
'label' =>
"Login",
'checked' => 1),
98 't.libelle' => array(
'label' =>
"Label",
'checked' => 1),
99 'd.bank' => array(
'label' =>
"BankAccount",
'checked' => 1,
'enabled' => (isModEnabled(
'bank'))),
102 'c.dateadh' => array(
'label' =>
"DateSubscription",
'checked' => 1,
'position' => 100),
103 'c.datef' => array(
'label' =>
"EndSubscription",
'checked' => 1,
'position' => 101),
104 'd.amount' => array(
'label' =>
"Amount",
'checked' => 1,
'position' => 102),
105 'c.datec' => array(
'label' =>
"DateCreation",
'checked' => 0,
'position' => 500),
106 'c.tms' => array(
'label' =>
"DateModificationShort",
'checked' => 0,
'position' => 500),
113$permissiontodelete = $user->hasRight(
'adherent',
'cotisation',
'creer');
120if (
GETPOST(
'cancel',
'alpha')) {
124if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
128$parameters = array(
'socid' => isset($socid) ? $socid : null);
129$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
134if (empty($reshook)) {
136 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
139 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
142 $search_lastname =
"";
143 $search_firstname =
"";
147 $search_account =
"";
149 $search_array_options = array();
151 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')
152 ||
GETPOST(
'button_search_x',
'alpha') ||
GETPOST(
'button_search.x',
'alpha') ||
GETPOST(
'button_search',
'alpha')) {
157 $objectclass =
'Subscription';
158 $objectlabel =
'Subscription';
159 $uploaddir = $conf->adherent->dir_output;
160 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
168$form =
new Form($db);
172$accountstatic =
new Account($db);
177$sql =
"SELECT d.rowid, d.login, d.firstname, d.lastname, d.societe, d.photo, d.statut as status,";
178$sql .=
" d.gender, d.email, d.morphy,";
179$sql .=
" c.rowid as crowid, c.fk_type, c.subscription,";
180$sql .=
" c.dateadh, c.datef, c.datec as date_creation, c.tms as date_modification,";
181$sql .=
" c.fk_bank as bank, c.note as note_private,";
182$sql .=
" b.fk_account";
184if (!empty($extrafields->attributes[
$object->table_element][
'label'])) {
185 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
186 $sql .= ($extrafields->attributes[
$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
190$parameters = array();
191$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object, $action);
192$sql .= $hookmanager->resPrint;
193$sql = preg_replace(
'/,\s*$/',
'', $sql);
197$sql .=
" FROM ".MAIN_DB_PREFIX.
"adherent as d";
198$sql .=
" JOIN ".MAIN_DB_PREFIX.
"subscription as c on d.rowid = c.fk_adherent";
199$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"adherent_extrafields as ef on (d.rowid = ef.fk_object)";
200$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"bank as b ON c.fk_bank = b.rowid";
201$sql .=
" WHERE d.entity IN (".getEntity(
'adherent').
")";
202if (isset($date_select) && $date_select !=
'') {
203 $sql .=
" AND c.dateadh >= '".((int) $date_select).
"-01-01 00:00:00'";
204 $sql .=
" AND c.dateadh < '".((int) $date_select + 1).
"-01-01 00:00:00'";
207 if (is_numeric($search_ref)) {
208 $sql .=
" AND c.rowid = ".((int) $search_ref);
210 $sql .=
" AND 1 = 2";
213if ($search_type > 0) {
216if ($search_lastname) {
217 $sql .=
natural_search(array(
'd.lastname',
'd.societe'), $search_lastname);
219if ($search_firstname) {
228if ($search_account > 0) {
229 $sql .=
" AND b.fk_account = ".((int) $search_account);
235 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
238include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
240$parameters = array();
241$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
242$sql .= $hookmanager->resPrint;
245$nbtotalofrecords =
'';
248 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
249 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
250 $resql = $db->query($sqlforcount);
252 $objforcount = $db->fetch_object($resql);
253 $nbtotalofrecords = $objforcount->nbtotalofrecords;
258 if (($page * $limit) > $nbtotalofrecords) {
266$sql .= $db->order($sortfield, $sortorder);
268 $sql .= $db->plimit($limit + 1, $offset);
271$resql = $db->query($sql);
277$num = $db->num_rows($resql);
281if ($num == 1 &&
getDolGlobalString(
'MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
282 $obj = $db->fetch_object($resql);
284 header(
"Location: ".DOL_URL_ROOT.
'/adherents/subscription/card.php?id='.$id);
291$title = $langs->trans(
"Subscriptions");
292if (!empty($date_select)) {
293 $title .=
' ('.$langs->trans(
"Year").
' '.$date_select.
')';
295$help_url =
'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder';
297llxHeader(
'', $title, $help_url, 0, 0,
'',
'',
'',
'bodyforlist');
299$arrayofselected = is_array($toselect) ? $toselect : array();
303 $param .=
'&mode='.urlencode($mode);
305if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
306 $param .=
'&contextpage='.urlencode($contextpage);
308if ($limit > 0 && $limit != $conf->liste_limit) {
309 $param .=
'&limit='.((int) $limit);
312 $param .=
"&statut=".urlencode($statut);
315 $param .=
"&search_type=".((int) $search_type);
318 $param .=
"&date_select=".urlencode($date_select);
320if ($search_lastname) {
321 $param .=
"&search_lastname=".urlencode($search_lastname);
324 $param .=
"&search_login=".urlencode($search_login);
326if ($search_account) {
327 $param .=
"&search_account=".urlencode($search_account);
330 $param .=
"&search_amount=".urlencode($search_amount);
332if ($optioncss !=
'') {
333 $param .=
'&optioncss='.urlencode($optioncss);
336include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
338$parameters = array(
'param' => &$param);
339$reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object, $action);
340$param .= $hookmanager->resPrint;
343$arrayofmassactions = array(
347if (!empty($permissiontodelete)) {
348 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
350if (
GETPOSTINT(
'nomassaction') || in_array($massaction, array(
'presend',
'predelete'))) {
351 $arrayofmassactions = array();
353$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
355print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
356if ($optioncss !=
'') {
357 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
359print
'<input type="hidden" name="token" value="'.newToken().
'">';
360print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
361print
'<input type="hidden" name="action" value="list">';
362print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
363print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
364print
'<input type="hidden" name="page" value="'.$page.
'">';
365print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
366print
'<input type="hidden" name="date_select" value="'.$date_select.
'">';
367print
'<input type="hidden" name="page_y" value="">';
368print
'<input type="hidden" name="mode" value="'.$mode.
'">';
371$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'));
372$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'));
373if ($user->hasRight(
'adherent',
'cotisation',
'creer')) {
375 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewSubscription'),
'',
'fa fa-plus-circle', DOL_URL_ROOT.
'/adherents/list.php?status=-1,1');
378print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $subscription->picto, 0, $newcardbutton,
'', $limit, 0, 0, 1);
380$topicmail =
"Information";
381$modelmail =
"subscription";
383$trackid =
'sub'.$object->id;
384include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
388 foreach ($fieldstosearchall as $key => $val) {
389 $fieldstosearchall[$key] = $langs->trans($val);
390 $setupstring .= $key.
"=".$val.
";";
392 print
'<!-- Search done like if MYOBJECT_QUICKSEARCH_ON_FIELDS = '.$setupstring.
' -->'.
"\n";
393 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).implode(
', ', $fieldstosearchall).
'</div>'.
"\n";
401$parameters = array();
402$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
403if (empty($reshook)) {
404 $moreforfilter .= $hookmanager->resPrint;
406 $moreforfilter = $hookmanager->resPrint;
409if (!empty($moreforfilter)) {
410 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
411 print $moreforfilter;
415$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
416$htmlofselectarray = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));
417$selectedfields = ($mode !=
'kanban' ? $htmlofselectarray :
'');
418$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
420print
'<div class="div-table-responsive">';
421print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
425print
'<tr class="liste_titre_filter">';
428 print
'<td class="liste_titre center maxwidthsearch">';
429 $searchpicto = $form->showFilterButtons(
'left');
435 print
'<td class="liste_titre"> </td>';
439if (!empty($arrayfields[
'd.ref'][
'checked'])) {
440 print
'<td class="liste_titre left">';
441 print
'<input class="flat maxwidth50" type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref).
'"></td>';
445if (!empty($arrayfields[
'd.fk_type'][
'checked'])) {
446 print
'<td class="liste_titre left">';
447 print $form->selectarray(
"search_type", $adht->liste_array(), $search_type, 1);
451if (!empty($arrayfields[
'd.lastname'][
'checked'])) {
452 print
'<td class="liste_titre left">';
453 print
'<input class="flat maxwidth75" type="text" name="search_lastname" value="'.dol_escape_htmltag($search_lastname).
'"></td>';
456if (!empty($arrayfields[
'd.firstname'][
'checked'])) {
457 print
'<td class="liste_titre left">';
458 print
'<input class="flat maxwidth75" type="text" name="search_firstname" value="'.dol_escape_htmltag($search_firstname).
'"></td>';
461if (!empty($arrayfields[
'd.login'][
'checked'])) {
462 print
'<td class="liste_titre left">';
463 print
'<input class="flat maxwidth75" type="text" name="search_login" value="'.dol_escape_htmltag($search_login).
'"></td>';
466if (!empty($arrayfields[
't.libelle'][
'checked'])) {
467 print
'<td class="liste_titre">';
472if (!empty($arrayfields[
'd.bank'][
'checked'])) {
473 print
'<td class="liste_titre">';
474 $form->select_comptes($search_account,
'search_account', 0,
'', 1,
'', 0,
'maxwidth100');
478if (!empty($arrayfields[
'c.dateadh'][
'checked'])) {
479 print
'<td class="liste_titre"> </td>';
482if (!empty($arrayfields[
'c.datef'][
'checked'])) {
483 print
'<td class="liste_titre"> </td>';
486if (!empty($arrayfields[
'd.amount'][
'checked'])) {
487 print
'<td class="liste_titre right">';
488 print
'<input class="flat" type="text" name="search_amount" value="'.dol_escape_htmltag($search_amount).
'" size="4">';
492include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
495$parameters = array(
'arrayfields' => $arrayfields);
496$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object, $action);
497print $hookmanager->resPrint;
499if (!empty($arrayfields[
'c.datec'][
'checked'])) {
500 print
'<td class="liste_titre">';
504if (!empty($arrayfields[
'c.tms'][
'checked'])) {
505 print
'<td class="liste_titre">';
511 print
'<td class="liste_titre center maxwidthsearch">';
512 $searchpicto = $form->showFilterButtons();
518$totalarray = array();
519$totalarray[
'nbfield'] = 0;
523print
'<tr class="liste_titre">';
526 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'align="center"', $sortfield, $sortorder,
'maxwidthsearch ');
527 $totalarray[
'nbfield']++;
529if (!empty($arrayfields[
'd.ref'][
'checked'])) {
530 print_liste_field_titre($arrayfields[
'd.ref'][
'label'], $_SERVER[
"PHP_SELF"],
"c.rowid", $param,
"",
"", $sortfield, $sortorder);
531 $totalarray[
'nbfield']++;
533if (!empty($arrayfields[
'd.fk_type'][
'checked'])) {
534 print_liste_field_titre($arrayfields[
'd.fk_type'][
'label'], $_SERVER[
"PHP_SELF"],
"c.fk_type", $param,
"",
"", $sortfield, $sortorder);
535 $totalarray[
'nbfield']++;
537if (!empty($arrayfields[
'd.lastname'][
'checked'])) {
538 print_liste_field_titre($arrayfields[
'd.lastname'][
'label'], $_SERVER[
"PHP_SELF"],
"d.lastname", $param,
"",
"", $sortfield, $sortorder);
539 $totalarray[
'nbfield']++;
541if (!empty($arrayfields[
'd.firstname'][
'checked'])) {
542 print_liste_field_titre($arrayfields[
'd.firstname'][
'label'], $_SERVER[
"PHP_SELF"],
"d.firstname", $param,
"",
"", $sortfield, $sortorder);
543 $totalarray[
'nbfield']++;
545if (!empty($arrayfields[
'd.login'][
'checked'])) {
546 print_liste_field_titre($arrayfields[
'd.login'][
'label'], $_SERVER[
"PHP_SELF"],
"d.login", $param,
"",
"", $sortfield, $sortorder);
547 $totalarray[
'nbfield']++;
549if (!empty($arrayfields[
't.libelle'][
'checked'])) {
550 print_liste_field_titre($arrayfields[
't.libelle'][
'label'], $_SERVER[
"PHP_SELF"],
"c.note", $param,
"",
'', $sortfield, $sortorder);
551 $totalarray[
'nbfield']++;
553if (!empty($arrayfields[
'd.bank'][
'checked'])) {
554 print_liste_field_titre($arrayfields[
'd.bank'][
'label'], $_SERVER[
"PHP_SELF"],
"b.fk_account", $param,
"",
"", $sortfield, $sortorder);
555 $totalarray[
'nbfield']++;
557if (!empty($arrayfields[
'c.dateadh'][
'checked'])) {
558 print_liste_field_titre($arrayfields[
'c.dateadh'][
'label'], $_SERVER[
"PHP_SELF"],
"c.dateadh", $param,
"",
'', $sortfield, $sortorder,
'center nowraponall ');
559 $totalarray[
'nbfield']++;
561if (!empty($arrayfields[
'c.datef'][
'checked'])) {
562 print_liste_field_titre($arrayfields[
'c.datef'][
'label'], $_SERVER[
"PHP_SELF"],
"c.datef", $param,
"",
'', $sortfield, $sortorder,
'center nowraponall ');
563 $totalarray[
'nbfield']++;
565if (!empty($arrayfields[
'd.amount'][
'checked'])) {
566 print_liste_field_titre($arrayfields[
'd.amount'][
'label'], $_SERVER[
"PHP_SELF"],
"c.subscription", $param,
"",
'', $sortfield, $sortorder,
'right ');
567 $totalarray[
'nbfield']++;
571include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
574$parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder,
'totalarray' => &$totalarray);
575$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object, $action);
576print $hookmanager->resPrint;
577if (!empty($arrayfields[
'c.datec'][
'checked'])) {
578 print_liste_field_titre($arrayfields[
'c.datec'][
'label'], $_SERVER[
"PHP_SELF"],
"c.datec",
"", $param,
'align="center" class="nowrap"', $sortfield, $sortorder);
580if (!empty($arrayfields[
'c.tms'][
'checked'])) {
581 print_liste_field_titre($arrayfields[
'c.tms'][
'label'], $_SERVER[
"PHP_SELF"],
"c.tms",
"", $param,
'align="center" class="nowrap"', $sortfield, $sortorder);
585 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
586 $totalarray[
'nbfield']++;
593$savnbfield = $totalarray[
'nbfield'];
594$totalarray = array();
595$totalarray[
'nbfield'] = 0;
596$imaxinloop = ($limit ? min($num, $limit) : $num);
597while ($i < $imaxinloop) {
598 $obj = $db->fetch_object($resql);
603 $subscription->ref = $obj->crowid;
604 $subscription->id = $obj->crowid;
605 $subscription->dateh = $db->jdate($obj->dateadh);
606 $subscription->datef = $db->jdate($obj->datef);
607 $subscription->amount = $obj->subscription;
608 $subscription->fk_adherent = $obj->rowid;
610 $adherent->lastname = $obj->lastname;
611 $adherent->firstname = $obj->firstname;
612 $adherent->ref = $obj->rowid;
613 $adherent->id = $obj->rowid;
614 $adherent->statut = $obj->status;
615 $adherent->status = $obj->status;
616 $adherent->login = $obj->login;
617 $adherent->photo = $obj->photo;
618 $adherent->gender = $obj->gender;
619 $adherent->morphy = $obj->morphy;
620 $adherent->email = $obj->email;
621 $adherent->typeid = $obj->fk_type;
622 $adherent->datefin = $db->jdate($obj->datef);
624 $typeid = ($obj->fk_type > 0 ? $obj->fk_type : $adherent->typeid);
626 $adht->fetch($typeid);
628 $adherent->need_subscription = $adht->subscription;
630 if ($mode ==
'kanban') {
632 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
633 print
'<div class="box-flex-container kanban">';
636 if ($massactionbutton || $massaction) {
638 if (in_array(
$object->id, $arrayofselected)) {
645 if ($obj->fk_account > 0) {
646 $accountstatic->id = $obj->fk_account;
647 $accountstatic->fetch($obj->fk_account);
650 print $subscription->getKanbanView(
'', array(
'selected' => in_array(
$object->id, $arrayofselected),
'adherent_type' => $adht,
'member' => $adherent,
'bank' => ($obj->fk_account > 0 ? $accountstatic : null)));
651 if ($i == ($imaxinloop - 1)) {
658 print
'<tr data-rowid="'.$object->id.
'" class="oddeven">';
661 print
'<td class="nowrap center">';
662 if ($massactionbutton || $massaction) {
664 if (in_array($obj->crowid, $arrayofselected)) {
667 print
'<input id="cb'.$obj->crowid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->crowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
671 $totalarray[
'nbfield']++;
675 if (!empty($arrayfields[
'd.ref'][
'checked'])) {
676 print
'<td class="nowraponall">'.$subscription->getNomUrl(1).
'</td>';
678 $totalarray[
'nbfield']++;
682 if (!empty($arrayfields[
'd.fk_type'][
'checked'])) {
683 print
'<td class="tdoverflowmax100">';
685 print $adht->getNomUrl(1);
689 $totalarray[
'nbfield']++;
694 if (!empty($arrayfields[
'd.lastname'][
'checked'])) {
695 print
'<td class="tdoverflowmax125">'.$adherent->getNomUrl(-1, 0,
'card',
'lastname').
'</td>';
697 $totalarray[
'nbfield']++;
701 if (!empty($arrayfields[
'd.firstname'][
'checked'])) {
702 print
'<td class="tdoverflowmax125" title="'.dol_escape_htmltag($adherent->firstname).
'">'.
dol_escape_htmltag($adherent->firstname).
'</td>';
704 $totalarray[
'nbfield']++;
709 if (!empty($arrayfields[
'd.login'][
'checked'])) {
710 print
'<td class="tdoverflowmax150" title="'.dol_escape_htmltag($adherent->login).
'">'.
dol_escape_htmltag($adherent->login).
'</td>';
712 $totalarray[
'nbfield']++;
717 if (!empty($arrayfields[
't.libelle'][
'checked'])) {
718 print
'<td class="tdoverflowmax400" title="'.dol_escape_htmltag($obj->note_private).
'">';
722 $totalarray[
'nbfield']++;
727 if (!empty($arrayfields[
'd.bank'][
'checked'])) {
728 print
'<td class="tdmaxoverflow100">';
729 if ($obj->fk_account > 0) {
730 $accountstatic->id = $obj->fk_account;
731 $accountstatic->fetch($obj->fk_account);
733 print $accountstatic->getNomUrl(1);
737 $totalarray[
'nbfield']++;
742 if (!empty($arrayfields[
'c.dateadh'][
'checked'])) {
743 print
'<td class="center nowraponall">'.dol_print_date($db->jdate($obj->dateadh),
'day').
"</td>\n";
745 $totalarray[
'nbfield']++;
749 if (!empty($arrayfields[
'c.datef'][
'checked'])) {
750 print
'<td class="center nowraponall">'.dol_print_date($db->jdate($obj->datef),
'day').
"</td>\n";
752 $totalarray[
'nbfield']++;
756 if (!empty($arrayfields[
'd.amount'][
'checked'])) {
757 print
'<td class="right amount">'.price($obj->subscription).
'</td>';
759 $totalarray[
'nbfield']++;
762 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'd.amount';
764 if (empty($totalarray[
'val'][
'd.amount'])) {
765 $totalarray[
'val'][
'd.amount'] = $obj->subscription;
767 $totalarray[
'val'][
'd.amount'] += $obj->subscription;
771 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
773 $parameters = array(
'arrayfields' => $arrayfields,
'obj' => $obj,
'i' => $i,
'totalarray' => &$totalarray);
774 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters);
775 print $hookmanager->resPrint;
777 if (!empty($arrayfields[
'c.datec'][
'checked'])) {
778 print
'<td class="nowrap center">';
779 print
dol_print_date($db->jdate($obj->date_creation),
'dayhour',
'tzuser');
782 $totalarray[
'nbfield']++;
786 if (!empty($arrayfields[
'c.tms'][
'checked'])) {
787 print
'<td class="nowrap center">';
788 print
dol_print_date($db->jdate($obj->date_modification),
'dayhour',
'tzuser');
791 $totalarray[
'nbfield']++;
796 print
'<td class="nowrap center">';
797 if ($massactionbutton || $massaction) {
799 if (in_array($obj->crowid, $arrayofselected)) {
802 print
'<input id="cb'.$obj->crowid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->crowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
806 $totalarray[
'nbfield']++;
816include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
822 foreach ($arrayfields as $key => $val) {
823 if (!empty($val[
'checked'])) {
827 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
832$parameters = array(
'arrayfields' => $arrayfields,
'sql' => $sql);
833$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
834print $hookmanager->resPrint;
836print
'</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()
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.
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.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
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 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.