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');
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';
223$parameters = array(
'arrayfields' => &$arrayfields);
224$reshook = $hookmanager->executeHooks(
'completeArrayFields', $parameters, $object, $action);
238if (
GETPOST(
'cancel',
'alpha')) {
242if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
246$permissiontoread = $user->hasRight(
'adherent',
'lire');
247$permissiontodelete = $user->hasRight(
'adherent',
'supprimer');
248$permissiontoadd = $user->hasRight(
'adherent',
'creer');
249$uploaddir =
$conf->member->dir_output;
252$parameters = array(
'socid' => isset($socid) ? $socid : null,
'arrayfields' => &$arrayfields);
253$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
258if (empty($reshook)) {
260 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
263 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
270 $search_lastname =
"";
271 $search_firstname =
"";
273 $search_civility =
"";
275 $search_company =
"";
278 $search_no_email = -1;
279 $search_address =
"";
283 $search_country =
'';
285 $search_phone_perso =
'';
286 $search_phone_mobile =
'';
291 $search_import_key =
'';
294 $search_datec_start =
'';
295 $search_datec_end =
'';
296 $search_datem_start =
'';
297 $search_datem_end =
'';
298 $search_array_options = array();
302 if ($massaction ==
'close' && $user->hasRight(
'adherent',
'creer')) {
308 foreach ($toselect as $idtoclose) {
309 $tmpmember->fetch($idtoclose);
310 $result = $tmpmember->resiliate($user);
315 } elseif ($result > 0) {
330 if ($massaction ==
'createexternaluser' && $user->hasRight(
'adherent',
'creer') && $user->hasRight(
'user',
'user',
'creer')) {
336 foreach ($toselect as $idtoclose) {
337 $tmpmember->fetch($idtoclose);
339 if (!empty($tmpmember->socid)) {
343 $result = $nuser->create_from_member($tmpuser, $tmpmember->login);
348 } elseif ($result > 0) {
355 setEventMessages($langs->trans(
"XExternalUserCreated", $nbcreated),
null,
'mesgs');
364 if ($action ==
'createsubscription_confirm' && $confirm ==
"yes" && $user->hasRight(
'adherent',
'creer')) {
379 } elseif (
getDolGlobalInt(
'MEMBER_SUBSCRIPTION_SUGGEST_END_OF_YEAR')) {
383 foreach ($toselect as
$id) {
384 $res = $tmpmember->fetch(
$id);
390 $datesubendthismember = $datesubend;
391 if (!$datesubendthismember && $tmpmember->typeid > 0) {
392 if ($adht->fetch($tmpmember->typeid) > 0) {
393 $delay = !empty($adht->duration_value) ? $adht->duration_value : 1;
394 $delayunit = !empty($adht->duration_unit) ? $adht->duration_unit :
'y';
398 $result = $tmpmember->subscription($now, (
float) $amount, 0,
'',
'',
'',
'',
'', $datesubendthismember);
410 setEventMessages($langs->trans(
"XSubsriptionCreated", $nbcreated),
null,
'mesgs');
413 setEventMessages($langs->trans(
"XSubsriptionErrors", $error),
null,
'mesgs');
419 $objectclass =
'Adherent';
420 $objectlabel =
'Members';
421 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
437$title = $langs->trans(
"Members");
438$help_url =
'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder';
446$sql .=
" d.rowid, d.ref, d.login, d.lastname, d.firstname, d.gender, d.societe as company, d.fk_soc as socid,";
447$sql .=
" d.civility, d.datefin, d.address, d.zip, d.town, d.state_id, d.country,";
448$sql .=
" d.email, d.phone, d.phone_perso, d.phone_mobile, d.birth, d.public, d.photo,";
449$sql .=
" d.fk_adherent_type as type_id, d.morphy, d.statut as status, d.datec as date_creation, d.tms as date_modification,";
450$sql .=
" d.note_private, d.note_public, d.import_key,";
452$sql .=
" ".$db->ifsql(
"d.societe IS NULL",
"s.nom",
"d.societe").
" as companyname,";
453$sql .=
" t.libelle as type, t.subscription,";
454$sql .=
" state.code_departement as state_code, state.nom as state_name";
457 $sql .=
", (SELECT count(*) FROM ".MAIN_DB_PREFIX.
"mailing_unsubscribe WHERE email = d.email) as unsubscribed";
461if (!empty($extrafields->attributes[
$object->table_element][
'label'])) {
462 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
463 $sql .= ($extrafields->attributes[
$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
"");
468$parameters = array();
469$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object, $action);
470$sql .= $hookmanager->resPrint;
471$sql = preg_replace(
'/,\s*$/',
'', $sql);
476$sql .=
" FROM ".MAIN_DB_PREFIX.
"adherent as d";
477if (!empty($extrafields->attributes[
$object->table_element][
'label']) && count($extrafields->attributes[
$object->table_element][
'label'])) {
478 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (d.rowid = ef.fk_object)";
480$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as country on (country.rowid = d.country)";
481$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_departements as state on (state.rowid = d.state_id)";
482$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s on (s.rowid = d.fk_soc)";
485$sql .=
", ".MAIN_DB_PREFIX.
"adherent_type as t";
486$sql .=
" WHERE d.fk_adherent_type = t.rowid";
488$searchCategoryContactList = $search_categ ? array($search_categ) : array();
489$searchCategoryContactOperator = 0;
491if (!empty($searchCategoryContactList)) {
492 $searchCategoryContactSqlList = array();
493 $listofcategoryid =
'';
494 foreach ($searchCategoryContactList as $searchCategoryContact) {
495 if (intval($searchCategoryContact) == -2) {
496 $searchCategoryContactSqlList[] =
"NOT EXISTS (SELECT ck.fk_categorie FROM ".MAIN_DB_PREFIX.
"categorie_member as ck WHERE d.rowid = ck.fk_member)";
497 } elseif (intval($searchCategoryContact) > 0) {
498 if ($searchCategoryContactOperator == 0) {
499 $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).
")";
501 $listofcategoryid .= ($listofcategoryid ?
', ' :
'') .((
int) $searchCategoryContact);
505 if ($listofcategoryid) {
506 $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).
"))";
508 if ($searchCategoryContactOperator == 1) {
509 if (!empty($searchCategoryContactSqlList)) {
510 $sql .=
" AND (".implode(
' OR ', $searchCategoryContactSqlList).
")";
513 if (!empty($searchCategoryContactSqlList)) {
514 $sql .=
" AND (".implode(
' AND ', $searchCategoryContactSqlList).
")";
519$sql .=
" AND d.entity IN (".getEntity(
'adherent').
")";
521 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
523if ($search_type > 0) {
524 $sql .=
" AND t.rowid=".((int) $search_type);
526if ($search_filter ==
'withoutsubscription') {
527 $sql .=
" AND (datefin IS NULL)";
529if ($search_filter ==
'waitingsubscription') {
530 $sql .=
" AND (datefin IS NULL AND t.subscription = '1')";
532if ($search_filter ==
'uptodate') {
535 $sql .=
" AND (datefin >= '".$db->idate($now).
"' OR (datefin IS NULL AND t.subscription = '0'))";
537if ($search_filter ==
'outofdate') {
538 $sql .=
" AND (datefin < '".$db->idate($now).
"')";
540if ($search_status !=
'') {
542 $sql .=
" AND d.statut in (".$db->sanitize(
$db->escape($search_status)).
")";
544if ($search_morphy !=
'' && $search_morphy !=
'-1') {
553if ($search_civility) {
556if ($search_firstname) {
559if ($search_lastname) {
562if ($search_gender !=
'' && $search_gender !=
'-1') {
568if ($search_company) {
569 $sql .=
natural_search(array(
"s.nom",
"d.societe"), $search_company);
574if ($search_no_email != -1 && $search_no_email > 0) {
575 $sql .=
" AND (SELECT count(*) FROM ".MAIN_DB_PREFIX.
"mailing_unsubscribe WHERE email = d.email) > 0";
577if ($search_no_email != -1 && $search_no_email == 0) {
578 $sql .=
" AND (SELECT count(*) FROM ".MAIN_DB_PREFIX.
"mailing_unsubscribe WHERE email = d.email) = 0 AND d.email IS NOT NULL AND d.email <> ''";
580if ($search_address) {
595if ($search_phone_perso) {
598if ($search_phone_mobile) {
601if ($search_country) {
602 $sql .=
" AND d.country IN (".$db->sanitize($search_country).
')';
604if ($search_import_key) {
607if ($search_datec_start) {
608 $sql .=
" AND d.datec >= '".$db->idate($search_datec_start).
"'";
610if ($search_datec_end) {
611 $sql .=
" AND d.datec <= '".$db->idate($search_datec_end).
"'";
613if ($search_datem_start) {
614 $sql .=
" AND d.tms >= '".$db->idate($search_datem_start).
"'";
616if ($search_datem_end) {
617 $sql .=
" AND d.tms <= '".$db->idate($search_datem_end).
"'";
620include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
622$parameters = array();
623$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
624$sql .= $hookmanager->resPrint;
627$nbtotalofrecords =
'';
630 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
631 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
632 $resql =
$db->query($sqlforcount);
634 $objforcount =
$db->fetch_object($resql);
635 $nbtotalofrecords = $objforcount->nbtotalofrecords;
640 if (($page * $limit) > (
int) $nbtotalofrecords) {
649$sql .=
$db->order($sortfield, $sortorder);
651 $sql .=
$db->plimit($limit + 1, $offset);
654$resql =
$db->query($sql);
660$num =
$db->num_rows($resql);
664if ($num == 1 &&
getDolGlobalInt(
'MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
665 $obj =
$db->fetch_object($resql);
667 header(
"Location: ".DOL_URL_ROOT.
'/adherents/card.php?id='.
$id);
674llxHeader(
'', $title, $help_url,
'', 0, 0, $morejs, $morecss,
'',
'mod-member page-list bodyforlist');
676$arrayofselected = is_array($toselect) ? $toselect : array();
679if ($search_type > 0) {
681 $result = $membertype->fetch((
int) $search_type);
682 $title .=
" (".$membertype->label.
")";
688 $query += [
'mode' => $mode];
690if ($contextpage != $_SERVER[
"PHP_SELF"]) {
691 $query += [
'contextpage' => $contextpage];
693if ($limit > 0 && $limit !=
$conf->liste_limit) {
694 $query += [
'limit' => $limit];
696if ($optioncss !=
'') {
697 $query += [
'optioncss' => $optioncss];
700 $query += [
'groupby' => $groupby];
702if ($search_all !=
"") {
703 $query += [
'search_all' => $search_all];
706 $query += [
'search_ref' => $search_ref];
708if ($search_civility) {
709 $query += [
'search_civility' => $search_civility];
711if ($search_firstname) {
712 $query += [
'search_firstname' => $search_firstname];
714if ($search_lastname) {
715 $query += [
'search_lastname' => $search_lastname];
718 $query += [
'search_gender' => $search_gender];
720if ($search_morphy !=
'' && $search_morphy !=
'-1') {
721 $query += [
'search_morphy' => $search_morphy];
724 $query += [
'search_login' => $search_login];
727 $query += [
'search_email' => $search_email];
729if ($search_no_email != -1) {
730 $query += [
'search_no_email' => $search_no_email];
732if ($search_categ > 0 || $search_categ == -2) {
733 $query += [
'search_categ' => $search_categ];
735if ($search_company) {
736 $query += [
'search_company' => $search_company];
738if ($search_address !=
'') {
739 $query += [
'search_address' => $search_address];
741if ($search_town !=
'') {
742 $query += [
'search_town' => $search_town];
744if ($search_zip !=
'') {
745 $query += [
'search_zip' => $search_zip];
747if ($search_state !=
'') {
748 $query += [
'search_state' => $search_state];
750if ($search_country !=
'') {
751 $query += [
'search_country' => $search_country];
753if ($search_phone !=
'') {
754 $query += [
'search_phone' => $search_phone];
756if ($search_phone_perso !=
'') {
757 $query += [
'search_phone_perso' => $search_phone_perso];
759if ($search_phone_mobile !=
'') {
760 $query += [
'search_phone_mobile' => $search_phone_mobile];
762if ($search_filter && $search_filter !=
'-1') {
763 $query += [
'search_filter' => $search_filter];
765if ($search_status !=
"" && $search_status != -3) {
766 $query += [
'search_status' => $search_status];
768if ($search_import_key !=
'') {
769 $query += [
'search_import_key' => $search_import_key];
771if ($search_type > 0) {
772 $query += [
'search_type' => $search_type];
774if ($search_datec_start) {
776 'search_datec_start_day' =>
dol_print_date($search_datec_start,
'%d'),
777 'search_datec_start_month' =>
dol_print_date($search_datec_start,
'%m'),
778 'search_datec_start_year' =>
dol_print_date($search_datec_start,
'%Y'),
781if ($search_datem_end) {
783 'search_datem_end_day' =>
dol_print_date($search_datem_end,
'%d'),
784 'search_datem_end_month' =>
dol_print_date($search_datem_end,
'%m'),
785 'search_datem_end_year' =>
dol_print_date($search_datem_end,
'%Y'),
790include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
793$parameters = array(
'query' => &$query);
794$reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object, $action);
797$param = http_build_query($query);
800$arrayofmassactions = array(
804if ($user->hasRight(
'adherent',
'creer')) {
805 $arrayofmassactions[
'close'] =
img_picto(
'',
'close_title',
'class="pictofixedwidth"').$langs->trans(
"Resiliate");
807if ($user->hasRight(
'adherent',
'supprimer')) {
808 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
810if (
isModEnabled(
'category') && $user->hasRight(
'adherent',
'creer')) {
811 $arrayofmassactions[
'preaffecttag'] =
img_picto(
'',
'category',
'class="pictofixedwidth"').$langs->trans(
"AffectTag");
813if ($user->hasRight(
'adherent',
'creer') && $user->hasRight(
'user',
'user',
'creer')) {
814 $arrayofmassactions[
'createexternaluser'] =
img_picto(
'',
'user',
'class="pictofixedwidth"').$langs->trans(
"CreateExternalUser");
816if ($user->hasRight(
'adherent',
'creer')) {
817 $arrayofmassactions[
'createsubscription'] =
img_picto(
'',
'payment',
'class="pictofixedwidth"').$langs->trans(
"CreateSubscription");
819if (
GETPOSTINT(
'nomassaction') || in_array($massaction, array(
'presend',
'predelete',
'preaffecttag'))) {
820 $arrayofmassactions = array();
822$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
824print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
825if ($optioncss !=
'') {
826 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
828print
'<input type="hidden" name="token" value="'.newToken().
'">';
829print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
830print
'<input type="hidden" name="action" value="list">';
831print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
832print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
833print
'<input type="hidden" name="page" value="'.$page.
'">';
834print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
835print
'<input type="hidden" name="page_y" value="">';
836print
'<input type="hidden" name="mode" value="'.$mode.
'">';
839$argsforbutton = $query;
840$argsforbutton[
'mode'] =
'common';
841$newcardbutton .=
dolGetButtonTitle($langs->trans(
'ViewList'),
'',
'fa fa-bars imgforviewmode',
dolBuildUrl($_SERVER[
"PHP_SELF"], $argsforbutton),
'', ((empty($mode) || $mode ==
'common') ? 2 : 1), array(
'morecss' =>
'reposition'));
842$argsforbutton[
'mode'] =
'kanban';
843$newcardbutton .=
dolGetButtonTitle($langs->trans(
'ViewKanban'),
'',
'fa fa-th-list imgforviewmode',
dolBuildUrl($_SERVER[
"PHP_SELF"], $argsforbutton),
'', ($mode ==
'kanban' ? 2 : 1), array(
'morecss' =>
'reposition'));
844$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'));
846$newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewMember'),
'',
'fa fa-plus-circle',
dolBuildUrl(DOL_URL_ROOT.
'/adherents/card.php', [
'action' =>
'create']),
'', $user->hasRight(
'adherent',
'creer'));
848print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
$object->picto, 0, $newcardbutton,
'', $limit, 0, 0, 1);
851$topicmail =
"Information";
852$modelmail =
"member";
854$trackid =
'mem'.$object->id;
855if ($massaction ==
'createsubscription') {
859 foreach ($toselect as
$id) {
861 $tmpmember->fetch(
$id);
862 $res = $adht->fetch($tmpmember->typeid);
864 $amounttmp = $adht->amount;
865 if (!empty($tmpmember->last_subscription_amount) && !
GETPOSTISSET(
'newamount') && is_numeric($amounttmp)) {
866 $amounttmp = max($tmpmember->last_subscription_amount, $amount);
868 $amount = max(0, $amounttmp, $amount);
875 $formquestion = array(
876 array(
'label' => $langs->trans(
"DateSubscription"),
'type' =>
'other',
'value' => $date),
877 array(
'label' => $langs->trans(
"Amount"),
'type' =>
'text',
'value' =>
price($amount, 0,
'', 0),
'name' =>
'amount'),
878 array(
'label' => $langs->trans(
"Label"),
'type' =>
'text',
'value' =>
'',
'name' =>
'label'),
879 array(
'type' =>
'separator'),
880 array(
'label' => $langs->trans(
"MoreActions"),
'type' =>
'other',
'value' => $langs->trans(
"None").
' '.
img_warning($langs->trans(
"WarningNoComplementaryActionDone"))),
882 print $form->formconfirm($_SERVER[
"PHP_SELF"], $langs->trans(
"ConfirmMassSubsriptionCreation"), $langs->trans(
"ConfirmMassSubsriptionCreationQuestion", count($toselect)),
"createsubscription_confirm", $formquestion,
'', 0, 200, 500, 1);
884include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
888 foreach ($fieldstosearchall as $key => $val) {
889 $fieldstosearchall[$key] = $langs->trans($val);
890 $setupstring .= $key.
"=".$val.
";";
892 print
'<!-- Search done like if MYOBJECT_QUICKSEARCH_ON_FIELDS = '.$setupstring.
' -->'.
"\n";
893 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).implode(
', ', $fieldstosearchall).
'</div>'.
"\n";
896$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
897$htmlofselectarray = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
$conf->main_checkbox_left_column);
898$selectedfields = ($mode !=
'kanban' ? $htmlofselectarray :
'');
899$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
903if (
isModEnabled(
'category') && $user->hasRight(
'categorie',
'lire')) {
904 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
905 $moreforfilter .=
'<div class="divsearchfield">';
906 $moreforfilter .=
img_picto($langs->trans(
'Categories'),
'category',
'class="pictofixedwidth"').$formother->select_categories(Categorie::TYPE_MEMBER, $search_categ,
'search_categ', 1, $langs->trans(
"MembersCategoriesShort"));
907 $moreforfilter .=
'</div>';
910 'arrayfields' => &$arrayfields,
912$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
913if (empty($reshook)) {
914 $moreforfilter .= $hookmanager->resPrint;
916 $moreforfilter = $hookmanager->resPrint;
918if (!empty($moreforfilter)) {
919 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
920 print $moreforfilter;
924print
'<div class="div-table-responsive">';
925print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
929print
'<tr class="liste_titre_filter">';
932if (
$conf->main_checkbox_left_column) {
933 print
'<td class="liste_titre center maxwidthsearch">';
934 $searchpicto = $form->showFilterButtons(
'left');
940if (!empty($arrayfields[
'd.rowid'][
'checked'])) {
941 print
'<td class="liste_titre">';
942 print
'<input class="flat" size="6" type="text" name="search_id" value="'.dol_escape_htmltag($search_id).
'">';
947if (!empty($arrayfields[
'd.ref'][
'checked'])) {
948 print
'<td class="liste_titre">';
949 print
'<input type="text" class="flat maxwidth75imp" name="search_ref" value="'.dol_escape_htmltag($search_ref).
'">';
954if (!empty($arrayfields[
'd.civility'][
'checked'])) {
955 print
'<td class="liste_titre left">';
956 print
'<input class="flat maxwidth50imp" type="text" name="search_civility" value="'.dol_escape_htmltag($search_civility).
'"></td>';
960if (!empty($arrayfields[
'd.lastname'][
'checked'])) {
961 print
'<td class="liste_titre left">';
962 print
'<input class="flat maxwidth75imp" type="text" name="search_lastname" value="'.dol_escape_htmltag($search_lastname).
'"></td>';
966if (!empty($arrayfields[
'd.firstname'][
'checked'])) {
967 print
'<td class="liste_titre left">';
968 print
'<input class="flat maxwidth75imp" type="text" name="search_firstname" value="'.dol_escape_htmltag($search_firstname).
'"></td>';
972if (!empty($arrayfields[
'd.gender'][
'checked'])) {
973 print
'<td class="liste_titre">';
974 $arraygender = array(
'man' => $langs->trans(
"Genderman"),
'woman' => $langs->trans(
"Genderwoman"),
'other' => $langs->trans(
"Genderother"));
975 print $form->selectarray(
'search_gender', $arraygender, $search_gender, 1);
980if (!empty($arrayfields[
'd.societe'][
'checked'])) {
981 print
'<td class="liste_titre left">';
982 print
'<input class="flat maxwidth75imp" type="text" name="search_company" value="'.dol_escape_htmltag($search_company).
'"></td>';
986if (!empty($arrayfields[
'd.login'][
'checked'])) {
987 print
'<td class="liste_titre left">';
988 print
'<input class="flat maxwidth75imp" type="text" name="search_login" value="'.dol_escape_htmltag($search_login).
'"></td>';
992if (!empty($arrayfields[
'd.morphy'][
'checked'])) {
993 print
'<td class="liste_titre center">';
994 $arraymorphy = array(
'mor' => $langs->trans(
"Moral"),
'phy' => $langs->trans(
"Physical"));
995 print $form->selectarray(
'search_morphy', $arraymorphy, $search_morphy, 1, 0, 0,
'', 0, 0, 0,
'',
'maxwidth100');
1000if (!empty($arrayfields[
't.libelle'][
'checked'])) {
1001 print
'<td class="liste_titre">';
1002 $listetype = $membertypestatic->liste_array();
1004 print $form->selectarray(
"search_type", $listetype, $search_type, 1, 0, 0,
'', 0, 32, 0,
'',
'minwidth75 maxwidth100');
1009if (!empty($arrayfields[
'd.address'][
'checked'])) {
1010 print
'<td class="liste_titre left">';
1011 print
'<input class="flat maxwidth75imp" type="text" name="search_address" value="'.dol_escape_htmltag($search_address).
'"></td>';
1015if (!empty($arrayfields[
'd.zip'][
'checked'])) {
1016 print
'<td class="liste_titre left">';
1017 print
'<input class="flat maxwidth50imp" type="text" name="search_zip" value="'.dol_escape_htmltag($search_zip).
'"></td>';
1021if (!empty($arrayfields[
'd.town'][
'checked'])) {
1022 print
'<td class="liste_titre left">';
1023 print
'<input class="flat maxwidth75imp" type="text" name="search_town" value="'.dol_escape_htmltag($search_town).
'"></td>';
1027if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1028 print
'<td class="liste_titre">';
1029 print
'<input class="flat searchstring maxwidth75imp" type="text" name="search_state" value="'.dol_escape_htmltag($search_state).
'">';
1034if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1035 print
'<td class="liste_titre center">';
1036 print $form->select_country($search_country,
'search_country',
'', 0,
'minwidth100imp maxwidth100');
1041if (!empty($arrayfields[
'd.phone'][
'checked'])) {
1042 print
'<td class="liste_titre left">';
1043 print
'<input class="flat maxwidth75imp" type="text" name="search_phone" value="'.dol_escape_htmltag($search_phone).
'"></td>';
1047if (!empty($arrayfields[
'd.phone_perso'][
'checked'])) {
1048 print
'<td class="liste_titre left">';
1049 print
'<input class="flat maxwidth75imp" type="text" name="search_phone_perso" value="'.dol_escape_htmltag($search_phone_perso).
'"></td>';
1053if (!empty($arrayfields[
'd.phone_mobile'][
'checked'])) {
1054 print
'<td class="liste_titre left">';
1055 print
'<input class="flat maxwidth75imp" type="text" name="search_phone_mobile" value="'.dol_escape_htmltag($search_phone_mobile).
'"></td>';
1059if (!empty($arrayfields[
'd.email'][
'checked'])) {
1060 print
'<td class="liste_titre left">';
1061 print
'<input class="flat maxwidth75imp" type="text" name="search_email" value="'.dol_escape_htmltag($search_email).
'"></td>';
1065if (!empty($arrayfields[
'unsubscribed'][
'checked'])) {
1066 print
'<td class="liste_titre center">';
1067 print $form->selectarray(
'search_no_email', array(
'-1' =>
'',
'0' => $langs->trans(
'No'),
'1' => $langs->trans(
'Yes')), $search_no_email);
1072include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
1075$parameters = array(
'arrayfields' => $arrayfields);
1076$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters);
1077print $hookmanager->resPrint;
1080if (!empty($arrayfields[
'd.datec'][
'checked'])) {
1081 print
'<td class="liste_titre center">';
1082 print
'<div class="nowrapfordate">';
1083 print $form->selectDate($search_datec_start ? $search_datec_start : -1,
'search_datec_start_', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1085 print
'<div class="nowrapfordate">';
1086 print $form->selectDate($search_datec_end ? $search_datec_end : -1,
'search_datec_end_', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
1092if (!empty($arrayfields[
'd.birth'][
'checked'])) {
1093 print
'<td class="liste_titre">';
1098if (!empty($arrayfields[
'd.tms'][
'checked'])) {
1099 print
'<td class="liste_titre">';
1100 print
'<div class="nowrapfordate">';
1101 print $form->selectDate($search_datem_start ? $search_datem_start : -1,
'search_datem_start_', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1103 print
'<div class="nowrapfordate">';
1104 print $form->selectDate($search_datem_end ? $search_datem_end : -1,
'search_datem_end_', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
1110if (!empty($arrayfields[
'd.import_key'][
'checked'])) {
1111 print
'<td class="liste_titre center">';
1112 print
'<input class="flat searchstring maxwidth50" type="text" name="search_import_key" value="'.dol_escape_htmltag($search_import_key).
'">';
1117if (!empty($arrayfields[
'd.datefin'][
'checked'])) {
1118 print
'<td class="liste_titre center">';
1120 $selectarray = array(
'-1' =>
'',
'waitingsubscription' => $langs->trans(
"WaitingSubscription"),
'uptodate' => $langs->trans(
"UpToDate"),
'outofdate' => $langs->trans(
"OutOfDate"));
1121 print $form->selectarray(
'search_filter', $selectarray, $search_filter);
1126if (!empty($arrayfields[
'd.statut'][
'checked'])) {
1127 print
'<td class="liste_titre center parentonrightofpage">';
1128 $liststatus = array(
1135 print $form->selectarray(
'search_status', $liststatus, $search_status, -3, 0, 0,
'', 0, 0, 0,
'',
'search_status width100 onrightofpage');
1140if (!
$conf->main_checkbox_left_column) {
1141 print
'<td class="liste_titre center maxwidthsearch">';
1142 $searchpicto = $form->showFilterButtons();
1153print
'<tr class="liste_titre">';
1155if (
$conf->main_checkbox_left_column) {
1156 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch actioncolumn ');
1159if (!empty($arrayfields[
'd.rowid'][
'checked'])) {
1161 print_liste_field_titre($arrayfields[
'd.rowid'][
'label'], $_SERVER[
"PHP_SELF"],
'd.rowid',
'', $param,
'', $sortfield, $sortorder,
'center ');
1164if (!empty($arrayfields[
'd.ref'][
'checked'])) {
1165 print_liste_field_titre($arrayfields[
'd.ref'][
'label'], $_SERVER[
"PHP_SELF"],
'd.ref',
'', $param,
'', $sortfield, $sortorder);
1168if (!empty($arrayfields[
'd.civility'][
'checked'])) {
1169 print_liste_field_titre($arrayfields[
'd.civility'][
'label'], $_SERVER[
"PHP_SELF"],
'd.civility',
'', $param,
'', $sortfield, $sortorder);
1172if (!empty($arrayfields[
'd.lastname'][
'checked'])) {
1173 print_liste_field_titre($arrayfields[
'd.lastname'][
'label'], $_SERVER[
"PHP_SELF"],
'd.lastname',
'', $param,
'', $sortfield, $sortorder);
1176if (!empty($arrayfields[
'd.firstname'][
'checked'])) {
1177 print_liste_field_titre($arrayfields[
'd.firstname'][
'label'], $_SERVER[
"PHP_SELF"],
'd.firstname',
'', $param,
'', $sortfield, $sortorder);
1180if (!empty($arrayfields[
'd.gender'][
'checked'])) {
1181 print_liste_field_titre($arrayfields[
'd.gender'][
'label'], $_SERVER[
'PHP_SELF'],
'd.gender',
'', $param,
'', $sortfield, $sortorder);
1184if (!empty($arrayfields[
'd.societe'][
'checked'])) {
1185 print_liste_field_titre($arrayfields[
'd.societe'][
'label'], $_SERVER[
"PHP_SELF"],
'companyname',
'', $param,
'', $sortfield, $sortorder);
1188if (!empty($arrayfields[
'd.login'][
'checked'])) {
1189 print_liste_field_titre($arrayfields[
'd.login'][
'label'], $_SERVER[
"PHP_SELF"],
'd.login',
'', $param,
'', $sortfield, $sortorder);
1192if (!empty($arrayfields[
'd.morphy'][
'checked'])) {
1193 print_liste_field_titre($arrayfields[
'd.morphy'][
'label'], $_SERVER[
"PHP_SELF"],
'd.morphy',
'', $param,
'', $sortfield, $sortorder,
'center ');
1196if (!empty($arrayfields[
't.libelle'][
'checked'])) {
1197 print_liste_field_titre($arrayfields[
't.libelle'][
'label'], $_SERVER[
"PHP_SELF"],
't.libelle',
'', $param,
'', $sortfield, $sortorder);
1200if (!empty($arrayfields[
'd.address'][
'checked'])) {
1201 print_liste_field_titre($arrayfields[
'd.address'][
'label'], $_SERVER[
"PHP_SELF"],
'd.address',
'', $param,
'', $sortfield, $sortorder);
1204if (!empty($arrayfields[
'd.zip'][
'checked'])) {
1205 print_liste_field_titre($arrayfields[
'd.zip'][
'label'], $_SERVER[
"PHP_SELF"],
'd.zip',
'', $param,
'', $sortfield, $sortorder);
1208if (!empty($arrayfields[
'd.town'][
'checked'])) {
1209 print_liste_field_titre($arrayfields[
'd.town'][
'label'], $_SERVER[
"PHP_SELF"],
'd.town',
'', $param,
'', $sortfield, $sortorder);
1212if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1213 print_liste_field_titre($arrayfields[
'state.nom'][
'label'], $_SERVER[
"PHP_SELF"],
"state.nom",
"", $param,
'', $sortfield, $sortorder);
1216if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1217 print_liste_field_titre($arrayfields[
'country.code_iso'][
'label'], $_SERVER[
"PHP_SELF"],
"country.code_iso",
"", $param,
'', $sortfield, $sortorder,
'center ');
1220if (!empty($arrayfields[
'd.phone'][
'checked'])) {
1221 print_liste_field_titre($arrayfields[
'd.phone'][
'label'], $_SERVER[
"PHP_SELF"],
'd.phone',
'', $param,
'', $sortfield, $sortorder);
1224if (!empty($arrayfields[
'd.phone_perso'][
'checked'])) {
1225 print_liste_field_titre($arrayfields[
'd.phone_perso'][
'label'], $_SERVER[
"PHP_SELF"],
'd.phone_perso',
'', $param,
'', $sortfield, $sortorder);
1228if (!empty($arrayfields[
'd.phone_mobile'][
'checked'])) {
1229 print_liste_field_titre($arrayfields[
'd.phone_mobile'][
'label'], $_SERVER[
"PHP_SELF"],
'd.phone_mobile',
'', $param,
'', $sortfield, $sortorder);
1232if (!empty($arrayfields[
'd.email'][
'checked'])) {
1233 print_liste_field_titre($arrayfields[
'd.email'][
'label'], $_SERVER[
"PHP_SELF"],
'd.email',
'', $param,
'', $sortfield, $sortorder);
1236if (!empty($arrayfields[
'unsubscribed'][
'checked'])) {
1237 print_liste_field_titre($arrayfields[
'unsubscribed'][
'label'], $_SERVER[
"PHP_SELF"],
'unsubscribed',
'', $param,
'', $sortfield, $sortorder,
'center ');
1241include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
1244$parameters = array(
'arrayfields' => $arrayfields,
'totalarray' => &
$totalarray,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder);
1245$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters);
1246print $hookmanager->resPrint;
1248if (!empty($arrayfields[
'd.datec'][
'checked'])) {
1249 print_liste_field_titre($arrayfields[
'd.datec'][
'label'], $_SERVER[
"PHP_SELF"],
"d.datec",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1252if (!empty($arrayfields[
'd.birth'][
'checked'])) {
1253 print_liste_field_titre($arrayfields[
'd.birth'][
'label'], $_SERVER[
"PHP_SELF"],
"d.birth",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1256if (!empty($arrayfields[
'd.tms'][
'checked'])) {
1257 print_liste_field_titre($arrayfields[
'd.tms'][
'label'], $_SERVER[
"PHP_SELF"],
"d.tms",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1260if (!empty($arrayfields[
'd.import_key'][
'checked'])) {
1261 print_liste_field_titre($arrayfields[
'd.import_key'][
'label'], $_SERVER[
"PHP_SELF"],
"d.import_key",
"", $param,
'', $sortfield, $sortorder,
'center ');
1264if (!empty($arrayfields[
'd.datefin'][
'checked'])) {
1265 print_liste_field_titre($arrayfields[
'd.datefin'][
'label'], $_SERVER[
"PHP_SELF"],
'd.datefin,t.subscription',
'', $param,
'', $sortfield, $sortorder,
'center ');
1268if (!empty($arrayfields[
'd.statut'][
'checked'])) {
1269 print_liste_field_titre($arrayfields[
'd.statut'][
'label'], $_SERVER[
"PHP_SELF"],
"d.statut,t.subscription,d.datefin",
"", $param,
'', $sortfield, $sortorder,
'center ');
1272if (!
$conf->main_checkbox_left_column) {
1273 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'maxwidthsearch center ');
1284$imaxinloop = ($limit ? min($num, $limit) : $num);
1285while ($i < $imaxinloop) {
1286 $obj =
$db->fetch_object($resql);
1291 $datefin =
$db->jdate($obj->datefin);
1293 $memberstatic->id = $obj->rowid;
1294 $memberstatic->ref = $obj->ref;
1295 $memberstatic->civility_code = $obj->civility;
1296 $memberstatic->login = $obj->login;
1297 $memberstatic->lastname = $obj->lastname;
1298 $memberstatic->firstname = $obj->firstname;
1299 $memberstatic->gender = $obj->gender;
1300 $memberstatic->status = $obj->status;
1301 $memberstatic->datefin = $datefin;
1302 $memberstatic->socid = $obj->socid;
1303 $memberstatic->photo = $obj->photo;
1304 $memberstatic->email = $obj->email;
1305 $memberstatic->morphy = $obj->morphy;
1306 $memberstatic->note_public = $obj->note_public;
1307 $memberstatic->note_private = $obj->note_private;
1308 $memberstatic->need_subscription = $obj->subscription;
1310 if (!empty($obj->socid)) {
1311 $memberstatic->fetch_thirdparty();
1312 if ($memberstatic->thirdparty->id > 0) {
1313 $companyname = $memberstatic->thirdparty->name;
1314 $companynametoshow = $memberstatic->thirdparty->getNomUrl(1);
1316 $companyname =
null;
1317 $companynametoshow =
null;
1320 $companyname = $obj->company;
1321 $companynametoshow = $obj->company;
1323 $memberstatic->company = (
string) $companyname;
1327 if ($mode ==
'kanban') {
1329 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
1330 print
'<div class="box-flex-container kanban">';
1332 $membertypestatic->id = $obj->type_id;
1333 $membertypestatic->label = $obj->type;
1335 $memberstatic->type = $membertypestatic->label;
1336 $memberstatic->photo = $obj->photo;
1339 print $memberstatic->getKanbanView(
'', array(
'selected' => in_array(
$object->id, $arrayofselected)));
1340 if ($i == (min($num, $limit) - 1)) {
1347 print
'<tr data-rowid="'.$object->id.
'" class="oddeven row-with-select">';
1350 if (
$conf->main_checkbox_left_column) {
1351 print
'<td class="nowrap center">';
1352 if ($massactionbutton || $massaction) {
1354 if (in_array($obj->rowid, $arrayofselected)) {
1357 print
'<input id="cb'.$obj->rowid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1365 if (!empty($arrayfields[
'd.rowid'][
'checked'])) {
1366 print
'<td class="center" data-key="id">'.dolPrintHTML($obj->rowid).
'</td>';
1372 if (!empty($arrayfields[
'd.ref'][
'checked'])) {
1373 print
'<td class="tdoverflowmax150">';
1374 print $memberstatic->getNomUrl(-1, 0,
'card',
'ref',
'', -1, 0, 1);
1381 if (!empty($arrayfields[
'd.civility'][
'checked'])) {
1390 if (!empty($arrayfields[
'd.lastname'][
'checked'])) {
1391 print
'<td class="tdoverflowmax125">';
1392 print $memberstatic->getNomUrl(0, 0,
'card',
'lastname');
1400 if (!empty($arrayfields[
'd.firstname'][
'checked'])) {
1401 print
'<td class="tdoverflowmax125">';
1402 print $memberstatic->getNomUrl(0, 0,
'card',
'firstname');
1410 if (!empty($arrayfields[
'd.gender'][
'checked'])) {
1413 print $langs->trans(
"Gender".$obj->gender);
1421 if (!empty($arrayfields[
'd.societe'][
'checked'])) {
1422 print
'<td class="tdoverflowmax125">';
1423 print $companynametoshow;
1427 if (!empty($arrayfields[
'd.login'][
'checked'])) {
1428 print
'<td class="tdoverflowmax125" title="'.dolPrintHTMLForAttribute($obj->login).
'">'.
dolPrintHTML($obj->login).
"</td>\n";
1434 if (!empty($arrayfields[
'd.morphy'][
'checked'])) {
1435 print
'<td class="center">';
1436 print $memberstatic->getmorphylib(
'', 2);
1443 if (!empty($arrayfields[
't.libelle'][
'checked'])) {
1444 $membertypestatic->id = $obj->type_id;
1445 $membertypestatic->label = $obj->type;
1446 print
'<td class="nowraponall tdoverflowmax100">';
1447 print $membertypestatic->getNomUrl(1, 32);
1454 if (!empty($arrayfields[
'd.address'][
'checked'])) {
1455 print
'<td class="nocellnopadd tdoverflowmax200" title="'.dol_escape_htmltag($obj->address).
'">';
1463 if (!empty($arrayfields[
'd.zip'][
'checked'])) {
1464 print
'<td class="nocellnopadd">';
1472 if (!empty($arrayfields[
'd.town'][
'checked'])) {
1473 print
'<td class="nocellnopadd">';
1481 if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1490 if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1491 $tmparray =
getCountry($obj->country,
'all');
1492 print
'<td class="center tdoverflowmax100" title="'.dolPrintHTMLForAttribute($tmparray[
'label']).
'">';
1500 if (!empty($arrayfields[
'd.phone'][
'checked'])) {
1501 print
'<td class="nocellnopadd">';
1509 if (!empty($arrayfields[
'd.phone_perso'][
'checked'])) {
1510 print
'<td class="nocellnopadd">';
1518 if (!empty($arrayfields[
'd.phone_mobile'][
'checked'])) {
1519 print
'<td class="nocellnopadd">';
1527 if (!empty($arrayfields[
'd.email'][
'checked'])) {
1528 print
'<td class="tdoverflowmax150" title="'.dolPrintHTMLForAttribute($obj->email).
'">';
1529 $showinvalidemail =
getDolGlobalInt(
'MAIN_SHOW_INVALID_EMAIL_IN_LIST', 1);
1530 print
dol_print_email($obj->email, 0, 0, 1, 64, $showinvalidemail, 1);
1537 if (!empty($arrayfields[
'unsubscribed'][
'checked'])) {
1538 print
'<td class="center">'.yn(($obj->unsubscribed > 0) ? 1 : 0).
"</td>\n";
1544 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
1546 $parameters = array(
'arrayfields' => $arrayfields,
'obj' => $obj,
'i' => $i,
'totalarray' => &
$totalarray);
1547 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters);
1548 print $hookmanager->resPrint;
1550 if (!empty($arrayfields[
'd.datec'][
'checked'])) {
1551 print
'<td class="nowrap center">';
1559 if (!empty($arrayfields[
'd.birth'][
'checked'])) {
1560 print
'<td class="nowrap center">';
1568 if (!empty($arrayfields[
'd.tms'][
'checked'])) {
1569 print
'<td class="nowrap center">';
1577 if (!empty($arrayfields[
'd.import_key'][
'checked'])) {
1578 print
'<td class="tdoverflowmax100 center" title="'.dolPrintHTMLForAttribute($obj->import_key).
'">';
1586 $datefin =
$db->jdate($obj->datefin);
1587 if (!empty($arrayfields[
'd.datefin'][
'checked'])) {
1591 if ($memberstatic->hasDelay()) {
1592 $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").
')';
1593 $s .=
" ".img_warning($langs->trans(
"SubscriptionLate").$textlate);
1596 if (!empty($obj->subscription)) {
1597 $s .=
'<span class="opacitymedium">'.$langs->trans(
"SubscriptionNotReceived").
'</span>';
1598 if ($obj->status > 0) {
1599 $s .=
" ".img_warning();
1602 $s .=
'<span class="opacitymedium">'.$langs->trans(
"SubscriptionNotNeeded").
'</span>';
1605 print
'<td class="nowraponall center tdoverflowmax150" title="'.dolPrintHTMLForAttribute(
dol_string_nohtmltag($s)).
'">';
1613 if (!empty($arrayfields[
'd.statut'][
'checked'])) {
1614 print
'<td class="nowrap center">';
1615 print $memberstatic->LibStatut($obj->status, $obj->subscription, $datefin, 5);
1622 if (!
$conf->main_checkbox_left_column) {
1623 print
'<td class="center">';
1624 if ($massactionbutton || $massaction) {
1626 if (in_array($obj->rowid, $arrayofselected)) {
1629 print
'<input id="cb'.$obj->rowid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1643include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
1649 foreach ($arrayfields as $key => $val) {
1650 if (!empty($val[
'checked'])) {
1654 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
1659$parameters = array(
'arrayfields' => $arrayfields,
'sql' => $sql);
1660$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
1661print $hookmanager->resPrint;
1663print
'</table>'.
"\n";
1666print
'</form>'.
"\n";
1668if (in_array(
'builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords ===
'' || $nbtotalofrecords)) {
1669 $hidegeneratedfilelistifempty = 1;
1670 if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
1671 $hidegeneratedfilelistifempty = 0;
1674 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
1678 $urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
1679 $urlsource .= str_replace(
'&',
'&', $param);
1681 $filedir = $diroutputmassaction;
1682 $genallowed = $permissiontoread;
1683 $delallowed = $permissiontoadd;
1685 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_get_last_day($year, $month=12, $gm=false)
Return GMT time for last day of a month or year.
dol_time_plus_duree($time, $duration_value, $duration_unit, $ruleforendofmonth=0, $tz='')
Add a delay to a date.
dol_now($mode='gmt')
Return date for now.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed information (by default a local PHP server timestamp) Rep...
dol_print_email($email, $contactid=0, $socid=0, $addlink=0, $max=0, $showinvalid=2, $withpicto=0, $morecss='paddingrightonly')
Show EMail link formatted for HTML output.
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.
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 '.
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.
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.
dolGetButtonTitleSeparator($moreClass="")
Add space between dolGetButtonTitle.
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).
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
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 $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, $nodie=0, $mode='')
Check permissions of a user to show a page and an object.