30require
'../../main.inc.php';
31require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
32require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent_type.class.php';
33require_once DOL_DOCUMENT_ROOT.
'/adherents/class/subscription.class.php';
34require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
44$langs->loadLangs(array(
"members",
"companies",
"banks"));
46$action =
GETPOST(
'action',
'aZ09') ?
GETPOST(
'action',
'aZ09') :
'view';
47$massaction =
GETPOST(
'massaction',
'alpha');
49$confirm =
GETPOST(
'confirm',
'alpha');
50$cancel =
GETPOST(
'cancel',
'alpha');
51$toselect =
GETPOST(
'toselect',
'array');
52$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') : str_replace(
'_',
'', basename(dirname(__FILE__)).basename(__FILE__,
'.php'));
53$backtopage =
GETPOST(
'backtopage',
'alpha');
54$optioncss =
GETPOST(
'optioncss',
'aZ');
57$statut = (GETPOSTISSET(
"statut") ?
GETPOST(
"statut",
"alpha") : 1);
58$search_ref =
GETPOST(
'search_ref',
'alpha');
60$search_lastname =
GETPOST(
'search_lastname',
'alpha');
61$search_firstname =
GETPOST(
'search_firstname',
'alpha');
62$search_login =
GETPOST(
'search_login',
'alpha');
63$search_note =
GETPOST(
'search_note',
'alpha');
64$search_account =
GETPOST(
'search_account',
'alpha');
65$search_amount =
GETPOST(
'search_amount',
'alpha');
66$search_all = trim(
GETPOST(
'search_all',
'alphanohtml'));
68$date_select =
GETPOST(
"date_select",
'alpha');
72$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
73$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
75if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
79$offset = $limit * $page;
86 $sortfield =
"c.dateadh";
92$hookmanager->initHooks(array(
'subscriptionlist'));
95$extrafields->fetch_name_optionals_label(
$object->table_element);
97$search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
100$fieldstosearchall = array(
105 'd.ref' => array(
'label' =>
"Ref",
'checked' => 1),
106 'd.fk_type' => array(
'label' =>
"Type",
'checked' => 1),
107 'd.lastname' => array(
'label' =>
"Lastname",
'checked' => 1),
108 'd.firstname' => array(
'label' =>
"Firstname",
'checked' => 1),
109 'd.login' => array(
'label' =>
"Login",
'checked' => 1),
110 'c.note' => array(
'label' =>
"Label",
'checked' => 1),
111 'd.bank' => array(
'label' =>
"BankAccount",
'checked' => 1,
'enabled' => (isModEnabled(
'bank'))),
114 'c.dateadh' => array(
'label' =>
"DateSubscription",
'checked' => 1,
'position' => 100),
115 'c.datef' => array(
'label' =>
"EndSubscription",
'checked' => 1,
'position' => 101),
116 'd.amount' => array(
'label' =>
"Amount",
'checked' => 1,
'position' => 102),
117 'c.datec' => array(
'label' =>
"DateCreation",
'checked' => 0,
'position' => 500),
118 'c.tms' => array(
'label' =>
"DateModificationShort",
'checked' => 0,
'position' => 500),
125$permissiontodelete = $user->hasRight(
'adherent',
'cotisation',
'creer');
132if (
GETPOST(
'cancel',
'alpha')) {
136if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
140$parameters = array(
'socid' => isset($socid) ? $socid : null);
141$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
146if (empty($reshook)) {
148 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
151 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
154 $search_lastname =
"";
155 $search_firstname =
"";
159 $search_account =
"";
161 $search_array_options = array();
163 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')
164 ||
GETPOST(
'button_search_x',
'alpha') ||
GETPOST(
'button_search.x',
'alpha') ||
GETPOST(
'button_search',
'alpha')) {
169 $objectclass =
'Subscription';
170 $objectlabel =
'Subscription';
171 $uploaddir =
$conf->member->dir_output;
172 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
180$form =
new Form($db);
184$accountstatic =
new Account($db);
189$sql =
"SELECT d.rowid, d.login, d.firstname, d.lastname, d.societe, d.photo, d.statut as status,";
190$sql .=
" d.gender, d.email, d.morphy,";
191$sql .=
" c.rowid as crowid, c.fk_type, c.subscription,";
192$sql .=
" c.dateadh, c.datef, c.datec as date_creation, c.tms as date_modification,";
193$sql .=
" c.fk_bank as bank, c.note as note_private,";
194$sql .=
" b.fk_account";
196if (!empty($extrafields->attributes[
$object->table_element][
'label'])) {
197 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
198 $sql .= ($extrafields->attributes[
$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
202$parameters = array();
203$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object, $action);
204$sql .= $hookmanager->resPrint;
205$sql = preg_replace(
'/,\s*$/',
'', $sql);
209$sql .=
" FROM ".MAIN_DB_PREFIX.
"adherent as d";
210$sql .=
" JOIN ".MAIN_DB_PREFIX.
"subscription as c on d.rowid = c.fk_adherent";
211$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"adherent_extrafields as ef on (d.rowid = ef.fk_object)";
212$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"bank as b ON c.fk_bank = b.rowid";
213$sql .=
" WHERE d.entity IN (".getEntity(
'adherent').
")";
214if (isset($date_select) && $date_select !=
'') {
215 $sql .=
" AND c.dateadh >= '".((int) $date_select).
"-01-01 00:00:00'";
216 $sql .=
" AND c.dateadh < '".((int) $date_select + 1).
"-01-01 00:00:00'";
219 if (is_numeric($search_ref)) {
220 $sql .=
" AND c.rowid = ".((int) $search_ref);
222 $sql .=
" AND 1 = 2";
225if ($search_type > 0) {
228if ($search_lastname) {
229 $sql .=
natural_search(array(
'd.lastname',
'd.societe'), $search_lastname);
231if ($search_firstname) {
240if ($search_account > 0) {
241 $sql .=
" AND b.fk_account = ".((int) $search_account);
247 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
250include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
252$parameters = array();
253$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
254$sql .= $hookmanager->resPrint;
257$nbtotalofrecords =
'';
260 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
261 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
262 $resql = $db->query($sqlforcount);
264 $objforcount = $db->fetch_object($resql);
265 $nbtotalofrecords = $objforcount->nbtotalofrecords;
270 if (($page * $limit) > $nbtotalofrecords) {
278$sql .= $db->order($sortfield, $sortorder);
280 $sql .= $db->plimit($limit + 1, $offset);
283$resql = $db->query($sql);
289$num = $db->num_rows($resql);
293if ($num == 1 &&
getDolGlobalString(
'MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
294 $obj = $db->fetch_object($resql);
296 header(
"Location: ".DOL_URL_ROOT.
'/adherents/subscription/card.php?id='.
$id);
303$title = $langs->trans(
"Subscriptions");
304if (!empty($date_select)) {
305 $title .=
' ('.$langs->trans(
"Year").
' '.$date_select.
')';
307$help_url =
'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder';
309llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'mod-member page-subscription-list bodyforlist');
311$arrayofselected = is_array($toselect) ? $toselect : array();
315 $param .=
'&mode='.urlencode($mode);
317if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
318 $param .=
'&contextpage='.urlencode($contextpage);
320if ($limit > 0 && $limit !=
$conf->liste_limit) {
321 $param .=
'&limit='.((int) $limit);
324 $param .=
"&statut=".urlencode($statut);
327 $param .=
"&search_type=".((int) $search_type);
330 $param .=
"&date_select=".urlencode($date_select);
332if ($search_lastname) {
333 $param .=
"&search_lastname=".urlencode($search_lastname);
336 $param .=
"&search_login=".urlencode($search_login);
338if ($search_account) {
339 $param .=
"&search_account=".urlencode($search_account);
342 $param .=
"&search_amount=".urlencode($search_amount);
344if ($optioncss !=
'') {
345 $param .=
'&optioncss='.urlencode($optioncss);
348include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
350$parameters = array(
'param' => &$param);
351$reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object, $action);
352$param .= $hookmanager->resPrint;
355$arrayofmassactions = array(
359if (!empty($permissiontodelete)) {
360 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
362if (
GETPOSTINT(
'nomassaction') || in_array($massaction, array(
'presend',
'predelete'))) {
363 $arrayofmassactions = array();
365$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
367print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
368if ($optioncss !=
'') {
369 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
371print
'<input type="hidden" name="token" value="'.newToken().
'">';
372print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
373print
'<input type="hidden" name="action" value="list">';
374print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
375print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
376print
'<input type="hidden" name="page" value="'.$page.
'">';
377print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
378print
'<input type="hidden" name="date_select" value="'.$date_select.
'">';
379print
'<input type="hidden" name="page_y" value="">';
380print
'<input type="hidden" name="mode" value="'.$mode.
'">';
383$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'));
384$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'));
385if ($user->hasRight(
'adherent',
'cotisation',
'creer')) {
387 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewSubscription'),
'',
'fa fa-plus-circle', DOL_URL_ROOT.
'/adherents/list.php?status=-1,1');
390print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $subscription->picto, 0, $newcardbutton,
'', $limit, 0, 0, 1);
392$topicmail =
"Information";
393$modelmail =
"subscription";
395$trackid =
'sub'.$object->id;
396include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
400 foreach ($fieldstosearchall as $key => $val) {
401 $fieldstosearchall[$key] = $langs->trans($val);
402 $setupstring .= $key.
"=".$val.
";";
404 print
'<!-- Search done like if MYOBJECT_QUICKSEARCH_ON_FIELDS = '.$setupstring.
' -->'.
"\n";
405 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).implode(
', ', $fieldstosearchall).
'</div>'.
"\n";
413$parameters = array();
414$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
415if (empty($reshook)) {
416 $moreforfilter .= $hookmanager->resPrint;
418 $moreforfilter = $hookmanager->resPrint;
421if (!empty($moreforfilter)) {
422 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
423 print $moreforfilter;
427$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
428$htmlofselectarray = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));
429$selectedfields = ($mode !=
'kanban' ? $htmlofselectarray :
'');
430$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
432print
'<div class="div-table-responsive">';
433print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
437print
'<tr class="liste_titre_filter">';
440 print
'<td class="liste_titre center maxwidthsearch">';
441 $searchpicto = $form->showFilterButtons(
'left');
447 print
'<td class="liste_titre"> </td>';
451if (!empty($arrayfields[
'd.ref'][
'checked'])) {
452 print
'<td class="liste_titre left">';
453 print
'<input class="flat maxwidth50" type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref).
'"></td>';
457if (!empty($arrayfields[
'd.fk_type'][
'checked'])) {
458 print
'<td class="liste_titre left">';
459 print $form->selectarray(
"search_type", $adht->liste_array(), $search_type, 1);
463if (!empty($arrayfields[
'd.lastname'][
'checked'])) {
464 print
'<td class="liste_titre left">';
465 print
'<input class="flat maxwidth75" type="text" name="search_lastname" value="'.dol_escape_htmltag($search_lastname).
'"></td>';
468if (!empty($arrayfields[
'd.firstname'][
'checked'])) {
469 print
'<td class="liste_titre left">';
470 print
'<input class="flat maxwidth75" type="text" name="search_firstname" value="'.dol_escape_htmltag($search_firstname).
'"></td>';
473if (!empty($arrayfields[
'd.login'][
'checked'])) {
474 print
'<td class="liste_titre left">';
475 print
'<input class="flat maxwidth75" type="text" name="search_login" value="'.dol_escape_htmltag($search_login).
'"></td>';
478if (!empty($arrayfields[
'c.note'][
'checked'])) {
479 print
'<td class="liste_titre">';
484if (!empty($arrayfields[
'd.bank'][
'checked'])) {
485 print
'<td class="liste_titre">';
486 $form->select_comptes($search_account,
'search_account', 0,
'', 1,
'', 0,
'maxwidth100');
490if (!empty($arrayfields[
'c.dateadh'][
'checked'])) {
491 print
'<td class="liste_titre"> </td>';
494if (!empty($arrayfields[
'c.datef'][
'checked'])) {
495 print
'<td class="liste_titre"> </td>';
498if (!empty($arrayfields[
'd.amount'][
'checked'])) {
499 print
'<td class="liste_titre right">';
500 print
'<input class="flat" type="text" name="search_amount" value="'.dol_escape_htmltag($search_amount).
'" size="4">';
504include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
507$parameters = array(
'arrayfields' => $arrayfields);
508$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object, $action);
509print $hookmanager->resPrint;
511if (!empty($arrayfields[
'c.datec'][
'checked'])) {
512 print
'<td class="liste_titre">';
516if (!empty($arrayfields[
'c.tms'][
'checked'])) {
517 print
'<td class="liste_titre">';
523 print
'<td class="liste_titre center maxwidthsearch">';
524 $searchpicto = $form->showFilterButtons();
530$totalarray = array();
531$totalarray[
'nbfield'] = 0;
535print
'<tr class="liste_titre">';
538 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'align="center"', $sortfield, $sortorder,
'maxwidthsearch ');
539 $totalarray[
'nbfield']++;
541if (!empty($arrayfields[
'd.ref'][
'checked'])) {
542 print_liste_field_titre($arrayfields[
'd.ref'][
'label'], $_SERVER[
"PHP_SELF"],
"c.rowid", $param,
"",
"", $sortfield, $sortorder);
543 $totalarray[
'nbfield']++;
545if (!empty($arrayfields[
'd.fk_type'][
'checked'])) {
546 print_liste_field_titre($arrayfields[
'd.fk_type'][
'label'], $_SERVER[
"PHP_SELF"],
"c.fk_type", $param,
"",
"", $sortfield, $sortorder);
547 $totalarray[
'nbfield']++;
549if (!empty($arrayfields[
'd.lastname'][
'checked'])) {
550 print_liste_field_titre($arrayfields[
'd.lastname'][
'label'], $_SERVER[
"PHP_SELF"],
"d.lastname", $param,
"",
"", $sortfield, $sortorder);
551 $totalarray[
'nbfield']++;
553if (!empty($arrayfields[
'd.firstname'][
'checked'])) {
554 print_liste_field_titre($arrayfields[
'd.firstname'][
'label'], $_SERVER[
"PHP_SELF"],
"d.firstname", $param,
"",
"", $sortfield, $sortorder);
555 $totalarray[
'nbfield']++;
557if (!empty($arrayfields[
'd.login'][
'checked'])) {
558 print_liste_field_titre($arrayfields[
'd.login'][
'label'], $_SERVER[
"PHP_SELF"],
"d.login", $param,
"",
"", $sortfield, $sortorder);
559 $totalarray[
'nbfield']++;
561if (!empty($arrayfields[
'c.note'][
'checked'])) {
562 print_liste_field_titre($arrayfields[
'c.note'][
'label'], $_SERVER[
"PHP_SELF"],
"c.note", $param,
"",
'', $sortfield, $sortorder);
563 $totalarray[
'nbfield']++;
565if (!empty($arrayfields[
'd.bank'][
'checked'])) {
566 print_liste_field_titre($arrayfields[
'd.bank'][
'label'], $_SERVER[
"PHP_SELF"],
"b.fk_account", $param,
"",
"", $sortfield, $sortorder);
567 $totalarray[
'nbfield']++;
569if (!empty($arrayfields[
'c.dateadh'][
'checked'])) {
570 print_liste_field_titre($arrayfields[
'c.dateadh'][
'label'], $_SERVER[
"PHP_SELF"],
"c.dateadh", $param,
"",
'', $sortfield, $sortorder,
'center nowraponall ');
571 $totalarray[
'nbfield']++;
573if (!empty($arrayfields[
'c.datef'][
'checked'])) {
574 print_liste_field_titre($arrayfields[
'c.datef'][
'label'], $_SERVER[
"PHP_SELF"],
"c.datef", $param,
"",
'', $sortfield, $sortorder,
'center nowraponall ');
575 $totalarray[
'nbfield']++;
577if (!empty($arrayfields[
'd.amount'][
'checked'])) {
578 print_liste_field_titre($arrayfields[
'd.amount'][
'label'], $_SERVER[
"PHP_SELF"],
"c.subscription", $param,
"",
'', $sortfield, $sortorder,
'right ');
579 $totalarray[
'nbfield']++;
583include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
586$parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder,
'totalarray' => &$totalarray);
587$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object, $action);
588print $hookmanager->resPrint;
589if (!empty($arrayfields[
'c.datec'][
'checked'])) {
590 print_liste_field_titre($arrayfields[
'c.datec'][
'label'], $_SERVER[
"PHP_SELF"],
"c.datec",
"", $param,
'align="center" class="nowrap"', $sortfield, $sortorder);
592if (!empty($arrayfields[
'c.tms'][
'checked'])) {
593 print_liste_field_titre($arrayfields[
'c.tms'][
'label'], $_SERVER[
"PHP_SELF"],
"c.tms",
"", $param,
'align="center" class="nowrap"', $sortfield, $sortorder);
597 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
598 $totalarray[
'nbfield']++;
605$savnbfield = $totalarray[
'nbfield'];
606$totalarray = array();
607$totalarray[
'nbfield'] = 0;
608$imaxinloop = ($limit ? min($num, $limit) : $num);
609while ($i < $imaxinloop) {
610 $obj = $db->fetch_object($resql);
615 $subscription->ref = $obj->crowid;
616 $subscription->id = $obj->crowid;
617 $subscription->dateh = $db->jdate($obj->dateadh);
618 $subscription->datef = $db->jdate($obj->datef);
619 $subscription->amount = $obj->subscription;
620 $subscription->fk_adherent = $obj->rowid;
622 $adherent->lastname = $obj->lastname;
623 $adherent->firstname = $obj->firstname;
624 $adherent->ref = $obj->rowid;
625 $adherent->id = $obj->rowid;
626 $adherent->statut = $obj->status;
627 $adherent->status = $obj->status;
628 $adherent->login = $obj->login;
629 $adherent->photo = $obj->photo;
630 $adherent->gender = $obj->gender;
631 $adherent->morphy = $obj->morphy;
632 $adherent->email = $obj->email;
633 $adherent->typeid = $obj->fk_type;
634 $adherent->datefin = $db->jdate($obj->datef);
636 $typeid = ($obj->fk_type > 0 ? $obj->fk_type : $adherent->typeid);
638 $adht->fetch($typeid);
640 $adherent->need_subscription = $adht->subscription;
642 if ($mode ==
'kanban') {
644 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
645 print
'<div class="box-flex-container kanban">';
648 if ($massactionbutton || $massaction) {
650 if (in_array(
$object->id, $arrayofselected)) {
657 if ($obj->fk_account > 0) {
658 $accountstatic->id = $obj->fk_account;
659 $accountstatic->fetch($obj->fk_account);
662 print $subscription->getKanbanView(
'', array(
'selected' => in_array(
$object->id, $arrayofselected),
'adherent_type' => $adht,
'member' => $adherent,
'bank' => ($obj->fk_account > 0 ? $accountstatic : null)));
663 if ($i == ($imaxinloop - 1)) {
670 print
'<tr data-rowid="'.$object->id.
'" class="oddeven">';
673 print
'<td class="nowrap center">';
674 if ($massactionbutton || $massaction) {
676 if (in_array($obj->crowid, $arrayofselected)) {
679 print
'<input id="cb'.$obj->crowid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->crowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
683 $totalarray[
'nbfield']++;
687 if (!empty($arrayfields[
'd.ref'][
'checked'])) {
688 print
'<td class="nowraponall">'.$subscription->getNomUrl(1).
'</td>';
690 $totalarray[
'nbfield']++;
694 if (!empty($arrayfields[
'd.fk_type'][
'checked'])) {
695 print
'<td class="tdoverflowmax100">';
697 print $adht->getNomUrl(1);
701 $totalarray[
'nbfield']++;
706 if (!empty($arrayfields[
'd.lastname'][
'checked'])) {
707 print
'<td class="tdoverflowmax125">'.$adherent->getNomUrl(-1, 0,
'card',
'lastname').
'</td>';
709 $totalarray[
'nbfield']++;
713 if (!empty($arrayfields[
'd.firstname'][
'checked'])) {
714 print
'<td class="tdoverflowmax125" title="'.dol_escape_htmltag($adherent->firstname).
'">'.
dol_escape_htmltag($adherent->firstname).
'</td>';
716 $totalarray[
'nbfield']++;
721 if (!empty($arrayfields[
'd.login'][
'checked'])) {
722 print
'<td class="tdoverflowmax150" title="'.dol_escape_htmltag($adherent->login).
'">'.
dol_escape_htmltag($adherent->login).
'</td>';
724 $totalarray[
'nbfield']++;
729 if (!empty($arrayfields[
'c.note'][
'checked'])) {
730 print
'<td class="tdoverflowmax400" title="'.dol_escape_htmltag($obj->note_private).
'">';
734 $totalarray[
'nbfield']++;
739 if (!empty($arrayfields[
'd.bank'][
'checked'])) {
740 print
'<td class="tdmaxoverflow100">';
741 if ($obj->fk_account > 0) {
742 $accountstatic->id = $obj->fk_account;
743 $accountstatic->fetch($obj->fk_account);
745 print $accountstatic->getNomUrl(1);
749 $totalarray[
'nbfield']++;
754 if (!empty($arrayfields[
'c.dateadh'][
'checked'])) {
755 print
'<td class="center nowraponall">'.dol_print_date($db->jdate($obj->dateadh),
'day').
"</td>\n";
757 $totalarray[
'nbfield']++;
761 if (!empty($arrayfields[
'c.datef'][
'checked'])) {
762 print
'<td class="center nowraponall">'.dol_print_date($db->jdate($obj->datef),
'day').
"</td>\n";
764 $totalarray[
'nbfield']++;
768 if (!empty($arrayfields[
'd.amount'][
'checked'])) {
769 print
'<td class="right amount">'.price($obj->subscription).
'</td>';
771 $totalarray[
'nbfield']++;
774 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'd.amount';
776 if (empty($totalarray[
'val'][
'd.amount'])) {
777 $totalarray[
'val'][
'd.amount'] = $obj->subscription;
779 $totalarray[
'val'][
'd.amount'] += $obj->subscription;
783 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
785 $parameters = array(
'arrayfields' => $arrayfields,
'obj' => $obj,
'i' => $i,
'totalarray' => &$totalarray);
786 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters);
787 print $hookmanager->resPrint;
789 if (!empty($arrayfields[
'c.datec'][
'checked'])) {
790 print
'<td class="nowrap center">';
791 print
dol_print_date($db->jdate($obj->date_creation),
'dayhour',
'tzuser');
794 $totalarray[
'nbfield']++;
798 if (!empty($arrayfields[
'c.tms'][
'checked'])) {
799 print
'<td class="nowrap center">';
800 print
dol_print_date($db->jdate($obj->date_modification),
'dayhour',
'tzuser');
803 $totalarray[
'nbfield']++;
808 print
'<td class="nowrap center">';
809 if ($massactionbutton || $massaction) {
811 if (in_array($obj->crowid, $arrayofselected)) {
814 print
'<input id="cb'.$obj->crowid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->crowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
818 $totalarray[
'nbfield']++;
828include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
834 foreach ($arrayfields as $key => $val) {
835 if (!empty($val[
'checked'])) {
839 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
844$parameters = array(
'arrayfields' => $arrayfields,
'sql' => $sql);
845$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
846print $hookmanager->resPrint;
848print
'</table>'.
"\n";
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
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.
print_barre_liste($title, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $selectlimitsuffix=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
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.
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...
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
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.