28require
'../../main.inc.php';
29require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
30require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent_type.class.php';
31require_once DOL_DOCUMENT_ROOT.
'/adherents/class/subscription.class.php';
32require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
34$langs->loadLangs(array(
"members",
"companies",
"banks"));
36$action =
GETPOST(
'action',
'aZ09') ?
GETPOST(
'action',
'aZ09') :
'view';
37$massaction =
GETPOST(
'massaction',
'alpha');
39$confirm =
GETPOST(
'confirm',
'alpha');
40$cancel =
GETPOST(
'cancel',
'alpha');
41$toselect =
GETPOST(
'toselect',
'array');
42$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') : str_replace(
'_',
'', basename(dirname(__FILE__)).basename(__FILE__,
'.php'));
43$backtopage =
GETPOST(
'backtopage',
'alpha');
44$optioncss =
GETPOST(
'optioncss',
'aZ');
47$statut = (GETPOSTISSET(
"statut") ?
GETPOST(
"statut",
"alpha") : 1);
48$search_ref =
GETPOST(
'search_ref',
'alpha');
49$search_type =
GETPOST(
'search_type',
'alpha');
50$search_lastname =
GETPOST(
'search_lastname',
'alpha');
51$search_firstname =
GETPOST(
'search_firstname',
'alpha');
52$search_login =
GETPOST(
'search_login',
'alpha');
53$search_note =
GETPOST(
'search_note',
'alpha');
54$search_account =
GETPOST(
'search_account',
'alpha');
55$search_amount =
GETPOST(
'search_amount',
'alpha');
58$date_select =
GETPOST(
"date_select",
'alpha');
62$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
63$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
65if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
69$offset = $limit * $page;
76 $sortfield =
"c.dateadh";
82$hookmanager->initHooks(array(
'subscriptionlist'));
85$extrafields->fetch_name_optionals_label(
$object->table_element);
87$search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
90$fieldstosearchall = array(
93 'd.ref' => array(
'label' =>
"Ref",
'checked' => 1),
94 'd.fk_type' => array(
'label' =>
"Type",
'checked' => 1),
95 'd.lastname' => array(
'label' =>
"Lastname",
'checked' => 1),
96 'd.firstname' => array(
'label' =>
"Firstname",
'checked' => 1),
97 'd.login' => array(
'label' =>
"Login",
'checked' => 1),
98 't.libelle' => array(
'label' =>
"Label",
'checked' => 1),
99 'd.bank' => array(
'label' =>
"BankAccount",
'checked' => 1,
'enabled' => (isModEnabled(
'bank'))),
102 'c.dateadh' => array(
'label' =>
"DateSubscription",
'checked' => 1,
'position' => 100),
103 'c.datef' => array(
'label' =>
"EndSubscription",
'checked' => 1,
'position' => 101),
104 'd.amount' => array(
'label' =>
"Amount",
'checked' => 1,
'position' => 102),
105 'c.datec' => array(
'label' =>
"DateCreation",
'checked' => 0,
'position' => 500),
106 'c.tms' => array(
'label' =>
"DateModificationShort",
'checked' => 0,
'position' => 500),
113$permissiontodelete = $user->hasRight(
'adherent',
'cotisation',
'creer');
120if (
GETPOST(
'cancel',
'alpha')) {
124if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
128$parameters = array(
'socid' => isset($socid) ? $socid : null);
129$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
134if (empty($reshook)) {
136 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
139 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
142 $search_lastname =
"";
143 $search_firstname =
"";
147 $search_account =
"";
149 $search_array_options = array();
151 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')
152 ||
GETPOST(
'button_search_x',
'alpha') ||
GETPOST(
'button_search.x',
'alpha') ||
GETPOST(
'button_search',
'alpha')) {
157 $objectclass =
'Subscription';
158 $objectlabel =
'Subscription';
159 $uploaddir = $conf->adherent->dir_output;
160 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
168$form =
new Form($db);
171$accountstatic =
new Account($db);
176$sql =
"SELECT d.rowid, d.login, d.firstname, d.lastname, d.societe, d.photo, d.statut as status,";
177$sql .=
" d.gender, d.email, d.morphy,";
178$sql .=
" c.rowid as crowid, c.fk_type, c.subscription,";
179$sql .=
" c.dateadh, c.datef, c.datec as date_creation, c.tms as date_modification,";
180$sql .=
" c.fk_bank as bank, c.note as note_private,";
181$sql .=
" b.fk_account";
183if (!empty($extrafields->attributes[
$object->table_element][
'label'])) {
184 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
185 $sql .= ($extrafields->attributes[
$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
189$parameters = array();
190$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object, $action);
191$sql .= $hookmanager->resPrint;
192$sql = preg_replace(
'/,\s*$/',
'', $sql);
196$sql .=
" FROM ".MAIN_DB_PREFIX.
"adherent as d";
197$sql .=
" JOIN ".MAIN_DB_PREFIX.
"subscription as c on d.rowid = c.fk_adherent";
198$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"adherent_extrafields as ef on (d.rowid = ef.fk_object)";
199$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"bank as b ON c.fk_bank = b.rowid";
200$sql .=
" WHERE d.entity IN (".getEntity(
'adherent').
")";
201if (isset($date_select) && $date_select !=
'') {
202 $sql .=
" AND c.dateadh >= '".((int) $date_select).
"-01-01 00:00:00'";
203 $sql .=
" AND c.dateadh < '".((int) $date_select + 1).
"-01-01 00:00:00'";
206 if (is_numeric($search_ref)) {
207 $sql .=
" AND c.rowid = ".((int) $search_ref);
209 $sql .=
" AND 1 = 2";
215if ($search_lastname) {
216 $sql .=
natural_search(array(
'd.lastname',
'd.societe'), $search_lastname);
218if ($search_firstname) {
227if ($search_account > 0) {
228 $sql .=
" AND b.fk_account = ".((int) $search_account);
234 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
237include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
239$parameters = array();
240$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
241$sql .= $hookmanager->resPrint;
244$nbtotalofrecords =
'';
247 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
248 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
249 $resql = $db->query($sqlforcount);
251 $objforcount = $db->fetch_object($resql);
252 $nbtotalofrecords = $objforcount->nbtotalofrecords;
257 if (($page * $limit) > $nbtotalofrecords) {
265$sql .= $db->order($sortfield, $sortorder);
267 $sql .= $db->plimit($limit + 1, $offset);
270$resql = $db->query($sql);
276$num = $db->num_rows($resql);
280if ($num == 1 &&
getDolGlobalString(
'MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
281 $obj = $db->fetch_object($resql);
283 header(
"Location: ".DOL_URL_ROOT.
'/adherents/subscription/card.php?id='.$id);
290$title = $langs->trans(
"Subscriptions");
291if (!empty($date_select)) {
292 $title .=
' ('.$langs->trans(
"Year").
' '.$date_select.
')';
294$help_url =
'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder';
296llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'mod-member page-subscription-list bodyforlist');
298$arrayofselected = is_array($toselect) ? $toselect : array();
302 $param .=
'&mode='.urlencode($mode);
304if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
305 $param .=
'&contextpage='.urlencode($contextpage);
307if ($limit > 0 && $limit != $conf->liste_limit) {
308 $param .=
'&limit='.((int) $limit);
311 $param .=
"&statut=".urlencode($statut);
314 $param .=
"&search_type=".urlencode($search_type);
317 $param .=
"&date_select=".urlencode($date_select);
319if ($search_lastname) {
320 $param .=
"&search_lastname=".urlencode($search_lastname);
323 $param .=
"&search_login=".urlencode($search_login);
325if ($search_account) {
326 $param .=
"&search_account=".urlencode($search_account);
329 $param .=
"&search_amount=".urlencode($search_amount);
331if ($optioncss !=
'') {
332 $param .=
'&optioncss='.urlencode($optioncss);
335include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
337$parameters = array(
'param' => &$param);
338$reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object, $action);
339$param .= $hookmanager->resPrint;
342$arrayofmassactions = array(
346if (!empty($permissiontodelete)) {
347 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
349if (
GETPOSTINT(
'nomassaction') || in_array($massaction, array(
'presend',
'predelete'))) {
350 $arrayofmassactions = array();
352$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
354print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
355if ($optioncss !=
'') {
356 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
358print
'<input type="hidden" name="token" value="'.newToken().
'">';
359print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
360print
'<input type="hidden" name="action" value="list">';
361print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
362print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
363print
'<input type="hidden" name="page" value="'.$page.
'">';
364print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
365print
'<input type="hidden" name="date_select" value="'.$date_select.
'">';
366print
'<input type="hidden" name="page_y" value="">';
367print
'<input type="hidden" name="mode" value="'.$mode.
'">';
370$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'));
371$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'));
372if ($user->hasRight(
'adherent',
'cotisation',
'creer')) {
374 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewSubscription'),
'',
'fa fa-plus-circle', DOL_URL_ROOT.
'/adherents/list.php?status=-1,1');
377print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $subscription->picto, 0, $newcardbutton,
'', $limit, 0, 0, 1);
379$topicmail =
"Information";
380$modelmail =
"subscription";
382$trackid =
'sub'.$object->id;
383include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
387 foreach ($fieldstosearchall as $key => $val) {
388 $fieldstosearchall[$key] = $langs->trans($val);
389 $setupstring .= $key.
"=".$val.
";";
391 print
'<!-- Search done like if MYOBJECT_QUICKSEARCH_ON_FIELDS = '.$setupstring.
' -->'.
"\n";
392 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).implode(
', ', $fieldstosearchall).
'</div>'.
"\n";
400$parameters = array();
401$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
402if (empty($reshook)) {
403 $moreforfilter .= $hookmanager->resPrint;
405 $moreforfilter = $hookmanager->resPrint;
408if (!empty($moreforfilter)) {
409 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
410 print $moreforfilter;
411 $parameters = array();
412 $reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
413 print $hookmanager->resPrint;
417$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
418$htmlofselectarray = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));
419$selectedfields = ($mode !=
'kanban' ? $htmlofselectarray :
'');
420$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
422print
'<div class="div-table-responsive">';
423print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
427print
'<tr class="liste_titre_filter">';
430 print
'<td class="liste_titre center maxwidthsearch">';
431 $searchpicto = $form->showFilterButtons(
'left');
437 print
'<td class="liste_titre"> </td>';
441if (!empty($arrayfields[
'd.ref'][
'checked'])) {
442 print
'<td class="liste_titre left">';
443 print
'<input class="flat maxwidth50" type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref).
'"></td>';
447if (!empty($arrayfields[
'd.fk_type'][
'checked'])) {
448 print
'<td class="liste_titre left">';
449 print
'<input class="flat maxwidth50" type="text" name="search_type" value="'.dol_escape_htmltag($search_type).
'">';
453if (!empty($arrayfields[
'd.lastname'][
'checked'])) {
454 print
'<td class="liste_titre left">';
455 print
'<input class="flat maxwidth75" type="text" name="search_lastname" value="'.dol_escape_htmltag($search_lastname).
'"></td>';
458if (!empty($arrayfields[
'd.firstname'][
'checked'])) {
459 print
'<td class="liste_titre left">';
460 print
'<input class="flat maxwidth75" type="text" name="search_firstname" value="'.dol_escape_htmltag($search_firstname).
'"></td>';
463if (!empty($arrayfields[
'd.login'][
'checked'])) {
464 print
'<td class="liste_titre left">';
465 print
'<input class="flat maxwidth75" type="text" name="search_login" value="'.dol_escape_htmltag($search_login).
'"></td>';
468if (!empty($arrayfields[
't.libelle'][
'checked'])) {
469 print
'<td class="liste_titre">';
474if (!empty($arrayfields[
'd.bank'][
'checked'])) {
475 print
'<td class="liste_titre">';
476 $form->select_comptes($search_account,
'search_account', 0,
'', 1,
'', 0,
'maxwidth100');
480if (!empty($arrayfields[
'c.dateadh'][
'checked'])) {
481 print
'<td class="liste_titre"> </td>';
484if (!empty($arrayfields[
'c.datef'][
'checked'])) {
485 print
'<td class="liste_titre"> </td>';
488if (!empty($arrayfields[
'd.amount'][
'checked'])) {
489 print
'<td class="liste_titre right">';
490 print
'<input class="flat" type="text" name="search_amount" value="'.dol_escape_htmltag($search_amount).
'" size="4">';
494include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
497$parameters = array(
'arrayfields' => $arrayfields);
498$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object, $action);
499print $hookmanager->resPrint;
501if (!empty($arrayfields[
'c.datec'][
'checked'])) {
502 print
'<td class="liste_titre">';
506if (!empty($arrayfields[
'c.tms'][
'checked'])) {
507 print
'<td class="liste_titre">';
513 print
'<td class="liste_titre center maxwidthsearch">';
514 $searchpicto = $form->showFilterButtons();
520$totalarray = array();
521$totalarray[
'nbfield'] = 0;
525print
'<tr class="liste_titre">';
528 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'align="center"', $sortfield, $sortorder,
'maxwidthsearch ');
529 $totalarray[
'nbfield']++;
531if (!empty($arrayfields[
'd.ref'][
'checked'])) {
532 print_liste_field_titre($arrayfields[
'd.ref'][
'label'], $_SERVER[
"PHP_SELF"],
"c.rowid", $param,
"",
"", $sortfield, $sortorder);
533 $totalarray[
'nbfield']++;
535if (!empty($arrayfields[
'd.fk_type'][
'checked'])) {
536 print_liste_field_titre($arrayfields[
'd.fk_type'][
'label'], $_SERVER[
"PHP_SELF"],
"c.fk_type", $param,
"",
"", $sortfield, $sortorder);
537 $totalarray[
'nbfield']++;
539if (!empty($arrayfields[
'd.lastname'][
'checked'])) {
540 print_liste_field_titre($arrayfields[
'd.lastname'][
'label'], $_SERVER[
"PHP_SELF"],
"d.lastname", $param,
"",
"", $sortfield, $sortorder);
541 $totalarray[
'nbfield']++;
543if (!empty($arrayfields[
'd.firstname'][
'checked'])) {
544 print_liste_field_titre($arrayfields[
'd.firstname'][
'label'], $_SERVER[
"PHP_SELF"],
"d.firstname", $param,
"",
"", $sortfield, $sortorder);
545 $totalarray[
'nbfield']++;
547if (!empty($arrayfields[
'd.login'][
'checked'])) {
548 print_liste_field_titre($arrayfields[
'd.login'][
'label'], $_SERVER[
"PHP_SELF"],
"d.login", $param,
"",
"", $sortfield, $sortorder);
549 $totalarray[
'nbfield']++;
551if (!empty($arrayfields[
't.libelle'][
'checked'])) {
552 print_liste_field_titre($arrayfields[
't.libelle'][
'label'], $_SERVER[
"PHP_SELF"],
"c.note", $param,
"",
'', $sortfield, $sortorder);
553 $totalarray[
'nbfield']++;
555if (!empty($arrayfields[
'd.bank'][
'checked'])) {
556 print_liste_field_titre($arrayfields[
'd.bank'][
'label'], $_SERVER[
"PHP_SELF"],
"b.fk_account", $param,
"",
"", $sortfield, $sortorder);
557 $totalarray[
'nbfield']++;
559if (!empty($arrayfields[
'c.dateadh'][
'checked'])) {
560 print_liste_field_titre($arrayfields[
'c.dateadh'][
'label'], $_SERVER[
"PHP_SELF"],
"c.dateadh", $param,
"",
'', $sortfield, $sortorder,
'center nowraponall ');
561 $totalarray[
'nbfield']++;
563if (!empty($arrayfields[
'c.datef'][
'checked'])) {
564 print_liste_field_titre($arrayfields[
'c.datef'][
'label'], $_SERVER[
"PHP_SELF"],
"c.datef", $param,
"",
'', $sortfield, $sortorder,
'center nowraponall ');
565 $totalarray[
'nbfield']++;
567if (!empty($arrayfields[
'd.amount'][
'checked'])) {
568 print_liste_field_titre($arrayfields[
'd.amount'][
'label'], $_SERVER[
"PHP_SELF"],
"c.subscription", $param,
"",
'', $sortfield, $sortorder,
'right ');
569 $totalarray[
'nbfield']++;
573include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
576$parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder,
'totalarray' => &$totalarray);
577$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object, $action);
578print $hookmanager->resPrint;
579if (!empty($arrayfields[
'c.datec'][
'checked'])) {
580 print_liste_field_titre($arrayfields[
'c.datec'][
'label'], $_SERVER[
"PHP_SELF"],
"c.datec",
"", $param,
'align="center" class="nowrap"', $sortfield, $sortorder);
582if (!empty($arrayfields[
'c.tms'][
'checked'])) {
583 print_liste_field_titre($arrayfields[
'c.tms'][
'label'], $_SERVER[
"PHP_SELF"],
"c.tms",
"", $param,
'align="center" class="nowrap"', $sortfield, $sortorder);
587 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
588 $totalarray[
'nbfield']++;
595$savnbfield = $totalarray[
'nbfield'];
596$totalarray = array();
597$totalarray[
'nbfield'] = 0;
598$imaxinloop = ($limit ? min($num, $limit) : $num);
599while ($i < $imaxinloop) {
600 $obj = $db->fetch_object($resql);
605 $subscription->ref = $obj->crowid;
606 $subscription->id = $obj->crowid;
607 $subscription->dateh = $db->jdate($obj->dateadh);
608 $subscription->datef = $db->jdate($obj->datef);
609 $subscription->amount = $obj->subscription;
610 $subscription->fk_adherent = $obj->rowid;
612 $adherent->lastname = $obj->lastname;
613 $adherent->firstname = $obj->firstname;
614 $adherent->ref = $obj->rowid;
615 $adherent->id = $obj->rowid;
616 $adherent->statut = $obj->status;
617 $adherent->status = $obj->status;
618 $adherent->login = $obj->login;
619 $adherent->photo = $obj->photo;
620 $adherent->gender = $obj->gender;
621 $adherent->morphy = $obj->morphy;
622 $adherent->email = $obj->email;
623 $adherent->typeid = $obj->fk_type;
624 $adherent->datefin = $db->jdate($obj->datef);
626 $typeid = ($obj->fk_type > 0 ? $obj->fk_type : $adherent->typeid);
628 $adht->fetch($typeid);
630 $adherent->need_subscription = $adht->subscription;
632 if ($mode ==
'kanban') {
634 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
635 print
'<div class="box-flex-container kanban">';
638 if ($massactionbutton || $massaction) {
640 if (in_array(
$object->id, $arrayofselected)) {
647 if ($obj->fk_account > 0) {
648 $accountstatic->id = $obj->fk_account;
649 $accountstatic->fetch($obj->fk_account);
652 print $subscription->getKanbanView(
'', array(
'selected' => in_array(
$object->id, $arrayofselected),
'adherent_type' => $adht,
'member' => $adherent,
'bank' => ($obj->fk_account > 0 ? $accountstatic : null)));
653 if ($i == ($imaxinloop - 1)) {
660 print
'<tr data-rowid="'.$object->id.
'" class="oddeven">';
663 print
'<td class="nowrap center">';
664 if ($massactionbutton || $massaction) {
666 if (in_array($obj->crowid, $arrayofselected)) {
669 print
'<input id="cb'.$obj->crowid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->crowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
673 $totalarray[
'nbfield']++;
677 if (!empty($arrayfields[
'd.ref'][
'checked'])) {
678 print
'<td class="nowraponall">'.$subscription->getNomUrl(1).
'</td>';
680 $totalarray[
'nbfield']++;
684 if (!empty($arrayfields[
'd.fk_type'][
'checked'])) {
685 print
'<td class="tdoverflowmax100">';
687 print $adht->getNomUrl(1);
691 $totalarray[
'nbfield']++;
696 if (!empty($arrayfields[
'd.lastname'][
'checked'])) {
697 print
'<td class="tdoverflowmax125">'.$adherent->getNomUrl(-1, 0,
'card',
'lastname').
'</td>';
699 $totalarray[
'nbfield']++;
703 if (!empty($arrayfields[
'd.firstname'][
'checked'])) {
704 print
'<td class="tdoverflowmax125" title="'.dol_escape_htmltag($adherent->firstname).
'">'.
dol_escape_htmltag($adherent->firstname).
'</td>';
706 $totalarray[
'nbfield']++;
711 if (!empty($arrayfields[
'd.login'][
'checked'])) {
712 print
'<td class="tdoverflowmax150" title="'.dol_escape_htmltag($adherent->login).
'">'.
dol_escape_htmltag($adherent->login).
'</td>';
714 $totalarray[
'nbfield']++;
719 if (!empty($arrayfields[
't.libelle'][
'checked'])) {
720 print
'<td class="tdoverflowmax400" title="'.dol_escape_htmltag($obj->note_private).
'">';
724 $totalarray[
'nbfield']++;
729 if (!empty($arrayfields[
'd.bank'][
'checked'])) {
730 print
'<td class="tdmaxoverflow100">';
731 if ($obj->fk_account > 0) {
732 $accountstatic->id = $obj->fk_account;
733 $accountstatic->fetch($obj->fk_account);
735 print $accountstatic->getNomUrl(1);
739 $totalarray[
'nbfield']++;
744 if (!empty($arrayfields[
'c.dateadh'][
'checked'])) {
745 print
'<td class="center nowraponall">'.dol_print_date($db->jdate($obj->dateadh),
'day').
"</td>\n";
747 $totalarray[
'nbfield']++;
751 if (!empty($arrayfields[
'c.datef'][
'checked'])) {
752 print
'<td class="center nowraponall">'.dol_print_date($db->jdate($obj->datef),
'day').
"</td>\n";
754 $totalarray[
'nbfield']++;
758 if (!empty($arrayfields[
'd.amount'][
'checked'])) {
759 print
'<td class="right amount">'.price($obj->subscription).
'</td>';
761 $totalarray[
'nbfield']++;
764 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'd.amount';
766 if (empty($totalarray[
'val'][
'd.amount'])) {
767 $totalarray[
'val'][
'd.amount'] = $obj->subscription;
769 $totalarray[
'val'][
'd.amount'] += $obj->subscription;
773 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
775 $parameters = array(
'arrayfields' => $arrayfields,
'obj' => $obj,
'i' => $i,
'totalarray' => &$totalarray);
776 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters);
777 print $hookmanager->resPrint;
779 if (!empty($arrayfields[
'c.datec'][
'checked'])) {
780 print
'<td class="nowrap center">';
781 print
dol_print_date($db->jdate($obj->date_creation),
'dayhour',
'tzuser');
784 $totalarray[
'nbfield']++;
788 if (!empty($arrayfields[
'c.tms'][
'checked'])) {
789 print
'<td class="nowrap center">';
790 print
dol_print_date($db->jdate($obj->date_modification),
'dayhour',
'tzuser');
793 $totalarray[
'nbfield']++;
798 print
'<td class="nowrap center">';
799 if ($massactionbutton || $massaction) {
801 if (in_array($obj->crowid, $arrayofselected)) {
804 print
'<input id="cb'.$obj->crowid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->crowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
808 $totalarray[
'nbfield']++;
818include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
824 foreach ($arrayfields as $key => $val) {
825 if (!empty($val[
'checked'])) {
829 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
834$parameters = array(
'arrayfields' => $arrayfields,
'sql' => $sql);
835$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
836print $hookmanager->resPrint;
838print
'</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.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dolGetFirstLineOfText($text, $nboflines=1, $charset='UTF-8')
Return first line of text.
dolGetButtonTitle($label, $helpText='', $iconClass='fa fa-file', $url='', $id='', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
natural_search($fields, $value, $mode=0, $nofirstand=0)
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
dol_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $disablesortlink=0, $tooltip='', $forcenowrapcolumntitle=0)
Get title line of an array.
dolGetButtonTitleSeparator($moreClass="")
Add space between dolGetButtonTitle.
print_barre_liste($title, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $hideselectlimit=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.