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');
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(
103 'd.ref' => array(
'label' =>
"Ref",
'checked' => 1),
104 'd.fk_type' => array(
'label' =>
"Type",
'checked' => 1),
105 'd.lastname' => array(
'label' =>
"Lastname",
'checked' => 1),
106 'd.firstname' => array(
'label' =>
"Firstname",
'checked' => 1),
107 'd.login' => array(
'label' =>
"Login",
'checked' => 1),
108 't.libelle' => array(
'label' =>
"Label",
'checked' => 1),
109 'd.bank' => array(
'label' =>
"BankAccount",
'checked' => 1,
'enabled' => (isModEnabled(
'bank'))),
112 'c.dateadh' => array(
'label' =>
"DateSubscription",
'checked' => 1,
'position' => 100),
113 'c.datef' => array(
'label' =>
"EndSubscription",
'checked' => 1,
'position' => 101),
114 'd.amount' => array(
'label' =>
"Amount",
'checked' => 1,
'position' => 102),
115 'c.datec' => array(
'label' =>
"DateCreation",
'checked' => 0,
'position' => 500),
116 'c.tms' => array(
'label' =>
"DateModificationShort",
'checked' => 0,
'position' => 500),
123$permissiontodelete = $user->hasRight(
'adherent',
'cotisation',
'creer');
130if (
GETPOST(
'cancel',
'alpha')) {
134if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
138$parameters = array(
'socid' => isset($socid) ? $socid : null);
139$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
144if (empty($reshook)) {
146 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
149 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
152 $search_lastname =
"";
153 $search_firstname =
"";
157 $search_account =
"";
159 $search_array_options = array();
161 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')
162 ||
GETPOST(
'button_search_x',
'alpha') ||
GETPOST(
'button_search.x',
'alpha') ||
GETPOST(
'button_search',
'alpha')) {
167 $objectclass =
'Subscription';
168 $objectlabel =
'Subscription';
169 $uploaddir =
$conf->adherent->dir_output;
170 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
178$form =
new Form($db);
182$accountstatic =
new Account($db);
187$sql =
"SELECT d.rowid, d.login, d.firstname, d.lastname, d.societe, d.photo, d.statut as status,";
188$sql .=
" d.gender, d.email, d.morphy,";
189$sql .=
" c.rowid as crowid, c.fk_type, c.subscription,";
190$sql .=
" c.dateadh, c.datef, c.datec as date_creation, c.tms as date_modification,";
191$sql .=
" c.fk_bank as bank, c.note as note_private,";
192$sql .=
" b.fk_account";
194if (!empty($extrafields->attributes[
$object->table_element][
'label'])) {
195 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
196 $sql .= ($extrafields->attributes[
$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
200$parameters = array();
201$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object, $action);
202$sql .= $hookmanager->resPrint;
203$sql = preg_replace(
'/,\s*$/',
'', $sql);
207$sql .=
" FROM ".MAIN_DB_PREFIX.
"adherent as d";
208$sql .=
" JOIN ".MAIN_DB_PREFIX.
"subscription as c on d.rowid = c.fk_adherent";
209$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"adherent_extrafields as ef on (d.rowid = ef.fk_object)";
210$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"bank as b ON c.fk_bank = b.rowid";
211$sql .=
" WHERE d.entity IN (".getEntity(
'adherent').
")";
212if (isset($date_select) && $date_select !=
'') {
213 $sql .=
" AND c.dateadh >= '".((int) $date_select).
"-01-01 00:00:00'";
214 $sql .=
" AND c.dateadh < '".((int) $date_select + 1).
"-01-01 00:00:00'";
217 if (is_numeric($search_ref)) {
218 $sql .=
" AND c.rowid = ".((int) $search_ref);
220 $sql .=
" AND 1 = 2";
223if ($search_type > 0) {
226if ($search_lastname) {
227 $sql .=
natural_search(array(
'd.lastname',
'd.societe'), $search_lastname);
229if ($search_firstname) {
238if ($search_account > 0) {
239 $sql .=
" AND b.fk_account = ".((int) $search_account);
245 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
248include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
250$parameters = array();
251$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
252$sql .= $hookmanager->resPrint;
255$nbtotalofrecords =
'';
258 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
259 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
260 $resql = $db->query($sqlforcount);
262 $objforcount = $db->fetch_object($resql);
263 $nbtotalofrecords = $objforcount->nbtotalofrecords;
268 if (($page * $limit) > $nbtotalofrecords) {
276$sql .= $db->order($sortfield, $sortorder);
278 $sql .= $db->plimit($limit + 1, $offset);
281$resql = $db->query($sql);
287$num = $db->num_rows($resql);
291if ($num == 1 &&
getDolGlobalString(
'MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
292 $obj = $db->fetch_object($resql);
294 header(
"Location: ".DOL_URL_ROOT.
'/adherents/subscription/card.php?id='.
$id);
301$title = $langs->trans(
"Subscriptions");
302if (!empty($date_select)) {
303 $title .=
' ('.$langs->trans(
"Year").
' '.$date_select.
')';
305$help_url =
'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder';
307llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'mod-member page-subscription-list bodyforlist');
309$arrayofselected = is_array($toselect) ? $toselect : array();
313 $param .=
'&mode='.urlencode($mode);
315if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
316 $param .=
'&contextpage='.urlencode($contextpage);
318if ($limit > 0 && $limit !=
$conf->liste_limit) {
319 $param .=
'&limit='.((int) $limit);
322 $param .=
"&statut=".urlencode($statut);
325 $param .=
"&search_type=".((int) $search_type);
328 $param .=
"&date_select=".urlencode($date_select);
330if ($search_lastname) {
331 $param .=
"&search_lastname=".urlencode($search_lastname);
334 $param .=
"&search_login=".urlencode($search_login);
336if ($search_account) {
337 $param .=
"&search_account=".urlencode($search_account);
340 $param .=
"&search_amount=".urlencode($search_amount);
342if ($optioncss !=
'') {
343 $param .=
'&optioncss='.urlencode($optioncss);
346include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
348$parameters = array(
'param' => &$param);
349$reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object, $action);
350$param .= $hookmanager->resPrint;
353$arrayofmassactions = array(
357if (!empty($permissiontodelete)) {
358 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
360if (
GETPOSTINT(
'nomassaction') || in_array($massaction, array(
'presend',
'predelete'))) {
361 $arrayofmassactions = array();
363$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
365print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
366if ($optioncss !=
'') {
367 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
369print
'<input type="hidden" name="token" value="'.newToken().
'">';
370print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
371print
'<input type="hidden" name="action" value="list">';
372print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
373print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
374print
'<input type="hidden" name="page" value="'.$page.
'">';
375print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
376print
'<input type="hidden" name="date_select" value="'.$date_select.
'">';
377print
'<input type="hidden" name="page_y" value="">';
378print
'<input type="hidden" name="mode" value="'.$mode.
'">';
381$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'));
382$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'));
383if ($user->hasRight(
'adherent',
'cotisation',
'creer')) {
385 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewSubscription'),
'',
'fa fa-plus-circle', DOL_URL_ROOT.
'/adherents/list.php?status=-1,1');
388print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $subscription->picto, 0, $newcardbutton,
'', $limit, 0, 0, 1);
390$topicmail =
"Information";
391$modelmail =
"subscription";
393$trackid =
'sub'.$object->id;
394include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
399 foreach ($fieldstosearchall as $key => $val) {
400 $fieldstosearchall[$key] = $langs->trans($val);
401 $setupstring .= $key.
"=".$val.
";";
403 print
'<!-- Search done like if MYOBJECT_QUICKSEARCH_ON_FIELDS = '.$setupstring.
' -->'.
"\n";
404 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).implode(
', ', $fieldstosearchall).
'</div>'.
"\n";
412$parameters = array();
413$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
414if (empty($reshook)) {
415 $moreforfilter .= $hookmanager->resPrint;
417 $moreforfilter = $hookmanager->resPrint;
420if (!empty($moreforfilter)) {
421 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
422 print $moreforfilter;
426$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
427$htmlofselectarray = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));
428$selectedfields = ($mode !=
'kanban' ? $htmlofselectarray :
'');
429$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
431print
'<div class="div-table-responsive">';
432print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
436print
'<tr class="liste_titre_filter">';
439 print
'<td class="liste_titre center maxwidthsearch">';
440 $searchpicto = $form->showFilterButtons(
'left');
446 print
'<td class="liste_titre"> </td>';
450if (!empty($arrayfields[
'd.ref'][
'checked'])) {
451 print
'<td class="liste_titre left">';
452 print
'<input class="flat maxwidth50" type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref).
'"></td>';
456if (!empty($arrayfields[
'd.fk_type'][
'checked'])) {
457 print
'<td class="liste_titre left">';
458 print $form->selectarray(
"search_type", $adht->liste_array(), $search_type, 1);
462if (!empty($arrayfields[
'd.lastname'][
'checked'])) {
463 print
'<td class="liste_titre left">';
464 print
'<input class="flat maxwidth75" type="text" name="search_lastname" value="'.dol_escape_htmltag($search_lastname).
'"></td>';
467if (!empty($arrayfields[
'd.firstname'][
'checked'])) {
468 print
'<td class="liste_titre left">';
469 print
'<input class="flat maxwidth75" type="text" name="search_firstname" value="'.dol_escape_htmltag($search_firstname).
'"></td>';
472if (!empty($arrayfields[
'd.login'][
'checked'])) {
473 print
'<td class="liste_titre left">';
474 print
'<input class="flat maxwidth75" type="text" name="search_login" value="'.dol_escape_htmltag($search_login).
'"></td>';
477if (!empty($arrayfields[
't.libelle'][
'checked'])) {
478 print
'<td class="liste_titre">';
483if (!empty($arrayfields[
'd.bank'][
'checked'])) {
484 print
'<td class="liste_titre">';
485 $form->select_comptes($search_account,
'search_account', 0,
'', 1,
'', 0,
'maxwidth100');
489if (!empty($arrayfields[
'c.dateadh'][
'checked'])) {
490 print
'<td class="liste_titre"> </td>';
493if (!empty($arrayfields[
'c.datef'][
'checked'])) {
494 print
'<td class="liste_titre"> </td>';
497if (!empty($arrayfields[
'd.amount'][
'checked'])) {
498 print
'<td class="liste_titre right">';
499 print
'<input class="flat" type="text" name="search_amount" value="'.dol_escape_htmltag($search_amount).
'" size="4">';
503include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
506$parameters = array(
'arrayfields' => $arrayfields);
507$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object, $action);
508print $hookmanager->resPrint;
510if (!empty($arrayfields[
'c.datec'][
'checked'])) {
511 print
'<td class="liste_titre">';
515if (!empty($arrayfields[
'c.tms'][
'checked'])) {
516 print
'<td class="liste_titre">';
522 print
'<td class="liste_titre center maxwidthsearch">';
523 $searchpicto = $form->showFilterButtons();
529$totalarray = array();
530$totalarray[
'nbfield'] = 0;
534print
'<tr class="liste_titre">';
537 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'align="center"', $sortfield, $sortorder,
'maxwidthsearch ');
538 $totalarray[
'nbfield']++;
540if (!empty($arrayfields[
'd.ref'][
'checked'])) {
541 print_liste_field_titre($arrayfields[
'd.ref'][
'label'], $_SERVER[
"PHP_SELF"],
"c.rowid", $param,
"",
"", $sortfield, $sortorder);
542 $totalarray[
'nbfield']++;
544if (!empty($arrayfields[
'd.fk_type'][
'checked'])) {
545 print_liste_field_titre($arrayfields[
'd.fk_type'][
'label'], $_SERVER[
"PHP_SELF"],
"c.fk_type", $param,
"",
"", $sortfield, $sortorder);
546 $totalarray[
'nbfield']++;
548if (!empty($arrayfields[
'd.lastname'][
'checked'])) {
549 print_liste_field_titre($arrayfields[
'd.lastname'][
'label'], $_SERVER[
"PHP_SELF"],
"d.lastname", $param,
"",
"", $sortfield, $sortorder);
550 $totalarray[
'nbfield']++;
552if (!empty($arrayfields[
'd.firstname'][
'checked'])) {
553 print_liste_field_titre($arrayfields[
'd.firstname'][
'label'], $_SERVER[
"PHP_SELF"],
"d.firstname", $param,
"",
"", $sortfield, $sortorder);
554 $totalarray[
'nbfield']++;
556if (!empty($arrayfields[
'd.login'][
'checked'])) {
557 print_liste_field_titre($arrayfields[
'd.login'][
'label'], $_SERVER[
"PHP_SELF"],
"d.login", $param,
"",
"", $sortfield, $sortorder);
558 $totalarray[
'nbfield']++;
560if (!empty($arrayfields[
't.libelle'][
'checked'])) {
561 print_liste_field_titre($arrayfields[
't.libelle'][
'label'], $_SERVER[
"PHP_SELF"],
"c.note", $param,
"",
'', $sortfield, $sortorder);
562 $totalarray[
'nbfield']++;
564if (!empty($arrayfields[
'd.bank'][
'checked'])) {
565 print_liste_field_titre($arrayfields[
'd.bank'][
'label'], $_SERVER[
"PHP_SELF"],
"b.fk_account", $param,
"",
"", $sortfield, $sortorder);
566 $totalarray[
'nbfield']++;
568if (!empty($arrayfields[
'c.dateadh'][
'checked'])) {
569 print_liste_field_titre($arrayfields[
'c.dateadh'][
'label'], $_SERVER[
"PHP_SELF"],
"c.dateadh", $param,
"",
'', $sortfield, $sortorder,
'center nowraponall ');
570 $totalarray[
'nbfield']++;
572if (!empty($arrayfields[
'c.datef'][
'checked'])) {
573 print_liste_field_titre($arrayfields[
'c.datef'][
'label'], $_SERVER[
"PHP_SELF"],
"c.datef", $param,
"",
'', $sortfield, $sortorder,
'center nowraponall ');
574 $totalarray[
'nbfield']++;
576if (!empty($arrayfields[
'd.amount'][
'checked'])) {
577 print_liste_field_titre($arrayfields[
'd.amount'][
'label'], $_SERVER[
"PHP_SELF"],
"c.subscription", $param,
"",
'', $sortfield, $sortorder,
'right ');
578 $totalarray[
'nbfield']++;
582include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
585$parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder,
'totalarray' => &$totalarray);
586$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object, $action);
587print $hookmanager->resPrint;
588if (!empty($arrayfields[
'c.datec'][
'checked'])) {
589 print_liste_field_titre($arrayfields[
'c.datec'][
'label'], $_SERVER[
"PHP_SELF"],
"c.datec",
"", $param,
'align="center" class="nowrap"', $sortfield, $sortorder);
591if (!empty($arrayfields[
'c.tms'][
'checked'])) {
592 print_liste_field_titre($arrayfields[
'c.tms'][
'label'], $_SERVER[
"PHP_SELF"],
"c.tms",
"", $param,
'align="center" class="nowrap"', $sortfield, $sortorder);
596 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
597 $totalarray[
'nbfield']++;
604$savnbfield = $totalarray[
'nbfield'];
605$totalarray = array();
606$totalarray[
'nbfield'] = 0;
607$imaxinloop = ($limit ? min($num, $limit) : $num);
608while ($i < $imaxinloop) {
609 $obj = $db->fetch_object($resql);
614 $subscription->ref = $obj->crowid;
615 $subscription->id = $obj->crowid;
616 $subscription->dateh = $db->jdate($obj->dateadh);
617 $subscription->datef = $db->jdate($obj->datef);
618 $subscription->amount = $obj->subscription;
619 $subscription->fk_adherent = $obj->rowid;
621 $adherent->lastname = $obj->lastname;
622 $adherent->firstname = $obj->firstname;
623 $adherent->ref = $obj->rowid;
624 $adherent->id = $obj->rowid;
625 $adherent->statut = $obj->status;
626 $adherent->status = $obj->status;
627 $adherent->login = $obj->login;
628 $adherent->photo = $obj->photo;
629 $adherent->gender = $obj->gender;
630 $adherent->morphy = $obj->morphy;
631 $adherent->email = $obj->email;
632 $adherent->typeid = $obj->fk_type;
633 $adherent->datefin = $db->jdate($obj->datef);
635 $typeid = ($obj->fk_type > 0 ? $obj->fk_type : $adherent->typeid);
637 $adht->fetch($typeid);
639 $adherent->need_subscription = $adht->subscription;
641 if ($mode ==
'kanban') {
643 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
644 print
'<div class="box-flex-container kanban">';
647 if ($massactionbutton || $massaction) {
649 if (in_array(
$object->id, $arrayofselected)) {
656 if ($obj->fk_account > 0) {
657 $accountstatic->id = $obj->fk_account;
658 $accountstatic->fetch($obj->fk_account);
661 print $subscription->getKanbanView(
'', array(
'selected' => in_array(
$object->id, $arrayofselected),
'adherent_type' => $adht,
'member' => $adherent,
'bank' => ($obj->fk_account > 0 ? $accountstatic : null)));
662 if ($i == ($imaxinloop - 1)) {
669 print
'<tr data-rowid="'.$object->id.
'" class="oddeven">';
672 print
'<td class="nowrap center">';
673 if ($massactionbutton || $massaction) {
675 if (in_array($obj->crowid, $arrayofselected)) {
678 print
'<input id="cb'.$obj->crowid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->crowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
682 $totalarray[
'nbfield']++;
686 if (!empty($arrayfields[
'd.ref'][
'checked'])) {
687 print
'<td class="nowraponall">'.$subscription->getNomUrl(1).
'</td>';
689 $totalarray[
'nbfield']++;
693 if (!empty($arrayfields[
'd.fk_type'][
'checked'])) {
694 print
'<td class="tdoverflowmax100">';
696 print $adht->getNomUrl(1);
700 $totalarray[
'nbfield']++;
705 if (!empty($arrayfields[
'd.lastname'][
'checked'])) {
706 print
'<td class="tdoverflowmax125">'.$adherent->getNomUrl(-1, 0,
'card',
'lastname').
'</td>';
708 $totalarray[
'nbfield']++;
712 if (!empty($arrayfields[
'd.firstname'][
'checked'])) {
713 print
'<td class="tdoverflowmax125" title="'.dol_escape_htmltag($adherent->firstname).
'">'.
dol_escape_htmltag($adherent->firstname).
'</td>';
715 $totalarray[
'nbfield']++;
720 if (!empty($arrayfields[
'd.login'][
'checked'])) {
721 print
'<td class="tdoverflowmax150" title="'.dol_escape_htmltag($adherent->login).
'">'.
dol_escape_htmltag($adherent->login).
'</td>';
723 $totalarray[
'nbfield']++;
728 if (!empty($arrayfields[
't.libelle'][
'checked'])) {
729 print
'<td class="tdoverflowmax400" title="'.dol_escape_htmltag($obj->note_private).
'">';
733 $totalarray[
'nbfield']++;
738 if (!empty($arrayfields[
'd.bank'][
'checked'])) {
739 print
'<td class="tdmaxoverflow100">';
740 if ($obj->fk_account > 0) {
741 $accountstatic->id = $obj->fk_account;
742 $accountstatic->fetch($obj->fk_account);
744 print $accountstatic->getNomUrl(1);
748 $totalarray[
'nbfield']++;
753 if (!empty($arrayfields[
'c.dateadh'][
'checked'])) {
754 print
'<td class="center nowraponall">'.dol_print_date($db->jdate($obj->dateadh),
'day').
"</td>\n";
756 $totalarray[
'nbfield']++;
760 if (!empty($arrayfields[
'c.datef'][
'checked'])) {
761 print
'<td class="center nowraponall">'.dol_print_date($db->jdate($obj->datef),
'day').
"</td>\n";
763 $totalarray[
'nbfield']++;
767 if (!empty($arrayfields[
'd.amount'][
'checked'])) {
768 print
'<td class="right amount">'.price($obj->subscription).
'</td>';
770 $totalarray[
'nbfield']++;
773 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'd.amount';
775 if (empty($totalarray[
'val'][
'd.amount'])) {
776 $totalarray[
'val'][
'd.amount'] = $obj->subscription;
778 $totalarray[
'val'][
'd.amount'] += $obj->subscription;
782 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
784 $parameters = array(
'arrayfields' => $arrayfields,
'obj' => $obj,
'i' => $i,
'totalarray' => &$totalarray);
785 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters);
786 print $hookmanager->resPrint;
788 if (!empty($arrayfields[
'c.datec'][
'checked'])) {
789 print
'<td class="nowrap center">';
790 print
dol_print_date($db->jdate($obj->date_creation),
'dayhour',
'tzuser');
793 $totalarray[
'nbfield']++;
797 if (!empty($arrayfields[
'c.tms'][
'checked'])) {
798 print
'<td class="nowrap center">';
799 print
dol_print_date($db->jdate($obj->date_modification),
'dayhour',
'tzuser');
802 $totalarray[
'nbfield']++;
807 print
'<td class="nowrap center">';
808 if ($massactionbutton || $massaction) {
810 if (in_array($obj->crowid, $arrayofselected)) {
813 print
'<input id="cb'.$obj->crowid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->crowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
817 $totalarray[
'nbfield']++;
827include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
833 foreach ($arrayfields as $key => $val) {
834 if (!empty($val[
'checked'])) {
838 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
843$parameters = array(
'arrayfields' => $arrayfields,
'sql' => $sql);
844$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
845print $hookmanager->resPrint;
847print
'</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.
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.