33 require
'../main.inc.php';
34 require_once DOL_DOCUMENT_ROOT.
'/core/lib/member.lib.php';
35 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
36 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent_type.class.php';
37 require_once DOL_DOCUMENT_ROOT.
'/core/class/extrafields.class.php';
38 require_once DOL_DOCUMENT_ROOT.
'/product/class/html.formproduct.class.php';
40 $langs->load(
"members");
42 $rowid =
GETPOST(
'rowid',
'int');
43 $action =
GETPOST(
'action',
'aZ09');
44 $cancel =
GETPOST(
'cancel',
'alpha');
45 $contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') : str_replace(
'_',
'', basename(dirname(__FILE__)).basename(__FILE__,
'.php'));
46 $backtopage =
GETPOST(
'backtopage',
'alpha');
47 $mode =
GETPOST(
'mode',
'alopha');
49 $sall =
GETPOST(
"sall",
"alpha");
50 $filter =
GETPOST(
"filter",
'alpha');
51 $search_lastname =
GETPOST(
'search_lastname',
'alpha');
52 $search_login =
GETPOST(
'search_login',
'alpha');
53 $search_email =
GETPOST(
'search_email',
'alpha');
54 $type =
GETPOST(
'type',
'intcomma');
55 $status =
GETPOST(
'status',
'alpha');
56 $optioncss =
GETPOST(
'optioncss',
'alpha');
58 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
59 $sortfield =
GETPOST(
'sortfield',
'aZ09comma');
60 $sortorder =
GETPOST(
'sortorder',
'aZ09comma');
62 if (empty($page) || $page == -1) {
65 $offset = $limit * $page;
66 $pageprev = $page - 1;
67 $pagenext = $page + 1;
72 $sortfield =
"d.lastname";
75 $label =
GETPOST(
"label",
"alpha");
76 $morphy =
GETPOST(
"morphy",
"alpha");
77 $status =
GETPOST(
"status",
"int");
78 $subscription =
GETPOST(
"subscription",
"int");
79 $amount =
GETPOST(
'amount',
'alpha');
80 $duration_value =
GETPOST(
'duration_value',
'int');
81 $duration_unit =
GETPOST(
'duration_unit',
'alpha');
83 $comment =
GETPOST(
"comment",
'restricthtml');
84 $mail_valid =
GETPOST(
"mail_valid",
'restricthtml');
88 $result =
restrictedArea($user,
'adherent', $rowid,
'adherent_type');
95 $extrafields->fetch_name_optionals_label($object->table_element);
97 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
98 $search_lastname =
"";
107 $hookmanager->initHooks(array(
'membertypecard',
'globalcard'));
117 if (!empty($backtopage)) {
118 header(
"Location: ".$backtopage);
123 if ($action ==
'add' && $user->hasRight(
'adherent',
'configurer')) {
124 $object->label = trim($label);
125 $object->morphy = trim($morphy);
126 $object->status = (int) $status;
127 $object->subscription = (int) $subscription;
128 $object->amount = ($amount ==
'' ?
'' :
price2num($amount,
'MT'));
129 $object->caneditamount = $caneditamount;
130 $object->duration_value = $duration_value;
131 $object->duration_unit = $duration_unit;
132 $object->note_public = trim($comment);
133 $object->note_private =
'';
134 $object->mail_valid = trim($mail_valid);
135 $object->vote = (int) $vote;
138 $ret = $extrafields->setOptionalsFromPost(
null, $object);
143 if (empty($object->label)) {
145 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Label")),
null,
'errors');
147 $sql =
"SELECT libelle FROM ".MAIN_DB_PREFIX.
"adherent_type WHERE libelle = '".$db->escape($object->label).
"'";
148 $sql .=
" WHERE entity IN (".getEntity(
'member_type').
")";
149 $result = $db->query($sql);
152 $num = $db->num_rows($result);
156 $langs->load(
"errors");
157 setEventMessages($langs->trans(
"ErrorLabelAlreadyExists", $login),
null,
'errors');
162 $id = $object->create($user);
164 header(
"Location: ".$_SERVER[
"PHP_SELF"]);
175 if ($action ==
'update' && $user->hasRight(
'adherent',
'configurer')) {
176 $object->fetch($rowid);
180 $object->label= trim($label);
181 $object->morphy = trim($morphy);
182 $object->status = (int) $status;
183 $object->subscription = (int) $subscription;
184 $object->amount = ($amount ==
'' ?
'' :
price2num($amount,
'MT'));
185 $object->caneditamount = $caneditamount;
186 $object->duration_value = $duration_value;
187 $object->duration_unit = $duration_unit;
188 $object->note_public = trim($comment);
189 $object->note_private =
'';
190 $object->mail_valid = trim($mail_valid);
191 $object->vote = (boolean) trim($vote);
194 $ret = $extrafields->setOptionalsFromPost(
null, $object,
'@GETPOSTISSET');
199 $ret = $object->update($user);
201 if ($ret >= 0 && !count($object->errors)) {
207 header(
"Location: ".$_SERVER[
"PHP_SELF"].
"?rowid=".$object->id);
211 if ($action ==
'confirm_delete' && $user->hasRight(
'adherent',
'configurer')) {
212 $object->fetch($rowid);
213 $res = $object->delete();
217 header(
"Location: ".$_SERVER[
"PHP_SELF"]);
220 setEventMessages($langs->trans(
"MemberTypeCanNotBeDeleted"),
null,
'errors');
233 $help_url =
'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder';
238 if (!$rowid && $action !=
'create' && $action !=
'edit') {
241 $sql =
"SELECT d.rowid, d.libelle as label, d.subscription, d.amount, d.caneditamount, d.vote, d.statut as status, d.morphy";
242 $sql .=
" FROM ".MAIN_DB_PREFIX.
"adherent_type as d";
243 $sql .=
" WHERE d.entity IN (".getEntity(
'member_type').
")";
245 $result = $db->query($sql);
247 $num = $db->num_rows($result);
254 $param .=
'&mode'.urlencode($mode);
256 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
257 $param .=
'&contextpage='.$contextpage;
259 if ($limit > 0 && $limit != $conf->liste_limit) {
260 $param .=
'&limit='.$limit;
265 $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'));
266 $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'));
268 if ($user->hasRight(
'adherent',
'configurer')) {
269 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewMemberType'),
'',
'fa fa-plus-circle', DOL_URL_ROOT.
'/adherents/type.php?action=create');
272 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
273 if ($optioncss !=
'') {
274 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
276 print
'<input type="hidden" name="token" value="'.newToken().
'">';
277 print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
278 print
'<input type="hidden" name="action" value="list">';
279 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
280 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
281 print
'<input type="hidden" name="mode" value="'.$mode.
'">';
284 print_barre_liste($langs->trans(
"MembersTypes"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder,
'', $num,
$nbtotalofrecords,
'members', 0, $newcardbutton,
'', $limit, 0, 0, 1);
288 print
'<div class="div-table-responsive">';
289 print
'<table class="tagtable liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
291 print
'<tr class="liste_titre">';
292 print
'<th>'.$langs->trans(
"Ref").
'</th>';
293 print
'<th>'.$langs->trans(
"Label").
'</th>';
294 print
'<th class="center">'.$langs->trans(
"MembersNature").
'</th>';
295 print
'<th class="center">'.$langs->trans(
"SubscriptionRequired").
'</th>';
296 print
'<th class="center">'.$langs->trans(
"Amount").
'</th>';
297 print
'<th class="center">'.$langs->trans(
"CanEditAmountShort").
'</th>';
298 print
'<th class="center">'.$langs->trans(
"VoteAllowed").
'</th>';
299 print
'<th class="center">'.$langs->trans(
"Status").
'</th>';
300 print
'<th> </th>';
306 $objp = $db->fetch_object($result);
308 $membertype->id = $objp->rowid;
309 $membertype->ref = $objp->rowid;
310 $membertype->label = $objp->rowid;
311 $membertype->status = $objp->status;
312 $membertype->subscription = $objp->subscription;
313 $membertype->amount = $objp->amount;
314 $membertype->caneditamount = $objp->caneditamount;
317 if ($mode ==
'kanban') {
319 print
'<tr><td colspan="12">';
320 print
'<div class="box-flex-container">';
323 $membertype->label = $objp->label;
324 $membertype->getKanbanView(
'');
325 if ($i == ($imaxinloop - 1)) {
330 print
'<tr class="oddeven">';
331 print
'<td class="nowraponall">';
332 print $membertype->getNomUrl(1);
335 print
'<td>'.dol_escape_htmltag($objp->label).
'</td>';
336 print
'<td class="center">';
337 if ($objp->morphy ==
'phy') {
338 print $langs->trans(
"Physical");
339 } elseif ($objp->morphy ==
'mor') {
340 print $langs->trans(
"Moral");
342 print $langs->trans(
"MorAndPhy");
345 print
'<td class="center">'.yn($objp->subscription).
'</td>';
346 print
'<td class="center"><span class="amount">'.(is_null($objp->amount) || $objp->amount ===
'' ?
'' :
price($objp->amount)).
'</span></td>';
347 print
'<td class="center">'.yn($objp->caneditamount).
'</td>';
348 print
'<td class="center">'.yn($objp->vote).
'</td>';
349 print
'<td class="center">'.$membertype->getLibStatut(5).
'</td>';
350 if ($user->rights->adherent->configurer) {
351 print
'<td class="right"><a class="editfielda" href="'.$_SERVER[
"PHP_SELF"].
'?action=edit&rowid='.$objp->rowid.
'">'.
img_edit().
'</a></td>';
353 print
'<td class="right"> </td>';
369 print
'<tr><td colspan="'.$colspan.
'" class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</td></tr>';
382 if ($action ==
'create') {
387 print
'<form action="'.$_SERVER[
'PHP_SELF'].
'" method="POST">';
388 print
'<input type="hidden" name="token" value="'.newToken().
'">';
389 print
'<input type="hidden" name="action" value="add">';
393 print
'<table class="border centpercent">';
396 print
'<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans(
"Label").
'</td><td><input type="text" class="minwidth200" name="label" autofocus="autofocus"></td></tr>';
398 print
'<tr><td>'.$langs->trans(
"Status").
'</td><td>';
399 print
$form->selectarray(
'status', array(
'0'=>$langs->trans(
'ActivityCeased'),
'1'=>$langs->trans(
'InActivity')), 1, 0, 0, 0,
'', 0, 0, 0,
'',
'minwidth100');
404 $morphys[
""] = $langs->trans(
"MorAndPhy");
405 $morphys[
"phy"] = $langs->trans(
"Physical");
406 $morphys[
"mor"] = $langs->trans(
"Moral");
407 print
'<tr><td><span>'.$langs->trans(
"MembersNature").
'</span></td><td>';
411 print
'<tr><td>'.$langs->trans(
"SubscriptionRequired").
'</td><td>';
412 print
$form->selectyesno(
"subscription", 1, 1);
415 print
'<tr><td>'.$langs->trans(
"Amount").
'</td><td>';
416 print
'<input name="amount" size="5" value="'.(GETPOSTISSET(
'amount') ?
GETPOST(
'amount') :
price($amount)).
'">';
419 print
'<tr><td>'.$form->textwithpicto($langs->trans(
"CanEditAmountShort"), $langs->transnoentities(
"CanEditAmount")).
'</td><td>';
423 print
'<tr><td>'.$langs->trans(
"VoteAllowed").
'</td><td>';
427 print
'<tr><td>'.$langs->trans(
"Duration").
'</td><td colspan="3">';
428 print
'<input name="duration_value" size="5" value="'.GETPOST(
'duraction_unit',
'aZ09').
'"> ';
429 print $formproduct->selectMeasuringUnits(
"duration_unit",
"time",
GETPOSTISSET(
"duration_unit") ?
GETPOST(
'duration_unit',
'aZ09') :
'y', 0, 1);
432 print
'<tr><td class="tdtop">'.$langs->trans(
"Description").
'</td><td>';
433 require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
434 $doleditor =
new DolEditor(
'comment', (
GETPOSTISSET(
'comment') ?
GETPOST(
'comment',
'restricthtml') : $object->note_public),
'', 200,
'dolibarr_notes',
'',
false,
true, empty($conf->fckeditor->enabled) ?
false : $conf->fckeditor->enabled, 15,
'90%');
435 $doleditor->Create();
437 print
'<tr><td class="tdtop">'.$langs->trans(
"WelcomeEMail").
'</td><td>';
438 require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
439 $doleditor =
new DolEditor(
'mail_valid',
GETPOSTISSET(
'mail_valid') ?
GETPOST(
'mail_valid') : $object->mail_valid,
'', 250,
'dolibarr_notes',
'',
false,
true, empty($conf->fckeditor->enabled) ?
false : $conf->fckeditor->enabled, 15,
'90%');
440 $doleditor->Create();
444 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_add.tpl.php';
451 print
$form->buttonsSaveCancel();
458 if ($action !=
'edit') {
460 $object->fetch($rowid);
461 $object->fetch_optionals();
466 if ($action ==
'delete') {
467 print
$form->formconfirm($_SERVER[
'PHP_SELF'].
"?rowid=".$object->id, $langs->trans(
"DeleteAMemberType"), $langs->trans(
"ConfirmDeleteMemberType", $object->label),
"confirm_delete",
'', 0, 1);
474 $linkback =
'<a href="'.DOL_URL_ROOT.
'/adherents/type.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
478 print
'<div class="fichecenter">';
479 print
'<div class="underbanner clearboth"></div>';
481 print
'<table class="tableforfield border centpercent">';
484 print
'<tr><td>'.$langs->trans(
"MembersNature").
'</td><td class="valeur" >'.$object->getmorphylib($object->morphy).
'</td>';
487 print
'<tr><td class="titlefield">'.$langs->trans(
"SubscriptionRequired").
'</td><td>';
488 print
yn($object->subscription);
492 print
'<tr><td class="titlefield">'.$langs->trans(
"Amount").
'</td><td>';
493 print ((is_null($object->amount) || $object->amount ===
'') ?
'' :
'<span class="amount">'.price($object->amount).
'</span>');
496 print
'<tr><td>'.$form->textwithpicto($langs->trans(
"CanEditAmountShort"), $langs->transnoentities(
"CanEditAmount")).
'</td><td>';
497 print
yn($object->caneditamount);
500 print
'<tr><td>'.$langs->trans(
"VoteAllowed").
'</td><td>';
501 print
yn($object->vote);
504 print
'<tr><td class="titlefield">'.$langs->trans(
"Duration").
'</td><td colspan="2">'.$object->duration_value.
' ';
505 if ($object->duration_value > 1) {
506 $dur = array(
"i"=>$langs->trans(
"Minute"),
"h"=>$langs->trans(
"Hours"),
"d"=>$langs->trans(
"Days"),
"w"=>$langs->trans(
"Weeks"),
"m"=>$langs->trans(
"Months"),
"y"=>$langs->trans(
"Years"));
507 } elseif ($object->duration_value > 0) {
508 $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"));
510 print (!empty($object->duration_unit) && isset($dur[$object->duration_unit]) ? $langs->trans($dur[$object->duration_unit]) :
'').
" ";
513 print
'<tr><td class="tdtop">'.$langs->trans(
"Description").
'</td><td>';
514 print nl2br($object->note).
"</td></tr>";
516 print
'<tr><td class="tdtop">'.$langs->trans(
"WelcomeEMail").
'</td><td>';
517 print nl2br($object->mail_valid).
"</td></tr>";
520 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
531 print
'<div class="tabsAction">';
534 if ($user->hasRight(
'adherent',
'configurer')) {
535 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>';
539 if ($user->hasRight(
'adherent',
'configurer')&& !empty($object->status)) {
540 print
'<div class="inline-block divButAction"><a class="butAction" href="card.php?action=create&token='.newToken().
'&typeid='.$object->id.
'&backtopage='.urlencode($_SERVER[
"PHP_SELF"].
'?rowid='.$object->id).
'">'.$langs->trans(
"AddMember").
'</a></div>';
542 print
'<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans(
"NoAddMember")).
'">'.$langs->trans(
"AddMember").
'</a></div>';
546 if ($user->hasRight(
'adherent',
'configurer')) {
547 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>';
559 $sql =
"SELECT d.rowid, d.login, d.firstname, d.lastname, d.societe as company,";
560 $sql .=
" d.datefin,";
561 $sql .=
" d.email, d.fk_adherent_type as type_id, d.morphy, d.statut as status,";
562 $sql .=
" t.libelle as type, t.subscription, t.amount";
563 $sql .=
" FROM ".MAIN_DB_PREFIX.
"adherent as d, ".MAIN_DB_PREFIX.
"adherent_type as t";
564 $sql .=
" WHERE d.fk_adherent_type = t.rowid ";
565 $sql .=
" AND d.entity IN (".getEntity(
'adherent').
")";
566 $sql .=
" AND t.rowid = ".((int) $object->id);
568 $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);
573 if ($action ==
'search') {
574 if (
GETPOST(
'search',
'alpha')) {
578 if (!empty($search_lastname)) {
579 $sql .=
natural_search(array(
"d.firstname",
"d.lastname"), $search_lastname);
581 if (!empty($search_login)) {
584 if (!empty($search_email)) {
587 if ($filter ==
'uptodate') {
588 $sql .=
" AND (datefin >= '".$db->idate($now).
"') OR t.subscription = 0)";
590 if ($filter ==
'outofdate') {
591 $sql .=
" AND (datefin < '".$db->idate($now).
"' AND t.subscription = 1)";
594 $sql .=
" ".$db->order($sortfield, $sortorder);
598 if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
599 $resql = $db->query($sql);
611 $sql .=
" ".$db->plimit($conf->liste_limit + 1, $offset);
613 $resql = $db->query($sql);
615 $num = $db->num_rows(
$resql);
618 $titre = $langs->trans(
"MembersList");
620 if ($status ==
'-1,1') {
621 $titre = $langs->trans(
"MembersListQualified");
622 } elseif ($status ==
'-1') {
623 $titre = $langs->trans(
"MembersListToValid");
624 } elseif ($status ==
'1' && !$filter) {
625 $titre = $langs->trans(
"MembersListValid");
626 } elseif ($status ==
'1' && $filter ==
'uptodate') {
627 $titre = $langs->trans(
"MembersListUpToDate");
628 } elseif ($status ==
'1' && $filter ==
'outofdate') {
629 $titre = $langs->trans(
"MembersListNotUpToDate");
630 } elseif ($status ==
'0') {
631 $titre = $langs->trans(
"MembersListResiliated");
632 } elseif ($status ==
'-2') {
633 $titre = $langs->trans(
"MembersListExcluded");
635 } elseif ($action ==
'search') {
636 $titre = $langs->trans(
"MembersListQualified");
641 $result = $membertype->fetch($type);
642 $titre .=
" (".$membertype->label.
")";
645 $param =
"&rowid=".urlencode($object->id);
646 if (!empty($status)) {
647 $param .=
"&status=".urlencode($status);
649 if (!empty($search_lastname)) {
650 $param .=
"&search_lastname=".urlencode($search_lastname);
652 if (!empty($search_firstname)) {
653 $param .=
"&search_firstname=".urlencode($search_firstname);
655 if (!empty($search_login)) {
656 $param .=
"&search_login=".urlencode($search_login);
658 if (!empty($search_email)) {
659 $param .=
"&search_email=".urlencode($search_email);
661 if (!empty($filter)) {
662 $param .=
"&filter=".urlencode($filter);
666 print $langs->trans(
"Filter").
" (".$langs->trans(
"Lastname").
", ".$langs->trans(
"Firstname").
", ".$langs->trans(
"EMail").
", ".$langs->trans(
"Address").
" ".$langs->trans(
"or").
" ".$langs->trans(
"Town").
"): ".$sall;
669 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
670 print
'<input type="hidden" name="token" value="'.newToken().
'">';
671 print
'<input class="flat" type="hidden" name="rowid" value="'.$object->id.
'" size="12"></td>';
678 print
'<div class="div-table-responsive">';
679 print
'<table class="tagtable liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
682 print
'<tr class="liste_titre_filter">';
684 print
'<td class="liste_titre left">';
685 print
'<input class="flat" type="text" name="search_lastname" value="'.dol_escape_htmltag($search_lastname).
'" size="12"></td>';
687 print
'<td class="liste_titre left">';
688 print
'<input class="flat" type="text" name="search_login" value="'.dol_escape_htmltag($search_login).
'" size="7"></td>';
690 print
'<td class="liste_titre"> </td>';
692 print
'<td class="liste_titre left">';
693 print
'<input class="flat" type="text" name="search_email" value="'.dol_escape_htmltag($search_email).
'" size="12"></td>';
695 print
'<td class="liste_titre"> </td>';
697 print
'<td class="liste_titre right" colspan="2">';
698 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")).
'">';
700 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")).
'">';
705 print
'<tr class="liste_titre">';
706 print_liste_field_titre(
"NameSlashCompany", $_SERVER[
"PHP_SELF"],
"d.lastname", $param,
"",
"", $sortfield, $sortorder);
708 print_liste_field_titre(
"MemberNature", $_SERVER[
"PHP_SELF"],
"d.morphy", $param,
"",
"", $sortfield, $sortorder);
710 print_liste_field_titre(
"Status", $_SERVER[
"PHP_SELF"],
"d.statut,d.datefin", $param,
"",
"", $sortfield, $sortorder);
711 print_liste_field_titre(
"EndSubscription", $_SERVER[
"PHP_SELF"],
"d.datefin", $param,
"",
'align="center"', $sortfield, $sortorder);
712 print_liste_field_titre(
"Action", $_SERVER[
"PHP_SELF"],
"", $param,
"",
'width="60" align="center"', $sortfield, $sortorder);
717 $imaxinloop = ($limit ? min($num, $limit) : $num);
718 while ($i < $imaxinloop) {
719 $objp = $db->fetch_object(
$resql);
721 $datefin = $db->jdate($objp->datefin);
723 $adh->lastname = $objp->lastname;
724 $adh->firstname = $objp->firstname;
725 $adh->datefin = $datefin;
726 $adh->need_subscription = $objp->subscription;
727 $adh->statut = $objp->status;
729 print
'<tr class="oddeven">';
732 if ($objp->company !=
'') {
733 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";
735 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";
739 print
"<td>".dol_escape_htmltag($objp->login).
"</td>\n";
750 print
"<td>".$adh->getmorphylib($objp->morphy, 1).
"</td>\n";
753 print
"<td>".dol_print_email($objp->email, 0, 0, 1).
"</td>\n";
756 print
'<td class="nowrap">';
757 print $adh->getLibStatut(2);
762 print
'<td class="nowrap center">';
763 if ($datefin <
dol_now() && $objp->status > 0) {
770 print
'<td class="nowrap center">';
771 if (!empty($objp->subscription)) {
772 print
'<span class="opacitymedium">'.$langs->trans(
"SubscriptionNotReceived").
'</span>';
773 if ($objp->status > 0) {
774 print
" ".img_warning();
783 print
'<td class="center">';
784 if ($user->hasRight(
'adherent',
'creer')) {
785 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>';
787 if ($user->hasRight(
'adherent',
'supprimer')) {
788 print
'<a class="marginleftonly" href="card.php?rowid='.$objp->rowid.
'&action=resiliate&token='.
newToken().
'">'.
img_picto($langs->trans(
"Resiliate"),
'disable.png').
'</a>';
797 print
'<tr><td colspan="7"><span class="opacitymedium">'.$langs->trans(
"None").
'</span></td></tr>';
818 if ($action ==
'edit') {
820 $object->fetch($rowid);
821 $object->fetch_optionals();
825 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'?rowid='.$object->id.
'">';
826 print
'<input type="hidden" name="token" value="'.newToken().
'">';
827 print
'<input type="hidden" name="rowid" value="'.$object->id.
'">';
828 print
'<input type="hidden" name="action" value="update">';
832 print
'<table class="border centpercent">';
834 print
'<tr><td class="titlefield">'.$langs->trans(
"Ref").
'</td><td>'.$object->id.
'</td></tr>';
836 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>';
838 print
'<tr><td>'.$langs->trans(
"Status").
'</td><td>';
839 print
$form->selectarray(
'status', array(
'0'=>$langs->trans(
'ActivityCeased'),
'1'=>$langs->trans(
'InActivity')), $object->status, 0, 0, 0,
'', 0, 0, 0,
'',
'minwidth100');
843 $morphys[
""] = $langs->trans(
"MorAndPhy");
844 $morphys[
"phy"] = $langs->trans(
"Physical");
845 $morphys[
"mor"] = $langs->trans(
"Moral");
846 print
'<tr><td><span>'.$langs->trans(
"MembersNature").
'</span></td><td>';
850 print
'<tr><td>'.$langs->trans(
"SubscriptionRequired").
'</td><td>';
851 print
$form->selectyesno(
"subscription", $object->subscription, 1);
854 print
'<tr><td>'.$langs->trans(
"Amount").
'</td><td>';
855 print
'<input name="amount" size="5" value="';
856 print ((is_null($object->amount) || $object->amount ===
'') ?
'' :
price($object->amount));
860 print
'<tr><td>'.$form->textwithpicto($langs->trans(
"CanEditAmountShort"), $langs->transnoentities(
"CanEditAmountDetail")).
'</td><td>';
861 print
$form->selectyesno(
"caneditamount", $object->caneditamount, 1);
864 print
'<tr><td>'.$langs->trans(
"VoteAllowed").
'</td><td>';
865 print
$form->selectyesno(
"vote", $object->vote, 1);
868 print
'<tr><td>'.$langs->trans(
"Duration").
'</td><td colspan="3">';
869 print
'<input name="duration_value" size="5" value="'.$object->duration_value.
'"> ';
870 print $formproduct->selectMeasuringUnits(
"duration_unit",
"time", ($object->duration_unit ===
'' ?
'y' : $object->duration_unit), 0, 1);
873 print
'<tr><td class="tdtop">'.$langs->trans(
"Description").
'</td><td>';
874 require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
875 $doleditor =
new DolEditor(
'comment', $object->note_public,
'', 220,
'dolibarr_notes',
'',
false,
true, empty($conf->fckeditor->enabled) ?
false : $conf->fckeditor->enabled, 15,
'90%');
876 $doleditor->Create();
879 print
'<tr><td class="tdtop">'.$langs->trans(
"WelcomeEMail").
'</td><td>';
880 $doleditor =
new DolEditor(
'mail_valid', $object->mail_valid,
'', 280,
'dolibarr_notes',
'',
false,
true, empty($conf->fckeditor->enabled) ?
false : $conf->fckeditor->enabled, 15,
'90%');
881 $doleditor->Create();
885 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_edit.tpl.php';
891 print
$form->buttonsSaveCancel();
if(GETPOST('button_removefilter_x', 'alpha')||GETPOST('button_removefilter.x', 'alpha')||GETPOST('button_removefilter', 'alpha')) if(GETPOST('button_search_x', 'alpha')||GETPOST('button_search.x', 'alpha')||GETPOST('button_search', 'alpha')) if($action=="save" &&empty($cancel)) $help_url
View.
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.
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') &&!empty($user->rights->don->lire)) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->hasRight("commande", "lire") &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='rowid', $fieldref='ref', $morehtmlref='', $moreparam='', $nodbprefix=0, $morehtmlleft='', $morehtmlstatus='', $onlybanner=0, $morehtmlright='')
Show tab footer of a card.
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='')
Show tabs of a record.
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
GETPOSTINT($paramname, $method=0)
Return value of a param into GET or POST supervariable.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields.
yn($yesno, $case=1, $color=0)
Return yes or no in current language.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
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.
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
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...
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
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_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_now($mode='auto')
Return date for now.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
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.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
print_barre_liste($titre, $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.
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.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
img_edit($titlealt='default', $float=0, $other='')
Show logo editer/modifier fiche.
member_type_prepare_head(AdherentType $object)
Return array head with list of tabs to view object informations.
$nbtotalofrecords
Count total nb of records.
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.