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';
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);
312 if ($result < 0 && !count($tmpmember->errors)) {
331 if ($massaction ==
'createexternaluser' && $user->hasRight(
'adherent',
'creer') && $user->hasRight(
'user',
'user',
'creer')) {
337 foreach ($toselect as $idtoclose) {
338 $tmpmember->fetch($idtoclose);
340 if (!empty($tmpmember->socid)) {
344 $result = $nuser->create_from_member($tmpuser, $tmpmember->login);
346 if ($result < 0 && !count($tmpmember->errors)) {
357 setEventMessages($langs->trans(
"XExternalUserCreated", $nbcreated),
null,
'mesgs');
366 if ($action ==
'createsubscription_confirm' && $confirm ==
"yes" && $user->hasRight(
'adherent',
'creer')) {
381 } elseif (
getDolGlobalInt(
'MEMBER_SUBSCRIPTION_SUGGEST_END_OF_YEAR')) {
385 foreach ($toselect as
$id) {
386 $res = $tmpmember->fetch(
$id);
392 $datesubendthismember = $datesubend;
393 if (!$datesubendthismember && $tmpmember->typeid > 0) {
394 if ($adht->fetch($tmpmember->typeid) > 0) {
395 $delay = !empty($adht->duration_value) ? $adht->duration_value : 1;
396 $delayunit = !empty($adht->duration_unit) ? $adht->duration_unit :
'y';
400 $result = $tmpmember->subscription($now, (
float) $amount, 0,
'',
'',
'',
'',
'', $datesubendthismember);
412 setEventMessages($langs->trans(
"XSubsriptionCreated", $nbcreated),
null,
'mesgs');
415 setEventMessages($langs->trans(
"XSubsriptionErrors", $error),
null,
'mesgs');
421 $objectclass =
'Adherent';
422 $objectlabel =
'Members';
423 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
439$title = $langs->trans(
"Members");
440$help_url =
'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder';
448$sql .=
" d.rowid, d.ref, d.login, d.lastname, d.firstname, d.gender, d.societe as company, d.fk_soc as socid,";
449$sql .=
" d.civility, d.datefin, d.address, d.zip, d.town, d.state_id, d.country,";
450$sql .=
" d.email, d.phone, d.phone_perso, d.phone_mobile, d.birth, d.public, d.photo,";
451$sql .=
" d.fk_adherent_type as type_id, d.morphy, d.statut as status, d.datec as date_creation, d.tms as date_modification,";
452$sql .=
" d.note_private, d.note_public, d.import_key,";
454$sql .=
" ".$db->ifsql(
"d.societe IS NULL",
"s.nom",
"d.societe").
" as companyname,";
455$sql .=
" t.libelle as type, t.subscription,";
456$sql .=
" state.code_departement as state_code, state.nom as state_name";
459 $sql .=
", (SELECT count(*) FROM ".MAIN_DB_PREFIX.
"mailing_unsubscribe WHERE email = d.email) as unsubscribed";
463if (!empty($extrafields->attributes[
$object->table_element][
'label'])) {
464 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
465 $sql .= ($extrafields->attributes[
$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
"");
470$parameters = array();
471$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object, $action);
472$sql .= $hookmanager->resPrint;
473$sql = preg_replace(
'/,\s*$/',
'', $sql);
478$sql .=
" FROM ".MAIN_DB_PREFIX.
"adherent as d";
479if (!empty($extrafields->attributes[
$object->table_element][
'label']) && count($extrafields->attributes[
$object->table_element][
'label'])) {
480 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (d.rowid = ef.fk_object)";
482$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as country on (country.rowid = d.country)";
483$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_departements as state on (state.rowid = d.state_id)";
484$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s on (s.rowid = d.fk_soc)";
487$sql .=
", ".MAIN_DB_PREFIX.
"adherent_type as t";
488$sql .=
" WHERE d.fk_adherent_type = t.rowid";
490$searchCategoryContactList = $search_categ ? array($search_categ) : array();
491$searchCategoryContactOperator = 0;
493if (!empty($searchCategoryContactList)) {
494 $searchCategoryContactSqlList = array();
495 $listofcategoryid =
'';
496 foreach ($searchCategoryContactList as $searchCategoryContact) {
497 if (intval($searchCategoryContact) == -2) {
498 $searchCategoryContactSqlList[] =
"NOT EXISTS (SELECT ck.fk_categorie FROM ".MAIN_DB_PREFIX.
"categorie_member as ck WHERE d.rowid = ck.fk_member)";
499 } elseif (intval($searchCategoryContact) > 0) {
500 if ($searchCategoryContactOperator == 0) {
501 $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).
")";
503 $listofcategoryid .= ($listofcategoryid ?
', ' :
'') .((
int) $searchCategoryContact);
507 if ($listofcategoryid) {
508 $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).
"))";
510 if ($searchCategoryContactOperator == 1) {
511 if (!empty($searchCategoryContactSqlList)) {
512 $sql .=
" AND (".implode(
' OR ', $searchCategoryContactSqlList).
")";
515 if (!empty($searchCategoryContactSqlList)) {
516 $sql .=
" AND (".implode(
' AND ', $searchCategoryContactSqlList).
")";
521$sql .=
" AND d.entity IN (".getEntity(
'adherent').
")";
523 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
525if ($search_type > 0) {
526 $sql .=
" AND t.rowid=".((int) $search_type);
528if ($search_filter ==
'withoutsubscription') {
529 $sql .=
" AND (datefin IS NULL)";
531if ($search_filter ==
'waitingsubscription') {
532 $sql .=
" AND (datefin IS NULL AND t.subscription = '1')";
534if ($search_filter ==
'uptodate') {
537 $sql .=
" AND (datefin >= '".$db->idate($now).
"' OR (datefin IS NULL AND t.subscription = '0'))";
539if ($search_filter ==
'outofdate') {
540 $sql .=
" AND (datefin < '".$db->idate($now).
"')";
542if ($search_status !=
'') {
544 $sql .=
" AND d.statut in (".$db->sanitize(
$db->escape($search_status)).
")";
546if ($search_morphy !=
'' && $search_morphy !=
'-1') {
555if ($search_civility) {
558if ($search_firstname) {
561if ($search_lastname) {
564if ($search_gender !=
'' && $search_gender !=
'-1') {
570if ($search_company) {
571 $sql .=
natural_search(array(
"s.nom",
"d.societe"), $search_company);
576if ($search_no_email != -1 && $search_no_email > 0) {
577 $sql .=
" AND (SELECT count(*) FROM ".MAIN_DB_PREFIX.
"mailing_unsubscribe WHERE email = d.email) > 0";
579if ($search_no_email != -1 && $search_no_email == 0) {
580 $sql .=
" AND (SELECT count(*) FROM ".MAIN_DB_PREFIX.
"mailing_unsubscribe WHERE email = d.email) = 0 AND d.email IS NOT NULL AND d.email <> ''";
582if ($search_address) {
597if ($search_phone_perso) {
600if ($search_phone_mobile) {
603if ($search_country) {
604 $sql .=
" AND d.country IN (".$db->sanitize($search_country).
')';
606if ($search_import_key) {
609if ($search_datec_start) {
610 $sql .=
" AND d.datec >= '".$db->idate($search_datec_start).
"'";
612if ($search_datec_end) {
613 $sql .=
" AND d.datec <= '".$db->idate($search_datec_end).
"'";
615if ($search_datem_start) {
616 $sql .=
" AND d.tms >= '".$db->idate($search_datem_start).
"'";
618if ($search_datem_end) {
619 $sql .=
" AND d.tms <= '".$db->idate($search_datem_end).
"'";
622include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
624$parameters = array();
625$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
626$sql .= $hookmanager->resPrint;
629$nbtotalofrecords =
'';
632 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
633 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
634 $resql =
$db->query($sqlforcount);
636 $objforcount =
$db->fetch_object($resql);
637 $nbtotalofrecords = $objforcount->nbtotalofrecords;
642 if (($page * $limit) > (
int) $nbtotalofrecords) {
651$sql .=
$db->order($sortfield, $sortorder);
653 $sql .=
$db->plimit($limit + 1, $offset);
656$resql =
$db->query($sql);
662$num =
$db->num_rows($resql);
666if ($num == 1 &&
getDolGlobalInt(
'MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
667 $obj =
$db->fetch_object($resql);
669 header(
"Location: ".DOL_URL_ROOT.
'/adherents/card.php?id='.
$id);
676llxHeader(
'', $title, $help_url,
'', 0, 0, $morejs, $morecss,
'',
'mod-member page-list bodyforlist');
678$arrayofselected = is_array($toselect) ? $toselect : array();
681if ($search_type > 0) {
683 $result = $membertype->fetch((
int) $search_type);
684 $title .=
" (".$membertype->label.
")";
690 $query += [
'mode' => $mode];
692if ($contextpage != $_SERVER[
"PHP_SELF"]) {
693 $query += [
'contextpage' => $contextpage];
695if ($limit > 0 && $limit !=
$conf->liste_limit) {
696 $query += [
'limit' => $limit];
698if ($optioncss !=
'') {
699 $query += [
'optioncss' => $optioncss];
702 $query += [
'groupby' => $groupby];
704if ($search_all !=
"") {
705 $query += [
'search_all' => $search_all];
708 $query += [
'search_ref' => $search_ref];
710if ($search_civility) {
711 $query += [
'search_civility' => $search_civility];
713if ($search_firstname) {
714 $query += [
'search_firstname' => $search_firstname];
716if ($search_lastname) {
717 $query += [
'search_lastname' => $search_lastname];
720 $query += [
'search_gender' => $search_gender];
722if ($search_morphy !=
'' && $search_morphy !=
'-1') {
723 $query += [
'search_morphy' => $search_morphy];
726 $query += [
'search_login' => $search_login];
729 $query += [
'search_email' => $search_email];
731if ($search_no_email != -1) {
732 $query += [
'search_no_email' => $search_no_email];
734if ($search_categ > 0 || $search_categ == -2) {
735 $query += [
'search_categ' => $search_categ];
737if ($search_company) {
738 $query += [
'search_company' => $search_company];
740if ($search_address !=
'') {
741 $query += [
'search_address' => $search_address];
743if ($search_town !=
'') {
744 $query += [
'search_town' => $search_town];
746if ($search_zip !=
'') {
747 $query += [
'search_zip' => $search_zip];
749if ($search_state !=
'') {
750 $query += [
'search_state' => $search_state];
752if ($search_country !=
'') {
753 $query += [
'search_country' => $search_country];
755if ($search_phone !=
'') {
756 $query += [
'search_phone' => $search_phone];
758if ($search_phone_perso !=
'') {
759 $query += [
'search_phone_perso' => $search_phone_perso];
761if ($search_phone_mobile !=
'') {
762 $query += [
'search_phone_mobile' => $search_phone_mobile];
764if ($search_filter && $search_filter !=
'-1') {
765 $query += [
'search_filter' => $search_filter];
767if ($search_status !=
"" && $search_status != -3) {
768 $query += [
'search_status' => $search_status];
770if ($search_import_key !=
'') {
771 $query += [
'search_import_key' => $search_import_key];
773if ($search_type > 0) {
774 $query += [
'search_type' => $search_type];
776if ($search_datec_start) {
778 'search_datec_start_day' =>
dol_print_date($search_datec_start,
'%d'),
779 'search_datec_start_month' =>
dol_print_date($search_datec_start,
'%m'),
780 'search_datec_start_year' =>
dol_print_date($search_datec_start,
'%Y'),
783if ($search_datem_end) {
785 'search_datem_end_day' =>
dol_print_date($search_datem_end,
'%d'),
786 'search_datem_end_month' =>
dol_print_date($search_datem_end,
'%m'),
787 'search_datem_end_year' =>
dol_print_date($search_datem_end,
'%Y'),
792include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
795$parameters = array(
'query' => &$query);
796$reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object, $action);
799$param = http_build_query($query);
802$arrayofmassactions = array(
806if ($user->hasRight(
'adherent',
'creer')) {
807 $arrayofmassactions[
'close'] =
img_picto(
'',
'close_title',
'class="pictofixedwidth"').$langs->trans(
"Resiliate");
809if ($user->hasRight(
'adherent',
'supprimer')) {
810 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
812if (
isModEnabled(
'category') && $user->hasRight(
'adherent',
'creer')) {
813 $arrayofmassactions[
'preaffecttag'] =
img_picto(
'',
'category',
'class="pictofixedwidth"').$langs->trans(
"AffectTag");
815if ($user->hasRight(
'adherent',
'creer') && $user->hasRight(
'user',
'user',
'creer')) {
816 $arrayofmassactions[
'createexternaluser'] =
img_picto(
'',
'user',
'class="pictofixedwidth"').$langs->trans(
"CreateExternalUser");
818if ($user->hasRight(
'adherent',
'creer')) {
819 $arrayofmassactions[
'createsubscription'] =
img_picto(
'',
'payment',
'class="pictofixedwidth"').$langs->trans(
"CreateSubscription");
821if (
GETPOSTINT(
'nomassaction') || in_array($massaction, array(
'presend',
'predelete',
'preaffecttag'))) {
822 $arrayofmassactions = array();
824$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
826print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
827if ($optioncss !=
'') {
828 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
830print
'<input type="hidden" name="token" value="'.newToken().
'">';
831print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
832print
'<input type="hidden" name="action" value="list">';
833print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
834print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
835print
'<input type="hidden" name="page" value="'.$page.
'">';
836print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
837print
'<input type="hidden" name="page_y" value="">';
838print
'<input type="hidden" name="mode" value="'.$mode.
'">';
841$argsforbutton = $query;
842$argsforbutton[
'mode'] =
'common';
843$newcardbutton .=
dolGetButtonTitle($langs->trans(
'ViewList'),
'',
'fa fa-bars imgforviewmode',
dolBuildUrl($_SERVER[
"PHP_SELF"], $argsforbutton),
'', ((empty($mode) || $mode ==
'common') ? 2 : 1), array(
'morecss' =>
'reposition'));
844$argsforbutton[
'mode'] =
'kanban';
845$newcardbutton .=
dolGetButtonTitle($langs->trans(
'ViewKanban'),
'',
'fa fa-th-list imgforviewmode',
dolBuildUrl($_SERVER[
"PHP_SELF"], $argsforbutton),
'', ($mode ==
'kanban' ? 2 : 1), array(
'morecss' =>
'reposition'));
846$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'));
848$newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewMember'),
'',
'fa fa-plus-circle',
dolBuildUrl(DOL_URL_ROOT.
'/adherents/card.php', [
'action' =>
'create']),
'', $user->hasRight(
'adherent',
'creer'));
850print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
$object->picto, 0, $newcardbutton,
'', $limit, 0, 0, 1);
853$topicmail =
"Information";
854$modelmail =
"member";
856$trackid =
'mem'.$object->id;
857if ($massaction ==
'createsubscription') {
861 foreach ($toselect as
$id) {
863 $tmpmember->fetch(
$id);
864 $res = $adht->fetch($tmpmember->typeid);
866 $amounttmp = $adht->amount;
867 if (!empty($tmpmember->last_subscription_amount) && !GETPOSTISSET(
'newamount') && is_numeric($amounttmp)) {
868 $amounttmp = max($tmpmember->last_subscription_amount, $amount);
870 $amount = max(0, $amounttmp, $amount);
877 $formquestion = array(
878 array(
'label' => $langs->trans(
"DateSubscription"),
'type' =>
'other',
'value' => $date),
879 array(
'label' => $langs->trans(
"Amount"),
'type' =>
'text',
'value' =>
price($amount, 0,
'', 0),
'name' =>
'amount'),
880 array(
'label' => $langs->trans(
"Label"),
'type' =>
'text',
'value' =>
'',
'name' =>
'label'),
881 array(
'type' =>
'separator'),
882 array(
'label' => $langs->trans(
"MoreActions"),
'type' =>
'other',
'value' => $langs->trans(
"None").
' '.
img_warning($langs->trans(
"WarningNoComplementaryActionDone"))),
884 print $form->formconfirm($_SERVER[
"PHP_SELF"], $langs->trans(
"ConfirmMassSubsriptionCreation"), $langs->trans(
"ConfirmMassSubsriptionCreationQuestion", count($toselect)),
"createsubscription_confirm", $formquestion,
'', 0, 200, 500, 1);
886include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
890 foreach ($fieldstosearchall as $key => $val) {
891 $fieldstosearchall[$key] = $langs->trans($val);
892 $setupstring .= $key.
"=".$val.
";";
894 print
'<!-- Search done like if MYOBJECT_QUICKSEARCH_ON_FIELDS = '.$setupstring.
' -->'.
"\n";
895 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).implode(
', ', $fieldstosearchall).
'</div>'.
"\n";
898$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
899$htmlofselectarray = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
$conf->main_checkbox_left_column);
900$selectedfields = ($mode !=
'kanban' ? $htmlofselectarray :
'');
901$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
905if (
isModEnabled(
'category') && $user->hasRight(
'categorie',
'lire')) {
906 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
907 $moreforfilter .=
'<div class="divsearchfield">';
908 $moreforfilter .=
img_picto($langs->trans(
'Categories'),
'category',
'class="pictofixedwidth"').$formother->select_categories(Categorie::TYPE_MEMBER, $search_categ,
'search_categ', 1, $langs->trans(
"MembersCategoriesShort"));
909 $moreforfilter .=
'</div>';
912 'arrayfields' => &$arrayfields,
914$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
915if (empty($reshook)) {
916 $moreforfilter .= $hookmanager->resPrint;
918 $moreforfilter = $hookmanager->resPrint;
920if (!empty($moreforfilter)) {
921 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
922 print $moreforfilter;
926print
'<div class="div-table-responsive">';
927print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
931print
'<tr class="liste_titre_filter">';
934if (
$conf->main_checkbox_left_column) {
935 print
'<td class="liste_titre center maxwidthsearch">';
936 $searchpicto = $form->showFilterButtons(
'left');
942if (!empty($arrayfields[
'd.rowid'][
'checked'])) {
943 print
'<td class="liste_titre">';
944 print
'<input class="flat" size="6" type="text" name="search_id" value="'.dol_escape_htmltag($search_id).
'">';
949if (!empty($arrayfields[
'd.ref'][
'checked'])) {
950 print
'<td class="liste_titre">';
951 print
'<input type="text" class="flat maxwidth75imp" name="search_ref" value="'.dol_escape_htmltag($search_ref).
'">';
956if (!empty($arrayfields[
'd.civility'][
'checked'])) {
957 print
'<td class="liste_titre left">';
958 print
'<input class="flat maxwidth50imp" type="text" name="search_civility" value="'.dol_escape_htmltag($search_civility).
'"></td>';
962if (!empty($arrayfields[
'd.lastname'][
'checked'])) {
963 print
'<td class="liste_titre left">';
964 print
'<input class="flat maxwidth75imp" type="text" name="search_lastname" value="'.dol_escape_htmltag($search_lastname).
'"></td>';
968if (!empty($arrayfields[
'd.firstname'][
'checked'])) {
969 print
'<td class="liste_titre left">';
970 print
'<input class="flat maxwidth75imp" type="text" name="search_firstname" value="'.dol_escape_htmltag($search_firstname).
'"></td>';
974if (!empty($arrayfields[
'd.gender'][
'checked'])) {
975 print
'<td class="liste_titre">';
976 $arraygender = array(
'man' => $langs->trans(
"Genderman"),
'woman' => $langs->trans(
"Genderwoman"),
'other' => $langs->trans(
"Genderother"));
977 print $form->selectarray(
'search_gender', $arraygender, $search_gender, 1);
982if (!empty($arrayfields[
'd.societe'][
'checked'])) {
983 print
'<td class="liste_titre left">';
984 print
'<input class="flat maxwidth75imp" type="text" name="search_company" value="'.dol_escape_htmltag($search_company).
'"></td>';
988if (!empty($arrayfields[
'd.login'][
'checked'])) {
989 print
'<td class="liste_titre left">';
990 print
'<input class="flat maxwidth75imp" type="text" name="search_login" value="'.dol_escape_htmltag($search_login).
'"></td>';
994if (!empty($arrayfields[
'd.morphy'][
'checked'])) {
995 print
'<td class="liste_titre center">';
996 $arraymorphy = array(
'mor' => $langs->trans(
"Moral"),
'phy' => $langs->trans(
"Physical"));
997 print $form->selectarray(
'search_morphy', $arraymorphy, $search_morphy, 1, 0, 0,
'', 0, 0, 0,
'',
'maxwidth100');
1002if (!empty($arrayfields[
't.libelle'][
'checked'])) {
1003 print
'<td class="liste_titre">';
1004 $listetype = $membertypestatic->liste_array();
1006 print $form->selectarray(
"search_type", $listetype, $search_type, 1, 0, 0,
'', 0, 32, 0,
'',
'minwidth75 maxwidth100');
1011if (!empty($arrayfields[
'd.address'][
'checked'])) {
1012 print
'<td class="liste_titre left">';
1013 print
'<input class="flat maxwidth75imp" type="text" name="search_address" value="'.dol_escape_htmltag($search_address).
'"></td>';
1017if (!empty($arrayfields[
'd.zip'][
'checked'])) {
1018 print
'<td class="liste_titre left">';
1019 print
'<input class="flat maxwidth50imp" type="text" name="search_zip" value="'.dol_escape_htmltag($search_zip).
'"></td>';
1023if (!empty($arrayfields[
'd.town'][
'checked'])) {
1024 print
'<td class="liste_titre left">';
1025 print
'<input class="flat maxwidth75imp" type="text" name="search_town" value="'.dol_escape_htmltag($search_town).
'"></td>';
1029if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1030 print
'<td class="liste_titre">';
1031 print
'<input class="flat searchstring maxwidth75imp" type="text" name="search_state" value="'.dol_escape_htmltag($search_state).
'">';
1036if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1037 print
'<td class="liste_titre center">';
1038 print $form->select_country($search_country,
'search_country',
'', 0,
'minwidth100imp maxwidth100');
1043if (!empty($arrayfields[
'd.phone'][
'checked'])) {
1044 print
'<td class="liste_titre left">';
1045 print
'<input class="flat maxwidth75imp" type="text" name="search_phone" value="'.dol_escape_htmltag($search_phone).
'"></td>';
1049if (!empty($arrayfields[
'd.phone_perso'][
'checked'])) {
1050 print
'<td class="liste_titre left">';
1051 print
'<input class="flat maxwidth75imp" type="text" name="search_phone_perso" value="'.dol_escape_htmltag($search_phone_perso).
'"></td>';
1055if (!empty($arrayfields[
'd.phone_mobile'][
'checked'])) {
1056 print
'<td class="liste_titre left">';
1057 print
'<input class="flat maxwidth75imp" type="text" name="search_phone_mobile" value="'.dol_escape_htmltag($search_phone_mobile).
'"></td>';
1061if (!empty($arrayfields[
'd.email'][
'checked'])) {
1062 print
'<td class="liste_titre left">';
1063 print
'<input class="flat maxwidth75imp" type="text" name="search_email" value="'.dol_escape_htmltag($search_email).
'"></td>';
1067if (!empty($arrayfields[
'unsubscribed'][
'checked'])) {
1068 print
'<td class="liste_titre center">';
1069 print $form->selectarray(
'search_no_email', array(
'-1' =>
'',
'0' => $langs->trans(
'No'),
'1' => $langs->trans(
'Yes')), $search_no_email);
1074include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
1077$parameters = array(
'arrayfields' => $arrayfields);
1078$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters);
1079print $hookmanager->resPrint;
1082if (!empty($arrayfields[
'd.datec'][
'checked'])) {
1083 print
'<td class="liste_titre center">';
1084 print
'<div class="nowrapfordate">';
1085 print $form->selectDate($search_datec_start ? $search_datec_start : -1,
'search_datec_start_', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1087 print
'<div class="nowrapfordate">';
1088 print $form->selectDate($search_datec_end ? $search_datec_end : -1,
'search_datec_end_', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
1094if (!empty($arrayfields[
'd.birth'][
'checked'])) {
1095 print
'<td class="liste_titre">';
1100if (!empty($arrayfields[
'd.tms'][
'checked'])) {
1101 print
'<td class="liste_titre">';
1102 print
'<div class="nowrapfordate">';
1103 print $form->selectDate($search_datem_start ? $search_datem_start : -1,
'search_datem_start_', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1105 print
'<div class="nowrapfordate">';
1106 print $form->selectDate($search_datem_end ? $search_datem_end : -1,
'search_datem_end_', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
1112if (!empty($arrayfields[
'd.import_key'][
'checked'])) {
1113 print
'<td class="liste_titre center">';
1114 print
'<input class="flat searchstring maxwidth50" type="text" name="search_import_key" value="'.dol_escape_htmltag($search_import_key).
'">';
1119if (!empty($arrayfields[
'd.datefin'][
'checked'])) {
1120 print
'<td class="liste_titre center">';
1122 $selectarray = array(
'-1' =>
'',
'waitingsubscription' => $langs->trans(
"WaitingSubscription"),
'uptodate' => $langs->trans(
"UpToDate"),
'outofdate' => $langs->trans(
"OutOfDate"));
1123 print $form->selectarray(
'search_filter', $selectarray, $search_filter);
1128if (!empty($arrayfields[
'd.statut'][
'checked'])) {
1129 print
'<td class="liste_titre center parentonrightofpage">';
1130 $liststatus = array(
1137 print $form->selectarray(
'search_status', $liststatus, $search_status, -3, 0, 0,
'', 0, 0, 0,
'',
'search_status width100 onrightofpage');
1142if (!
$conf->main_checkbox_left_column) {
1143 print
'<td class="liste_titre center maxwidthsearch">';
1144 $searchpicto = $form->showFilterButtons();
1155print
'<tr class="liste_titre">';
1157if (
$conf->main_checkbox_left_column) {
1158 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch actioncolumn ');
1161if (!empty($arrayfields[
'd.rowid'][
'checked'])) {
1163 print_liste_field_titre($arrayfields[
'd.rowid'][
'label'], $_SERVER[
"PHP_SELF"],
'd.rowid',
'', $param,
'', $sortfield, $sortorder,
'center ');
1166if (!empty($arrayfields[
'd.ref'][
'checked'])) {
1167 print_liste_field_titre($arrayfields[
'd.ref'][
'label'], $_SERVER[
"PHP_SELF"],
'd.ref',
'', $param,
'', $sortfield, $sortorder);
1170if (!empty($arrayfields[
'd.civility'][
'checked'])) {
1171 print_liste_field_titre($arrayfields[
'd.civility'][
'label'], $_SERVER[
"PHP_SELF"],
'd.civility',
'', $param,
'', $sortfield, $sortorder);
1174if (!empty($arrayfields[
'd.lastname'][
'checked'])) {
1175 print_liste_field_titre($arrayfields[
'd.lastname'][
'label'], $_SERVER[
"PHP_SELF"],
'd.lastname',
'', $param,
'', $sortfield, $sortorder);
1178if (!empty($arrayfields[
'd.firstname'][
'checked'])) {
1179 print_liste_field_titre($arrayfields[
'd.firstname'][
'label'], $_SERVER[
"PHP_SELF"],
'd.firstname',
'', $param,
'', $sortfield, $sortorder);
1182if (!empty($arrayfields[
'd.gender'][
'checked'])) {
1183 print_liste_field_titre($arrayfields[
'd.gender'][
'label'], $_SERVER[
'PHP_SELF'],
'd.gender',
'', $param,
'', $sortfield, $sortorder);
1186if (!empty($arrayfields[
'd.societe'][
'checked'])) {
1187 print_liste_field_titre($arrayfields[
'd.societe'][
'label'], $_SERVER[
"PHP_SELF"],
'companyname',
'', $param,
'', $sortfield, $sortorder);
1190if (!empty($arrayfields[
'd.login'][
'checked'])) {
1191 print_liste_field_titre($arrayfields[
'd.login'][
'label'], $_SERVER[
"PHP_SELF"],
'd.login',
'', $param,
'', $sortfield, $sortorder);
1194if (!empty($arrayfields[
'd.morphy'][
'checked'])) {
1195 print_liste_field_titre($arrayfields[
'd.morphy'][
'label'], $_SERVER[
"PHP_SELF"],
'd.morphy',
'', $param,
'', $sortfield, $sortorder);
1198if (!empty($arrayfields[
't.libelle'][
'checked'])) {
1199 print_liste_field_titre($arrayfields[
't.libelle'][
'label'], $_SERVER[
"PHP_SELF"],
't.libelle',
'', $param,
'', $sortfield, $sortorder);
1202if (!empty($arrayfields[
'd.address'][
'checked'])) {
1203 print_liste_field_titre($arrayfields[
'd.address'][
'label'], $_SERVER[
"PHP_SELF"],
'd.address',
'', $param,
'', $sortfield, $sortorder);
1206if (!empty($arrayfields[
'd.zip'][
'checked'])) {
1207 print_liste_field_titre($arrayfields[
'd.zip'][
'label'], $_SERVER[
"PHP_SELF"],
'd.zip',
'', $param,
'', $sortfield, $sortorder);
1210if (!empty($arrayfields[
'd.town'][
'checked'])) {
1211 print_liste_field_titre($arrayfields[
'd.town'][
'label'], $_SERVER[
"PHP_SELF"],
'd.town',
'', $param,
'', $sortfield, $sortorder);
1214if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1215 print_liste_field_titre($arrayfields[
'state.nom'][
'label'], $_SERVER[
"PHP_SELF"],
"state.nom",
"", $param,
'', $sortfield, $sortorder);
1218if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1219 print_liste_field_titre($arrayfields[
'country.code_iso'][
'label'], $_SERVER[
"PHP_SELF"],
"country.code_iso",
"", $param,
'', $sortfield, $sortorder,
'center ');
1222if (!empty($arrayfields[
'd.phone'][
'checked'])) {
1223 print_liste_field_titre($arrayfields[
'd.phone'][
'label'], $_SERVER[
"PHP_SELF"],
'd.phone',
'', $param,
'', $sortfield, $sortorder);
1226if (!empty($arrayfields[
'd.phone_perso'][
'checked'])) {
1227 print_liste_field_titre($arrayfields[
'd.phone_perso'][
'label'], $_SERVER[
"PHP_SELF"],
'd.phone_perso',
'', $param,
'', $sortfield, $sortorder);
1230if (!empty($arrayfields[
'd.phone_mobile'][
'checked'])) {
1231 print_liste_field_titre($arrayfields[
'd.phone_mobile'][
'label'], $_SERVER[
"PHP_SELF"],
'd.phone_mobile',
'', $param,
'', $sortfield, $sortorder);
1234if (!empty($arrayfields[
'd.email'][
'checked'])) {
1235 print_liste_field_titre($arrayfields[
'd.email'][
'label'], $_SERVER[
"PHP_SELF"],
'd.email',
'', $param,
'', $sortfield, $sortorder);
1238if (!empty($arrayfields[
'unsubscribed'][
'checked'])) {
1239 print_liste_field_titre($arrayfields[
'unsubscribed'][
'label'], $_SERVER[
"PHP_SELF"],
'unsubscribed',
'', $param,
'', $sortfield, $sortorder,
'center ');
1243include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
1246$parameters = array(
'arrayfields' => $arrayfields,
'totalarray' => &
$totalarray,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder);
1247$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters);
1248print $hookmanager->resPrint;
1250if (!empty($arrayfields[
'd.datec'][
'checked'])) {
1251 print_liste_field_titre($arrayfields[
'd.datec'][
'label'], $_SERVER[
"PHP_SELF"],
"d.datec",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1254if (!empty($arrayfields[
'd.birth'][
'checked'])) {
1255 print_liste_field_titre($arrayfields[
'd.birth'][
'label'], $_SERVER[
"PHP_SELF"],
"d.birth",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1258if (!empty($arrayfields[
'd.tms'][
'checked'])) {
1259 print_liste_field_titre($arrayfields[
'd.tms'][
'label'], $_SERVER[
"PHP_SELF"],
"d.tms",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1262if (!empty($arrayfields[
'd.import_key'][
'checked'])) {
1263 print_liste_field_titre($arrayfields[
'd.import_key'][
'label'], $_SERVER[
"PHP_SELF"],
"d.import_key",
"", $param,
'', $sortfield, $sortorder,
'center ');
1266if (!empty($arrayfields[
'd.datefin'][
'checked'])) {
1267 print_liste_field_titre($arrayfields[
'd.datefin'][
'label'], $_SERVER[
"PHP_SELF"],
'd.datefin,t.subscription',
'', $param,
'', $sortfield, $sortorder,
'center ');
1270if (!empty($arrayfields[
'd.statut'][
'checked'])) {
1271 print_liste_field_titre($arrayfields[
'd.statut'][
'label'], $_SERVER[
"PHP_SELF"],
"d.statut,t.subscription,d.datefin",
"", $param,
'', $sortfield, $sortorder,
'center ');
1274if (!
$conf->main_checkbox_left_column) {
1275 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'maxwidthsearch center ');
1286$imaxinloop = ($limit ? min($num, $limit) : $num);
1287while ($i < $imaxinloop) {
1288 $obj =
$db->fetch_object($resql);
1293 $datefin =
$db->jdate($obj->datefin);
1295 $memberstatic->id = $obj->rowid;
1296 $memberstatic->ref = $obj->ref;
1297 $memberstatic->civility_code = $obj->civility;
1298 $memberstatic->login = $obj->login;
1299 $memberstatic->lastname = $obj->lastname;
1300 $memberstatic->firstname = $obj->firstname;
1301 $memberstatic->gender = $obj->gender;
1302 $memberstatic->status = $obj->status;
1303 $memberstatic->datefin = $datefin;
1304 $memberstatic->socid = $obj->socid;
1305 $memberstatic->photo = $obj->photo;
1306 $memberstatic->email = $obj->email;
1307 $memberstatic->morphy = $obj->morphy;
1308 $memberstatic->note_public = $obj->note_public;
1309 $memberstatic->note_private = $obj->note_private;
1310 $memberstatic->need_subscription = $obj->subscription;
1312 if (!empty($obj->socid)) {
1313 $memberstatic->fetch_thirdparty();
1314 if ($memberstatic->thirdparty->id > 0) {
1315 $companyname = $memberstatic->thirdparty->name;
1316 $companynametoshow = $memberstatic->thirdparty->getNomUrl(1);
1318 $companyname =
null;
1319 $companynametoshow =
null;
1322 $companyname = $obj->company;
1323 $companynametoshow = $obj->company;
1325 $memberstatic->company = (
string) $companyname;
1329 if ($mode ==
'kanban') {
1331 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
1332 print
'<div class="box-flex-container kanban">';
1334 $membertypestatic->id = $obj->type_id;
1335 $membertypestatic->label = $obj->type;
1337 $memberstatic->type = $membertypestatic->label;
1338 $memberstatic->photo = $obj->photo;
1341 print $memberstatic->getKanbanView(
'', array(
'selected' => in_array(
$object->id, $arrayofselected)));
1342 if ($i == (min($num, $limit) - 1)) {
1349 print
'<tr data-rowid="'.$object->id.
'" class="oddeven row-with-select">';
1352 if (
$conf->main_checkbox_left_column) {
1353 print
'<td class="nowrap center">';
1354 if ($massactionbutton || $massaction) {
1356 if (in_array($obj->rowid, $arrayofselected)) {
1359 print
'<input id="cb'.$obj->rowid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1367 if (!empty($arrayfields[
'd.rowid'][
'checked'])) {
1368 print
'<td class="center" data-key="id">'.dolPrintHTML($obj->rowid).
'</td>';
1374 if (!empty($arrayfields[
'd.ref'][
'checked'])) {
1375 print
'<td class="tdoverflowmax150">';
1376 print $memberstatic->getNomUrl(-1, 0,
'card',
'ref',
'', -1, 0, 1);
1383 if (!empty($arrayfields[
'd.civility'][
'checked'])) {
1392 if (!empty($arrayfields[
'd.lastname'][
'checked'])) {
1393 print
'<td class="tdoverflowmax125">';
1394 print $memberstatic->getNomUrl(0, 0,
'card',
'lastname');
1402 if (!empty($arrayfields[
'd.firstname'][
'checked'])) {
1403 print
'<td class="tdoverflowmax125">';
1404 print $memberstatic->getNomUrl(0, 0,
'card',
'firstname');
1412 if (!empty($arrayfields[
'd.gender'][
'checked'])) {
1415 print $langs->trans(
"Gender".$obj->gender);
1423 if (!empty($arrayfields[
'd.societe'][
'checked'])) {
1424 print
'<td class="tdoverflowmax125">';
1425 print $companynametoshow;
1429 if (!empty($arrayfields[
'd.login'][
'checked'])) {
1430 print
'<td class="tdoverflowmax125" title="'.dolPrintHTMLForAttribute($obj->login).
'">'.
dolPrintHTML($obj->login).
"</td>\n";
1436 if (!empty($arrayfields[
'd.morphy'][
'checked'])) {
1437 print
'<td class="center">';
1438 print $memberstatic->getmorphylib(
'', 2);
1445 if (!empty($arrayfields[
't.libelle'][
'checked'])) {
1446 $membertypestatic->id = $obj->type_id;
1447 $membertypestatic->label = $obj->type;
1448 print
'<td class="nowraponall tdoverflowmax100">';
1449 print $membertypestatic->getNomUrl(1, 32);
1456 if (!empty($arrayfields[
'd.address'][
'checked'])) {
1457 print
'<td class="nocellnopadd tdoverflowmax200" title="'.dol_escape_htmltag($obj->address).
'">';
1465 if (!empty($arrayfields[
'd.zip'][
'checked'])) {
1466 print
'<td class="nocellnopadd">';
1474 if (!empty($arrayfields[
'd.town'][
'checked'])) {
1475 print
'<td class="nocellnopadd">';
1483 if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1492 if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1493 $tmparray =
getCountry($obj->country,
'all');
1494 print
'<td class="center tdoverflowmax100" title="'.dolPrintHTMLForAttribute($tmparray[
'label']).
'">';
1502 if (!empty($arrayfields[
'd.phone'][
'checked'])) {
1503 print
'<td class="nocellnopadd">';
1511 if (!empty($arrayfields[
'd.phone_perso'][
'checked'])) {
1512 print
'<td class="nocellnopadd">';
1520 if (!empty($arrayfields[
'd.phone_mobile'][
'checked'])) {
1521 print
'<td class="nocellnopadd">';
1529 if (!empty($arrayfields[
'd.email'][
'checked'])) {
1530 print
'<td class="tdoverflowmax150" title="'.dolPrintHTMLForAttribute($obj->email).
'">';
1531 $showinvalidemail =
getDolGlobalInt(
'MAIN_SHOW_INVALID_EMAIL_IN_LIST', 1);
1532 print
dol_print_email($obj->email, 0, 0, 1, 64, $showinvalidemail, 1);
1539 if (!empty($arrayfields[
'unsubscribed'][
'checked'])) {
1540 print
'<td class="center">'.yn(($obj->unsubscribed > 0) ? 1 : 0).
"</td>\n";
1546 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
1548 $parameters = array(
'arrayfields' => $arrayfields,
'obj' => $obj,
'i' => $i,
'totalarray' => &
$totalarray);
1549 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters);
1550 print $hookmanager->resPrint;
1552 if (!empty($arrayfields[
'd.datec'][
'checked'])) {
1553 print
'<td class="nowrap center">';
1561 if (!empty($arrayfields[
'd.birth'][
'checked'])) {
1562 print
'<td class="nowrap center">';
1570 if (!empty($arrayfields[
'd.tms'][
'checked'])) {
1571 print
'<td class="nowrap center">';
1579 if (!empty($arrayfields[
'd.import_key'][
'checked'])) {
1580 print
'<td class="tdoverflowmax100 center" title="'.dolPrintHTMLForAttribute($obj->import_key).
'">';
1588 $datefin =
$db->jdate($obj->datefin);
1589 if (!empty($arrayfields[
'd.datefin'][
'checked'])) {
1593 if ($memberstatic->hasDelay()) {
1594 $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").
')';
1595 $s .=
" ".img_warning($langs->trans(
"SubscriptionLate").$textlate);
1598 if (!empty($obj->subscription)) {
1599 $s .=
'<span class="opacitymedium">'.$langs->trans(
"SubscriptionNotReceived").
'</span>';
1600 if ($obj->status > 0) {
1601 $s .=
" ".img_warning();
1604 $s .=
'<span class="opacitymedium">'.$langs->trans(
"SubscriptionNotNeeded").
'</span>';
1607 print
'<td class="nowraponall center tdoverflowmax150" title="'.dolPrintHTMLForAttribute(
dol_string_nohtmltag($s)).
'">';
1615 if (!empty($arrayfields[
'd.statut'][
'checked'])) {
1616 print
'<td class="nowrap center">';
1617 print $memberstatic->LibStatut($obj->status, $obj->subscription, $datefin, 5);
1624 if (!
$conf->main_checkbox_left_column) {
1625 print
'<td class="center">';
1626 if ($massactionbutton || $massaction) {
1628 if (in_array($obj->rowid, $arrayofselected)) {
1631 print
'<input id="cb'.$obj->rowid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1645include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
1651 foreach ($arrayfields as $key => $val) {
1652 if (!empty($val[
'checked'])) {
1656 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
1661$parameters = array(
'arrayfields' => $arrayfields,
'sql' => $sql);
1662$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
1663print $hookmanager->resPrint;
1665print
'</table>'.
"\n";
1668print
'</form>'.
"\n";
1670if (in_array(
'builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords ===
'' || $nbtotalofrecords)) {
1671 $hidegeneratedfilelistifempty = 1;
1672 if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
1673 $hidegeneratedfilelistifempty = 0;
1676 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
1680 $urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
1681 $urlsource .= str_replace(
'&',
'&', $param);
1683 $filedir = $diroutputmassaction;
1684 $genallowed = $permissiontoread;
1685 $delallowed = $permissiontoadd;
1687 print $formfile->showdocuments(
'massfilesarea_'.
$object->module,
'', $filedir, $urlsource, 0, $delallowed,
'', 1, 1, 0, 48, 1, $param, $title,
'',
'',
'',
null, $hidegeneratedfilelistifempty);
$id
Support class for third parties, contacts, members, users or resources.
if(! $sortfield) if(! $sortorder) $object
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Class to manage members of a foundation.
const STATUS_EXCLUDED
Excluded.
const STATUS_DRAFT
Draft status.
const STATUS_RESILIATED
Resiliated (membership end and was not renew)
const STATUS_VALIDATED
Validated status.
Class to manage members type.
Class to manage Dolibarr users.
getCountry($searchkey, $withcode='', $dbtouse=null, $outputlangs=null, $entconv=1, $searchlabel='')
Return country label, code or id from an id, code or label.
dol_time_plus_duree($time, $duration_value, $duration_unit, $ruleforendofmonth=0)
Add a delay to a date.
dol_get_last_day($year, $month=12, $gm=false)
Return GMT time for last day of a month or year.
dol_now($mode='gmt')
Return date for now.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed information (by default a local PHP server timestamp) Rep...
dol_print_email($email, $contactid=0, $socid=0, $addlink=0, $max=0, $showinvalid=2, $withpicto=0, $morecss='paddingrightonly')
Show EMail link formatted for HTML output.
dol_print_phone($phone, $countrycode='', $contactid=0, $socid=0, $addlink='', $separ=" ", $withpicto='', $titlealt='', $adddivfloat=0, $morecss='paddingright')
Format phone numbers according to country.
dol_string_nohtmltag($stringtoclean, $removelinefeed=1, $pagecodeto='UTF-8', $strip_tags=0, $removedoublespaces=1)
Clean a string from all HTML tags and entities.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
dolBuildUrl($url, $params=[], $addtoken=false, $anchor='')
Return path of url.
dol_eval($s, $returnvalue=1, $hideerrors=1, $onlysimplestring='1')
Replace eval function to add more security.
price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code='')
Function to format a value into an amount for visual output Function used into PDF and HTML pages.
natural_search($fields, $value, $mode=0, $nofirstand=0, $sqltoadd='')
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by the value of a given key, which produces ascending (default) or descending out...
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0, $nodefault=0)
Return value of a param into GET or POST supervariable.
GETPOSTINT($paramname, $method=0, $nodefault=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
dol_clone($srcobject, $native=2)
Create a clone of instance of object (new instance with same value for each properties) With native =...
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false, $decorate=0)
Output date in a string format according to outputlangs (or langs if not defined).
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...
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.
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.
dolGetButtonTitle($label, $helpText='', $iconClass='fa fa-file', $url='', $id='', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
dolGetButtonTitleSeparator($moreClass="")
Add space between dolGetButtonTitle.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
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
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.