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');
109$filter =
GETPOST(
"filter",
'alpha');
111 $search_filter = $filter;
114$statut =
GETPOST(
"statut",
'alpha');
116 $search_status = $statut;
119$search_all = trim(
GETPOST(
'search_all',
'alphanohtml'));
121if ($search_status < -2) {
127$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
128$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
130if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
134$offset = $limit * $page;
135$pageprev = $page - 1;
136$pagenext = $page + 1;
138 $sortorder = ($filter ==
'outofdate' ?
"DESC" :
"ASC");
141 $sortfield = ($filter ==
'outofdate' ?
"d.datefin" :
"d.lastname");
147$hookmanager->initHooks(array(
'memberlist'));
149$diroutputmassaction =
$conf->member->dir_output.
'/temp/massgeneration/'.$user->id;
152$extrafields->fetch_name_optionals_label(
$object->table_element);
154$search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
157$fieldstosearchall = array(
159 'd.login' =>
'Login',
160 'd.lastname' =>
'Lastname',
161 'd.firstname' =>
'Firstname',
162 'd.societe' =>
"Company",
163 'd.email' =>
'EMail',
164 'd.address' =>
'Address',
167 'd.phone' =>
"Phone",
168 'd.phone_perso' =>
"PhonePerso",
169 'd.phone_mobile' =>
"PhoneMobile",
170 'd.note_public' =>
'NotePublic',
171 'd.note_private' =>
'NotePrivate',
175 'd.rowid' => array(
'label' =>
'TechnicalID',
'checked' => -1,
'enabled' => 1,
'position' => 1),
176 'd.ref' => array(
'label' =>
"Ref",
'checked' => 1),
177 'd.civility' => array(
'label' =>
"Civility",
'checked' => 0),
178 'd.gender' => array(
'label' =>
"Gender",
'checked' => 0),
179 'd.societe' => array(
'label' =>
"Company",
'checked' => 1,
'position' => 70),
180 'd.login' => array(
'label' =>
"Login",
'checked' => 1),
181 'd.morphy' => array(
'label' =>
"MemberNature",
'checked' => 1),
182 't.libelle' => array(
'label' =>
"MemberType",
'checked' => 1,
'position' => 55),
183 't.amount' => array(
'label' =>
"RecommendedAmount",
'checked' => 1,
'position' => 55),
184 't.minimumamount' => array(
'label' =>
"MinimumAmountShort",
'checked' => 1,
'position' => 55),
185 'd.address' => array(
'label' =>
"Address",
'checked' => 0),
186 'd.zip' => array(
'label' =>
"Zip",
'checked' => 0),
187 'd.town' => array(
'label' =>
"Town",
'checked' => 0),
188 'd.phone' => array(
'label' =>
"Phone",
'checked' => 0),
189 'd.phone_perso' => array(
'label' =>
"PhonePerso",
'checked' => 0),
190 'd.phone_mobile' => array(
'label' =>
"PhoneMobile",
'checked' => 0),
191 'd.email' => array(
'label' =>
"Email",
'checked' => 1),
192 'unsubscribed' => array(
'label' =>
'No_Email',
'checked' =>
'0',
'enabled' => (
string) (
int)
isModEnabled(
'mailing'),
'position' => 126),
193 'state.nom' => array(
'label' =>
"State",
'checked' => 0,
'position' => 90),
194 'country.code_iso' => array(
'label' =>
"Country",
'checked' => 0,
'position' => 95),
197 'd.datefin' => array(
'label' =>
"EndSubscription"),
198 'd.datec' => array(
'label' =>
"DateCreation"),
199 'd.birth' => array(
'label' =>
"Birthday"),
200 'd.tms' => array(
'label' =>
"DateModificationShort"),
201 'd.statut' => array(
'label' =>
"Status"),
202 'd.import_key' => array(
'label' =>
"ImportId"),
207foreach (
$object->fields as $key => $val) {
209 if (!empty($val[
'visible'])) {
211 if (in_array($key, array(
'fk_adherent_type',
'state_id',
'country'))) {
214 $visible = (int)
dol_eval((
string) $val[
'visible'], 1);
215 $arrayfields[$tableprefix.
'.'.$key] = array(
216 'label' => $val[
'label'],
217 'checked' => (($visible < 0) ?
'0' :
'1'),
218 'enabled' => (string) (int) (abs($visible) != 3 && (bool)
dol_eval((string) $val[
'enabled'], 1)),
219 'position' => (int) $val[
'position'],
220 'help' => isset($val[
'help']) ? $val[
'help'] :
''
226include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
229$parameters = array(
'arrayfields' => &$arrayfields);
230$reshook = $hookmanager->executeHooks(
'completeArrayFields', $parameters, $object, $action);
244if (
GETPOST(
'cancel',
'alpha')) {
248if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
252$permissiontoread = $user->hasRight(
'adherent',
'lire');
253$permissiontodelete = $user->hasRight(
'adherent',
'supprimer');
254$permissiontoadd = $user->hasRight(
'adherent',
'creer');
255$uploaddir =
$conf->member->dir_output;
258$parameters = array(
'socid' => isset($socid) ? $socid : null,
'arrayfields' => &$arrayfields);
259$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
261 setEventMessages($hookmanager->error, $hookmanager->errors,
'errors');
264if (empty($reshook)) {
266 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
269 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
276 $search_lastname =
"";
277 $search_firstname =
"";
279 $search_civility =
"";
281 $search_company =
"";
284 $search_minimumamount =
"";
286 $search_no_email = -1;
287 $search_address =
"";
291 $search_country =
'';
293 $search_phone_perso =
'';
294 $search_phone_mobile =
'';
299 $search_import_key =
'';
302 $search_datec_start =
'';
303 $search_datec_end =
'';
304 $search_datem_start =
'';
305 $search_datem_end =
'';
306 $search_array_options = array();
310 if ($massaction ==
'close' && $user->hasRight(
'adherent',
'creer')) {
316 foreach ($toselect as $idtoclose) {
317 $tmpmember->fetch($idtoclose);
318 $result = $tmpmember->resiliate($user);
322 setEventMessages($tmpmember->error, $tmpmember->errors,
'errors');
323 } elseif ($result > 0) {
329 setEventMessages($langs->trans(
"XMembersClosed", $nbclose),
null,
'mesgs');
338 if ($massaction ==
'createexternaluser' && $user->hasRight(
'adherent',
'creer') && $user->hasRight(
'user',
'user',
'creer')) {
344 foreach ($toselect as $idtoclose) {
345 $tmpmember->fetch($idtoclose);
347 if (!empty($tmpmember->socid)) {
348 $nuser =
new User($db);
351 $result = $nuser->create_from_member($tmpuser, $tmpmember->login);
355 setEventMessages($nuser->error, $nuser->errors,
'errors');
356 } elseif ($result > 0) {
363 setEventMessages($langs->trans(
"XExternalUserCreated", $nbcreated),
null,
'mesgs');
372 if ($action ==
'createsubscription_confirm' && $confirm ==
"yes" && $user->hasRight(
'adherent',
'creer')) {
387 } elseif (
getDolGlobalInt(
'MEMBER_SUBSCRIPTION_SUGGEST_END_OF_YEAR')) {
391 foreach ($toselect as
$id) {
392 $res = $tmpmember->fetch(
$id);
398 $datesubendthismember = $datesubend;
399 if (!$datesubendthismember && $tmpmember->typeid > 0) {
400 if ($adht->fetch($tmpmember->typeid) > 0) {
401 $delay = !empty($adht->duration_value) ? $adht->duration_value : 1;
402 $delayunit = !empty($adht->duration_unit) ? $adht->duration_unit :
'y';
406 $result = $tmpmember->subscription($now, (
float) $amount, 0,
'',
'',
'',
'',
'', $datesubendthismember);
418 setEventMessages($langs->trans(
"XSubsriptionCreated", $nbcreated),
null,
'mesgs');
421 setEventMessages($langs->trans(
"XSubsriptionErrors", $error),
null,
'mesgs');
427 $objectclass =
'Adherent';
428 $objectlabel =
'Members';
429 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
437$form =
new Form($db);
445$title = $langs->trans(
"Members");
446$help_url =
'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder';
454$sql .=
" d.rowid, d.ref, d.login, d.lastname, d.firstname, d.gender, d.societe as company, d.fk_soc as socid,";
455$sql .=
" d.civility, d.datefin, d.address, d.zip, d.town, d.state_id, d.country,";
456$sql .=
" d.email, d.phone, d.phone_perso, d.phone_mobile, d.birth, d.public, d.photo,";
457$sql .=
" d.fk_adherent_type as type_id, d.morphy, d.statut as status, d.datec as date_creation, d.tms as date_modification,";
458$sql .=
" d.note_private, d.note_public, d.import_key,";
460$sql .=
" ".$db->ifsql(
"d.societe IS NULL",
"s.nom",
"d.societe").
" as companyname,";
461$sql .=
" t.libelle as type, t.subscription, t.amount, t.minimumamount,";
462$sql .=
" state.code_departement as state_code, state.nom as state_name";
465 $sql .=
", (SELECT count(*) FROM ".MAIN_DB_PREFIX.
"mailing_unsubscribe WHERE email = d.email) as unsubscribed";
469if (!empty($extrafields->attributes[
$object->table_element][
'label'])) {
470 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
471 $sql .= ($extrafields->attributes[
$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
"");
476$parameters = array();
477$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object, $action);
478$sql .= $hookmanager->resPrint;
479$sql = preg_replace(
'/,\s*$/',
'', $sql);
484$sql .=
" FROM ".MAIN_DB_PREFIX.
"adherent as d";
485if (!empty($extrafields->attributes[
$object->table_element][
'label']) && count($extrafields->attributes[
$object->table_element][
'label'])) {
486 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (d.rowid = ef.fk_object)";
488$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as country on (country.rowid = d.country)";
489$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_departements as state on (state.rowid = d.state_id)";
490$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s on (s.rowid = d.fk_soc)";
493$sql .=
", ".MAIN_DB_PREFIX.
"adherent_type as t";
494$sql .=
" WHERE d.fk_adherent_type = t.rowid";
496$searchCategoryContactList = $search_categ ? array($search_categ) : array();
497$searchCategoryContactOperator = 0;
499if (!empty($searchCategoryContactList)) {
500 $searchCategoryContactSqlList = array();
501 $listofcategoryid =
'';
502 foreach ($searchCategoryContactList as $searchCategoryContact) {
503 if (intval($searchCategoryContact) == -2) {
504 $searchCategoryContactSqlList[] =
"NOT EXISTS (SELECT ck.fk_categorie FROM ".MAIN_DB_PREFIX.
"categorie_member as ck WHERE d.rowid = ck.fk_member)";
505 } elseif (intval($searchCategoryContact) > 0) {
506 if ($searchCategoryContactOperator == 0) {
507 $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).
")";
509 $listofcategoryid .= ($listofcategoryid ?
', ' :
'') .((
int) $searchCategoryContact);
513 if ($listofcategoryid) {
514 $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).
"))";
516 if ($searchCategoryContactOperator == 1) {
517 if (!empty($searchCategoryContactSqlList)) {
518 $sql .=
" AND (".implode(
' OR ', $searchCategoryContactSqlList).
")";
521 if (!empty($searchCategoryContactSqlList)) {
522 $sql .=
" AND (".implode(
' AND ', $searchCategoryContactSqlList).
")";
527$sql .=
" AND d.entity IN (".getEntity(
'adherent').
")";
529 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
531if ($search_type > 0) {
532 $sql .=
" AND t.rowid=".((int) $search_type);
534if ($search_amount !=
'') {
537if ($search_minimumamount !=
'') {
538 $sql .=
natural_search(
't.minimumamount', $search_minimumamount, 1);
540if ($search_filter ==
'withoutsubscription') {
541 $sql .=
" AND (datefin IS NULL)";
543if ($search_filter ==
'waitingsubscription') {
544 $sql .=
" AND (datefin IS NULL AND t.subscription = '1')";
546if ($search_filter ==
'uptodate') {
549 $sql .=
" AND (datefin >= '".$db->idate($now).
"' OR (datefin IS NULL AND t.subscription = '0'))";
551if ($search_filter ==
'outofdate') {
552 $sql .=
" AND (datefin < '".$db->idate($now).
"')";
554if ($search_status !=
'') {
556 $sql .=
" AND d.statut in (".$db->sanitize($db->escape($search_status)).
")";
558if ($search_morphy !=
'' && $search_morphy !=
'-1') {
567if ($search_civility) {
570if ($search_firstname) {
573if ($search_lastname) {
576if ($search_gender !=
'' && $search_gender !=
'-1') {
582if ($search_company) {
583 $sql .=
natural_search(array(
"s.nom",
"d.societe"), $search_company);
588if ($search_no_email != -1 && $search_no_email > 0) {
589 $sql .=
" AND (SELECT count(*) FROM ".MAIN_DB_PREFIX.
"mailing_unsubscribe WHERE email = d.email) > 0";
591if ($search_no_email != -1 && $search_no_email == 0) {
592 $sql .=
" AND (SELECT count(*) FROM ".MAIN_DB_PREFIX.
"mailing_unsubscribe WHERE email = d.email) = 0 AND d.email IS NOT NULL AND d.email <> ''";
594if ($search_address) {
609if ($search_phone_perso) {
612if ($search_phone_mobile) {
615if ($search_country) {
616 $sql .=
" AND d.country IN (".$db->sanitize($search_country).
')';
618if ($search_import_key) {
621if ($search_datec_start) {
622 $sql .=
" AND d.datec >= '".$db->idate($search_datec_start).
"'";
624if ($search_datec_end) {
625 $sql .=
" AND d.datec <= '".$db->idate($search_datec_end).
"'";
627if ($search_datem_start) {
628 $sql .=
" AND d.tms >= '".$db->idate($search_datem_start).
"'";
630if ($search_datem_end) {
631 $sql .=
" AND d.tms <= '".$db->idate($search_datem_end).
"'";
634include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
636$parameters = array();
637$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
638$sql .= $hookmanager->resPrint;
641$nbtotalofrecords =
'';
644 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
645 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
646 $resql = $db->query($sqlforcount);
648 $objforcount = $db->fetch_object($resql);
649 $nbtotalofrecords = $objforcount->nbtotalofrecords;
651 dol_print_error($db);
654 if (($page * $limit) > (
int) $nbtotalofrecords) {
663$sql .= $db->order($sortfield, $sortorder);
665 $sql .= $db->plimit($limit + 1, $offset);
668$resql = $db->query($sql);
670 dol_print_error($db);
674$num = $db->num_rows($resql);
678if ($num == 1 &&
getDolGlobalInt(
'MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
679 $obj = $db->fetch_object($resql);
681 header(
"Location: ".DOL_URL_ROOT.
'/adherents/card.php?id='.
$id);
688llxHeader(
'', $title, $help_url,
'', 0, 0, $morejs, $morecss,
'',
'mod-member page-list bodyforlist');
690$arrayofselected = is_array($toselect) ? $toselect : array();
693if ($search_type > 0) {
695 $result = $membertype->fetch((
int) $search_type);
696 $title .=
" (".$membertype->label.
")";
702 $query += [
'mode' => $mode];
704if ($contextpage != $_SERVER[
"PHP_SELF"]) {
705 $query += [
'contextpage' => $contextpage];
707if ($limit > 0 && $limit !=
$conf->liste_limit) {
708 $query += [
'limit' => $limit];
710if ($optioncss !=
'') {
711 $query += [
'optioncss' => $optioncss];
714 $query += [
'groupby' => $groupby];
716if ($search_all !=
"") {
717 $query += [
'search_all' => $search_all];
720 $query += [
'search_ref' => $search_ref];
722if ($search_civility) {
723 $query += [
'search_civility' => $search_civility];
725if ($search_firstname) {
726 $query += [
'search_firstname' => $search_firstname];
728if ($search_lastname) {
729 $query += [
'search_lastname' => $search_lastname];
732 $query += [
'search_gender' => $search_gender];
734if ($search_morphy !=
'' && $search_morphy !=
'-1') {
735 $query += [
'search_morphy' => $search_morphy];
738 $query += [
'search_login' => $search_login];
741 $query += [
'search_email' => $search_email];
743if ($search_no_email != -1) {
744 $query += [
'search_no_email' => $search_no_email];
746if ($search_categ > 0 || $search_categ == -2) {
747 $query += [
'search_categ' => $search_categ];
749if ($search_company) {
750 $query += [
'search_company' => $search_company];
752if ($search_address !=
'') {
753 $query += [
'search_address' => $search_address];
755if ($search_town !=
'') {
756 $query += [
'search_town' => $search_town];
758if ($search_zip !=
'') {
759 $query += [
'search_zip' => $search_zip];
761if ($search_state !=
'') {
762 $query += [
'search_state' => $search_state];
764if ($search_country !=
'') {
765 $query += [
'search_country' => $search_country];
767if ($search_phone !=
'') {
768 $query += [
'search_phone' => $search_phone];
770if ($search_phone_perso !=
'') {
771 $query += [
'search_phone_perso' => $search_phone_perso];
773if ($search_phone_mobile !=
'') {
774 $query += [
'search_phone_mobile' => $search_phone_mobile];
776if ($search_filter && $search_filter !=
'-1') {
777 $query += [
'search_filter' => $search_filter];
779if ($search_status !=
"" && $search_status != -3) {
780 $query += [
'search_status' => $search_status];
782if ($search_import_key !=
'') {
783 $query += [
'search_import_key' => $search_import_key];
785if ($search_type > 0) {
786 $query += [
'search_type' => $search_type];
788if ($search_amount !=
'') {
789 $query += [
'search_amount' => $search_amount];
791if ($search_minimumamount !=
'') {
792 $query += [
'search_minimumamount' => $search_minimumamount];
794if ($search_datec_start) {
796 'search_datec_start_day' =>
dol_print_date($search_datec_start,
'%d'),
797 'search_datec_start_month' =>
dol_print_date($search_datec_start,
'%m'),
798 'search_datec_start_year' =>
dol_print_date($search_datec_start,
'%Y'),
801if ($search_datem_end) {
803 'search_datem_end_day' =>
dol_print_date($search_datem_end,
'%d'),
804 'search_datem_end_month' =>
dol_print_date($search_datem_end,
'%m'),
805 'search_datem_end_year' =>
dol_print_date($search_datem_end,
'%Y'),
810include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
813$parameters = array(
'query' => &$query);
814$reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object, $action);
817$param = http_build_query($query);
820$arrayofmassactions = array(
824if ($user->hasRight(
'adherent',
'creer')) {
825 $arrayofmassactions[
'close'] = img_picto(
'',
'close_title',
'class="pictofixedwidth"').$langs->trans(
"Resiliate");
827if ($user->hasRight(
'adherent',
'supprimer')) {
828 $arrayofmassactions[
'predelete'] = img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
830if (
isModEnabled(
'category') && $user->hasRight(
'adherent',
'creer')) {
831 $arrayofmassactions[
'preaffecttag'] = img_picto(
'',
'category',
'class="pictofixedwidth"').$langs->trans(
"AffectTag");
833if ($user->hasRight(
'adherent',
'creer') && $user->hasRight(
'user',
'user',
'creer')) {
834 $arrayofmassactions[
'createexternaluser'] = img_picto(
'',
'user',
'class="pictofixedwidth"').$langs->trans(
"CreateExternalUser");
836if ($user->hasRight(
'adherent',
'creer')) {
837 $arrayofmassactions[
'createsubscription'] = img_picto(
'',
'payment',
'class="pictofixedwidth"').$langs->trans(
"CreateSubscription");
839if (
GETPOSTINT(
'nomassaction') || in_array($massaction, array(
'presend',
'predelete',
'preaffecttag'))) {
840 $arrayofmassactions = array();
842$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
844print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
845if ($optioncss !=
'') {
846 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
848print
'<input type="hidden" name="token" value="'.newToken().
'">';
849print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
850print
'<input type="hidden" name="action" value="list">';
851print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
852print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
853print
'<input type="hidden" name="page" value="'.$page.
'">';
854print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
855print
'<input type="hidden" name="page_y" value="">';
856print
'<input type="hidden" name="mode" value="'.$mode.
'">';
859$argsforbutton = $query;
860$argsforbutton[
'mode'] =
'common';
861$newcardbutton .=
dolGetButtonTitle($langs->trans(
'ViewList'),
'',
'fa fa-bars imgforviewmode',
dolBuildUrl($_SERVER[
"PHP_SELF"], $argsforbutton),
'', ((empty($mode) || $mode ==
'common') ? 2 : 1), array(
'morecss' =>
'reposition'));
862$argsforbutton[
'mode'] =
'kanban';
863$newcardbutton .=
dolGetButtonTitle($langs->trans(
'ViewKanban'),
'',
'fa fa-th-list imgforviewmode',
dolBuildUrl($_SERVER[
"PHP_SELF"], $argsforbutton),
'', ($mode ==
'kanban' ? 2 : 1), array(
'morecss' =>
'reposition'));
864$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'));
866$newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewMember'),
'',
'fa fa-plus-circle',
dolBuildUrl(DOL_URL_ROOT.
'/adherents/card.php', [
'action' =>
'create']),
'', $user->hasRight(
'adherent',
'creer'));
868print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
$object->picto, 0, $newcardbutton,
'', $limit, 0, 0, 1);
871$topicmail =
"Information";
872$modelmail =
"member";
874$trackid =
'mem'.$object->id;
875if ($massaction ==
'createsubscription') {
879 foreach ($toselect as
$id) {
881 $tmpmember->fetch(
$id);
882 $res = $adht->fetch($tmpmember->typeid);
884 $amounttmp = $adht->amount;
885 if (!empty($tmpmember->last_subscription_amount) && !
GETPOSTISSET(
'newamount') && is_numeric($amounttmp)) {
886 $amounttmp = max($tmpmember->last_subscription_amount, $amount);
888 $amount = max(0, $amounttmp, $amount);
895 $formquestion = array(
896 array(
'label' => $langs->trans(
"DateSubscription"),
'type' =>
'other',
'value' => $date),
897 array(
'label' => $langs->trans(
"Amount"),
'type' =>
'text',
'value' =>
price($amount, 0,
'', 0),
'name' =>
'amount'),
898 array(
'label' => $langs->trans(
"Label"),
'type' =>
'text',
'value' =>
'',
'name' =>
'label'),
899 array(
'type' =>
'separator'),
900 array(
'label' => $langs->trans(
"MoreActions"),
'type' =>
'other',
'value' => $langs->trans(
"None").
' '.img_warning($langs->trans(
"WarningNoComplementaryActionDone"))),
902 print $form->formconfirm($_SERVER[
"PHP_SELF"], $langs->trans(
"ConfirmMassSubsriptionCreation"), $langs->trans(
"ConfirmMassSubsriptionCreationQuestion", count($toselect)),
"createsubscription_confirm", $formquestion,
'', 0, 200, 500, 1);
904include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
908 foreach ($fieldstosearchall as $key => $val) {
909 $fieldstosearchall[$key] = $langs->trans($val);
910 $setupstring .= $key.
"=".$val.
";";
912 print
'<!-- Search done like if MYOBJECT_QUICKSEARCH_ON_FIELDS = '.$setupstring.
' -->'.
"\n";
913 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).implode(
', ', $fieldstosearchall).
'</div>'.
"\n";
916$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
917$htmlofselectarray = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
$conf->main_checkbox_left_column);
918$selectedfields = ($mode !=
'kanban' ? $htmlofselectarray :
'');
919$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
923if (
isModEnabled(
'category') && $user->hasRight(
'categorie',
'lire')) {
924 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
925 $moreforfilter .=
'<div class="divsearchfield">';
926 $moreforfilter .= img_picto($langs->trans(
'Categories'),
'category',
'class="pictofixedwidth"').$formother->select_categories(Categorie::TYPE_MEMBER, $search_categ,
'search_categ', 1, $langs->trans(
"MembersCategoriesShort"));
927 $moreforfilter .=
'</div>';
930 'arrayfields' => &$arrayfields,
932$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
933if (empty($reshook)) {
934 $moreforfilter .= $hookmanager->resPrint;
936 $moreforfilter = $hookmanager->resPrint;
938if (!empty($moreforfilter)) {
939 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
940 print $moreforfilter;
944print
'<div class="div-table-responsive">';
945print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
949print
'<tr class="liste_titre_filter">';
952if (
$conf->main_checkbox_left_column) {
953 print
'<td class="liste_titre center maxwidthsearch">';
954 $searchpicto = $form->showFilterButtons(
'left');
960if (!empty($arrayfields[
'd.rowid'][
'checked'])) {
961 print
'<td class="liste_titre center">';
962 print
'<input class="width50" type="text" name="search_id" value="'.dol_escape_htmltag($search_id).
'">';
967if (!empty($arrayfields[
'd.ref'][
'checked'])) {
968 print
'<td class="liste_titre">';
969 print
'<input type="text" class="flat maxwidth75imp" name="search_ref" value="'.dol_escape_htmltag($search_ref).
'">';
974if (!empty($arrayfields[
'd.civility'][
'checked'])) {
975 print
'<td class="liste_titre left">';
976 print
'<input class="flat maxwidth50imp" type="text" name="search_civility" value="'.dol_escape_htmltag($search_civility).
'"></td>';
980if (!empty($arrayfields[
'd.lastname'][
'checked'])) {
981 print
'<td class="liste_titre left">';
982 print
'<input class="flat maxwidth75imp" type="text" name="search_lastname" value="'.dol_escape_htmltag($search_lastname).
'"></td>';
986if (!empty($arrayfields[
'd.firstname'][
'checked'])) {
987 print
'<td class="liste_titre left">';
988 print
'<input class="flat maxwidth75imp" type="text" name="search_firstname" value="'.dol_escape_htmltag($search_firstname).
'"></td>';
992if (!empty($arrayfields[
'd.gender'][
'checked'])) {
993 print
'<td class="liste_titre">';
994 $arraygender = array(
'man' => $langs->trans(
"Genderman"),
'woman' => $langs->trans(
"Genderwoman"),
'other' => $langs->trans(
"Genderother"));
995 print $form->selectarray(
'search_gender', $arraygender, $search_gender, 1);
1000if (!empty($arrayfields[
'd.societe'][
'checked'])) {
1001 print
'<td class="liste_titre left">';
1002 print
'<input class="flat maxwidth75imp" type="text" name="search_company" value="'.dol_escape_htmltag($search_company).
'"></td>';
1006if (!empty($arrayfields[
'd.login'][
'checked'])) {
1007 print
'<td class="liste_titre left">';
1008 print
'<input class="flat maxwidth75imp" type="text" name="search_login" value="'.dol_escape_htmltag($search_login).
'"></td>';
1012if (!empty($arrayfields[
'd.morphy'][
'checked'])) {
1013 print
'<td class="liste_titre center">';
1014 $arraymorphy = array(
'mor' => $langs->trans(
"Moral"),
'phy' => $langs->trans(
"Physical"));
1015 print $form->selectarray(
'search_morphy', $arraymorphy, $search_morphy, 1, 0, 0,
'', 0, 0, 0,
'',
'maxwidth100');
1020if (!empty($arrayfields[
't.libelle'][
'checked'])) {
1021 print
'<td class="liste_titre">';
1022 $listetype = $membertypestatic->liste_array();
1024 print $form->selectarray(
"search_type", $listetype, $search_type, 1, 0, 0,
'', 0, 32, 0,
'',
'minwidth75 maxwidth100');
1029if (!empty($arrayfields[
't.amount'][
'checked'])) {
1030 print
'<td class="liste_titre">';
1031 print
'<input class="flat" type="text" size="4" name="search_amount" value="'.dol_escape_htmltag($search_amount).
'">';
1036if (!empty($arrayfields[
't.minimumamount'][
'checked'])) {
1037 print
'<td class="liste_titre">';
1038 print
'<input class="flat" type="text" size="4" name="search_minimumamount" value="'.dol_escape_htmltag($search_minimumamount).
'">';
1043if (!empty($arrayfields[
'd.address'][
'checked'])) {
1044 print
'<td class="liste_titre left">';
1045 print
'<input class="flat maxwidth75imp" type="text" name="search_address" value="'.dol_escape_htmltag($search_address).
'"></td>';
1049if (!empty($arrayfields[
'd.zip'][
'checked'])) {
1050 print
'<td class="liste_titre left">';
1051 print
'<input class="flat maxwidth50imp" type="text" name="search_zip" value="'.dol_escape_htmltag($search_zip).
'"></td>';
1055if (!empty($arrayfields[
'd.town'][
'checked'])) {
1056 print
'<td class="liste_titre left">';
1057 print
'<input class="flat maxwidth75imp" type="text" name="search_town" value="'.dol_escape_htmltag($search_town).
'"></td>';
1061if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1062 print
'<td class="liste_titre">';
1063 print
'<input class="flat searchstring maxwidth75imp" type="text" name="search_state" value="'.dol_escape_htmltag($search_state).
'">';
1068if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1069 print
'<td class="liste_titre center">';
1070 print $form->select_country($search_country,
'search_country',
'', 0,
'minwidth100imp maxwidth100');
1075if (!empty($arrayfields[
'd.phone'][
'checked'])) {
1076 print
'<td class="liste_titre left">';
1077 print
'<input class="flat maxwidth75imp" type="text" name="search_phone" value="'.dol_escape_htmltag($search_phone).
'"></td>';
1081if (!empty($arrayfields[
'd.phone_perso'][
'checked'])) {
1082 print
'<td class="liste_titre left">';
1083 print
'<input class="flat maxwidth75imp" type="text" name="search_phone_perso" value="'.dol_escape_htmltag($search_phone_perso).
'"></td>';
1087if (!empty($arrayfields[
'd.phone_mobile'][
'checked'])) {
1088 print
'<td class="liste_titre left">';
1089 print
'<input class="flat maxwidth75imp" type="text" name="search_phone_mobile" value="'.dol_escape_htmltag($search_phone_mobile).
'"></td>';
1093if (!empty($arrayfields[
'd.email'][
'checked'])) {
1094 print
'<td class="liste_titre left">';
1095 print
'<input class="flat maxwidth75imp" type="text" name="search_email" value="'.dol_escape_htmltag($search_email).
'"></td>';
1099if (!empty($arrayfields[
'unsubscribed'][
'checked'])) {
1100 print
'<td class="liste_titre center">';
1101 print $form->selectarray(
'search_no_email', array(
'-1' =>
'',
'0' => $langs->trans(
'No'),
'1' => $langs->trans(
'Yes')), $search_no_email);
1106include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
1109$parameters = array(
'arrayfields' => $arrayfields);
1110$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters);
1111print $hookmanager->resPrint;
1114if (!empty($arrayfields[
'd.datec'][
'checked'])) {
1115 print
'<td class="liste_titre center">';
1116 print
'<div class="nowrapfordate">';
1117 print $form->selectDate($search_datec_start ? $search_datec_start : -1,
'search_datec_start_', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1119 print
'<div class="nowrapfordate">';
1120 print $form->selectDate($search_datec_end ? $search_datec_end : -1,
'search_datec_end_', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
1126if (!empty($arrayfields[
'd.birth'][
'checked'])) {
1127 print
'<td class="liste_titre">';
1132if (!empty($arrayfields[
'd.tms'][
'checked'])) {
1133 print
'<td class="liste_titre">';
1134 print
'<div class="nowrapfordate">';
1135 print $form->selectDate($search_datem_start ? $search_datem_start : -1,
'search_datem_start_', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1137 print
'<div class="nowrapfordate">';
1138 print $form->selectDate($search_datem_end ? $search_datem_end : -1,
'search_datem_end_', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
1144if (!empty($arrayfields[
'd.import_key'][
'checked'])) {
1145 print
'<td class="liste_titre center">';
1146 print
'<input class="flat searchstring maxwidth50" type="text" name="search_import_key" value="'.dol_escape_htmltag($search_import_key).
'">';
1151if (!empty($arrayfields[
'd.datefin'][
'checked'])) {
1152 print
'<td class="liste_titre center">';
1154 $selectarray = array(
'-1' =>
'',
'waitingsubscription' => $langs->trans(
"WaitingSubscription"),
'uptodate' => $langs->trans(
"UpToDate"),
'outofdate' => $langs->trans(
"OutOfDate"));
1155 print $form->selectarray(
'search_filter', $selectarray, $search_filter);
1160if (!empty($arrayfields[
'd.statut'][
'checked'])) {
1161 print
'<td class="liste_titre center parentonrightofpage">';
1162 $liststatus = array(
1169 print $form->selectarray(
'search_status', $liststatus, $search_status, -3, 0, 0,
'', 0, 0, 0,
'',
'search_status width100 onrightofpage');
1174if (!
$conf->main_checkbox_left_column) {
1175 print
'<td class="liste_titre center maxwidthsearch">';
1176 $searchpicto = $form->showFilterButtons();
1182$totalarray = array();
1183$totalarray[
'nbfield'] = 0;
1187print
'<tr class="liste_titre">';
1189if (
$conf->main_checkbox_left_column) {
1190 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch actioncolumn ');
1191 $totalarray[
'nbfield']++;
1193if (!empty($arrayfields[
'd.rowid'][
'checked'])) {
1195 print_liste_field_titre($arrayfields[
'd.rowid'][
'label'], $_SERVER[
"PHP_SELF"],
'd.rowid',
'', $param,
'', $sortfield, $sortorder,
'center ');
1196 $totalarray[
'nbfield']++;
1198if (!empty($arrayfields[
'd.ref'][
'checked'])) {
1199 print_liste_field_titre($arrayfields[
'd.ref'][
'label'], $_SERVER[
"PHP_SELF"],
'd.ref',
'', $param,
'', $sortfield, $sortorder);
1200 $totalarray[
'nbfield']++;
1202if (!empty($arrayfields[
'd.civility'][
'checked'])) {
1203 print_liste_field_titre($arrayfields[
'd.civility'][
'label'], $_SERVER[
"PHP_SELF"],
'd.civility',
'', $param,
'', $sortfield, $sortorder);
1204 $totalarray[
'nbfield']++;
1206if (!empty($arrayfields[
'd.lastname'][
'checked'])) {
1207 print_liste_field_titre($arrayfields[
'd.lastname'][
'label'], $_SERVER[
"PHP_SELF"],
'd.lastname',
'', $param,
'', $sortfield, $sortorder);
1208 $totalarray[
'nbfield']++;
1210if (!empty($arrayfields[
'd.firstname'][
'checked'])) {
1211 print_liste_field_titre($arrayfields[
'd.firstname'][
'label'], $_SERVER[
"PHP_SELF"],
'd.firstname',
'', $param,
'', $sortfield, $sortorder);
1212 $totalarray[
'nbfield']++;
1214if (!empty($arrayfields[
'd.gender'][
'checked'])) {
1215 print_liste_field_titre($arrayfields[
'd.gender'][
'label'], $_SERVER[
'PHP_SELF'],
'd.gender',
'', $param,
'', $sortfield, $sortorder);
1216 $totalarray[
'nbfield']++;
1218if (!empty($arrayfields[
'd.societe'][
'checked'])) {
1219 print_liste_field_titre($arrayfields[
'd.societe'][
'label'], $_SERVER[
"PHP_SELF"],
'companyname',
'', $param,
'', $sortfield, $sortorder);
1220 $totalarray[
'nbfield']++;
1222if (!empty($arrayfields[
'd.login'][
'checked'])) {
1223 print_liste_field_titre($arrayfields[
'd.login'][
'label'], $_SERVER[
"PHP_SELF"],
'd.login',
'', $param,
'', $sortfield, $sortorder);
1224 $totalarray[
'nbfield']++;
1226if (!empty($arrayfields[
'd.morphy'][
'checked'])) {
1227 print_liste_field_titre($arrayfields[
'd.morphy'][
'label'], $_SERVER[
"PHP_SELF"],
'd.morphy',
'', $param,
'', $sortfield, $sortorder,
'center ');
1228 $totalarray[
'nbfield']++;
1230if (!empty($arrayfields[
't.libelle'][
'checked'])) {
1231 print_liste_field_titre($arrayfields[
't.libelle'][
'label'], $_SERVER[
"PHP_SELF"],
't.libelle',
'', $param,
'', $sortfield, $sortorder);
1232 $totalarray[
'nbfield']++;
1234if (!empty($arrayfields[
't.amount'][
'checked'])) {
1235 print_liste_field_titre($arrayfields[
't.amount'][
'label'], $_SERVER[
"PHP_SELF"],
't.amount',
'', $param,
'', $sortfield, $sortorder);
1236 $totalarray[
'nbfield']++;
1238if (!empty($arrayfields[
't.minimumamount'][
'checked'])) {
1239 print_liste_field_titre($arrayfields[
't.minimumamount'][
'label'], $_SERVER[
"PHP_SELF"],
't.minimumamount',
'', $param,
'', $sortfield, $sortorder);
1240 $totalarray[
'nbfield']++;
1242if (!empty($arrayfields[
'd.address'][
'checked'])) {
1243 print_liste_field_titre($arrayfields[
'd.address'][
'label'], $_SERVER[
"PHP_SELF"],
'd.address',
'', $param,
'', $sortfield, $sortorder);
1244 $totalarray[
'nbfield']++;
1246if (!empty($arrayfields[
'd.zip'][
'checked'])) {
1247 print_liste_field_titre($arrayfields[
'd.zip'][
'label'], $_SERVER[
"PHP_SELF"],
'd.zip',
'', $param,
'', $sortfield, $sortorder);
1248 $totalarray[
'nbfield']++;
1250if (!empty($arrayfields[
'd.town'][
'checked'])) {
1251 print_liste_field_titre($arrayfields[
'd.town'][
'label'], $_SERVER[
"PHP_SELF"],
'd.town',
'', $param,
'', $sortfield, $sortorder);
1252 $totalarray[
'nbfield']++;
1254if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1255 print_liste_field_titre($arrayfields[
'state.nom'][
'label'], $_SERVER[
"PHP_SELF"],
"state.nom",
"", $param,
'', $sortfield, $sortorder);
1256 $totalarray[
'nbfield']++;
1258if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1259 print_liste_field_titre($arrayfields[
'country.code_iso'][
'label'], $_SERVER[
"PHP_SELF"],
"country.code_iso",
"", $param,
'', $sortfield, $sortorder,
'center ');
1260 $totalarray[
'nbfield']++;
1262if (!empty($arrayfields[
'd.phone'][
'checked'])) {
1263 print_liste_field_titre($arrayfields[
'd.phone'][
'label'], $_SERVER[
"PHP_SELF"],
'd.phone',
'', $param,
'', $sortfield, $sortorder);
1264 $totalarray[
'nbfield']++;
1266if (!empty($arrayfields[
'd.phone_perso'][
'checked'])) {
1267 print_liste_field_titre($arrayfields[
'd.phone_perso'][
'label'], $_SERVER[
"PHP_SELF"],
'd.phone_perso',
'', $param,
'', $sortfield, $sortorder);
1268 $totalarray[
'nbfield']++;
1270if (!empty($arrayfields[
'd.phone_mobile'][
'checked'])) {
1271 print_liste_field_titre($arrayfields[
'd.phone_mobile'][
'label'], $_SERVER[
"PHP_SELF"],
'd.phone_mobile',
'', $param,
'', $sortfield, $sortorder);
1272 $totalarray[
'nbfield']++;
1274if (!empty($arrayfields[
'd.email'][
'checked'])) {
1275 print_liste_field_titre($arrayfields[
'd.email'][
'label'], $_SERVER[
"PHP_SELF"],
'd.email',
'', $param,
'', $sortfield, $sortorder);
1276 $totalarray[
'nbfield']++;
1278if (!empty($arrayfields[
'unsubscribed'][
'checked'])) {
1279 print_liste_field_titre($arrayfields[
'unsubscribed'][
'label'], $_SERVER[
"PHP_SELF"],
'unsubscribed',
'', $param,
'', $sortfield, $sortorder,
'center ');
1280 $totalarray[
'nbfield']++;
1283include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
1286$parameters = array(
'arrayfields' => $arrayfields,
'totalarray' => &$totalarray,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder);
1287$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters);
1288print $hookmanager->resPrint;
1290if (!empty($arrayfields[
'd.datec'][
'checked'])) {
1291 print_liste_field_titre($arrayfields[
'd.datec'][
'label'], $_SERVER[
"PHP_SELF"],
"d.datec",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1292 $totalarray[
'nbfield']++;
1294if (!empty($arrayfields[
'd.birth'][
'checked'])) {
1295 print_liste_field_titre($arrayfields[
'd.birth'][
'label'], $_SERVER[
"PHP_SELF"],
"d.birth",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1296 $totalarray[
'nbfield']++;
1298if (!empty($arrayfields[
'd.tms'][
'checked'])) {
1299 print_liste_field_titre($arrayfields[
'd.tms'][
'label'], $_SERVER[
"PHP_SELF"],
"d.tms",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1300 $totalarray[
'nbfield']++;
1302if (!empty($arrayfields[
'd.import_key'][
'checked'])) {
1303 print_liste_field_titre($arrayfields[
'd.import_key'][
'label'], $_SERVER[
"PHP_SELF"],
"d.import_key",
"", $param,
'', $sortfield, $sortorder,
'center ');
1304 $totalarray[
'nbfield']++;
1306if (!empty($arrayfields[
'd.datefin'][
'checked'])) {
1307 print_liste_field_titre($arrayfields[
'd.datefin'][
'label'], $_SERVER[
"PHP_SELF"],
'd.datefin,t.subscription',
'', $param,
'', $sortfield, $sortorder,
'center ');
1308 $totalarray[
'nbfield']++;
1310if (!empty($arrayfields[
'd.statut'][
'checked'])) {
1311 print_liste_field_titre($arrayfields[
'd.statut'][
'label'], $_SERVER[
"PHP_SELF"],
"d.statut,t.subscription,d.datefin",
"", $param,
'', $sortfield, $sortorder,
'center ');
1312 $totalarray[
'nbfield']++;
1314if (!
$conf->main_checkbox_left_column) {
1315 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'maxwidthsearch center ');
1316 $totalarray[
'nbfield']++;
1323$savnbfield = $totalarray[
'nbfield'];
1324$totalarray = array();
1325$totalarray[
'nbfield'] = 0;
1326$imaxinloop = ($limit ? min($num, $limit) : $num);
1327while ($i < $imaxinloop) {
1328 $obj = $db->fetch_object($resql);
1333 $datefin = $db->jdate($obj->datefin);
1335 $memberstatic->id = $obj->rowid;
1336 $memberstatic->ref = $obj->ref;
1337 $memberstatic->civility_code = $obj->civility;
1338 $memberstatic->login = $obj->login;
1339 $memberstatic->lastname = $obj->lastname;
1340 $memberstatic->firstname = $obj->firstname;
1341 $memberstatic->gender = $obj->gender;
1342 $memberstatic->status = $obj->status;
1343 $memberstatic->datefin = $datefin;
1344 $memberstatic->socid = $obj->socid;
1345 $memberstatic->photo = $obj->photo;
1346 $memberstatic->email = $obj->email;
1347 $memberstatic->morphy = $obj->morphy;
1348 $memberstatic->note_public = $obj->note_public;
1349 $memberstatic->note_private = $obj->note_private;
1350 $memberstatic->need_subscription = $obj->subscription;
1352 if (!empty($obj->socid)) {
1353 $memberstatic->fetch_thirdparty();
1354 if ($memberstatic->thirdparty->id > 0) {
1355 $companyname = $memberstatic->thirdparty->name;
1356 $companynametoshow = $memberstatic->thirdparty->getNomUrl(1);
1358 $companyname =
null;
1359 $companynametoshow =
null;
1362 $companyname = $obj->company;
1363 $companynametoshow = $obj->company;
1365 $memberstatic->company = (string) $companyname;
1369 if ($mode ==
'kanban') {
1371 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
1372 print
'<div class="box-flex-container kanban">';
1374 $membertypestatic->id = $obj->type_id;
1375 $membertypestatic->label = $obj->type;
1377 $memberstatic->type = $membertypestatic->label;
1378 $memberstatic->photo = $obj->photo;
1381 print $memberstatic->getKanbanView(
'', array(
'selected' => in_array(
$object->id, $arrayofselected)));
1382 if ($i == (min($num, $limit) - 1)) {
1389 print
'<tr data-rowid="'.$object->id.
'" class="oddeven row-with-select">';
1392 if (
$conf->main_checkbox_left_column) {
1393 print
'<td class="nowrap center">';
1394 if ($massactionbutton || $massaction) {
1396 if (in_array($obj->rowid, $arrayofselected)) {
1399 print
'<input id="cb'.$obj->rowid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1403 $totalarray[
'nbfield']++;
1407 if (!empty($arrayfields[
'd.rowid'][
'checked'])) {
1408 print
'<td class="center" data-key="id">'.dolPrintHTML($obj->rowid).
'</td>';
1410 $totalarray[
'nbfield']++;
1414 if (!empty($arrayfields[
'd.ref'][
'checked'])) {
1415 print
'<td class="tdoverflowmax150">';
1416 print $memberstatic->getNomUrl(-1, 0,
'card',
'ref',
'', -1, 0, 1);
1419 $totalarray[
'nbfield']++;
1423 if (!empty($arrayfields[
'd.civility'][
'checked'])) {
1425 print dolPrintHTML($obj->civility);
1428 $totalarray[
'nbfield']++;
1432 if (!empty($arrayfields[
'd.lastname'][
'checked'])) {
1433 print
'<td class="tdoverflowmax125">';
1434 print $memberstatic->getNomUrl(0, 0,
'card',
'lastname');
1438 $totalarray[
'nbfield']++;
1442 if (!empty($arrayfields[
'd.firstname'][
'checked'])) {
1443 print
'<td class="tdoverflowmax125">';
1444 print $memberstatic->getNomUrl(0, 0,
'card',
'firstname');
1448 $totalarray[
'nbfield']++;
1452 if (!empty($arrayfields[
'd.gender'][
'checked'])) {
1455 print $langs->trans(
"Gender".$obj->gender);
1459 $totalarray[
'nbfield']++;
1463 if (!empty($arrayfields[
'd.societe'][
'checked'])) {
1464 print
'<td class="tdoverflowmax125">';
1465 print $companynametoshow;
1469 if (!empty($arrayfields[
'd.login'][
'checked'])) {
1470 print
'<td class="tdoverflowmax125" title="'.dolPrintHTMLForAttribute($obj->login).
'">'.dolPrintHTML($obj->login).
"</td>\n";
1472 $totalarray[
'nbfield']++;
1476 if (!empty($arrayfields[
'd.morphy'][
'checked'])) {
1477 print
'<td class="center">';
1478 print $memberstatic->getmorphylib(
'', 2);
1481 $totalarray[
'nbfield']++;
1485 if (!empty($arrayfields[
't.libelle'][
'checked'])) {
1486 $membertypestatic->id = $obj->type_id;
1487 $membertypestatic->label = $obj->type;
1488 print
'<td class="nowraponall tdoverflowmax100">';
1489 print $membertypestatic->getNomUrl(1, 32);
1492 $totalarray[
'nbfield']++;
1496 if (!empty($arrayfields[
't.amount'][
'checked'])) {
1497 print
'<td class="nowraponall tdoverflowmax100">';
1498 print
price($obj->amount);
1501 $totalarray[
'nbfield']++;
1505 if (!empty($arrayfields[
't.minimumamount'][
'checked'])) {
1506 print
'<td class="nowraponall tdoverflowmax100">';
1507 print
price($obj->minimumamount);
1510 $totalarray[
'nbfield']++;
1514 if (!empty($arrayfields[
'd.address'][
'checked'])) {
1515 print
'<td class="nocellnopadd tdoverflowmax200" title="'.dol_escape_htmltag($obj->address).
'">';
1516 print dolPrintHTML($obj->address);
1519 $totalarray[
'nbfield']++;
1523 if (!empty($arrayfields[
'd.zip'][
'checked'])) {
1524 print
'<td class="nocellnopadd">';
1525 print dolPrintHTML($obj->zip);
1528 $totalarray[
'nbfield']++;
1532 if (!empty($arrayfields[
'd.town'][
'checked'])) {
1533 print
'<td class="nocellnopadd">';
1534 print dolPrintHTML($obj->town);
1537 $totalarray[
'nbfield']++;
1541 if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1543 print dolPrintHTML($obj->state_name);
1546 $totalarray[
'nbfield']++;
1550 if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1551 $tmparray =
getCountry($obj->country,
'all');
1552 print
'<td class="center tdoverflowmax100" title="'.dolPrintHTMLForAttribute($tmparray[
'label']).
'">';
1553 print dolPrintHTML($tmparray[
'label']);
1556 $totalarray[
'nbfield']++;
1560 if (!empty($arrayfields[
'd.phone'][
'checked'])) {
1561 print
'<td class="nocellnopadd">';
1565 $totalarray[
'nbfield']++;
1569 if (!empty($arrayfields[
'd.phone_perso'][
'checked'])) {
1570 print
'<td class="nocellnopadd">';
1574 $totalarray[
'nbfield']++;
1578 if (!empty($arrayfields[
'd.phone_mobile'][
'checked'])) {
1579 print
'<td class="nocellnopadd">';
1583 $totalarray[
'nbfield']++;
1587 if (!empty($arrayfields[
'd.email'][
'checked'])) {
1588 print
'<td class="tdoverflowmax150" title="'.dolPrintHTMLForAttribute((
string) $obj->email).
'">';
1589 $showinvalidemail =
getDolGlobalInt(
'MAIN_SHOW_INVALID_EMAIL_IN_LIST', 1);
1590 print
dol_print_email((
string) $obj->email, 0, 0, 1, 64, $showinvalidemail, 1);
1593 $totalarray[
'nbfield']++;
1597 if (!empty($arrayfields[
'unsubscribed'][
'checked'])) {
1598 print
'<td class="center">'.yn(($obj->unsubscribed > 0) ? 1 : 0).
"</td>\n";
1600 $totalarray[
'nbfield']++;
1604 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
1606 $parameters = array(
'arrayfields' => $arrayfields,
'obj' => $obj,
'i' => $i,
'totalarray' => &$totalarray);
1607 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters);
1608 print $hookmanager->resPrint;
1610 if (!empty($arrayfields[
'd.datec'][
'checked'])) {
1611 print
'<td class="nowrap center">';
1612 print
dol_print_date($db->jdate($obj->date_creation),
'dayhour',
'tzuser');
1615 $totalarray[
'nbfield']++;
1619 if (!empty($arrayfields[
'd.birth'][
'checked'])) {
1620 print
'<td class="nowrap center">';
1624 $totalarray[
'nbfield']++;
1628 if (!empty($arrayfields[
'd.tms'][
'checked'])) {
1629 print
'<td class="nowrap center">';
1630 print
dol_print_date($db->jdate($obj->date_modification),
'dayhour',
'tzuser');
1633 $totalarray[
'nbfield']++;
1637 if (!empty($arrayfields[
'd.import_key'][
'checked'])) {
1638 print
'<td class="tdoverflowmax100 center" title="'.dolPrintHTMLForAttribute($obj->import_key).
'">';
1639 print dolPrintHTML($obj->import_key);
1642 $totalarray[
'nbfield']++;
1646 $datefin = $db->jdate($obj->datefin);
1647 if (!empty($arrayfields[
'd.datefin'][
'checked'])) {
1651 if ($memberstatic->hasDelay()) {
1652 $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").
')';
1653 $s .=
" ".img_warning($langs->trans(
"SubscriptionLate").$textlate);
1656 if (!empty($obj->subscription)) {
1657 $s .=
'<span class="opacitymedium">'.$langs->trans(
"SubscriptionNotReceived").
'</span>';
1658 if ($obj->status > 0) {
1659 $s .=
" ".img_warning();
1662 $s .=
'<span class="opacitymedium">'.$langs->trans(
"SubscriptionNotNeeded").
'</span>';
1665 print
'<td class="nowraponall center tdoverflowmax150" title="'.dolPrintHTMLForAttribute(
dol_string_nohtmltag($s)).
'">';
1669 $totalarray[
'nbfield']++;
1673 if (!empty($arrayfields[
'd.statut'][
'checked'])) {
1674 print
'<td class="nowrap center">';
1675 print $memberstatic->LibStatut($obj->status, $obj->subscription, $datefin, 5);
1678 $totalarray[
'nbfield']++;
1682 if (!
$conf->main_checkbox_left_column) {
1683 print
'<td class="center">';
1684 if ($massactionbutton || $massaction) {
1686 if (in_array($obj->rowid, $arrayofselected)) {
1689 print
'<input id="cb'.$obj->rowid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1693 $totalarray[
'nbfield']++;
1703include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
1709 foreach ($arrayfields as $key => $val) {
1710 if (!empty($val[
'checked'])) {
1714 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
1719$parameters = array(
'arrayfields' => $arrayfields,
'sql' => $sql);
1720$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
1721print $hookmanager->resPrint;
1723print
'</table>'.
"\n";
1726print
'</form>'.
"\n";
1728if (in_array(
'builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords ===
'' || $nbtotalofrecords)) {
1729 $hidegeneratedfilelistifempty = 1;
1730 if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
1731 $hidegeneratedfilelistifempty = 0;
1734 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
1738 $urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
1739 $urlsource .= str_replace(
'&',
'&', $param);
1741 $filedir = $diroutputmassaction;
1742 $genallowed = $permissiontoread;
1743 $delallowed = $permissiontoadd;
1745 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.
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_time_plus_duree($time, $duration_value, $duration_unit, $ruleforendofmonth=0)
Add a delay to a date.
dol_get_last_day($year, $month=12, $gm=false)
Return GMT time for last day of a month or year.
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.
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.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
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.
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.