34require
'../main.inc.php';
43require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
44require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent_type.class.php';
45require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
46require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
49$langs->loadLangs(array(
"members",
"companies",
"categories"));
52$action =
GETPOST(
'action',
'aZ09');
53$massaction =
GETPOST(
'massaction',
'alpha');
55$confirm =
GETPOST(
'confirm',
'alpha');
56$cancel =
GETPOST(
'cancel',
'alpha');
57$toselect =
GETPOST(
'toselect',
'array:int');
58$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'memberslist';
59$backtopage =
GETPOST(
'backtopage',
'alpha');
60$optioncss =
GETPOST(
'optioncss',
'aZ');
61$mode =
GETPOST(
'mode',
'alpha');
62$groupby =
GETPOST(
'groupby',
'aZ09');
65$search =
GETPOST(
"search",
'alpha');
66$search_id =
GETPOST(
'search_id',
'int');
67$search_ref =
GETPOST(
"search_ref",
'alpha');
68$search_lastname =
GETPOST(
"search_lastname",
'alpha');
69$search_firstname =
GETPOST(
"search_firstname",
'alpha');
70$search_gender =
GETPOST(
"search_gender",
'alpha');
71$search_civility =
GETPOST(
"search_civility",
'alpha');
72$search_company =
GETPOST(
'search_company',
'alphanohtml');
73$search_login =
GETPOST(
"search_login",
'alpha');
74$search_address =
GETPOST(
"search_address",
'alpha');
75$search_zip =
GETPOST(
"search_zip",
'alpha');
76$search_town =
GETPOST(
"search_town",
'alpha');
77$search_state =
GETPOST(
"search_state",
'alpha');
78$search_country =
GETPOST(
"search_country",
'alpha');
79$search_phone =
GETPOST(
"search_phone",
'alpha');
80$search_phone_perso =
GETPOST(
"search_phone_perso",
'alpha');
81$search_phone_mobile =
GETPOST(
"search_phone_mobile",
'alpha');
82$search_type =
GETPOST(
"search_type",
'alpha');
83$search_email =
GETPOST(
"search_email",
'alpha');
85 $search_no_email = GETPOSTISSET(
"search_no_email") ?
GETPOSTINT(
"search_no_email") : -1;
87 $search_no_email = -1;
89$search_categ =
GETPOST(
"search_categ",
'intcomma');
90$search_morphy =
GETPOST(
"search_morphy",
'alpha');
91$search_import_key = trim(
GETPOST(
"search_import_key",
'alpha'));
94if (
GETPOSTINT(
'catid') && empty($search_categ)) {
98$search_filter =
GETPOST(
"search_filter",
'alpha');
99$search_status =
GETPOST(
"search_status",
'intcomma');
105$filter =
GETPOST(
"filter",
'alpha');
107 $search_filter = $filter;
110$statut =
GETPOST(
"statut",
'alpha');
112 $search_status = $statut;
115$search_all = trim(
GETPOST(
'search_all',
'alphanohtml'));
117if ($search_status < -2) {
123$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
124$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
126if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
130$offset = $limit * $page;
131$pageprev = $page - 1;
132$pagenext = $page + 1;
134 $sortorder = ($filter ==
'outofdate' ?
"DESC" :
"ASC");
137 $sortfield = ($filter ==
'outofdate' ?
"d.datefin" :
"d.lastname");
143$hookmanager->initHooks(array(
'memberlist'));
145$diroutputmassaction =
$conf->member->dir_output.
'/temp/massgeneration/'.$user->id;
148$extrafields->fetch_name_optionals_label(
$object->table_element);
150$search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
153$fieldstosearchall = array(
155 'd.login' =>
'Login',
156 'd.lastname' =>
'Lastname',
157 'd.firstname' =>
'Firstname',
158 'd.societe' =>
"Company",
159 'd.email' =>
'EMail',
160 'd.address' =>
'Address',
163 'd.phone' =>
"Phone",
164 'd.phone_perso' =>
"PhonePerso",
165 'd.phone_mobile' =>
"PhoneMobile",
166 'd.note_public' =>
'NotePublic',
167 'd.note_private' =>
'NotePrivate',
171 'd.rowid' => array(
'label' =>
'ID',
'checked' => 1,
'enabled' =>
getDolGlobalInt(
'MAIN_SHOW_TECHNICAL_ID'),
'position' => 1),
172 'd.ref' => array(
'label' =>
"Ref",
'checked' => 1),
173 'd.civility' => array(
'label' =>
"Civility",
'checked' => 0),
174 'd.gender' => array(
'label' =>
"Gender",
'checked' => 0),
175 'd.societe' => array(
'label' =>
"Company",
'checked' => 1,
'position' => 70),
176 'd.login' => array(
'label' =>
"Login",
'checked' => 1),
177 'd.morphy' => array(
'label' =>
"MemberNature",
'checked' => 1),
178 't.libelle' => array(
'label' =>
"MemberType",
'checked' => 1,
'position' => 55),
179 'd.address' => array(
'label' =>
"Address",
'checked' => 0),
180 'd.zip' => array(
'label' =>
"Zip",
'checked' => 0),
181 'd.town' => array(
'label' =>
"Town",
'checked' => 0),
182 'd.phone' => array(
'label' =>
"Phone",
'checked' => 0),
183 'd.phone_perso' => array(
'label' =>
"PhonePerso",
'checked' => 0),
184 'd.phone_mobile' => array(
'label' =>
"PhoneMobile",
'checked' => 0),
185 'd.email' => array(
'label' =>
"Email",
'checked' => 1),
186 'unsubscribed' => array(
'label' =>
'No_Email',
'checked' =>
'0',
'enabled' => (
string) (
int)
isModEnabled(
'mailing'),
'position' => 126),
187 'state.nom' => array(
'label' =>
"State",
'checked' => 0,
'position' => 90),
188 'country.code_iso' => array(
'label' =>
"Country",
'checked' => 0,
'position' => 95),
191 'd.datefin' => array(
'label' =>
"EndSubscription"),
192 'd.datec' => array(
'label' =>
"DateCreation"),
193 'd.birth' => array(
'label' =>
"Birthday"),
194 'd.tms' => array(
'label' =>
"DateModificationShort"),
195 'd.statut' => array(
'label' =>
"Status"),
196 'd.import_key' => array(
'label' =>
"ImportId"),
201foreach (
$object->fields as $key => $val) {
203 if (!empty($val[
'visible'])) {
205 if (in_array($key, array(
'fk_adherent_type',
'state_id',
'country'))) {
208 $visible = (int)
dol_eval((
string) $val[
'visible'], 1);
209 $arrayfields[$tableprefix.
'.'.$key] = array(
210 'label' => $val[
'label'],
211 'checked' => (($visible < 0) ?
'0' :
'1'),
212 'enabled' => (
string) (int) (abs($visible) != 3 && (bool)
dol_eval((
string) $val[
'enabled'], 1)),
213 'position' => (int) $val[
'position'],
214 'help' => isset($val[
'help']) ? $val[
'help'] :
''
220include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
234if (
GETPOST(
'cancel',
'alpha')) {
238if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
242$permissiontoread = $user->hasRight(
'adherent',
'lire');
243$permissiontodelete = $user->hasRight(
'adherent',
'supprimer');
244$permissiontoadd = $user->hasRight(
'adherent',
'creer');
245$uploaddir =
$conf->member->dir_output;
248$parameters = array(
'socid' => isset($socid) ? $socid : null,
'arrayfields' => &$arrayfields);
249$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
254if (empty($reshook)) {
256 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
259 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
266 $search_lastname =
"";
267 $search_firstname =
"";
269 $search_civility =
"";
271 $search_company =
"";
274 $search_no_email = -1;
275 $search_address =
"";
279 $search_country =
'';
281 $search_phone_perso =
'';
282 $search_phone_mobile =
'';
287 $search_import_key =
'';
290 $search_datec_start =
'';
291 $search_datec_end =
'';
292 $search_datem_start =
'';
293 $search_datem_end =
'';
294 $search_array_options = array();
298 if ($massaction ==
'close' && $user->hasRight(
'adherent',
'creer')) {
304 foreach ($toselect as $idtoclose) {
305 $tmpmember->fetch($idtoclose);
306 $result = $tmpmember->resiliate($user);
308 if ($result < 0 && !count($tmpmember->errors)) {
327 if ($massaction ==
'createexternaluser' && $user->hasRight(
'adherent',
'creer') && $user->hasRight(
'user',
'user',
'creer')) {
333 foreach ($toselect as $idtoclose) {
334 $tmpmember->fetch($idtoclose);
336 if (!empty($tmpmember->socid)) {
340 $result = $nuser->create_from_member($tmpuser, $tmpmember->login);
342 if ($result < 0 && !count($tmpmember->errors)) {
353 setEventMessages($langs->trans(
"XExternalUserCreated", $nbcreated),
null,
'mesgs');
362 if ($action ==
'createsubscription_confirm' && $confirm ==
"yes" && $user->hasRight(
'adherent',
'creer')) {
377 } elseif (
getDolGlobalInt(
'MEMBER_SUBSCRIPTION_SUGGEST_END_OF_YEAR')) {
381 foreach ($toselect as
$id) {
382 $res = $tmpmember->fetch(
$id);
388 $datesubendthismember = $datesubend;
389 if (!$datesubendthismember && $tmpmember->typeid > 0) {
390 if ($adht->fetch($tmpmember->typeid) > 0) {
391 $delay = !empty($adht->duration_value) ? $adht->duration_value : 1;
392 $delayunit = !empty($adht->duration_unit) ? $adht->duration_unit :
'y';
396 $result = $tmpmember->subscription($now, (
float) $amount, 0,
'',
'',
'',
'',
'', $datesubendthismember);
408 setEventMessages($langs->trans(
"XSubsriptionCreated", $nbcreated),
null,
'mesgs');
411 setEventMessages($langs->trans(
"XSubsriptionErrors", $error),
null,
'mesgs');
417 $objectclass =
'Adherent';
418 $objectlabel =
'Members';
419 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
435$title = $langs->trans(
"Members");
436$help_url =
'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder';
444$sql .=
" d.rowid, d.ref, d.login, d.lastname, d.firstname, d.gender, d.societe as company, d.fk_soc as socid,";
445$sql .=
" d.civility, d.datefin, d.address, d.zip, d.town, d.state_id, d.country,";
446$sql .=
" d.email, d.phone, d.phone_perso, d.phone_mobile, d.birth, d.public, d.photo,";
447$sql .=
" d.fk_adherent_type as type_id, d.morphy, d.statut as status, d.datec as date_creation, d.tms as date_modification,";
448$sql .=
" d.note_private, d.note_public, d.import_key,";
450$sql .=
" ".$db->ifsql(
"d.societe IS NULL",
"s.nom",
"d.societe").
" as companyname,";
451$sql .=
" t.libelle as type, t.subscription,";
452$sql .=
" state.code_departement as state_code, state.nom as state_name";
455 $sql .=
", (SELECT count(*) FROM ".MAIN_DB_PREFIX.
"mailing_unsubscribe WHERE email = d.email) as unsubscribed";
459if (!empty($extrafields->attributes[
$object->table_element][
'label'])) {
460 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
461 $sql .= ($extrafields->attributes[
$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
"");
466$parameters = array();
467$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object, $action);
468$sql .= $hookmanager->resPrint;
469$sql = preg_replace(
'/,\s*$/',
'', $sql);
474$sql .=
" FROM ".MAIN_DB_PREFIX.
"adherent as d";
475if (!empty($extrafields->attributes[
$object->table_element][
'label']) && count($extrafields->attributes[
$object->table_element][
'label'])) {
476 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (d.rowid = ef.fk_object)";
478$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as country on (country.rowid = d.country)";
479$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_departements as state on (state.rowid = d.state_id)";
480$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s on (s.rowid = d.fk_soc)";
483$sql .=
", ".MAIN_DB_PREFIX.
"adherent_type as t";
484$sql .=
" WHERE d.fk_adherent_type = t.rowid";
486$searchCategoryContactList = $search_categ ? array($search_categ) : array();
487$searchCategoryContactOperator = 0;
489if (!empty($searchCategoryContactList)) {
490 $searchCategoryContactSqlList = array();
491 $listofcategoryid =
'';
492 foreach ($searchCategoryContactList as $searchCategoryContact) {
493 if (intval($searchCategoryContact) == -2) {
494 $searchCategoryContactSqlList[] =
"NOT EXISTS (SELECT ck.fk_categorie FROM ".MAIN_DB_PREFIX.
"categorie_member as ck WHERE d.rowid = ck.fk_member)";
495 } elseif (intval($searchCategoryContact) > 0) {
496 if ($searchCategoryContactOperator == 0) {
497 $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).
")";
499 $listofcategoryid .= ($listofcategoryid ?
', ' :
'') .((
int) $searchCategoryContact);
503 if ($listofcategoryid) {
504 $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).
"))";
506 if ($searchCategoryContactOperator == 1) {
507 if (!empty($searchCategoryContactSqlList)) {
508 $sql .=
" AND (".implode(
' OR ', $searchCategoryContactSqlList).
")";
511 if (!empty($searchCategoryContactSqlList)) {
512 $sql .=
" AND (".implode(
' AND ', $searchCategoryContactSqlList).
")";
517$sql .=
" AND d.entity IN (".getEntity(
'adherent').
")";
519 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
521if ($search_type > 0) {
522 $sql .=
" AND t.rowid=".((int) $search_type);
524if ($search_filter ==
'withoutsubscription') {
525 $sql .=
" AND (datefin IS NULL)";
527if ($search_filter ==
'waitingsubscription') {
528 $sql .=
" AND (datefin IS NULL AND t.subscription = '1')";
530if ($search_filter ==
'uptodate') {
533 $sql .=
" AND (datefin >= '".$db->idate($now).
"' OR (datefin IS NULL AND t.subscription = '0'))";
535if ($search_filter ==
'outofdate') {
536 $sql .=
" AND (datefin < '".$db->idate($now).
"')";
538if ($search_status !=
'') {
540 $sql .=
" AND d.statut in (".$db->sanitize(
$db->escape($search_status)).
")";
542if ($search_morphy !=
'' && $search_morphy !=
'-1') {
551if ($search_civility) {
554if ($search_firstname) {
557if ($search_lastname) {
560if ($search_gender !=
'' && $search_gender !=
'-1') {
566if ($search_company) {
567 $sql .=
natural_search(array(
"s.nom",
"d.societe"), $search_company);
572if ($search_no_email != -1 && $search_no_email > 0) {
573 $sql .=
" AND (SELECT count(*) FROM ".MAIN_DB_PREFIX.
"mailing_unsubscribe WHERE email = d.email) > 0";
575if ($search_no_email != -1 && $search_no_email == 0) {
576 $sql .=
" AND (SELECT count(*) FROM ".MAIN_DB_PREFIX.
"mailing_unsubscribe WHERE email = d.email) = 0 AND d.email IS NOT NULL AND d.email <> ''";
578if ($search_address) {
593if ($search_phone_perso) {
596if ($search_phone_mobile) {
599if ($search_country) {
600 $sql .=
" AND d.country IN (".$db->sanitize($search_country).
')';
602if ($search_import_key) {
605if ($search_datec_start) {
606 $sql .=
" AND d.datec >= '".$db->idate($search_datec_start).
"'";
608if ($search_datec_end) {
609 $sql .=
" AND d.datec <= '".$db->idate($search_datec_end).
"'";
611if ($search_datem_start) {
612 $sql .=
" AND d.tms >= '".$db->idate($search_datem_start).
"'";
614if ($search_datem_end) {
615 $sql .=
" AND d.tms <= '".$db->idate($search_datem_end).
"'";
618include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
620$parameters = array();
621$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
622$sql .= $hookmanager->resPrint;
625$nbtotalofrecords =
'';
628 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
629 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
630 $resql =
$db->query($sqlforcount);
632 $objforcount =
$db->fetch_object($resql);
633 $nbtotalofrecords = $objforcount->nbtotalofrecords;
638 if (($page * $limit) > (
int) $nbtotalofrecords) {
647$sql .=
$db->order($sortfield, $sortorder);
649 $sql .=
$db->plimit($limit + 1, $offset);
652$resql =
$db->query($sql);
658$num =
$db->num_rows($resql);
662if ($num == 1 &&
getDolGlobalInt(
'MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
663 $obj =
$db->fetch_object($resql);
665 header(
"Location: ".DOL_URL_ROOT.
'/adherents/card.php?id='.
$id);
672llxHeader(
'', $title, $help_url,
'', 0, 0, $morejs, $morecss,
'',
'mod-member page-list bodyforlist');
674$arrayofselected = is_array($toselect) ? $toselect : array();
677if ($search_type > 0) {
679 $result = $membertype->fetch((
int) $search_type);
680 $title .=
" (".$membertype->label.
")";
686 $query += [
'mode' => $mode];
688if ($contextpage != $_SERVER[
"PHP_SELF"]) {
689 $query += [
'contextpage' => $contextpage];
691if ($limit > 0 && $limit !=
$conf->liste_limit) {
692 $query += [
'limit' => $limit];
694if ($optioncss !=
'') {
695 $query += [
'optioncss' => $optioncss];
698 $query += [
'groupby' => $groupby];
700if ($search_all !=
"") {
701 $query += [
'search_all' => $search_all];
704 $query += [
'search_ref' => $search_ref];
706if ($search_civility) {
707 $query += [
'search_civility' => $search_civility];
709if ($search_firstname) {
710 $query += [
'search_firstname' => $search_firstname];
712if ($search_lastname) {
713 $query += [
'search_lastname' => $search_lastname];
716 $query += [
'search_gender' => $search_gender];
718if ($search_morphy !=
'' && $search_morphy !=
'-1') {
719 $query += [
'search_morphy' => $search_morphy];
722 $query += [
'search_login' => $search_login];
725 $query += [
'search_email' => $search_email];
727if ($search_no_email != -1) {
728 $query += [
'search_no_email' => $search_no_email];
730if ($search_categ > 0 || $search_categ == -2) {
731 $query += [
'search_categ' => $search_categ];
733if ($search_company) {
734 $query += [
'search_company' => $search_company];
736if ($search_address !=
'') {
737 $query += [
'search_address' => $search_address];
739if ($search_town !=
'') {
740 $query += [
'search_town' => $search_town];
742if ($search_zip !=
'') {
743 $query += [
'search_zip' => $search_zip];
745if ($search_state !=
'') {
746 $query += [
'search_state' => $search_state];
748if ($search_country !=
'') {
749 $query += [
'search_country' => $search_country];
751if ($search_phone !=
'') {
752 $query += [
'search_phone' => $search_phone];
754if ($search_phone_perso !=
'') {
755 $query += [
'search_phone_perso' => $search_phone_perso];
757if ($search_phone_mobile !=
'') {
758 $query += [
'search_phone_mobile' => $search_phone_mobile];
760if ($search_filter && $search_filter !=
'-1') {
761 $query += [
'search_filter' => $search_filter];
763if ($search_status !=
"" && $search_status != -3) {
764 $query += [
'search_status' => $search_status];
766if ($search_import_key !=
'') {
767 $query += [
'search_import_key' => $search_import_key];
769if ($search_type > 0) {
770 $query += [
'search_type' => $search_type];
772if ($search_datec_start) {
774 'search_datec_start_day' =>
dol_print_date($search_datec_start,
'%d'),
775 'search_datec_start_month' =>
dol_print_date($search_datec_start,
'%m'),
776 'search_datec_start_year' =>
dol_print_date($search_datec_start,
'%Y'),
779if ($search_datem_end) {
781 'search_datem_end_day' =>
dol_print_date($search_datem_end,
'%d'),
782 'search_datem_end_month' =>
dol_print_date($search_datem_end,
'%m'),
783 'search_datem_end_year' =>
dol_print_date($search_datem_end,
'%Y'),
788include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
791$parameters = array(
'query' => &$query);
792$reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object, $action);
795$param = http_build_query($query);
798$arrayofmassactions = array(
802if ($user->hasRight(
'adherent',
'creer')) {
803 $arrayofmassactions[
'close'] =
img_picto(
'',
'close_title',
'class="pictofixedwidth"').$langs->trans(
"Resiliate");
805if ($user->hasRight(
'adherent',
'supprimer')) {
806 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
808if (
isModEnabled(
'category') && $user->hasRight(
'adherent',
'creer')) {
809 $arrayofmassactions[
'preaffecttag'] =
img_picto(
'',
'category',
'class="pictofixedwidth"').$langs->trans(
"AffectTag");
811if ($user->hasRight(
'adherent',
'creer') && $user->hasRight(
'user',
'user',
'creer')) {
812 $arrayofmassactions[
'createexternaluser'] =
img_picto(
'',
'user',
'class="pictofixedwidth"').$langs->trans(
"CreateExternalUser");
814if ($user->hasRight(
'adherent',
'creer')) {
815 $arrayofmassactions[
'createsubscription'] =
img_picto(
'',
'payment',
'class="pictofixedwidth"').$langs->trans(
"CreateSubscription");
817if (
GETPOSTINT(
'nomassaction') || in_array($massaction, array(
'presend',
'predelete',
'preaffecttag'))) {
818 $arrayofmassactions = array();
820$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
822print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
823if ($optioncss !=
'') {
824 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
826print
'<input type="hidden" name="token" value="'.newToken().
'">';
827print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
828print
'<input type="hidden" name="action" value="list">';
829print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
830print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
831print
'<input type="hidden" name="page" value="'.$page.
'">';
832print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
833print
'<input type="hidden" name="page_y" value="">';
834print
'<input type="hidden" name="mode" value="'.$mode.
'">';
837$queryforbutton = $query;
838$queryforbutton[
'mode'] =
'common';
839$newcardbutton .= dolGetButtonTitle($langs->trans(
'ViewList'),
'',
'fa fa-bars imgforviewmode',
dolBuildUrl($_SERVER[
"PHP_SELF"], $queryforbutton),
'', ((empty($mode) || $mode ==
'common') ? 2 : 1), array(
'morecss' =>
'reposition'));
840$queryforbutton[
'mode'] =
'kanban';
841$newcardbutton .= dolGetButtonTitle($langs->trans(
'ViewKanban'),
'',
'fa fa-th-list imgforviewmode',
dolBuildUrl($_SERVER[
"PHP_SELF"], $queryforbutton),
'', ($mode ==
'kanban' ? 2 : 1), array(
'morecss' =>
'reposition'));
842$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'));
843$newcardbutton .= dolGetButtonTitleSeparator();
844$newcardbutton .= dolGetButtonTitle($langs->trans(
'NewMember'),
'',
'fa fa-plus-circle',
dolBuildUrl(DOL_URL_ROOT.
'/adherents/card.php', [
'action' =>
'create']),
'', $user->hasRight(
'adherent',
'creer'));
846print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
$object->picto, 0, $newcardbutton,
'', $limit, 0, 0, 1);
849$topicmail =
"Information";
850$modelmail =
"member";
852$trackid =
'mem'.$object->id;
853if ($massaction ==
'createsubscription') {
857 foreach ($toselect as
$id) {
859 $tmpmember->fetch(
$id);
860 $res = $adht->fetch($tmpmember->typeid);
862 $amounttmp = $adht->amount;
863 if (!empty($tmpmember->last_subscription_amount) && !GETPOSTISSET(
'newamount') && is_numeric($amounttmp)) {
864 $amounttmp = max($tmpmember->last_subscription_amount, $amount);
866 $amount = max(0, $amounttmp, $amount);
873 $formquestion = array(
874 array(
'label' => $langs->trans(
"DateSubscription"),
'type' =>
'other',
'value' => $date),
875 array(
'label' => $langs->trans(
"Amount"),
'type' =>
'text',
'value' =>
price($amount, 0,
'', 0),
'name' =>
'amount'),
876 array(
'label' => $langs->trans(
"Label"),
'type' =>
'text',
'value' =>
'',
'name' =>
'label'),
877 array(
'type' =>
'separator'),
878 array(
'label' => $langs->trans(
"MoreActions"),
'type' =>
'other',
'value' => $langs->trans(
"None").
' '.
img_warning($langs->trans(
"WarningNoComplementaryActionDone"))),
880 print $form->formconfirm($_SERVER[
"PHP_SELF"], $langs->trans(
"ConfirmMassSubsriptionCreation"), $langs->trans(
"ConfirmMassSubsriptionCreationQuestion", count($toselect)),
"createsubscription_confirm", $formquestion,
'', 0, 200, 500, 1);
882include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
886 foreach ($fieldstosearchall as $key => $val) {
887 $fieldstosearchall[$key] = $langs->trans($val);
888 $setupstring .= $key.
"=".$val.
";";
890 print
'<!-- Search done like if MYOBJECT_QUICKSEARCH_ON_FIELDS = '.$setupstring.
' -->'.
"\n";
891 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).implode(
', ', $fieldstosearchall).
'</div>'.
"\n";
894$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
895$htmlofselectarray = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
$conf->main_checkbox_left_column);
896$selectedfields = ($mode !=
'kanban' ? $htmlofselectarray :
'');
897$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
901if (
isModEnabled(
'category') && $user->hasRight(
'categorie',
'lire')) {
902 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
903 $moreforfilter .=
'<div class="divsearchfield">';
904 $moreforfilter .=
img_picto($langs->trans(
'Categories'),
'category',
'class="pictofixedwidth"').$formother->select_categories(Categorie::TYPE_MEMBER, $search_categ,
'search_categ', 1, $langs->trans(
"MembersCategoriesShort"));
905 $moreforfilter .=
'</div>';
908 'arrayfields' => &$arrayfields,
910$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
911if (empty($reshook)) {
912 $moreforfilter .= $hookmanager->resPrint;
914 $moreforfilter = $hookmanager->resPrint;
916if (!empty($moreforfilter)) {
917 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
918 print $moreforfilter;
922print
'<div class="div-table-responsive">';
923print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
927print
'<tr class="liste_titre_filter">';
930if (
$conf->main_checkbox_left_column) {
931 print
'<td class="liste_titre center maxwidthsearch">';
932 $searchpicto = $form->showFilterButtons(
'left');
938if (!empty($arrayfields[
'd.rowid'][
'checked'])) {
939 print
'<td class="liste_titre">';
940 print
'<input class="flat" size="6" type="text" name="search_id" value="'.dol_escape_htmltag($search_id).
'">';
945if (!empty($arrayfields[
'd.ref'][
'checked'])) {
946 print
'<td class="liste_titre">';
947 print
'<input type="text" class="flat maxwidth75imp" name="search_ref" value="'.dol_escape_htmltag($search_ref).
'">';
952if (!empty($arrayfields[
'd.civility'][
'checked'])) {
953 print
'<td class="liste_titre left">';
954 print
'<input class="flat maxwidth50imp" type="text" name="search_civility" value="'.dol_escape_htmltag($search_civility).
'"></td>';
958if (!empty($arrayfields[
'd.lastname'][
'checked'])) {
959 print
'<td class="liste_titre left">';
960 print
'<input class="flat maxwidth75imp" type="text" name="search_lastname" value="'.dol_escape_htmltag($search_lastname).
'"></td>';
964if (!empty($arrayfields[
'd.firstname'][
'checked'])) {
965 print
'<td class="liste_titre left">';
966 print
'<input class="flat maxwidth75imp" type="text" name="search_firstname" value="'.dol_escape_htmltag($search_firstname).
'"></td>';
970if (!empty($arrayfields[
'd.gender'][
'checked'])) {
971 print
'<td class="liste_titre">';
972 $arraygender = array(
'man' => $langs->trans(
"Genderman"),
'woman' => $langs->trans(
"Genderwoman"),
'other' => $langs->trans(
"Genderother"));
973 print $form->selectarray(
'search_gender', $arraygender, $search_gender, 1);
978if (!empty($arrayfields[
'd.societe'][
'checked'])) {
979 print
'<td class="liste_titre left">';
980 print
'<input class="flat maxwidth75imp" type="text" name="search_company" value="'.dol_escape_htmltag($search_company).
'"></td>';
984if (!empty($arrayfields[
'd.login'][
'checked'])) {
985 print
'<td class="liste_titre left">';
986 print
'<input class="flat maxwidth75imp" type="text" name="search_login" value="'.dol_escape_htmltag($search_login).
'"></td>';
990if (!empty($arrayfields[
'd.morphy'][
'checked'])) {
991 print
'<td class="liste_titre center">';
992 $arraymorphy = array(
'mor' => $langs->trans(
"Moral"),
'phy' => $langs->trans(
"Physical"));
993 print $form->selectarray(
'search_morphy', $arraymorphy, $search_morphy, 1, 0, 0,
'', 0, 0, 0,
'',
'maxwidth100');
998if (!empty($arrayfields[
't.libelle'][
'checked'])) {
999 print
'<td class="liste_titre">';
1000 $listetype = $membertypestatic->liste_array();
1002 print $form->selectarray(
"search_type", $listetype, $search_type, 1, 0, 0,
'', 0, 32, 0,
'',
'minwidth75 maxwidth100');
1007if (!empty($arrayfields[
'd.address'][
'checked'])) {
1008 print
'<td class="liste_titre left">';
1009 print
'<input class="flat maxwidth75imp" type="text" name="search_address" value="'.dol_escape_htmltag($search_address).
'"></td>';
1013if (!empty($arrayfields[
'd.zip'][
'checked'])) {
1014 print
'<td class="liste_titre left">';
1015 print
'<input class="flat maxwidth50imp" type="text" name="search_zip" value="'.dol_escape_htmltag($search_zip).
'"></td>';
1019if (!empty($arrayfields[
'd.town'][
'checked'])) {
1020 print
'<td class="liste_titre left">';
1021 print
'<input class="flat maxwidth75imp" type="text" name="search_town" value="'.dol_escape_htmltag($search_town).
'"></td>';
1025if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1026 print
'<td class="liste_titre">';
1027 print
'<input class="flat searchstring maxwidth75imp" type="text" name="search_state" value="'.dol_escape_htmltag($search_state).
'">';
1032if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1033 print
'<td class="liste_titre center">';
1034 print $form->select_country($search_country,
'search_country',
'', 0,
'minwidth100imp maxwidth100');
1039if (!empty($arrayfields[
'd.phone'][
'checked'])) {
1040 print
'<td class="liste_titre left">';
1041 print
'<input class="flat maxwidth75imp" type="text" name="search_phone" value="'.dol_escape_htmltag($search_phone).
'"></td>';
1045if (!empty($arrayfields[
'd.phone_perso'][
'checked'])) {
1046 print
'<td class="liste_titre left">';
1047 print
'<input class="flat maxwidth75imp" type="text" name="search_phone_perso" value="'.dol_escape_htmltag($search_phone_perso).
'"></td>';
1051if (!empty($arrayfields[
'd.phone_mobile'][
'checked'])) {
1052 print
'<td class="liste_titre left">';
1053 print
'<input class="flat maxwidth75imp" type="text" name="search_phone_mobile" value="'.dol_escape_htmltag($search_phone_mobile).
'"></td>';
1057if (!empty($arrayfields[
'd.email'][
'checked'])) {
1058 print
'<td class="liste_titre left">';
1059 print
'<input class="flat maxwidth75imp" type="text" name="search_email" value="'.dol_escape_htmltag($search_email).
'"></td>';
1063if (!empty($arrayfields[
'unsubscribed'][
'checked'])) {
1064 print
'<td class="liste_titre center">';
1065 print $form->selectarray(
'search_no_email', array(
'-1' =>
'',
'0' => $langs->trans(
'No'),
'1' => $langs->trans(
'Yes')), $search_no_email);
1070include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
1073$parameters = array(
'arrayfields' => $arrayfields);
1074$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters);
1075print $hookmanager->resPrint;
1078if (!empty($arrayfields[
'd.datec'][
'checked'])) {
1079 print
'<td class="liste_titre center">';
1080 print
'<div class="nowrapfordate">';
1081 print $form->selectDate($search_datec_start ? $search_datec_start : -1,
'search_datec_start_', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1083 print
'<div class="nowrapfordate">';
1084 print $form->selectDate($search_datec_end ? $search_datec_end : -1,
'search_datec_end_', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
1090if (!empty($arrayfields[
'd.birth'][
'checked'])) {
1091 print
'<td class="liste_titre">';
1096if (!empty($arrayfields[
'd.tms'][
'checked'])) {
1097 print
'<td class="liste_titre">';
1098 print
'<div class="nowrapfordate">';
1099 print $form->selectDate($search_datem_start ? $search_datem_start : -1,
'search_datem_start_', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1101 print
'<div class="nowrapfordate">';
1102 print $form->selectDate($search_datem_end ? $search_datem_end : -1,
'search_datem_end_', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
1108if (!empty($arrayfields[
'd.import_key'][
'checked'])) {
1109 print
'<td class="liste_titre center">';
1110 print
'<input class="flat searchstring maxwidth50" type="text" name="search_import_key" value="'.dol_escape_htmltag($search_import_key).
'">';
1115if (!empty($arrayfields[
'd.datefin'][
'checked'])) {
1116 print
'<td class="liste_titre center">';
1118 $selectarray = array(
'-1' =>
'',
'waitingsubscription' => $langs->trans(
"WaitingSubscription"),
'uptodate' => $langs->trans(
"UpToDate"),
'outofdate' => $langs->trans(
"OutOfDate"));
1119 print $form->selectarray(
'search_filter', $selectarray, $search_filter);
1124if (!empty($arrayfields[
'd.statut'][
'checked'])) {
1125 print
'<td class="liste_titre center parentonrightofpage">';
1126 $liststatus = array(
1133 print $form->selectarray(
'search_status', $liststatus, $search_status, -3, 0, 0,
'', 0, 0, 0,
'',
'search_status width100 onrightofpage');
1138if (!
$conf->main_checkbox_left_column) {
1139 print
'<td class="liste_titre center maxwidthsearch">';
1140 $searchpicto = $form->showFilterButtons();
1151print
'<tr class="liste_titre">';
1153if (
$conf->main_checkbox_left_column) {
1154 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch actioncolumn ');
1157if (!empty($arrayfields[
'd.rowid'][
'checked'])) {
1159 print_liste_field_titre($arrayfields[
'd.rowid'][
'label'], $_SERVER[
"PHP_SELF"],
'd.rowid',
'', $param,
'', $sortfield, $sortorder,
'center ');
1162if (!empty($arrayfields[
'd.ref'][
'checked'])) {
1163 print_liste_field_titre($arrayfields[
'd.ref'][
'label'], $_SERVER[
"PHP_SELF"],
'd.ref',
'', $param,
'', $sortfield, $sortorder);
1166if (!empty($arrayfields[
'd.civility'][
'checked'])) {
1167 print_liste_field_titre($arrayfields[
'd.civility'][
'label'], $_SERVER[
"PHP_SELF"],
'd.civility',
'', $param,
'', $sortfield, $sortorder);
1170if (!empty($arrayfields[
'd.lastname'][
'checked'])) {
1171 print_liste_field_titre($arrayfields[
'd.lastname'][
'label'], $_SERVER[
"PHP_SELF"],
'd.lastname',
'', $param,
'', $sortfield, $sortorder);
1174if (!empty($arrayfields[
'd.firstname'][
'checked'])) {
1175 print_liste_field_titre($arrayfields[
'd.firstname'][
'label'], $_SERVER[
"PHP_SELF"],
'd.firstname',
'', $param,
'', $sortfield, $sortorder);
1178if (!empty($arrayfields[
'd.gender'][
'checked'])) {
1179 print_liste_field_titre($arrayfields[
'd.gender'][
'label'], $_SERVER[
'PHP_SELF'],
'd.gender',
'', $param,
'', $sortfield, $sortorder);
1182if (!empty($arrayfields[
'd.societe'][
'checked'])) {
1183 print_liste_field_titre($arrayfields[
'd.societe'][
'label'], $_SERVER[
"PHP_SELF"],
'companyname',
'', $param,
'', $sortfield, $sortorder);
1186if (!empty($arrayfields[
'd.login'][
'checked'])) {
1187 print_liste_field_titre($arrayfields[
'd.login'][
'label'], $_SERVER[
"PHP_SELF"],
'd.login',
'', $param,
'', $sortfield, $sortorder);
1190if (!empty($arrayfields[
'd.morphy'][
'checked'])) {
1191 print_liste_field_titre($arrayfields[
'd.morphy'][
'label'], $_SERVER[
"PHP_SELF"],
'd.morphy',
'', $param,
'', $sortfield, $sortorder);
1194if (!empty($arrayfields[
't.libelle'][
'checked'])) {
1195 print_liste_field_titre($arrayfields[
't.libelle'][
'label'], $_SERVER[
"PHP_SELF"],
't.libelle',
'', $param,
'', $sortfield, $sortorder);
1198if (!empty($arrayfields[
'd.address'][
'checked'])) {
1199 print_liste_field_titre($arrayfields[
'd.address'][
'label'], $_SERVER[
"PHP_SELF"],
'd.address',
'', $param,
'', $sortfield, $sortorder);
1202if (!empty($arrayfields[
'd.zip'][
'checked'])) {
1203 print_liste_field_titre($arrayfields[
'd.zip'][
'label'], $_SERVER[
"PHP_SELF"],
'd.zip',
'', $param,
'', $sortfield, $sortorder);
1206if (!empty($arrayfields[
'd.town'][
'checked'])) {
1207 print_liste_field_titre($arrayfields[
'd.town'][
'label'], $_SERVER[
"PHP_SELF"],
'd.town',
'', $param,
'', $sortfield, $sortorder);
1210if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1211 print_liste_field_titre($arrayfields[
'state.nom'][
'label'], $_SERVER[
"PHP_SELF"],
"state.nom",
"", $param,
'', $sortfield, $sortorder);
1214if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1215 print_liste_field_titre($arrayfields[
'country.code_iso'][
'label'], $_SERVER[
"PHP_SELF"],
"country.code_iso",
"", $param,
'', $sortfield, $sortorder,
'center ');
1218if (!empty($arrayfields[
'd.phone'][
'checked'])) {
1219 print_liste_field_titre($arrayfields[
'd.phone'][
'label'], $_SERVER[
"PHP_SELF"],
'd.phone',
'', $param,
'', $sortfield, $sortorder);
1222if (!empty($arrayfields[
'd.phone_perso'][
'checked'])) {
1223 print_liste_field_titre($arrayfields[
'd.phone_perso'][
'label'], $_SERVER[
"PHP_SELF"],
'd.phone_perso',
'', $param,
'', $sortfield, $sortorder);
1226if (!empty($arrayfields[
'd.phone_mobile'][
'checked'])) {
1227 print_liste_field_titre($arrayfields[
'd.phone_mobile'][
'label'], $_SERVER[
"PHP_SELF"],
'd.phone_mobile',
'', $param,
'', $sortfield, $sortorder);
1230if (!empty($arrayfields[
'd.email'][
'checked'])) {
1231 print_liste_field_titre($arrayfields[
'd.email'][
'label'], $_SERVER[
"PHP_SELF"],
'd.email',
'', $param,
'', $sortfield, $sortorder);
1234if (!empty($arrayfields[
'unsubscribed'][
'checked'])) {
1235 print_liste_field_titre($arrayfields[
'unsubscribed'][
'label'], $_SERVER[
"PHP_SELF"],
'unsubscribed',
'', $param,
'', $sortfield, $sortorder,
'center ');
1239include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
1242$parameters = array(
'arrayfields' => $arrayfields,
'totalarray' => &
$totalarray,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder);
1243$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters);
1244print $hookmanager->resPrint;
1246if (!empty($arrayfields[
'd.datec'][
'checked'])) {
1247 print_liste_field_titre($arrayfields[
'd.datec'][
'label'], $_SERVER[
"PHP_SELF"],
"d.datec",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1250if (!empty($arrayfields[
'd.birth'][
'checked'])) {
1251 print_liste_field_titre($arrayfields[
'd.birth'][
'label'], $_SERVER[
"PHP_SELF"],
"d.birth",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1254if (!empty($arrayfields[
'd.tms'][
'checked'])) {
1255 print_liste_field_titre($arrayfields[
'd.tms'][
'label'], $_SERVER[
"PHP_SELF"],
"d.tms",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1258if (!empty($arrayfields[
'd.import_key'][
'checked'])) {
1259 print_liste_field_titre($arrayfields[
'd.import_key'][
'label'], $_SERVER[
"PHP_SELF"],
"d.import_key",
"", $param,
'', $sortfield, $sortorder,
'center ');
1262if (!empty($arrayfields[
'd.datefin'][
'checked'])) {
1263 print_liste_field_titre($arrayfields[
'd.datefin'][
'label'], $_SERVER[
"PHP_SELF"],
'd.datefin,t.subscription',
'', $param,
'', $sortfield, $sortorder,
'center ');
1266if (!empty($arrayfields[
'd.statut'][
'checked'])) {
1267 print_liste_field_titre($arrayfields[
'd.statut'][
'label'], $_SERVER[
"PHP_SELF"],
"d.statut,t.subscription,d.datefin",
"", $param,
'', $sortfield, $sortorder,
'center ');
1270if (!
$conf->main_checkbox_left_column) {
1271 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'maxwidthsearch center ');
1282$imaxinloop = ($limit ? min($num, $limit) : $num);
1283while ($i < $imaxinloop) {
1284 $obj =
$db->fetch_object($resql);
1289 $datefin =
$db->jdate($obj->datefin);
1291 $memberstatic->id = $obj->rowid;
1292 $memberstatic->ref = $obj->ref;
1293 $memberstatic->civility_code = $obj->civility;
1294 $memberstatic->login = $obj->login;
1295 $memberstatic->lastname = $obj->lastname;
1296 $memberstatic->firstname = $obj->firstname;
1297 $memberstatic->gender = $obj->gender;
1298 $memberstatic->status = $obj->status;
1299 $memberstatic->datefin = $datefin;
1300 $memberstatic->socid = $obj->socid;
1301 $memberstatic->photo = $obj->photo;
1302 $memberstatic->email = $obj->email;
1303 $memberstatic->morphy = $obj->morphy;
1304 $memberstatic->note_public = $obj->note_public;
1305 $memberstatic->note_private = $obj->note_private;
1306 $memberstatic->need_subscription = $obj->subscription;
1308 if (!empty($obj->socid)) {
1309 $memberstatic->fetch_thirdparty();
1310 if ($memberstatic->thirdparty->id > 0) {
1311 $companyname = $memberstatic->thirdparty->name;
1312 $companynametoshow = $memberstatic->thirdparty->getNomUrl(1);
1314 $companyname =
null;
1315 $companynametoshow =
null;
1318 $companyname = $obj->company;
1319 $companynametoshow = $obj->company;
1321 $memberstatic->company = (
string) $companyname;
1325 if ($mode ==
'kanban') {
1327 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
1328 print
'<div class="box-flex-container kanban">';
1330 $membertypestatic->id = $obj->type_id;
1331 $membertypestatic->label = $obj->type;
1333 $memberstatic->type = $membertypestatic->label;
1334 $memberstatic->photo = $obj->photo;
1337 print $memberstatic->getKanbanView(
'', array(
'selected' => in_array(
$object->id, $arrayofselected)));
1338 if ($i == (min($num, $limit) - 1)) {
1345 print
'<tr data-rowid="'.$object->id.
'" class="oddeven row-with-select">';
1348 if (
$conf->main_checkbox_left_column) {
1349 print
'<td class="nowrap center">';
1350 if ($massactionbutton || $massaction) {
1352 if (in_array($obj->rowid, $arrayofselected)) {
1355 print
'<input id="cb'.$obj->rowid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1363 if (!empty($arrayfields[
'd.rowid'][
'checked'])) {
1364 print
'<td class="center" data-key="id">'.dolPrintHTML($obj->rowid).
'</td>';
1370 if (!empty($arrayfields[
'd.ref'][
'checked'])) {
1371 print
'<td class="tdoverflowmax150">';
1372 print $memberstatic->getNomUrl(-1, 0,
'card',
'ref',
'', -1, 0, 1);
1379 if (!empty($arrayfields[
'd.civility'][
'checked'])) {
1388 if (!empty($arrayfields[
'd.lastname'][
'checked'])) {
1389 print
'<td class="tdoverflowmax125">';
1390 print $memberstatic->getNomUrl(0, 0,
'card',
'lastname');
1398 if (!empty($arrayfields[
'd.firstname'][
'checked'])) {
1399 print
'<td class="tdoverflowmax125">';
1400 print $memberstatic->getNomUrl(0, 0,
'card',
'firstname');
1408 if (!empty($arrayfields[
'd.gender'][
'checked'])) {
1411 print $langs->trans(
"Gender".$obj->gender);
1419 if (!empty($arrayfields[
'd.societe'][
'checked'])) {
1420 print
'<td class="tdoverflowmax125">';
1421 print $companynametoshow;
1425 if (!empty($arrayfields[
'd.login'][
'checked'])) {
1426 print
'<td class="tdoverflowmax125" title="'.dolPrintHTMLForAttribute($obj->login).
'">'.
dolPrintHTML($obj->login).
"</td>\n";
1432 if (!empty($arrayfields[
'd.morphy'][
'checked'])) {
1433 print
'<td class="center">';
1434 print $memberstatic->getmorphylib(
'', 2);
1441 if (!empty($arrayfields[
't.libelle'][
'checked'])) {
1442 $membertypestatic->id = $obj->type_id;
1443 $membertypestatic->label = $obj->type;
1444 print
'<td class="nowraponall tdoverflowmax100">';
1445 print $membertypestatic->getNomUrl(1, 32);
1452 if (!empty($arrayfields[
'd.address'][
'checked'])) {
1453 print
'<td class="nocellnopadd tdoverflowmax200" title="'.dol_escape_htmltag($obj->address).
'">';
1461 if (!empty($arrayfields[
'd.zip'][
'checked'])) {
1462 print
'<td class="nocellnopadd">';
1470 if (!empty($arrayfields[
'd.town'][
'checked'])) {
1471 print
'<td class="nocellnopadd">';
1479 if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1488 if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1489 $tmparray =
getCountry($obj->country,
'all');
1490 print
'<td class="center tdoverflowmax100" title="'.dolPrintHTMLForAttribute($tmparray[
'label']).
'">';
1498 if (!empty($arrayfields[
'd.phone'][
'checked'])) {
1499 print
'<td class="nocellnopadd">';
1507 if (!empty($arrayfields[
'd.phone_perso'][
'checked'])) {
1508 print
'<td class="nocellnopadd">';
1516 if (!empty($arrayfields[
'd.phone_mobile'][
'checked'])) {
1517 print
'<td class="nocellnopadd">';
1525 if (!empty($arrayfields[
'd.email'][
'checked'])) {
1526 print
'<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->email).
'">';
1534 if (!empty($arrayfields[
'unsubscribed'][
'checked'])) {
1535 print
'<td class="center">'.yn(($obj->unsubscribed > 0) ? 1 : 0).
"</td>\n";
1541 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
1543 $parameters = array(
'arrayfields' => $arrayfields,
'obj' => $obj,
'i' => $i,
'totalarray' => &
$totalarray);
1544 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters);
1545 print $hookmanager->resPrint;
1547 if (!empty($arrayfields[
'd.datec'][
'checked'])) {
1548 print
'<td class="nowrap center">';
1556 if (!empty($arrayfields[
'd.birth'][
'checked'])) {
1557 print
'<td class="nowrap center">';
1565 if (!empty($arrayfields[
'd.tms'][
'checked'])) {
1566 print
'<td class="nowrap center">';
1574 if (!empty($arrayfields[
'd.import_key'][
'checked'])) {
1575 print
'<td class="tdoverflowmax100 center" title="'.dolPrintHTMLForAttribute($obj->import_key).
'">';
1583 $datefin =
$db->jdate($obj->datefin);
1584 if (!empty($arrayfields[
'd.datefin'][
'checked'])) {
1588 if ($memberstatic->hasDelay()) {
1589 $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").
')';
1590 $s .=
" ".img_warning($langs->trans(
"SubscriptionLate").$textlate);
1593 if (!empty($obj->subscription)) {
1594 $s .=
'<span class="opacitymedium">'.$langs->trans(
"SubscriptionNotReceived").
'</span>';
1595 if ($obj->status > 0) {
1596 $s .=
" ".img_warning();
1599 $s .=
'<span class="opacitymedium">'.$langs->trans(
"SubscriptionNotNeeded").
'</span>';
1602 print
'<td class="nowraponall center tdoverflowmax150" title="'.dolPrintHTMLForAttribute(
dol_string_nohtmltag($s)).
'">';
1610 if (!empty($arrayfields[
'd.statut'][
'checked'])) {
1611 print
'<td class="nowrap center">';
1612 print $memberstatic->LibStatut($obj->status, $obj->subscription, $datefin, 5);
1619 if (!
$conf->main_checkbox_left_column) {
1620 print
'<td class="center">';
1621 if ($massactionbutton || $massaction) {
1623 if (in_array($obj->rowid, $arrayofselected)) {
1626 print
'<input id="cb'.$obj->rowid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1640include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
1646 foreach ($arrayfields as $key => $val) {
1647 if (!empty($val[
'checked'])) {
1651 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
1656$parameters = array(
'arrayfields' => $arrayfields,
'sql' => $sql);
1657$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
1658print $hookmanager->resPrint;
1660print
'</table>'.
"\n";
1663print
'</form>'.
"\n";
1665if (in_array(
'builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords ===
'' || $nbtotalofrecords)) {
1666 $hidegeneratedfilelistifempty = 1;
1667 if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
1668 $hidegeneratedfilelistifempty = 0;
1671 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
1675 $urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
1676 $urlsource .= str_replace(
'&',
'&', $param);
1678 $filedir = $diroutputmassaction;
1679 $genallowed = $permissiontoread;
1680 $delallowed = $permissiontoadd;
1682 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...
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
print_liste_field_titre($name, $file="", $field="", $begin="", $param="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
dol_print_phone($phone, $countrycode='', $contactid=0, $socid=0, $addlink='', $separ=" ", $withpicto='', $titlealt='', $adddivfloat=0, $morecss='paddingright')
Format phone numbers according to country.
print_barre_liste($title, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $selectlimitsuffix=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dolPrintHTML($s, $allowiframe=0, $moreallowedtags=array())
Return a string (that can be on several lines) ready to be output on a HTML page.
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...
dol_print_email($email, $contactid=0, $socid=0, $addlink=0, $max=0, $showinvalid=1, $withpicto=0, $morecss='paddingrightonly')
Show EMail link formatted for HTML output.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
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).
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
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 $langs trans("Show") . '< td style="' . $timeColor . '" align="center"> s</td > badge status0 badge status4 badge status3 Error badge status8< td align="center">< span class="badge ' . $badge . '"></span ></td >< td align="center">< a href="#" class="button button-small" onclick="openLogModal(this)" data-req="' . dol_escape_htmltag($reqSafe) . '" data-res="' . dol_escape_htmltag($resSafe) . '" data-err="' . dol_escape_htmltag($errSafe) . '">< span class="fa fa-search-plus"></span ></a ></td ></tr >< tr >< td colspan="' . $colspan . '" class="opacitymedium"></td ></tr ></table ></div ></form > logModal none logModal none s a JSON string
buildzip.php
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.