35require
'../main.inc.php';
36require_once DOL_DOCUMENT_ROOT.
'/core/lib/member.lib.php';
37require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
38require_once DOL_DOCUMENT_ROOT.
'/core/lib/images.lib.php';
39require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
40require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
41require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
42require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent_type.class.php';
43require_once DOL_DOCUMENT_ROOT.
'/adherents/class/subscription.class.php';
44require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
45require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
46require_once DOL_DOCUMENT_ROOT.
'/core/class/extrafields.class.php';
47require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formadmin.class.php';
48require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
49require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
53$langs->loadLangs(array(
"companies",
"bills",
"members",
"users",
"other",
"paypal"));
57$action =
GETPOST(
'action',
'aZ09');
58$cancel =
GETPOST(
'cancel',
'alpha');
59$backtopage =
GETPOST(
'backtopage',
'alpha');
60$backtopageforcancel =
GETPOST(
'backtopageforcancel',
'alpha');
61$confirm =
GETPOST(
'confirm',
'alpha');
69if (isModEnabled(
'mailmanspip')) {
70 include_once DOL_DOCUMENT_ROOT.
'/mailmanspip/class/mailmanspip.class.php';
72 $langs->load(
'mailmanspip');
83$extrafields->fetch_name_optionals_label(
$object->table_element);
92 require_once DOL_DOCUMENT_ROOT.
'/core/class/canvas.class.php';
93 $objcanvas =
new Canvas($db, $action);
94 $objcanvas->getCanvas(
'adherent',
'membercard', $canvas);
98$hookmanager->initHooks(array(
'membercard',
'globalcard'));
101if ($id > 0 || !empty($ref)) {
103 $result =
$object->fetch($id, $ref);
106 $canadduser = ($user->admin || $user->hasRight(
'user',
'user',
'creer'));
110 $caneditfielduser = ((($user->id ==
$object->user_id) && $user->hasRight(
'user',
'self',
'creer'))
111 || (($user->id !=
$object->user_id) && $user->hasRight(
'user',
'user',
'creer')));
112 $caneditpassworduser = ((($user->id ==
$object->user_id) && $user->hasRight(
'user',
'self',
'password'))
113 || (($user->id !=
$object->user_id) && $user->hasRight(
'user',
'user',
'password')));
118$canaddmember = $user->hasRight(
'adherent',
'creer');
119$caneditfieldmember =
false;
122 $caneditfieldmember = $user->hasRight(
'adherent',
'creer');
128if (!$user->hasRight(
'adherent',
'creer') && $action ==
'edit') {
132$linkofpubliclist = DOL_MAIN_URL_ROOT.
'/public/members/public_list.php'.((isModEnabled(
'multicompany')) ?
'?entity='.$conf->entity :
'');
139$parameters = array(
'id' => $id,
'rowid' => $id,
'objcanvas' => $objcanvas,
'confirm' => $confirm);
140$reshook = $hookmanager->executeHooks(
'doActions', $parameters,
$object, $action);
145if (empty($reshook)) {
146 $backurlforlist = DOL_URL_ROOT.
'/adherents/list.php';
148 if (empty($backtopage) || ($cancel && empty($id))) {
149 if (empty($backtopage) || ($cancel && strpos($backtopage,
'__ID__'))) {
150 if (empty($id) && (($action !=
'add' && $action !=
'create') || $cancel)) {
151 $backtopage = $backurlforlist;
153 $backtopage = DOL_URL_ROOT.
'/adherents/card.php?id='.((!empty($id) &&
$id > 0) ? $id :
'__ID__');
159 if (!empty($backtopageforcancel)) {
160 header(
"Location: ".$backtopageforcancel);
162 } elseif (!empty($backtopage)) {
163 header(
"Location: ".$backtopage);
169 if ($action ==
'setuserid' && ($user->hasRight(
'user',
'self',
'creer') || $user->hasRight(
'user',
'user',
'creer'))) {
171 if (!$user->hasRight(
'user',
'user',
'creer')) {
172 if ($userid != $user->id && $userid !=
$object->user_id) {
174 setEventMessages($langs->trans(
"ErrorUserPermissionAllowsToLinksToItselfOnly"),
null,
'errors');
179 if ($userid !=
$object->user_id) {
180 $result =
$object->setUserId($userid);
189 if ($action ==
'setsocid' && $caneditfieldmember) {
192 if ($socid !=
$object->socid) {
193 $sql =
"SELECT rowid FROM ".MAIN_DB_PREFIX.
"adherent";
194 $sql .=
" WHERE socid = ".((int) $socid);
195 $sql .=
" AND entity = ".$conf->entity;
196 $resql = $db->query($sql);
198 $obj = $db->fetch_object($resql);
199 if ($obj && $obj->rowid > 0) {
201 $othermember->fetch($obj->rowid);
202 $thirdparty =
new Societe($db);
203 $thirdparty->fetch($socid);
205 setEventMessages($langs->trans(
"ErrorMemberIsAlreadyLinkedToThisThirdParty", $othermember->getFullName($langs), $othermember->login, $thirdparty->name),
null,
'errors');
210 $result =
$object->setThirdPartyId($socid);
221 if ($action ==
'confirm_create_user' && $confirm ==
'yes' && $user->hasRight(
'user',
'user',
'creer')) {
224 $nuser =
new User($db);
226 if (
GETPOST(
'internalorexternal',
'aZ09') ==
'internal') {
227 $tmpuser->fk_soc = 0;
230 $result = $nuser->create_from_member($tmpuser,
GETPOST(
'login',
'alphanohtml'));
233 $langs->load(
"errors");
236 setEventMessages($langs->trans(
"NewUserCreated", $nuser->login),
null,
'mesgs');
245 if ($action ==
'confirm_create_thirdparty' && $confirm ==
'yes' && $user->hasRight(
'societe',
'creer')) {
249 $result = $company->create_from_member(
$object,
GETPOST(
'companyname',
'alpha'),
GETPOST(
'companyalias',
'alpha'));
252 $langs->load(
"errors");
261 if ($action ==
'update' && !$cancel && $user->hasRight(
'adherent',
'creer')) {
262 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
268 $lastname =
GETPOST(
"lastname",
'alphanohtml');
269 $firstname =
GETPOST(
"firstname",
'alphanohtml');
270 $gender =
GETPOST(
"gender",
'alphanohtml');
271 $societe =
GETPOST(
"societe",
'alphanohtml');
272 $morphy =
GETPOST(
"morphy",
'alphanohtml');
273 $login =
GETPOST(
"login",
'alphanohtml');
274 if ($morphy !=
'mor' && empty($lastname)) {
276 $langs->load(
"errors");
277 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Lastname")),
null,
'errors');
279 if ($morphy !=
'mor' && (!isset($firstname) || $firstname ==
'')) {
281 $langs->load(
"errors");
282 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Firstname")),
null,
'errors');
284 if ($morphy ==
'mor' && empty($societe)) {
286 $langs->load(
"errors");
287 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Company")),
null,
'errors');
293 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Login")),
null,
'errors');
297 if ($result > 0 && !$error) {
301 $object->civility_id = trim(
GETPOST(
"civility_id",
'alphanohtml'));
306 if (GETPOSTISSET(
'pass')) {
322 $object->email = preg_replace(
'/\s+/',
'',
GETPOST(
"member_email",
'alpha'));
323 $object->url = trim(
GETPOST(
'member_url',
'custom', 0, FILTER_SANITIZE_URL));
324 $object->socialnetworks = array();
325 foreach ($socialnetworks as $key => $value) {
326 if (GETPOSTISSET($key) &&
GETPOST($key,
'alphanohtml') !=
'') {
327 $object->socialnetworks[$key] = trim(
GETPOST($key,
'alphanohtml'));
336 if (
GETPOST(
'deletephoto',
'alpha')) {
338 } elseif (!empty($_FILES[
'photo'][
'name'])) {
348 $ret = $extrafields->setOptionalsFromPost(
null,
$object,
'@GETPOSTISSET');
356 if ($user->id !=
$object->user_id && !$user->hasRight(
'user',
'user',
'creer')) {
363 if (GETPOSTISSET(
'pass')) {
366 if ($user->id ==
$object->user_id) {
367 if (!$user->hasRight(
'user',
'self',
'password')) {
371 if (!$user->hasRight(
'user',
'user',
'password')) {
379 $result =
$object->update($user, 0, $nosyncuser, $nosyncuserpass);
381 if ($result >= 0 && !count(
$object->errors)) {
382 $categories =
GETPOST(
'memcats',
'array');
383 $object->setCategories($categories);
386 $dir = $conf->adherent->dir_output.
'/'.
get_exdir(0, 0, 0, 1,
$object,
'member').
'/photos';
387 $file_OK = is_uploaded_file($_FILES[
'photo'][
'tmp_name']);
390 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
392 $dirthumbs = $conf->adherent->dir_output.
'/'.
get_exdir(0, 0, 0, 1,
$object,
'member').
'/photos/thumbs';
402 if (!
dol_move_uploaded_file($_FILES[
'photo'][
'tmp_name'], $newfile, 1, 0, $_FILES[
'photo'][
'error']) > 0) {
413 switch ($_FILES[
'photo'][
'error']) {
416 $errors[] =
"ErrorFileSizeTooLarge";
419 $errors[] =
"ErrorFilePartiallyUploaded";
428 if (!empty($backtopage)) {
429 header(
"Location: ".$backtopage);
444 if ($action ==
'add' && $user->hasRight(
'adherent',
'creer')) {
449 if (GETPOSTISSET(
"birthday") &&
GETPOST(
"birthday") && GETPOSTISSET(
"birthmonth") &&
GETPOST(
"birthmonth") && GETPOSTISSET(
"birthyear") &&
GETPOST(
"birthyear")) {
452 $datesubscription =
'';
453 if (GETPOSTISSET(
"reday") && GETPOSTISSET(
"remonth") && GETPOSTISSET(
"reyear")) {
458 $civility_id =
GETPOST(
"civility_id",
'alphanohtml');
459 $lastname =
GETPOST(
"lastname",
'alphanohtml');
460 $firstname =
GETPOST(
"firstname",
'alphanohtml');
461 $gender =
GETPOST(
"gender",
'alphanohtml');
462 $societe =
GETPOST(
"societe",
'alphanohtml');
463 $address =
GETPOST(
"address",
'alphanohtml');
464 $zip =
GETPOST(
"zipcode",
'alphanohtml');
465 $town =
GETPOST(
"town",
'alphanohtml');
469 $phone =
GETPOST(
"phone",
'alpha');
470 $phone_perso =
GETPOST(
"phone_perso",
'alpha');
471 $phone_mobile =
GETPOST(
"phone_mobile",
'alpha');
472 $email = preg_replace(
'/\s+/',
'',
GETPOST(
"member_email",
'aZ09arobase'));
473 $url = trim(
GETPOST(
'url',
'custom', 0, FILTER_SANITIZE_URL));
474 $login =
GETPOST(
"member_login",
'alphanohtml');
475 $pass =
GETPOST(
"password",
'password');
476 $photo =
GETPOST(
"photo",
'alphanohtml');
477 $morphy =
GETPOST(
"morphy",
'alphanohtml');
482 $default_lang =
GETPOST(
'default_lang',
'alpha');
484 $object->civility_id = $civility_id;
485 $object->firstname = $firstname;
494 $object->country_id = $country_id;
496 $object->phone_perso = $phone_perso;
497 $object->phone_mobile = $phone_mobile;
498 $object->socialnetworks = array();
499 if (isModEnabled(
'socialnetworks')) {
500 foreach ($socialnetworks as $key => $value) {
501 if (GETPOSTISSET($key) &&
GETPOST($key,
'alphanohtml') !=
'') {
502 $object->socialnetworks[$key] =
GETPOST(
"member_".$key,
'alphanohtml');
519 $object->default_lang = $default_lang;
521 $ret = $extrafields->setOptionalsFromPost(
null,
$object);
527 if (empty($morphy) || $morphy ==
"-1") {
529 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"MemberNature")),
null,
'errors');
535 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Login")),
null,
'errors');
537 $sql =
"SELECT login FROM ".MAIN_DB_PREFIX.
"adherent WHERE login='".$db->escape($login).
"'";
538 $result = $db->query($sql);
541 $num = $db->num_rows($result);
545 $langs->load(
"errors");
546 setEventMessages($langs->trans(
"ErrorLoginAlreadyExists", $login),
null,
'errors');
551 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Password")),
null,
'errors');
554 if ($morphy ==
'mor' && empty($societe)) {
556 $langs->load(
"errors");
557 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Company")),
null,
'errors');
559 if ($morphy !=
'mor' && empty($lastname)) {
561 $langs->load(
"errors");
562 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Lastname")),
null,
'errors');
564 if ($morphy !=
'mor' && (!isset($firstname) || $firstname ==
'')) {
566 $langs->load(
"errors");
567 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Firstname")),
null,
'errors');
569 if (!($typeid > 0)) {
571 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Type")),
null,
'errors');
575 $langs->load(
"errors");
579 $langs->load(
"errors");
583 if (isset($public)) {
591 $result =
$object->create($user);
594 $memcats =
GETPOST(
'memcats',
'array');
595 $object->setCategories($memcats);
602 $backtopage = preg_replace(
'/__ID__/', (
string) $id, $backtopage);
615 $result = $company->create_from_member(
$object);
617 $langs->load(
"errors");
626 $action = ($result < 0 || !$error) ?
'' :
'create';
628 if (!$error && $backtopage) {
629 header(
"Location: ".$backtopage);
634 if ($user->hasRight(
'adherent',
'supprimer') && $action ==
'confirm_delete' && $confirm ==
'yes') {
635 $result =
$object->delete($user);
638 if (!empty($backtopage) && !preg_match(
'/'.preg_quote($_SERVER[
"PHP_SELF"],
'/').
'/', $backtopage)) {
639 header(
"Location: ".$backtopage);
642 header(
"Location: list.php");
650 if ($user->hasRight(
'adherent',
'creer') && $action ==
'confirm_valid' && $confirm ==
'yes') {
658 $result =
$object->validate($user);
660 if ($result >= 0 && !count(
$object->errors)) {
667 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
671 $outputlangs->setDefaultLang(empty(
$object->thirdparty->default_lang) ? $mysoc->default_lang :
$object->thirdparty->default_lang);
673 $outputlangs->loadLangs(array(
"main",
"members",
"companies",
"install",
"other"));
675 $arraydefaultmessage =
null;
678 if (!empty($labeltouse)) {
679 $arraydefaultmessage = $formmail->getEMailTemplate($db,
'member', $user, $outputlangs, 0, 1, $labeltouse);
682 if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
683 $subject = $arraydefaultmessage->topic;
684 $msg = $arraydefaultmessage->content;
687 if (empty($labeltouse) || (
int) $labeltouse === -1) {
689 $langs->load(
"errors");
690 setEventMessages(
'<a href="'.DOL_URL_ROOT.
'/adherents/admin/member_emails.php">'.$langs->trans(
'WarningMandatorySetupNotComplete').
'</a>',
null,
'errors');
698 $moreinheader =
'X-Dolibarr-Info: send_an_email by adherents/card.php'.
"\r\n";
700 $result =
$object->sendEmail($texttosend, $subjecttosend, array(), array(), array(),
"",
"", 0, -1,
'', $moreinheader);
720 if ($user->hasRight(
'adherent',
'supprimer') && $action ==
'confirm_resiliate') {
723 if ($confirm ==
'yes') {
727 $result =
$object->resiliate($user);
729 if ($result >= 0 && !count(
$object->errors)) {
735 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
739 $outputlangs->setDefaultLang(empty(
$object->thirdparty->default_lang) ? $mysoc->default_lang :
$object->thirdparty->default_lang);
741 $outputlangs->loadLangs(array(
"main",
"members",
"companies",
"install",
"other"));
743 $arraydefaultmessage =
null;
746 if (!empty($labeltouse)) {
747 $arraydefaultmessage = $formmail->getEMailTemplate($db,
'member', $user, $outputlangs, 0, 1, $labeltouse);
750 if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
751 $subject = $arraydefaultmessage->topic;
752 $msg = $arraydefaultmessage->content;
755 if (empty($labeltouse) || (
int) $labeltouse === -1) {
765 $moreinheader =
'X-Dolibarr-Info: send_an_email by adherents/card.php'.
"\r\n";
767 $result =
$object->sendEmail($texttosend, $subjecttosend, array(), array(), array(),
"",
"", 0, -1,
'', $moreinheader);
781 if (!empty($backtopage) && !$error) {
782 header(
"Location: ".$backtopage);
787 if ($user->hasRight(
'adherent',
'supprimer') && $action ==
'confirm_exclude') {
790 if ($confirm ==
'yes') {
794 $result =
$object->exclude($user);
796 if ($result >= 0 && !count(
$object->errors)) {
802 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
806 $outputlangs->setDefaultLang(empty(
$object->thirdparty->default_lang) ? $mysoc->default_lang :
$object->thirdparty->default_lang);
808 $outputlangs->loadLangs(array(
"main",
"members",
"companies",
"install",
"other"));
810 $arraydefaultmessage =
null;
813 if (!empty($labeltouse)) {
814 $arraydefaultmessage = $formmail->getEMailTemplate($db,
'member', $user, $outputlangs, 0, 1, $labeltouse);
817 if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
818 $subject = $arraydefaultmessage->topic;
819 $msg = $arraydefaultmessage->content;
822 if (empty($labeltouse) || (
int) $labeltouse === -1) {
832 $moreinheader =
'X-Dolibarr-Info: send_an_email by adherents/card.php'.
"\r\n";
834 $result =
$object->sendEmail($texttosend, $subjecttosend, array(), array(), array(),
"",
"", 0, -1,
'', $moreinheader);
848 if (!empty($backtopage) && !$error) {
849 header(
"Location: ".$backtopage);
855 if (is_object($mailmanspip)) {
856 if ($user->hasRight(
'adherent',
'supprimer') && $action ==
'confirm_del_spip' && $confirm ==
'yes') {
858 if (!$mailmanspip->del_to_spip(
$object)) {
859 setEventMessages($langs->trans(
'DeleteIntoSpipError').
': '.$mailmanspip->error,
null,
'errors');
864 if ($user->hasRight(
'adherent',
'creer') && $action ==
'confirm_add_spip' && $confirm ==
'yes') {
866 if (!$mailmanspip->add_to_spip(
$object)) {
867 setEventMessages($langs->trans(
'AddIntoSpipError').
': '.$mailmanspip->error,
null,
'errors');
874 include DOL_DOCUMENT_ROOT.
'/core/actions_printing.inc.php';
877 $upload_dir = $conf->adherent->dir_output;
878 $permissiontoadd = $user->hasRight(
'adherent',
'creer');
879 include DOL_DOCUMENT_ROOT.
'/core/actions_builddoc.inc.php';
882 $triggersendname =
'MEMBER_SENTBYMAIL';
884 $mode =
'emailfrommember';
885 $trackid =
'mem'.$object->id;
886 include DOL_DOCUMENT_ROOT.
'/core/actions_sendmails.inc.php';
894$form =
new Form($db);
899$title = $langs->trans(
"Member").
" - ".$langs->trans(
"Card");
900$help_url =
'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder';
902llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'mod-member page-card');
904$countrynotdefined = $langs->trans(
"ErrorSetACountryFirst").
' ('.$langs->trans(
"SeeAbove").
')';
906if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
910 if (empty(
$object->error) && $id) {
918 $objcanvas->display_canvas($action);
925 if ($action ==
'create') {
933 $object->country_code = $tmparray[
'code'];
934 $object->country = $tmparray[
'label'];
938 if (!empty($socid)) {
943 if (!($soc->id > 0)) {
944 $langs->load(
"errors");
945 print($langs->trans(
'ErrorRecordNotFound'));
954 if ($conf->use_javascript_ajax) {
955 print
"\n".
'<script type="text/javascript">'.
"\n";
956 print
'jQuery(document).ready(function () {
957 jQuery("#selectcountry_id").change(function() {
958 document.formsoc.action.value="create";
959 document.formsoc.submit();
961 function initfieldrequired() {
962 jQuery("#tdcompany").removeClass("fieldrequired");
963 jQuery("#tdlastname").removeClass("fieldrequired");
964 jQuery("#tdfirstname").removeClass("fieldrequired");
965 if (jQuery(\'input[name="morphy"]:checked\').val() == \'mor\') {
966 jQuery("#tdcompany").addClass("fieldrequired");
968 if (jQuery(\'input[name="morphy"]:checked\').val() == \'phy\') {
969 jQuery("#tdlastname").addClass("fieldrequired");
970 jQuery("#tdfirstname").addClass("fieldrequired");
973 jQuery(\'input[name="morphy"]\').change(function() {
978 print
'</script>'.
"\n";
981 print
'<form name="formsoc" action="'.$_SERVER[
"PHP_SELF"].
'" method="post" enctype="multipart/form-data">';
982 print
'<input type="hidden" name="token" value="'.newToken().
'">';
983 print
'<input type="hidden" name="action" value="add">';
984 print
'<input type="hidden" name="socid" value="'.$socid.
'">';
986 print
'<input type="hidden" name="backtopage" value="'.($backtopage !=
'1' ? $backtopage : $_SERVER[
"HTTP_REFERER"]).
'">';
991 print
'<table class="border centpercent">';
996 print
'<tr><td><span class="fieldrequired">'.$langs->trans(
"Login").
' / '.$langs->trans(
"Id").
'</span></td><td><input type="text" name="member_login" class="minwidth300" maxlength="50" value="'.(GETPOSTISSET(
"member_login") ?
GETPOST(
"member_login",
'alphanohtml', 2) :
$object->login).
'" autofocus="autofocus"></td></tr>';
1001 require_once DOL_DOCUMENT_ROOT.
'/core/lib/security2.lib.php';
1003 print
'<tr><td><span class="fieldrequired">'.$langs->trans(
"Password").
'</span></td><td>';
1004 print
'<input type="text" class="minwidth300" maxlength="50" name="password" value="'.dol_escape_htmltag($generated_password).
'">';
1009 print
'<tr><td class="fieldrequired">'.$langs->trans(
"MemberType").
'</td><td>';
1010 $listetype = $adht->liste_array(1);
1011 print
img_picto(
'', $adht->picto,
'class="pictofixedwidth"');
1012 if (count($listetype)) {
1013 print $form->selectarray(
"typeid", $listetype, (
GETPOSTINT(
'typeid') ?
GETPOSTINT(
'typeid') : $typeid), (count($listetype) > 1 ? 1 : 0), 0, 0,
'', 0, 0, 0,
'',
'minwidth200', 1);
1015 print
'<span class="error">'.$langs->trans(
"NoTypeDefinedGoToSetup").
'</span>';
1017 if ($user->hasRight(
'member',
'configurer')) {
1018 print
' <a href="'.DOL_URL_ROOT.
'/adherents/type.php?action=create&backtopage='.urlencode($_SERVER[
"PHP_SELF"].
'?action=create&typeid=--IDFORBACKTOPAGE--').
'"><span class="fa fa-plus-circle valignmiddle paddingleft" title="'.$langs->trans(
"NewMemberType").
'"></span></a>';
1024 $morphys[
"phy"] = $langs->trans(
"Physical");
1025 $morphys[
"mor"] = $langs->trans(
"Moral");
1026 $checkednature = (GETPOSTISSET(
"morphy") ?
GETPOST(
"morphy",
'alpha') :
$object->morphy);
1027 print
'<tr><td class="fieldrequired">'.$langs->trans(
"MemberNature").
"</td><td>\n";
1028 print
'<span id="spannature1" class="nonature-back spannature paddinglarge marginrightonly"><label for="phisicalinput" class="valignmiddle">'.$morphys[
"phy"].
'<input id="phisicalinput" class="flat checkforselect marginleftonly valignmiddle" type="radio" name="morphy" value="phy"'.($checkednature ==
"phy" ?
' checked="checked"' :
'').
'></label></span>';
1029 print
'<span id="spannature2" class="nonature-back spannature paddinglarge marginrightonly"><label for="moralinput" class="valignmiddle">'.$morphys[
"mor"].
'<input id="moralinput" class="flat checkforselect marginleftonly valignmiddle" type="radio" name="morphy" value="mor"'.($checkednature ==
"mor" ?
' checked="checked"' :
'').
'></label></span>';
1032 if ($conf->use_javascript_ajax) {
1034 function refreshNatureCss() {
1035 jQuery(".spannature").each(function( index ) {
1036 console.log(jQuery("#spannature"+(index+1)+" .checkforselect").is(":checked"));
1037 if (jQuery("#spannature"+(index+1)+" .checkforselect").is(":checked")) {
1039 jQuery("#spannature"+(index+1)).addClass("member-individual-back").removeClass("nonature-back");
1042 jQuery("#spannature"+(index+1)).addClass("member-company-back").removeClass("nonature-back");
1045 jQuery("#spannature"+(index+1)).removeClass("member-individual-back").removeClass("member-company-back").addClass("nonature-back");
1049 jQuery(".spannature").click(function(){
1050 console.log("We click on a nature");
1060 print
'<tr><td id="tdcompany">'.$langs->trans(
"Company").
'</td><td><input type="text" name="societe" class="minwidth300" maxlength="128" value="'.(GETPOSTISSET(
'societe') ?
GETPOST(
'societe',
'alphanohtml') : $soc->
name).
'"></td></tr>';
1063 print
'<tr><td>'.$langs->trans(
"UserTitle").
'</td><td>';
1064 print $formcompany->select_civility(
GETPOSTINT(
'civility_id') ?
GETPOSTINT(
'civility_id') :
$object->civility_id,
'civility_id',
'maxwidth150', 1).
'</td>';
1068 print
'<tr><td id="tdlastname">'.$langs->trans(
"Lastname").
'</td><td><input type="text" name="lastname" class="minwidth300" maxlength="50" value="'.(GETPOSTISSET(
'lastname') ?
GETPOST(
'lastname',
'alphanohtml') :
$object->lastname).
'"></td>';
1072 print
'<tr><td id="tdfirstname">'.$langs->trans(
"Firstname").
'</td><td><input type="text" name="firstname" class="minwidth300" maxlength="50" value="'.(GETPOSTISSET(
'firstname') ?
GETPOST(
'firstname',
'alphanohtml') :
$object->firstname).
'"></td>';
1076 print
'<tr><td>'.$langs->trans(
"Gender").
'</td>';
1078 $arraygender = array(
'man' => $langs->trans(
"Genderman"),
'woman' => $langs->trans(
"Genderwoman"),
'other' => $langs->trans(
"Genderother"));
1079 print $form->selectarray(
'gender', $arraygender,
GETPOST(
'gender',
'alphanohtml'), 1, 0, 0,
'', 0, 0, 0,
'',
'minwidth100', 1);
1083 print
'<tr><td>'.(getDolGlobalString(
'ADHERENT_MAIL_REQUIRED') ?
'<span class="fieldrequired">' :
'').$langs->trans(
"EMail").(getDolGlobalString(
'ADHERENT_MAIL_REQUIRED') ?
'</span>' :
'').
'</td>';
1084 print
'<td>'.img_picto(
'',
'object_email').
' <input type="text" name="member_email" class="minwidth300" maxlength="255" value="'.(GETPOSTISSET(
'member_email') ?
GETPOST(
'member_email',
'alpha') : $soc->
email).
'"></td></tr>';
1087 print
'<tr><td>'.$form->editfieldkey(
'Web',
'member_url',
GETPOST(
'member_url',
'alpha'),
$object, 0).
'</td>';
1088 print
'<td>'.img_picto(
'',
'globe').
' <input type="text" class="maxwidth500 widthcentpercentminusx" name="member_url" id="member_url" value="'.(GETPOSTISSET(
'member_url') ?
GETPOST(
'member_url',
'alpha') :
$object->url).
'"></td></tr>';
1091 print
'<tr><td class="tdtop">'.$langs->trans(
"Address").
'</td><td>';
1092 print
'<textarea name="address" wrap="soft" class="quatrevingtpercent" rows="2">'.(GETPOSTISSET(
'address') ?
GETPOST(
'address',
'alphanohtml') : $soc->
address).
'</textarea>';
1096 print
'<tr><td>'.$langs->trans(
"Zip").
' / '.$langs->trans(
"Town").
'</td><td>';
1097 print $formcompany->select_ziptown((GETPOSTISSET(
'zipcode') ?
GETPOST(
'zipcode',
'alphanohtml') : $soc->zip),
'zipcode', array(
'town',
'selectcountry_id',
'state_id'), 6);
1099 print $formcompany->select_ziptown((GETPOSTISSET(
'town') ?
GETPOST(
'town',
'alphanohtml') : $soc->town),
'town', array(
'zipcode',
'selectcountry_id',
'state_id'));
1103 if (empty($soc->country_id)) {
1104 $soc->country_id = $mysoc->country_id;
1105 $soc->country_code = $mysoc->country_code;
1106 $soc->state_id = $mysoc->state_id;
1108 print
'<tr><td>'.$langs->trans(
'Country').
'</td><td>';
1109 print
img_picto(
'',
'country',
'class="pictofixedwidth"');
1110 print $form->select_country(GETPOSTISSET(
'country_id') ?
GETPOST(
'country_id',
'alpha') : $soc->country_id,
'country_id');
1112 print
info_admin($langs->trans(
"YouCanChangeValuesForThisListFromDictionarySetup"), 1);
1118 print
'<tr><td>'.$langs->trans(
'State').
'</td><td>';
1119 if ($soc->country_id) {
1120 print
img_picto(
'',
'state',
'class="pictofixedwidth"');
1121 print $formcompany->select_state(GETPOSTISSET(
'state_id') ?
GETPOSTINT(
'state_id') : $soc->state_id, $soc->country_code);
1123 print $countrynotdefined;
1129 print
'<tr><td>'.$langs->trans(
"PhonePro").
'</td>';
1130 print
'<td>'.img_picto(
'',
'object_phoning',
'class="pictofixedwidth"').
'<input type="text" name="phone" size="20" value="'.(GETPOSTISSET(
'phone') ?
GETPOST(
'phone',
'alpha') : $soc->phone).
'"></td></tr>';
1133 print
'<tr><td>'.$langs->trans(
"PhonePerso").
'</td>';
1134 print
'<td>'.img_picto(
'',
'object_phoning',
'class="pictofixedwidth"').
'<input type="text" name="phone_perso" size="20" value="'.(GETPOSTISSET(
'phone_perso') ?
GETPOST(
'phone_perso',
'alpha') :
$object->phone_perso).
'"></td></tr>';
1137 print
'<tr><td>'.$langs->trans(
"PhoneMobile").
'</td>';
1138 print
'<td>'.img_picto(
'',
'object_phoning_mobile',
'class="pictofixedwidth"').
'<input type="text" name="phone_mobile" size="20" value="'.(GETPOSTISSET(
'phone_mobile') ?
GETPOST(
'phone_mobile',
'alpha') :
$object->phone_mobile).
'"></td></tr>';
1140 if (isModEnabled(
'socialnetworks')) {
1141 foreach ($socialnetworks as $key => $value) {
1142 if (!$value[
'active']) {
1145 $val = (GETPOSTISSET(
'member_'.$key) ?
GETPOST(
'member_'.$key,
'alpha') : (empty(
$object->socialnetworks[$key]) ?
'' :
$object->socialnetworks[$key]));
1146 print
'<tr><td>'.$langs->trans($value[
'label']).
'</td><td><input type="text" name="member_'.$key.
'" size="40" value="'.$val.
'"></td></tr>';
1151 print
"<tr><td>".$langs->trans(
"DateOfBirth").
"</td><td>\n";
1152 print
img_picto(
'',
'object_calendar',
'class="pictofixedwidth"').$form->selectDate((
$object->birth ?
$object->birth : -1),
'birth', 0, 0, 1,
'formsoc');
1153 print
"</td></tr>\n";
1157 $htmltext = $langs->trans(
"Public",
getDolGlobalString(
'MAIN_INFO_SOCIETE_NOM'), $linkofpubliclist);
1158 print $form->textwithpicto($langs->trans(
"MembershipPublic"), $htmltext, 1,
'help',
'', 0, 3,
'membershippublic');
1159 print
"</td><td>\n";
1160 print $form->selectyesno(
"public",
$object->public, 1,
false, 0, 1);
1161 print
"</td></tr>\n";
1164 if (isModEnabled(
'category') && $user->hasRight(
'categorie',
'lire')) {
1165 print
'<tr><td>'.$form->editfieldkey(
"Categories",
'memcats',
'',
$object, 0).
'</td><td>';
1166 $cate_arbo = $form->select_all_categories(Categorie::TYPE_MEMBER,
'',
'parent', 64, 0, 3);
1167 print
img_picto(
'',
'category').$form->multiselectarray(
'memcats', $cate_arbo,
GETPOST(
'memcats',
'array'), 0, 0,
'quatrevingtpercent widthcentpercentminusx', 0, 0);
1172 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_add.tpl.php';
1179 print $form->buttonsSaveCancel(
"AddMember");
1185 if ($action ==
'edit') {
1191 $res =
$object->fetch_optionals();
1198 $adht->fetch(
$object->typeid);
1202 if (!empty($country) ||
$object->country_id) {
1203 $sql =
"SELECT rowid, code, label from ".MAIN_DB_PREFIX.
"c_country";
1204 $sql .=
" WHERE rowid = ".(int) (!empty($country) ? $country :
$object->country_id);
1205 $resql = $db->query($sql);
1207 $obj = $db->fetch_object($resql);
1212 if (is_object($obj)) {
1213 $object->country_id = $obj->rowid;
1214 $object->country_code = $obj->code;
1215 $object->country = $langs->trans(
"Country".$obj->code) ? $langs->trans(
"Country".$obj->code) : $obj->label;
1222 if ($conf->use_javascript_ajax) {
1223 print
"\n".
'<script type="text/javascript">';
1224 print
'jQuery(document).ready(function () {
1225 jQuery("#selectcountry_id").change(function() {
1226 document.formsoc.action.value="edit";
1227 document.formsoc.submit();
1229 function initfieldrequired() {
1230 jQuery("#tdcompany").removeClass("fieldrequired");
1231 jQuery("#tdlastname").removeClass("fieldrequired");
1232 jQuery("#tdfirstname").removeClass("fieldrequired");
1233 if (jQuery(\'input[name="morphy"]:checked\').val() == \'mor\') {
1234 jQuery("#tdcompany").addClass("fieldrequired");
1236 if (jQuery(\'input[name="morphy"]:checked\').val() == \'phy\') {
1237 jQuery("#tdlastname").addClass("fieldrequired");
1238 jQuery("#tdfirstname").addClass("fieldrequired");
1241 jQuery(\'input[name="morphy"]\').change(function() {
1242 initfieldrequired();
1244 initfieldrequired();
1246 print
'</script>'.
"\n";
1249 print
'<form name="formsoc" action="'.$_SERVER[
"PHP_SELF"].
'" method="post" enctype="multipart/form-data">';
1250 print
'<input type="hidden" name="token" value="'.newToken().
'" />';
1251 print
'<input type="hidden" name="action" value="update" />';
1252 print
'<input type="hidden" name="rowid" value="'.$id.
'" />';
1253 print
'<input type="hidden" name="statut" value="'.$object->status.
'" />';
1255 print
'<input type="hidden" name="backtopage" value="'.($backtopage !=
'1' ? $backtopage : $_SERVER[
"HTTP_REFERER"]).
'">';
1260 print
'<table class="border centpercent">';
1263 print
'<tr><td class="titlefieldcreate">'.$langs->trans(
"Ref").
'</td><td class="valeur">'.
$object->ref.
'</td></tr>';
1267 print
'<tr><td><span class="fieldrequired">'.$langs->trans(
"Login").
' / '.$langs->trans(
"Id").
'</span></td><td><input type="text" name="login" class="minwidth300" maxlength="50" value="'.(GETPOSTISSET(
"login") ?
GETPOST(
"login",
'alphanohtml', 2) :
$object->login).
'"></td></tr>';
1272 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Password").
'</td><td><input type="password" name="pass" class="minwidth300" maxlength="50" value="'.
dol_escape_htmltag(GETPOSTISSET(
"pass") ?
GETPOST(
"pass",
'password', 2) :
'').
'"></td></tr>';
1276 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Type").
'</td><td>';
1277 if ($user->hasRight(
'adherent',
'creer')) {
1278 print $form->selectarray(
"typeid", $adht->liste_array(), (GETPOSTISSET(
"typeid") ?
GETPOSTINT(
"typeid") :
$object->typeid), 0, 0, 0,
'', 0, 0, 0,
'',
'minwidth200', 1);
1280 print $adht->getNomUrl(1);
1281 print
'<input type="hidden" name="typeid" value="'.$object->typeid.
'">';
1286 $morphys[
"phy"] = $langs->trans(
"Physical");
1287 $morphys[
"mor"] = $langs->trans(
"Moral");
1288 $checkednature = (GETPOSTISSET(
"morphy") ?
GETPOST(
"morphy",
'alpha') :
$object->morphy);
1289 print
'<tr><td><span class="fieldrequired">'.$langs->trans(
"MemberNature").
'</span></td><td>';
1290 print
'<span id="spannature1" class="member-individual-back spannature paddinglarge marginrightonly"><label for="phisicalinput" class="valignmiddle">'.$morphys[
"phy"].
'<input id="phisicalinput" class="flat checkforselect marginleftonly valignmiddle" type="radio" name="morphy" value="phy"'.($checkednature ==
"phy" ?
' checked="checked"' :
'').
'></label></span>';
1291 print
'<span id="spannature1" class="member-company-back spannature paddinglarge marginrightonly"><label for="moralinput" class="valignmiddle">'.$morphys[
"mor"].
'<input id="moralinput" class="flat checkforselect marginleftonly valignmiddle" type="radio" name="morphy" value="mor"'.($checkednature ==
"mor" ?
' checked="checked"' :
'').
'></label></span>';
1295 print
'<tr><td id="tdcompany">'.$langs->trans(
"Company").
'</td><td><input type="text" name="societe" class="minwidth300" maxlength="128" value="'.(GETPOSTISSET(
"societe") ?
GETPOST(
"societe",
'alphanohtml', 2) :
$object->company).
'"></td></tr>';
1298 print
'<tr><td>'.$langs->trans(
"UserTitle").
'</td><td>';
1299 print $formcompany->select_civility(GETPOSTISSET(
"civility_id") ?
GETPOST(
"civility_id",
'alpha') :
$object->civility_id,
'civility_id',
'maxwidth150', 1);
1304 print
'<tr><td id="tdlastname">'.$langs->trans(
"Lastname").
'</td><td><input type="text" name="lastname" class="minwidth300" maxlength="50" value="'.(GETPOSTISSET(
"lastname") ?
GETPOST(
"lastname",
'alphanohtml', 2) :
$object->lastname).
'"></td>';
1308 print
'<tr><td id="tdfirstname">'.$langs->trans(
"Firstname").
'</td><td><input type="text" name="firstname" class="minwidth300" maxlength="50" value="'.(GETPOSTISSET(
"firstname") ?
GETPOST(
"firstname",
'alphanohtml', 3) :
$object->firstname).
'"></td>';
1312 print
'<tr><td>'.$langs->trans(
"Gender").
'</td>';
1314 $arraygender = array(
'man' => $langs->trans(
"Genderman"),
'woman' => $langs->trans(
"Genderwoman"),
'other' => $langs->trans(
"Genderother"));
1315 print $form->selectarray(
'gender', $arraygender, GETPOSTISSET(
'gender') ?
GETPOST(
'gender',
'alphanohtml') :
$object->gender, 1, 0, 0,
'', 0, 0, 0,
'',
'minwidth100', 1);
1319 print
'<tr><td>'.$langs->trans(
"Photo").
'</td>';
1320 print
'<td class="hideonsmartphone" valign="middle">';
1321 print $form->showphoto(
'memberphoto',
$object).
"\n";
1322 if ($caneditfieldmember) {
1326 print
'<table class="nobordernopadding">';
1328 print
'<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"><label for="photodelete" class="paddingleft">'.$langs->trans(
"Delete").
'</label><br></td></tr>';
1332 $maxmin = $maxfilesizearray[
'maxmin'];
1334 print
'<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).
'">';
1336 print
'<input type="file" class="flat" name="photo" id="photoinput">';
1343 print
'<tr><td>'.(getDolGlobalString(
"ADHERENT_MAIL_REQUIRED") ?
'<span class="fieldrequired">' :
'').$langs->trans(
"EMail").(getDolGlobalString(
"ADHERENT_MAIL_REQUIRED") ?
'</span>' :
'').
'</td>';
1344 print
'<td>'.img_picto(
'',
'object_email',
'class="pictofixedwidth"').
'<input type="text" name="member_email" class="minwidth300" maxlength="255" value="'.(GETPOSTISSET(
"member_email") ?
GETPOST(
"member_email",
'', 2) :
$object->
email).
'"></td></tr>';
1347 print
'<tr><td>'.$form->editfieldkey(
'Web',
'member_url',
GETPOST(
'member_url',
'alpha'),
$object, 0).
'</td>';
1348 print
'<td>'.img_picto(
'',
'globe',
'class="pictofixedwidth"').
'<input type="text" name="member_url" id="member_url" class="maxwidth200onsmartphone maxwidth500 widthcentpercentminusx " value="'.(GETPOSTISSET(
'member_url') ?
GETPOST(
'member_url',
'alpha') :
$object->url).
'"></td></tr>';
1351 print
'<tr><td>'.$langs->trans(
"Address").
'</td><td>';
1352 print
'<textarea name="address" wrap="soft" class="quatrevingtpercent" rows="'.ROWS_2.
'">'.(GETPOSTISSET(
"address") ?
GETPOST(
"address",
'alphanohtml', 2) :
$object->
address).
'</textarea>';
1356 print
'<tr><td>'.$langs->trans(
"Zip").
' / '.$langs->trans(
"Town").
'</td><td>';
1357 print $formcompany->select_ziptown((GETPOSTISSET(
"zipcode") ?
GETPOST(
"zipcode",
'alphanohtml', 2) :
$object->zip),
'zipcode', array(
'town',
'selectcountry_id',
'state_id'), 6);
1359 print $formcompany->select_ziptown((GETPOSTISSET(
"town") ?
GETPOST(
"town",
'alphanohtml', 2) :
$object->town),
'town', array(
'zipcode',
'selectcountry_id',
'state_id'));
1364 print
'<tr><td>'.$langs->trans(
'Country').
'</td><td>';
1365 print
img_picto(
'',
'country',
'class="pictofixedwidth"');
1366 print $form->select_country(GETPOSTISSET(
"country_id") ?
GETPOST(
"country_id",
"alpha") :
$object->country_id,
'country_id');
1368 print
info_admin($langs->trans(
"YouCanChangeValuesForThisListFromDictionarySetup"), 1);
1374 print
'<tr><td>'.$langs->trans(
'State').
'</td><td>';
1375 print
img_picto(
'',
'state',
'class="pictofixedwidth"');
1376 print $formcompany->select_state(
$object->state_id, GETPOSTISSET(
"country_id") ?
GETPOST(
"country_id",
"alpha") :
$object->country_id);
1381 print
'<tr><td>'.$langs->trans(
"PhonePro").
'</td>';
1382 print
'<td>'.img_picto(
'',
'object_phoning',
'class="pictofixedwidth"').
'<input type="text" name="phone" value="'.(GETPOSTISSET(
"phone") ?
GETPOST(
"phone") :
$object->phone).
'"></td></tr>';
1385 print
'<tr><td>'.$langs->trans(
"PhonePerso").
'</td>';
1386 print
'<td>'.img_picto(
'',
'object_phoning',
'class="pictofixedwidth"').
'<input type="text" name="phone_perso" value="'.(GETPOSTISSET(
"phone_perso") ?
GETPOST(
"phone_perso") :
$object->phone_perso).
'"></td></tr>';
1389 print
'<tr><td>'.$langs->trans(
"PhoneMobile").
'</td>';
1390 print
'<td>'.img_picto(
'',
'object_phoning_mobile',
'class="pictofixedwidth"').
'<input type="text" name="phone_mobile" value="'.(GETPOSTISSET(
"phone_mobile") ?
GETPOST(
"phone_mobile") :
$object->phone_mobile).
'"></td></tr>';
1392 if (isModEnabled(
'socialnetworks')) {
1393 foreach ($socialnetworks as $key => $value) {
1394 if (!$value[
'active']) {
1397 print
'<tr><td>'.$langs->trans($value[
'label']).
'</td><td><input type="text" name="'.$key.
'" class="minwidth100" value="'.(GETPOSTISSET($key) ?
GETPOST($key,
'alphanohtml') : (isset(
$object->socialnetworks[$key]) ?
$object->socialnetworks[$key] : null)).
'"></td></tr>';
1402 print
"<tr><td>".$langs->trans(
"DateOfBirth").
"</td><td>\n";
1403 print
img_picto(
'',
'object_calendar',
'class="pictofixedwidth"').$form->selectDate((
$object->birth ?
$object->birth : -1),
'birth', 0, 0, 1,
'formsoc');
1404 print
"</td></tr>\n";
1408 print
'<tr><td>'.$form->editfieldkey(
'DefaultLang',
'default_lang',
'',
$object, 0).
'</td><td colspan="3">'.
"\n";
1409 print
img_picto(
'',
'language',
'class="pictofixedwidth"').$formadmin->select_language(
$object->default_lang,
'default_lang', 0, array(), 1);
1416 $htmltext = $langs->trans(
"Public",
getDolGlobalString(
'MAIN_INFO_SOCIETE_NOM'), $linkofpubliclist);
1417 print $form->textwithpicto($langs->trans(
"MembershipPublic"), $htmltext, 1,
'help',
'', 0, 3,
'membershippublic');
1418 print
"</td><td>\n";
1419 print $form->selectyesno(
"public", (GETPOSTISSET(
"public") ?
GETPOST(
"public",
'alphanohtml', 2) :
$object->public), 1, false, 0, 1);
1420 print
"</td></tr>\n";
1423 if (isModEnabled(
'category') && $user->hasRight(
'categorie',
'lire')) {
1424 print
'<tr><td>'.$form->editfieldkey(
"Categories",
'memcats',
'',
$object, 0).
'</td>';
1426 $cate_arbo = $form->select_all_categories(Categorie::TYPE_MEMBER,
'',
'', 64, 0, 3);
1428 $cats = $c->containing(
$object->id, Categorie::TYPE_MEMBER);
1429 $arrayselected = array();
1430 if (is_array($cats)) {
1431 foreach ($cats as $cat) {
1432 $arrayselected[] = $cat->id;
1435 print
img_picto(
'',
'category',
'class="pictofixedwidth"');
1436 print $form->multiselectarray(
'memcats', $cate_arbo, $arrayselected, 0, 0,
'widthcentpercentminusx', 0,
'100%');
1441 if (isModEnabled(
'societe')) {
1442 print
'<tr><td>'.$langs->trans(
"LinkedToDolibarrThirdParty").
'</td><td colspan="2" class="valeur">';
1445 $result = $company->fetch(
$object->socid);
1446 print $company->getNomUrl(1);
1448 print $langs->trans(
"NoThirdPartyAssociatedToMember");
1454 print
'<tr><td>'.$langs->trans(
"LinkedToDolibarrUser").
'</td><td colspan="2" class="valeur">';
1456 $form->form_users($_SERVER[
'PHP_SELF'].
'?rowid='.
$object->id,
$object->user_id,
'none');
1458 print $langs->trans(
"NoDolibarrAccess");
1463 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_edit.tpl.php';
1468 print $form->buttonsSaveCancel(
"Save",
'Cancel');
1474 if ($id > 0 && $action !=
'edit') {
1480 $res =
$object->fetch_optionals();
1487 $res = $adht->fetch(
$object->typeid);
1499 print
dol_get_fiche_head($head,
'general', $langs->trans(
"Member"), -1,
'user', 0,
'',
'', 0,
'', 1);
1502 if ($action ==
'create_user') {
1503 $login = (GETPOSTISSET(
'login') ?
GETPOST(
'login',
'alphanohtml') :
$object->login);
1504 if (empty($login)) {
1506 include_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
1509 if (empty($login)) {
1510 $login = strtolower(substr(
$object->firstname, 0, 4)).strtolower(substr(
$object->lastname, 0, 4));
1514 $formquestion = array(
1515 array(
'label' => $langs->trans(
"LoginToCreate"),
'type' =>
'text',
'name' =>
'login',
'value' => $login)
1517 if (isModEnabled(
'societe') &&
$object->socid > 0) {
1519 $formquestion[] = array(
'label' => $langs->trans(
"UserWillBe"),
'type' =>
'radio',
'name' =>
'internalorexternal',
'default' =>
'external',
'values' => array(
'external' => $langs->trans(
"External").
' - '.$langs->trans(
"LinkedToDolibarrThirdParty").
' '.
$object->thirdparty->getNomUrl(1,
'', 0, 1),
'internal' => $langs->trans(
"Internal")));
1522 if (isModEnabled(
'societe') &&
$object->socid <= 0) {
1523 $text .= $langs->trans(
"UserWillBeInternalUser").
'<br>';
1525 $text .= $langs->trans(
"ConfirmCreateLogin");
1526 print $form->formconfirm($_SERVER[
"PHP_SELF"].
"?rowid=".
$object->id, $langs->trans(
"CreateDolibarrLogin"), $text,
"confirm_create_user", $formquestion,
'yes');
1530 if ($action ==
'create_thirdparty') {
1532 $fullname =
$object->getFullName($langs);
1534 if (
$object->morphy ==
'mor') {
1535 $companyname =
$object->company;
1536 if (!empty($fullname)) {
1537 $companyalias = $fullname;
1540 $companyname = $fullname;
1541 if (!empty(
$object->company)) {
1542 $companyalias =
$object->company;
1547 $formquestion = array(
1548 array(
'label' => $langs->trans(
"NameToCreate"),
'type' =>
'text',
'name' =>
'companyname',
'value' => $companyname,
'morecss' =>
'minwidth300',
'moreattr' =>
'maxlength="128"'),
1549 array(
'label' => $langs->trans(
"AliasNames"),
'type' =>
'text',
'name' =>
'companyalias',
'value' => $companyalias,
'morecss' =>
'minwidth300',
'moreattr' =>
'maxlength="128"')
1552 print $form->formconfirm($_SERVER[
"PHP_SELF"].
"?rowid=".
$object->id, $langs->trans(
"CreateDolibarrThirdParty"), $langs->trans(
"ConfirmCreateThirdParty"),
"confirm_create_thirdparty", $formquestion,
'yes');
1556 if ($action ==
'valid') {
1557 $langs->load(
"mails");
1560 $adht->fetch(
$object->typeid);
1566 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
1569 $outputlangs =
new Translate(
'', $conf);
1570 $outputlangs->setDefaultLang(empty(
$object->thirdparty->default_lang) ? $mysoc->default_lang :
$object->thirdparty->default_lang);
1572 $outputlangs->loadLangs(array(
"main",
"members",
"companies",
"install",
"other"));
1574 $arraydefaultmessage =
null;
1577 if (!empty($labeltouse)) {
1578 $arraydefaultmessage = $formmail->getEMailTemplate($db,
'member', $user, $outputlangs, 0, 1, $labeltouse);
1581 if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
1582 $subject = $arraydefaultmessage->topic;
1583 $msg = $arraydefaultmessage->content;
1591 $tmp = $langs->trans(
"SendingAnEMailToMember");
1592 $tmp .=
'<br>'.$langs->trans(
"MailFrom").
': <b>'.
getDolGlobalString(
'ADHERENT_MAIL_FROM').
'</b>, ';
1593 $tmp .=
'<br>'.$langs->trans(
"MailRecipient").
': <b>'.
$object->email.
'</b>';
1595 $helpcontent .=
'<b>'.$langs->trans(
"MailFrom").
'</b>: '.
getDolGlobalString(
'ADHERENT_MAIL_FROM').
'<br>'.
"\n";
1596 $helpcontent .=
'<b>'.$langs->trans(
"MailRecipient").
'</b>: '.
$object->email.
'<br>'.
"\n";
1597 $helpcontent .=
'<b>'.$langs->trans(
"Subject").
'</b>:<br>'.
"\n";
1598 $helpcontent .= $subjecttosend.
"\n";
1599 $helpcontent .=
"<br>";
1600 $helpcontent .=
'<b>'.$langs->trans(
"Content").
'</b>:<br>';
1603 $label = $form->textwithpicto($tmp, $helpcontent, 1,
'help');
1606 $formquestion = array();
1608 $formquestion[] = array(
'type' =>
'checkbox',
'name' =>
'send_mail',
'label' => $label,
'value' => (
getDolGlobalString(
'ADHERENT_DEFAULT_SENDINFOBYMAIL') ?
true : false));
1611 $formquestion[] = array(
'type' =>
'other',
'label' => $langs->transnoentitiesnoconv(
"SynchroMailManEnabled"),
'value' =>
'');
1614 $formquestion[] = array(
'type' =>
'other',
'label' => $langs->transnoentitiesnoconv(
"SynchroSpipEnabled"),
'value' =>
'');
1616 print $form->formconfirm(
"card.php?rowid=".$id, $langs->trans(
"ValidateMember"), $langs->trans(
"ConfirmValidateMember"),
"confirm_valid", $formquestion,
'yes', 1, 220);
1620 if ($action ==
'resiliate') {
1621 $langs->load(
"mails");
1624 $adht->fetch(
$object->typeid);
1630 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
1633 $outputlangs =
new Translate(
'', $conf);
1634 $outputlangs->setDefaultLang(empty(
$object->thirdparty->default_lang) ? $mysoc->default_lang :
$object->thirdparty->default_lang);
1636 $outputlangs->loadLangs(array(
"main",
"members"));
1638 $arraydefaultmessage =
null;
1641 if (!empty($labeltouse)) {
1642 $arraydefaultmessage = $formmail->getEMailTemplate($db,
'member', $user, $outputlangs, 0, 1, $labeltouse);
1645 if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
1646 $subject = $arraydefaultmessage->topic;
1647 $msg = $arraydefaultmessage->content;
1655 $tmp = $langs->trans(
"SendingAnEMailToMember");
1656 $tmp .=
'<br>('.$langs->trans(
"MailFrom").
': <b>'.
getDolGlobalString(
'ADHERENT_MAIL_FROM').
'</b>, ';
1657 $tmp .= $langs->trans(
"MailRecipient").
': <b>'.
$object->email.
'</b>)';
1659 $helpcontent .=
'<b>'.$langs->trans(
"MailFrom").
'</b>: '.
getDolGlobalString(
'ADHERENT_MAIL_FROM').
'<br>'.
"\n";
1660 $helpcontent .=
'<b>'.$langs->trans(
"MailRecipient").
'</b>: '.
$object->email.
'<br>'.
"\n";
1661 $helpcontent .=
'<b>'.$langs->trans(
"Subject").
'</b>:<br>'.
"\n";
1662 $helpcontent .= $subjecttosend.
"\n";
1663 $helpcontent .=
"<br>";
1664 $helpcontent .=
'<b>'.$langs->trans(
"Content").
'</b>:<br>';
1667 $label = $form->textwithpicto($tmp, $helpcontent, 1,
'help');
1670 $formquestion = array();
1672 $formquestion[] = array(
'type' =>
'checkbox',
'name' =>
'send_mail',
'label' => $label,
'value' => (
getDolGlobalString(
'ADHERENT_DEFAULT_SENDINFOBYMAIL') ?
'true' :
'false'));
1675 $formquestion[] = array(
'type' =>
'hidden',
'name' =>
'backtopage',
'value' => ($backtopage !=
'1' ? $backtopage : $_SERVER[
"HTTP_REFERER"]));
1677 print $form->formconfirm(
"card.php?rowid=".$id, $langs->trans(
"ResiliateMember"), $langs->trans(
"ConfirmResiliateMember"),
"confirm_resiliate", $formquestion,
'no', 1, 240);
1681 if ($action ==
'exclude') {
1682 $langs->load(
"mails");
1685 $adht->fetch(
$object->typeid);
1691 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
1694 $outputlangs =
new Translate(
'', $conf);
1695 $outputlangs->setDefaultLang(empty(
$object->thirdparty->default_lang) ? $mysoc->default_lang :
$object->thirdparty->default_lang);
1697 $outputlangs->loadLangs(array(
"main",
"members"));
1699 $arraydefaultmessage =
null;
1702 if (!empty($labeltouse)) {
1703 $arraydefaultmessage = $formmail->getEMailTemplate($db,
'member', $user, $outputlangs, 0, 1, $labeltouse);
1706 if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
1707 $subject = $arraydefaultmessage->topic;
1708 $msg = $arraydefaultmessage->content;
1716 $tmp = $langs->trans(
"SendingAnEMailToMember");
1717 $tmp .=
'<br>('.$langs->trans(
"MailFrom").
': <b>'.
getDolGlobalString(
'ADHERENT_MAIL_FROM').
'</b>, ';
1718 $tmp .= $langs->trans(
"MailRecipient").
': <b>'.
$object->email.
'</b>)';
1720 $helpcontent .=
'<b>'.$langs->trans(
"MailFrom").
'</b>: '.
getDolGlobalString(
'ADHERENT_MAIL_FROM').
'<br>'.
"\n";
1721 $helpcontent .=
'<b>'.$langs->trans(
"MailRecipient").
'</b>: '.
$object->email.
'<br>'.
"\n";
1722 $helpcontent .=
'<b>'.$langs->trans(
"Subject").
'</b>:<br>'.
"\n";
1723 $helpcontent .= $subjecttosend.
"\n";
1724 $helpcontent .=
"<br>";
1725 $helpcontent .=
'<b>'.$langs->trans(
"Content").
'</b>:<br>';
1728 $label = $form->textwithpicto($tmp, $helpcontent, 1,
'help');
1731 $formquestion = array();
1733 $formquestion[] = array(
'type' =>
'checkbox',
'name' =>
'send_mail',
'label' => $label,
'value' => (
getDolGlobalString(
'ADHERENT_DEFAULT_SENDINFOBYMAIL') ?
'true' :
'false'));
1736 $formquestion[] = array(
'type' =>
'hidden',
'name' =>
'backtopage',
'value' => ($backtopage !=
'1' ? $backtopage : $_SERVER[
"HTTP_REFERER"]));
1738 print $form->formconfirm(
"card.php?rowid=".$id, $langs->trans(
"ExcludeMember"), $langs->trans(
"ConfirmExcludeMember"),
"confirm_exclude", $formquestion,
'no', 1, 240);
1742 if ($action ==
'delete') {
1743 $formquestion = array();
1745 $formquestion[] = array(
'type' =>
'hidden',
'name' =>
'backtopage',
'value' => ($backtopage !=
'1' ? $backtopage : $_SERVER[
"HTTP_REFERER"]));
1747 print $form->formconfirm(
"card.php?rowid=".$id, $langs->trans(
"DeleteMember"), $langs->trans(
"ConfirmDeleteMember"),
"confirm_delete", $formquestion,
'no', 1);
1751 if ($action ==
'add_spip') {
1752 print $form->formconfirm(
"card.php?rowid=".$id, $langs->trans(
'AddIntoSpip'), $langs->trans(
'AddIntoSpipConfirmation'),
'confirm_add_spip');
1755 if ($action ==
'del_spip') {
1756 print $form->formconfirm(
"card.php?rowid=$id", $langs->trans(
'DeleteIntoSpip'), $langs->trans(
'DeleteIntoSpipConfirmation'),
'confirm_del_spip');
1763 if (isModEnabled(
'societe')) {
1767 $linkback =
'<a href="'.DOL_URL_ROOT.
'/adherents/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
1769 $morehtmlref =
'<a href="'.DOL_URL_ROOT.
'/adherents/vcard.php?id='.
$object->id.
'" class="refid">';
1770 $morehtmlref .=
img_picto($langs->trans(
"Download").
' '.$langs->trans(
"VCard"),
'vcard.png',
'class="valignmiddle marginleftonly paddingrightonly"');
1771 $morehtmlref .=
'</a>';
1774 dol_banner_tab(
$object,
'rowid', $linkback, 1,
'rowid',
'ref', $morehtmlref);
1776 print
'<div class="fichecenter">';
1777 print
'<div class="fichehalfleft">';
1779 print
'<div class="underbanner clearboth"></div>';
1780 print
'<table class="border tableforfield centpercent">';
1784 print
'<tr><td class="titlefield">'.$langs->trans(
"Login").
' / '.$langs->trans(
"Id").
'</td><td class="valeur">'.
dol_escape_htmltag(
$object->login).
'</td></tr>';
1788 print
'<tr><td class="titlefield">'.$langs->trans(
"Type").
'</td>';
1789 print
'<td class="valeur">'.$adht->getNomUrl(1).
"</td></tr>\n";
1792 print
'<tr><td>'.$langs->trans(
"MemberNature").
'</td>';
1793 print
'<td class="valeur" >'.$object->getmorphylib(
'', 1).
'</td>';
1800 print
'<tr><td>'.$langs->trans(
"UserTitle").
'</td><td class="valeur">'.
$object->getCivilityLabel().
'</td>';
1805 print
'<tr><td>'.$langs->trans(
"Password").
'</td><td>';
1807 print preg_replace(
'/./i',
'*',
$object->pass);
1810 print
'<!-- '.$langs->trans(
"Crypted").
': '.
$object->pass_indatabase_crypted.
' -->';
1812 print
'<span class="opacitymedium">'.$langs->trans(
"Hidden").
'</span>';
1814 if (!empty(
$object->pass_indatabase) && empty(
$object->user_id)) {
1815 $langs->load(
"errors");
1816 $htmltext = $langs->trans(
"WarningPasswordSetWithNoAccount");
1817 print
' '.$form->textwithpicto(
'', $htmltext, 1,
'warning');
1823 print
'<tr><td>'.$langs->trans(
"SubscriptionEndDate").
'</td><td class="valeur">';
1827 print
" ".img_warning($langs->trans(
"Late"));
1830 if (
$object->need_subscription == 0) {
1831 print $langs->trans(
"SubscriptionNotNeeded");
1832 } elseif (!$adht->subscription) {
1833 print $langs->trans(
"SubscriptionNotRecorded");
1835 print
" ".img_warning($langs->trans(
"Late"));
1838 print $langs->trans(
"SubscriptionNotReceived");
1840 print
" ".img_warning($langs->trans(
"Late"));
1850 print
'<div class="fichehalfright">';
1851 print
'<div class="underbanner clearboth"></div>';
1853 print
'<table class="border tableforfield centpercent">';
1856 if (isModEnabled(
'category') && $user->hasRight(
'categorie',
'lire')) {
1857 print
'<tr><td>'.$langs->trans(
"Categories").
'</td>';
1858 print
'<td colspan="2">';
1859 print $form->showCategories(
$object->id, Categorie::TYPE_MEMBER, 1);
1864 print
'<tr><td class="titlefield">'.$langs->trans(
"DateOfBirth").
'</td><td class="valeur">'.
dol_print_date(
$object->birth,
'day').
'</td></tr>';
1868 require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
1869 print
'<tr><td>'.$langs->trans(
"DefaultLang").
'</td><td>';
1872 $langs->load(
"languages");
1873 $labellang = (
$object->default_lang ? $langs->trans(
'Language_'.
$object->default_lang) :
'');
1881 $htmltext = $langs->trans(
"Public",
getDolGlobalString(
'MAIN_INFO_SOCIETE_NOM'), $linkofpubliclist);
1882 print $form->textwithpicto($langs->trans(
"MembershipPublic"), $htmltext, 1,
'help',
'', 0, 3,
'membershippublic');
1883 print
'</td><td class="valeur">'.yn(
$object->public).
'</td></tr>';
1886 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
1889 if (isModEnabled(
'societe')) {
1891 $editenable = $user->hasRight(
'adherent',
'creer');
1892 print $form->editfieldkey(
'LinkedToDolibarrThirdParty',
'thirdparty',
'',
$object, $editenable);
1893 print
'</td><td colspan="2" class="valeur">';
1894 if ($action ==
'editthirdparty') {
1895 $htmlname =
'socid';
1896 print
'<form method="POST" action="'.$_SERVER[
'PHP_SELF'].
'" name="form'.$htmlname.
'">';
1897 print
'<input type="hidden" name="rowid" value="'.$object->id.
'">';
1898 print
'<input type="hidden" name="action" value="set'.$htmlname.
'">';
1899 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1900 print
'<table class="nobordernopadding">';
1902 print $form->select_company(
$object->socid,
'socid',
'', 1);
1904 print
'<td class="left"><input type="submit" class="button button-edit smallpaddingimp" value="'.$langs->trans(
"Modify").
'"></td>';
1905 print
'</tr></table></form>';
1909 $result = $company->fetch(
$object->socid);
1910 print $company->getNomUrl(1);
1913 $tmparray = $company->getOutstandingBills(
'customer');
1914 if (!empty($tmparray[
'refs'])) {
1915 print
' - '.img_picto($langs->trans(
"Invoices"),
'bill',
'class="paddingright"').
'<a href="'.DOL_URL_ROOT.
'/compta/facture/list.php?socid='.
$object->socid.
'">'.$langs->trans(
"Invoices").
' ('.count($tmparray[
'refs']).
')';
1920 print
'<span class="opacitymedium">'.$langs->trans(
"NoThirdPartyAssociatedToMember").
'</span>';
1928 $editenable = $user->hasRight(
'adherent',
'creer') && $user->hasRight(
'user',
'user',
'creer');
1929 print $form->editfieldkey(
'LinkedToDolibarrUser',
'login',
'',
$object, $editenable);
1930 print
'</td><td colspan="2" class="valeur">';
1931 if ($action ==
'editlogin') {
1932 $form->form_users($_SERVER[
'PHP_SELF'].
'?rowid='.
$object->id,
$object->user_id,
'userid', array());
1935 $linkeduser =
new User($db);
1936 $linkeduser->fetch(
$object->user_id);
1937 print $linkeduser->getNomUrl(-1);
1939 print
'<span class="opacitymedium">'.$langs->trans(
"NoDolibarrAccess").
'</span>';
1946 print
"</div></div>\n";
1947 print
'<div class="clearboth"></div>';
1956 print
'<div class="tabsAction">';
1958 $parameters = array();
1959 $reshook = $hookmanager->executeHooks(
'addMoreActionsButtons', $parameters,
$object, $action);
1960 if (empty($reshook)) {
1961 if ($action !=
'editlogin' && $action !=
'editthirdparty') {
1963 if (empty($user->socid)) {
1965 print
'<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?id='.((int)
$object->id).
'&action=presend&mode=init#formmailbeforetitle">'.$langs->trans(
'SendMail').
'</a>'.
"\n";
1984 if ($user->hasRight(
'adherent',
'creer')) {
1985 print
'<a class="butAction" href="card.php?rowid='.((int)
$object->id).
'&action=edit&token='.
newToken().
'">'.$langs->trans(
"Modify").
'</a>'.
"\n";
1987 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"Modify").
'</span>'.
"\n";
1992 if ($user->hasRight(
'adherent',
'creer')) {
1993 print
'<a class="butAction" href="card.php?rowid='.((int)
$object->id).
'&action=valid&token='.
newToken().
'">'.$langs->trans(
"Validate").
'</a>'.
"\n";
1995 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"Validate").
'</span>'.
"\n";
2001 if ($user->hasRight(
'adherent',
'creer')) {
2002 print
'<a class="butAction" href="card.php?rowid='.((int)
$object->id).
'&action=valid&token='.
newToken().
'">'.$langs->trans(
"Reenable").
"</a>\n";
2004 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"Reenable").
'</span>'.
"\n";
2010 if ($user->hasRight(
'adherent',
'supprimer')) {
2011 print
'<a class="butAction" href="card.php?rowid='.((int)
$object->id).
'&action=resiliate&token='.
newToken().
'">'.$langs->trans(
"Resiliate").
"</a></span>\n";
2013 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"Resiliate").
'</span>'.
"\n";
2019 if ($user->hasRight(
'adherent',
'supprimer')) {
2020 print
'<a class="butAction" href="card.php?rowid='.((int)
$object->id).
'&action=exclude&token='.
newToken().
'">'.$langs->trans(
"Exclude").
"</a></span>\n";
2022 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"Exclude").
'</span>'.
"\n";
2027 if (isModEnabled(
'societe') && !
$object->socid) {
2028 if ($user->hasRight(
'societe',
'creer')) {
2030 print
'<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?rowid='.((int)
$object->id).
'&action=create_thirdparty&token='.
newToken().
'" title="'.
dol_escape_htmltag($langs->trans(
"CreateDolibarrThirdPartyDesc")).
'">'.$langs->trans(
"CreateDolibarrThirdParty").
'</a>'.
"\n";
2032 print
'<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans(
"ValidateBefore")).
'">'.$langs->trans(
"CreateDolibarrThirdParty").
'</a>'.
"\n";
2035 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"CreateDolibarrThirdParty").
'</span>'.
"\n";
2040 if (!$user->socid && !
$object->user_id) {
2041 if ($user->hasRight(
'user',
'user',
'creer')) {
2043 print
'<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?rowid='.((int)
$object->id).
'&action=create_user&token='.
newToken().
'" title="'.
dol_escape_htmltag($langs->trans(
"CreateDolibarrLoginDesc")).
'">'.$langs->trans(
"CreateDolibarrLogin").
'</a>'.
"\n";
2045 print
'<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans(
"ValidateBefore")).
'">'.$langs->trans(
"CreateDolibarrLogin").
'</a>'.
"\n";
2048 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"CreateDolibarrLogin").
'</span>'.
"\n";
2054 $isinspip = $mailmanspip->is_in_spip(
$object);
2056 if ($isinspip == 1) {
2057 print
'<a class="butAction" href="card.php?rowid='.((int)
$object->id).
'&action=del_spip&token='.
newToken().
'">'.$langs->trans(
"DeleteIntoSpip").
'</a>'.
"\n";
2059 if ($isinspip == 0) {
2060 print
'<a class="butAction" href="card.php?rowid='.((int)
$object->id).
'&action=add_spip&token='.
newToken().
'">'.$langs->trans(
"AddIntoSpip").
'</a>'.
"\n";
2065 if ($user->hasRight(
'adherent',
'supprimer')) {
2066 print
'<a class="butActionDelete" href="card.php?rowid='.((int)
$object->id).
'&action=delete&token='.
newToken().
'">'.$langs->trans(
"Delete").
'</a>'.
"\n";
2068 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"Delete").
'</span>'.
"\n";
2074 if ($isinspip == -1) {
2075 print
'<br><br><span class="error">'.$langs->trans(
'SPIPConnectionFailed').
': '.$mailmanspip->error.
'</span>';
2080 if (
GETPOST(
'modelselected')) {
2081 $action =
'presend';
2084 if ($action !=
'presend') {
2085 print
'<div class="fichecenter"><div class="fichehalfleft">';
2086 print
'<a name="builddoc"></a>';
2090 $filedir = $conf->adherent->dir_output.
'/'.
get_exdir(0, 0, 0, 1,
$object,
'member');
2091 $urlsource = $_SERVER[
'PHP_SELF'].
'?id='.
$object->id;
2092 $genallowed = $user->hasRight(
'adherent',
'lire');
2093 $delallowed = $user->hasRight(
'adherent',
'creer');
2095 print $formfile->showdocuments(
'member', $filename, $filedir, $urlsource, $genallowed, $delallowed,
$object->model_pdf, 1, 0, 0, 28, 0,
'',
'',
'', (empty(
$object->default_lang) ?
'' :
$object->default_lang),
'',
$object);
2096 $somethingshown = $formfile->numoffiles;
2104 include_once DOL_DOCUMENT_ROOT.
'/core/lib/payments.lib.php';
2105 $validpaymentmethod = getValidOnlinePaymentMethods(
'');
2106 $useonlinepayment = count($validpaymentmethod);
2108 if ($useonlinepayment) {
2110 if (empty($amount)) {
2111 $amount = max($adht->amount,
$object->first_subscription_amount,
$object->last_subscription_amount);
2113 if (empty($amount)) {
2116 require_once DOL_DOCUMENT_ROOT.
'/core/lib/payments.lib.php';
2117 print showOnlinePaymentUrl(
'membersubscription',
$object->ref, $amount);
2120 print
'</div><div class="fichehalfright">';
2124 $morehtmlcenter =
'';
2125 $messagingUrl = DOL_URL_ROOT.
'/adherents/messaging.php?rowid='.
$object->id;
2126 $morehtmlcenter .=
dolGetButtonTitle($langs->trans(
'ShowAsConversation'),
'',
'fa fa-comments imgforviewmode', $messagingUrl,
'', 1);
2127 $morehtmlcenter .=
dolGetButtonTitle($langs->trans(
'SeeAll'),
'',
'fa fa-bars imgforviewmode', DOL_URL_ROOT.
'/adherents/agenda.php?id='.
$object->id);
2130 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formactions.class.php';
2132 $somethingshown = $formactions->showactions(
$object,
$object->element, $socid, 1,
'listactions', $MAXEVENT,
'', $morehtmlcenter);
2134 print
'</div></div>';
2138 $modelmail =
'member';
2139 $defaulttopic =
'CardContent';
2140 $diroutput = $conf->adherent->dir_output;
2141 $trackid =
'mem'.$object->id;
2143 include DOL_DOCUMENT_ROOT.
'/core/tpl/card_presend.tpl.php';
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Class to manage members of a foundation.
const STATUS_EXCLUDED
Excluded.
const STATUS_DRAFT
Draft status.
const STATUS_RESILIATED
Resiliated.
const STATUS_VALIDATED
Validated status.
Class to manage members type.
Class to manage categories.
Class to manage mailman and spip.
Class to manage third parties objects (customers, suppliers, prospects...)
Class to manage translations.
Class to manage Dolibarr users.
getCountry($searchkey, $withcode='', $dbtouse=null, $outputlangs=null, $entconv=1, $searchlabel='')
Return country label, code or id from an id, code or label.
print $script_file $mode $langs defaultlang(is_numeric($duration_value) ? " delay=". $duration_value :"").(is_numeric($duration_value2) ? " after cd cd cd description as p label as s rowid as s nom as s email
Sender: Who sends the email ("Sender" has sent emails on behalf of "From").
dol_delete_dir_recursive($dir, $count=0, $nophperrors=0, $onlysub=0, &$countdeleted=0, $indexdatabase=1, $nolog=0)
Remove a directory $dir and its subdirectories (or only files and subdirectories)
dol_delete_file($file, $disableglob=0, $nophperrors=0, $nohook=0, $object=null, $allowdotdot=false, $indexdatabase=1, $nolog=0)
Remove a file or several files with a mask.
dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disablevirusscan=0, $uploaderrorcode=0, $nohook=0, $varfiles='addedfile', $upload_dir='')
Check validity of a file upload from an GUI page, and move it to its final destination.
dol_buildlogin($lastname, $firstname)
Build a login from lastname, firstname.
isValidUrl($url, $http=0, $pass=0, $port=0, $path=0, $query=0, $anchor=0)
Url string validation <http[s]> :// [user[:pass]@] hostname [port] [/path] [?getquery] [anchor].
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed information (by default a local PHP server timestamp) Rep...
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
picto_from_langcode($codelang, $moreatt='', $notitlealt=0)
Return img flag of country for a language code or country code.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
dolGetButtonTitle($label, $helpText='', $iconClass='fa fa-file', $url='', $id='', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
newToken()
Return the value of token currently saved into session with name 'newtoken'.
dol_clone($object, $native=0)
Create a clone of instance of object (new instance with same value for each properties) With native =...
dol_concatdesc($text1, $text2, $forxml=false, $invert=false)
Concat 2 descriptions with a new line between them (second operand after first one with appropriate n...
complete_substitutions_array(&$substitutionarray, $outputlangs, $object=null, $parameters=null, $callfunc="completesubstitutionarray")
Complete the $substitutionarray with more entries coming from external module that had set the "subst...
make_substitutions($text, $substitutionarray, $outputlangs=null, $converttextinhtmlifnecessary=0)
Make substitution into a text string, replacing keys with vals from $substitutionarray (oldval=>newva...
getArrayOfSocialNetworks()
Get array of social network dictionary.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dol_htmlentitiesbr($stringtoencode, $nl2brmode=0, $pagecodefrom='UTF-8', $removelasteolbr=1)
This function is called to encode a string into a HTML string but differs from htmlentities because a...
getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $object=null, $include=null)
Return array of possible common substitutions.
isValidEmail($address, $acceptsupervisorkey=0, $acceptuserkey=0)
Return true if email syntax is ok.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='', $picto='')
Show information in HTML for admin users or standard users.
get_exdir($num, $level, $alpha, $withoutslash, $object, $modulepart='')
Return a path to have a the directory according to object where files are stored.
dol_mkdir($dir, $dataroot='', $newmask='')
Creation of a directory (this can create recursive subdir)
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
div refaddress div address
image_format_supported($file, $acceptsvg=0)
Return if a filename is file name of a supported image format.
member_prepare_head(Adherent $object)
Return array head with list of tabs to view object information.
$conf db name
Only used if Module[ID]Name translation string is not found.
getRandomPassword($generic=false, $replaceambiguouschars=null, $length=32)
Return a generated password using default module.
getMaxFileSizeArray()
Return the max allowed for file upload.
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.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.