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';
41 $langs->load(
"members");
43 $rowid =
GETPOST(
'rowid',
'int');
44 $action =
GETPOST(
'action',
'aZ09');
45 $massaction =
GETPOST(
'massaction',
'alpha');
46 $cancel =
GETPOST(
'cancel',
'alpha');
47 $contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') : str_replace(
'_',
'', basename(dirname(__FILE__)).basename(__FILE__,
'.php'));
48 $backtopage =
GETPOST(
'backtopage',
'alpha');
49 $mode =
GETPOST(
'mode',
'alopha');
51 $sall =
GETPOST(
"sall",
"alpha");
52 $filter =
GETPOST(
"filter",
'alpha');
53 $search_lastname =
GETPOST(
'search_lastname',
'alpha');
54 $search_login =
GETPOST(
'search_login',
'alpha');
55 $search_email =
GETPOST(
'search_email',
'alpha');
56 $type =
GETPOST(
'type',
'intcomma');
57 $status =
GETPOST(
'status',
'alpha');
58 $optioncss =
GETPOST(
'optioncss',
'alpha');
61 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
62 $sortfield =
GETPOST(
'sortfield',
'aZ09comma');
63 $sortorder =
GETPOST(
'sortorder',
'aZ09comma');
65 if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
69 $offset = $limit * $page;
70 $pageprev = $page - 1;
71 $pagenext = $page + 1;
76 $sortfield =
"d.lastname";
79 $label =
GETPOST(
"label",
"alpha");
80 $morphy =
GETPOST(
"morphy",
"alpha");
81 $status =
GETPOST(
"status",
"int");
82 $subscription =
GETPOST(
"subscription",
"int");
83 $amount =
GETPOST(
'amount',
'alpha');
84 $duration_value =
GETPOST(
'duration_value',
'int');
85 $duration_unit =
GETPOST(
'duration_unit',
'alpha');
87 $comment =
GETPOST(
"comment",
'restricthtml');
88 $mail_valid =
GETPOST(
"mail_valid",
'restricthtml');
94 $hookmanager->initHooks(array(
'membertypecard',
'globalcard'));
97 $extrafields->fetch_name_optionals_label($object->table_element);
99 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
100 $search_lastname =
"";
109 $result =
restrictedArea($user,
'adherent', $rowid,
'adherent_type');
116 if (
GETPOST(
'cancel',
'alpha')) {
120 if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
127 if (!empty($backtopage)) {
128 header(
"Location: ".$backtopage);
133 if ($action ==
'add' && $user->hasRight(
'adherent',
'configurer')) {
134 $object->label = trim($label);
135 $object->morphy = trim($morphy);
136 $object->status = (int) $status;
137 $object->subscription = (int) $subscription;
138 $object->amount = ($amount ==
'' ?
'' :
price2num($amount,
'MT'));
139 $object->caneditamount = $caneditamount;
140 $object->duration_value = $duration_value;
141 $object->duration_unit = $duration_unit;
142 $object->note_public = trim($comment);
143 $object->note_private =
'';
144 $object->mail_valid = trim($mail_valid);
145 $object->vote = (int) $vote;
148 $ret = $extrafields->setOptionalsFromPost(
null, $object);
153 if (empty($object->label)) {
155 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Label")),
null,
'errors');
157 $sql =
"SELECT libelle FROM ".MAIN_DB_PREFIX.
"adherent_type WHERE libelle = '".$db->escape($object->label).
"'";
158 $sql .=
" WHERE entity IN (".getEntity(
'member_type').
")";
159 $result = $db->query(
$sql);
162 $num = $db->num_rows($result);
166 $langs->load(
"errors");
167 setEventMessages($langs->trans(
"ErrorLabelAlreadyExists", $login),
null,
'errors');
172 $id = $object->create($user);
174 header(
"Location: ".$_SERVER[
"PHP_SELF"]);
185 if ($action ==
'update' && $user->hasRight(
'adherent',
'configurer')) {
186 $object->fetch($rowid);
190 $object->label= trim($label);
191 $object->morphy = trim($morphy);
192 $object->status = (int) $status;
193 $object->subscription = (int) $subscription;
194 $object->amount = ($amount ==
'' ?
'' :
price2num($amount,
'MT'));
195 $object->caneditamount = $caneditamount;
196 $object->duration_value = $duration_value;
197 $object->duration_unit = $duration_unit;
198 $object->note_public = trim($comment);
199 $object->note_private =
'';
200 $object->mail_valid = trim($mail_valid);
201 $object->vote = (boolean) trim($vote);
204 $ret = $extrafields->setOptionalsFromPost(
null, $object,
'@GETPOSTISSET');
209 $ret = $object->update($user);
211 if ($ret >= 0 && !count($object->errors)) {
217 header(
"Location: ".$_SERVER[
"PHP_SELF"].
"?rowid=".$object->id);
221 if ($action ==
'confirm_delete' && $user->hasRight(
'adherent',
'configurer')) {
222 $object->fetch($rowid);
223 $res = $object->delete();
227 header(
"Location: ".$_SERVER[
"PHP_SELF"]);
230 setEventMessages($langs->trans(
"MemberTypeCanNotBeDeleted"),
null,
'errors');
243 $help_url =
'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder';
248 if (!$rowid && $action !=
'create' && $action !=
'edit') {
251 $sql =
"SELECT d.rowid, d.libelle as label, d.subscription, d.amount, d.caneditamount, d.vote, d.statut as status, d.morphy";
252 $sql .=
" FROM ".MAIN_DB_PREFIX.
"adherent_type as d";
253 $sql .=
" WHERE d.entity IN (".getEntity(
'member_type').
")";
255 $result = $db->query(
$sql);
257 $num = $db->num_rows($result);
264 $param .=
'&mode'.urlencode($mode);
266 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
267 $param .=
'&contextpage='.$contextpage;
269 if ($limit > 0 && $limit != $conf->liste_limit) {
270 $param .=
'&limit='.$limit;
275 $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'));
276 $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'));
278 if ($user->hasRight(
'adherent',
'configurer')) {
279 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewMemberType'),
'',
'fa fa-plus-circle', DOL_URL_ROOT.
'/adherents/type.php?action=create');
282 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
283 if ($optioncss !=
'') {
284 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
286 print
'<input type="hidden" name="token" value="'.newToken().
'">';
287 print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
288 print
'<input type="hidden" name="action" value="list">';
289 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
290 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
291 print
'<input type="hidden" name="mode" value="'.$mode.
'">';
294 print_barre_liste($langs->trans(
"MembersTypes"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder,
'', $num,
$nbtotalofrecords,
'members', 0, $newcardbutton,
'', $limit, 0, 0, 1);
298 print
'<div class="div-table-responsive">';
299 print
'<table class="tagtable liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
301 print
'<tr class="liste_titre">';
303 print
'<th> </th>';
305 print
'<th>'.$langs->trans(
"Ref").
'</th>';
306 print
'<th>'.$langs->trans(
"Label").
'</th>';
307 print
'<th class="center">'.$langs->trans(
"MembersNature").
'</th>';
308 print
'<th class="center">'.$langs->trans(
"SubscriptionRequired").
'</th>';
309 print
'<th class="center">'.$langs->trans(
"Amount").
'</th>';
310 print
'<th class="center">'.$langs->trans(
"CanEditAmountShort").
'</th>';
311 print
'<th class="center">'.$langs->trans(
"VoteAllowed").
'</th>';
312 print
'<th class="center">'.$langs->trans(
"Status").
'</th>';
314 print
'<th> </th>';
325 $imaxinloop = ($limit ? min($num, $limit) : $num);
326 while ($i < $imaxinloop) {
327 $objp = $db->fetch_object($result);
329 $membertype->id = $objp->rowid;
330 $membertype->ref = $objp->rowid;
331 $membertype->label = $objp->rowid;
332 $membertype->status = $objp->status;
333 $membertype->subscription = $objp->subscription;
334 $membertype->amount = $objp->amount;
335 $membertype->caneditamount = $objp->caneditamount;
337 if ($mode ==
'kanban') {
339 print
'<tr><td colspan="12">';
340 print
'<div class="box-flex-container kanban">';
343 $membertype->label = $objp->label;
344 print $membertype->getKanbanView(
'');
345 if ($i == ($imaxinloop - 1)) {
350 print
'<tr class="oddeven">';
352 if ($user->rights->adherent->configurer) {
353 print
'<td class="center"><a class="editfielda" href="'.$_SERVER[
"PHP_SELF"].
'?action=edit&rowid='.$objp->rowid.
'">'.
img_edit().
'</a></td>';
356 print
'<td class="nowraponall">';
357 print $membertype->getNomUrl(1);
360 print
'<td>'.dol_escape_htmltag($objp->label).
'</td>';
361 print
'<td class="center">';
362 if ($objp->morphy ==
'phy') {
363 print $langs->trans(
"Physical");
364 } elseif ($objp->morphy ==
'mor') {
365 print $langs->trans(
"Moral");
367 print $langs->trans(
"MorAndPhy");
370 print
'<td class="center">'.yn($objp->subscription).
'</td>';
371 print
'<td class="center"><span class="amount">'.(is_null($objp->amount) || $objp->amount ===
'' ?
'' :
price($objp->amount)).
'</span></td>';
372 print
'<td class="center">'.yn($objp->caneditamount).
'</td>';
373 print
'<td class="center">'.yn($objp->vote).
'</td>';
374 print
'<td class="center">'.$membertype->getLibStatut(5).
'</td>';
376 if ($user->rights->adherent->configurer) {
377 print
'<td class="right"><a class="editfielda" href="'.$_SERVER[
"PHP_SELF"].
'?action=edit&rowid='.$objp->rowid.
'">'.
img_edit().
'</a></td>';
394 print
'<tr><td colspan="'.$colspan.
'" class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</td></tr>';
407 if ($action ==
'create') {
412 print
'<form action="'.$_SERVER[
'PHP_SELF'].
'" method="POST">';
413 print
'<input type="hidden" name="token" value="'.newToken().
'">';
414 print
'<input type="hidden" name="action" value="add">';
418 print
'<table class="border centpercent">';
421 print
'<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans(
"Label").
'</td><td><input type="text" class="minwidth200" name="label" autofocus="autofocus"></td></tr>';
423 print
'<tr><td>'.$langs->trans(
"Status").
'</td><td>';
424 print
$form->selectarray(
'status', array(
'0'=>$langs->trans(
'ActivityCeased'),
'1'=>$langs->trans(
'InActivity')), 1, 0, 0, 0,
'', 0, 0, 0,
'',
'minwidth100');
429 $morphys[
""] = $langs->trans(
"MorAndPhy");
430 $morphys[
"phy"] = $langs->trans(
"Physical");
431 $morphys[
"mor"] = $langs->trans(
"Moral");
432 print
'<tr><td><span>'.$langs->trans(
"MembersNature").
'</span></td><td>';
436 print
'<tr><td>'.$langs->trans(
"SubscriptionRequired").
'</td><td>';
437 print
$form->selectyesno(
"subscription", 1, 1);
440 print
'<tr><td>'.$langs->trans(
"Amount").
'</td><td>';
441 print
'<input name="amount" size="5" value="'.(GETPOSTISSET(
'amount') ?
GETPOST(
'amount') :
price($amount)).
'">';
444 print
'<tr><td>'.$form->textwithpicto($langs->trans(
"CanEditAmountShort"), $langs->transnoentities(
"CanEditAmount")).
'</td><td>';
448 print
'<tr><td>'.$langs->trans(
"VoteAllowed").
'</td><td>';
452 print
'<tr><td>'.$langs->trans(
"Duration").
'</td><td colspan="3">';
453 print
'<input name="duration_value" size="5" value="'.GETPOST(
'duraction_unit',
'aZ09').
'"> ';
454 print $formproduct->selectMeasuringUnits(
"duration_unit",
"time",
GETPOSTISSET(
"duration_unit") ?
GETPOST(
'duration_unit',
'aZ09') :
'y', 0, 1);
457 print
'<tr><td class="tdtop">'.$langs->trans(
"Description").
'</td><td>';
458 require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
459 $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%');
460 $doleditor->Create();
462 print
'<tr><td class="tdtop">'.$langs->trans(
"WelcomeEMail").
'</td><td>';
463 require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
464 $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%');
465 $doleditor->Create();
469 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_add.tpl.php';
476 print
$form->buttonsSaveCancel();
483 if ($action !=
'edit') {
485 $object->fetch($rowid);
486 $object->fetch_optionals();
491 if ($action ==
'delete') {
492 print
$form->formconfirm($_SERVER[
'PHP_SELF'].
"?rowid=".$object->id, $langs->trans(
"DeleteAMemberType"), $langs->trans(
"ConfirmDeleteMemberType", $object->label),
"confirm_delete",
'', 0, 1);
499 $linkback =
'<a href="'.DOL_URL_ROOT.
'/adherents/type.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
503 print
'<div class="fichecenter">';
504 print
'<div class="underbanner clearboth"></div>';
506 print
'<table class="tableforfield border centpercent">';
509 print
'<tr><td>'.$langs->trans(
"MembersNature").
'</td><td class="valeur" >'.$object->getmorphylib($object->morphy).
'</td>';
512 print
'<tr><td class="titlefield">'.$langs->trans(
"SubscriptionRequired").
'</td><td>';
513 print
yn($object->subscription);
517 print
'<tr><td class="titlefield">'.$langs->trans(
"Amount").
'</td><td>';
518 print ((is_null($object->amount) || $object->amount ===
'') ?
'' :
'<span class="amount">'.price($object->amount).
'</span>');
521 print
'<tr><td>'.$form->textwithpicto($langs->trans(
"CanEditAmountShort"), $langs->transnoentities(
"CanEditAmount")).
'</td><td>';
522 print
yn($object->caneditamount);
525 print
'<tr><td>'.$langs->trans(
"VoteAllowed").
'</td><td>';
526 print
yn($object->vote);
529 print
'<tr><td class="titlefield">'.$langs->trans(
"Duration").
'</td><td colspan="2">'.$object->duration_value.
' ';
530 if ($object->duration_value > 1) {
531 $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"));
532 } elseif ($object->duration_value > 0) {
533 $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"));
535 print (!empty($object->duration_unit) && isset($dur[$object->duration_unit]) ? $langs->trans($dur[$object->duration_unit]) :
'').
" ";
538 print
'<tr><td class="tdtop">'.$langs->trans(
"Description").
'</td><td>';
539 print nl2br($object->note).
"</td></tr>";
541 print
'<tr><td class="tdtop">'.$langs->trans(
"WelcomeEMail").
'</td><td>';
542 print nl2br($object->mail_valid).
"</td></tr>";
545 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
556 print
'<div class="tabsAction">';
559 if ($user->hasRight(
'adherent',
'configurer')) {
560 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>';
564 if ($user->hasRight(
'adherent',
'configurer')&& !empty($object->status)) {
565 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>';
567 print
'<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans(
"NoAddMember")).
'">'.$langs->trans(
"AddMember").
'</a></div>';
571 if ($user->hasRight(
'adherent',
'configurer')) {
572 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>';
584 $sql =
"SELECT d.rowid, d.login, d.firstname, d.lastname, d.societe as company,";
585 $sql .=
" d.datefin,";
586 $sql .=
" d.email, d.fk_adherent_type as type_id, d.morphy, d.statut as status,";
587 $sql .=
" t.libelle as type, t.subscription, t.amount";
588 $sql .=
" FROM ".MAIN_DB_PREFIX.
"adherent as d, ".MAIN_DB_PREFIX.
"adherent_type as t";
589 $sql .=
" WHERE d.fk_adherent_type = t.rowid ";
590 $sql .=
" AND d.entity IN (".getEntity(
'adherent').
")";
591 $sql .=
" AND t.rowid = ".((int) $object->id);
593 $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);
598 if ($action ==
'search') {
599 if (
GETPOST(
'search',
'alpha')) {
603 if (!empty($search_lastname)) {
606 if (!empty($search_login)) {
609 if (!empty($search_email)) {
612 if ($filter ==
'uptodate') {
613 $sql .=
" AND (datefin >= '".$db->idate($now).
"') OR t.subscription = 0)";
615 if ($filter ==
'outofdate') {
616 $sql .=
" AND (datefin < '".$db->idate($now).
"' AND t.subscription = 1)";
619 $sql .=
" ".$db->order($sortfield, $sortorder);
623 if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
624 $resql = $db->query(
$sql);
636 $sql .=
" ".$db->plimit($conf->liste_limit + 1, $offset);
638 $resql = $db->query(
$sql);
640 $num = $db->num_rows($resql);
643 $titre = $langs->trans(
"MembersList");
645 if ($status ==
'-1,1') {
646 $titre = $langs->trans(
"MembersListQualified");
647 } elseif ($status ==
'-1') {
648 $titre = $langs->trans(
"MembersListToValid");
649 } elseif ($status ==
'1' && !$filter) {
650 $titre = $langs->trans(
"MembersListValid");
651 } elseif ($status ==
'1' && $filter ==
'uptodate') {
652 $titre = $langs->trans(
"MembersListUpToDate");
653 } elseif ($status ==
'1' && $filter ==
'outofdate') {
654 $titre = $langs->trans(
"MembersListNotUpToDate");
655 } elseif ($status ==
'0') {
656 $titre = $langs->trans(
"MembersListResiliated");
657 } elseif ($status ==
'-2') {
658 $titre = $langs->trans(
"MembersListExcluded");
660 } elseif ($action ==
'search') {
661 $titre = $langs->trans(
"MembersListQualified");
666 $result = $membertype->fetch($type);
667 $titre .=
" (".$membertype->label.
")";
670 $param =
"&rowid=".urlencode($object->id);
671 if (!empty($status)) {
672 $param .=
"&status=".urlencode($status);
674 if (!empty($search_lastname)) {
675 $param .=
"&search_lastname=".urlencode($search_lastname);
677 if (!empty($search_firstname)) {
678 $param .=
"&search_firstname=".urlencode($search_firstname);
680 if (!empty($search_login)) {
681 $param .=
"&search_login=".urlencode($search_login);
683 if (!empty($search_email)) {
684 $param .=
"&search_email=".urlencode($search_email);
686 if (!empty($filter)) {
687 $param .=
"&filter=".urlencode($filter);
691 print $langs->trans(
"Filter").
" (".$langs->trans(
"Lastname").
", ".$langs->trans(
"Firstname").
", ".$langs->trans(
"EMail").
", ".$langs->trans(
"Address").
" ".$langs->trans(
"or").
" ".$langs->trans(
"Town").
"): ".$sall;
694 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
695 print
'<input type="hidden" name="token" value="'.newToken().
'">';
696 print
'<input class="flat" type="hidden" name="rowid" value="'.$object->id.
'" size="12"></td>';
703 print
'<div class="div-table-responsive">';
704 print
'<table class="tagtable liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
707 print
'<tr class="liste_titre_filter">';
709 print
'<td class="liste_titre left">';
710 print
'<input class="flat" type="text" name="search_lastname" value="'.dol_escape_htmltag($search_lastname).
'" size="12"></td>';
712 print
'<td class="liste_titre left">';
713 print
'<input class="flat" type="text" name="search_login" value="'.dol_escape_htmltag($search_login).
'" size="7"></td>';
715 print
'<td class="liste_titre"> </td>';
717 print
'<td class="liste_titre left">';
718 print
'<input class="flat" type="text" name="search_email" value="'.dol_escape_htmltag($search_email).
'" size="12"></td>';
720 print
'<td class="liste_titre"> </td>';
722 print
'<td class="liste_titre right" colspan="2">';
723 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")).
'">';
725 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")).
'">';
730 print
'<tr class="liste_titre">';
732 print_liste_field_titre(
"Action", $_SERVER[
"PHP_SELF"],
"", $param,
"",
'width="60" align="center"', $sortfield, $sortorder);
734 print_liste_field_titre(
"NameSlashCompany", $_SERVER[
"PHP_SELF"],
"d.lastname", $param,
"",
"", $sortfield, $sortorder);
736 print_liste_field_titre(
"MemberNature", $_SERVER[
"PHP_SELF"],
"d.morphy", $param,
"",
"", $sortfield, $sortorder);
738 print_liste_field_titre(
"Status", $_SERVER[
"PHP_SELF"],
"d.statut,d.datefin", $param,
"",
"", $sortfield, $sortorder);
739 print_liste_field_titre(
"EndSubscription", $_SERVER[
"PHP_SELF"],
"d.datefin", $param,
"",
'align="center"', $sortfield, $sortorder);
741 print_liste_field_titre(
"Action", $_SERVER[
"PHP_SELF"],
"", $param,
"",
'width="60" align="center"', $sortfield, $sortorder);
747 $imaxinloop = ($limit ? min($num, $limit) : $num);
748 while ($i < $imaxinloop) {
749 $objp = $db->fetch_object($resql);
751 $datefin = $db->jdate($objp->datefin);
753 $adh->lastname = $objp->lastname;
754 $adh->firstname = $objp->firstname;
755 $adh->datefin = $datefin;
756 $adh->need_subscription = $objp->subscription;
757 $adh->statut = $objp->status;
759 print
'<tr class="oddeven">';
762 print
'<td class="center">';
763 if ($user->hasRight(
'adherent',
'creer')) {
764 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>';
766 if ($user->hasRight(
'adherent',
'supprimer')) {
767 print
'<a class="marginleftonly" href="card.php?rowid='.$objp->rowid.
'&action=resiliate&token='.
newToken().
'">'.
img_picto($langs->trans(
"Resiliate"),
'disable.png').
'</a>';
772 if ($objp->company !=
'') {
773 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";
775 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";
779 print
"<td>".dol_escape_htmltag($objp->login).
"</td>\n";
790 print
"<td>".$adh->getmorphylib($objp->morphy, 1).
"</td>\n";
793 print
"<td>".dol_print_email($objp->email, 0, 0, 1).
"</td>\n";
796 print
'<td class="nowrap">';
797 print $adh->getLibStatut(2);
802 print
'<td class="nowrap center">';
803 if ($datefin <
dol_now() && $objp->status > 0) {
810 print
'<td class="nowrap center">';
811 if (!empty($objp->subscription)) {
812 print
'<span class="opacitymedium">'.$langs->trans(
"SubscriptionNotReceived").
'</span>';
813 if ($objp->status > 0) {
814 print
" ".img_warning();
824 print
'<td class="center">';
825 if ($user->hasRight(
'adherent',
'creer')) {
826 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>';
828 if ($user->hasRight(
'adherent',
'supprimer')) {
829 print
'<a class="marginleftonly" href="card.php?rowid='.$objp->rowid.
'&action=resiliate&token='.
newToken().
'">'.
img_picto($langs->trans(
"Resiliate"),
'disable.png').
'</a>';
838 print
'<tr><td colspan="7"><span class="opacitymedium">'.$langs->trans(
"None").
'</span></td></tr>';
859 if ($action ==
'edit') {
861 $object->fetch($rowid);
862 $object->fetch_optionals();
866 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'?rowid='.$object->id.
'">';
867 print
'<input type="hidden" name="token" value="'.newToken().
'">';
868 print
'<input type="hidden" name="rowid" value="'.$object->id.
'">';
869 print
'<input type="hidden" name="action" value="update">';
873 print
'<table class="border centpercent">';
875 print
'<tr><td class="titlefield">'.$langs->trans(
"Ref").
'</td><td>'.$object->id.
'</td></tr>';
877 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>';
879 print
'<tr><td>'.$langs->trans(
"Status").
'</td><td>';
880 print
$form->selectarray(
'status', array(
'0'=>$langs->trans(
'ActivityCeased'),
'1'=>$langs->trans(
'InActivity')), $object->status, 0, 0, 0,
'', 0, 0, 0,
'',
'minwidth100');
884 $morphys[
""] = $langs->trans(
"MorAndPhy");
885 $morphys[
"phy"] = $langs->trans(
"Physical");
886 $morphys[
"mor"] = $langs->trans(
"Moral");
887 print
'<tr><td><span>'.$langs->trans(
"MembersNature").
'</span></td><td>';
891 print
'<tr><td>'.$langs->trans(
"SubscriptionRequired").
'</td><td>';
892 print
$form->selectyesno(
"subscription", $object->subscription, 1);
895 print
'<tr><td>'.$langs->trans(
"Amount").
'</td><td>';
896 print
'<input name="amount" size="5" value="';
897 print ((is_null($object->amount) || $object->amount ===
'') ?
'' :
price($object->amount));
901 print
'<tr><td>'.$form->textwithpicto($langs->trans(
"CanEditAmountShort"), $langs->transnoentities(
"CanEditAmountDetail")).
'</td><td>';
902 print
$form->selectyesno(
"caneditamount", $object->caneditamount, 1);
905 print
'<tr><td>'.$langs->trans(
"VoteAllowed").
'</td><td>';
906 print
$form->selectyesno(
"vote", $object->vote, 1);
909 print
'<tr><td>'.$langs->trans(
"Duration").
'</td><td colspan="3">';
910 print
'<input name="duration_value" size="5" value="'.$object->duration_value.
'"> ';
911 print $formproduct->selectMeasuringUnits(
"duration_unit",
"time", ($object->duration_unit ===
'' ?
'y' : $object->duration_unit), 0, 1);
914 print
'<tr><td class="tdtop">'.$langs->trans(
"Description").
'</td><td>';
915 require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
916 $doleditor =
new DolEditor(
'comment', $object->note_public,
'', 220,
'dolibarr_notes',
'',
false,
true, empty($conf->fckeditor->enabled) ?
false : $conf->fckeditor->enabled, 15,
'90%');
917 $doleditor->Create();
920 print
'<tr><td class="tdtop">'.$langs->trans(
"WelcomeEMail").
'</td><td>';
921 $doleditor =
new DolEditor(
'mail_valid', $object->mail_valid,
'', 280,
'dolibarr_notes',
'',
false,
true, empty($conf->fckeditor->enabled) ?
false : $conf->fckeditor->enabled, 15,
'90%');
922 $doleditor->Create();
926 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_edit.tpl.php';
932 print
$form->buttonsSaveCancel();