32 require
'../main.inc.php';
33 require_once DOL_DOCUMENT_ROOT.
'/core/lib/member.lib.php';
34 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
35 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent_type.class.php';
36 require_once DOL_DOCUMENT_ROOT.
'/core/class/extrafields.class.php';
37 require_once DOL_DOCUMENT_ROOT.
'/product/class/html.formproduct.class.php';
39 $langs->load(
"members");
41 $rowid =
GETPOST(
'rowid',
'int');
42 $action =
GETPOST(
'action',
'aZ09');
43 $cancel =
GETPOST(
'cancel',
'alpha');
44 $contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') : str_replace(
'_',
'', basename(dirname(__FILE__)).basename(__FILE__,
'.php'));
45 $backtopage =
GETPOST(
'backtopage',
'alpha');
47 $sall =
GETPOST(
"sall",
"alpha");
48 $filter =
GETPOST(
"filter",
'alpha');
49 $search_lastname =
GETPOST(
'search_lastname',
'alpha');
50 $search_login =
GETPOST(
'search_login',
'alpha');
51 $search_email =
GETPOST(
'search_email',
'alpha');
52 $type =
GETPOST(
'type',
'intcomma');
53 $status =
GETPOST(
'status',
'alpha');
54 $optioncss =
GETPOST(
'optioncss',
'alpha');
56 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
57 $sortfield =
GETPOST(
'sortfield',
'aZ09comma');
58 $sortorder =
GETPOST(
'sortorder',
'aZ09comma');
60 if (empty($page) || $page == -1) {
63 $offset = $limit * $page;
64 $pageprev = $page - 1;
65 $pagenext = $page + 1;
70 $sortfield =
"d.lastname";
73 $label =
GETPOST(
"label",
"alpha");
74 $morphy =
GETPOST(
"morphy",
"alpha");
75 $status =
GETPOST(
"status",
"int");
76 $subscription =
GETPOST(
"subscription",
"int");
77 $amount =
GETPOST(
'amount',
'alpha');
78 $duration_value =
GETPOST(
'duration_value',
'int');
79 $duration_unit =
GETPOST(
'duration_unit',
'alpha');
81 $comment =
GETPOST(
"comment",
'restricthtml');
82 $mail_valid =
GETPOST(
"mail_valid",
'restricthtml');
85 $result =
restrictedArea($user,
'adherent', $rowid,
'adherent_type');
92 $extrafields->fetch_name_optionals_label($object->table_element);
94 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
95 $search_lastname =
"";
104 $hookmanager->initHooks(array(
'membertypecard',
'globalcard'));
114 if (!empty($backtopage)) {
115 header(
"Location: ".$backtopage);
120 if ($action ==
'add' && $user->rights->adherent->configurer) {
121 $object->label = trim($label);
122 $object->morphy = trim($morphy);
123 $object->status = (int) $status;
124 $object->subscription = (int) $subscription;
125 $object->amount = ($amount ==
'' ?
'' :
price2num($amount,
'MT'));
126 $object->duration_value = $duration_value;
127 $object->duration_unit = $duration_unit;
128 $object->note = trim($comment);
129 $object->note_public = trim($comment);
130 $object->mail_valid = trim($mail_valid);
131 $object->vote = (int) $vote;
134 $ret = $extrafields->setOptionalsFromPost(
null, $object);
139 if (empty($object->label)) {
141 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Label")),
null,
'errors');
143 $sql =
"SELECT libelle FROM ".MAIN_DB_PREFIX.
"adherent_type WHERE libelle='".$db->escape($object->label).
"'";
144 $sql .=
" WHERE entity IN (".getEntity(
'member_type').
")";
145 $result = $db->query($sql);
147 $num = $db->num_rows($result);
151 $langs->load(
"errors");
152 setEventMessages($langs->trans(
"ErrorLabelAlreadyExists", $login),
null,
'errors');
157 $id = $object->create($user);
159 header(
"Location: ".$_SERVER[
"PHP_SELF"]);
170 if ($action ==
'update' && $user->rights->adherent->configurer) {
171 $object->fetch($rowid);
173 $object->oldcopy = clone $object;
174 $object->label= trim($label);
175 $object->morphy = trim($morphy);
176 $object->status = (int) $status;
177 $object->subscription = (int) $subscription;
178 $object->amount = ($amount ==
'' ?
'' :
price2num($amount,
'MT'));
179 $object->duration_value = $duration_value;
180 $object->duration_unit = $duration_unit;
181 $object->note = trim($comment);
182 $object->note_public = trim($comment);
183 $object->mail_valid = trim($mail_valid);
184 $object->vote = (boolean) trim($vote);
187 $ret = $extrafields->setOptionalsFromPost(
null, $object,
'@GETPOSTISSET');
192 $ret = $object->update($user);
194 if ($ret >= 0 && !count($object->errors)) {
200 header(
"Location: ".$_SERVER[
"PHP_SELF"].
"?rowid=".$object->id);
204 if ($action ==
'confirm_delete' && !empty($user->rights->adherent->configurer)) {
205 $object->fetch($rowid);
206 $res = $object->delete();
210 header(
"Location: ".$_SERVER[
"PHP_SELF"]);
213 setEventMessages($langs->trans(
"MemberTypeCanNotBeDeleted"),
null,
'errors');
226 $help_url =
'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder';
231 if (!$rowid && $action !=
'create' && $action !=
'edit') {
234 $sql =
"SELECT d.rowid, d.libelle as label, d.subscription, d.amount, d.vote, d.statut as status, d.morphy";
235 $sql .=
" FROM ".MAIN_DB_PREFIX.
"adherent_type as d";
236 $sql .=
" WHERE d.entity IN (".getEntity(
'member_type').
")";
238 $result = $db->query($sql);
240 $num = $db->num_rows($result);
241 $nbtotalofrecords = $num;
246 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
247 $param .=
'&contextpage='.$contextpage;
249 if ($limit > 0 && $limit != $conf->liste_limit) {
250 $param .=
'&limit='.$limit;
254 if ($user->rights->adherent->configurer) {
255 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewMemberType'),
'',
'fa fa-plus-circle', DOL_URL_ROOT.
'/adherents/type.php?action=create');
258 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
259 if ($optioncss !=
'') {
260 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
262 print
'<input type="hidden" name="token" value="'.newToken().
'">';
263 print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
264 print
'<input type="hidden" name="action" value="list">';
265 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
266 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
268 print_barre_liste($langs->trans(
"MembersTypes"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder,
'', $num, $nbtotalofrecords,
'members', 0, $newcardbutton,
'', $limit, 0, 0, 1);
272 print
'<div class="div-table-responsive">';
273 print
'<table class="tagtable liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
275 print
'<tr class="liste_titre">';
276 print
'<th>'.$langs->trans(
"Ref").
'</th>';
277 print
'<th>'.$langs->trans(
"Label").
'</th>';
278 print
'<th class="center">'.$langs->trans(
"MembersNature").
'</th>';
279 print
'<th class="center">'.$langs->trans(
"SubscriptionRequired").
'</th>';
280 print
'<th class="center">'.$langs->trans(
"Amount").
'</th>';
281 print
'<th class="center">'.$langs->trans(
"VoteAllowed").
'</th>';
282 print
'<th class="center">'.$langs->trans(
"Status").
'</th>';
283 print
'<th> </th>';
289 $objp = $db->fetch_object($result);
291 $membertype->id = $objp->rowid;
292 $membertype->ref = $objp->rowid;
293 $membertype->label = $objp->rowid;
294 $membertype->status = $objp->status;
295 $membertype->subscription = $objp->subscription;
296 $membertype->amount = $objp->amount;
298 print
'<tr class="oddeven">';
299 print
'<td class="nowraponall">';
300 print $membertype->getNomUrl(1);
303 print
'<td>'.dol_escape_htmltag($objp->label).
'</td>';
304 print
'<td class="center">';
305 if ($objp->morphy ==
'phy') {
306 print $langs->trans(
"Physical");
307 } elseif ($objp->morphy ==
'mor') {
308 print $langs->trans(
"Moral");
310 print $langs->trans(
"MorAndPhy");
313 print
'<td class="center">'.yn($objp->subscription).
'</td>';
314 print
'<td class="center"><span class="amount">'.(is_null($objp->amount) || $objp->amount ===
'' ?
'' :
price($objp->amount)).
'</span></td>';
315 print
'<td class="center">'.yn($objp->vote).
'</td>';
316 print
'<td class="center">'.$membertype->getLibStatut(5).
'</td>';
317 if ($user->rights->adherent->configurer) {
318 print
'<td class="right"><a class="editfielda" href="'.$_SERVER[
"PHP_SELF"].
'?action=edit&rowid='.$objp->rowid.
'">'.
img_edit().
'</a></td>';
320 print
'<td class="right"> </td>';
335 print
'<tr><td colspan="'.$colspan.
'" class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</td></tr>';
348 if ($action ==
'create') {
353 print
'<form action="'.$_SERVER[
'PHP_SELF'].
'" method="POST">';
354 print
'<input type="hidden" name="token" value="'.newToken().
'">';
355 print
'<input type="hidden" name="action" value="add">';
359 print
'<table class="border centpercent">';
362 print
'<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans(
"Label").
'</td><td><input type="text" class="minwidth200" name="label" autofocus="autofocus"></td></tr>';
364 print
'<tr><td>'.$langs->trans(
"Status").
'</td><td>';
365 print
$form->selectarray(
'status', array(
'0'=>$langs->trans(
'ActivityCeased'),
'1'=>$langs->trans(
'InActivity')), 1, 0, 0, 0,
'', 0, 0, 0,
'',
'minwidth100');
370 $morphys[
""] = $langs->trans(
"MorAndPhy");
371 $morphys[
"phy"] = $langs->trans(
"Physical");
372 $morphys[
"mor"] = $langs->trans(
"Moral");
373 print
'<tr><td><span>'.$langs->trans(
"MembersNature").
'</span></td><td>';
377 print
'<tr><td>'.$langs->trans(
"SubscriptionRequired").
'</td><td>';
378 print
$form->selectyesno(
"subscription", 1, 1);
381 print
'<tr><td>'.$langs->trans(
"Amount").
'</td><td>';
382 print
'<input name="amount" size="5" value="'.(GETPOSTISSET(
'amount') ?
GETPOST(
'amount') :
price($amount)).
'">';
385 print
'<tr><td>'.$langs->trans(
"VoteAllowed").
'</td><td>';
389 print
'<tr><td>'.$langs->trans(
"Duration").
'</td><td colspan="3">';
390 print
'<input name="duration_value" size="5" value="'.GETPOST(
'duraction_unit',
'aZ09').
'"> ';
391 print $formproduct->selectMeasuringUnits(
"duration_unit",
"time",
GETPOSTISSET(
"duration_unit") ?
GETPOST(
'duration_unit',
'aZ09') :
'y', 0, 1);
394 print
'<tr><td class="tdtop">'.$langs->trans(
"Description").
'</td><td>';
395 require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
396 $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%');
397 $doleditor->Create();
399 print
'<tr><td class="tdtop">'.$langs->trans(
"WelcomeEMail").
'</td><td>';
400 require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
401 $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%');
402 $doleditor->Create();
406 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_add.tpl.php';
413 print
$form->buttonsSaveCancel();
420 if ($action !=
'edit') {
422 $object->fetch($rowid);
423 $object->fetch_optionals();
428 if ($action ==
'delete') {
429 print
$form->formconfirm($_SERVER[
'PHP_SELF'].
"?rowid=".$object->id, $langs->trans(
"DeleteAMemberType"), $langs->trans(
"ConfirmDeleteMemberType", $object->label),
"confirm_delete",
'', 0, 1);
436 $linkback =
'<a href="'.DOL_URL_ROOT.
'/adherents/type.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
440 print
'<div class="fichecenter">';
441 print
'<div class="underbanner clearboth"></div>';
443 print
'<table class="tableforfield border centpercent">';
446 print
'<tr><td>'.$langs->trans(
"MembersNature").
'</td><td class="valeur" >'.$object->getmorphylib($object->morphy).
'</td>';
449 print
'<tr><td class="titlefield">'.$langs->trans(
"SubscriptionRequired").
'</td><td>';
450 print
yn($object->subscription);
454 print
'<tr><td class="titlefield">'.$langs->trans(
"Amount").
'</td><td>';
455 print ((is_null($object->amount) || $object->amount ===
'') ?
'' :
'<span class="amount">'.price($object->amount).
'</span>');
458 print
'<tr><td>'.$langs->trans(
"VoteAllowed").
'</td><td>';
459 print
yn($object->vote);
462 print
'<tr><td class="titlefield">'.$langs->trans(
"Duration").
'</td><td colspan="2">'.$object->duration_value.
' ';
463 if ($object->duration_value > 1) {
464 $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"));
465 } elseif ($object->duration_value > 0) {
466 $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"));
468 print (!empty($object->duration_unit) && isset($dur[$object->duration_unit]) ? $langs->trans($dur[$object->duration_unit]) :
'').
" ";
471 print
'<tr><td class="tdtop">'.$langs->trans(
"Description").
'</td><td>';
472 print nl2br($object->note).
"</td></tr>";
474 print
'<tr><td class="tdtop">'.$langs->trans(
"WelcomeEMail").
'</td><td>';
475 print nl2br($object->mail_valid).
"</td></tr>";
478 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
489 print
'<div class="tabsAction">';
492 if ($user->rights->adherent->configurer) {
493 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>';
497 if ($user->rights->adherent->configurer && !empty($object->status)) {
498 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>';
500 print
'<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans(
"NoAddMember")).
'">'.$langs->trans(
"AddMember").
'</a></div>';
504 if ($user->rights->adherent->configurer) {
505 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>';
517 $sql =
"SELECT d.rowid, d.login, d.firstname, d.lastname, d.societe as company,";
518 $sql .=
" d.datefin,";
519 $sql .=
" d.email, d.fk_adherent_type as type_id, d.morphy, d.statut as status,";
520 $sql .=
" t.libelle as type, t.subscription, t.amount";
521 $sql .=
" FROM ".MAIN_DB_PREFIX.
"adherent as d, ".MAIN_DB_PREFIX.
"adherent_type as t";
522 $sql .=
" WHERE d.fk_adherent_type = t.rowid ";
523 $sql .=
" AND d.entity IN (".getEntity(
'adherent').
")";
524 $sql .=
" AND t.rowid = ".((int) $object->id);
526 $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);
531 if ($action ==
'search') {
532 if (
GETPOST(
'search',
'alpha')) {
536 if (!empty($search_lastname)) {
537 $sql .=
natural_search(array(
"d.firstname",
"d.lastname"), $search_lastname);
539 if (!empty($search_login)) {
542 if (!empty($search_email)) {
545 if ($filter ==
'uptodate') {
546 $sql .=
" AND (datefin >= '".$db->idate($now).
"') OR t.subscription = 0)";
548 if ($filter ==
'outofdate') {
549 $sql .=
" AND (datefin < '".$db->idate($now).
"' AND t.subscription = 1)";
552 $sql .=
" ".$db->order($sortfield, $sortorder);
555 $nbtotalofrecords =
'';
556 if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
557 $resql = $db->query($sql);
559 $nbtotalofrecords = $db->num_rows($result);
563 if (($page * $limit) > $nbtotalofrecords) {
569 $sql .=
" ".$db->plimit($conf->liste_limit + 1, $offset);
571 $resql = $db->query($sql);
573 $num = $db->num_rows(
$resql);
576 $titre = $langs->trans(
"MembersList");
578 if ($status ==
'-1,1') {
579 $titre = $langs->trans(
"MembersListQualified");
580 } elseif ($status ==
'-1') {
581 $titre = $langs->trans(
"MembersListToValid");
582 } elseif ($status ==
'1' && !$filter) {
583 $titre = $langs->trans(
"MembersListValid");
584 } elseif ($status ==
'1' && $filter ==
'uptodate') {
585 $titre = $langs->trans(
"MembersListUpToDate");
586 } elseif ($status ==
'1' && $filter ==
'outofdate') {
587 $titre = $langs->trans(
"MembersListNotUpToDate");
588 } elseif ($status ==
'0') {
589 $titre = $langs->trans(
"MembersListResiliated");
590 } elseif ($status ==
'-2') {
591 $titre = $langs->trans(
"MembersListExcluded");
593 } elseif ($action ==
'search') {
594 $titre = $langs->trans(
"MembersListQualified");
599 $result = $membertype->fetch($type);
600 $titre .=
" (".$membertype->label.
")";
603 $param =
"&rowid=".urlencode($object->id);
604 if (!empty($status)) {
605 $param .=
"&status=".urlencode($status);
607 if (!empty($search_lastname)) {
608 $param .=
"&search_lastname=".urlencode($search_lastname);
610 if (!empty($search_firstname)) {
611 $param .=
"&search_firstname=".urlencode($search_firstname);
613 if (!empty($search_login)) {
614 $param .=
"&search_login=".urlencode($search_login);
616 if (!empty($search_email)) {
617 $param .=
"&search_email=".urlencode($search_email);
619 if (!empty($filter)) {
620 $param .=
"&filter=".urlencode($filter);
624 print $langs->trans(
"Filter").
" (".$langs->trans(
"Lastname").
", ".$langs->trans(
"Firstname").
", ".$langs->trans(
"EMail").
", ".$langs->trans(
"Address").
" ".$langs->trans(
"or").
" ".$langs->trans(
"Town").
"): ".$sall;
627 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
628 print
'<input type="hidden" name="token" value="'.newToken().
'">';
629 print
'<input class="flat" type="hidden" name="rowid" value="'.$object->id.
'" size="12"></td>';
632 print_barre_liste(
'', $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder,
'', $num, $nbtotalofrecords);
636 print
'<div class="div-table-responsive">';
637 print
'<table class="tagtable liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
640 print
'<tr class="liste_titre_filter">';
642 print
'<td class="liste_titre left">';
643 print
'<input class="flat" type="text" name="search_lastname" value="'.dol_escape_htmltag($search_lastname).
'" size="12"></td>';
645 print
'<td class="liste_titre left">';
646 print
'<input class="flat" type="text" name="search_login" value="'.dol_escape_htmltag($search_login).
'" size="7"></td>';
648 print
'<td class="liste_titre"> </td>';
650 print
'<td class="liste_titre left">';
651 print
'<input class="flat" type="text" name="search_email" value="'.dol_escape_htmltag($search_email).
'" size="12"></td>';
653 print
'<td class="liste_titre"> </td>';
655 print
'<td class="liste_titre right" colspan="2">';
656 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")).
'">';
658 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")).
'">';
663 print
'<tr class="liste_titre">';
664 print_liste_field_titre(
"NameSlashCompany", $_SERVER[
"PHP_SELF"],
"d.lastname", $param,
"",
"", $sortfield, $sortorder);
666 print_liste_field_titre(
"MemberNature", $_SERVER[
"PHP_SELF"],
"d.morphy", $param,
"",
"", $sortfield, $sortorder);
668 print_liste_field_titre(
"Status", $_SERVER[
"PHP_SELF"],
"d.statut,d.datefin", $param,
"",
"", $sortfield, $sortorder);
669 print_liste_field_titre(
"EndSubscription", $_SERVER[
"PHP_SELF"],
"d.datefin", $param,
"",
'align="center"', $sortfield, $sortorder);
670 print_liste_field_titre(
"Action", $_SERVER[
"PHP_SELF"],
"", $param,
"",
'width="60" align="center"', $sortfield, $sortorder);
675 $imaxinloop = ($limit ? min($num, $limit) : $num);
676 while ($i < $imaxinloop) {
677 $objp = $db->fetch_object(
$resql);
679 $datefin = $db->jdate($objp->datefin);
681 $adh->lastname = $objp->lastname;
682 $adh->firstname = $objp->firstname;
683 $adh->datefin = $datefin;
684 $adh->need_subscription = $objp->subscription;
685 $adh->statut = $objp->status;
687 print
'<tr class="oddeven">';
690 if ($objp->company !=
'') {
691 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";
693 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";
697 print
"<td>".dol_escape_htmltag($objp->login).
"</td>\n";
708 print
"<td>".$adh->getmorphylib($objp->morphy).
"</td>\n";
711 print
"<td>".dol_print_email($objp->email, 0, 0, 1).
"</td>\n";
714 print
'<td class="nowrap">';
715 print $adh->getLibStatut(2);
720 print
'<td class="nowrap center">';
721 if ($datefin <
dol_now() && $objp->status > 0) {
728 print
'<td class="nowrap left">';
729 if (!empty($objp->subscription)) {
730 print $langs->trans(
"SubscriptionNotReceived");
731 if ($objp->status > 0) {
732 print
" ".img_warning();
741 print
'<td class="center">';
742 if ($user->rights->adherent->creer) {
743 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>';
745 if ($user->rights->adherent->supprimer) {
746 print
'<a class="marginleftonly" href="card.php?rowid='.$objp->rowid.
'&action=resign&token='.
newToken().
'">'.
img_picto($langs->trans(
"Resiliate"),
'disable.png').
'</a>';
755 print
'<tr><td colspan="7"><span class="opacitymedium">'.$langs->trans(
"None").
'</span></td></tr>';
763 print_barre_liste(
'', $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder,
'', $num, $nbtotalofrecords,
'');
776 if ($action ==
'edit') {
778 $object->fetch($rowid);
779 $object->fetch_optionals();
783 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'?rowid='.$object->id.
'">';
784 print
'<input type="hidden" name="token" value="'.newToken().
'">';
785 print
'<input type="hidden" name="rowid" value="'.$object->id.
'">';
786 print
'<input type="hidden" name="action" value="update">';
790 print
'<table class="border centpercent">';
792 print
'<tr><td class="titlefield">'.$langs->trans(
"Ref").
'</td><td>'.$object->id.
'</td></tr>';
794 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>';
796 print
'<tr><td>'.$langs->trans(
"Status").
'</td><td>';
797 print
$form->selectarray(
'status', array(
'0'=>$langs->trans(
'ActivityCeased'),
'1'=>$langs->trans(
'InActivity')), $object->status, 0, 0, 0,
'', 0, 0, 0,
'',
'minwidth100');
801 $morphys[
""] = $langs->trans(
"MorAndPhy");
802 $morphys[
"phy"] = $langs->trans(
"Physical");
803 $morphys[
"mor"] = $langs->trans(
"Moral");
804 print
'<tr><td><span>'.$langs->trans(
"MembersNature").
'</span></td><td>';
808 print
'<tr><td>'.$langs->trans(
"SubscriptionRequired").
'</td><td>';
809 print
$form->selectyesno(
"subscription", $object->subscription, 1);
812 print
'<tr><td>'.$langs->trans(
"Amount").
'</td><td>';
813 print
'<input name="amount" size="5" value="';
814 print ((is_null($object->amount) || $object->amount ===
'') ?
'' :
price($object->amount));
818 print
'<tr><td>'.$langs->trans(
"VoteAllowed").
'</td><td>';
819 print
$form->selectyesno(
"vote", $object->vote, 1);
822 print
'<tr><td>'.$langs->trans(
"Duration").
'</td><td colspan="3">';
823 print
'<input name="duration_value" size="5" value="'.$object->duration_value.
'"> ';
824 print $formproduct->selectMeasuringUnits(
"duration_unit",
"time", ($object->duration_unit ===
'' ?
'y' : $object->duration_unit), 0, 1);
827 print
'<tr><td class="tdtop">'.$langs->trans(
"Description").
'</td><td>';
828 require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
829 $doleditor =
new DolEditor(
'comment', $object->note,
'', 280,
'dolibarr_notes',
'',
false,
true, empty($conf->fckeditor->enabled) ?
false : $conf->fckeditor->enabled, 15,
'90%');
830 $doleditor->Create();
833 print
'<tr><td class="tdtop">'.$langs->trans(
"WelcomeEMail").
'</td><td>';
834 $doleditor =
new DolEditor(
'mail_valid', $object->mail_valid,
'', 280,
'dolibarr_notes',
'',
false,
true, empty($conf->fckeditor->enabled) ?
false : $conf->fckeditor->enabled, 15,
'90%');
835 $doleditor->Create();
839 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_edit.tpl.php';
845 print
$form->buttonsSaveCancel();