35require
'../main.inc.php';
36require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
37require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent_type.class.php';
38require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
39require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
51$langs->loadLangs(array(
"members",
"companies",
"categories"));
55$action =
GETPOST(
'action',
'aZ09');
56$massaction =
GETPOST(
'massaction',
'alpha');
58$confirm =
GETPOST(
'confirm',
'alpha');
59$cancel =
GETPOST(
'cancel',
'alpha');
60$toselect =
GETPOST(
'toselect',
'array');
61$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'memberslist';
62$backtopage =
GETPOST(
'backtopage',
'alpha');
63$optioncss =
GETPOST(
'optioncss',
'aZ');
64$mode =
GETPOST(
'mode',
'alpha');
65$groupby =
GETPOST(
'groupby',
'aZ09');
68$search =
GETPOST(
"search",
'alpha');
69$search_id =
GETPOST(
'search_id',
'int');
70$search_ref =
GETPOST(
"search_ref",
'alpha');
71$search_lastname =
GETPOST(
"search_lastname",
'alpha');
72$search_firstname =
GETPOST(
"search_firstname",
'alpha');
73$search_gender =
GETPOST(
"search_gender",
'alpha');
74$search_civility =
GETPOST(
"search_civility",
'alpha');
75$search_company =
GETPOST(
'search_company',
'alphanohtml');
76$search_login =
GETPOST(
"search_login",
'alpha');
77$search_address =
GETPOST(
"search_address",
'alpha');
78$search_zip =
GETPOST(
"search_zip",
'alpha');
79$search_town =
GETPOST(
"search_town",
'alpha');
80$search_state =
GETPOST(
"search_state",
'alpha');
81$search_country =
GETPOST(
"search_country",
'alpha');
82$search_phone =
GETPOST(
"search_phone",
'alpha');
83$search_phone_perso =
GETPOST(
"search_phone_perso",
'alpha');
84$search_phone_mobile =
GETPOST(
"search_phone_mobile",
'alpha');
85$search_type =
GETPOST(
"search_type",
'alpha');
86$search_email =
GETPOST(
"search_email",
'alpha');
87$search_categ =
GETPOST(
"search_categ",
'intcomma');
88$search_morphy =
GETPOST(
"search_morphy",
'alpha');
89$search_import_key = trim(
GETPOST(
"search_import_key",
'alpha'));
92if (
GETPOSTINT(
'catid') && empty($search_categ)) {
96$search_filter =
GETPOST(
"search_filter",
'alpha');
97$search_status =
GETPOST(
"search_status",
'intcomma');
103$filter =
GETPOST(
"filter",
'alpha');
105 $search_filter = $filter;
108$statut =
GETPOST(
"statut",
'alpha');
110 $search_status = $statut;
113$search_all = trim(
GETPOST(
'search_all',
'alphanohtml'));
115if ($search_status < -2) {
121$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
122$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
124if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
128$offset = $limit * $page;
129$pageprev = $page - 1;
130$pagenext = $page + 1;
132 $sortorder = ($filter ==
'outofdate' ?
"DESC" :
"ASC");
135 $sortfield = ($filter ==
'outofdate' ?
"d.datefin" :
"d.lastname");
141$hookmanager->initHooks(array(
'memberlist'));
145$extrafields->fetch_name_optionals_label(
$object->table_element);
147$search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
150$fieldstosearchall = array(
152 'd.login' =>
'Login',
153 'd.lastname' =>
'Lastname',
154 'd.firstname' =>
'Firstname',
155 'd.societe' =>
"Company",
156 'd.email' =>
'EMail',
157 'd.address' =>
'Address',
160 'd.phone' =>
"Phone",
161 'd.phone_perso' =>
"PhonePerso",
162 'd.phone_mobile' =>
"PhoneMobile",
163 'd.note_public' =>
'NotePublic',
164 'd.note_private' =>
'NotePrivate',
168 'd.rowid' => array(
'label' =>
'ID',
'checked' => 1,
'enabled' =>
getDolGlobalInt(
'MAIN_SHOW_TECHNICAL_ID'),
'position' => 1),
169 'd.ref' => array(
'label' =>
"Ref",
'checked' => 1),
170 'd.civility' => array(
'label' =>
"Civility",
'checked' => 0),
171 'd.lastname' => array(
'label' =>
"Lastname",
'checked' => 1),
172 'd.firstname' => array(
'label' =>
"Firstname",
'checked' => 1),
173 'd.gender' => array(
'label' =>
"Gender",
'checked' => 0),
174 'd.company' => array(
'label' =>
"Company",
'checked' => 1,
'position' => 70),
175 'd.login' => array(
'label' =>
"Login",
'checked' => 1),
176 'd.morphy' => array(
'label' =>
"MemberNature",
'checked' => 1),
177 't.libelle' => array(
'label' =>
"MemberType",
'checked' => 1,
'position' => 55),
178 'd.address' => array(
'label' =>
"Address",
'checked' => 0),
179 'd.zip' => array(
'label' =>
"Zip",
'checked' => 0),
180 'd.town' => array(
'label' =>
"Town",
'checked' => 0),
181 'd.phone' => array(
'label' =>
"Phone",
'checked' => 0),
182 'd.phone_perso' => array(
'label' =>
"PhonePerso",
'checked' => 0),
183 'd.phone_mobile' => array(
'label' =>
"PhoneMobile",
'checked' => 0),
184 'd.email' => array(
'label' =>
"Email",
'checked' => 1),
185 'state.nom' => array(
'label' =>
"State",
'checked' => 0,
'position' => 90),
186 'country.code_iso' => array(
'label' =>
"Country",
'checked' => 0,
'position' => 95),
189 'd.datefin' => array(
'label' =>
"EndSubscription"),
190 'd.datec' => array(
'label' =>
"DateCreation"),
191 'd.birth' => array(
'label' =>
"Birthday"),
192 'd.tms' => array(
'label' =>
"DateModificationShort"),
193 'd.statut' => array(
'label' =>
"Status"),
194 'd.import_key' => array(
'label' =>
"ImportId"),
201 if (!empty($val[
'visible'])) {
203 if (in_array($key, array(
'fk_adherent_type',
'state_id',
'country'))) {
206 $visible = (int)
dol_eval((
string) $val[
'visible'], 1);
207 $arrayfields[$tableprefix.
'.'.$key] = array(
208 'label' => $val[
'label'],
209 'checked' => (($visible < 0) ? 0 : 1),
210 'enabled' => (
int) (abs($visible) != 3 && (bool)
dol_eval($val[
'enabled'], 1)),
211 'position' => (
int) $val[
'position'],
212 'help' => isset($val[
'help']) ? $val[
'help'] :
''
218include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
224'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields';
233if (
GETPOST(
'cancel',
'alpha')) {
237if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
241$permissiontoread = $user->hasRight(
'adherent',
'lire');
242$permissiontodelete = $user->hasRight(
'adherent',
'supprimer');
243$permissiontoadd = $user->hasRight(
'adherent',
'creer');
244$uploaddir =
$conf->member->dir_output;
247$parameters = array(
'socid' => isset($socid) ? $socid : null,
'arrayfields' => &$arrayfields);
248$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
253if (empty($reshook)) {
255 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
258 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
265 $search_lastname =
"";
266 $search_firstname =
"";
268 $search_civility =
"";
270 $search_company =
"";
273 $search_address =
"";
277 $search_country =
'';
279 $search_phone_perso =
'';
280 $search_phone_mobile =
'';
285 $search_import_key =
'';
288 $search_datec_start =
'';
289 $search_datec_end =
'';
290 $search_datem_start =
'';
291 $search_datem_end =
'';
292 $search_array_options = array();
296 if ($massaction ==
'close' && $user->hasRight(
'adherent',
'creer')) {
302 foreach ($toselect as $idtoclose) {
303 $tmpmember->fetch($idtoclose);
304 $result = $tmpmember->resiliate($user);
306 if ($result < 0 && !count($tmpmember->errors)) {
325 if ($massaction ==
'createexternaluser' && $user->hasRight(
'adherent',
'creer') && $user->hasRight(
'user',
'user',
'creer')) {
331 foreach ($toselect as $idtoclose) {
332 $tmpmember->fetch($idtoclose);
334 if (!empty($tmpmember->socid)) {
335 $nuser =
new User($db);
338 $result = $nuser->create_from_member($tmpuser, $tmpmember->login);
340 if ($result < 0 && !count($tmpmember->errors)) {
351 setEventMessages($langs->trans(
"XExternalUserCreated", $nbcreated),
null,
'mesgs');
360 if ($action ==
'createsubscription_confirm' && $confirm ==
"yes" && $user->hasRight(
'adherent',
'creer')) {
374 } elseif (
getDolGlobalInt(
'MEMBER_SUBSCRIPTION_SUGGEST_END_OF_YEAR')) {
378 foreach ($toselect as
$id) {
379 $res = $tmpmember->fetch(
$id);
381 $result = $tmpmember->subscription($now, $amount, 0,
'',
'',
'',
'',
'', $datesubend);
393 setEventMessages($langs->trans(
"XSubsriptionCreated", $nbcreated),
null,
'mesgs');
396 setEventMessages($langs->trans(
"XSubsriptionError", $error),
null,
'mesgs');
402 $objectclass =
'Adherent';
403 $objectlabel =
'Members';
404 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
412$form =
new Form($db);
420$title = $langs->trans(
"Members").
" - ".$langs->trans(
"List");
421$help_url =
'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder';
429$sql .=
" d.rowid, d.ref, d.login, d.lastname, d.firstname, d.gender, d.societe as company, d.fk_soc,";
430$sql .=
" d.civility, d.datefin, d.address, d.zip, d.town, d.state_id, d.country,";
431$sql .=
" d.email, d.phone, d.phone_perso, d.phone_mobile, d.birth, d.public, d.photo,";
432$sql .=
" d.fk_adherent_type as type_id, d.morphy, d.statut as status, d.datec as date_creation, d.tms as date_modification,";
433$sql .=
" d.note_private, d.note_public, d.import_key,";
435$sql .=
" ".$db->ifsql(
"d.societe IS NULL",
"s.nom",
"d.societe").
" as companyname,";
436$sql .=
" t.libelle as type, t.subscription,";
437$sql .=
" state.code_departement as state_code, state.nom as state_name";
440if (!empty($extrafields->attributes[
$object->table_element][
'label'])) {
441 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
442 $sql .= ($extrafields->attributes[
$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
"");
447$parameters = array();
448$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object, $action);
449$sql .= $hookmanager->resPrint;
450$sql = preg_replace(
'/,\s*$/',
'', $sql);
455$sql .=
" FROM ".MAIN_DB_PREFIX.
"adherent as d";
456if (!empty($extrafields->attributes[
$object->table_element][
'label']) && count($extrafields->attributes[
$object->table_element][
'label'])) {
457 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (d.rowid = ef.fk_object)";
459$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as country on (country.rowid = d.country)";
460$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_departements as state on (state.rowid = d.state_id)";
461$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s on (s.rowid = d.fk_soc)";
464$sql .=
", ".MAIN_DB_PREFIX.
"adherent_type as t";
465$sql .=
" WHERE d.fk_adherent_type = t.rowid";
467$searchCategoryContactList = $search_categ ? array($search_categ) : array();
468$searchCategoryContactOperator = 0;
470if (!empty($searchCategoryContactList)) {
471 $searchCategoryContactSqlList = array();
472 $listofcategoryid =
'';
473 foreach ($searchCategoryContactList as $searchCategoryContact) {
474 if (intval($searchCategoryContact) == -2) {
475 $searchCategoryContactSqlList[] =
"NOT EXISTS (SELECT ck.fk_categorie FROM ".MAIN_DB_PREFIX.
"categorie_member as ck WHERE d.rowid = ck.fk_member)";
476 } elseif (intval($searchCategoryContact) > 0) {
477 if ($searchCategoryContactOperator == 0) {
478 $searchCategoryContactSqlList[] =
" EXISTS (SELECT ck.fk_categorie FROM ".MAIN_DB_PREFIX.
"categorie_member as ck WHERE d.rowid = ck.fk_member AND ck.fk_categorie = ".((int) $searchCategoryContact).
")";
480 $listofcategoryid .= ($listofcategoryid ?
', ' :
'') .((
int) $searchCategoryContact);
484 if ($listofcategoryid) {
485 $searchCategoryContactSqlList[] =
" EXISTS (SELECT ck.fk_categorie FROM ".MAIN_DB_PREFIX.
"categorie_member as ck WHERE d.rowid = ck.fk_member AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid).
"))";
487 if ($searchCategoryContactOperator == 1) {
488 if (!empty($searchCategoryContactSqlList)) {
489 $sql .=
" AND (".implode(
' OR ', $searchCategoryContactSqlList).
")";
492 if (!empty($searchCategoryContactSqlList)) {
493 $sql .=
" AND (".implode(
' AND ', $searchCategoryContactSqlList).
")";
498$sql .=
" AND d.entity IN (".getEntity(
'adherent').
")";
500 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
502if ($search_type > 0) {
503 $sql .=
" AND t.rowid=".((int) $search_type);
505if ($search_filter ==
'withoutsubscription') {
506 $sql .=
" AND (datefin IS NULL)";
508if ($search_filter ==
'waitingsubscription') {
509 $sql .=
" AND (datefin IS NULL AND t.subscription = '1')";
511if ($search_filter ==
'uptodate') {
514 $sql .=
" AND (datefin >= '".$db->idate($now).
"' OR (datefin IS NULL AND t.subscription = '0'))";
516if ($search_filter ==
'outofdate') {
517 $sql .=
" AND (datefin < '".$db->idate($now).
"')";
519if ($search_status !=
'') {
521 $sql .=
" AND d.statut in (".$db->sanitize($db->escape($search_status)).
")";
523if ($search_morphy !=
'' && $search_morphy !=
'-1') {
532if ($search_civility) {
535if ($search_firstname) {
538if ($search_lastname) {
541if ($search_gender !=
'' && $search_gender !=
'-1') {
547if ($search_company) {
548 $sql .=
natural_search(array(
"s.nom",
"d.societe"), $search_company);
553if ($search_address) {
568if ($search_phone_perso) {
571if ($search_phone_mobile) {
574if ($search_country) {
575 $sql .=
" AND d.country IN (".$db->sanitize($search_country).
')';
577if ($search_import_key) {
580if ($search_datec_start) {
581 $sql .=
" AND d.datec >= '".$db->idate($search_datec_start).
"'";
583if ($search_datec_end) {
584 $sql .=
" AND d.datec <= '".$db->idate($search_datec_end).
"'";
586if ($search_datem_start) {
587 $sql .=
" AND d.tms >= '".$db->idate($search_datem_start).
"'";
589if ($search_datem_end) {
590 $sql .=
" AND d.tms <= '".$db->idate($search_datem_end).
"'";
593include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
595$parameters = array();
596$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
597$sql .= $hookmanager->resPrint;
600$nbtotalofrecords =
'';
603 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
604 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
605 $resql = $db->query($sqlforcount);
607 $objforcount = $db->fetch_object($resql);
608 $nbtotalofrecords = $objforcount->nbtotalofrecords;
613 if (($page * $limit) > $nbtotalofrecords) {
622$sql .= $db->order($sortfield, $sortorder);
624 $sql .= $db->plimit($limit + 1, $offset);
627$resql = $db->query($sql);
633$num = $db->num_rows($resql);
637if ($num == 1 &&
getDolGlobalInt(
'MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
638 $obj = $db->fetch_object($resql);
640 header(
"Location: ".DOL_URL_ROOT.
'/adherents/card.php?id='.
$id);
647llxHeader(
'', $title, $help_url,
'', 0, 0, $morejs, $morecss,
'',
'mod-member page-list bodyforlist');
649$arrayofselected = is_array($toselect) ? $toselect : array();
652if ($search_type > 0) {
654 $result = $membertype->fetch($search_type);
655 $title .=
" (".$membertype->label.
")";
661 $param .=
'&mode='.urlencode($mode);
663if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
664 $param .=
'&contextpage='.urlencode($contextpage);
666if ($limit > 0 && $limit !=
$conf->liste_limit) {
667 $param .=
'&limit='.((int) $limit);
669if ($optioncss !=
'') {
670 $param .=
'&optioncss='.urlencode($optioncss);
673 $param .=
'&groupby='.urlencode($groupby);
675if ($search_all !=
"") {
676 $param .=
"&search_all=".urlencode($search_all);
679 $param .=
"&search_ref=".urlencode($search_ref);
681if ($search_civility) {
682 $param .=
"&search_civility=".urlencode($search_civility);
684if ($search_firstname) {
685 $param .=
"&search_firstname=".urlencode($search_firstname);
687if ($search_lastname) {
688 $param .=
"&search_lastname=".urlencode($search_lastname);
691 $param .=
"&search_gender=".urlencode($search_gender);
694 $param .=
"&search_login=".urlencode($search_login);
697 $param .=
"&search_email=".urlencode($search_email);
699if ($search_categ > 0 || $search_categ == -2) {
700 $param .=
"&search_categ=".urlencode((
string) ($search_categ));
702if ($search_company) {
703 $param .=
"&search_company=".urlencode($search_company);
705if ($search_address !=
'') {
706 $param .=
"&search_address=".urlencode($search_address);
708if ($search_town !=
'') {
709 $param .=
"&search_town=".urlencode($search_town);
711if ($search_zip !=
'') {
712 $param .=
"&search_zip=".urlencode($search_zip);
714if ($search_state !=
'') {
715 $param .=
"&search_state=".urlencode($search_state);
717if ($search_country !=
'') {
718 $param .=
"&search_country=".urlencode($search_country);
720if ($search_phone !=
'') {
721 $param .=
"&search_phone=".urlencode($search_phone);
723if ($search_phone_perso !=
'') {
724 $param .=
"&search_phone_perso=".urlencode($search_phone_perso);
726if ($search_phone_mobile !=
'') {
727 $param .=
"&search_phone_mobile=".urlencode($search_phone_mobile);
729if ($search_filter && $search_filter !=
'-1') {
730 $param .=
"&search_filter=".urlencode($search_filter);
732if ($search_status !=
"" && $search_status != -3) {
733 $param .=
"&search_status=".urlencode($search_status);
735if ($search_import_key !=
'') {
736 $param .=
'&search_import_key='.urlencode($search_import_key);
738if ($search_type > 0) {
739 $param .=
"&search_type=".urlencode($search_type);
741if ($search_datec_start) {
742 $param .=
'&search_datec_start_day='.dol_print_date($search_datec_start,
'%d').
'&search_datec_start_month='.
dol_print_date($search_datec_start,
'%m').
'&search_datec_start_year='.
dol_print_date($search_datec_start,
'%Y');
744if ($search_datem_end) {
745 $param .=
'&search_datem_end_day='.dol_print_date($search_datem_end,
'%d').
'&search_datem_end_month='.
dol_print_date($search_datem_end,
'%m').
'&search_datem_end_year='.
dol_print_date($search_datem_end,
'%Y');
749include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
752$arrayofmassactions = array(
756if ($user->hasRight(
'adherent',
'creer')) {
757 $arrayofmassactions[
'close'] =
img_picto(
'',
'close_title',
'class="pictofixedwidth"').$langs->trans(
"Resiliate");
759if ($user->hasRight(
'adherent',
'supprimer')) {
760 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
762if (isModEnabled(
'category') && $user->hasRight(
'adherent',
'creer')) {
763 $arrayofmassactions[
'preaffecttag'] =
img_picto(
'',
'category',
'class="pictofixedwidth"').$langs->trans(
"AffectTag");
765if ($user->hasRight(
'adherent',
'creer') && $user->hasRight(
'user',
'user',
'creer')) {
766 $arrayofmassactions[
'createexternaluser'] =
img_picto(
'',
'user',
'class="pictofixedwidth"').$langs->trans(
"CreateExternalUser");
768if ($user->hasRight(
'adherent',
'creer')) {
769 $arrayofmassactions[
'createsubscription'] =
img_picto(
'',
'payment',
'class="pictofixedwidth"').$langs->trans(
"CreateSubscription");
771if (
GETPOSTINT(
'nomassaction') || in_array($massaction, array(
'presend',
'predelete',
'preaffecttag'))) {
772 $arrayofmassactions = array();
774$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
776print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
777if ($optioncss !=
'') {
778 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
780print
'<input type="hidden" name="token" value="'.newToken().
'">';
781print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
782print
'<input type="hidden" name="action" value="list">';
783print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
784print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
785print
'<input type="hidden" name="page" value="'.$page.
'">';
786print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
787print
'<input type="hidden" name="page_y" value="">';
788print
'<input type="hidden" name="mode" value="'.$mode.
'">';
792$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'));
793$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'));
795$newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewMember'),
'',
'fa fa-plus-circle', DOL_URL_ROOT.
'/adherents/card.php?action=create',
'', $user->hasRight(
'adherent',
'creer'));
797print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
$object->picto, 0, $newcardbutton,
'', $limit, 0, 0, 1);
800$topicmail =
"Information";
801$modelmail =
"member";
803$trackid =
'mem'.$object->id;
804if ($massaction ==
'createsubscription') {
808 foreach ($toselect as
$id) {
810 $tmpmember->fetch(
$id);
811 $res = $adht->fetch($tmpmember->typeid);
813 $amounttmp = $adht->amount;
814 if (!empty($tmpmember->last_subscription_amount) && !GETPOSTISSET(
'newamount') && is_numeric($amounttmp)) {
815 $amounttmp = max($tmpmember->last_subscription_amount, $amount);
817 $amount = max(0, $amounttmp, $amount);
824 $formquestion = array(
825 array(
'label' => $langs->trans(
"DateSubscription"),
'type' =>
'other',
'value' => $date),
826 array(
'label' => $langs->trans(
"Amount"),
'type' =>
'text',
'value' =>
price($amount, 0,
'', 0),
'name' =>
'amount'),
827 array(
'type' =>
'separator'),
828 array(
'label' => $langs->trans(
"MoreActions"),
'type' =>
'other',
'value' => $langs->trans(
"None").
' '.
img_warning($langs->trans(
"WarningNoComplementaryActionDone"))),
830 print $form->formconfirm($_SERVER[
"PHP_SELF"], $langs->trans(
"ConfirmMassSubsriptionCreation"), $langs->trans(
"ConfirmMassSubsriptionCreationQuestion", count($toselect)),
"createsubscription_confirm", $formquestion,
'', 0, 200, 500, 1);
832include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
836 foreach ($fieldstosearchall as $key => $val) {
837 $fieldstosearchall[$key] = $langs->trans($val);
838 $setupstring .= $key.
"=".$val.
";";
840 print
'<!-- Search done like if MYOBJECT_QUICKSEARCH_ON_FIELDS = '.$setupstring.
' -->'.
"\n";
841 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).implode(
', ', $fieldstosearchall).
'</div>'.
"\n";
844$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
845$htmlofselectarray = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));
846$selectedfields = ($mode !=
'kanban' ? $htmlofselectarray :
'');
847$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
851if (isModEnabled(
'category') && $user->hasRight(
'categorie',
'lire')) {
852 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
853 $moreforfilter .=
'<div class="divsearchfield">';
854 $moreforfilter .=
img_picto($langs->trans(
'Categories'),
'category',
'class="pictofixedwidth"').$formother->select_categories(Categorie::TYPE_MEMBER, $search_categ,
'search_categ', 1, $langs->trans(
"MembersCategoriesShort"));
855 $moreforfilter .=
'</div>';
858 'arrayfields' => &$arrayfields,
860$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
861if (empty($reshook)) {
862 $moreforfilter .= $hookmanager->resPrint;
864 $moreforfilter = $hookmanager->resPrint;
866if (!empty($moreforfilter)) {
867 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
868 print $moreforfilter;
872print
'<div class="div-table-responsive">';
873print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
877print
'<tr class="liste_titre_filter">';
881 print
'<td class="liste_titre center maxwidthsearch">';
882 $searchpicto = $form->showFilterButtons(
'left');
888if (!empty($arrayfields[
'd.rowid'][
'checked'])) {
889 print
'<td class="liste_titre">';
890 print
'<input class="flat" size="6" type="text" name="search_id" value="'.dol_escape_htmltag($search_id).
'">';
895if (!empty($arrayfields[
'd.ref'][
'checked'])) {
896 print
'<td class="liste_titre">';
897 print
'<input type="text" class="flat maxwidth75imp" name="search_ref" value="'.dol_escape_htmltag($search_ref).
'">';
902if (!empty($arrayfields[
'd.civility'][
'checked'])) {
903 print
'<td class="liste_titre left">';
904 print
'<input class="flat maxwidth50imp" type="text" name="search_civility" value="'.dol_escape_htmltag($search_civility).
'"></td>';
908if (!empty($arrayfields[
'd.firstname'][
'checked'])) {
909 print
'<td class="liste_titre left">';
910 print
'<input class="flat maxwidth75imp" type="text" name="search_firstname" value="'.dol_escape_htmltag($search_firstname).
'"></td>';
914if (!empty($arrayfields[
'd.lastname'][
'checked'])) {
915 print
'<td class="liste_titre left">';
916 print
'<input class="flat maxwidth75imp" type="text" name="search_lastname" value="'.dol_escape_htmltag($search_lastname).
'"></td>';
920if (!empty($arrayfields[
'd.gender'][
'checked'])) {
921 print
'<td class="liste_titre">';
922 $arraygender = array(
'man' => $langs->trans(
"Genderman"),
'woman' => $langs->trans(
"Genderwoman"),
'other' => $langs->trans(
"Genderother"));
923 print $form->selectarray(
'search_gender', $arraygender, $search_gender, 1);
928if (!empty($arrayfields[
'd.company'][
'checked'])) {
929 print
'<td class="liste_titre left">';
930 print
'<input class="flat maxwidth75imp" type="text" name="search_company" value="'.dol_escape_htmltag($search_company).
'"></td>';
934if (!empty($arrayfields[
'd.login'][
'checked'])) {
935 print
'<td class="liste_titre left">';
936 print
'<input class="flat maxwidth75imp" type="text" name="search_login" value="'.dol_escape_htmltag($search_login).
'"></td>';
940if (!empty($arrayfields[
'd.morphy'][
'checked'])) {
941 print
'<td class="liste_titre center">';
942 $arraymorphy = array(
'mor' => $langs->trans(
"Moral"),
'phy' => $langs->trans(
"Physical"));
943 print $form->selectarray(
'search_morphy', $arraymorphy, $search_morphy, 1, 0, 0,
'', 0, 0, 0,
'',
'maxwidth100');
948if (!empty($arrayfields[
't.libelle'][
'checked'])) {
951if (!empty($arrayfields[
't.libelle'][
'checked'])) {
952 print
'<td class="liste_titre">';
953 $listetype = $membertypestatic->liste_array();
955 print $form->selectarray(
"search_type", $listetype, $search_type, 1, 0, 0,
'', 0, 32);
960if (!empty($arrayfields[
'd.address'][
'checked'])) {
961 print
'<td class="liste_titre left">';
962 print
'<input class="flat maxwidth75imp" type="text" name="search_address" value="'.dol_escape_htmltag($search_address).
'"></td>';
966if (!empty($arrayfields[
'd.zip'][
'checked'])) {
967 print
'<td class="liste_titre left">';
968 print
'<input class="flat maxwidth50imp" type="text" name="search_zip" value="'.dol_escape_htmltag($search_zip).
'"></td>';
972if (!empty($arrayfields[
'd.town'][
'checked'])) {
973 print
'<td class="liste_titre left">';
974 print
'<input class="flat maxwidth75imp" type="text" name="search_town" value="'.dol_escape_htmltag($search_town).
'"></td>';
978if (!empty($arrayfields[
'state.nom'][
'checked'])) {
979 print
'<td class="liste_titre">';
980 print
'<input class="flat searchstring maxwidth75imp" type="text" name="search_state" value="'.dol_escape_htmltag($search_state).
'">';
985if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
986 print
'<td class="liste_titre center">';
987 print $form->select_country($search_country,
'search_country',
'', 0,
'minwidth100imp maxwidth100');
992if (!empty($arrayfields[
'd.phone'][
'checked'])) {
993 print
'<td class="liste_titre left">';
994 print
'<input class="flat maxwidth75imp" type="text" name="search_phone" value="'.dol_escape_htmltag($search_phone).
'"></td>';
998if (!empty($arrayfields[
'd.phone_perso'][
'checked'])) {
999 print
'<td class="liste_titre left">';
1000 print
'<input class="flat maxwidth75imp" type="text" name="search_phone_perso" value="'.dol_escape_htmltag($search_phone_perso).
'"></td>';
1004if (!empty($arrayfields[
'd.phone_mobile'][
'checked'])) {
1005 print
'<td class="liste_titre left">';
1006 print
'<input class="flat maxwidth75imp" type="text" name="search_phone_mobile" value="'.dol_escape_htmltag($search_phone_mobile).
'"></td>';
1010if (!empty($arrayfields[
'd.email'][
'checked'])) {
1011 print
'<td class="liste_titre left">';
1012 print
'<input class="flat maxwidth75imp" type="text" name="search_email" value="'.dol_escape_htmltag($search_email).
'"></td>';
1016if (!empty($arrayfields[
'd.datefin'][
'checked'])) {
1017 print
'<td class="liste_titre center">';
1019 $selectarray = array(
'-1' =>
'',
'waitingsubscription' => $langs->trans(
"WaitingSubscription"),
'uptodate' => $langs->trans(
"UpToDate"),
'outofdate' => $langs->trans(
"OutOfDate"));
1020 print $form->selectarray(
'search_filter', $selectarray, $search_filter);
1025include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
1028$parameters = array(
'arrayfields' => $arrayfields);
1029$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters);
1030print $hookmanager->resPrint;
1033if (!empty($arrayfields[
'd.datec'][
'checked'])) {
1034 print
'<td class="liste_titre">';
1035 print
'<div class="nowrapfordate">';
1036 print $form->selectDate($search_datec_start ? $search_datec_start : -1,
'search_datec_start_', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1038 print
'<div class="nowrapfordate">';
1039 print $form->selectDate($search_datec_end ? $search_datec_end : -1,
'search_datec_end_', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
1045if (!empty($arrayfields[
'd.birth'][
'checked'])) {
1046 print
'<td class="liste_titre">';
1051if (!empty($arrayfields[
'd.tms'][
'checked'])) {
1052 print
'<td class="liste_titre">';
1053 print
'<div class="nowrapfordate">';
1054 print $form->selectDate($search_datem_start ? $search_datem_start : -1,
'search_datem_start_', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1056 print
'<div class="nowrapfordate">';
1057 print $form->selectDate($search_datem_end ? $search_datem_end : -1,
'search_datem_end_', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
1063if (!empty($arrayfields[
'd.import_key'][
'checked'])) {
1064 print
'<td class="liste_titre center">';
1065 print
'<input class="flat searchstring maxwidth50" type="text" name="search_import_key" value="'.dol_escape_htmltag($search_import_key).
'">';
1070if (!empty($arrayfields[
'd.statut'][
'checked'])) {
1071 print
'<td class="liste_titre center parentonrightofpage">';
1072 $liststatus = array(
1079 print $form->selectarray(
'search_status', $liststatus, $search_status, -3, 0, 0,
'', 0, 0, 0,
'',
'search_status width100 onrightofpage');
1085 print
'<td class="liste_titre center maxwidthsearch">';
1086 $searchpicto = $form->showFilterButtons();
1092$totalarray = array();
1093$totalarray[
'nbfield'] = 0;
1097print
'<tr class="liste_titre">';
1100 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch actioncolumn ');
1101 $totalarray[
'nbfield']++;
1103if (!empty($arrayfields[
'd.rowid'][
'checked'])) {
1105 print_liste_field_titre($arrayfields[
'd.rowid'][
'label'], $_SERVER[
"PHP_SELF"],
'd.rowid',
'', $param,
'', $sortfield, $sortorder,
'center ');
1106 $totalarray[
'nbfield']++;
1108if (!empty($arrayfields[
'd.ref'][
'checked'])) {
1109 print_liste_field_titre($arrayfields[
'd.ref'][
'label'], $_SERVER[
"PHP_SELF"],
'd.ref',
'', $param,
'', $sortfield, $sortorder);
1110 $totalarray[
'nbfield']++;
1112if (!empty($arrayfields[
'd.civility'][
'checked'])) {
1113 print_liste_field_titre($arrayfields[
'd.civility'][
'label'], $_SERVER[
"PHP_SELF"],
'd.civility',
'', $param,
'', $sortfield, $sortorder);
1114 $totalarray[
'nbfield']++;
1116if (!empty($arrayfields[
'd.firstname'][
'checked'])) {
1117 print_liste_field_titre($arrayfields[
'd.firstname'][
'label'], $_SERVER[
"PHP_SELF"],
'd.firstname',
'', $param,
'', $sortfield, $sortorder);
1118 $totalarray[
'nbfield']++;
1120if (!empty($arrayfields[
'd.lastname'][
'checked'])) {
1121 print_liste_field_titre($arrayfields[
'd.lastname'][
'label'], $_SERVER[
"PHP_SELF"],
'd.lastname',
'', $param,
'', $sortfield, $sortorder);
1122 $totalarray[
'nbfield']++;
1124if (!empty($arrayfields[
'd.gender'][
'checked'])) {
1125 print_liste_field_titre($arrayfields[
'd.gender'][
'label'], $_SERVER[
'PHP_SELF'],
'd.gender', $param,
"",
"", $sortfield, $sortorder);
1126 $totalarray[
'nbfield']++;
1128if (!empty($arrayfields[
'd.company'][
'checked'])) {
1129 print_liste_field_titre($arrayfields[
'd.company'][
'label'], $_SERVER[
"PHP_SELF"],
'companyname',
'', $param,
'', $sortfield, $sortorder);
1130 $totalarray[
'nbfield']++;
1132if (!empty($arrayfields[
'd.login'][
'checked'])) {
1133 print_liste_field_titre($arrayfields[
'd.login'][
'label'], $_SERVER[
"PHP_SELF"],
'd.login',
'', $param,
'', $sortfield, $sortorder);
1134 $totalarray[
'nbfield']++;
1136if (!empty($arrayfields[
'd.morphy'][
'checked'])) {
1137 print_liste_field_titre($arrayfields[
'd.morphy'][
'label'], $_SERVER[
"PHP_SELF"],
'd.morphy',
'', $param,
'', $sortfield, $sortorder);
1138 $totalarray[
'nbfield']++;
1140if (!empty($arrayfields[
't.libelle'][
'checked'])) {
1141 print_liste_field_titre($arrayfields[
't.libelle'][
'label'], $_SERVER[
"PHP_SELF"],
't.libelle',
'', $param,
'', $sortfield, $sortorder);
1142 $totalarray[
'nbfield']++;
1144if (!empty($arrayfields[
'd.address'][
'checked'])) {
1145 print_liste_field_titre($arrayfields[
'd.address'][
'label'], $_SERVER[
"PHP_SELF"],
'd.address',
'', $param,
'', $sortfield, $sortorder);
1146 $totalarray[
'nbfield']++;
1148if (!empty($arrayfields[
'd.zip'][
'checked'])) {
1149 print_liste_field_titre($arrayfields[
'd.zip'][
'label'], $_SERVER[
"PHP_SELF"],
'd.zip',
'', $param,
'', $sortfield, $sortorder);
1150 $totalarray[
'nbfield']++;
1152if (!empty($arrayfields[
'd.town'][
'checked'])) {
1153 print_liste_field_titre($arrayfields[
'd.town'][
'label'], $_SERVER[
"PHP_SELF"],
'd.town',
'', $param,
'', $sortfield, $sortorder);
1154 $totalarray[
'nbfield']++;
1156if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1157 print_liste_field_titre($arrayfields[
'state.nom'][
'label'], $_SERVER[
"PHP_SELF"],
"state.nom",
"", $param,
'', $sortfield, $sortorder);
1158 $totalarray[
'nbfield']++;
1160if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1161 print_liste_field_titre($arrayfields[
'country.code_iso'][
'label'], $_SERVER[
"PHP_SELF"],
"country.code_iso",
"", $param,
'', $sortfield, $sortorder,
'center ');
1162 $totalarray[
'nbfield']++;
1164if (!empty($arrayfields[
'd.phone'][
'checked'])) {
1165 print_liste_field_titre($arrayfields[
'd.phone'][
'label'], $_SERVER[
"PHP_SELF"],
'd.phone',
'', $param,
'', $sortfield, $sortorder);
1166 $totalarray[
'nbfield']++;
1168if (!empty($arrayfields[
'd.phone_perso'][
'checked'])) {
1169 print_liste_field_titre($arrayfields[
'd.phone_perso'][
'label'], $_SERVER[
"PHP_SELF"],
'd.phone_perso',
'', $param,
'', $sortfield, $sortorder);
1170 $totalarray[
'nbfield']++;
1172if (!empty($arrayfields[
'd.phone_mobile'][
'checked'])) {
1173 print_liste_field_titre($arrayfields[
'd.phone_mobile'][
'label'], $_SERVER[
"PHP_SELF"],
'd.phone_mobile',
'', $param,
'', $sortfield, $sortorder);
1174 $totalarray[
'nbfield']++;
1176if (!empty($arrayfields[
'd.email'][
'checked'])) {
1177 print_liste_field_titre($arrayfields[
'd.email'][
'label'], $_SERVER[
"PHP_SELF"],
'd.email',
'', $param,
'', $sortfield, $sortorder);
1178 $totalarray[
'nbfield']++;
1180if (!empty($arrayfields[
'd.datefin'][
'checked'])) {
1181 print_liste_field_titre($arrayfields[
'd.datefin'][
'label'], $_SERVER[
"PHP_SELF"],
'd.datefin,t.subscription',
'', $param,
'', $sortfield, $sortorder,
'center ');
1182 $totalarray[
'nbfield']++;
1185include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
1188$parameters = array(
'arrayfields' => $arrayfields,
'totalarray' => &$totalarray,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder);
1189$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters);
1190print $hookmanager->resPrint;
1192if (!empty($arrayfields[
'd.datec'][
'checked'])) {
1193 print_liste_field_titre($arrayfields[
'd.datec'][
'label'], $_SERVER[
"PHP_SELF"],
"d.datec",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1194 $totalarray[
'nbfield']++;
1196if (!empty($arrayfields[
'd.birth'][
'checked'])) {
1197 print_liste_field_titre($arrayfields[
'd.birth'][
'label'], $_SERVER[
"PHP_SELF"],
"d.birth",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1198 $totalarray[
'nbfield']++;
1200if (!empty($arrayfields[
'd.tms'][
'checked'])) {
1201 print_liste_field_titre($arrayfields[
'd.tms'][
'label'], $_SERVER[
"PHP_SELF"],
"d.tms",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1202 $totalarray[
'nbfield']++;
1204if (!empty($arrayfields[
'd.import_key'][
'checked'])) {
1205 print_liste_field_titre($arrayfields[
'd.import_key'][
'label'], $_SERVER[
"PHP_SELF"],
"d.import_key",
"", $param,
'', $sortfield, $sortorder,
'center ');
1206 $totalarray[
'nbfield']++;
1208if (!empty($arrayfields[
'd.statut'][
'checked'])) {
1209 print_liste_field_titre($arrayfields[
'd.statut'][
'label'], $_SERVER[
"PHP_SELF"],
"d.statut,t.subscription,d.datefin",
"", $param,
'', $sortfield, $sortorder,
'center ');
1210 $totalarray[
'nbfield']++;
1213 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'maxwidthsearch center ');
1214 $totalarray[
'nbfield']++;
1221$savnbfield = $totalarray[
'nbfield'];
1222$totalarray = array();
1223$totalarray[
'nbfield'] = 0;
1224$imaxinloop = ($limit ? min($num, $limit) : $num);
1225while ($i < $imaxinloop) {
1226 $obj = $db->fetch_object($resql);
1231 $datefin = $db->jdate($obj->datefin);
1233 $memberstatic->id = $obj->rowid;
1234 $memberstatic->ref = $obj->ref;
1235 $memberstatic->civility_code = $obj->civility;
1236 $memberstatic->login = $obj->login;
1237 $memberstatic->lastname = $obj->lastname;
1238 $memberstatic->firstname = $obj->firstname;
1239 $memberstatic->gender = $obj->gender;
1240 $memberstatic->status = $obj->status;
1241 $memberstatic->datefin = $datefin;
1242 $memberstatic->socid = $obj->fk_soc;
1243 $memberstatic->photo = $obj->photo;
1244 $memberstatic->email = $obj->email;
1245 $memberstatic->morphy = $obj->morphy;
1246 $memberstatic->note_public = $obj->note_public;
1247 $memberstatic->note_private = $obj->note_private;
1248 $memberstatic->need_subscription = $obj->subscription;
1250 if (!empty($obj->fk_soc)) {
1251 $memberstatic->fetch_thirdparty();
1252 if ($memberstatic->thirdparty->id > 0) {
1253 $companyname = $memberstatic->thirdparty->name;
1254 $companynametoshow = $memberstatic->thirdparty->getNomUrl(1);
1256 $companyname =
null;
1257 $companynametoshow =
null;
1260 $companyname = $obj->company;
1261 $companynametoshow = $obj->company;
1263 $memberstatic->company = (string) $companyname;
1267 if ($mode ==
'kanban') {
1269 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
1270 print
'<div class="box-flex-container kanban">';
1272 $membertypestatic->id = $obj->type_id;
1273 $membertypestatic->label = $obj->type;
1275 $memberstatic->type = $membertypestatic->label;
1276 $memberstatic->photo = $obj->photo;
1279 print $memberstatic->getKanbanView(
'', array(
'selected' => in_array(
$object->id, $arrayofselected)));
1280 if ($i == (min($num, $limit) - 1)) {
1287 print
'<tr data-rowid="'.$object->id.
'" class="oddeven">';
1291 print
'<td class="nowrap center">';
1292 if ($massactionbutton || $massaction) {
1294 if (in_array($obj->rowid, $arrayofselected)) {
1297 print
'<input id="cb'.$obj->rowid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1301 $totalarray[
'nbfield']++;
1305 if (!empty($arrayfields[
'd.rowid'][
'checked'])) {
1306 print
'<td class="center" data-key="id">'.$obj->rowid.
'</td>';
1308 $totalarray[
'nbfield']++;
1312 if (!empty($arrayfields[
'd.ref'][
'checked'])) {
1314 print $memberstatic->getNomUrl(-1, 0,
'card',
'ref',
'', -1, 0, 1);
1317 $totalarray[
'nbfield']++;
1321 if (!empty($arrayfields[
'd.civility'][
'checked'])) {
1326 $totalarray[
'nbfield']++;
1330 if (!empty($arrayfields[
'd.firstname'][
'checked'])) {
1331 print
'<td class="tdoverflowmax125" title="'.dol_escape_htmltag($obj->firstname).
'">';
1332 print $memberstatic->getNomUrl(0, 0,
'card',
'firstname');
1336 $totalarray[
'nbfield']++;
1340 if (!empty($arrayfields[
'd.lastname'][
'checked'])) {
1341 print
'<td class="tdoverflowmax125" title="'.dol_escape_htmltag($obj->lastname).
'">';
1342 print $memberstatic->getNomUrl(0, 0,
'card',
'lastname');
1346 $totalarray[
'nbfield']++;
1350 if (!empty($arrayfields[
'd.gender'][
'checked'])) {
1353 print $langs->trans(
"Gender".$obj->gender);
1357 $totalarray[
'nbfield']++;
1361 if (!empty($arrayfields[
'd.company'][
'checked'])) {
1362 print
'<td class="tdoverflowmax150" title="'.dol_escape_htmltag($companyname).
'">';
1363 print $companynametoshow;
1367 if (!empty($arrayfields[
'd.login'][
'checked'])) {
1368 print
'<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->login).
'">'.$obj->login.
"</td>\n";
1370 $totalarray[
'nbfield']++;
1374 if (!empty($arrayfields[
'd.morphy'][
'checked'])) {
1375 print
'<td class="center">';
1376 print $memberstatic->getmorphylib(
'', 2);
1379 $totalarray[
'nbfield']++;
1383 if (!empty($arrayfields[
't.libelle'][
'checked'])) {
1384 $membertypestatic->id = $obj->type_id;
1385 $membertypestatic->label = $obj->type;
1386 print
'<td class="nowraponall">';
1387 print $membertypestatic->getNomUrl(1, 32);
1390 $totalarray[
'nbfield']++;
1394 if (!empty($arrayfields[
'd.address'][
'checked'])) {
1395 print
'<td class="nocellnopadd tdoverflowmax200" title="'.dol_escape_htmltag($obj->address).
'">';
1399 $totalarray[
'nbfield']++;
1403 if (!empty($arrayfields[
'd.zip'][
'checked'])) {
1404 print
'<td class="nocellnopadd">';
1408 $totalarray[
'nbfield']++;
1412 if (!empty($arrayfields[
'd.town'][
'checked'])) {
1413 print
'<td class="nocellnopadd">';
1417 $totalarray[
'nbfield']++;
1421 if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1426 $totalarray[
'nbfield']++;
1430 if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1431 $tmparray =
getCountry($obj->country,
'all');
1432 print
'<td class="center tdoverflowmax100" title="'.dol_escape_htmltag($tmparray[
'label']).
'">';
1436 $totalarray[
'nbfield']++;
1440 if (!empty($arrayfields[
'd.phone'][
'checked'])) {
1441 print
'<td class="nocellnopadd">';
1445 $totalarray[
'nbfield']++;
1449 if (!empty($arrayfields[
'd.phone_perso'][
'checked'])) {
1450 print
'<td class="nocellnopadd">';
1454 $totalarray[
'nbfield']++;
1458 if (!empty($arrayfields[
'd.phone_mobile'][
'checked'])) {
1459 print
'<td class="nocellnopadd">';
1463 $totalarray[
'nbfield']++;
1467 if (!empty($arrayfields[
'd.email'][
'checked'])) {
1468 print
'<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->email).
'">';
1472 $totalarray[
'nbfield']++;
1476 $datefin = $db->jdate($obj->datefin);
1477 if (!empty($arrayfields[
'd.datefin'][
'checked'])) {
1481 if ($memberstatic->hasDelay()) {
1482 $textlate =
' ('.$langs->trans(
"DateReference").
' > '.$langs->trans(
"DateToday").
' '.(ceil(
$conf->adherent->subscription->warning_delay / 60 / 60 / 24) >= 0 ?
'+' :
'').ceil(
$conf->adherent->subscription->warning_delay / 60 / 60 / 24).
' '.$langs->trans(
"days").
')';
1483 $s .=
" ".img_warning($langs->trans(
"SubscriptionLate").$textlate);
1486 if (!empty($obj->subscription)) {
1487 $s .=
'<span class="opacitymedium">'.$langs->trans(
"SubscriptionNotReceived").
'</span>';
1488 if ($obj->status > 0) {
1489 $s .=
" ".img_warning();
1492 $s .=
'<span class="opacitymedium">'.$langs->trans(
"SubscriptionNotNeeded").
'</span>';
1495 print
'<td class="nowraponall center tdoverflowmax150" title="'.dolPrintHTMLForAttribute(
dol_string_nohtmltag($s)).
'">';
1499 $totalarray[
'nbfield']++;
1503 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
1505 $parameters = array(
'arrayfields' => $arrayfields,
'obj' => $obj,
'i' => $i,
'totalarray' => &$totalarray);
1506 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters);
1507 print $hookmanager->resPrint;
1509 if (!empty($arrayfields[
'd.datec'][
'checked'])) {
1510 print
'<td class="nowrap center">';
1511 print
dol_print_date($db->jdate($obj->date_creation),
'dayhour',
'tzuser');
1514 $totalarray[
'nbfield']++;
1518 if (!empty($arrayfields[
'd.birth'][
'checked'])) {
1519 print
'<td class="nowrap center">';
1523 $totalarray[
'nbfield']++;
1527 if (!empty($arrayfields[
'd.tms'][
'checked'])) {
1528 print
'<td class="nowrap center">';
1529 print
dol_print_date($db->jdate($obj->date_modification),
'dayhour',
'tzuser');
1532 $totalarray[
'nbfield']++;
1536 if (!empty($arrayfields[
'd.import_key'][
'checked'])) {
1537 print
'<td class="tdoverflowmax100 center" title="'.dol_escape_htmltag($obj->import_key).
'">';
1541 $totalarray[
'nbfield']++;
1545 if (!empty($arrayfields[
'd.statut'][
'checked'])) {
1546 print
'<td class="nowrap center">';
1547 print $memberstatic->LibStatut($obj->status, $obj->subscription, $datefin, 5);
1550 $totalarray[
'nbfield']++;
1555 print
'<td class="center">';
1556 if ($massactionbutton || $massaction) {
1558 if (in_array($obj->rowid, $arrayofselected)) {
1561 print
'<input id="cb'.$obj->rowid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1565 $totalarray[
'nbfield']++;
1575include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
1581 foreach ($arrayfields as $key => $val) {
1582 if (!empty($val[
'checked'])) {
1586 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
1591$parameters = array(
'arrayfields' => $arrayfields,
'sql' => $sql);
1592$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
1593print $hookmanager->resPrint;
1595print
'</table>'.
"\n";
1598print
'</form>'.
"\n";
1600if (in_array(
'builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords ===
'' || $nbtotalofrecords)) {
1601 $hidegeneratedfilelistifempty = 1;
1602 if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
1603 $hidegeneratedfilelistifempty = 0;
1606 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
1610 $urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
1611 $urlsource .= str_replace(
'&',
'&', $param);
1613 $filedir = $diroutputmassaction;
1614 $genallowed = $permissiontoread;
1615 $delallowed = $permissiontoadd;
1617 print $formfile->showdocuments(
'massfilesarea_'.
$object->module,
'', $filedir, $urlsource, 0, $delallowed,
'', 1, 1, 0, 48, 1, $param, $title,
'',
'',
'',
null, $hidegeneratedfilelistifempty);
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Class to manage members of a foundation.
const STATUS_EXCLUDED
Excluded.
const STATUS_DRAFT
Draft status.
const STATUS_RESILIATED
Resiliated (membership end and was not renew)
const STATUS_VALIDATED
Validated status.
Class to manage members type.
Class to manage Dolibarr users.
getCountry($searchkey, $withcode='', $dbtouse=null, $outputlangs=null, $entconv=1, $searchlabel='')
Return country label, code or id from an id, code or label.
dol_get_last_day($year, $month=12, $gm=false)
Return GMT time for last day of a month or year.
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...
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
print_barre_liste($title, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $selectlimitsuffix=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_print_phone($phone, $countrycode='', $cid=0, $socid=0, $addlink='', $separ=" ", $withpicto='', $titlealt='', $adddivfloat=0, $morecss='paddingright')
Format phone numbers according to country.
dol_string_nohtmltag($stringtoclean, $removelinefeed=1, $pagecodeto='UTF-8', $strip_tags=0, $removedoublespaces=1)
Clean a string from all HTML tags and entities.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
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.
dol_eval($s, $returnvalue=1, $hideerrors=1, $onlysimplestring='1')
Replace eval function to add more security.
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...
price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code='')
Function to format a value into an amount for visual output Function used into PDF and HTML pages.
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).
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by the value of a given key, which produces ascending (default) or descending out...
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
dol_print_email($email, $cid=0, $socid=0, $addlink=0, $max=64, $showinvalid=1, $withpicto=0, $morecss='paddingrightonly')
Show EMail link formatted for HTML output.
dolGetButtonTitleSeparator($moreClass="")
Add space between dolGetButtonTitle.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_clone($object, $native=2)
Create a clone of instance of object (new instance with same value for each properties) With native =...
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.