35require
'../main.inc.php';
36require_once DOL_DOCUMENT_ROOT.
'/core/lib/member.lib.php';
37require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
38require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent_type.class.php';
39require_once DOL_DOCUMENT_ROOT.
'/core/class/extrafields.class.php';
40require_once DOL_DOCUMENT_ROOT.
'/product/class/html.formproduct.class.php';
51$langs->load(
"members");
54$action =
GETPOST(
'action',
'aZ09');
55$massaction =
GETPOST(
'massaction',
'alpha');
56$cancel =
GETPOST(
'cancel',
'alpha');
57$toselect =
GETPOST(
'toselect',
'array');
58$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') : str_replace(
'_',
'', basename(dirname(__FILE__)).basename(__FILE__,
'.php'));
59$backtopage =
GETPOST(
'backtopage',
'alpha');
60$mode =
GETPOST(
'mode',
'alpha');
62$sall =
GETPOST(
"sall",
"alpha");
63$filter =
GETPOST(
"filter",
'alpha');
64$search_ref =
GETPOST(
'search_ref',
'alpha');
65$search_lastname =
GETPOST(
'search_lastname',
'alpha');
66$search_login =
GETPOST(
'search_login',
'alpha');
67$search_email =
GETPOST(
'search_email',
'alpha');
68$type =
GETPOST(
'type',
'intcomma');
69$status =
GETPOST(
'status',
'alpha');
70$optioncss =
GETPOST(
'optioncss',
'alpha');
74$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
75$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
77if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
81$offset = $limit * $page;
88 $sortfield =
"d.lastname";
91$label =
GETPOST(
"label",
"alpha");
92$morphy =
GETPOST(
"morphy",
"alpha");
93$status =
GETPOST(
"status",
"intcomma");
95$amount =
GETPOST(
'amount',
'alpha');
97$duration_unit =
GETPOST(
'duration_unit',
'alpha');
99$comment =
GETPOST(
"comment",
'restricthtml');
100$mail_valid =
GETPOST(
"mail_valid",
'restricthtml');
106$hookmanager->initHooks(array(
'membertypecard',
'globalcard'));
109$extrafields->fetch_name_optionals_label(
$object->table_element);
114$arrayfields = array();
115foreach (
$object->fields as $key => $val) {
117 if (!empty($val[
'visible'])) {
118 $visible = (int)
dol_eval((
string) $val[
'visible'], 1);
119 $arrayfields[$tableprefix.
'.'.$key] = array(
120 'label' => $val[
'label'],
121 'checked' => (($visible < 0) ? 0 : 1),
122 'enabled' => (abs($visible) != 3 && (bool)
dol_eval($val[
'enabled'], 1)),
123 'position' => $val[
'position'],
124 'help' => isset($val[
'help']) ? $val[
'help'] :
''
131$result =
restrictedArea($user,
'adherent', $rowid,
'adherent_type');
139if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
141 $search_lastname =
"";
148if (
GETPOST(
'cancel',
'alpha')) {
152if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
159 if (!empty($backtopage)) {
160 header(
"Location: ".$backtopage);
165if ($action ==
'add' && $user->hasRight(
'adherent',
'configurer')) {
167 $object->morphy = trim($morphy);
168 $object->status = (int) $status;
169 $object->subscription = (int) $subscription;
171 $object->caneditamount = $caneditamount;
172 $object->duration_value = $duration_value;
173 $object->duration_unit = $duration_unit;
174 $object->note_public = trim($comment);
176 $object->mail_valid = trim($mail_valid);
180 $ret = $extrafields->setOptionalsFromPost(
null, $object);
187 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Label")),
null,
'errors');
189 $sql =
"SELECT libelle FROM ".MAIN_DB_PREFIX.
"adherent_type WHERE libelle = '".$db->escape(
$object->label).
"'";
190 $sql .=
" WHERE entity IN (".getEntity(
'member_type').
")";
191 $result = $db->query($sql);
194 $num = $db->num_rows($result);
198 $langs->load(
"errors");
206 $backurlforlist = $_SERVER[
"PHP_SELF"];
208 $urltogo = $backtopage ? str_replace(
'__ID__', (
string)
$id, $backtopage) : $backurlforlist;
209 $urltogo = preg_replace(
'/--IDFORBACKTOPAGE--/', (
string)
$object->id, $urltogo);
211 header(
"Location: " . $urltogo);
222if ($action ==
'update' && $user->hasRight(
'adherent',
'configurer')) {
228 $object->morphy = trim($morphy);
229 $object->status = (int) $status;
230 $object->subscription = (int) $subscription;
232 $object->caneditamount = $caneditamount;
233 $object->duration_value = $duration_value;
234 $object->duration_unit = $duration_unit;
235 $object->note_public = trim($comment);
237 $object->mail_valid = trim($mail_valid);
241 $ret = $extrafields->setOptionalsFromPost(
null, $object,
'@GETPOSTISSET');
248 if ($ret >= 0 && !count(
$object->errors)) {
254 header(
"Location: ".$_SERVER[
"PHP_SELF"].
"?rowid=".
$object->id);
258if ($action ==
'confirm_delete' && $user->hasRight(
'adherent',
'configurer')) {
264 header(
"Location: ".$_SERVER[
"PHP_SELF"]);
267 setEventMessages($langs->trans(
"MemberTypeCanNotBeDeleted"),
null,
'errors');
277$form =
new Form($db);
280$title = $langs->trans(
"MembersTypeSetup");
281$help_url =
'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder';
283llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'mod-member page-type');
285$arrayofselected = is_array($toselect) ? $toselect : array();
288if (!$rowid && $action !=
'create' && $action !=
'edit') {
291 $sql =
"SELECT d.rowid, d.libelle as label, d.subscription, d.amount, d.caneditamount, d.vote, d.statut as status, d.morphy, d.duration";
292 $sql .=
" FROM ".MAIN_DB_PREFIX.
"adherent_type as d";
293 $sql .=
" WHERE d.entity IN (".getEntity(
'member_type').
")";
295 $result = $db->query($sql);
297 $num = $db->num_rows($result);
298 $nbtotalofrecords = $num;
304 $param .=
'&mode='.urlencode($mode);
306 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
307 $param .=
'&contextpage='.$contextpage;
309 if ($limit > 0 && $limit !=
$conf->liste_limit) {
310 $param .=
'&limit='.$limit;
315 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'ViewList'),
'',
'fa fa-bars imgforviewmode', $_SERVER[
"PHP_SELF"].
'?mode=common'.preg_replace(
'/(&|\?)*mode=[^&]+/',
'', $param),
'', ((empty($mode) || $mode ==
'common') ? 2 : 1), array(
'morecss' =>
'reposition'));
316 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'ViewKanban'),
'',
'fa fa-th-list imgforviewmode', $_SERVER[
"PHP_SELF"].
'?mode=kanban'.preg_replace(
'/(&|\?)*mode=[^&]+/',
'', $param),
'', ($mode ==
'kanban' ? 2 : 1), array(
'morecss' =>
'reposition'));
318 if ($user->hasRight(
'adherent',
'configurer')) {
320 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewMemberType'),
'',
'fa fa-plus-circle', DOL_URL_ROOT.
'/adherents/type.php?action=create');
323 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
324 if ($optioncss !=
'') {
325 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
327 print
'<input type="hidden" name="token" value="'.newToken().
'">';
328 print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
329 print
'<input type="hidden" name="action" value="list">';
330 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
331 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
332 print
'<input type="hidden" name="mode" value="'.$mode.
'">';
335 print_barre_liste($langs->trans(
"MembersTypes"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder,
'', $num, $nbtotalofrecords,
'members', 0, $newcardbutton,
'', $limit, 0, 0, 1);
339 print
'<div class="div-table-responsive">';
340 print
'<table class="tagtable noborder liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
342 print
'<tr class="liste_titre">';
344 print
'<th> </th>';
346 print
'<th>'.$langs->trans(
"Ref").
'</th>';
347 print
'<th>'.$langs->trans(
"Label").
'</th>';
348 print
'<th class="center">'.$langs->trans(
"MembersNature").
'</th>';
349 print
'<th class="center">'.$langs->trans(
"MembershipDuration").
'</th>';
350 print
'<th class="center">'.$langs->trans(
"SubscriptionRequired").
'</th>';
351 print
'<th class="center">'.$langs->trans(
"Amount").
'</th>';
352 print
'<th class="center">'.$langs->trans(
"CanEditAmountShort").
'</th>';
353 print
'<th class="center">'.$langs->trans(
"VoteAllowed").
'</th>';
354 print
'<th class="center">'.$langs->trans(
"Status").
'</th>';
356 print
'<th> </th>';
368 $imaxinloop = ($limit ? min($num, $limit) : $num);
369 while ($i < $imaxinloop) {
370 $objp = $db->fetch_object($result);
372 $membertype->id = $objp->rowid;
373 $membertype->ref = $objp->rowid;
374 $membertype->label = $objp->rowid;
375 $membertype->status = $objp->status;
376 $membertype->subscription = $objp->subscription;
377 $membertype->amount = $objp->amount;
378 $membertype->caneditamount = $objp->caneditamount;
380 if ($mode ==
'kanban') {
382 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
383 print
'<div class="box-flex-container kanban">';
386 $membertype->label = $objp->label;
387 print $membertype->getKanbanView(
'', array(
'selected' => in_array(
$object->id, $arrayofselected)));
388 if ($i == ($imaxinloop - 1)) {
393 print
'<tr class="oddeven">';
396 if ($user->hasRight(
'adherent',
'configurer')) {
397 print
'<td class="center"><a class="editfielda" href="'.$_SERVER[
"PHP_SELF"].
'?action=edit&rowid='.$objp->rowid.
'">'.
img_edit().
'</a></td>';
401 print
'<td class="nowraponall">';
402 print $membertype->getNomUrl(1);
406 print
'<td>'.dol_escape_htmltag($objp->label).
'</td>';
408 print
'<td class="center">';
409 if ($objp->morphy ==
'phy') {
410 print $langs->trans(
"Physical");
411 } elseif ($objp->morphy ==
'mor') {
412 print $langs->trans(
"Moral");
414 print $langs->trans(
"MorAndPhy");
418 print
'<td class="center nowrap">';
419 if ($objp->duration) {
420 $duration_value = intval($objp->duration);
421 if ($duration_value > 1) {
422 $dur = array(
"i" => $langs->trans(
"Minutes"),
"h" => $langs->trans(
"Hours"),
"d" => $langs->trans(
"Days"),
"w" => $langs->trans(
"Weeks"),
"m" => $langs->trans(
"Months"),
"y" => $langs->trans(
"Years"));
424 $dur = array(
"i" => $langs->trans(
"Minute"),
"h" => $langs->trans(
"Hour"),
"d" => $langs->trans(
"Day"),
"w" => $langs->trans(
"Week"),
"m" => $langs->trans(
"Month"),
"y" => $langs->trans(
"Year"));
426 $unit = preg_replace(
"/[^a-zA-Z]+/",
"", $objp->duration);
427 print max(1, $duration_value).
' '.$dur[$unit];
431 print
'<td class="center">'.yn($objp->subscription).
'</td>';
433 print
'<td class="center"><span class="amount">'.(is_null($objp->amount) || $objp->amount ===
'' ?
'' :
price($objp->amount)).
'</span></td>';
435 print
'<td class="center">'.yn($objp->caneditamount).
'</td>';
437 print
'<td class="center">'.yn($objp->vote).
'</td>';
439 print
'<td class="center">'.$membertype->getLibStatut(5).
'</td>';
442 if ($user->hasRight(
'adherent',
'configurer')) {
443 print
'<td class="right"><a class="editfielda" href="'.$_SERVER[
"PHP_SELF"].
'?action=edit&rowid='.$objp->rowid.
'">'.
img_edit().
'</a></td>';
452 include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
457 foreach ($arrayfields as $key => $val) {
462 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
475if ($action ==
'create') {
478 print
'<form action="'.$_SERVER[
'PHP_SELF'].
'" method="POST">';
479 print
'<input type="hidden" name="token" value="'.newToken().
'">';
480 print
'<input type="hidden" name="action" value="add">';
481 print
'<input type="hidden" name="backtopage" value="'.$backtopage.
'">';
485 print
'<table class="border centpercent">';
488 print
'<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans(
"Label").
'</td><td><input type="text" class="minwidth200" name="label" autofocus="autofocus"></td></tr>';
490 print
'<tr><td>'.$langs->trans(
"Status").
'</td><td>';
491 print $form->selectarray(
'status', array(
'0' => $langs->trans(
'ActivityCeased'),
'1' => $langs->trans(
'InActivity')), 1, 0, 0, 0,
'', 0, 0, 0,
'',
'minwidth100');
496 $morphys[
""] = $langs->trans(
"MorAndPhy");
497 $morphys[
"phy"] = $langs->trans(
"Physical");
498 $morphys[
"mor"] = $langs->trans(
"Moral");
499 print
'<tr><td><span>'.$langs->trans(
"MembersNature").
'</span></td><td>';
500 print $form->selectarray(
"morphy", $morphys, GETPOSTISSET(
"morphy") ?
GETPOST(
"morphy",
'aZ09') :
'morphy');
503 print
'<tr><td>'.$form->textwithpicto($langs->trans(
"SubscriptionRequired"), $langs->trans(
"SubscriptionRequiredDesc")).
'</td><td>';
504 print $form->selectyesno(
"subscription", 1, 1);
507 print
'<tr><td>'.$langs->trans(
"Amount").
'</td><td>';
508 print
'<input name="amount" size="5" value="'.(GETPOSTISSET(
'amount') ?
GETPOST(
'amount') :
price($amount)).
'">';
511 print
'<tr><td>'.$form->textwithpicto($langs->trans(
"CanEditAmountShort"), $langs->transnoentities(
"CanEditAmount")).
'</td><td>';
512 print $form->selectyesno(
"caneditamount", GETPOSTISSET(
'caneditamount') ?
GETPOST(
'caneditamount') : 0, 1);
515 print
'<tr><td>'.$langs->trans(
"VoteAllowed").
'</td><td>';
516 print $form->selectyesno(
"vote", GETPOSTISSET(
"vote") ?
GETPOST(
'vote',
'aZ09') : 1, 1);
519 print
'<tr><td>'.$langs->trans(
"Duration").
'</td><td colspan="3">';
520 print
'<input name="duration_value" size="5" value="'.GETPOST(
'duraction_unit',
'aZ09').
'"> ';
521 print $formproduct->selectMeasuringUnits(
"duration_unit",
"time", GETPOSTISSET(
"duration_unit") ?
GETPOST(
'duration_unit',
'aZ09') :
'y', 0, 1);
524 print
'<tr><td class="tdtop">'.$langs->trans(
"Description").
'</td><td>';
525 require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
526 $doleditor =
new DolEditor(
'comment', (GETPOSTISSET(
'comment') ?
GETPOST(
'comment',
'restricthtml') :
$object->note_public),
'', 200,
'dolibarr_notes',
'', false, true, isModEnabled(
'fckeditor'), 15,
'90%');
527 $doleditor->Create();
529 print
'<tr><td class="tdtop">'.$langs->trans(
"WelcomeEMail").
'</td><td>';
530 require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
531 $doleditor =
new DolEditor(
'mail_valid', GETPOSTISSET(
'mail_valid') ?
GETPOST(
'mail_valid') :
$object->mail_valid,
'', 250,
'dolibarr_notes',
'', false, true, isModEnabled(
'fckeditor'), 15,
'90%');
532 $doleditor->Create();
536 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_add.tpl.php';
543 print $form->buttonsSaveCancel();
550 if ($action !=
'edit') {
558 if ($action ==
'delete') {
559 print $form->formconfirm($_SERVER[
'PHP_SELF'].
"?rowid=".
$object->id, $langs->trans(
"DeleteAMemberType"), $langs->trans(
"ConfirmDeleteMemberType",
$object->label),
"confirm_delete",
'', 0, 1);
566 $linkback =
'<a href="'.DOL_URL_ROOT.
'/adherents/type.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
568 dol_banner_tab($object,
'rowid', $linkback);
570 print
'<div class="fichecenter">';
571 print
'<div class="underbanner clearboth"></div>';
573 print
'<table class="tableforfield border centpercent">';
576 print
'<tr><td>'.$langs->trans(
"MembersNature").
'</td><td class="valeur" >'.
$object->getmorphylib(
$object->morphy).
'</td>';
579 print
'<tr><td>'.$form->textwithpicto($langs->trans(
"SubscriptionRequired"), $langs->trans(
"SubscriptionRequiredDesc")).
'</td><td>';
584 print
'<tr><td class="titlefield">'.$langs->trans(
"Amount").
'</td><td>';
588 print
'<tr><td>'.$form->textwithpicto($langs->trans(
"CanEditAmountShort"), $langs->transnoentities(
"CanEditAmount")).
'</td><td>';
592 print
'<tr><td>'.$langs->trans(
"VoteAllowed").
'</td><td>';
597 print
'<tr><td class="titlefield">'.$langs->trans(
"Duration").
'</td><td colspan="2">'.
$object->duration_value.
' ';
598 if (
$object->duration_value > 1) {
599 $dur = array(
"i" => $langs->trans(
"Minutes"),
"h" => $langs->trans(
"Hours"),
"d" => $langs->trans(
"Days"),
"w" => $langs->trans(
"Weeks"),
"m" => $langs->trans(
"Months"),
"y" => $langs->trans(
"Years"));
600 } elseif (
$object->duration_value > 0) {
601 $dur = array(
"i" => $langs->trans(
"Minute"),
"h" => $langs->trans(
"Hour"),
"d" => $langs->trans(
"Day"),
"w" => $langs->trans(
"Week"),
"m" => $langs->trans(
"Month"),
"y" => $langs->trans(
"Year"));
603 print(!empty(
$object->duration_unit) && isset($dur[
$object->duration_unit]) ? $langs->trans($dur[
$object->duration_unit]) :
'').
" ";
607 print
'<tr><td class="tdtop">'.$langs->trans(
"Description").
'</td><td><div class="longmessagecut">';
609 print
"</div></td></tr>";
612 print
'<tr><td class="tdtop">'.$langs->trans(
"WelcomeEMail").
'</td><td><div class="longmessagecut">';
614 print
"</div></td></tr>";
617 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
629 print
'<div class="tabsAction">';
632 if ($user->hasRight(
'adherent',
'configurer')) {
633 print
'<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER[
'PHP_SELF'].
'?action=edit&token='.
newToken().
'&rowid='.
$object->id.
'">'.$langs->trans(
"Modify").
'</a></div>';
637 if (
$object->morphy ==
'phy') {
639 } elseif (
$object->morphy ==
'mor') {
645 if ($user->hasRight(
'adherent',
'configurer') && !empty(
$object->status)) {
646 print
'<div class="inline-block divButAction"><a class="butAction" href="card.php?action=create&token='.newToken().
'&typeid='.
$object->id.($morphy ?
'&morphy='.urlencode($morphy) :
'').
'&backtopage='.urlencode($_SERVER[
"PHP_SELF"].
'?rowid='.
$object->id).
'">'.$langs->trans(
"AddMember").
'</a></div>';
648 print
'<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans(
"NoAddMember")).
'">'.$langs->trans(
"AddMember").
'</a></div>';
652 if ($user->hasRight(
'adherent',
'configurer')) {
653 print
'<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER[
'PHP_SELF'].
'?action=delete&token='.
newToken().
'&rowid='.
$object->id.
'">'.$langs->trans(
"DeleteType").
'</a></div>';
665 $sql =
"SELECT d.rowid, d.ref, d.entity, d.login, d.firstname, d.lastname, d.societe as company, d.fk_soc,";
666 $sql .=
" d.datefin,";
667 $sql .=
" d.email, d.photo, d.fk_adherent_type as type_id, d.morphy, d.statut as status,";
668 $sql .=
" t.libelle as type, t.subscription, t.amount";
672 $sql .=
" FROM ".MAIN_DB_PREFIX.
"adherent as d, ".MAIN_DB_PREFIX.
"adherent_type as t";
673 $sql .=
" WHERE d.fk_adherent_type = t.rowid ";
674 $sql .=
" AND d.entity IN (".getEntity(
'adherent').
")";
675 $sql .=
" AND t.rowid = ".((int)
$object->id);
677 $sql .=
natural_search(array(
"d.firstname",
"d.lastname",
"d.societe",
"d.email",
"d.login",
"d.address",
"d.town",
"d.note_public",
"d.note_private"), $sall);
682 if ($action ==
'search') {
683 if (
GETPOST(
'search',
'alpha')) {
687 if (!empty($search_ref)) {
690 if (!empty($search_lastname)) {
691 $sql .=
natural_search(array(
"d.firstname",
"d.lastname"), $search_lastname);
693 if (!empty($search_login)) {
696 if (!empty($search_email)) {
699 if ($filter ==
'uptodate') {
700 $sql .=
" AND (datefin >= '".$db->idate($now).
"') OR t.subscription = 0)";
702 if ($filter ==
'outofdate') {
703 $sql .=
" AND (datefin < '".$db->idate($now).
"' AND t.subscription = 1)";
707 $nbtotalofrecords =
'';
710 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
711 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
712 $resql = $db->query($sqlforcount);
714 $objforcount = $db->fetch_object($resql);
715 $nbtotalofrecords = $objforcount->nbtotalofrecords;
720 if (($page * $limit) > $nbtotalofrecords) {
728 $sql .= $db->order($sortfield, $sortorder);
730 $sql .= $db->plimit($limit + 1, $offset);
733 $resql = $db->query($sql);
735 $num = $db->num_rows($resql);
738 $titre = $langs->trans(
"MembersList");
740 if ($status ==
'-1,1') {
741 $titre = $langs->trans(
"MembersListQualified");
742 } elseif ($status ==
'-1') {
743 $titre = $langs->trans(
"MembersListToValid");
744 } elseif ($status ==
'1' && !$filter) {
745 $titre = $langs->trans(
"MembersListValid");
746 } elseif ($status ==
'1' && $filter ==
'uptodate') {
747 $titre = $langs->trans(
"MembersListUpToDate");
748 } elseif ($status ==
'1' && $filter ==
'outofdate') {
749 $titre = $langs->trans(
"MembersListNotUpToDate");
750 } elseif ($status ==
'0') {
751 $titre = $langs->trans(
"MembersListResiliated");
752 } elseif ($status ==
'-2') {
753 $titre = $langs->trans(
"MembersListExcluded");
755 } elseif ($action ==
'search') {
756 $titre = $langs->trans(
"MembersListQualified");
761 $result = $membertype->fetch($type);
762 $titre .=
" (".$membertype->label.
")";
765 $param =
"&rowid=".urlencode((
string) (
$object->id));
767 $param .=
'&mode='.urlencode($mode);
769 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
770 $param .=
'&contextpage='.urlencode($contextpage);
772 if ($limit > 0 && $limit !=
$conf->liste_limit) {
773 $param .=
'&limit='.((int) $limit);
775 if (!empty($status)) {
776 $param .=
"&status=".urlencode($status);
778 if (!empty($search_ref)) {
779 $param .=
"&search_ref=".urlencode($search_ref);
781 if (!empty($search_lastname)) {
782 $param .=
"&search_lastname=".urlencode($search_lastname);
784 if (!empty($search_login)) {
785 $param .=
"&search_login=".urlencode($search_login);
787 if (!empty($search_email)) {
788 $param .=
"&search_email=".urlencode($search_email);
790 if (!empty($filter)) {
791 $param .=
"&filter=".urlencode($filter);
795 print $langs->trans(
"Filter").
" (".$langs->trans(
"Lastname").
", ".$langs->trans(
"Firstname").
", ".$langs->trans(
"EMail").
", ".$langs->trans(
"Address").
" ".$langs->trans(
"or").
" ".$langs->trans(
"Town").
"): ".$sall;
798 print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'" name="formfilter" autocomplete="off">';
799 print
'<input type="hidden" name="token" value="'.newToken().
'">';
800 print
'<input class="flat" type="hidden" name="rowid" value="'.$object->id.
'"></td>';
801 print
'<input class="flat" type="hidden" name="page_y" value=""></td>';
803 print_barre_liste(
'', $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder,
'', $num, $nbtotalofrecords,
'generic', 0,
'',
'', $limit);
807 print
'<div class="div-table-responsive">';
808 print
'<table class="tagtable liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
811 print
'<tr class="liste_titre_filter">';
814 print
'<td class="liste_titre center maxwidthsearch">';
815 $searchpicto = $form->showFilterButtons(
'left');
820 print
'<td class="liste_titre left">';
821 print
'<input class="flat maxwidth100" type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref).
'"></td>';
823 print
'<td class="liste_titre left">';
824 print
'<input class="flat maxwidth100" type="text" name="search_lastname" value="'.dol_escape_htmltag($search_lastname).
'"></td>';
826 print
'<td class="liste_titre left">';
827 print
'<input class="flat maxwidth100" type="text" name="search_login" value="'.dol_escape_htmltag($search_login).
'"></td>';
829 print
'<td class="liste_titre"> </td>';
831 print
'<td class="liste_titre left">';
832 print
'<input class="flat maxwidth100" type="text" name="search_email" value="'.dol_escape_htmltag($search_email).
'"></td>';
834 print
'<td class="liste_titre"> </td>';
836 print
'<td class="liste_titre"> </td>';
839 print
'<td class="liste_titre center nowraponall">';
840 print
'<input type="image" class="liste_titre" src="'.DOL_URL_ROOT.
'/theme/'.
$conf->theme.
'/img/search.png" name="button_search" value="'.
dol_escape_htmltag($langs->trans(
"Search")).
'" title="'.
dol_escape_htmltag($langs->trans(
"Search")).
'">';
842 print
'<input type="image" class="liste_titre" src="'.DOL_URL_ROOT.
'/theme/'.
$conf->theme.
'/img/searchclear.png" name="button_removefilter" value="'.
dol_escape_htmltag($langs->trans(
"RemoveFilter")).
'" title="'.
dol_escape_htmltag($langs->trans(
"RemoveFilter")).
'">';
848 print
'<tr class="liste_titre">';
850 print_liste_field_titre(
"Action", $_SERVER[
"PHP_SELF"],
"", $param,
"",
'width="60" align="center"', $sortfield, $sortorder);
853 print_liste_field_titre(
"NameSlashCompany", $_SERVER[
"PHP_SELF"],
"d.lastname", $param,
"",
"", $sortfield, $sortorder);
855 print_liste_field_titre(
"MemberNature", $_SERVER[
"PHP_SELF"],
"d.morphy", $param,
"",
"", $sortfield, $sortorder);
857 print_liste_field_titre(
"Status", $_SERVER[
"PHP_SELF"],
"d.statut,d.datefin", $param,
"",
"", $sortfield, $sortorder);
858 print_liste_field_titre(
"EndSubscription", $_SERVER[
"PHP_SELF"],
"d.datefin", $param,
"",
'align="center"', $sortfield, $sortorder);
860 print_liste_field_titre(
"Action", $_SERVER[
"PHP_SELF"],
"", $param,
"",
'width="60" align="center"', $sortfield, $sortorder);
866 $imaxinloop = ($limit ? min($num, $limit) : $num);
867 while ($i < $imaxinloop) {
868 $objp = $db->fetch_object($resql);
870 $datefin = $db->jdate($objp->datefin);
872 $adh->id = $objp->rowid;
873 $adh->ref = $objp->ref;
874 $adh->login = $objp->login;
875 $adh->lastname = $objp->lastname;
876 $adh->firstname = $objp->firstname;
877 $adh->datefin = $datefin;
878 $adh->need_subscription = $objp->subscription;
879 $adh->statut = $objp->status;
880 $adh->status = $objp->status;
881 $adh->email = $objp->email;
882 $adh->photo = $objp->photo;
884 print
'<tr class="oddeven">';
888 print
'<td class="center">';
889 if ($user->hasRight(
'adherent',
'creer')) {
890 print
'<a class="editfielda marginleftonly" href="card.php?rowid='.$objp->rowid.
'&action=edit&token='.
newToken().
'&backtopage='.urlencode($_SERVER[
"PHP_SELF"].
'?rowid='.
$object->id).
'">'.
img_edit().
'</a>';
892 if ($user->hasRight(
'adherent',
'supprimer')) {
893 print
'<a class="marginleftonly" href="card.php?rowid='.$objp->rowid.
'&action=resiliate&token='.
newToken().
'">'.
img_picto($langs->trans(
"Resiliate"),
'disable.png').
'</a>';
900 print $adh->getNomUrl(-1, 0,
'card',
'ref',
'', -1, 0, 1);
904 if ($objp->company !=
'') {
905 print
'<td><a href="card.php?rowid='.$objp->rowid.
'">'.
img_object($langs->trans(
"ShowMember"),
"user",
'class="paddingright"').$adh->getFullName($langs, 0, -1, 20).
' / '.
dol_trunc($objp->company, 12).
'</a></td>'.
"\n";
907 print
'<td><a href="card.php?rowid='.$objp->rowid.
'">'.
img_object($langs->trans(
"ShowMember"),
"user",
'class="paddingright"').$adh->getFullName($langs, 0, -1, 32).
'</a></td>'.
"\n";
911 print
"<td>".dol_escape_htmltag($objp->login).
"</td>\n";
922 print
"<td>".$adh->getmorphylib($objp->morphy, 1).
"</td>\n";
925 print
"<td>".dol_print_email($objp->email, 0, 0, 1).
"</td>\n";
928 print
'<td class="nowrap">';
929 print $adh->getLibStatut(2);
934 print
'<td class="nowrap center">';
935 if ($datefin <
dol_now() && $objp->status > 0) {
942 print
'<td class="nowrap center">';
943 if (!empty($objp->subscription)) {
944 print
'<span class="opacitymedium">'.$langs->trans(
"SubscriptionNotReceived").
'</span>';
945 if ($objp->status > 0) {
946 print
" ".img_warning();
956 print
'<td class="center">';
957 if ($user->hasRight(
'adherent',
'creer')) {
958 print
'<a class="editfielda marginleftonly" href="card.php?rowid='.$objp->rowid.
'&action=edit&token='.
newToken().
'&backtopage='.urlencode($_SERVER[
"PHP_SELF"].
'?rowid='.
$object->id).
'">'.
img_edit().
'</a>';
960 if ($user->hasRight(
'adherent',
'supprimer')) {
961 print
'<a class="marginleftonly" href="card.php?rowid='.$objp->rowid.
'&action=resiliate&token='.
newToken().
'">'.
img_picto($langs->trans(
"Resiliate"),
'disable.png').
'</a>';
970 print
'<tr><td colspan="9"><span class="opacitymedium">'.$langs->trans(
"None").
'</span></td></tr>';
987 if ($action ==
'edit') {
994 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'?rowid='.
$object->id.
'">';
995 print
'<input type="hidden" name="token" value="'.newToken().
'">';
996 print
'<input type="hidden" name="rowid" value="'.$object->id.
'">';
997 print
'<input type="hidden" name="action" value="update">';
1001 print
'<table class="border centpercent">';
1003 print
'<tr><td class="titlefield">'.$langs->trans(
"Ref").
'</td><td>'.
$object->id.
'</td></tr>';
1005 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Label").
'</td><td><input type="text" class="minwidth300" name="label" value="'.
dol_escape_htmltag(
$object->label).
'"></td></tr>';
1007 print
'<tr><td>'.$langs->trans(
"Status").
'</td><td>';
1008 print $form->selectarray(
'status', array(
'0' => $langs->trans(
'ActivityCeased'),
'1' => $langs->trans(
'InActivity')),
$object->status, 0, 0, 0,
'', 0, 0, 0,
'',
'minwidth100');
1012 $morphys[
""] = $langs->trans(
"MorAndPhy");
1013 $morphys[
"phy"] = $langs->trans(
"Physical");
1014 $morphys[
"mor"] = $langs->trans(
"Moral");
1015 print
'<tr><td><span>'.$langs->trans(
"MembersNature").
'</span></td><td>';
1016 print $form->selectarray(
"morphy", $morphys, GETPOSTISSET(
"morphy") ?
GETPOST(
"morphy",
'aZ09') :
$object->morphy);
1019 print
'<tr><td>'.$langs->trans(
"SubscriptionRequired").
'</td><td>';
1020 print $form->selectyesno(
"subscription",
$object->subscription, 1);
1023 print
'<tr><td>'.$langs->trans(
"Amount").
'</td><td>';
1024 print
'<input name="amount" size="5" value="';
1029 print
'<tr><td>'.$form->textwithpicto($langs->trans(
"CanEditAmountShort"), $langs->transnoentities(
"CanEditAmountDetail")).
'</td><td>';
1030 print $form->selectyesno(
"caneditamount",
$object->caneditamount, 1);
1033 print
'<tr><td>'.$langs->trans(
"VoteAllowed").
'</td><td>';
1034 print $form->selectyesno(
"vote",
$object->vote, 1);
1037 print
'<tr><td>'.$langs->trans(
"Duration").
'</td><td colspan="3">';
1038 print
'<input name="duration_value" size="5" value="'.$object->duration_value.
'"> ';
1039 print $formproduct->selectMeasuringUnits(
"duration_unit",
"time", (
$object->duration_unit ===
'' ?
'y' :
$object->duration_unit), 0, 1);
1042 print
'<tr><td class="tdtop">'.$langs->trans(
"Description").
'</td><td>';
1043 require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
1044 $doleditor =
new DolEditor(
'comment',
$object->note_public,
'', 220,
'dolibarr_notes',
'',
false,
true, isModEnabled(
'fckeditor'), 15,
'90%');
1045 $doleditor->Create();
1048 print
'<tr><td class="tdtop">'.$langs->trans(
"WelcomeEMail").
'</td><td>';
1049 $doleditor =
new DolEditor(
'mail_valid',
$object->mail_valid,
'', 280,
'dolibarr_notes',
'',
false,
true, isModEnabled(
'fckeditor'), 15,
'90%');
1050 $doleditor->Create();
1054 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_edit.tpl.php';
1060 print $form->buttonsSaveCancel();
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $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.
Class to manage members type.
Class to manage a WYSIWYG editor.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
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_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
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.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
dol_eval($s, $returnvalue=1, $hideerrors=1, $onlysimplestring='1')
Replace eval function to add more security.
natural_search($fields, $value, $mode=0, $nofirstand=0)
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
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.
dol_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
newToken()
Return the value of token currently saved into session with name 'newtoken'.
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
yn($yesno, $format=1, $color=0)
Return yes or no in current language.
dolGetButtonTitleSeparator($moreClass="")
Add space between dolGetButtonTitle.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_clone($object, $native=2)
Create a clone of instance of object (new instance with same value for each properties) With native =...
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dol_trunc($string, $size=40, $trunc='right', $stringencoding='UTF-8', $nodot=0, $display=0)
Truncate a string to a particular length adding '…' if string larger than length.
dol_htmlentitiesbr($stringtoencode, $nl2brmode=0, $pagecodefrom='UTF-8', $removelasteolbr=1)
This function is called to encode a string into a HTML string but differs from htmlentities because a...
dol_string_onlythesehtmltags($stringtoclean, $cleanalsosomestyles=1, $removeclassattribute=1, $cleanalsojavascript=0, $allowiframe=0, $allowed_tags=array(), $allowlink=0, $allowscript=0, $allowstyle=0, $allowphp=0)
Clean a string to keep only desirable HTML tags.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
img_edit($titlealt='default', $float=0, $other='')
Show logo edit/modify fiche.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
member_type_prepare_head(AdherentType $object)
Return array head with list of tabs to view object information.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
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.