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';
43$langs->load(
"members");
46$action =
GETPOST(
'action',
'aZ09');
47$massaction =
GETPOST(
'massaction',
'alpha');
48$cancel =
GETPOST(
'cancel',
'alpha');
49$toselect =
GETPOST(
'toselect',
'array');
50$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') : str_replace(
'_',
'', basename(dirname(__FILE__)).basename(__FILE__,
'.php'));
51$backtopage =
GETPOST(
'backtopage',
'alpha');
52$mode =
GETPOST(
'mode',
'alpha');
54$sall =
GETPOST(
"sall",
"alpha");
55$filter =
GETPOST(
"filter",
'alpha');
56$search_ref =
GETPOST(
'search_ref',
'alpha');
57$search_lastname =
GETPOST(
'search_lastname',
'alpha');
58$search_login =
GETPOST(
'search_login',
'alpha');
59$search_email =
GETPOST(
'search_email',
'alpha');
60$type =
GETPOST(
'type',
'intcomma');
61$status =
GETPOST(
'status',
'alpha');
62$optioncss =
GETPOST(
'optioncss',
'alpha');
66$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
67$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
69if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
73$offset = $limit * $page;
80 $sortfield =
"d.lastname";
83$label =
GETPOST(
"label",
"alpha");
84$morphy =
GETPOST(
"morphy",
"alpha");
85$status =
GETPOST(
"status",
"intcomma");
87$amount =
GETPOST(
'amount',
'alpha');
89$duration_unit =
GETPOST(
'duration_unit',
'alpha');
91$comment =
GETPOST(
"comment",
'restricthtml');
92$mail_valid =
GETPOST(
"mail_valid",
'restricthtml');
98$hookmanager->initHooks(array(
'membertypecard',
'globalcard'));
101$extrafields->fetch_name_optionals_label(
$object->table_element);
104$result =
restrictedArea($user,
'adherent', $rowid,
'adherent_type');
111if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
113 $search_lastname =
"";
120if (
GETPOST(
'cancel',
'alpha')) {
124if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
131 if (!empty($backtopage)) {
132 header(
"Location: ".$backtopage);
137if ($action ==
'add' && $user->hasRight(
'adherent',
'configurer')) {
139 $object->morphy = trim($morphy);
140 $object->status = (int) $status;
141 $object->subscription = (int) $subscription;
143 $object->caneditamount = $caneditamount;
144 $object->duration_value = $duration_value;
145 $object->duration_unit = $duration_unit;
146 $object->note_public = trim($comment);
148 $object->mail_valid = trim($mail_valid);
152 $ret = $extrafields->setOptionalsFromPost(
null, $object);
159 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Label")),
null,
'errors');
161 $sql =
"SELECT libelle FROM ".MAIN_DB_PREFIX.
"adherent_type WHERE libelle = '".$db->escape(
$object->label).
"'";
162 $sql .=
" WHERE entity IN (".getEntity(
'member_type').
")";
163 $result = $db->query($sql);
166 $num = $db->num_rows($result);
170 $langs->load(
"errors");
171 setEventMessages($langs->trans(
"ErrorLabelAlreadyExists", $login),
null,
'errors');
178 $backurlforlist = $_SERVER[
"PHP_SELF"];
180 $urltogo = $backtopage ? str_replace(
'__ID__', (
string) $id, $backtopage) : $backurlforlist;
181 $urltogo = preg_replace(
'/--IDFORBACKTOPAGE--/', (
string)
$object->id, $urltogo);
183 header(
"Location: " . $urltogo);
194if ($action ==
'update' && $user->hasRight(
'adherent',
'configurer')) {
200 $object->morphy = trim($morphy);
201 $object->status = (int) $status;
202 $object->subscription = (int) $subscription;
204 $object->caneditamount = $caneditamount;
205 $object->duration_value = $duration_value;
206 $object->duration_unit = $duration_unit;
207 $object->note_public = trim($comment);
209 $object->mail_valid = trim($mail_valid);
213 $ret = $extrafields->setOptionalsFromPost(
null, $object,
'@GETPOSTISSET');
220 if ($ret >= 0 && !count(
$object->errors)) {
226 header(
"Location: ".$_SERVER[
"PHP_SELF"].
"?rowid=".
$object->id);
230if ($action ==
'confirm_delete' && $user->hasRight(
'adherent',
'configurer')) {
236 header(
"Location: ".$_SERVER[
"PHP_SELF"]);
239 setEventMessages($langs->trans(
"MemberTypeCanNotBeDeleted"),
null,
'errors');
249$form =
new Form($db);
252$help_url =
'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder';
254llxHeader(
'', $langs->trans(
"MembersTypeSetup"), $help_url);
256$arrayofselected = is_array($toselect) ? $toselect : array();
259if (!$rowid && $action !=
'create' && $action !=
'edit') {
262 $sql =
"SELECT d.rowid, d.libelle as label, d.subscription, d.amount, d.caneditamount, d.vote, d.statut as status, d.morphy, d.duration";
263 $sql .=
" FROM ".MAIN_DB_PREFIX.
"adherent_type as d";
264 $sql .=
" WHERE d.entity IN (".getEntity(
'member_type').
")";
266 $result = $db->query($sql);
268 $num = $db->num_rows($result);
269 $nbtotalofrecords = $num;
275 $param .=
'&mode='.urlencode($mode);
277 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
278 $param .=
'&contextpage='.$contextpage;
280 if ($limit > 0 && $limit != $conf->liste_limit) {
281 $param .=
'&limit='.$limit;
286 $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'));
287 $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'));
289 if ($user->hasRight(
'adherent',
'configurer')) {
291 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewMemberType'),
'',
'fa fa-plus-circle', DOL_URL_ROOT.
'/adherents/type.php?action=create');
294 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
295 if ($optioncss !=
'') {
296 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
298 print
'<input type="hidden" name="token" value="'.newToken().
'">';
299 print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
300 print
'<input type="hidden" name="action" value="list">';
301 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
302 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
303 print
'<input type="hidden" name="mode" value="'.$mode.
'">';
306 print_barre_liste($langs->trans(
"MembersTypes"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder,
'', $num, $nbtotalofrecords,
'members', 0, $newcardbutton,
'', $limit, 0, 0, 1);
310 print
'<div class="div-table-responsive">';
311 print
'<table class="tagtable liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
313 print
'<tr class="liste_titre">';
315 print
'<th> </th>';
317 print
'<th>'.$langs->trans(
"Ref").
'</th>';
318 print
'<th>'.$langs->trans(
"Label").
'</th>';
319 print
'<th class="center">'.$langs->trans(
"MembersNature").
'</th>';
320 print
'<th class="center">'.$langs->trans(
"MembershipDuration").
'</th>';
321 print
'<th class="center">'.$langs->trans(
"SubscriptionRequired").
'</th>';
322 print
'<th class="center">'.$langs->trans(
"Amount").
'</th>';
323 print
'<th class="center">'.$langs->trans(
"CanEditAmountShort").
'</th>';
324 print
'<th class="center">'.$langs->trans(
"VoteAllowed").
'</th>';
325 print
'<th class="center">'.$langs->trans(
"Status").
'</th>';
327 print
'<th> </th>';
339 $imaxinloop = ($limit ? min($num, $limit) : $num);
340 while ($i < $imaxinloop) {
341 $objp = $db->fetch_object($result);
343 $membertype->id = $objp->rowid;
344 $membertype->ref = $objp->rowid;
345 $membertype->label = $objp->rowid;
346 $membertype->status = $objp->status;
347 $membertype->subscription = $objp->subscription;
348 $membertype->amount = $objp->amount;
349 $membertype->caneditamount = $objp->caneditamount;
351 if ($mode ==
'kanban') {
353 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
354 print
'<div class="box-flex-container kanban">';
357 $membertype->label = $objp->label;
358 print $membertype->getKanbanView(
'', array(
'selected' => in_array(
$object->id, $arrayofselected)));
359 if ($i == ($imaxinloop - 1)) {
364 print
'<tr class="oddeven">';
367 if ($user->hasRight(
'adherent',
'configurer')) {
368 print
'<td class="center"><a class="editfielda" href="'.$_SERVER[
"PHP_SELF"].
'?action=edit&rowid='.$objp->rowid.
'">'.
img_edit().
'</a></td>';
372 print
'<td class="nowraponall">';
373 print $membertype->getNomUrl(1);
377 print
'<td>'.dol_escape_htmltag($objp->label).
'</td>';
379 print
'<td class="center">';
380 if ($objp->morphy ==
'phy') {
381 print $langs->trans(
"Physical");
382 } elseif ($objp->morphy ==
'mor') {
383 print $langs->trans(
"Moral");
385 print $langs->trans(
"MorAndPhy");
389 print
'<td class="center nowrap">';
390 if ($objp->duration) {
391 $duration_value = intval($objp->duration);
392 if ($duration_value > 1) {
393 $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"));
395 $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"));
397 $unit = preg_replace(
"/[^a-zA-Z]+/",
"", $objp->duration);
398 print max(1, $duration_value).
' '.$dur[$unit];
402 print
'<td class="center">'.yn($objp->subscription).
'</td>';
404 print
'<td class="center"><span class="amount">'.(is_null($objp->amount) || $objp->amount ===
'' ?
'' :
price($objp->amount)).
'</span></td>';
406 print
'<td class="center">'.yn($objp->caneditamount).
'</td>';
408 print
'<td class="center">'.yn($objp->vote).
'</td>';
410 print
'<td class="center">'.$membertype->getLibStatut(5).
'</td>';
413 if ($user->hasRight(
'adherent',
'configurer')) {
414 print
'<td class="right"><a class="editfielda" href="'.$_SERVER[
"PHP_SELF"].
'?action=edit&rowid='.$objp->rowid.
'">'.
img_edit().
'</a></td>';
431 print
'<tr><td colspan="'.$colspan.
'" class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</td></tr>';
444if ($action ==
'create') {
449 print
'<form action="'.$_SERVER[
'PHP_SELF'].
'" method="POST">';
450 print
'<input type="hidden" name="token" value="'.newToken().
'">';
451 print
'<input type="hidden" name="action" value="add">';
452 print
'<input type="hidden" name="backtopage" value="'.$backtopage.
'">';
456 print
'<table class="border centpercent">';
459 print
'<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans(
"Label").
'</td><td><input type="text" class="minwidth200" name="label" autofocus="autofocus"></td></tr>';
461 print
'<tr><td>'.$langs->trans(
"Status").
'</td><td>';
462 print $form->selectarray(
'status', array(
'0' => $langs->trans(
'ActivityCeased'),
'1' => $langs->trans(
'InActivity')), 1, 0, 0, 0,
'', 0, 0, 0,
'',
'minwidth100');
467 $morphys[
""] = $langs->trans(
"MorAndPhy");
468 $morphys[
"phy"] = $langs->trans(
"Physical");
469 $morphys[
"mor"] = $langs->trans(
"Moral");
470 print
'<tr><td><span>'.$langs->trans(
"MembersNature").
'</span></td><td>';
471 print $form->selectarray(
"morphy", $morphys, GETPOSTISSET(
"morphy") ?
GETPOST(
"morphy",
'aZ09') :
'morphy');
474 print
'<tr><td>'.$form->textwithpicto($langs->trans(
"SubscriptionRequired"), $langs->trans(
"SubscriptionRequiredDesc")).
'</td><td>';
475 print $form->selectyesno(
"subscription", 1, 1);
478 print
'<tr><td>'.$langs->trans(
"Amount").
'</td><td>';
479 print
'<input name="amount" size="5" value="'.(GETPOSTISSET(
'amount') ?
GETPOST(
'amount') :
price($amount)).
'">';
482 print
'<tr><td>'.$form->textwithpicto($langs->trans(
"CanEditAmountShort"), $langs->transnoentities(
"CanEditAmount")).
'</td><td>';
483 print $form->selectyesno(
"caneditamount", GETPOSTISSET(
'caneditamount') ?
GETPOST(
'caneditamount') : 0, 1);
486 print
'<tr><td>'.$langs->trans(
"VoteAllowed").
'</td><td>';
487 print $form->selectyesno(
"vote", GETPOSTISSET(
"vote") ?
GETPOST(
'vote',
'aZ09') : 1, 1);
490 print
'<tr><td>'.$langs->trans(
"Duration").
'</td><td colspan="3">';
491 print
'<input name="duration_value" size="5" value="'.GETPOST(
'duraction_unit',
'aZ09').
'"> ';
492 print $formproduct->selectMeasuringUnits(
"duration_unit",
"time", GETPOSTISSET(
"duration_unit") ?
GETPOST(
'duration_unit',
'aZ09') :
'y', 0, 1);
495 print
'<tr><td class="tdtop">'.$langs->trans(
"Description").
'</td><td>';
496 require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
497 $doleditor =
new DolEditor(
'comment', (GETPOSTISSET(
'comment') ?
GETPOST(
'comment',
'restricthtml') :
$object->note_public),
'', 200,
'dolibarr_notes',
'', false, true, isModEnabled(
'fckeditor'), 15,
'90%');
498 $doleditor->Create();
500 print
'<tr><td class="tdtop">'.$langs->trans(
"WelcomeEMail").
'</td><td>';
501 require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
502 $doleditor =
new DolEditor(
'mail_valid', GETPOSTISSET(
'mail_valid') ?
GETPOST(
'mail_valid') :
$object->mail_valid,
'', 250,
'dolibarr_notes',
'', false, true, isModEnabled(
'fckeditor'), 15,
'90%');
503 $doleditor->Create();
507 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_add.tpl.php';
514 print $form->buttonsSaveCancel();
521 if ($action !=
'edit') {
529 if ($action ==
'delete') {
530 print $form->formconfirm($_SERVER[
'PHP_SELF'].
"?rowid=".
$object->id, $langs->trans(
"DeleteAMemberType"), $langs->trans(
"ConfirmDeleteMemberType",
$object->label),
"confirm_delete",
'', 0, 1);
537 $linkback =
'<a href="'.DOL_URL_ROOT.
'/adherents/type.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
539 dol_banner_tab($object,
'rowid', $linkback);
541 print
'<div class="fichecenter">';
542 print
'<div class="underbanner clearboth"></div>';
544 print
'<table class="tableforfield border centpercent">';
547 print
'<tr><td>'.$langs->trans(
"MembersNature").
'</td><td class="valeur" >'.
$object->getmorphylib(
$object->morphy).
'</td>';
550 print
'<tr><td>'.$form->textwithpicto($langs->trans(
"SubscriptionRequired"), $langs->trans(
"SubscriptionRequiredDesc")).
'</td><td>';
555 print
'<tr><td class="titlefield">'.$langs->trans(
"Amount").
'</td><td>';
559 print
'<tr><td>'.$form->textwithpicto($langs->trans(
"CanEditAmountShort"), $langs->transnoentities(
"CanEditAmount")).
'</td><td>';
563 print
'<tr><td>'.$langs->trans(
"VoteAllowed").
'</td><td>';
568 print
'<tr><td class="titlefield">'.$langs->trans(
"Duration").
'</td><td colspan="2">'.
$object->duration_value.
' ';
569 if (
$object->duration_value > 1) {
570 $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"));
571 } elseif (
$object->duration_value > 0) {
572 $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"));
574 print(!empty(
$object->duration_unit) && isset($dur[
$object->duration_unit]) ? $langs->trans($dur[
$object->duration_unit]) :
'').
" ";
578 print
'<tr><td class="tdtop">'.$langs->trans(
"Description").
'</td><td><div class="longmessagecut">';
580 print
"</div></td></tr>";
583 print
'<tr><td class="tdtop">'.$langs->trans(
"WelcomeEMail").
'</td><td><div class="longmessagecut">';
585 print
"</div></td></tr>";
588 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
600 print
'<div class="tabsAction">';
603 if ($user->hasRight(
'adherent',
'configurer')) {
604 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>';
608 if (
$object->morphy ==
'phy') {
610 } elseif (
$object->morphy ==
'mor') {
616 if ($user->hasRight(
'adherent',
'configurer') && !empty(
$object->status)) {
617 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>';
619 print
'<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans(
"NoAddMember")).
'">'.$langs->trans(
"AddMember").
'</a></div>';
623 if ($user->hasRight(
'adherent',
'configurer')) {
624 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>';
636 $sql =
"SELECT d.rowid, d.ref, d.entity, d.login, d.firstname, d.lastname, d.societe as company, d.fk_soc,";
637 $sql .=
" d.datefin,";
638 $sql .=
" d.email, d.photo, d.fk_adherent_type as type_id, d.morphy, d.statut as status,";
639 $sql .=
" t.libelle as type, t.subscription, t.amount";
643 $sql .=
" FROM ".MAIN_DB_PREFIX.
"adherent as d, ".MAIN_DB_PREFIX.
"adherent_type as t";
644 $sql .=
" WHERE d.fk_adherent_type = t.rowid ";
645 $sql .=
" AND d.entity IN (".getEntity(
'adherent').
")";
646 $sql .=
" AND t.rowid = ".((int)
$object->id);
648 $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);
653 if ($action ==
'search') {
654 if (
GETPOST(
'search',
'alpha')) {
658 if (!empty($search_ref)) {
661 if (!empty($search_lastname)) {
662 $sql .=
natural_search(array(
"d.firstname",
"d.lastname"), $search_lastname);
664 if (!empty($search_login)) {
667 if (!empty($search_email)) {
670 if ($filter ==
'uptodate') {
671 $sql .=
" AND (datefin >= '".$db->idate($now).
"') OR t.subscription = 0)";
673 if ($filter ==
'outofdate') {
674 $sql .=
" AND (datefin < '".$db->idate($now).
"' AND t.subscription = 1)";
678 $nbtotalofrecords =
'';
681 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
682 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
683 $resql = $db->query($sqlforcount);
685 $objforcount = $db->fetch_object($resql);
686 $nbtotalofrecords = $objforcount->nbtotalofrecords;
691 if (($page * $limit) > $nbtotalofrecords) {
699 $sql .= $db->order($sortfield, $sortorder);
701 $sql .= $db->plimit($limit + 1, $offset);
704 $resql = $db->query($sql);
706 $num = $db->num_rows($resql);
709 $titre = $langs->trans(
"MembersList");
711 if ($status ==
'-1,1') {
712 $titre = $langs->trans(
"MembersListQualified");
713 } elseif ($status ==
'-1') {
714 $titre = $langs->trans(
"MembersListToValid");
715 } elseif ($status ==
'1' && !$filter) {
716 $titre = $langs->trans(
"MembersListValid");
717 } elseif ($status ==
'1' && $filter ==
'uptodate') {
718 $titre = $langs->trans(
"MembersListUpToDate");
719 } elseif ($status ==
'1' && $filter ==
'outofdate') {
720 $titre = $langs->trans(
"MembersListNotUpToDate");
721 } elseif ($status ==
'0') {
722 $titre = $langs->trans(
"MembersListResiliated");
723 } elseif ($status ==
'-2') {
724 $titre = $langs->trans(
"MembersListExcluded");
726 } elseif ($action ==
'search') {
727 $titre = $langs->trans(
"MembersListQualified");
732 $result = $membertype->fetch($type);
733 $titre .=
" (".$membertype->label.
")";
736 $param =
"&rowid=".urlencode((
string) (
$object->id));
738 $param .=
'&mode='.urlencode($mode);
740 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
741 $param .=
'&contextpage='.urlencode($contextpage);
743 if ($limit > 0 && $limit != $conf->liste_limit) {
744 $param .=
'&limit='.((int) $limit);
746 if (!empty($status)) {
747 $param .=
"&status=".urlencode($status);
749 if (!empty($search_ref)) {
750 $param .=
"&search_ref=".urlencode($search_ref);
752 if (!empty($search_lastname)) {
753 $param .=
"&search_lastname=".urlencode($search_lastname);
755 if (!empty($search_login)) {
756 $param .=
"&search_login=".urlencode($search_login);
758 if (!empty($search_email)) {
759 $param .=
"&search_email=".urlencode($search_email);
761 if (!empty($filter)) {
762 $param .=
"&filter=".urlencode($filter);
766 print $langs->trans(
"Filter").
" (".$langs->trans(
"Lastname").
", ".$langs->trans(
"Firstname").
", ".$langs->trans(
"EMail").
", ".$langs->trans(
"Address").
" ".$langs->trans(
"or").
" ".$langs->trans(
"Town").
"): ".$sall;
769 print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'" name="formfilter" autocomplete="off">';
770 print
'<input type="hidden" name="token" value="'.newToken().
'">';
771 print
'<input class="flat" type="hidden" name="rowid" value="'.$object->id.
'"></td>';
772 print
'<input class="flat" type="hidden" name="page_y" value=""></td>';
774 print_barre_liste(
'', $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder,
'', $num, $nbtotalofrecords,
'generic', 0,
'',
'', $limit);
778 print
'<div class="div-table-responsive">';
779 print
'<table class="tagtable liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
782 print
'<tr class="liste_titre_filter">';
785 print
'<td class="liste_titre center maxwidthsearch">';
786 $searchpicto = $form->showFilterButtons(
'left');
791 print
'<td class="liste_titre left">';
792 print
'<input class="flat maxwidth100" type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref).
'"></td>';
794 print
'<td class="liste_titre left">';
795 print
'<input class="flat maxwidth100" type="text" name="search_lastname" value="'.dol_escape_htmltag($search_lastname).
'"></td>';
797 print
'<td class="liste_titre left">';
798 print
'<input class="flat maxwidth100" type="text" name="search_login" value="'.dol_escape_htmltag($search_login).
'"></td>';
800 print
'<td class="liste_titre"> </td>';
802 print
'<td class="liste_titre left">';
803 print
'<input class="flat maxwidth100" type="text" name="search_email" value="'.dol_escape_htmltag($search_email).
'"></td>';
805 print
'<td class="liste_titre"> </td>';
807 print
'<td class="liste_titre"> </td>';
810 print
'<td class="liste_titre center nowraponall">';
811 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")).
'">';
813 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")).
'">';
819 print
'<tr class="liste_titre">';
821 print_liste_field_titre(
"Action", $_SERVER[
"PHP_SELF"],
"", $param,
"",
'width="60" align="center"', $sortfield, $sortorder);
824 print_liste_field_titre(
"NameSlashCompany", $_SERVER[
"PHP_SELF"],
"d.lastname", $param,
"",
"", $sortfield, $sortorder);
826 print_liste_field_titre(
"MemberNature", $_SERVER[
"PHP_SELF"],
"d.morphy", $param,
"",
"", $sortfield, $sortorder);
828 print_liste_field_titre(
"Status", $_SERVER[
"PHP_SELF"],
"d.statut,d.datefin", $param,
"",
"", $sortfield, $sortorder);
829 print_liste_field_titre(
"EndSubscription", $_SERVER[
"PHP_SELF"],
"d.datefin", $param,
"",
'align="center"', $sortfield, $sortorder);
831 print_liste_field_titre(
"Action", $_SERVER[
"PHP_SELF"],
"", $param,
"",
'width="60" align="center"', $sortfield, $sortorder);
837 $imaxinloop = ($limit ? min($num, $limit) : $num);
838 while ($i < $imaxinloop) {
839 $objp = $db->fetch_object($resql);
841 $datefin = $db->jdate($objp->datefin);
843 $adh->id = $objp->rowid;
844 $adh->ref = $objp->ref;
845 $adh->login = $objp->login;
846 $adh->lastname = $objp->lastname;
847 $adh->firstname = $objp->firstname;
848 $adh->datefin = $datefin;
849 $adh->need_subscription = $objp->subscription;
850 $adh->statut = $objp->status;
851 $adh->status = $objp->status;
852 $adh->email = $objp->email;
853 $adh->photo = $objp->photo;
855 print
'<tr class="oddeven">';
859 print
'<td class="center">';
860 if ($user->hasRight(
'adherent',
'creer')) {
861 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>';
863 if ($user->hasRight(
'adherent',
'supprimer')) {
864 print
'<a class="marginleftonly" href="card.php?rowid='.$objp->rowid.
'&action=resiliate&token='.
newToken().
'">'.
img_picto($langs->trans(
"Resiliate"),
'disable.png').
'</a>';
871 print $adh->getNomUrl(-1, 0,
'card',
'ref',
'', -1, 0, 1);
875 if ($objp->company !=
'') {
876 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";
878 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";
882 print
"<td>".dol_escape_htmltag($objp->login).
"</td>\n";
893 print
"<td>".$adh->getmorphylib($objp->morphy, 1).
"</td>\n";
896 print
"<td>".dol_print_email($objp->email, 0, 0, 1).
"</td>\n";
899 print
'<td class="nowrap">';
900 print $adh->getLibStatut(2);
905 print
'<td class="nowrap center">';
906 if ($datefin <
dol_now() && $objp->status > 0) {
913 print
'<td class="nowrap center">';
914 if (!empty($objp->subscription)) {
915 print
'<span class="opacitymedium">'.$langs->trans(
"SubscriptionNotReceived").
'</span>';
916 if ($objp->status > 0) {
917 print
" ".img_warning();
927 print
'<td class="center">';
928 if ($user->hasRight(
'adherent',
'creer')) {
929 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>';
931 if ($user->hasRight(
'adherent',
'supprimer')) {
932 print
'<a class="marginleftonly" href="card.php?rowid='.$objp->rowid.
'&action=resiliate&token='.
newToken().
'">'.
img_picto($langs->trans(
"Resiliate"),
'disable.png').
'</a>';
941 print
'<tr><td colspan="9"><span class="opacitymedium">'.$langs->trans(
"None").
'</span></td></tr>';
958 if ($action ==
'edit') {
965 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'?rowid='.
$object->id.
'">';
966 print
'<input type="hidden" name="token" value="'.newToken().
'">';
967 print
'<input type="hidden" name="rowid" value="'.$object->id.
'">';
968 print
'<input type="hidden" name="action" value="update">';
972 print
'<table class="border centpercent">';
974 print
'<tr><td class="titlefield">'.$langs->trans(
"Ref").
'</td><td>'.
$object->id.
'</td></tr>';
976 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>';
978 print
'<tr><td>'.$langs->trans(
"Status").
'</td><td>';
979 print $form->selectarray(
'status', array(
'0' => $langs->trans(
'ActivityCeased'),
'1' => $langs->trans(
'InActivity')),
$object->status, 0, 0, 0,
'', 0, 0, 0,
'',
'minwidth100');
983 $morphys[
""] = $langs->trans(
"MorAndPhy");
984 $morphys[
"phy"] = $langs->trans(
"Physical");
985 $morphys[
"mor"] = $langs->trans(
"Moral");
986 print
'<tr><td><span>'.$langs->trans(
"MembersNature").
'</span></td><td>';
987 print $form->selectarray(
"morphy", $morphys, GETPOSTISSET(
"morphy") ?
GETPOST(
"morphy",
'aZ09') :
$object->morphy);
990 print
'<tr><td>'.$langs->trans(
"SubscriptionRequired").
'</td><td>';
991 print $form->selectyesno(
"subscription",
$object->subscription, 1);
994 print
'<tr><td>'.$langs->trans(
"Amount").
'</td><td>';
995 print
'<input name="amount" size="5" value="';
1000 print
'<tr><td>'.$form->textwithpicto($langs->trans(
"CanEditAmountShort"), $langs->transnoentities(
"CanEditAmountDetail")).
'</td><td>';
1001 print $form->selectyesno(
"caneditamount",
$object->caneditamount, 1);
1004 print
'<tr><td>'.$langs->trans(
"VoteAllowed").
'</td><td>';
1005 print $form->selectyesno(
"vote",
$object->vote, 1);
1008 print
'<tr><td>'.$langs->trans(
"Duration").
'</td><td colspan="3">';
1009 print
'<input name="duration_value" size="5" value="'.$object->duration_value.
'"> ';
1010 print $formproduct->selectMeasuringUnits(
"duration_unit",
"time", (
$object->duration_unit ===
'' ?
'y' :
$object->duration_unit), 0, 1);
1013 print
'<tr><td class="tdtop">'.$langs->trans(
"Description").
'</td><td>';
1014 require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
1015 $doleditor =
new DolEditor(
'comment',
$object->note_public,
'', 220,
'dolibarr_notes',
'',
false,
true, isModEnabled(
'fckeditor'), 15,
'90%');
1016 $doleditor->Create();
1019 print
'<tr><td class="tdtop">'.$langs->trans(
"WelcomeEMail").
'</td><td>';
1020 $doleditor =
new DolEditor(
'mail_valid',
$object->mail_valid,
'', 280,
'dolibarr_notes',
'',
false,
true, isModEnabled(
'fckeditor'), 15,
'90%');
1021 $doleditor->Create();
1025 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_edit.tpl.php';
1031 print $form->buttonsSaveCancel();
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
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)
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.
yn($yesno, $case=1, $color=0)
Return yes or no in current language.
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.
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_string_onlythesehtmltags($stringtoclean, $cleanalsosomestyles=1, $removeclassattribute=1, $cleanalsojavascript=0, $allowiframe=0, $allowed_tags=array(), $allowlink=0)
Clean a string to keep only desirable HTML tags.
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'.
dol_clone($object, $native=0)
Create a clone of instance of object (new instance with same value for each properties) With native =...
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
dolGetButtonTitleSeparator($moreClass="")
Add space between dolGetButtonTitle.
print_barre_liste($title, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $hideselectlimit=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
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...
getDolGlobalString($key, $default='')
Return 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.
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.