30require
'../../main.inc.php';
40require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
41require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent_type.class.php';
42require_once DOL_DOCUMENT_ROOT.
'/adherents/class/subscription.class.php';
43require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
46$langs->loadLangs(array(
"members",
"companies",
"banks"));
48$action =
GETPOST(
'action',
'aZ09') ?
GETPOST(
'action',
'aZ09') :
'view';
49$massaction =
GETPOST(
'massaction',
'alpha');
51$confirm =
GETPOST(
'confirm',
'alpha');
52$cancel =
GETPOST(
'cancel',
'alpha');
53$toselect =
GETPOST(
'toselect',
'array:int');
54$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') : str_replace(
'_',
'', basename(dirname(__FILE__)).basename(__FILE__,
'.php'));
55$backtopage =
GETPOST(
'backtopage',
'alpha');
56$optioncss =
GETPOST(
'optioncss',
'aZ');
59$statut = (GETPOSTISSET(
"statut") ?
GETPOST(
"statut",
"alpha") : 1);
60$search_ref =
GETPOST(
'search_ref',
'alpha');
62$search_lastname =
GETPOST(
'search_lastname',
'alpha');
63$search_firstname =
GETPOST(
'search_firstname',
'alpha');
64$search_login =
GETPOST(
'search_login',
'alpha');
65$search_note =
GETPOST(
'search_note',
'alpha');
66$search_account =
GETPOST(
'search_account',
'alpha');
67$search_amount =
GETPOST(
'search_amount',
'alpha');
68$search_all = trim(
GETPOST(
'search_all',
'alphanohtml'));
70$search_dateadh_startday =
GETPOSTINT(
'search_dateadh_startday');
71$search_dateadh_startmonth =
GETPOSTINT(
'search_dateadh_startmonth');
72$search_dateadh_startyear =
GETPOSTINT(
'search_dateadh_startyear');
73$search_dateadh_endday =
GETPOSTINT(
'search_dateadh_endday');
74$search_dateadh_endmonth =
GETPOSTINT(
'search_dateadh_endmonth');
75$search_dateadh_endyear =
GETPOSTINT(
'search_dateadh_endyear');
76$search_dateadh_start =
dol_mktime(0, 0, 0, $search_dateadh_startmonth, $search_dateadh_startday, $search_dateadh_startyear);
77$search_dateadh_end =
dol_mktime(23, 59, 59, $search_dateadh_endmonth, $search_dateadh_endday, $search_dateadh_endyear);
79$search_datef_startday =
GETPOSTINT(
'search_datef_startday');
80$search_datef_startmonth =
GETPOSTINT(
'search_datef_startmonth');
81$search_datef_startyear =
GETPOSTINT(
'search_datef_startyear');
82$search_datef_endday =
GETPOSTINT(
'search_datef_endday');
83$search_datef_endmonth =
GETPOSTINT(
'search_datef_endmonth');
84$search_datef_endyear =
GETPOSTINT(
'search_datef_endyear');
85$search_datef_start =
dol_mktime(0, 0, 0, $search_datef_startmonth, $search_datef_startday, $search_datef_startyear);
86$search_datef_end =
dol_mktime(23, 59, 59, $search_datef_endmonth, $search_datef_endday, $search_datef_endyear);
88$date_select =
GETPOST(
"date_select",
'alpha');
92$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
93$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
95if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
99$offset = $limit * $page;
100$pageprev = $page - 1;
101$pagenext = $page + 1;
106 $sortfield =
"c.dateadh";
111$hookmanager->initHooks(array(
'subscriptionlist'));
114$extrafields->fetch_name_optionals_label(
$object->table_element);
116$search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
119$fieldstosearchall = array(
124 'd.ref' => array(
'label' =>
"Ref",
'checked' =>
'1'),
125 'd.fk_type' => array(
'label' =>
"Type",
'checked' =>
'1'),
126 'd.lastname' => array(
'label' =>
"Lastname",
'checked' =>
'1'),
127 'd.firstname' => array(
'label' =>
"Firstname",
'checked' =>
'1'),
128 'd.login' => array(
'label' =>
"Login",
'checked' =>
'1'),
129 'c.note' => array(
'label' =>
"Label",
'checked' =>
'1'),
130 'd.bank' => array(
'label' =>
"BankAccount",
'checked' =>
'1',
'enabled' => (
string) (
int) (
isModEnabled(
'bank'))),
133 'c.dateadh' => array(
'label' =>
"DateSubscription",
'checked' =>
'1',
'position' => 100),
134 'c.datef' => array(
'label' =>
"EndSubscription",
'checked' =>
'1',
'position' => 101),
135 'd.amount' => array(
'label' =>
"Amount",
'checked' =>
'1',
'position' => 102),
136 'c.datec' => array(
'label' =>
"DateCreation",
'checked' =>
'0',
'position' => 500),
137 'c.tms' => array(
'label' =>
"DateModificationShort",
'checked' =>
'0',
'position' => 500),
141$parameters = array(
'arrayfields' => &$arrayfields);
142$reshook = $hookmanager->executeHooks(
'completeArrayFields', $parameters, $object, $action);
147$permissiontodelete = $user->hasRight(
'adherent',
'cotisation',
'creer');
154if (
GETPOST(
'cancel',
'alpha')) {
158if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
162$parameters = array(
'socid' =>
null);
163$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
168if (empty($reshook)) {
170 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
173 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
176 $search_lastname =
"";
177 $search_firstname =
"";
181 $search_account =
"";
183 $search_array_options = array();
184 $search_dateadh_startday =
'';
185 $search_dateadh_startmonth =
'';
186 $search_dateadh_startyear =
'';
187 $search_dateadh_endday =
'';
188 $search_dateadh_endmonth =
'';
189 $search_dateadh_endyear =
'';
190 $search_dateadh_start =
'';
191 $search_dateadh_end =
'';
192 $search_datef_startday =
'';
193 $search_datef_startmonth =
'';
194 $search_datef_startyear =
'';
195 $search_datef_endday =
'';
196 $search_datef_endmonth =
'';
197 $search_datef_endyear =
'';
198 $search_datef_start =
'';
199 $search_datef_end =
'';
201 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')
202 ||
GETPOST(
'button_search_x',
'alpha') ||
GETPOST(
'button_search.x',
'alpha') ||
GETPOST(
'button_search',
'alpha')) {
207 $objectclass =
'Subscription';
208 $objectlabel =
'Subscription';
209 $uploaddir =
$conf->member->dir_output;
210 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
228$sql =
"SELECT d.rowid, d.login, d.firstname, d.lastname, d.societe, d.photo, d.statut as status,";
229$sql .=
" d.gender, d.email, d.morphy,";
230$sql .=
" c.rowid as crowid, c.fk_type, c.subscription,";
231$sql .=
" c.dateadh, c.datef, c.datec as date_creation, c.tms as date_modification,";
232$sql .=
" c.fk_bank as bank, c.note as note_private,";
233$sql .=
" b.fk_account";
235if (!empty($extrafields->attributes[
$object->table_element][
'label'])) {
236 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
237 $sql .= ($extrafields->attributes[
$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
"");
241$parameters = array();
242$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object, $action);
243$sql .= $hookmanager->resPrint;
244$sql = preg_replace(
'/,\s*$/',
'', $sql);
248$sql .=
" FROM ".MAIN_DB_PREFIX.
"adherent as d";
249$sql .=
" JOIN ".MAIN_DB_PREFIX.
"subscription as c on d.rowid = c.fk_adherent";
250$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"adherent_extrafields as ef on (d.rowid = ef.fk_object)";
251$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"bank as b ON c.fk_bank = b.rowid";
252$sql .=
" WHERE d.entity IN (".getEntity(
'adherent').
")";
253if (isset($date_select) && $date_select !=
'') {
254 $sql .=
" AND c.dateadh >= '".((int) $date_select).
"-01-01 00:00:00'";
255 $sql .=
" AND c.dateadh < '".((int) $date_select + 1).
"-01-01 00:00:00'";
258 if (is_numeric($search_ref)) {
259 $sql .=
" AND c.rowid = ".((int) $search_ref);
261 $sql .=
" AND 1 = 2";
264if ($search_type > 0) {
265 $sql .=
natural_search(array(
'c.fk_type'), (
string) $search_type);
267if ($search_lastname) {
268 $sql .=
natural_search(array(
'd.lastname',
'd.societe'), $search_lastname);
270if ($search_firstname) {
279if ($search_account > 0) {
280 $sql .=
" AND b.fk_account = ".((int) $search_account);
286 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
288if ($search_dateadh_start) {
289 $sql .=
" AND c.dateadh >= '".$db->idate($search_dateadh_start).
"'";
291if ($search_dateadh_end) {
292 $sql .=
" AND c.dateadh <= '".$db->idate($search_dateadh_end).
"'";
294if ($search_datef_start) {
295 $sql .=
" AND c.datef >= '".$db->idate($search_datef_start).
"'";
297if ($search_datef_end) {
298 $sql .=
" AND c.datef <= '".$db->idate($search_datef_end).
"'";
301include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
303$parameters = array();
304$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
305$sql .= $hookmanager->resPrint;
308$nbtotalofrecords =
'';
311 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
312 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
313 $resql =
$db->query($sqlforcount);
315 $objforcount =
$db->fetch_object($resql);
316 $nbtotalofrecords = $objforcount->nbtotalofrecords;
321 if (($page * $limit) > (
int) $nbtotalofrecords) {
329$sql .=
$db->order($sortfield, $sortorder);
331 $sql .=
$db->plimit($limit + 1, $offset);
334$resql =
$db->query($sql);
340$num =
$db->num_rows($resql);
344if ($num == 1 &&
getDolGlobalString(
'MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
345 $obj =
$db->fetch_object($resql);
347 header(
"Location: ".DOL_URL_ROOT.
'/adherents/subscription/card.php?id='.
$id);
354$title = $langs->trans(
"Subscriptions");
355if (!empty($date_select)) {
356 $title .=
' ('.$langs->trans(
"Year").
' '.$date_select.
')';
358$help_url =
'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder';
360llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'mod-member page-subscription-list bodyforlist');
362$arrayofselected = is_array($toselect) ? $toselect : array();
366 $param .=
'&mode='.urlencode($mode);
368if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
369 $param .=
'&contextpage='.urlencode($contextpage);
371if ($limit > 0 && $limit !=
$conf->liste_limit) {
372 $param .=
'&limit='.((int) $limit);
375 $param .=
"&statut=".urlencode($statut);
378 $param .=
"&search_type=".((int) $search_type);
381 $param .=
"&date_select=".urlencode($date_select);
383if ($search_lastname) {
384 $param .=
"&search_lastname=".urlencode($search_lastname);
387 $param .=
"&search_login=".urlencode($search_login);
389if ($search_account) {
390 $param .=
"&search_account=".urlencode($search_account);
393 $param .=
"&search_amount=".urlencode($search_amount);
395if ($optioncss !=
'') {
396 $param .=
'&optioncss='.urlencode($optioncss);
399if ($search_dateadh_startday) $param .=
'&search_dateadh_startday='.urlencode((
string) $search_dateadh_startday);
400if ($search_dateadh_startmonth) $param .=
'&search_dateadh_startmonth='.urlencode((
string) $search_dateadh_startmonth);
401if ($search_dateadh_startyear) $param .=
'&search_dateadh_startyear='.urlencode((
string) $search_dateadh_startyear);
404if ($search_dateadh_endday) $param .=
'&search_dateadh_endday='.urlencode((
string) $search_dateadh_endday);
405if ($search_dateadh_endmonth) $param .=
'&search_dateadh_endmonth='.urlencode((
string) $search_dateadh_endmonth);
406if ($search_dateadh_endyear) $param .=
'&search_dateadh_endyear='.urlencode((
string) $search_dateadh_endyear);
409if ($search_datef_startday) $param .=
'&search_datef_startday='.urlencode((
string) $search_datef_startday);
410if ($search_datef_startmonth) $param .=
'&search_datef_startmonth='.urlencode((
string) $search_datef_startmonth);
411if ($search_datef_startyear) $param .=
'&search_datef_startyear='.urlencode((
string) $search_datef_startyear);
414if ($search_datef_endday) $param .=
'&search_datef_endday='.urlencode((
string) $search_datef_endday);
415if ($search_datef_endmonth) $param .=
'&search_datef_endmonth='.urlencode((
string) $search_datef_endmonth);
416if ($search_datef_endyear) $param .=
'&search_datef_endyear='.urlencode((
string) $search_datef_endyear);
419include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
421$parameters = array(
'param' => &$param);
422$reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object, $action);
423$param .= $hookmanager->resPrint;
426$arrayofmassactions = array(
430if (!empty($permissiontodelete)) {
431 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
433if (
GETPOSTINT(
'nomassaction') || in_array($massaction, array(
'presend',
'predelete'))) {
434 $arrayofmassactions = array();
436$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
438print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
439if ($optioncss !=
'') {
440 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
442print
'<input type="hidden" name="token" value="'.newToken().
'">';
443print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
444print
'<input type="hidden" name="action" value="list">';
445print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
446print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
447print
'<input type="hidden" name="page" value="'.$page.
'">';
448print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
449print
'<input type="hidden" name="date_select" value="'.$date_select.
'">';
450print
'<input type="hidden" name="page_y" value="">';
451print
'<input type="hidden" name="mode" value="'.$mode.
'">';
454$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'));
455$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'));
456$newcardbutton .=
dolGetButtonTitle($langs->trans(
'Statistics'),
'',
'fa fa-chart-bar imgforviewmode',
dol_buildpath(
'/adherents/stats/index.php', 1).
'?objecttype=adherent@adherent'.preg_replace(
'/(&|\?)*(mode|groupby)=[^&]+/',
'', $param),
'', ($mode ==
'statistics' ? 2 : 1), array(
'morecss' =>
'reposition'));
457if ($user->hasRight(
'adherent',
'cotisation',
'creer')) {
459 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewSubscription'),
'',
'fa fa-plus-circle', DOL_URL_ROOT.
'/adherents/list.php?status=-1,1');
462print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $subscription->picto, 0, $newcardbutton,
'', $limit, 0, 0, 1);
464$topicmail =
"Information";
465$modelmail =
"subscription";
467$trackid =
'sub'.$object->id;
468include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
472 foreach ($fieldstosearchall as $key => $val) {
473 $fieldstosearchall[$key] = $langs->trans($val);
474 $setupstring .= $key.
"=".$val.
";";
476 print
'<!-- Search done like if MYOBJECT_QUICKSEARCH_ON_FIELDS = '.$setupstring.
' -->'.
"\n";
477 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).implode(
', ', $fieldstosearchall).
'</div>'.
"\n";
485$parameters = array();
486$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
487if (empty($reshook)) {
488 $moreforfilter .= $hookmanager->resPrint;
490 $moreforfilter = $hookmanager->resPrint;
493if (!empty($moreforfilter)) {
494 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
495 print $moreforfilter;
499$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
500$htmlofselectarray = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
$conf->main_checkbox_left_column);
501$selectedfields = ($mode !=
'kanban' ? $htmlofselectarray :
'');
502$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
504print
'<div class="div-table-responsive">';
505print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
509print
'<tr class="liste_titre_filter">';
511if (
$conf->main_checkbox_left_column) {
512 print
'<td class="liste_titre center maxwidthsearch">';
513 $searchpicto = $form->showFilterButtons(
'left');
519 print
'<td class="liste_titre"> </td>';
523if (!empty($arrayfields[
'd.ref'][
'checked'])) {
524 print
'<td class="liste_titre left">';
525 print
'<input class="flat maxwidth50" type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref).
'"></td>';
529if (!empty($arrayfields[
'd.fk_type'][
'checked'])) {
530 print
'<td class="liste_titre left">';
531 print $form->selectarray(
"search_type", $adht->liste_array(), $search_type, 1);
535if (!empty($arrayfields[
'd.lastname'][
'checked'])) {
536 print
'<td class="liste_titre left">';
537 print
'<input class="flat maxwidth75" type="text" name="search_lastname" value="'.dol_escape_htmltag($search_lastname).
'"></td>';
540if (!empty($arrayfields[
'd.firstname'][
'checked'])) {
541 print
'<td class="liste_titre left">';
542 print
'<input class="flat maxwidth75" type="text" name="search_firstname" value="'.dol_escape_htmltag($search_firstname).
'"></td>';
545if (!empty($arrayfields[
'd.login'][
'checked'])) {
546 print
'<td class="liste_titre left">';
547 print
'<input class="flat maxwidth75" type="text" name="search_login" value="'.dol_escape_htmltag($search_login).
'"></td>';
550if (!empty($arrayfields[
'c.note'][
'checked'])) {
551 print
'<td class="liste_titre">';
552 print
'<input class="flat maxwidth100" type="text" name="search_note" value="'.dol_escape_htmltag($search_note).
'"></td>';
556if (!empty($arrayfields[
'd.bank'][
'checked'])) {
557 print
'<td class="liste_titre">';
558 $form->select_comptes($search_account,
'search_account', 0,
'', 1,
'', 0,
'maxwidth100');
562if (!empty($arrayfields[
'c.dateadh'][
'checked'])) {
563 print
'<td class="liste_titre center">';
564 print $form->selectDate($search_dateadh_start,
'search_dateadh_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
566 print $form->selectDate($search_dateadh_end,
'search_dateadh_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'To'));
570if (!empty($arrayfields[
'c.datef'][
'checked'])) {
571 print
'<td class="liste_titre center">';
572 print $form->selectDate($search_datef_start,
'search_datef_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
574 print $form->selectDate($search_datef_end,
'search_datef_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'To'));
578if (!empty($arrayfields[
'd.amount'][
'checked'])) {
579 print
'<td class="liste_titre right">';
580 print
'<input class="flat" type="text" name="search_amount" value="'.dol_escape_htmltag($search_amount).
'" size="4">';
584include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
587$parameters = array(
'arrayfields' => $arrayfields);
588$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object, $action);
589print $hookmanager->resPrint;
591if (!empty($arrayfields[
'c.datec'][
'checked'])) {
592 print
'<td class="liste_titre">';
596if (!empty($arrayfields[
'c.tms'][
'checked'])) {
597 print
'<td class="liste_titre">';
602if (!
$conf->main_checkbox_left_column) {
603 print
'<td class="liste_titre center maxwidthsearch">';
604 $searchpicto = $form->showFilterButtons();
615print
'<tr class="liste_titre">';
617if (
$conf->main_checkbox_left_column) {
618 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'align="center"', $sortfield, $sortorder,
'maxwidthsearch ');
621if (!empty($arrayfields[
'd.ref'][
'checked'])) {
622 print_liste_field_titre($arrayfields[
'd.ref'][
'label'], $_SERVER[
"PHP_SELF"],
"c.rowid",
"", $param,
"", $sortfield, $sortorder);
625if (!empty($arrayfields[
'd.fk_type'][
'checked'])) {
626 print_liste_field_titre($arrayfields[
'd.fk_type'][
'label'], $_SERVER[
"PHP_SELF"],
"c.fk_type",
"", $param,
"", $sortfield, $sortorder);
629if (!empty($arrayfields[
'd.lastname'][
'checked'])) {
630 print_liste_field_titre($arrayfields[
'd.lastname'][
'label'], $_SERVER[
"PHP_SELF"],
"d.lastname",
"", $param,
"", $sortfield, $sortorder);
633if (!empty($arrayfields[
'd.firstname'][
'checked'])) {
634 print_liste_field_titre($arrayfields[
'd.firstname'][
'label'], $_SERVER[
"PHP_SELF"],
"d.firstname",
"", $param,
"", $sortfield, $sortorder);
637if (!empty($arrayfields[
'd.login'][
'checked'])) {
638 print_liste_field_titre($arrayfields[
'd.login'][
'label'], $_SERVER[
"PHP_SELF"],
"d.login",
"", $param,
"", $sortfield, $sortorder);
641if (!empty($arrayfields[
'c.note'][
'checked'])) {
642 print_liste_field_titre($arrayfields[
'c.note'][
'label'], $_SERVER[
"PHP_SELF"],
"c.note",
"", $param,
'', $sortfield, $sortorder);
645if (!empty($arrayfields[
'd.bank'][
'checked'])) {
646 print_liste_field_titre($arrayfields[
'd.bank'][
'label'], $_SERVER[
"PHP_SELF"],
"b.fk_account",
"", $param,
"", $sortfield, $sortorder);
649if (!empty($arrayfields[
'c.dateadh'][
'checked'])) {
650 print_liste_field_titre($arrayfields[
'c.dateadh'][
'label'], $_SERVER[
"PHP_SELF"],
"c.dateadh",
"", $param,
'', $sortfield, $sortorder,
'center nowraponall ');
653if (!empty($arrayfields[
'c.datef'][
'checked'])) {
654 print_liste_field_titre($arrayfields[
'c.datef'][
'label'], $_SERVER[
"PHP_SELF"],
"c.datef",
"", $param,
'', $sortfield, $sortorder,
'center nowraponall ');
657if (!empty($arrayfields[
'd.amount'][
'checked'])) {
658 print_liste_field_titre($arrayfields[
'd.amount'][
'label'], $_SERVER[
"PHP_SELF"],
"c.subscription",
"", $param,
'', $sortfield, $sortorder,
'right ');
663include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
666$parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder,
'totalarray' => &
$totalarray);
667$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object, $action);
668print $hookmanager->resPrint;
669if (!empty($arrayfields[
'c.datec'][
'checked'])) {
670 print_liste_field_titre($arrayfields[
'c.datec'][
'label'], $_SERVER[
"PHP_SELF"],
"c.datec",
"", $param,
'align="center" class="nowrap"', $sortfield, $sortorder);
672if (!empty($arrayfields[
'c.tms'][
'checked'])) {
673 print_liste_field_titre($arrayfields[
'c.tms'][
'label'], $_SERVER[
"PHP_SELF"],
"c.tms",
"", $param,
'align="center" class="nowrap"', $sortfield, $sortorder);
676if (!
$conf->main_checkbox_left_column) {
677 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
688$imaxinloop = ($limit ? min($num, $limit) : $num);
689while ($i < $imaxinloop) {
690 $obj =
$db->fetch_object($resql);
695 $subscription->ref = $obj->crowid;
696 $subscription->id = $obj->crowid;
697 $subscription->dateh =
$db->jdate($obj->dateadh);
698 $subscription->datef =
$db->jdate($obj->datef);
699 $subscription->amount = $obj->subscription;
700 $subscription->fk_adherent = $obj->rowid;
702 $adherent->lastname = $obj->lastname;
703 $adherent->firstname = $obj->firstname;
704 $adherent->company = $obj->societe;
705 $adherent->ref = $obj->rowid;
706 $adherent->id = $obj->rowid;
707 $adherent->statut = $obj->status;
708 $adherent->status = $obj->status;
709 $adherent->login = $obj->login;
710 $adherent->photo = $obj->photo;
711 $adherent->gender = $obj->gender;
712 $adherent->morphy = $obj->morphy;
713 $adherent->email = $obj->email;
714 $adherent->typeid = $obj->fk_type;
715 $adherent->datefin =
$db->jdate($obj->datef);
717 $typeid = ($obj->fk_type > 0 ? $obj->fk_type : $adherent->typeid);
719 $adht->fetch($typeid);
721 $adherent->need_subscription = (int) $adht->subscription;
723 if ($mode ==
'kanban') {
725 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
726 print
'<div class="box-flex-container kanban">';
729 if ($massactionbutton || $massaction) {
731 if (in_array(
$object->id, $arrayofselected)) {
738 if ($obj->fk_account > 0) {
739 $accountstatic->id = $obj->fk_account;
740 $accountstatic->fetch($obj->fk_account);
743 print $subscription->getKanbanView(
'', array(
'selected' => in_array(
$object->id, $arrayofselected),
'adherent_type' => $adht,
'member' => $adherent,
'bank' => ($obj->fk_account > 0 ? $accountstatic : null)));
744 if ($i == ($imaxinloop - 1)) {
751 print
'<tr data-rowid="'.$object->id.
'" class="oddeven">';
753 if (
$conf->main_checkbox_left_column) {
754 print
'<td class="nowrap center">';
755 if ($massactionbutton || $massaction) {
757 if (in_array($obj->crowid, $arrayofselected)) {
760 print
'<input id="cb'.$obj->crowid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->crowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
768 if (!empty($arrayfields[
'd.ref'][
'checked'])) {
769 print
'<td class="nowraponall">'.$subscription->getNomUrl(1).
'</td>';
775 if (!empty($arrayfields[
'd.fk_type'][
'checked'])) {
776 print
'<td class="tdoverflowmax100">';
778 print $adht->getNomUrl(1);
787 if (!empty($arrayfields[
'd.lastname'][
'checked'])) {
788 print
'<td class="tdoverflowmax125">'.$adherent->getNomUrl(-1, 0,
'card',
'lastname').
'</td>';
794 if (!empty($arrayfields[
'd.firstname'][
'checked'])) {
795 print
'<td class="tdoverflowmax125" title="'.dol_escape_htmltag($adherent->firstname).
'">'.
dol_escape_htmltag($adherent->firstname).
'</td>';
802 if (!empty($arrayfields[
'd.login'][
'checked'])) {
803 print
'<td class="tdoverflowmax150" title="'.dol_escape_htmltag($adherent->login).
'">'.
dol_escape_htmltag($adherent->login).
'</td>';
810 if (!empty($arrayfields[
'c.note'][
'checked'])) {
811 print
'<td class="tdoverflowmax400" title="'.dol_escape_htmltag($obj->note_private).
'">';
820 if (!empty($arrayfields[
'd.bank'][
'checked'])) {
821 print
'<td class="tdoverflowmax100">';
822 if ($obj->fk_account > 0) {
823 $accountstatic->id = $obj->fk_account;
824 $accountstatic->fetch($obj->fk_account);
826 print $accountstatic->getNomUrl(1);
835 if (!empty($arrayfields[
'c.dateadh'][
'checked'])) {
836 print
'<td class="center nowraponall">'.dol_print_date(
$db->jdate($obj->dateadh),
'day').
"</td>\n";
842 if (!empty($arrayfields[
'c.datef'][
'checked'])) {
843 print
'<td class="center nowraponall">'.dol_print_date(
$db->jdate($obj->datef),
'day').
"</td>\n";
849 if (!empty($arrayfields[
'd.amount'][
'checked'])) {
850 print
'<td class="right amount">'.price($obj->subscription).
'</td>';
858 $totalarray[
'val'][
'd.amount'] = $obj->subscription;
860 $totalarray[
'val'][
'd.amount'] += $obj->subscription;
864 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
866 $parameters = array(
'arrayfields' => $arrayfields,
'obj' => $obj,
'i' => $i,
'totalarray' => &
$totalarray);
867 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters);
868 print $hookmanager->resPrint;
870 if (!empty($arrayfields[
'c.datec'][
'checked'])) {
871 print
'<td class="nowrap center">';
879 if (!empty($arrayfields[
'c.tms'][
'checked'])) {
880 print
'<td class="nowrap center">';
888 if (!
$conf->main_checkbox_left_column) {
889 print
'<td class="nowrap center">';
890 if ($massactionbutton || $massaction) {
892 if (in_array($obj->crowid, $arrayofselected)) {
895 print
'<input id="cb'.$obj->crowid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->crowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
909include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
915 foreach ($arrayfields as $key => $val) {
916 if (!empty($val[
'checked'])) {
920 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
925$parameters = array(
'arrayfields' => $arrayfields,
'sql' => $sql);
926$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
927print $hookmanager->resPrint;
929print
'</table>'.
"\n";
$id
Support class for third parties, contacts, members, users or resources.
if(! $sortfield) if(! $sortorder) $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.
dol_now($mode='gmt')
Return date for now.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed information (by default a local PHP server timestamp) Rep...
dolGetFirstLineOfText($text, $nboflines=1, $charset='UTF-8')
Return first line of text.
natural_search($fields, $value, $mode=0, $nofirstand=0, $sqltoadd='')
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0, $nodefault=0)
Return value of a param into GET or POST supervariable.
GETPOSTINT($paramname, $method=0, $nodefault=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false, $decorate=0)
Output date in a string format according to outputlangs (or langs if not defined).
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
print_liste_field_titre($name, $file="", $field="", $begin="", $param="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
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, $allowothertags=array())
Show picto whatever it's its name (generic function)
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.
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.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
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.