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');
48 $sall =
GETPOST(
"sall",
"alpha");
49 $filter =
GETPOST(
"filter",
'alpha');
50 $search_lastname =
GETPOST(
'search_lastname',
'alpha');
51 $search_login =
GETPOST(
'search_login',
'alpha');
52 $search_email =
GETPOST(
'search_email',
'alpha');
53 $type =
GETPOST(
'type',
'intcomma');
54 $status =
GETPOST(
'status',
'alpha');
55 $optioncss =
GETPOST(
'optioncss',
'alpha');
57 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
58 $sortfield =
GETPOST(
'sortfield',
'aZ09comma');
59 $sortorder =
GETPOST(
'sortorder',
'aZ09comma');
61 if (empty($page) || $page == -1) {
64 $offset = $limit * $page;
65 $pageprev = $page - 1;
66 $pagenext = $page + 1;
71 $sortfield =
"d.lastname";
74 $label =
GETPOST(
"label",
"alpha");
75 $morphy =
GETPOST(
"morphy",
"alpha");
76 $status =
GETPOST(
"status",
"int");
77 $subscription =
GETPOST(
"subscription",
"int");
78 $amount =
GETPOST(
'amount',
'alpha');
79 $duration_value =
GETPOST(
'duration_value',
'int');
80 $duration_unit =
GETPOST(
'duration_unit',
'alpha');
82 $comment =
GETPOST(
"comment",
'restricthtml');
83 $mail_valid =
GETPOST(
"mail_valid",
'restricthtml');
87 $result =
restrictedArea($user,
'adherent', $rowid,
'adherent_type');
94 $extrafields->fetch_name_optionals_label($object->table_element);
96 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
97 $search_lastname =
"";
106 $hookmanager->initHooks(array(
'membertypecard',
'globalcard'));
116 if (!empty($backtopage)) {
117 header(
"Location: ".$backtopage);
122 if ($action ==
'add' && $user->hasRight(
'adherent',
'configurer')) {
123 $object->label = trim($label);
124 $object->morphy = trim($morphy);
125 $object->status = (int) $status;
126 $object->subscription = (int) $subscription;
127 $object->amount = ($amount ==
'' ?
'' :
price2num($amount,
'MT'));
128 $object->caneditamount = $caneditamount;
129 $object->duration_value = $duration_value;
130 $object->duration_unit = $duration_unit;
131 $object->note_public = trim($comment);
132 $object->note_private =
'';
133 $object->mail_valid = trim($mail_valid);
134 $object->vote = (int) $vote;
137 $ret = $extrafields->setOptionalsFromPost(
null, $object);
142 if (empty($object->label)) {
144 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Label")),
null,
'errors');
146 $sql =
"SELECT libelle FROM ".MAIN_DB_PREFIX.
"adherent_type WHERE libelle = '".$db->escape($object->label).
"'";
147 $sql .=
" WHERE entity IN (".getEntity(
'member_type').
")";
148 $result = $db->query($sql);
151 $num = $db->num_rows($result);
155 $langs->load(
"errors");
156 setEventMessages($langs->trans(
"ErrorLabelAlreadyExists", $login),
null,
'errors');
161 $id = $object->create($user);
163 header(
"Location: ".$_SERVER[
"PHP_SELF"]);
174 if ($action ==
'update' && $user->rights->adherent->configurer) {
175 $object->fetch($rowid);
179 $object->label= trim($label);
180 $object->morphy = trim($morphy);
181 $object->status = (int) $status;
182 $object->subscription = (int) $subscription;
183 $object->amount = ($amount ==
'' ?
'' :
price2num($amount,
'MT'));
184 $object->caneditamount = $caneditamount;
185 $object->duration_value = $duration_value;
186 $object->duration_unit = $duration_unit;
187 $object->note_public = trim($comment);
188 $object->note_private =
'';
189 $object->mail_valid = trim($mail_valid);
190 $object->vote = (boolean) trim($vote);
193 $ret = $extrafields->setOptionalsFromPost(
null, $object,
'@GETPOSTISSET');
198 $ret = $object->update($user);
200 if ($ret >= 0 && !count($object->errors)) {
206 header(
"Location: ".$_SERVER[
"PHP_SELF"].
"?rowid=".$object->id);
210 if ($action ==
'confirm_delete' && !empty($user->rights->adherent->configurer)) {
211 $object->fetch($rowid);
212 $res = $object->delete();
216 header(
"Location: ".$_SERVER[
"PHP_SELF"]);
219 setEventMessages($langs->trans(
"MemberTypeCanNotBeDeleted"),
null,
'errors');
232 $help_url =
'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder';
237 if (!$rowid && $action !=
'create' && $action !=
'edit') {
240 $sql =
"SELECT d.rowid, d.libelle as label, d.subscription, d.amount, d.caneditamount, d.vote, d.statut as status, d.morphy";
241 $sql .=
" FROM ".MAIN_DB_PREFIX.
"adherent_type as d";
242 $sql .=
" WHERE d.entity IN (".getEntity(
'member_type').
")";
244 $result = $db->query($sql);
246 $num = $db->num_rows($result);
252 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
253 $param .=
'&contextpage='.$contextpage;
255 if ($limit > 0 && $limit != $conf->liste_limit) {
256 $param .=
'&limit='.$limit;
260 if ($user->rights->adherent->configurer) {
261 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewMemberType'),
'',
'fa fa-plus-circle', DOL_URL_ROOT.
'/adherents/type.php?action=create');
264 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
265 if ($optioncss !=
'') {
266 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
268 print
'<input type="hidden" name="token" value="'.newToken().
'">';
269 print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
270 print
'<input type="hidden" name="action" value="list">';
271 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
272 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
274 print_barre_liste($langs->trans(
"MembersTypes"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder,
'', $num,
$nbtotalofrecords,
'members', 0, $newcardbutton,
'', $limit, 0, 0, 1);
278 print
'<div class="div-table-responsive">';
279 print
'<table class="tagtable liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
281 print
'<tr class="liste_titre">';
282 print
'<th>'.$langs->trans(
"Ref").
'</th>';
283 print
'<th>'.$langs->trans(
"Label").
'</th>';
284 print
'<th class="center">'.$langs->trans(
"MembersNature").
'</th>';
285 print
'<th class="center">'.$langs->trans(
"SubscriptionRequired").
'</th>';
286 print
'<th class="center">'.$langs->trans(
"Amount").
'</th>';
287 print
'<th class="center">'.$langs->trans(
"CanEditAmountShort").
'</th>';
288 print
'<th class="center">'.$langs->trans(
"VoteAllowed").
'</th>';
289 print
'<th class="center">'.$langs->trans(
"Status").
'</th>';
290 print
'<th> </th>';
296 $objp = $db->fetch_object($result);
298 $membertype->id = $objp->rowid;
299 $membertype->ref = $objp->rowid;
300 $membertype->label = $objp->rowid;
301 $membertype->status = $objp->status;
302 $membertype->subscription = $objp->subscription;
303 $membertype->amount = $objp->amount;
304 $membertype->caneditamount = $objp->caneditamount;
306 print
'<tr class="oddeven">';
307 print
'<td class="nowraponall">';
308 print $membertype->getNomUrl(1);
311 print
'<td>'.dol_escape_htmltag($objp->label).
'</td>';
312 print
'<td class="center">';
313 if ($objp->morphy ==
'phy') {
314 print $langs->trans(
"Physical");
315 } elseif ($objp->morphy ==
'mor') {
316 print $langs->trans(
"Moral");
318 print $langs->trans(
"MorAndPhy");
321 print
'<td class="center">'.yn($objp->subscription).
'</td>';
322 print
'<td class="center"><span class="amount">'.(is_null($objp->amount) || $objp->amount ===
'' ?
'' :
price($objp->amount)).
'</span></td>';
323 print
'<td class="center">'.yn($objp->caneditamount).
'</td>';
324 print
'<td class="center">'.yn($objp->vote).
'</td>';
325 print
'<td class="center">'.$membertype->getLibStatut(5).
'</td>';
326 if ($user->rights->adherent->configurer) {
327 print
'<td class="right"><a class="editfielda" href="'.$_SERVER[
"PHP_SELF"].
'?action=edit&rowid='.$objp->rowid.
'">'.
img_edit().
'</a></td>';
329 print
'<td class="right"> </td>';
344 print
'<tr><td colspan="'.$colspan.
'" class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</td></tr>';
357 if ($action ==
'create') {
362 print
'<form action="'.$_SERVER[
'PHP_SELF'].
'" method="POST">';
363 print
'<input type="hidden" name="token" value="'.newToken().
'">';
364 print
'<input type="hidden" name="action" value="add">';
368 print
'<table class="border centpercent">';
371 print
'<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans(
"Label").
'</td><td><input type="text" class="minwidth200" name="label" autofocus="autofocus"></td></tr>';
373 print
'<tr><td>'.$langs->trans(
"Status").
'</td><td>';
374 print
$form->selectarray(
'status', array(
'0'=>$langs->trans(
'ActivityCeased'),
'1'=>$langs->trans(
'InActivity')), 1, 0, 0, 0,
'', 0, 0, 0,
'',
'minwidth100');
379 $morphys[
""] = $langs->trans(
"MorAndPhy");
380 $morphys[
"phy"] = $langs->trans(
"Physical");
381 $morphys[
"mor"] = $langs->trans(
"Moral");
382 print
'<tr><td><span>'.$langs->trans(
"MembersNature").
'</span></td><td>';
386 print
'<tr><td>'.$form->textwithpicto($langs->trans(
"SubscriptionRequired"), $langs->trans(
"SubscriptionRequiredDesc")).
'</td><td>';
387 print
$form->selectyesno(
"subscription", 1, 1);
390 print
'<tr><td>'.$langs->trans(
"Amount").
'</td><td>';
391 print
'<input name="amount" size="5" value="'.(GETPOSTISSET(
'amount') ?
GETPOST(
'amount') :
price($amount)).
'">';
394 print
'<tr><td>'.$form->textwithpicto($langs->trans(
"CanEditAmountShort"), $langs->transnoentities(
"CanEditAmount")).
'</td><td>';
398 print
'<tr><td>'.$langs->trans(
"VoteAllowed").
'</td><td>';
402 print
'<tr><td>'.$langs->trans(
"Duration").
'</td><td colspan="3">';
403 print
'<input name="duration_value" size="5" value="'.GETPOST(
'duraction_unit',
'aZ09').
'"> ';
404 print $formproduct->selectMeasuringUnits(
"duration_unit",
"time",
GETPOSTISSET(
"duration_unit") ?
GETPOST(
'duration_unit',
'aZ09') :
'y', 0, 1);
407 print
'<tr><td class="tdtop">'.$langs->trans(
"Description").
'</td><td>';
408 require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
409 $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%');
410 $doleditor->Create();
412 print
'<tr><td class="tdtop">'.$langs->trans(
"WelcomeEMail").
'</td><td>';
413 require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
414 $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%');
415 $doleditor->Create();
419 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_add.tpl.php';
426 print
$form->buttonsSaveCancel();
433 if ($action !=
'edit') {
435 $object->fetch($rowid);
436 $object->fetch_optionals();
441 if ($action ==
'delete') {
442 print
$form->formconfirm($_SERVER[
'PHP_SELF'].
"?rowid=".$object->id, $langs->trans(
"DeleteAMemberType"), $langs->trans(
"ConfirmDeleteMemberType", $object->label),
"confirm_delete",
'', 0, 1);
449 $linkback =
'<a href="'.DOL_URL_ROOT.
'/adherents/type.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
453 print
'<div class="fichecenter">';
454 print
'<div class="underbanner clearboth"></div>';
456 print
'<table class="tableforfield border centpercent">';
459 print
'<tr><td>'.$langs->trans(
"MembersNature").
'</td><td class="valeur" >'.$object->getmorphylib($object->morphy).
'</td>';
462 print
'<tr><td>'.$form->textwithpicto($langs->trans(
"SubscriptionRequired"), $langs->trans(
"SubscriptionRequiredDesc")).
'</td><td>';
463 print
yn($object->subscription);
467 print
'<tr><td class="titlefield">'.$langs->trans(
"Amount").
'</td><td>';
468 print ((is_null($object->amount) || $object->amount ===
'') ?
'' :
'<span class="amount">'.price($object->amount).
'</span>');
471 print
'<tr><td>'.$form->textwithpicto($langs->trans(
"CanEditAmountShort"), $langs->transnoentities(
"CanEditAmount")).
'</td><td>';
472 print
yn($object->caneditamount);
475 print
'<tr><td>'.$langs->trans(
"VoteAllowed").
'</td><td>';
476 print
yn($object->vote);
479 print
'<tr><td class="titlefield">'.$langs->trans(
"Duration").
'</td><td colspan="2">'.$object->duration_value.
' ';
480 if ($object->duration_value > 1) {
481 $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"));
482 } elseif ($object->duration_value > 0) {
483 $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"));
485 print (!empty($object->duration_unit) && isset($dur[$object->duration_unit]) ? $langs->trans($dur[$object->duration_unit]) :
'').
" ";
488 print
'<tr><td class="tdtop">'.$langs->trans(
"Description").
'</td><td>';
489 print nl2br($object->note).
"</td></tr>";
491 print
'<tr><td class="tdtop">'.$langs->trans(
"WelcomeEMail").
'</td><td>';
492 print nl2br($object->mail_valid).
"</td></tr>";
495 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
506 print
'<div class="tabsAction">';
509 if ($user->hasRight(
'adherent',
'configurer')) {
510 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>';
514 if ($user->hasRight(
'adherent',
'configurer')&& !empty($object->status)) {
515 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>';
517 print
'<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans(
"NoAddMember")).
'">'.$langs->trans(
"AddMember").
'</a></div>';
521 if ($user->hasRight(
'adherent',
'configurer')) {
522 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>';
534 $sql =
"SELECT d.rowid, d.login, d.firstname, d.lastname, d.societe as company,";
535 $sql .=
" d.datefin,";
536 $sql .=
" d.email, d.fk_adherent_type as type_id, d.morphy, d.statut as status,";
537 $sql .=
" t.libelle as type, t.subscription, t.amount";
538 $sql .=
" FROM ".MAIN_DB_PREFIX.
"adherent as d, ".MAIN_DB_PREFIX.
"adherent_type as t";
539 $sql .=
" WHERE d.fk_adherent_type = t.rowid ";
540 $sql .=
" AND d.entity IN (".getEntity(
'adherent').
")";
541 $sql .=
" AND t.rowid = ".((int) $object->id);
543 $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);
548 if ($action ==
'search') {
549 if (
GETPOST(
'search',
'alpha')) {
553 if (!empty($search_lastname)) {
554 $sql .=
natural_search(array(
"d.firstname",
"d.lastname"), $search_lastname);
556 if (!empty($search_login)) {
559 if (!empty($search_email)) {
562 if ($filter ==
'uptodate') {
563 $sql .=
" AND (datefin >= '".$db->idate($now).
"') OR t.subscription = 0)";
565 if ($filter ==
'outofdate') {
566 $sql .=
" AND (datefin < '".$db->idate($now).
"' AND t.subscription = 1)";
569 $sql .=
" ".$db->order($sortfield, $sortorder);
573 if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
574 $resql = $db->query($sql);
586 $sql .=
" ".$db->plimit($conf->liste_limit + 1, $offset);
588 $resql = $db->query($sql);
590 $num = $db->num_rows(
$resql);
593 $titre = $langs->trans(
"MembersList");
595 if ($status ==
'-1,1') {
596 $titre = $langs->trans(
"MembersListQualified");
597 } elseif ($status ==
'-1') {
598 $titre = $langs->trans(
"MembersListToValid");
599 } elseif ($status ==
'1' && !$filter) {
600 $titre = $langs->trans(
"MembersListValid");
601 } elseif ($status ==
'1' && $filter ==
'uptodate') {
602 $titre = $langs->trans(
"MembersListUpToDate");
603 } elseif ($status ==
'1' && $filter ==
'outofdate') {
604 $titre = $langs->trans(
"MembersListNotUpToDate");
605 } elseif ($status ==
'0') {
606 $titre = $langs->trans(
"MembersListResiliated");
607 } elseif ($status ==
'-2') {
608 $titre = $langs->trans(
"MembersListExcluded");
610 } elseif ($action ==
'search') {
611 $titre = $langs->trans(
"MembersListQualified");
616 $result = $membertype->fetch($type);
617 $titre .=
" (".$membertype->label.
")";
620 $param =
"&rowid=".urlencode($object->id);
621 if (!empty($status)) {
622 $param .=
"&status=".urlencode($status);
624 if (!empty($search_lastname)) {
625 $param .=
"&search_lastname=".urlencode($search_lastname);
627 if (!empty($search_firstname)) {
628 $param .=
"&search_firstname=".urlencode($search_firstname);
630 if (!empty($search_login)) {
631 $param .=
"&search_login=".urlencode($search_login);
633 if (!empty($search_email)) {
634 $param .=
"&search_email=".urlencode($search_email);
636 if (!empty($filter)) {
637 $param .=
"&filter=".urlencode($filter);
641 print $langs->trans(
"Filter").
" (".$langs->trans(
"Lastname").
", ".$langs->trans(
"Firstname").
", ".$langs->trans(
"EMail").
", ".$langs->trans(
"Address").
" ".$langs->trans(
"or").
" ".$langs->trans(
"Town").
"): ".$sall;
644 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
645 print
'<input type="hidden" name="token" value="'.newToken().
'">';
646 print
'<input class="flat" type="hidden" name="rowid" value="'.$object->id.
'"></td>';
653 print
'<div class="div-table-responsive">';
654 print
'<table class="tagtable liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
657 print
'<tr class="liste_titre_filter">';
659 print
'<td class="liste_titre left">';
660 print
'<input class="flat maxwidth100" type="text" name="search_lastname" value="'.dol_escape_htmltag($search_lastname).
'"></td>';
662 print
'<td class="liste_titre left">';
663 print
'<input class="flat maxwidth100" type="text" name="search_login" value="'.dol_escape_htmltag($search_login).
'"></td>';
665 print
'<td class="liste_titre"> </td>';
667 print
'<td class="liste_titre left">';
668 print
'<input class="flat maxwidth100" type="text" name="search_email" value="'.dol_escape_htmltag($search_email).
'"></td>';
670 print
'<td class="liste_titre"> </td>';
672 print
'<td class="liste_titre right" colspan="2">';
673 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")).
'">';
675 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")).
'">';
680 print
'<tr class="liste_titre">';
681 print_liste_field_titre(
"NameSlashCompany", $_SERVER[
"PHP_SELF"],
"d.lastname", $param,
"",
"", $sortfield, $sortorder);
683 print_liste_field_titre(
"MemberNature", $_SERVER[
"PHP_SELF"],
"d.morphy", $param,
"",
"", $sortfield, $sortorder);
685 print_liste_field_titre(
"Status", $_SERVER[
"PHP_SELF"],
"d.statut,d.datefin", $param,
"",
"", $sortfield, $sortorder);
686 print_liste_field_titre(
"EndSubscription", $_SERVER[
"PHP_SELF"],
"d.datefin", $param,
"",
'align="center"', $sortfield, $sortorder);
687 print_liste_field_titre(
"Action", $_SERVER[
"PHP_SELF"],
"", $param,
"",
'width="60" align="center"', $sortfield, $sortorder);
692 $imaxinloop = ($limit ? min($num, $limit) : $num);
693 while ($i < $imaxinloop) {
694 $objp = $db->fetch_object(
$resql);
696 $datefin = $db->jdate($objp->datefin);
698 $adh->lastname = $objp->lastname;
699 $adh->firstname = $objp->firstname;
700 $adh->datefin = $datefin;
701 $adh->need_subscription = $objp->subscription;
702 $adh->statut = $objp->status;
704 print
'<tr class="oddeven">';
707 if ($objp->company !=
'') {
708 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";
710 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";
714 print
"<td>".dol_escape_htmltag($objp->login).
"</td>\n";
725 print
"<td>".$adh->getmorphylib($objp->morphy, 1).
"</td>\n";
728 print
"<td>".dol_print_email($objp->email, 0, 0, 1).
"</td>\n";
731 print
'<td class="nowrap">';
732 print $adh->getLibStatut(2);
737 print
'<td class="nowrap center">';
738 if ($datefin <
dol_now() && $objp->status > 0) {
745 print
'<td class="nowrap center">';
746 if (!empty($objp->subscription)) {
747 print
'<span class="opacitymedium">'.$langs->trans(
"SubscriptionNotReceived").
'</span>';
748 if ($objp->status > 0) {
749 print
" ".img_warning();
758 print
'<td class="center">';
759 if ($user->hasRight(
'adherent',
'creer')) {
760 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>';
762 if ($user->hasRight(
'adherent',
'supprimer')) {
763 print
'<a class="marginleftonly" href="card.php?rowid='.$objp->rowid.
'&action=resiliate&token='.
newToken().
'">'.
img_picto($langs->trans(
"Resiliate"),
'disable.png').
'</a>';
772 print
'<tr><td colspan="7"><span class="opacitymedium">'.$langs->trans(
"None").
'</span></td></tr>';
789 if ($action ==
'edit') {
791 $object->fetch($rowid);
792 $object->fetch_optionals();
796 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'?rowid='.$object->id.
'">';
797 print
'<input type="hidden" name="token" value="'.newToken().
'">';
798 print
'<input type="hidden" name="rowid" value="'.$object->id.
'">';
799 print
'<input type="hidden" name="action" value="update">';
803 print
'<table class="border centpercent">';
805 print
'<tr><td class="titlefield">'.$langs->trans(
"Ref").
'</td><td>'.$object->id.
'</td></tr>';
807 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>';
809 print
'<tr><td>'.$langs->trans(
"Status").
'</td><td>';
810 print
$form->selectarray(
'status', array(
'0'=>$langs->trans(
'ActivityCeased'),
'1'=>$langs->trans(
'InActivity')), $object->status, 0, 0, 0,
'', 0, 0, 0,
'',
'minwidth100');
814 $morphys[
""] = $langs->trans(
"MorAndPhy");
815 $morphys[
"phy"] = $langs->trans(
"Physical");
816 $morphys[
"mor"] = $langs->trans(
"Moral");
817 print
'<tr><td><span>'.$langs->trans(
"MembersNature").
'</span></td><td>';
821 print
'<tr><td>'.$langs->trans(
"SubscriptionRequired").
'</td><td>';
822 print
$form->selectyesno(
"subscription", $object->subscription, 1);
825 print
'<tr><td>'.$langs->trans(
"Amount").
'</td><td>';
826 print
'<input name="amount" size="5" value="';
827 print ((is_null($object->amount) || $object->amount ===
'') ?
'' :
price($object->amount));
831 print
'<tr><td>'.$form->textwithpicto($langs->trans(
"CanEditAmountShort"), $langs->transnoentities(
"CanEditAmountDetail")).
'</td><td>';
832 print
$form->selectyesno(
"caneditamount", $object->caneditamount, 1);
835 print
'<tr><td>'.$langs->trans(
"VoteAllowed").
'</td><td>';
836 print
$form->selectyesno(
"vote", $object->vote, 1);
839 print
'<tr><td>'.$langs->trans(
"Duration").
'</td><td colspan="3">';
840 print
'<input name="duration_value" size="5" value="'.$object->duration_value.
'"> ';
841 print $formproduct->selectMeasuringUnits(
"duration_unit",
"time", ($object->duration_unit ===
'' ?
'y' : $object->duration_unit), 0, 1);
844 print
'<tr><td class="tdtop">'.$langs->trans(
"Description").
'</td><td>';
845 require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
846 $doleditor =
new DolEditor(
'comment', $object->note_public,
'', 220,
'dolibarr_notes',
'',
false,
true, empty($conf->fckeditor->enabled) ?
false : $conf->fckeditor->enabled, 15,
'90%');
847 $doleditor->Create();
850 print
'<tr><td class="tdtop">'.$langs->trans(
"WelcomeEMail").
'</td><td>';
851 $doleditor =
new DolEditor(
'mail_valid', $object->mail_valid,
'', 280,
'dolibarr_notes',
'',
false,
true, empty($conf->fckeditor->enabled) ?
false : $conf->fckeditor->enabled, 15,
'90%');
852 $doleditor->Create();
856 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_edit.tpl.php';
862 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.