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');
60$search_ref =
GETPOST(
'search_ref',
'alpha');
61$search_id =
GETPOST(
'search_id',
'alpha');
63$search_lastname =
GETPOST(
'search_lastname',
'alpha');
64$search_firstname =
GETPOST(
'search_firstname',
'alpha');
65$search_login =
GETPOST(
'search_login',
'alpha');
66$search_note =
GETPOST(
'search_note',
'alpha');
67$search_account =
GETPOST(
'search_account',
'alpha');
68$search_amount =
GETPOST(
'search_amount',
'alpha');
69$search_all = trim(
GETPOST(
'search_all',
'alphanohtml'));
71$search_dateadh_startday =
GETPOSTINT(
'search_dateadh_startday');
72$search_dateadh_startmonth =
GETPOSTINT(
'search_dateadh_startmonth');
73$search_dateadh_startyear =
GETPOSTINT(
'search_dateadh_startyear');
74$search_dateadh_endday =
GETPOSTINT(
'search_dateadh_endday');
75$search_dateadh_endmonth =
GETPOSTINT(
'search_dateadh_endmonth');
76$search_dateadh_endyear =
GETPOSTINT(
'search_dateadh_endyear');
77$search_dateadh_start =
dol_mktime(0, 0, 0, $search_dateadh_startmonth, $search_dateadh_startday, $search_dateadh_startyear);
78$search_dateadh_end =
dol_mktime(23, 59, 59, $search_dateadh_endmonth, $search_dateadh_endday, $search_dateadh_endyear);
80$search_datef_startday =
GETPOSTINT(
'search_datef_startday');
81$search_datef_startmonth =
GETPOSTINT(
'search_datef_startmonth');
82$search_datef_startyear =
GETPOSTINT(
'search_datef_startyear');
83$search_datef_endday =
GETPOSTINT(
'search_datef_endday');
84$search_datef_endmonth =
GETPOSTINT(
'search_datef_endmonth');
85$search_datef_endyear =
GETPOSTINT(
'search_datef_endyear');
86$search_datef_start =
dol_mktime(0, 0, 0, $search_datef_startmonth, $search_datef_startday, $search_datef_startyear);
87$search_datef_end =
dol_mktime(23, 59, 59, $search_datef_endmonth, $search_datef_endday, $search_datef_endyear);
89$date_select =
GETPOST(
"date_select",
'alpha');
93$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
94$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
96if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
100$offset = $limit * $page;
101$pageprev = $page - 1;
102$pagenext = $page + 1;
107 $sortfield =
"c.dateadh";
112$hookmanager->initHooks(array(
'subscriptionlist'));
115$extrafields->fetch_name_optionals_label(
$object->table_element);
117$search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
120$fieldstosearchall = array(
125 'c.rowid' => array(
'label' =>
'TechnicalID',
'checked' =>
'-1',
'position' => 1),
126 'd.ref' => array(
'label' =>
"Ref",
'checked' =>
'1'),
127 'd.fk_type' => array(
'label' =>
"Type",
'checked' =>
'1'),
128 'd.lastname' => array(
'label' =>
"Lastname",
'checked' =>
'1'),
129 'd.firstname' => array(
'label' =>
"Firstname",
'checked' =>
'1'),
130 'd.login' => array(
'label' =>
"Login",
'checked' =>
'1'),
131 'c.note' => array(
'label' =>
"Label",
'checked' =>
'1'),
132 'd.bank' => array(
'label' =>
"BankAccount",
'checked' =>
'1',
'enabled' => (
string) (
int) (
isModEnabled(
'bank'))),
135 'c.dateadh' => array(
'label' =>
"DateSubscription",
'checked' =>
'1',
'position' => 100),
136 'c.datef' => array(
'label' =>
"EndSubscription",
'checked' =>
'1',
'position' => 101),
137 'd.amount' => array(
'label' =>
"Amount",
'checked' =>
'1',
'position' => 102),
138 'c.datec' => array(
'label' =>
"DateCreation",
'checked' =>
'0',
'position' => 500),
139 'c.tms' => array(
'label' =>
"DateModificationShort",
'checked' =>
'0',
'position' => 500),
143$parameters = array(
'arrayfields' => &$arrayfields);
144$reshook = $hookmanager->executeHooks(
'completeArrayFields', $parameters, $object, $action);
149$permissiontodelete = $user->hasRight(
'adherent',
'cotisation',
'creer');
156if (
GETPOST(
'cancel',
'alpha')) {
160if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
164$parameters = array(
'socid' =>
null);
165$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
167 setEventMessages($hookmanager->error, $hookmanager->errors,
'errors');
170if (empty($reshook)) {
172 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
175 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
179 $search_lastname =
"";
180 $search_firstname =
"";
184 $search_account =
"";
186 $search_array_options = array();
187 $search_dateadh_startday =
'';
188 $search_dateadh_startmonth =
'';
189 $search_dateadh_startyear =
'';
190 $search_dateadh_endday =
'';
191 $search_dateadh_endmonth =
'';
192 $search_dateadh_endyear =
'';
193 $search_dateadh_start =
'';
194 $search_dateadh_end =
'';
195 $search_datef_startday =
'';
196 $search_datef_startmonth =
'';
197 $search_datef_startyear =
'';
198 $search_datef_endday =
'';
199 $search_datef_endmonth =
'';
200 $search_datef_endyear =
'';
201 $search_datef_start =
'';
202 $search_datef_end =
'';
204 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')
205 ||
GETPOST(
'button_search_x',
'alpha') ||
GETPOST(
'button_search.x',
'alpha') ||
GETPOST(
'button_search',
'alpha')) {
210 $objectclass =
'Subscription';
211 $objectlabel =
'Subscription';
212 $uploaddir =
$conf->member->dir_output;
213 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
221$form =
new Form($db);
225$accountstatic =
new Account($db);
231$sql =
"SELECT d.rowid, d.login, d.firstname, d.lastname, d.societe, d.photo, d.statut as status,";
232$sql .=
" d.gender, d.email, d.morphy,";
233$sql .=
" c.rowid as crowid, c.fk_type, c.subscription,";
234$sql .=
" c.dateadh, c.datef, c.datec as date_creation, c.tms as date_modification,";
235$sql .=
" c.fk_bank as bank, c.note as note_private,";
236$sql .=
" b.fk_account";
238if (!empty($extrafields->attributes[
$object->table_element][
'label'])) {
239 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
240 $sql .= ($extrafields->attributes[
$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
"");
244$parameters = array();
245$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object, $action);
246$sql .= $hookmanager->resPrint;
247$sql = preg_replace(
'/,\s*$/',
'', $sql);
251$sql .=
" FROM ".MAIN_DB_PREFIX.
"adherent as d";
252$sql .=
" JOIN ".MAIN_DB_PREFIX.
"subscription as c on d.rowid = c.fk_adherent";
253$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"adherent_extrafields as ef on (d.rowid = ef.fk_object)";
254$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"bank as b ON c.fk_bank = b.rowid";
255$sql .=
" WHERE d.entity IN (".getEntity(
'adherent').
")";
256if (isset($date_select) && $date_select !=
'') {
257 $sql .=
" AND c.dateadh >= '".((int) $date_select).
"-01-01 00:00:00'";
258 $sql .=
" AND c.dateadh < '".((int) $date_select + 1).
"-01-01 00:00:00'";
261 if (is_numeric($search_ref)) {
262 $sql .=
" AND c.rowid = ".((int) $search_ref);
264 $sql .=
" AND 1 = 2";
270if ($search_type > 0) {
271 $sql .=
natural_search(array(
'c.fk_type'), (
string) $search_type);
273if ($search_lastname) {
274 $sql .=
natural_search(array(
'd.lastname',
'd.societe'), $search_lastname);
276if ($search_firstname) {
285if ($search_account > 0) {
286 $sql .=
" AND b.fk_account = ".((int) $search_account);
292 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
294if ($search_dateadh_start) {
295 $sql .=
" AND c.dateadh >= '".$db->idate($search_dateadh_start).
"'";
297if ($search_dateadh_end) {
298 $sql .=
" AND c.dateadh <= '".$db->idate($search_dateadh_end).
"'";
300if ($search_datef_start) {
301 $sql .=
" AND c.datef >= '".$db->idate($search_datef_start).
"'";
303if ($search_datef_end) {
304 $sql .=
" AND c.datef <= '".$db->idate($search_datef_end).
"'";
307include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
309$parameters = array();
310$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
311$sql .= $hookmanager->resPrint;
314$nbtotalofrecords =
'';
317 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
318 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
319 $resql = $db->query($sqlforcount);
321 $objforcount = $db->fetch_object($resql);
322 $nbtotalofrecords = $objforcount->nbtotalofrecords;
324 dol_print_error($db);
327 if (($page * $limit) > (
int) $nbtotalofrecords) {
335$sql .= $db->order($sortfield, $sortorder);
337 $sql .= $db->plimit($limit + 1, $offset);
340$resql = $db->query($sql);
342 dol_print_error($db);
346$num = $db->num_rows($resql);
350if ($num == 1 &&
getDolGlobalString(
'MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
351 $obj = $db->fetch_object($resql);
353 header(
"Location: ".DOL_URL_ROOT.
'/adherents/subscription/card.php?id='.
$id);
360$title = $langs->trans(
"Subscriptions");
361if (!empty($date_select)) {
362 $title .=
' ('.$langs->trans(
"Year").
' '.$date_select.
')';
364$help_url =
'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder';
366llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'mod-member page-subscription-list bodyforlist');
368$arrayofselected = is_array($toselect) ? $toselect : array();
372 $param .=
'&mode='.urlencode($mode);
374if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
375 $param .=
'&contextpage='.urlencode($contextpage);
377if ($limit > 0 && $limit !=
$conf->liste_limit) {
378 $param .=
'&limit='.((int) $limit);
381 $param .=
"&statut=".urlencode($statut);
384 $param .=
"&search_type=".((int) $search_type);
387 $param .=
"&search_id=".((int) $search_id);
390 $param .=
"&date_select=".urlencode($date_select);
392if ($search_lastname) {
393 $param .=
"&search_lastname=".urlencode($search_lastname);
396 $param .=
"&search_login=".urlencode($search_login);
398if ($search_account) {
399 $param .=
"&search_account=".urlencode($search_account);
402 $param .=
"&search_amount=".urlencode($search_amount);
404if ($optioncss !=
'') {
405 $param .=
'&optioncss='.urlencode($optioncss);
408if ($search_dateadh_startday) $param .=
'&search_dateadh_startday='.urlencode((
string) $search_dateadh_startday);
409if ($search_dateadh_startmonth) $param .=
'&search_dateadh_startmonth='.urlencode((
string) $search_dateadh_startmonth);
410if ($search_dateadh_startyear) $param .=
'&search_dateadh_startyear='.urlencode((
string) $search_dateadh_startyear);
413if ($search_dateadh_endday) $param .=
'&search_dateadh_endday='.urlencode((
string) $search_dateadh_endday);
414if ($search_dateadh_endmonth) $param .=
'&search_dateadh_endmonth='.urlencode((
string) $search_dateadh_endmonth);
415if ($search_dateadh_endyear) $param .=
'&search_dateadh_endyear='.urlencode((
string) $search_dateadh_endyear);
418if ($search_datef_startday) $param .=
'&search_datef_startday='.urlencode((
string) $search_datef_startday);
419if ($search_datef_startmonth) $param .=
'&search_datef_startmonth='.urlencode((
string) $search_datef_startmonth);
420if ($search_datef_startyear) $param .=
'&search_datef_startyear='.urlencode((
string) $search_datef_startyear);
423if ($search_datef_endday) $param .=
'&search_datef_endday='.urlencode((
string) $search_datef_endday);
424if ($search_datef_endmonth) $param .=
'&search_datef_endmonth='.urlencode((
string) $search_datef_endmonth);
425if ($search_datef_endyear) $param .=
'&search_datef_endyear='.urlencode((
string) $search_datef_endyear);
428include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
430$parameters = array(
'param' => &$param);
431$reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object, $action);
432$param .= $hookmanager->resPrint;
435$arrayofmassactions = array(
439if (!empty($permissiontodelete)) {
440 $arrayofmassactions[
'predelete'] = img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
442if (
GETPOSTINT(
'nomassaction') || in_array($massaction, array(
'presend',
'predelete'))) {
443 $arrayofmassactions = array();
445$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
447print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
448if ($optioncss !=
'') {
449 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
451print
'<input type="hidden" name="token" value="'.newToken().
'">';
452print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
453print
'<input type="hidden" name="action" value="list">';
454print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
455print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
456print
'<input type="hidden" name="page" value="'.$page.
'">';
457print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
458print
'<input type="hidden" name="date_select" value="'.$date_select.
'">';
459print
'<input type="hidden" name="page_y" value="">';
460print
'<input type="hidden" name="mode" value="'.$mode.
'">';
463$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'));
464$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'));
465$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'));
466if ($user->hasRight(
'adherent',
'cotisation',
'creer')) {
468 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewSubscription'),
'',
'fa fa-plus-circle', DOL_URL_ROOT.
'/adherents/list.php?status=-1,1');
471print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $subscription->picto, 0, $newcardbutton,
'', $limit, 0, 0, 1);
473$topicmail =
"Information";
474$modelmail =
"subscription";
476$trackid =
'sub'.$object->id;
477include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
481 foreach ($fieldstosearchall as $key => $val) {
482 $fieldstosearchall[$key] = $langs->trans($val);
483 $setupstring .= $key.
"=".$val.
";";
485 print
'<!-- Search done like if MYOBJECT_QUICKSEARCH_ON_FIELDS = '.$setupstring.
' -->'.
"\n";
486 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).implode(
', ', $fieldstosearchall).
'</div>'.
"\n";
494$parameters = array();
495$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
496if (empty($reshook)) {
497 $moreforfilter .= $hookmanager->resPrint;
499 $moreforfilter = $hookmanager->resPrint;
502if (!empty($moreforfilter)) {
503 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
504 print $moreforfilter;
508$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
509$htmlofselectarray = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
$conf->main_checkbox_left_column);
510$selectedfields = ($mode !=
'kanban' ? $htmlofselectarray :
'');
511$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
513print
'<div class="div-table-responsive">';
514print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
518print
'<tr class="liste_titre_filter">';
520if (
$conf->main_checkbox_left_column) {
521 print
'<td class="liste_titre center maxwidthsearch">';
522 $searchpicto = $form->showFilterButtons(
'left');
527if (!empty($arrayfields[
'c.rowid'][
'checked'])) {
528 print
'<td class="liste_titre center">';
529 print
'<input class="width50" type="text" name="search_id" value="'.dol_escape_htmltag($search_id).
'">';
534if (!empty($arrayfields[
'd.ref'][
'checked'])) {
535 print
'<td class="liste_titre left">';
536 print
'<input class="flat maxwidth50" type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref).
'"></td>';
540if (!empty($arrayfields[
'd.fk_type'][
'checked'])) {
541 print
'<td class="liste_titre left">';
542 print $form->selectarray(
"search_type", $adht->liste_array(), $search_type, 1);
546if (!empty($arrayfields[
'd.lastname'][
'checked'])) {
547 print
'<td class="liste_titre left">';
548 print
'<input class="flat maxwidth75" type="text" name="search_lastname" value="'.dol_escape_htmltag($search_lastname).
'"></td>';
551if (!empty($arrayfields[
'd.firstname'][
'checked'])) {
552 print
'<td class="liste_titre left">';
553 print
'<input class="flat maxwidth75" type="text" name="search_firstname" value="'.dol_escape_htmltag($search_firstname).
'"></td>';
556if (!empty($arrayfields[
'd.login'][
'checked'])) {
557 print
'<td class="liste_titre left">';
558 print
'<input class="flat maxwidth75" type="text" name="search_login" value="'.dol_escape_htmltag($search_login).
'"></td>';
561if (!empty($arrayfields[
'c.note'][
'checked'])) {
562 print
'<td class="liste_titre">';
563 print
'<input class="flat maxwidth100" type="text" name="search_note" value="'.dol_escape_htmltag($search_note).
'"></td>';
567if (!empty($arrayfields[
'd.bank'][
'checked'])) {
568 print
'<td class="liste_titre">';
569 $form->select_comptes($search_account,
'search_account', 0,
'', 1,
'', 0,
'maxwidth100');
573if (!empty($arrayfields[
'c.dateadh'][
'checked'])) {
574 print
'<td class="liste_titre center">';
575 print $form->selectDate($search_dateadh_start,
'search_dateadh_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
577 print $form->selectDate($search_dateadh_end,
'search_dateadh_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'To'));
581if (!empty($arrayfields[
'c.datef'][
'checked'])) {
582 print
'<td class="liste_titre center">';
583 print $form->selectDate($search_datef_start,
'search_datef_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
585 print $form->selectDate($search_datef_end,
'search_datef_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'To'));
589if (!empty($arrayfields[
'd.amount'][
'checked'])) {
590 print
'<td class="liste_titre right">';
591 print
'<input class="flat" type="text" name="search_amount" value="'.dol_escape_htmltag($search_amount).
'" size="4">';
595include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
598$parameters = array(
'arrayfields' => $arrayfields);
599$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object, $action);
600print $hookmanager->resPrint;
602if (!empty($arrayfields[
'c.datec'][
'checked'])) {
603 print
'<td class="liste_titre">';
607if (!empty($arrayfields[
'c.tms'][
'checked'])) {
608 print
'<td class="liste_titre">';
613if (!
$conf->main_checkbox_left_column) {
614 print
'<td class="liste_titre center maxwidthsearch">';
615 $searchpicto = $form->showFilterButtons();
621$totalarray = array();
622$totalarray[
'nbfield'] = 0;
626print
'<tr class="liste_titre">';
628if (
$conf->main_checkbox_left_column) {
629 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'align="center"', $sortfield, $sortorder,
'maxwidthsearch ');
630 $totalarray[
'nbfield']++;
633if (!empty($arrayfields[
'c.rowid'][
'checked'])) {
634 print_liste_field_titre($arrayfields[
'c.rowid'][
'label'], $_SERVER[
"PHP_SELF"],
'c.rowid',
'', $param,
'', $sortfield, $sortorder,
'center ');
635 $totalarray[
'nbfield']++;
637if (!empty($arrayfields[
'd.ref'][
'checked'])) {
638 print_liste_field_titre($arrayfields[
'd.ref'][
'label'], $_SERVER[
"PHP_SELF"],
"c.rowid",
"", $param,
"", $sortfield, $sortorder);
639 $totalarray[
'nbfield']++;
641if (!empty($arrayfields[
'd.fk_type'][
'checked'])) {
642 print_liste_field_titre($arrayfields[
'd.fk_type'][
'label'], $_SERVER[
"PHP_SELF"],
"c.fk_type",
"", $param,
"", $sortfield, $sortorder);
643 $totalarray[
'nbfield']++;
645if (!empty($arrayfields[
'd.lastname'][
'checked'])) {
646 print_liste_field_titre($arrayfields[
'd.lastname'][
'label'], $_SERVER[
"PHP_SELF"],
"d.lastname",
"", $param,
"", $sortfield, $sortorder);
647 $totalarray[
'nbfield']++;
649if (!empty($arrayfields[
'd.firstname'][
'checked'])) {
650 print_liste_field_titre($arrayfields[
'd.firstname'][
'label'], $_SERVER[
"PHP_SELF"],
"d.firstname",
"", $param,
"", $sortfield, $sortorder);
651 $totalarray[
'nbfield']++;
653if (!empty($arrayfields[
'd.login'][
'checked'])) {
654 print_liste_field_titre($arrayfields[
'd.login'][
'label'], $_SERVER[
"PHP_SELF"],
"d.login",
"", $param,
"", $sortfield, $sortorder);
655 $totalarray[
'nbfield']++;
657if (!empty($arrayfields[
'c.note'][
'checked'])) {
658 print_liste_field_titre($arrayfields[
'c.note'][
'label'], $_SERVER[
"PHP_SELF"],
"c.note",
"", $param,
'', $sortfield, $sortorder);
659 $totalarray[
'nbfield']++;
661if (!empty($arrayfields[
'd.bank'][
'checked'])) {
662 print_liste_field_titre($arrayfields[
'd.bank'][
'label'], $_SERVER[
"PHP_SELF"],
"b.fk_account",
"", $param,
"", $sortfield, $sortorder);
663 $totalarray[
'nbfield']++;
665if (!empty($arrayfields[
'c.dateadh'][
'checked'])) {
666 print_liste_field_titre($arrayfields[
'c.dateadh'][
'label'], $_SERVER[
"PHP_SELF"],
"c.dateadh",
"", $param,
'', $sortfield, $sortorder,
'center nowraponall ');
667 $totalarray[
'nbfield']++;
669if (!empty($arrayfields[
'c.datef'][
'checked'])) {
670 print_liste_field_titre($arrayfields[
'c.datef'][
'label'], $_SERVER[
"PHP_SELF"],
"c.datef",
"", $param,
'', $sortfield, $sortorder,
'center nowraponall ');
671 $totalarray[
'nbfield']++;
673if (!empty($arrayfields[
'd.amount'][
'checked'])) {
674 print_liste_field_titre($arrayfields[
'd.amount'][
'label'], $_SERVER[
"PHP_SELF"],
"c.subscription",
"", $param,
'', $sortfield, $sortorder,
'right ');
675 $totalarray[
'nbfield']++;
679include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
682$parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder,
'totalarray' => &$totalarray);
683$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object, $action);
684print $hookmanager->resPrint;
685if (!empty($arrayfields[
'c.datec'][
'checked'])) {
686 print_liste_field_titre($arrayfields[
'c.datec'][
'label'], $_SERVER[
"PHP_SELF"],
"c.datec",
"", $param,
'align="center" class="nowrap"', $sortfield, $sortorder);
688if (!empty($arrayfields[
'c.tms'][
'checked'])) {
689 print_liste_field_titre($arrayfields[
'c.tms'][
'label'], $_SERVER[
"PHP_SELF"],
"c.tms",
"", $param,
'align="center" class="nowrap"', $sortfield, $sortorder);
692if (!
$conf->main_checkbox_left_column) {
693 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
694 $totalarray[
'nbfield']++;
701$savnbfield = $totalarray[
'nbfield'];
702$totalarray = array();
703$totalarray[
'nbfield'] = 0;
704$imaxinloop = ($limit ? min($num, $limit) : $num);
705while ($i < $imaxinloop) {
706 $obj = $db->fetch_object($resql);
711 $subscription->ref = $obj->crowid;
712 $subscription->id = $obj->crowid;
713 $subscription->dateh = $db->jdate($obj->dateadh);
714 $subscription->datef = $db->jdate($obj->datef);
715 $subscription->amount = $obj->subscription;
716 $subscription->fk_adherent = $obj->rowid;
718 $adherent->lastname = $obj->lastname;
719 $adherent->firstname = $obj->firstname;
720 $adherent->company = $obj->societe;
721 $adherent->ref = $obj->rowid;
722 $adherent->id = $obj->rowid;
723 $adherent->statut = $obj->status;
724 $adherent->status = $obj->status;
725 $adherent->login = $obj->login;
726 $adherent->photo = $obj->photo;
727 $adherent->gender = $obj->gender;
728 $adherent->morphy = $obj->morphy;
729 $adherent->email = $obj->email;
730 $adherent->typeid = $obj->fk_type;
731 $adherent->datefin = $db->jdate($obj->datef);
733 $typeid = ($obj->fk_type > 0 ? $obj->fk_type : $adherent->typeid);
735 $adht->fetch($typeid);
737 $adherent->need_subscription = (int) $adht->subscription;
739 if ($mode ==
'kanban') {
741 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
742 print
'<div class="box-flex-container kanban">';
745 if ($massactionbutton || $massaction) {
747 if (in_array(
$object->id, $arrayofselected)) {
754 if ($obj->fk_account > 0) {
755 $accountstatic->id = $obj->fk_account;
756 $accountstatic->fetch($obj->fk_account);
759 print $subscription->getKanbanView(
'', array(
'selected' => in_array(
$object->id, $arrayofselected),
'adherent_type' => $adht,
'member' => $adherent,
'bank' => ($obj->fk_account > 0 ? $accountstatic : null)));
760 if ($i == ($imaxinloop - 1)) {
767 print
'<tr data-rowid="'.$object->id.
'" class="oddeven">';
769 if (
$conf->main_checkbox_left_column) {
770 print
'<td class="nowrap center">';
771 if ($massactionbutton || $massaction) {
773 if (in_array($obj->crowid, $arrayofselected)) {
776 print
'<input id="cb'.$obj->crowid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->crowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
780 $totalarray[
'nbfield']++;
784 if (!empty($arrayfields[
'c.rowid'][
'checked'])) {
785 print
'<td class="center" data-key="id">'.dolPrintHTML($obj->crowid).
'</td>';
787 $totalarray[
'nbfield']++;
791 if (!empty($arrayfields[
'd.ref'][
'checked'])) {
792 print
'<td class="nowraponall">'.$subscription->getNomUrl(1).
'</td>';
794 $totalarray[
'nbfield']++;
798 if (!empty($arrayfields[
'd.fk_type'][
'checked'])) {
799 print
'<td class="tdoverflowmax100">';
801 print $adht->getNomUrl(1);
805 $totalarray[
'nbfield']++;
810 if (!empty($arrayfields[
'd.lastname'][
'checked'])) {
811 print
'<td class="tdoverflowmax125">'.$adherent->getNomUrl(-1, 0,
'card',
'lastname').
'</td>';
813 $totalarray[
'nbfield']++;
817 if (!empty($arrayfields[
'd.firstname'][
'checked'])) {
818 print
'<td class="tdoverflowmax125" title="'.dolPrintHTMLForAttribute($adherent->firstname).
'">'.dolPrintHTML($adherent->firstname).
'</td>';
820 $totalarray[
'nbfield']++;
825 if (!empty($arrayfields[
'd.login'][
'checked'])) {
826 print
'<td class="tdoverflowmax150" title="'.dolPrintHTMLForAttribute($adherent->login).
'">'.dolPrintHTML($adherent->login).
'</td>';
828 $totalarray[
'nbfield']++;
833 if (!empty($arrayfields[
'c.note'][
'checked'])) {
834 print
'<td class="" title="'.dolPrintHTMLForAttribute($obj->note_private).
'">';
835 print
'<div class="twolinesmax-normallineheight minwidth200onall">';
836 print
'<span class="spantitle">';
842 $totalarray[
'nbfield']++;
847 if (!empty($arrayfields[
'd.bank'][
'checked'])) {
848 print
'<td class="tdoverflowmax100">';
849 if ($obj->fk_account > 0) {
850 $accountstatic->id = $obj->fk_account;
851 $accountstatic->fetch($obj->fk_account);
853 print $accountstatic->getNomUrl(1);
857 $totalarray[
'nbfield']++;
862 if (!empty($arrayfields[
'c.dateadh'][
'checked'])) {
863 print
'<td class="center nowraponall">'.dol_print_date($db->jdate($obj->dateadh),
'day').
"</td>\n";
865 $totalarray[
'nbfield']++;
869 if (!empty($arrayfields[
'c.datef'][
'checked'])) {
870 print
'<td class="center nowraponall">'.dol_print_date($db->jdate($obj->datef),
'day').
"</td>\n";
872 $totalarray[
'nbfield']++;
876 if (!empty($arrayfields[
'd.amount'][
'checked'])) {
877 print
'<td class="right amount">'.price($obj->subscription).
'</td>';
879 $totalarray[
'nbfield']++;
882 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'd.amount';
884 if (empty($totalarray[
'val'][
'd.amount'])) {
885 $totalarray[
'val'][
'd.amount'] = $obj->subscription;
887 $totalarray[
'val'][
'd.amount'] += $obj->subscription;
891 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
893 $parameters = array(
'arrayfields' => $arrayfields,
'obj' => $obj,
'i' => $i,
'totalarray' => &$totalarray);
894 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters);
895 print $hookmanager->resPrint;
897 if (!empty($arrayfields[
'c.datec'][
'checked'])) {
898 print
'<td class="nowrap center">';
899 print
dol_print_date($db->jdate($obj->date_creation),
'dayhour',
'tzuser');
902 $totalarray[
'nbfield']++;
906 if (!empty($arrayfields[
'c.tms'][
'checked'])) {
907 print
'<td class="nowrap center">';
908 print
dol_print_date($db->jdate($obj->date_modification),
'dayhour',
'tzuser');
911 $totalarray[
'nbfield']++;
915 if (!
$conf->main_checkbox_left_column) {
916 print
'<td class="nowrap center">';
917 if ($massactionbutton || $massaction) {
919 if (in_array($obj->crowid, $arrayofselected)) {
922 print
'<input id="cb'.$obj->crowid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->crowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
926 $totalarray[
'nbfield']++;
936include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
942 foreach ($arrayfields as $key => $val) {
943 if (!empty($val[
'checked'])) {
947 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
952$parameters = array(
'arrayfields' => $arrayfields,
'sql' => $sql);
953$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
954print $hookmanager->resPrint;
956print
'</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).
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
print_liste_field_titre($name, $file="", $field="", $begin="", $param="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
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.
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $nodie=0, $mode='')
Check permissions of a user to show a page and an object.