35require
'../main.inc.php';
44require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
45require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent_type.class.php';
46require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
47require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
48require_once DOL_DOCUMENT_ROOT.
'/core/lib/phone.lib.php';
51$langs->loadLangs(array(
"members",
"companies",
"categories"));
54$action =
GETPOST(
'action',
'aZ09');
55$massaction =
GETPOST(
'massaction',
'alpha');
57$confirm =
GETPOST(
'confirm',
'alpha');
58$cancel =
GETPOST(
'cancel',
'alpha');
59$toselect =
GETPOST(
'toselect',
'array:int');
60$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'memberslist';
61$backtopage =
GETPOST(
'backtopage',
'alpha');
62$optioncss =
GETPOST(
'optioncss',
'aZ');
63$mode =
GETPOST(
'mode',
'alpha');
64$groupby =
GETPOST(
'groupby',
'aZ09');
67$search =
GETPOST(
"search",
'alpha');
68$search_id =
GETPOST(
'search_id',
'int');
69$search_ref =
GETPOST(
"search_ref",
'alpha');
70$search_lastname =
GETPOST(
"search_lastname",
'alpha');
71$search_firstname =
GETPOST(
"search_firstname",
'alpha');
72$search_gender =
GETPOST(
"search_gender",
'alpha');
73$search_civility =
GETPOST(
"search_civility",
'alpha');
74$search_company =
GETPOST(
'search_company',
'alphanohtml');
75$search_login =
GETPOST(
"search_login",
'alpha');
76$search_address =
GETPOST(
"search_address",
'alpha');
77$search_zip =
GETPOST(
"search_zip",
'alpha');
78$search_town =
GETPOST(
"search_town",
'alpha');
79$search_state =
GETPOST(
"search_state",
'alpha');
80$search_country =
GETPOST(
"search_country",
'alpha');
81$search_phone =
GETPOST(
"search_phone",
'alpha');
82$search_phone_perso =
GETPOST(
"search_phone_perso",
'alpha');
83$search_phone_mobile =
GETPOST(
"search_phone_mobile",
'alpha');
84$search_type =
GETPOST(
"search_type",
'alpha');
85$search_amount =
GETPOST(
"search_amount",
'alpha');
86$search_minimumamount =
GETPOST(
"search_minimumamount",
'alpha');
87$search_email =
GETPOST(
"search_email",
'alpha');
91 $search_no_email = -1;
93$search_categ =
GETPOST(
"search_categ",
'intcomma');
94$search_morphy =
GETPOST(
"search_morphy",
'alpha');
95$search_import_key = trim(
GETPOST(
"search_import_key",
'alpha'));
98if (
GETPOSTINT(
'catid') && empty($search_categ)) {
102$search_filter =
GETPOST(
"search_filter",
'alpha');
103$search_status =
GETPOST(
"search_status",
'intcomma');
108$search_datefin_start =
'';
112$search_datefin_end =
'';
117$filter =
GETPOST(
"filter",
'alpha');
119 $search_filter = $filter;
122$statut =
GETPOST(
"statut",
'alpha');
124 $search_status = $statut;
127$search_all = trim(
GETPOST(
'search_all',
'alphanohtml'));
129if ($search_status < -2) {
135$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
136$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
138if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
142$offset = $limit * $page;
143$pageprev = $page - 1;
144$pagenext = $page + 1;
146 $sortorder = ($filter ==
'outofdate' ?
"DESC" :
"ASC");
149 $sortfield = ($filter ==
'outofdate' ?
"d.datefin" :
"d.lastname");
155$hookmanager->initHooks(array(
'memberlist'));
157$diroutputmassaction =
$conf->member->dir_output.
'/temp/massgeneration/'.$user->id;
160$extrafields->fetch_name_optionals_label(
$object->table_element);
162$search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
165$fieldstosearchall = array(
167 'd.login' =>
'Login',
168 'd.lastname' =>
'Lastname',
169 'd.firstname' =>
'Firstname',
170 'd.societe' =>
"Company",
171 'd.email' =>
'EMail',
172 'd.address' =>
'Address',
175 'd.phone' =>
"Phone",
176 'd.phone_perso' =>
"PhonePerso",
177 'd.phone_mobile' =>
"PhoneMobile",
178 'd.note_public' =>
'NotePublic',
179 'd.note_private' =>
'NotePrivate',
183 'd.rowid' => array(
'label' =>
'TechnicalID',
'checked' => -1,
'enabled' => 1,
'position' => 1),
184 'd.ref' => array(
'label' =>
"Ref",
'checked' => 1),
185 'd.civility' => array(
'label' =>
"Civility",
'checked' => 0),
186 'd.gender' => array(
'label' =>
"Gender",
'checked' => 0),
187 'd.societe' => array(
'label' =>
"Company",
'checked' => 1,
'position' => 70),
188 'd.login' => array(
'label' =>
"Login",
'checked' => 1),
189 'd.morphy' => array(
'label' =>
"MemberNature",
'checked' => 1),
190 't.libelle' => array(
'label' =>
"MemberType",
'checked' => 1,
'position' => 55),
191 't.amount' => array(
'label' =>
"RecommendedAmount",
'checked' => 1,
'position' => 55),
192 't.minimumamount' => array(
'label' =>
"MinimumAmountShort",
'checked' => 1,
'position' => 55),
193 'd.address' => array(
'label' =>
"Address",
'checked' => 0),
194 'd.zip' => array(
'label' =>
"Zip",
'checked' => 0),
195 'd.town' => array(
'label' =>
"Town",
'checked' => 0),
196 'd.phone' => array(
'label' =>
"Phone",
'checked' => 0),
197 'd.phone_perso' => array(
'label' =>
"PhonePerso",
'checked' => 0),
198 'd.phone_mobile' => array(
'label' =>
"PhoneMobile",
'checked' => 0),
199 'd.email' => array(
'label' =>
"Email",
'checked' => 1),
200 'unsubscribed' => array(
'label' =>
'No_Email',
'checked' =>
'0',
'enabled' => (
string) (
int)
isModEnabled(
'mailing'),
'position' => 126),
201 'state.nom' => array(
'label' =>
"State",
'checked' => 0,
'position' => 90),
202 'country.code_iso' => array(
'label' =>
"Country",
'checked' => 0,
'position' => 95),
205 'd.datefin' => array(
'label' =>
"EndSubscription"),
206 'd.datec' => array(
'label' =>
"DateCreation"),
207 'd.birth' => array(
'label' =>
"Birthday"),
208 'd.tms' => array(
'label' =>
"DateModificationShort"),
209 'd.statut' => array(
'label' =>
"Status"),
210 'd.import_key' => array(
'label' =>
"ImportId"),
215foreach (
$object->fields as $key => $val) {
217 if (!empty($val[
'visible'])) {
219 if (in_array($key, array(
'fk_adherent_type',
'state_id',
'country'))) {
222 $visible = (int)
dol_eval((
string) $val[
'visible'], 1);
223 $arrayfields[$tableprefix.
'.'.$key] = array(
224 'label' => $val[
'label'],
225 'checked' => (($visible < 0) ?
'0' :
'1'),
226 'enabled' => (string) (int) (abs($visible) != 3 && (bool)
dol_eval((string) $val[
'enabled'], 1)),
227 'position' => (int) $val[
'position'],
228 'help' => isset($val[
'help']) ? $val[
'help'] :
''
234include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
237$parameters = array(
'arrayfields' => &$arrayfields);
238$reshook = $hookmanager->executeHooks(
'completeArrayFields', $parameters, $object, $action);
252if (
GETPOST(
'cancel',
'alpha')) {
256if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
260$permissiontoread = $user->hasRight(
'adherent',
'lire');
261$permissiontodelete = $user->hasRight(
'adherent',
'supprimer');
262$permissiontoadd = $user->hasRight(
'adherent',
'creer');
263$uploaddir =
$conf->member->dir_output;
266$parameters = array(
'socid' => isset($socid) ? $socid : null,
'arrayfields' => &$arrayfields);
267$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
269 setEventMessages($hookmanager->error, $hookmanager->errors,
'errors');
272if (empty($reshook)) {
274 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
277 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
284 $search_lastname =
"";
285 $search_firstname =
"";
287 $search_civility =
"";
289 $search_company =
"";
292 $search_minimumamount =
"";
294 $search_no_email = -1;
295 $search_address =
"";
299 $search_country =
'';
301 $search_phone_perso =
'';
302 $search_phone_mobile =
'';
307 $search_import_key =
'';
310 $search_datec_start =
'';
311 $search_datec_end =
'';
312 $search_datem_start =
'';
313 $search_datem_end =
'';
314 $search_datefin_start =
'';
315 $search_datefin_end =
'';
316 $search_array_options = array();
320 if ($massaction ==
'close' && $permissiontoadd) {
326 foreach ($toselect as $idtoclose) {
327 $tmpmember->fetch($idtoclose);
328 $result = $tmpmember->resiliate($user);
332 setEventMessages($tmpmember->error, $tmpmember->errors,
'errors');
333 } elseif ($result > 0) {
339 setEventMessages($langs->trans(
"XMembersClosed", $nbclose),
null,
'mesgs');
348 if ($massaction ==
'createexternaluser' && $user->hasRight(
'adherent',
'creer') && $user->hasRight(
'user',
'user',
'creer')) {
354 foreach ($toselect as $idtoclose) {
355 $tmpmember->fetch($idtoclose);
357 if (!empty($tmpmember->socid)) {
358 $nuser =
new User($db);
361 $result = $nuser->create_from_member($tmpuser, $tmpmember->login);
365 setEventMessages($nuser->error, $nuser->errors,
'errors');
366 } elseif ($result > 0) {
373 setEventMessages($langs->trans(
"XExternalUserCreated", $nbcreated),
null,
'mesgs');
382 if ($action ==
'createsubscription_confirm' && $confirm ==
"yes" && $user->hasRight(
'adherent',
'cotisation',
'creer')) {
385 $note =
GETPOST(
'note',
'restricthtml');
390 $error_array = array();
399 } elseif (
getDolGlobalInt(
'MEMBER_SUBSCRIPTION_SUGGEST_END_OF_YEAR')) {
403 foreach ($toselect as
$id) {
404 $res = $tmpmember->fetch(
$id);
410 $datesubendthismember = $datesubend;
411 if (!$datesubendthismember && $tmpmember->typeid > 0) {
412 if ($adht->fetch($tmpmember->typeid) > 0) {
413 $delay = !empty($adht->duration_value) ? $adht->duration_value : 1;
414 $delayunit = !empty($adht->duration_unit) ? $adht->duration_unit :
'y';
418 $result = $tmpmember->subscription($now, (
float) $amount, 0,
'', $note,
'',
'',
'', $datesubendthismember);
421 $error_array[
$id] = $tmpmember->getNomUrl(1) .
'—' . $tmpmember->error;
431 setEventMessages($langs->trans(
"XSubsriptionCreated", $nbcreated),
null,
'mesgs');
434 setEventMessages($langs->trans(
"XSubsriptionErrors", $error), $error_array,
'errors');
440 $objectclass =
'Adherent';
441 $objectlabel =
'Members';
442 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
450$form =
new Form($db);
458$title = $langs->trans(
"Members");
459$help_url =
'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder';
463$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
464$htmlofselectarray = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
$conf->main_checkbox_left_column);
470$sql .=
" d.rowid, d.ref, d.login, d.lastname, d.firstname, d.gender, d.societe as company, d.fk_soc as socid,";
471$sql .=
" d.civility, d.datefin, d.address, d.zip, d.town, d.state_id, d.country,";
472$sql .=
" d.email, d.phone, d.phone_perso, d.phone_mobile, d.birth, d.public, d.photo,";
473$sql .=
" d.fk_adherent_type as type_id, d.morphy, d.statut as status, d.datec as date_creation, d.tms as date_modification,";
474$sql .=
" d.note_private, d.note_public, d.import_key,";
476$sql .=
" ".$db->ifsql(
"d.societe IS NULL",
"s.nom",
"d.societe").
" as companyname,";
477$sql .=
" t.libelle as type, t.subscription, t.amount, t.minimumamount,";
478$sql .=
" state.code_departement as state_code, state.nom as state_name";
481 $sql .=
", (SELECT count(*) FROM ".MAIN_DB_PREFIX.
"mailing_unsubscribe WHERE email = d.email) as unsubscribed";
485if (!empty($extrafields->attributes[
$object->table_element][
'label'])) {
486 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
487 $sql .= ($extrafields->attributes[
$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
"");
492$parameters = array();
493$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object, $action);
494$sql .= $hookmanager->resPrint;
495$sql = preg_replace(
'/,\s*$/',
'', $sql);
500$sql .=
" FROM ".MAIN_DB_PREFIX.
"adherent as d";
501if (!empty($extrafields->attributes[
$object->table_element][
'label']) && count($extrafields->attributes[
$object->table_element][
'label'])) {
502 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (d.rowid = ef.fk_object)";
504$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as country on (country.rowid = d.country)";
505$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_departements as state on (state.rowid = d.state_id)";
506$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s on (s.rowid = d.fk_soc)";
509$sql .=
", ".MAIN_DB_PREFIX.
"adherent_type as t";
510$sql .=
" WHERE d.fk_adherent_type = t.rowid";
512$searchCategoryContactList = $search_categ ? array($search_categ) : array();
513$searchCategoryContactOperator = 0;
515if (!empty($searchCategoryContactList)) {
516 $searchCategoryContactSqlList = array();
517 $listofcategoryid =
'';
518 foreach ($searchCategoryContactList as $searchCategoryContact) {
519 if (intval($searchCategoryContact) == -2) {
520 $searchCategoryContactSqlList[] =
"NOT EXISTS (SELECT ck.fk_categorie FROM ".MAIN_DB_PREFIX.
"categorie_member as ck WHERE d.rowid = ck.fk_member)";
521 } elseif (intval($searchCategoryContact) > 0) {
522 if ($searchCategoryContactOperator == 0) {
523 $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).
")";
525 $listofcategoryid .= ($listofcategoryid ?
', ' :
'') .((
int) $searchCategoryContact);
529 if ($listofcategoryid) {
530 $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).
"))";
532 if ($searchCategoryContactOperator == 1) {
533 if (!empty($searchCategoryContactSqlList)) {
534 $sql .=
" AND (".implode(
' OR ', $searchCategoryContactSqlList).
")";
537 if (!empty($searchCategoryContactSqlList)) {
538 $sql .=
" AND (".implode(
' AND ', $searchCategoryContactSqlList).
")";
543$sql .=
" AND d.entity IN (".getEntity(
'adherent').
")";
545 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
547if ($search_type > 0) {
548 $sql .=
" AND t.rowid=".((int) $search_type);
550if ($search_amount !=
'') {
553if ($search_minimumamount !=
'') {
554 $sql .=
natural_search(
't.minimumamount', $search_minimumamount, 1);
556if ($search_filter ==
'withoutsubscription') {
557 $sql .=
" AND (datefin IS NULL)";
559if ($search_filter ==
'waitingsubscription') {
560 $sql .=
" AND (datefin IS NULL AND t.subscription = '1')";
562if ($search_filter ==
'uptodate') {
565 $sql .=
" AND (datefin >= '".$db->idate($now).
"' OR (datefin IS NULL AND t.subscription = '0'))";
567if ($search_filter ==
'outofdate') {
568 $sql .=
" AND (datefin < '".$db->idate($now).
"')";
570if ($search_status !=
'') {
572 $sql .=
" AND d.statut in (".$db->sanitize($db->escape($search_status)).
")";
574if ($search_morphy !=
'' && $search_morphy !=
'-1') {
583if ($search_civility) {
586if ($search_firstname) {
589if ($search_lastname) {
590 if (empty($arrayfields[
'd.firstname'][
'checked'])) {
592 $sql .=
natural_search(array(
"d.lastname",
"d.firstname"), $search_lastname);
597if ($search_gender !=
'' && $search_gender !=
'-1') {
603if ($search_company) {
604 $sql .=
natural_search(array(
"s.nom",
"d.societe"), $search_company);
609if ($search_no_email != -1 && $search_no_email > 0) {
610 $sql .=
" AND (SELECT count(*) FROM ".MAIN_DB_PREFIX.
"mailing_unsubscribe WHERE email = d.email) > 0";
612if ($search_no_email != -1 && $search_no_email == 0) {
613 $sql .=
" AND (SELECT count(*) FROM ".MAIN_DB_PREFIX.
"mailing_unsubscribe WHERE email = d.email) = 0 AND d.email IS NOT NULL AND d.email <> ''";
615if ($search_address) {
630if ($search_phone_perso) {
633if ($search_phone_mobile) {
636if ($search_country) {
637 $sql .=
" AND d.country IN (".$db->sanitize($search_country).
')';
639if ($search_import_key) {
642if ($search_datec_start) {
643 $sql .=
" AND d.datec >= '".$db->idate($search_datec_start).
"'";
645if ($search_datec_end) {
646 $sql .=
" AND d.datec <= '".$db->idate($search_datec_end).
"'";
648if ($search_datem_start) {
649 $sql .=
" AND d.tms >= '".$db->idate($search_datem_start).
"'";
651if ($search_datem_end) {
652 $sql .=
" AND d.tms <= '".$db->idate($search_datem_end).
"'";
654if ($search_datefin_start) {
655 $sql .=
" AND d.datefin >= '".$db->idate($search_datefin_start).
"'";
657if ($search_datefin_end) {
658 $sql .=
" AND d.datefin <= '".$db->idate($search_datefin_end).
"'";
661include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
663$parameters = array();
664$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
665$sql .= $hookmanager->resPrint;
668$nbtotalofrecords =
'';
671 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
672 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
673 $resql = $db->query($sqlforcount);
675 $objforcount = $db->fetch_object($resql);
676 $nbtotalofrecords = $objforcount->nbtotalofrecords;
678 dol_print_error($db);
681 if (($page * $limit) > (
int) $nbtotalofrecords) {
690$sql .= $db->order($sortfield, $sortorder);
692 $sql .= $db->plimit($limit + 1, $offset);
695$resql = $db->query($sql);
697 dol_print_error($db);
701$num = $db->num_rows($resql);
705if ($num == 1 &&
getDolGlobalInt(
'MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
706 $obj = $db->fetch_object($resql);
708 header(
"Location: ".DOL_URL_ROOT.
'/adherents/card.php?id='.
$id);
715llxHeader(
'', $title, $help_url,
'', 0, 0, $morejs, $morecss,
'',
'mod-member page-list bodyforlist');
717$arrayofselected = is_array($toselect) ? $toselect : array();
720if ($search_type > 0) {
722 $result = $membertype->fetch((
int) $search_type);
723 $title .=
" (".$membertype->label.
")";
729 $query += [
'mode' => $mode];
731if ($contextpage != $_SERVER[
"PHP_SELF"]) {
732 $query += [
'contextpage' => $contextpage];
734if ($limit > 0 && $limit !=
$conf->liste_limit) {
735 $query += [
'limit' => $limit];
737if ($optioncss !=
'') {
738 $query += [
'optioncss' => $optioncss];
741 $query += [
'groupby' => $groupby];
743if ($search_all !=
"") {
744 $query += [
'search_all' => $search_all];
747 $query += [
'search_ref' => $search_ref];
749if ($search_civility) {
750 $query += [
'search_civility' => $search_civility];
752if ($search_firstname) {
753 $query += [
'search_firstname' => $search_firstname];
755if ($search_lastname) {
756 $query += [
'search_lastname' => $search_lastname];
759 $query += [
'search_gender' => $search_gender];
761if ($search_morphy !=
'' && $search_morphy !=
'-1') {
762 $query += [
'search_morphy' => $search_morphy];
765 $query += [
'search_login' => $search_login];
768 $query += [
'search_email' => $search_email];
770if ($search_no_email != -1) {
771 $query += [
'search_no_email' => $search_no_email];
773if ($search_categ > 0 || $search_categ == -2) {
774 $query += [
'search_categ' => $search_categ];
776if ($search_company) {
777 $query += [
'search_company' => $search_company];
779if ($search_address !=
'') {
780 $query += [
'search_address' => $search_address];
782if ($search_town !=
'') {
783 $query += [
'search_town' => $search_town];
785if ($search_zip !=
'') {
786 $query += [
'search_zip' => $search_zip];
788if ($search_state !=
'') {
789 $query += [
'search_state' => $search_state];
791if ($search_country !=
'') {
792 $query += [
'search_country' => $search_country];
794if ($search_phone !=
'') {
795 $query += [
'search_phone' => $search_phone];
797if ($search_phone_perso !=
'') {
798 $query += [
'search_phone_perso' => $search_phone_perso];
800if ($search_phone_mobile !=
'') {
801 $query += [
'search_phone_mobile' => $search_phone_mobile];
803if ($search_filter && $search_filter !=
'-1') {
804 $query += [
'search_filter' => $search_filter];
806if ($search_status !=
"" && $search_status != -3) {
807 $query += [
'search_status' => $search_status];
809if ($search_import_key !=
'') {
810 $query += [
'search_import_key' => $search_import_key];
812if ($search_type > 0) {
813 $query += [
'search_type' => $search_type];
815if ($search_amount !=
'') {
816 $query += [
'search_amount' => $search_amount];
818if ($search_minimumamount !=
'') {
819 $query += [
'search_minimumamount' => $search_minimumamount];
821if ($search_datec_start) {
823 'search_datec_start_day' =>
dol_print_date($search_datec_start,
'%d'),
824 'search_datec_start_month' =>
dol_print_date($search_datec_start,
'%m'),
825 'search_datec_start_year' =>
dol_print_date($search_datec_start,
'%Y'),
828if ($search_datem_end) {
830 'search_datem_end_day' =>
dol_print_date($search_datem_end,
'%d'),
831 'search_datem_end_month' =>
dol_print_date($search_datem_end,
'%m'),
832 'search_datem_end_year' =>
dol_print_date($search_datem_end,
'%Y'),
836if ($search_datefin_start) {
838 'search_datefin_start_day' =>
dol_print_date($search_datefin_start,
'%d'),
839 'search_datefin_start_month' =>
dol_print_date($search_datefin_start,
'%m'),
840 'search_datefin_start_year' =>
dol_print_date($search_datefin_start,
'%Y'),
843if ($search_datefin_end) {
845 'search_datefin_end_day' =>
dol_print_date($search_datefin_end,
'%d'),
846 'search_datefin_end_month' =>
dol_print_date($search_datefin_end,
'%m'),
847 'search_datefin_end_year' =>
dol_print_date($search_datefin_end,
'%Y'),
852include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
855$parameters = array(
'query' => &$query);
856$reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object, $action);
859$param = http_build_query($query);
862$arrayofmassactions = array(
866if ($user->hasRight(
'adherent',
'creer')) {
867 $arrayofmassactions[
'close'] = img_picto(
'',
'close_title',
'class="pictofixedwidth"').$langs->trans(
"Resiliate");
869if ($user->hasRight(
'adherent',
'supprimer')) {
870 $arrayofmassactions[
'predelete'] = img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
872if (
isModEnabled(
'category') && $user->hasRight(
'adherent',
'creer')) {
873 $arrayofmassactions[
'preaffecttag'] = img_picto(
'',
'category',
'class="pictofixedwidth"').$langs->trans(
"AffectTag");
875if ($user->hasRight(
'adherent',
'creer') && $user->hasRight(
'user',
'user',
'creer')) {
876 $arrayofmassactions[
'createexternaluser'] = img_picto(
'',
'user',
'class="pictofixedwidth"').$langs->trans(
"CreateExternalUser");
878if ($user->hasRight(
'adherent',
'cotisation',
'creer')) {
879 $arrayofmassactions[
'createsubscription'] = img_picto(
'',
'payment',
'class="pictofixedwidth"').$langs->trans(
"CreateSubscription");
881if (
GETPOSTINT(
'nomassaction') || in_array($massaction, array(
'presend',
'predelete',
'preaffecttag'))) {
882 $arrayofmassactions = array();
884$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
886print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
887if ($optioncss !=
'') {
888 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
890print
'<input type="hidden" name="token" value="'.newToken().
'">';
891print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
892print
'<input type="hidden" name="action" value="list">';
893print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
894print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
895print
'<input type="hidden" name="page" value="'.$page.
'">';
896print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
897print
'<input type="hidden" name="page_y" value="">';
898print
'<input type="hidden" name="mode" value="'.$mode.
'">';
901$argsforbutton = $query;
902$argsforbutton[
'mode'] =
'common';
903$newcardbutton .=
dolGetButtonTitle($langs->trans(
'ViewList'),
'',
'fa fa-bars imgforviewmode',
dolBuildUrl($_SERVER[
"PHP_SELF"], $argsforbutton),
'', ((empty($mode) || $mode ==
'common') ? 2 : 1), array(
'morecss' =>
'reposition'));
904$argsforbutton[
'mode'] =
'kanban';
905$newcardbutton .=
dolGetButtonTitle($langs->trans(
'ViewKanban'),
'',
'fa fa-th-list imgforviewmode',
dolBuildUrl($_SERVER[
"PHP_SELF"], $argsforbutton),
'', ($mode ==
'kanban' ? 2 : 1), array(
'morecss' =>
'reposition'));
906$newcardbutton .=
dolGetButtonTitle($langs->trans(
'Statistics'),
'',
'fa fa-chart-bar imgforviewmode',
dol_buildpath(
'/adherents/stats/geo.php', 1).
'?mode=memberbycountry&objecttype=adherent@adherent'.preg_replace(
'/(&|\?)*(mode|groupby)=[^&]+/',
'', $param),
'', ($mode ==
'statistics' ? 2 : 1), array(
'morecss' =>
'reposition'));
908$newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewMember'),
'',
'fa fa-plus-circle',
dolBuildUrl(DOL_URL_ROOT.
'/adherents/card.php', [
'action' =>
'create']),
'', $user->hasRight(
'adherent',
'creer'));
910print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
$object->picto, 0, $newcardbutton,
'', $limit, 0, 0, 1);
913$topicmail =
"Information";
914$modelmail =
"member";
916$trackid =
'mem'.$object->id;
917if ($massaction ==
'createsubscription') {
921 foreach ($toselect as
$id) {
923 $tmpmember->fetch(
$id);
924 $res = $adht->fetch($tmpmember->typeid);
926 $amounttmp = $adht->amount;
927 if (!empty($tmpmember->last_subscription_amount) && !
GETPOSTISSET(
'newamount') && is_numeric($amounttmp)) {
928 $amounttmp = max($tmpmember->last_subscription_amount, $amount);
930 $amount = max(0, $amounttmp, $amount);
937 $formquestion = array(
938 array(
'label' => $langs->trans(
"DateSubscription"),
'type' =>
'other',
'value' => $date),
939 array(
'label' => $langs->trans(
"Amount"),
'type' =>
'text',
'value' =>
price($amount, 0,
'', 0),
'name' =>
'amount'),
940 array(
'label' => $langs->trans(
"Note"),
'type' =>
'text',
'value' =>
'',
'name' =>
'note'),
941 array(
'type' =>
'separator'),
942 array(
'label' => $langs->trans(
"MoreActions"),
'type' =>
'other',
'value' => $langs->trans(
"None").
' '.img_warning($langs->trans(
"WarningNoComplementaryActionDone"))),
944 print $form->formconfirm($_SERVER[
"PHP_SELF"], $langs->trans(
"ConfirmMassSubsriptionCreation"), $langs->trans(
"ConfirmMassSubsriptionCreationQuestion", count($toselect)),
"createsubscription_confirm", $formquestion,
'', 0, 200, 500, 1);
946include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
950 foreach ($fieldstosearchall as $key => $val) {
951 $fieldstosearchall[$key] = $langs->trans($val);
952 $setupstring .= $key.
"=".$val.
";";
954 print
'<!-- Search done like if MYOBJECT_QUICKSEARCH_ON_FIELDS = '.$setupstring.
' -->'.
"\n";
955 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).implode(
', ', $fieldstosearchall).
'</div>'.
"\n";
958$selectedfields = ($mode !=
'kanban' ? $htmlofselectarray :
'');
959$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
963if (
isModEnabled(
'category') && $user->hasRight(
'categorie',
'lire')) {
964 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
965 $moreforfilter .=
'<div class="divsearchfield">';
966 $moreforfilter .= img_picto($langs->trans(
'Categories'),
'category',
'class="pictofixedwidth"').$formother->select_categories(Categorie::TYPE_MEMBER, $search_categ,
'search_categ', 1, $langs->trans(
"MembersCategoriesShort"));
967 $moreforfilter .=
'</div>';
970 'arrayfields' => &$arrayfields,
972$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
973if (empty($reshook)) {
974 $moreforfilter .= $hookmanager->resPrint;
976 $moreforfilter = $hookmanager->resPrint;
978if (!empty($moreforfilter)) {
979 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
980 print $moreforfilter;
984print
'<div class="div-table-responsive">';
985print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
989print
'<tr class="liste_titre_filter">';
992if (
$conf->main_checkbox_left_column) {
993 print
'<td class="liste_titre center maxwidthsearch">';
994 $searchpicto = $form->showFilterButtons(
'left');
1000if (!empty($arrayfields[
'd.rowid'][
'checked'])) {
1001 print
'<td class="liste_titre center">';
1002 print
'<input class="width50" type="text" name="search_id" value="'.dol_escape_htmltag($search_id).
'">';
1007if (!empty($arrayfields[
'd.ref'][
'checked'])) {
1008 print
'<td class="liste_titre">';
1009 print
'<input type="text" class="flat maxwidth75imp" name="search_ref" value="'.dol_escape_htmltag($search_ref).
'">';
1014if (!empty($arrayfields[
'd.civility'][
'checked'])) {
1015 print
'<td class="liste_titre left">';
1016 print
'<input class="flat maxwidth50imp" type="text" name="search_civility" value="'.dol_escape_htmltag($search_civility).
'"></td>';
1020if (!empty($arrayfields[
'd.lastname'][
'checked'])) {
1021 print
'<td class="liste_titre left">';
1022 print
'<input class="flat maxwidth75imp" type="text" name="search_lastname" value="'.dol_escape_htmltag($search_lastname).
'"></td>';
1026if (!empty($arrayfields[
'd.firstname'][
'checked'])) {
1027 print
'<td class="liste_titre left">';
1028 print
'<input class="flat maxwidth75imp" type="text" name="search_firstname" value="'.dol_escape_htmltag($search_firstname).
'"></td>';
1032if (!empty($arrayfields[
'd.gender'][
'checked'])) {
1033 print
'<td class="liste_titre">';
1034 $arraygender = array(
'man' => $langs->trans(
"Genderman"),
'woman' => $langs->trans(
"Genderwoman"),
'other' => $langs->trans(
"Genderother"));
1035 print $form->selectarray(
'search_gender', $arraygender, $search_gender, 1);
1040if (!empty($arrayfields[
'd.societe'][
'checked'])) {
1041 print
'<td class="liste_titre left">';
1042 print
'<input class="flat maxwidth75imp" type="text" name="search_company" value="'.dol_escape_htmltag($search_company).
'"></td>';
1046if (!empty($arrayfields[
'd.login'][
'checked'])) {
1047 print
'<td class="liste_titre left">';
1048 print
'<input class="flat maxwidth75imp" type="text" name="search_login" value="'.dol_escape_htmltag($search_login).
'"></td>';
1052if (!empty($arrayfields[
'd.morphy'][
'checked'])) {
1053 print
'<td class="liste_titre center">';
1054 $arraymorphy = array(
'mor' => $langs->trans(
"Moral"),
'phy' => $langs->trans(
"Physical"));
1055 print $form->selectarray(
'search_morphy', $arraymorphy, $search_morphy, 1, 0, 0,
'', 0, 0, 0,
'',
'maxwidth100');
1060if (!empty($arrayfields[
't.libelle'][
'checked'])) {
1061 print
'<td class="liste_titre">';
1062 $listetype = $membertypestatic->liste_array();
1064 print $form->selectarray(
"search_type", $listetype, $search_type, 1, 0, 0,
'', 0, 32, 0,
'',
'minwidth75 maxwidth100');
1069if (!empty($arrayfields[
't.amount'][
'checked'])) {
1070 print
'<td class="liste_titre">';
1071 print
'<input class="flat" type="text" size="4" name="search_amount" value="'.dol_escape_htmltag($search_amount).
'">';
1076if (!empty($arrayfields[
't.minimumamount'][
'checked'])) {
1077 print
'<td class="liste_titre">';
1078 print
'<input class="flat" type="text" size="4" name="search_minimumamount" value="'.dol_escape_htmltag($search_minimumamount).
'">';
1083if (!empty($arrayfields[
'd.address'][
'checked'])) {
1084 print
'<td class="liste_titre left">';
1085 print
'<input class="flat maxwidth75imp" type="text" name="search_address" value="'.dol_escape_htmltag($search_address).
'"></td>';
1089if (!empty($arrayfields[
'd.zip'][
'checked'])) {
1090 print
'<td class="liste_titre left">';
1091 print
'<input class="flat maxwidth50imp" type="text" name="search_zip" value="'.dol_escape_htmltag($search_zip).
'"></td>';
1095if (!empty($arrayfields[
'd.town'][
'checked'])) {
1096 print
'<td class="liste_titre left">';
1097 print
'<input class="flat maxwidth75imp" type="text" name="search_town" value="'.dol_escape_htmltag($search_town).
'"></td>';
1101if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1102 print
'<td class="liste_titre">';
1103 print
'<input class="flat searchstring maxwidth75imp" type="text" name="search_state" value="'.dol_escape_htmltag($search_state).
'">';
1108if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1109 print
'<td class="liste_titre center">';
1110 print $form->select_country($search_country,
'search_country',
'', 0,
'minwidth100imp maxwidth100');
1115if (!empty($arrayfields[
'd.phone'][
'checked'])) {
1116 print
'<td class="liste_titre left">';
1117 print
'<input class="flat maxwidth75imp" type="text" name="search_phone" value="'.dol_escape_htmltag($search_phone).
'"></td>';
1121if (!empty($arrayfields[
'd.phone_perso'][
'checked'])) {
1122 print
'<td class="liste_titre left">';
1123 print
'<input class="flat maxwidth75imp" type="text" name="search_phone_perso" value="'.dol_escape_htmltag($search_phone_perso).
'"></td>';
1127if (!empty($arrayfields[
'd.phone_mobile'][
'checked'])) {
1128 print
'<td class="liste_titre left">';
1129 print
'<input class="flat maxwidth75imp" type="text" name="search_phone_mobile" value="'.dol_escape_htmltag($search_phone_mobile).
'"></td>';
1133if (!empty($arrayfields[
'd.email'][
'checked'])) {
1134 print
'<td class="liste_titre left">';
1135 print
'<input class="flat maxwidth75imp" type="text" name="search_email" value="'.dol_escape_htmltag($search_email).
'"></td>';
1139if (!empty($arrayfields[
'unsubscribed'][
'checked'])) {
1140 print
'<td class="liste_titre center">';
1141 print $form->selectarray(
'search_no_email', array(
'-1' =>
'',
'0' => $langs->trans(
'No'),
'1' => $langs->trans(
'Yes')), $search_no_email);
1146include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
1149$parameters = array(
'arrayfields' => $arrayfields);
1150$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters);
1151print $hookmanager->resPrint;
1154if (!empty($arrayfields[
'd.datec'][
'checked'])) {
1155 print
'<td class="liste_titre center">';
1156 print
'<div class="nowrapfordate">';
1157 print $form->selectDate($search_datec_start ? $search_datec_start : -1,
'search_datec_start_', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1159 print
'<div class="nowrapfordate">';
1160 print $form->selectDate($search_datec_end ? $search_datec_end : -1,
'search_datec_end_', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
1166if (!empty($arrayfields[
'd.birth'][
'checked'])) {
1167 print
'<td class="liste_titre">';
1172if (!empty($arrayfields[
'd.tms'][
'checked'])) {
1173 print
'<td class="liste_titre">';
1174 print
'<div class="nowrapfordate">';
1175 print $form->selectDate($search_datem_start ? $search_datem_start : -1,
'search_datem_start_', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1177 print
'<div class="nowrapfordate">';
1178 print $form->selectDate($search_datem_end ? $search_datem_end : -1,
'search_datem_end_', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
1184if (!empty($arrayfields[
'd.import_key'][
'checked'])) {
1185 print
'<td class="liste_titre center">';
1186 print
'<input class="flat searchstring maxwidth50" type="text" name="search_import_key" value="'.dol_escape_htmltag($search_import_key).
'">';
1191if (!empty($arrayfields[
'd.datefin'][
'checked'])) {
1192 print
'<td class="liste_titre center">';
1193 print
'<div class="nowrapfordate">';
1194 print $form->selectDate($search_datefin_start ? $search_datefin_start : -1,
'search_datefin_start_', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1196 print
'<div class="nowrapfordate">';
1197 print $form->selectDate($search_datefin_end ? $search_datefin_end : -1,
'search_datefin_end_', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
1200 if (
getDolGlobalString(
'MEMBER_SHOW_COMBO_OF_STATUS_FOR_END_DATE_FILTER') || ($search_filter && $search_filter !=
'-1')) {
1202 $selectarray = array(
'-1' =>
'',
'waitingsubscription' => $langs->trans(
"WaitingSubscription"),
'uptodate' => $langs->trans(
"UpToDate"),
'outofdate' => $langs->trans(
"OutOfDate"));
1203 print $form->selectarray(
'search_filter', $selectarray, $search_filter);
1209if (!empty($arrayfields[
'd.statut'][
'checked'])) {
1210 print
'<td class="liste_titre center parentonrightofpage">';
1211 $liststatus = array(
1218 print $form->selectarray(
'search_status', $liststatus, $search_status, -3, 0, 0,
'', 0, 0, 0,
'',
'search_status width100 onrightofpage');
1223if (!
$conf->main_checkbox_left_column) {
1224 print
'<td class="liste_titre center maxwidthsearch">';
1225 $searchpicto = $form->showFilterButtons();
1231$totalarray = array();
1232$totalarray[
'nbfield'] = 0;
1236print
'<tr class="liste_titre">';
1238if (
$conf->main_checkbox_left_column) {
1239 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch actioncolumn ');
1240 $totalarray[
'nbfield']++;
1242if (!empty($arrayfields[
'd.rowid'][
'checked'])) {
1244 print_liste_field_titre($arrayfields[
'd.rowid'][
'label'], $_SERVER[
"PHP_SELF"],
'd.rowid',
'', $param,
'', $sortfield, $sortorder,
'center ');
1245 $totalarray[
'nbfield']++;
1247if (!empty($arrayfields[
'd.ref'][
'checked'])) {
1248 print_liste_field_titre($arrayfields[
'd.ref'][
'label'], $_SERVER[
"PHP_SELF"],
'd.ref',
'', $param,
'', $sortfield, $sortorder);
1249 $totalarray[
'nbfield']++;
1251if (!empty($arrayfields[
'd.civility'][
'checked'])) {
1252 print_liste_field_titre($arrayfields[
'd.civility'][
'label'], $_SERVER[
"PHP_SELF"],
'd.civility',
'', $param,
'', $sortfield, $sortorder);
1253 $totalarray[
'nbfield']++;
1255if (!empty($arrayfields[
'd.lastname'][
'checked'])) {
1256 print_liste_field_titre($arrayfields[
'd.lastname'][
'label'], $_SERVER[
"PHP_SELF"],
'd.lastname',
'', $param,
'', $sortfield, $sortorder);
1257 $totalarray[
'nbfield']++;
1259if (!empty($arrayfields[
'd.firstname'][
'checked'])) {
1260 print_liste_field_titre($arrayfields[
'd.firstname'][
'label'], $_SERVER[
"PHP_SELF"],
'd.firstname',
'', $param,
'', $sortfield, $sortorder);
1261 $totalarray[
'nbfield']++;
1263if (!empty($arrayfields[
'd.gender'][
'checked'])) {
1264 print_liste_field_titre($arrayfields[
'd.gender'][
'label'], $_SERVER[
'PHP_SELF'],
'd.gender',
'', $param,
'', $sortfield, $sortorder);
1265 $totalarray[
'nbfield']++;
1267if (!empty($arrayfields[
'd.societe'][
'checked'])) {
1268 print_liste_field_titre($arrayfields[
'd.societe'][
'label'], $_SERVER[
"PHP_SELF"],
'companyname',
'', $param,
'', $sortfield, $sortorder);
1269 $totalarray[
'nbfield']++;
1271if (!empty($arrayfields[
'd.login'][
'checked'])) {
1272 print_liste_field_titre($arrayfields[
'd.login'][
'label'], $_SERVER[
"PHP_SELF"],
'd.login',
'', $param,
'', $sortfield, $sortorder);
1273 $totalarray[
'nbfield']++;
1275if (!empty($arrayfields[
'd.morphy'][
'checked'])) {
1276 print_liste_field_titre($arrayfields[
'd.morphy'][
'label'], $_SERVER[
"PHP_SELF"],
'd.morphy',
'', $param,
'', $sortfield, $sortorder,
'center ');
1277 $totalarray[
'nbfield']++;
1279if (!empty($arrayfields[
't.libelle'][
'checked'])) {
1280 print_liste_field_titre($arrayfields[
't.libelle'][
'label'], $_SERVER[
"PHP_SELF"],
't.libelle',
'', $param,
'', $sortfield, $sortorder);
1281 $totalarray[
'nbfield']++;
1283if (!empty($arrayfields[
't.amount'][
'checked'])) {
1284 print_liste_field_titre($arrayfields[
't.amount'][
'label'], $_SERVER[
"PHP_SELF"],
't.amount',
'', $param,
'', $sortfield, $sortorder);
1285 $totalarray[
'nbfield']++;
1287if (!empty($arrayfields[
't.minimumamount'][
'checked'])) {
1288 print_liste_field_titre($arrayfields[
't.minimumamount'][
'label'], $_SERVER[
"PHP_SELF"],
't.minimumamount',
'', $param,
'', $sortfield, $sortorder);
1289 $totalarray[
'nbfield']++;
1291if (!empty($arrayfields[
'd.address'][
'checked'])) {
1292 print_liste_field_titre($arrayfields[
'd.address'][
'label'], $_SERVER[
"PHP_SELF"],
'd.address',
'', $param,
'', $sortfield, $sortorder);
1293 $totalarray[
'nbfield']++;
1295if (!empty($arrayfields[
'd.zip'][
'checked'])) {
1296 print_liste_field_titre($arrayfields[
'd.zip'][
'label'], $_SERVER[
"PHP_SELF"],
'd.zip',
'', $param,
'', $sortfield, $sortorder);
1297 $totalarray[
'nbfield']++;
1299if (!empty($arrayfields[
'd.town'][
'checked'])) {
1300 print_liste_field_titre($arrayfields[
'd.town'][
'label'], $_SERVER[
"PHP_SELF"],
'd.town',
'', $param,
'', $sortfield, $sortorder);
1301 $totalarray[
'nbfield']++;
1303if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1304 print_liste_field_titre($arrayfields[
'state.nom'][
'label'], $_SERVER[
"PHP_SELF"],
"state.nom",
"", $param,
'', $sortfield, $sortorder);
1305 $totalarray[
'nbfield']++;
1307if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1308 print_liste_field_titre($arrayfields[
'country.code_iso'][
'label'], $_SERVER[
"PHP_SELF"],
"country.code_iso",
"", $param,
'', $sortfield, $sortorder,
'center ');
1309 $totalarray[
'nbfield']++;
1311if (!empty($arrayfields[
'd.phone'][
'checked'])) {
1312 print_liste_field_titre($arrayfields[
'd.phone'][
'label'], $_SERVER[
"PHP_SELF"],
'd.phone',
'', $param,
'', $sortfield, $sortorder);
1313 $totalarray[
'nbfield']++;
1315if (!empty($arrayfields[
'd.phone_perso'][
'checked'])) {
1316 print_liste_field_titre($arrayfields[
'd.phone_perso'][
'label'], $_SERVER[
"PHP_SELF"],
'd.phone_perso',
'', $param,
'', $sortfield, $sortorder);
1317 $totalarray[
'nbfield']++;
1319if (!empty($arrayfields[
'd.phone_mobile'][
'checked'])) {
1320 print_liste_field_titre($arrayfields[
'd.phone_mobile'][
'label'], $_SERVER[
"PHP_SELF"],
'd.phone_mobile',
'', $param,
'', $sortfield, $sortorder);
1321 $totalarray[
'nbfield']++;
1323if (!empty($arrayfields[
'd.email'][
'checked'])) {
1324 print_liste_field_titre($arrayfields[
'd.email'][
'label'], $_SERVER[
"PHP_SELF"],
'd.email',
'', $param,
'', $sortfield, $sortorder);
1325 $totalarray[
'nbfield']++;
1327if (!empty($arrayfields[
'unsubscribed'][
'checked'])) {
1328 print_liste_field_titre($arrayfields[
'unsubscribed'][
'label'], $_SERVER[
"PHP_SELF"],
'unsubscribed',
'', $param,
'', $sortfield, $sortorder,
'center ');
1329 $totalarray[
'nbfield']++;
1332include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
1335$parameters = array(
'arrayfields' => $arrayfields,
'totalarray' => &$totalarray,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder);
1336$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters);
1337print $hookmanager->resPrint;
1339if (!empty($arrayfields[
'd.datec'][
'checked'])) {
1340 print_liste_field_titre($arrayfields[
'd.datec'][
'label'], $_SERVER[
"PHP_SELF"],
"d.datec",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1341 $totalarray[
'nbfield']++;
1343if (!empty($arrayfields[
'd.birth'][
'checked'])) {
1344 print_liste_field_titre($arrayfields[
'd.birth'][
'label'], $_SERVER[
"PHP_SELF"],
"d.birth",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1345 $totalarray[
'nbfield']++;
1347if (!empty($arrayfields[
'd.tms'][
'checked'])) {
1348 print_liste_field_titre($arrayfields[
'd.tms'][
'label'], $_SERVER[
"PHP_SELF"],
"d.tms",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1349 $totalarray[
'nbfield']++;
1351if (!empty($arrayfields[
'd.import_key'][
'checked'])) {
1352 print_liste_field_titre($arrayfields[
'd.import_key'][
'label'], $_SERVER[
"PHP_SELF"],
"d.import_key",
"", $param,
'', $sortfield, $sortorder,
'center ');
1353 $totalarray[
'nbfield']++;
1355if (!empty($arrayfields[
'd.datefin'][
'checked'])) {
1356 print_liste_field_titre($arrayfields[
'd.datefin'][
'label'], $_SERVER[
"PHP_SELF"],
'd.datefin,t.subscription',
'', $param,
'', $sortfield, $sortorder,
'center ');
1357 $totalarray[
'nbfield']++;
1359if (!empty($arrayfields[
'd.statut'][
'checked'])) {
1360 print_liste_field_titre($arrayfields[
'd.statut'][
'label'], $_SERVER[
"PHP_SELF"],
"d.statut,t.subscription,d.datefin",
"", $param,
'', $sortfield, $sortorder,
'center ');
1361 $totalarray[
'nbfield']++;
1363if (!
$conf->main_checkbox_left_column) {
1364 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'maxwidthsearch center ');
1365 $totalarray[
'nbfield']++;
1372$savnbfield = $totalarray[
'nbfield'];
1373$totalarray = array();
1374$totalarray[
'nbfield'] = 0;
1375$imaxinloop = ($limit ? min($num, $limit) : $num);
1376while ($i < $imaxinloop) {
1377 $obj = $db->fetch_object($resql);
1382 $datefin = $db->jdate($obj->datefin);
1384 $memberstatic->id = $obj->rowid;
1385 $memberstatic->ref = $obj->ref;
1386 $memberstatic->civility_code = $obj->civility;
1387 $memberstatic->login = $obj->login;
1388 $memberstatic->lastname = $obj->lastname;
1389 $memberstatic->firstname = $obj->firstname;
1390 $memberstatic->gender = $obj->gender;
1391 $memberstatic->status = $obj->status;
1392 $memberstatic->datefin = $datefin;
1393 $memberstatic->socid = $obj->socid;
1394 $memberstatic->photo = $obj->photo;
1395 $memberstatic->email = $obj->email;
1396 $memberstatic->morphy = $obj->morphy;
1397 $memberstatic->note_public = $obj->note_public;
1398 $memberstatic->note_private = $obj->note_private;
1399 $memberstatic->need_subscription = $obj->subscription;
1401 if (!empty($obj->socid)) {
1402 $memberstatic->fetch_thirdparty();
1403 if ($memberstatic->thirdparty->id > 0) {
1404 $companyname = $memberstatic->thirdparty->name;
1405 $companynametoshow = $memberstatic->thirdparty->getNomUrl(1);
1407 $companyname =
null;
1408 $companynametoshow =
null;
1411 $companyname = $obj->company;
1412 $companynametoshow = $obj->company;
1414 $memberstatic->company = (string) $companyname;
1418 if ($mode ==
'kanban') {
1420 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
1421 print
'<div class="box-flex-container kanban">';
1423 $membertypestatic->id = $obj->type_id;
1424 $membertypestatic->label = $obj->type;
1426 $memberstatic->type = $membertypestatic->label;
1427 $memberstatic->photo = $obj->photo;
1430 print $memberstatic->getKanbanView(
'', array(
'selected' => in_array(
$object->id, $arrayofselected)));
1431 if ($i == (min($num, $limit) - 1)) {
1438 print
'<tr data-rowid="'.$object->id.
'" class="oddeven row-with-select">';
1441 if (
$conf->main_checkbox_left_column) {
1442 print
'<td class="nowrap center">';
1443 if ($massactionbutton || $massaction) {
1445 if (in_array($obj->rowid, $arrayofselected)) {
1448 print
'<input id="cb'.$obj->rowid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1452 $totalarray[
'nbfield']++;
1456 if (!empty($arrayfields[
'd.rowid'][
'checked'])) {
1457 print
'<td class="center" data-key="id">'.dolPrintHTML($obj->rowid).
'</td>';
1459 $totalarray[
'nbfield']++;
1463 if (!empty($arrayfields[
'd.ref'][
'checked'])) {
1464 print
'<td class="tdoverflowmax150">';
1465 print $memberstatic->getNomUrl(-1, 0,
'card',
'ref',
'', -1, 0, 1);
1468 $totalarray[
'nbfield']++;
1472 if (!empty($arrayfields[
'd.civility'][
'checked'])) {
1474 print dolPrintHTML($obj->civility);
1477 $totalarray[
'nbfield']++;
1481 if (!empty($arrayfields[
'd.lastname'][
'checked'])) {
1482 print
'<td class="tdlineheightsmall">';
1483 print
'<div class="tdoverflowmax125 inline-block lineheightsmall">';
1484 print $memberstatic->getNomUrl(0, 0,
'card',
'lastname');
1487 if (empty($arrayfields[
'd.firstname'][
'checked']) && !empty($obj->firstname)) {
1488 print
'<br><span class="spantitle">'.dolPrintHTML($obj->firstname).
'</span>';
1493 $totalarray[
'nbfield']++;
1497 if (!empty($arrayfields[
'd.firstname'][
'checked'])) {
1498 print
'<td class="tdoverflowmax125">';
1499 print $memberstatic->getNomUrl(0, 0,
'card',
'firstname');
1503 $totalarray[
'nbfield']++;
1507 if (!empty($arrayfields[
'd.gender'][
'checked'])) {
1510 print $langs->trans(
"Gender".$obj->gender);
1514 $totalarray[
'nbfield']++;
1518 if (!empty($arrayfields[
'd.societe'][
'checked'])) {
1519 print
'<td class="tdoverflowmax125">';
1520 print $companynametoshow;
1524 if (!empty($arrayfields[
'd.login'][
'checked'])) {
1525 print
'<td class="tdoverflowmax125" title="'.dolPrintHTMLForAttribute($obj->login).
'">'.dolPrintHTML($obj->login).
"</td>\n";
1527 $totalarray[
'nbfield']++;
1531 if (!empty($arrayfields[
'd.morphy'][
'checked'])) {
1532 print
'<td class="center">';
1533 print $memberstatic->getmorphylib(
'', 2);
1536 $totalarray[
'nbfield']++;
1540 if (!empty($arrayfields[
't.libelle'][
'checked'])) {
1541 $membertypestatic->id = $obj->type_id;
1542 $membertypestatic->label = $obj->type;
1543 print
'<td class="nowraponall tdoverflowmax100">';
1544 print $membertypestatic->getNomUrl(1, 32);
1547 $totalarray[
'nbfield']++;
1551 if (!empty($arrayfields[
't.amount'][
'checked'])) {
1552 print
'<td class="nowraponall tdoverflowmax100">';
1553 print
price($obj->amount);
1556 $totalarray[
'nbfield']++;
1560 if (!empty($arrayfields[
't.minimumamount'][
'checked'])) {
1561 print
'<td class="nowraponall tdoverflowmax100">';
1562 print
price($obj->minimumamount);
1565 $totalarray[
'nbfield']++;
1569 if (!empty($arrayfields[
'd.address'][
'checked'])) {
1570 print
'<td class="nocellnopadd tdoverflowmax200" title="'.dol_escape_htmltag($obj->address).
'">';
1571 print dolPrintHTML($obj->address);
1574 $totalarray[
'nbfield']++;
1578 if (!empty($arrayfields[
'd.zip'][
'checked'])) {
1579 print
'<td class="nocellnopadd">';
1580 print dolPrintHTML($obj->zip);
1583 $totalarray[
'nbfield']++;
1587 if (!empty($arrayfields[
'd.town'][
'checked'])) {
1588 print
'<td class="nocellnopadd">';
1589 print dolPrintHTML($obj->town);
1592 $totalarray[
'nbfield']++;
1596 if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1598 print dolPrintHTML($obj->state_name);
1601 $totalarray[
'nbfield']++;
1605 if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1606 $tmparray =
getCountry($obj->country,
'all');
1607 print
'<td class="center tdoverflowmax100" title="'.dolPrintHTMLForAttribute($tmparray[
'label']).
'">';
1608 print dolPrintHTML($tmparray[
'label']);
1611 $totalarray[
'nbfield']++;
1615 if (!empty($arrayfields[
'd.phone'][
'checked'])) {
1616 print
'<td class="nocellnopadd">';
1620 $totalarray[
'nbfield']++;
1624 if (!empty($arrayfields[
'd.phone_perso'][
'checked'])) {
1625 print
'<td class="nocellnopadd">';
1629 $totalarray[
'nbfield']++;
1633 if (!empty($arrayfields[
'd.phone_mobile'][
'checked'])) {
1634 print
'<td class="nocellnopadd">';
1638 $totalarray[
'nbfield']++;
1642 if (!empty($arrayfields[
'd.email'][
'checked'])) {
1643 print
'<td class="tdoverflowmax150" title="'.dolPrintHTMLForAttribute((
string) $obj->email).
'">';
1644 $showinvalidemail =
getDolGlobalInt(
'MAIN_SHOW_INVALID_EMAIL_IN_LIST', 1);
1645 print
dol_print_email((
string) $obj->email, 0, 0, 1, 64, $showinvalidemail, 1);
1648 $totalarray[
'nbfield']++;
1652 if (!empty($arrayfields[
'unsubscribed'][
'checked'])) {
1653 print
'<td class="center">'.yn(($obj->unsubscribed > 0) ? 1 : 0).
"</td>\n";
1655 $totalarray[
'nbfield']++;
1659 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
1661 $parameters = array(
'arrayfields' => $arrayfields,
'obj' => $obj,
'i' => $i,
'totalarray' => &$totalarray);
1662 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters);
1663 print $hookmanager->resPrint;
1665 if (!empty($arrayfields[
'd.datec'][
'checked'])) {
1666 print
'<td class="nowrap center">';
1667 print
dol_print_date($db->jdate($obj->date_creation),
'dayhour',
'tzuser');
1670 $totalarray[
'nbfield']++;
1674 if (!empty($arrayfields[
'd.birth'][
'checked'])) {
1675 print
'<td class="nowrap center">';
1679 $totalarray[
'nbfield']++;
1683 if (!empty($arrayfields[
'd.tms'][
'checked'])) {
1684 print
'<td class="nowrap center">';
1685 print
dol_print_date($db->jdate($obj->date_modification),
'dayhour',
'tzuser');
1688 $totalarray[
'nbfield']++;
1692 if (!empty($arrayfields[
'd.import_key'][
'checked'])) {
1693 print
'<td class="tdoverflowmax100 center" title="'.dolPrintHTMLForAttribute($obj->import_key).
'">';
1694 print dolPrintHTML($obj->import_key);
1697 $totalarray[
'nbfield']++;
1701 $datefin = $db->jdate($obj->datefin);
1702 if (!empty($arrayfields[
'd.datefin'][
'checked'])) {
1706 if ($memberstatic->hasDelay()) {
1707 $textlate =
' ('.$langs->trans(
"DateReference").
' > '.$langs->trans(
"DateToday").
' '.(ceil(
getWarningDelay(
'member',
'subscription') / 60 / 60 / 24) >= 0 ?
'+' :
'').ceil(
getWarningDelay(
'member',
'subscription') / 60 / 60 / 24).
' '.$langs->trans(
"days").
')';
1708 $s .=
" ".img_warning($langs->trans(
"SubscriptionLate").$textlate);
1711 if (!empty($obj->subscription)) {
1712 $s .=
'<span class="opacitymedium">'.$langs->trans(
"SubscriptionNotReceived").
'</span>';
1713 if ($obj->status > 0) {
1714 $s .=
" ".img_warning();
1717 $s .=
'<span class="opacitymedium">'.$langs->trans(
"SubscriptionNotNeeded").
'</span>';
1720 print
'<td class="nowraponall center tdoverflowmax150" title="'.dolPrintHTMLForAttribute(
dol_string_nohtmltag($s)).
'">';
1724 $totalarray[
'nbfield']++;
1728 if (!empty($arrayfields[
'd.statut'][
'checked'])) {
1729 print
'<td class="nowrap center">';
1730 print $memberstatic->LibStatut($obj->status, $obj->subscription, $datefin, 5);
1733 $totalarray[
'nbfield']++;
1737 if (!
$conf->main_checkbox_left_column) {
1738 print
'<td class="center">';
1739 if ($massactionbutton || $massaction) {
1741 if (in_array($obj->rowid, $arrayofselected)) {
1744 print
'<input id="cb'.$obj->rowid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1748 $totalarray[
'nbfield']++;
1758include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
1764 foreach ($arrayfields as $key => $val) {
1765 if (!empty($val[
'checked'])) {
1769 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
1774$parameters = array(
'arrayfields' => $arrayfields,
'sql' => $sql);
1775$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
1776print $hookmanager->resPrint;
1778print
'</table>'.
"\n";
1781print
'</form>'.
"\n";
1783if (in_array(
'builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords ===
'' || $nbtotalofrecords)) {
1784 $hidegeneratedfilelistifempty = 1;
1785 if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
1786 $hidegeneratedfilelistifempty = 0;
1789 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
1793 $urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
1794 $urlsource .= str_replace(
'&',
'&', $param);
1796 $filedir = $diroutputmassaction;
1797 $genallowed = $permissiontoread;
1798 $delallowed = $permissiontoadd;
1800 print $formfile->showdocuments(
'massfilesarea_'.
$object->module,
'', $filedir, $urlsource, 0, $delallowed,
'', 1, 1, 0, 48, 1, $param, $title,
'',
'',
'',
null, $hidegeneratedfilelistifempty);
$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.
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
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_time_plus_duree($time, $duration_value, $duration_unit, $ruleforendofmonth=0, $tz='')
Add a delay to a date.
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...
dol_print_email($email, $contactid=0, $socid=0, $addlink=0, $max=0, $showinvalid=2, $withpicto=0, $morecss='paddingrightonly')
Show EMail link formatted for HTML output.
price2num($amount, $rounding='', $option=0, $currencycode='')
Function that return a number with universal decimal format (decimal separator is '.
dol_print_phone($phone, $countrycode='', $contactid=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.
dolBuildUrl($url, $params=[], $addtoken=false, $anchor='')
Return path of url.
dol_eval($s, $returnvalue=1, $hideerrors=1, $onlysimplestring='1')
Replace eval function to add more security.
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.
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.
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...
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_clone($srcobject, $native=2)
Create a clone of instance of object (new instance with same value for each properties) With native =...
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.
getWarningDelay($module, $parmlevel1, $parmlevel2='')
Return a warning delay You can use it like this: if (getWarningDelay('module', 'paramlevel1')) It rep...
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.
dolGetButtonTitleSeparator($moreClass="")
Add space between dolGetButtonTitle.
dol_natural_search_phone($db, $fields, $value, $nofirstand=0)
Build a natural_search() SQL fragment for a phone/fax field, tolerant of the international storage fo...
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.