32 require
'../main.inc.php';
33 require_once DOL_DOCUMENT_ROOT.
'/core/lib/member.lib.php';
34 require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
35 require_once DOL_DOCUMENT_ROOT.
'/core/lib/images.lib.php';
36 require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
37 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
38 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent_type.class.php';
39 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/subscription.class.php';
40 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
41 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
42 require_once DOL_DOCUMENT_ROOT.
'/core/class/extrafields.class.php';
43 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
44 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
47 $langs->loadLangs(array(
"companies",
"bills",
"members",
"users",
"other",
"paypal"));
49 $action =
GETPOST(
'action',
'aZ09');
50 $cancel =
GETPOST(
'cancel',
'alpha');
51 $backtopage =
GETPOST(
'backtopage',
'alpha');
52 $confirm =
GETPOST(
'confirm',
'alpha');
53 $rowid =
GETPOST(
'rowid',
'int');
55 $typeid =
GETPOST(
'typeid',
'int');
56 $userid =
GETPOST(
'userid',
'int');
57 $socid =
GETPOST(
'socid',
'int');
60 if (!empty($conf->mailmanspip->enabled)) {
61 include_once DOL_DOCUMENT_ROOT.
'/mailmanspip/class/mailmanspip.class.php';
63 $langs->load(
'mailmanspip');
72 $extrafields->fetch_name_optionals_label($object->table_element);
77 $object->getCanvas($id);
78 $canvas = $object->canvas ? $object->canvas :
GETPOST(
"canvas");
80 if (!empty($canvas)) {
81 require_once DOL_DOCUMENT_ROOT.
'/core/class/canvas.class.php';
82 $objcanvas =
new Canvas($db, $action);
83 $objcanvas->getCanvas(
'adherent',
'membercard', $canvas);
87 $hookmanager->initHooks(array(
'membercard',
'globalcard'));
90 if ($id > 0 || !empty($ref)) {
92 $result = $object->fetch($id, $ref);
95 $canadduser = ($user->admin || $user->rights->user->user->creer);
97 if ($object->user_id) {
99 $caneditfielduser = ((($user->id == $object->user_id) && $user->rights->user->self->creer)
100 || (($user->id != $object->user_id) && $user->rights->user->user->creer));
101 $caneditpassworduser = ((($user->id == $object->user_id) && $user->rights->user->self->password)
102 || (($user->id != $object->user_id) && $user->rights->user->user->password));
107 $canaddmember = $user->rights->adherent->creer;
110 $caneditfieldmember = $user->rights->adherent->creer;
114 $result =
restrictedArea($user,
'adherent', $object->id,
'',
'',
'socid',
'rowid', 0);
121 $parameters = array(
'id'=>$id,
'rowid'=>$id,
'objcanvas'=>$objcanvas,
'confirm'=>$confirm);
122 $reshook = $hookmanager->executeHooks(
'doActions',
$parameters, $object, $action);
127 if (empty($reshook)) {
128 $backurlforlist = DOL_URL_ROOT.
'/adherents/list.php';
130 if (empty($backtopage) || ($cancel && empty($id))) {
131 if (empty($backtopage) || ($cancel && strpos($backtopage,
'__ID__'))) {
132 if (empty($id) && (($action !=
'add' && $action !=
'create') || $cancel)) {
133 $backtopage = $backurlforlist;
135 $backtopage = DOL_URL_ROOT.
'/adherents/card.php?id='.((!empty($id) && $id > 0) ? $id :
'__ID__');
141 if (!empty($backtopageforcancel)) {
142 header(
"Location: ".$backtopageforcancel);
144 } elseif (!empty($backtopage)) {
145 header(
"Location: ".$backtopage);
151 if ($action ==
'setuserid' && ($user->rights->user->self->creer || $user->rights->user->user->creer)) {
153 if (empty($user->rights->user->user->creer)) {
154 if ($userid != $user->id && $userid != $object->user_id) {
156 setEventMessages($langs->trans(
"ErrorUserPermissionAllowsToLinksToItselfOnly"),
null,
'errors');
161 if ($userid != $object->user_id) {
162 $result = $object->setUserId($userid);
171 if ($action ==
'setsocid') {
174 if ($socid != $object->socid) {
175 $sql =
"SELECT rowid FROM ".MAIN_DB_PREFIX.
"adherent";
176 $sql .=
" WHERE socid = ".((int) $socid);
177 $sql .=
" AND entity = ".$conf->entity;
178 $resql = $db->query($sql);
180 $obj = $db->fetch_object(
$resql);
181 if ($obj && $obj->rowid > 0) {
183 $othermember->fetch($obj->rowid);
184 $thirdparty =
new Societe($db);
185 $thirdparty->fetch($socid);
187 setEventMessages($langs->trans(
"ErrorMemberIsAlreadyLinkedToThisThirdParty", $othermember->getFullName($langs), $othermember->login, $thirdparty->name),
null,
'errors');
192 $result = $object->setThirdPartyId($socid);
203 if ($action ==
'confirm_create_user' && $confirm ==
'yes' && $user->rights->user->user->creer) {
206 $nuser =
new User($db);
208 if (
GETPOST(
'internalorexternal',
'aZ09') ==
'internal') {
209 $tmpuser->fk_soc = 0;
212 $result = $nuser->create_from_member($tmpuser,
GETPOST(
'login',
'alphanohtml'));
215 $langs->load(
"errors");
218 setEventMessages($langs->trans(
"NewUserCreated", $nuser->login),
null,
'mesgs');
227 if ($action ==
'confirm_create_thirdparty' && $confirm ==
'yes' && $user->rights->societe->creer) {
231 $result = $company->create_from_member($object,
GETPOST(
'companyname',
'alpha'),
GETPOST(
'companyalias',
'alpha'));
234 $langs->load(
"errors");
243 if ($action ==
'update' && !$cancel && $user->rights->adherent->creer) {
244 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
250 $lastname =
GETPOST(
"lastname",
'alphanohtml');
251 $firstname =
GETPOST(
"firstname",
'alphanohtml');
252 $gender =
GETPOST(
"gender",
'alphanohtml');
253 $societe =
GETPOST(
"societe",
'alphanohtml');
254 $morphy =
GETPOST(
"morphy",
'alphanohtml');
255 $login =
GETPOST(
"login",
'alphanohtml');
256 if ($morphy !=
'mor' && empty($lastname)) {
258 $langs->load(
"errors");
259 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Lastname")),
null,
'errors');
261 if ($morphy !=
'mor' && (!isset($firstname) || $firstname ==
'')) {
263 $langs->load(
"errors");
264 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Firstname")),
null,
'errors');
266 if ($morphy ==
'mor' && empty($societe)) {
268 $langs->load(
"errors");
269 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Company")),
null,
'errors');
272 if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
275 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Login")),
null,
'errors');
279 if ($result > 0 && !$error) {
280 $object->oldcopy = clone $object;
283 $object->civility_id = trim(
GETPOST(
"civility_id",
'alphanohtml'));
284 $object->firstname = trim(
GETPOST(
"firstname",
'alphanohtml'));
285 $object->lastname = trim(
GETPOST(
"lastname",
'alphanohtml'));
286 $object->gender = trim(
GETPOST(
"gender",
'alphanohtml'));
287 $object->login = trim(
GETPOST(
"login",
'alphanohtml'));
288 $object->pass = trim(
GETPOST(
"pass",
'none'));
290 $object->societe = trim(
GETPOST(
"societe",
'alphanohtml'));
291 $object->company = trim(
GETPOST(
"societe",
'alphanohtml'));
293 $object->address = trim(
GETPOST(
"address",
'alphanohtml'));
294 $object->zip = trim(
GETPOST(
"zipcode",
'alphanohtml'));
295 $object->town = trim(
GETPOST(
"town",
'alphanohtml'));
296 $object->state_id =
GETPOST(
"state_id",
'int');
297 $object->country_id =
GETPOST(
"country_id",
'int');
299 $object->phone = trim(
GETPOST(
"phone",
'alpha'));
300 $object->phone_perso = trim(
GETPOST(
"phone_perso",
'alpha'));
301 $object->phone_mobile = trim(
GETPOST(
"phone_mobile",
'alpha'));
302 $object->email = preg_replace(
'/\s+/',
'',
GETPOST(
"member_email",
'alpha'));
303 $object->url = trim(
GETPOST(
'member_url',
'custom', 0, FILTER_SANITIZE_URL));
304 $object->socialnetworks = array();
305 foreach ($socialnetworks as $key => $value) {
307 $object->socialnetworks[$key] = trim(
GETPOST($key,
'alphanohtml'));
314 $object->birth = $birthdate;
316 $object->typeid =
GETPOST(
"typeid",
'int');
318 $object->morphy =
GETPOST(
"morphy",
'alpha');
320 if (
GETPOST(
'deletephoto',
'alpha')) {
322 } elseif (!empty($_FILES[
'photo'][
'name'])) {
327 $object->statut =
GETPOST(
"statut",
'alpha');
328 $object->public =
GETPOST(
"public",
'alpha');
331 $ret = $extrafields->setOptionalsFromPost(
null, $object,
'@GETPOSTISSET');
338 if ($object->user_id) {
339 if ($user->id != $object->user_id && empty($user->rights->user->user->creer)) {
346 if ($object->user_id) {
347 if ($user->id != $object->user_id && empty($user->rights->user->user->password)) {
353 $result = $object->update($user, 0, $nosyncuser, $nosyncuserpass);
355 if ($result >= 0 && !count($object->errors)) {
356 $categories =
GETPOST(
'memcats',
'array');
357 $object->setCategories($categories);
360 $dir = $conf->adherent->dir_output.
'/'.
get_exdir(0, 0, 0, 1, $object,
'member').
'/photos';
361 $file_OK = is_uploaded_file($_FILES[
'photo'][
'tmp_name']);
364 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
365 $fileimg = $conf->adherent->dir_output.
'/'.
get_exdir(0, 0, 0, 1, $object,
'member').
'/photos/'.$object->photo;
366 $dirthumbs = $conf->adherent->dir_output.
'/'.
get_exdir(0, 0, 0, 1, $object,
'member').
'/photos/thumbs';
376 if (!
dol_move_uploaded_file($_FILES[
'photo'][
'tmp_name'], $newfile, 1, 0, $_FILES[
'photo'][
'error']) > 0) {
380 $object->addThumbs($newfile);
387 switch ($_FILES[
'photo'][
'error']) {
390 $errors[] =
"ErrorFileSizeTooLarge";
393 $errors[] =
"ErrorFilePartiallyUploaded";
398 $rowid = $object->id;
402 if (!empty($backtopage)) {
403 header(
"Location: ".$backtopage);
418 if ($action ==
'add' && $user->rights->adherent->creer) {
420 $object->canvas = $canvas;
426 $datesubscription =
'';
431 $typeid =
GETPOST(
"typeid",
'int');
432 $civility_id =
GETPOST(
"civility_id",
'alphanohtml');
433 $lastname =
GETPOST(
"lastname",
'alphanohtml');
434 $firstname =
GETPOST(
"firstname",
'alphanohtml');
435 $gender =
GETPOST(
"gender",
'alphanohtml');
436 $societe =
GETPOST(
"societe",
'alphanohtml');
437 $address =
GETPOST(
"address",
'alphanohtml');
438 $zip =
GETPOST(
"zipcode",
'alphanohtml');
439 $town =
GETPOST(
"town",
'alphanohtml');
440 $state_id =
GETPOST(
"state_id",
'int');
441 $country_id =
GETPOST(
"country_id",
'int');
443 $phone =
GETPOST(
"phone",
'alpha');
444 $phone_perso =
GETPOST(
"phone_perso",
'alpha');
445 $phone_mobile =
GETPOST(
"phone_mobile",
'alpha');
450 $email = preg_replace(
'/\s+/',
'',
GETPOST(
"member_email",
'alpha'));
451 $url = trim(
GETPOST(
'url',
'custom', 0, FILTER_SANITIZE_URL));
452 $login =
GETPOST(
"member_login",
'alphanohtml');
453 $pass =
GETPOST(
"password",
'none');
454 $photo =
GETPOST(
"photo",
'alphanohtml');
455 $morphy =
GETPOST(
"morphy",
'alphanohtml');
456 $public =
GETPOST(
"public",
'alphanohtml');
458 $userid =
GETPOST(
"userid",
'int');
459 $socid =
GETPOST(
"socid",
'int');
461 $object->civility_id = $civility_id;
462 $object->firstname = $firstname;
463 $object->lastname = $lastname;
464 $object->gender = $gender;
465 $object->societe = $societe;
466 $object->company = $societe;
467 $object->address = $address;
469 $object->town = $town;
470 $object->state_id = $state_id;
471 $object->country_id = $country_id;
472 $object->phone = $phone;
473 $object->phone_perso = $phone_perso;
474 $object->phone_mobile = $phone_mobile;
475 $object->socialnetworks = array();
476 if (!empty($conf->socialnetworks->enabled)) {
477 foreach ($socialnetworks as $key => $value) {
479 $object->socialnetworks[$key] =
GETPOST(
"member_".$key,
'alphanohtml');
489 $object->email = $email;
491 $object->login = $login;
492 $object->pass = $pass;
493 $object->birth = $birthdate;
494 $object->photo = $photo;
495 $object->typeid = $typeid;
497 $object->morphy = $morphy;
498 $object->user_id = $userid;
499 $object->socid = $socid;
500 $object->public = $public;
503 $ret = $extrafields->setOptionalsFromPost(
null, $object);
509 if (empty($morphy) || $morphy ==
"-1") {
511 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"MemberNature")),
null,
'errors');
514 if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
517 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Login")),
null,
'errors');
519 $sql =
"SELECT login FROM ".MAIN_DB_PREFIX.
"adherent WHERE login='".$db->escape($login).
"'";
520 $result = $db->query($sql);
522 $num = $db->num_rows($result);
526 $langs->load(
"errors");
527 setEventMessages($langs->trans(
"ErrorLoginAlreadyExists", $login),
null,
'errors');
532 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Password")),
null,
'errors');
535 if ($morphy ==
'mor' && empty($societe)) {
537 $langs->load(
"errors");
538 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Company")),
null,
'errors');
540 if ($morphy !=
'mor' && empty($lastname)) {
542 $langs->load(
"errors");
543 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Lastname")),
null,
'errors');
545 if ($morphy !=
'mor' && (!isset($firstname) || $firstname ==
'')) {
547 $langs->load(
"errors");
548 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Firstname")),
null,
'errors');
550 if (!($typeid > 0)) {
552 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Type")),
null,
'errors');
554 if (!empty($conf->global->ADHERENT_MAIL_REQUIRED) && !isValidEMail($email)) {
556 $langs->load(
"errors");
559 if (!empty($object->url) && !
isValidUrl($object->url)) {
560 $langs->load(
"errors");
564 if (isset($public)) {
572 $result = $object->create($user);
575 $memcats =
GETPOST(
'memcats',
'array');
576 $object->setCategories($memcats);
579 $rowid = $object->id;
584 if ($object->error) {
591 if (!empty($conf->global->ADHERENT_DEFAULT_CREATE_THIRDPARTY)) {
597 $fullname = $object->getFullName($langs);
599 if ($object->morphy ==
'mor') {
600 $companyname = $object->company;
601 if (!empty($fullname)) {
602 $companyalias = $fullname;
605 $companyname = $fullname;
606 if (!empty($object->company)) {
607 $companyalias = $object->company;
611 $result = $company->create_from_member($object, $companyname, $companyalias);
614 $langs->load(
"errors");
623 $action = ($result < 0 || !$error) ?
'' :
'create';
626 if ($user->rights->adherent->supprimer && $action ==
'confirm_delete' && $confirm ==
'yes') {
627 $result = $object->delete($id, $user);
629 if (!empty($backtopage)) {
630 header(
"Location: ".$backtopage);
633 header(
"Location: list.php");
641 if ($user->rights->adherent->creer && $action ==
'confirm_valid' && $confirm ==
'yes') {
647 $adht->fetch($object->typeid);
649 $result = $object->validate($user);
651 if ($result >= 0 && !count($object->errors)) {
653 if ($object->email &&
GETPOST(
"send_mail")) {
658 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
662 $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
664 $outputlangs->loadLangs(array(
"main",
"members",
"companies",
"install",
"other"));
666 $arraydefaultmessage =
null;
667 $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION;
669 if (!empty($labeltouse)) {
670 $arraydefaultmessage = $formmail->getEMailTemplate($db,
'member', $user, $outputlangs, 0, 1, $labeltouse);
673 if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
674 $subject = $arraydefaultmessage->topic;
675 $msg = $arraydefaultmessage->content;
678 if (empty($labeltouse) || (
int) $labeltouse === -1) {
688 $moreinheader =
'X-Dolibarr-Info: send_an_email by adherents/card.php'.
"\r\n";
690 $result = $object->send_an_email($texttosend, $subjecttosend, array(), array(), array(),
"",
"", 0, -1,
'', $moreinheader);
699 if ($object->error) {
714 if ($user->rights->adherent->supprimer && $action ==
'confirm_resiliate') {
717 if ($confirm ==
'yes') {
719 $adht->fetch($object->typeid);
721 $result = $object->resiliate($user);
723 if ($result >= 0 && !count($object->errors)) {
724 if ($object->email &&
GETPOST(
"send_mail")) {
729 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
733 $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
735 $outputlangs->loadLangs(array(
"main",
"members",
"companies",
"install",
"other"));
737 $arraydefaultmessage =
null;
738 $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_CANCELATION;
740 if (!empty($labeltouse)) {
741 $arraydefaultmessage = $formmail->getEMailTemplate($db,
'member', $user, $outputlangs, 0, 1, $labeltouse);
744 if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
745 $subject = $arraydefaultmessage->topic;
746 $msg = $arraydefaultmessage->content;
749 if (empty($labeltouse) || (
int) $labeltouse === -1) {
759 $moreinheader =
'X-Dolibarr-Info: send_an_email by adherents/card.php'.
"\r\n";
761 $result = $object->send_an_email($texttosend, $subjecttosend, array(), array(), array(),
"",
"", 0, -1,
'', $moreinheader);
771 if ($object->error) {
779 if (!empty($backtopage) && !$error) {
780 header(
"Location: ".$backtopage);
785 if ($user->rights->adherent->supprimer && $action ==
'confirm_exclude') {
788 if ($confirm ==
'yes') {
790 $adht->fetch($object->typeid);
792 $result = $object->exclude($user);
794 if ($result >= 0 && !count($object->errors)) {
795 if ($object->email &&
GETPOST(
"send_mail")) {
800 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
804 $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
806 $outputlangs->loadLangs(array(
"main",
"members",
"companies",
"install",
"other"));
808 $arraydefaultmessage =
null;
809 $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_EXCLUSION;
811 if (!empty($labeltouse)) {
812 $arraydefaultmessage = $formmail->getEMailTemplate($db,
'member', $user, $outputlangs, 0, 1, $labeltouse);
815 if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
816 $subject = $arraydefaultmessage->topic;
817 $msg = $arraydefaultmessage->content;
820 if (empty($labeltouse) || (
int) $labeltouse === -1) {
830 $moreinheader =
'X-Dolibarr-Info: send_an_email by adherents/card.php'.
"\r\n";
832 $result = $object->send_an_email($texttosend, $subjecttosend, array(), array(), array(),
"",
"", 0, -1,
'', $moreinheader);
842 if ($object->error) {
850 if (!empty($backtopage) && !$error) {
851 header(
"Location: ".$backtopage);
857 if ($user->rights->adherent->supprimer && $action ==
'confirm_del_spip' && $confirm ==
'yes') {
858 if (!count($object->errors)) {
859 if (!$mailmanspip->del_to_spip($object)) {
860 setEventMessages($langs->trans(
'DeleteIntoSpipError').
': '.$mailmanspip->error,
null,
'errors');
865 if ($user->rights->adherent->creer && $action ==
'confirm_add_spip' && $confirm ==
'yes') {
866 if (!count($object->errors)) {
867 if (!$mailmanspip->add_to_spip($object)) {
868 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->rights->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';
898 $title = $langs->trans(
"Member").
" - ".$langs->trans(
"Card");
899 $help_url =
'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder';
902 $countrynotdefined = $langs->trans(
"ErrorSetACountryFirst").
' ('.$langs->trans(
"SeeAbove").
')';
904 if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
908 if (empty($object->error) && $id) {
910 $result = $object->fetch($id);
915 $objcanvas->assign_values($action, $object->id, $object->ref);
916 $objcanvas->display_canvas($action);
923 if ($action ==
'create') {
924 $object->canvas = $canvas;
925 $object->state_id =
GETPOST(
'state_id',
'int');
928 $object->country_id =
GETPOST(
'country_id',
'int') ?
GETPOST(
'country_id',
'int') : $mysoc->country_id;
929 if ($object->country_id) {
930 $tmparray =
getCountry($object->country_id,
'all');
931 $object->country_code = $tmparray[
'code'];
932 $object->country = $tmparray[
'label'];
936 if (!empty($socid)) {
941 if (!($soc->id > 0)) {
942 $langs->load(
"errors");
943 print($langs->trans(
'ErrorRecordNotFound'));
952 if ($conf->use_javascript_ajax) {
953 print
"\n".
'<script type="text/javascript">'.
"\n";
954 print
'jQuery(document).ready(function () {
955 jQuery("#selectcountry_id").change(function() {
956 document.formsoc.action.value="create";
957 document.formsoc.submit();
959 function initfieldrequired() {
960 jQuery("#tdcompany").removeClass("fieldrequired");
961 jQuery("#tdlastname").removeClass("fieldrequired");
962 jQuery("#tdfirstname").removeClass("fieldrequired");
963 if (jQuery("#morphy").val() == \'mor\') {
964 jQuery("#tdcompany").addClass("fieldrequired");
966 if (jQuery("#morphy").val() == \'phy\') {
967 jQuery("#tdlastname").addClass("fieldrequired");
968 jQuery("#tdfirstname").addClass("fieldrequired");
971 jQuery("#morphy").change(function() {
976 print
'</script>'.
"\n";
979 print
'<form name="formsoc" action="'.$_SERVER[
"PHP_SELF"].
'" method="post" enctype="multipart/form-data">';
980 print
'<input type="hidden" name="token" value="'.newToken().
'">';
981 print
'<input type="hidden" name="action" value="add">';
982 print
'<input type="hidden" name="socid" value="'.$socid.
'">';
984 print
'<input type="hidden" name="backtopage" value="'.($backtopage !=
'1' ? $backtopage : $_SERVER[
"HTTP_REFERER"]).
'">';
989 print
'<table class="border centpercent">';
993 if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
994 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>';
998 if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
999 require_once DOL_DOCUMENT_ROOT.
'/core/lib/security2.lib.php';
1001 print
'<tr><td><span class="fieldrequired">'.$langs->trans(
"Password").
'</span></td><td>';
1002 print
'<input type="text" class="minwidth300" maxlength="50" name="password" value="'.dol_escape_htmltag($generated_password).
'">';
1007 print
'<tr><td class="fieldrequired">'.$langs->trans(
"MemberType").
'</td><td>';
1008 $listetype = $adht->liste_array(1);
1009 if (count($listetype)) {
1010 print
$form->selectarray(
"typeid", $listetype, (
GETPOST(
'typeid',
'int') ?
GETPOST(
'typeid',
'int') : $typeid), (count($listetype) > 1 ? 1 : 0), 0, 0,
'', 0, 0, 0,
'',
'', 1);
1012 print
'<span class="error">'.$langs->trans(
"NoTypeDefinedGoToSetup").
'</span>';
1017 $morphys[
"phy"] = $langs->trans(
"Physical");
1018 $morphys[
"mor"] = $langs->trans(
"Moral");
1019 print
'<tr><td class="fieldrequired">'.$langs->trans(
"MemberNature").
"</td><td>\n";
1020 print
$form->selectarray(
"morphy", $morphys, (
GETPOST(
'morphy',
'alpha') ?
GETPOST(
'morphy',
'alpha') : $object->morphy), 1, 0, 0,
'', 0, 0, 0,
'',
'', 1);
1024 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>';
1027 print
'<tr><td>'.$langs->trans(
"UserTitle").
'</td><td>';
1028 print $formcompany->select_civility(
GETPOST(
'civility_id',
'int') ?
GETPOST(
'civility_id',
'int') : $object->civility_id,
'civility_id',
'maxwidth150', 1).
'</td>';
1032 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>';
1036 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>';
1040 print
'<tr><td>'.$langs->trans(
"Gender").
'</td>';
1042 $arraygender = array(
'man'=>$langs->trans(
"Genderman"),
'woman'=>$langs->trans(
"Genderwoman"),
'other'=>$langs->trans(
"Genderother"));
1043 print
$form->selectarray(
'gender', $arraygender,
GETPOST(
'gender',
'alphanohtml'), 1, 0, 0,
'', 0, 0, 0,
'',
'', 1);
1047 print
'<tr><td>'.(!empty($conf->global->ADHERENT_MAIL_REQUIRED) ?
'<span class="fieldrequired">' :
'').$langs->trans(
"EMail").(!empty($conf->global->ADHERENT_MAIL_REQUIRED) ?
'</span>' :
'').
'</td>';
1048 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>';
1051 print
'<tr><td>'.$form->editfieldkey(
'Web',
'member_url',
'', $object, 0).
'</td>';
1052 print
'<td>'.img_picto(
'',
'globe').
' <input type="text" class="maxwidth500 widthcentpercentminusx" name="member_url" id="member_url" value="'.$object->url.
'"></td></tr>';
1055 print
'<tr><td class="tdtop">'.$langs->trans(
"Address").
'</td><td>';
1056 print
'<textarea name="address" wrap="soft" class="quatrevingtpercent" rows="2">'.(GETPOSTISSET(
'address') ?
GETPOST(
'address',
'alphanohtml') : $soc->address).
'</textarea>';
1060 print
'<tr><td>'.$langs->trans(
"Zip").
' / '.$langs->trans(
"Town").
'</td><td>';
1061 print $formcompany->select_ziptown((
GETPOSTISSET(
'zipcode') ?
GETPOST(
'zipcode',
'alphanohtml') : $soc->zip),
'zipcode', array(
'town',
'selectcountry_id',
'state_id'), 6);
1063 print $formcompany->select_ziptown((
GETPOSTISSET(
'town') ?
GETPOST(
'town',
'alphanohtml') : $soc->town),
'town', array(
'zipcode',
'selectcountry_id',
'state_id'));
1067 if (empty($soc->country_id)) {
1068 $soc->country_id = $mysoc->country_id;
1069 $soc->country_code = $mysoc->country_code;
1070 $soc->state_id = $mysoc->state_id;
1072 print
'<tr><td>'.$langs->trans(
'Country').
'</td><td>';
1073 print
img_picto(
'',
'country',
'class="pictofixedwidth"');
1074 print
$form->select_country(
GETPOSTISSET(
'country_id') ?
GETPOST(
'country_id',
'alpha') : $soc->country_id,
'country_id');
1076 print
info_admin($langs->trans(
"YouCanChangeValuesForThisListFromDictionarySetup"), 1);
1081 if (empty($conf->global->MEMBER_DISABLE_STATE)) {
1082 print
'<tr><td>'.$langs->trans(
'State').
'</td><td>';
1083 if ($soc->country_id) {
1084 print
img_picto(
'',
'state',
'class="pictofixedwidth"');
1085 print $formcompany->select_state(
GETPOSTISSET(
'state_id') ?
GETPOST(
'state_id',
'int') : $soc->state_id, $soc->country_code);
1087 print $countrynotdefined;
1093 print
'<tr><td>'.$langs->trans(
"PhonePro").
'</td>';
1094 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>';
1097 print
'<tr><td>'.$langs->trans(
"PhonePerso").
'</td>';
1098 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>';
1101 print
'<tr><td>'.$langs->trans(
"PhoneMobile").
'</td>';
1102 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>';
1104 if (!empty($conf->socialnetworks->enabled)) {
1105 foreach ($socialnetworks as $key => $value) {
1106 if (!$value[
'active']) {
1109 $val = (
GETPOSTISSET(
'member_'.$key) ?
GETPOST(
'member_'.$key,
'alpha') : (empty($object->socialnetworks[$key]) ?
'' : $object->socialnetworks[$key]));
1110 print
'<tr><td>'.$langs->trans($value[
'label']).
'</td><td><input type="text" name="member_'.$key.
'" size="40" value="'.$val.
'"></td></tr>';
1115 print
"<tr><td>".$langs->trans(
"DateOfBirth").
"</td><td>\n";
1116 print
$form->selectDate(($object->birth ? $object->birth : -1),
'birth',
'',
'', 1,
'formsoc');
1117 print
"</td></tr>\n";
1120 print
"<tr><td>".$langs->trans(
"Public").
"</td><td>\n";
1121 print
$form->selectyesno(
"public", $object->public, 1);
1122 print
"</td></tr>\n";
1125 if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) {
1126 print
'<tr><td>'.$form->editfieldkey(
"Categories",
'memcats',
'', $object, 0).
'</td><td>';
1127 $cate_arbo =
$form->select_all_categories(Categorie::TYPE_MEMBER,
null,
'parent',
null,
null, 1);
1128 print
img_picto(
'',
'category').$form->multiselectarray(
'memcats', $cate_arbo,
GETPOST(
'memcats',
'array'),
null,
null,
'quatrevingtpercent widthcentpercentminusx', 0, 0);
1133 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_add.tpl.php';
1140 print
$form->buttonsSaveCancel(
"AddMember");
1146 if ($action ==
'edit') {
1147 $res = $object->fetch($id);
1151 $res = $object->fetch_optionals();
1157 $adht->fetch($object->typeid);
1160 $country =
GETPOST(
'country',
'int');
1161 if (!empty($country) || $object->country_id) {
1162 $sql =
"SELECT rowid, code, label from ".MAIN_DB_PREFIX.
"c_country where rowid = ".(!empty($country) ? $country : $object->country_id);
1163 $resql = $db->query($sql);
1165 $obj = $db->fetch_object(
$resql);
1169 $object->country_id = $obj->rowid;
1170 $object->country_code = $obj->code;
1171 $object->country = $langs->trans(
"Country".$obj->code) ? $langs->trans(
"Country".$obj->code) : $obj->label;
1177 if ($conf->use_javascript_ajax) {
1178 print
"\n".
'<script type="text/javascript">';
1179 print
'jQuery(document).ready(function () {
1180 jQuery("#selectcountry_id").change(function() {
1181 document.formsoc.action.value="edit";
1182 document.formsoc.submit();
1184 function initfieldrequired() {
1185 jQuery("#tdcompany").removeClass("fieldrequired");
1186 jQuery("#tdlastname").removeClass("fieldrequired");
1187 jQuery("#tdfirstname").removeClass("fieldrequired");
1188 if (jQuery("#morphy").val() == \'mor\') {
1189 jQuery("#tdcompany").addClass("fieldrequired");
1191 if (jQuery("#morphy").val() == \'phy\') {
1192 jQuery("#tdlastname").addClass("fieldrequired");
1193 jQuery("#tdfirstname").addClass("fieldrequired");
1196 jQuery("#morphy").change(function() {
1197 initfieldrequired();
1199 initfieldrequired();
1201 print
'</script>'.
"\n";
1204 print
'<form name="formsoc" action="'.$_SERVER[
"PHP_SELF"].
'" method="post" enctype="multipart/form-data">';
1205 print
'<input type="hidden" name="token" value="'.newToken().
'" />';
1206 print
'<input type="hidden" name="action" value="update" />';
1207 print
'<input type="hidden" name="rowid" value="'.$id.
'" />';
1208 print
'<input type="hidden" name="statut" value="'.$object->statut.
'" />';
1210 print
'<input type="hidden" name="backtopage" value="'.($backtopage !=
'1' ? $backtopage : $_SERVER[
"HTTP_REFERER"]).
'">';
1215 print
'<table class="border centpercent">';
1218 print
'<tr><td class="titlefieldcreate">'.$langs->trans(
"Ref").
'</td><td class="valeur">'.$object->ref.
'</td></tr>';
1221 if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
1222 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>';
1226 if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
1227 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",
'none', 2) : $object->pass).
'"></td></tr>';
1231 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Type").
'</td><td>';
1232 if ($user->rights->adherent->creer) {
1233 print
$form->selectarray(
"typeid", $adht->liste_array(), (
GETPOSTISSET(
"typeid") ?
GETPOST(
"typeid",
'int') : $object->typeid), 0, 0, 0,
'', 0, 0, 0,
'',
'', 1);
1235 print $adht->getNomUrl(1);
1236 print
'<input type="hidden" name="typeid" value="'.$object->typeid.
'">';
1241 $morphys[
"phy"] = $langs->trans(
"Physical");
1242 $morphys[
"mor"] = $langs->trans(
"Moral");
1243 print
'<tr><td><span class="fieldrequired">'.$langs->trans(
"MemberNature").
'</span></td><td>';
1244 print
$form->selectarray(
"morphy", $morphys, (
GETPOSTISSET(
"morphy") ?
GETPOST(
"morphy",
'alpha') : $object->morphy), 0, 0, 0,
'', 0, 0, 0,
'',
'', 1);
1248 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>';
1251 print
'<tr><td>'.$langs->trans(
"UserTitle").
'</td><td>';
1252 print $formcompany->select_civility(
GETPOSTISSET(
"civility_id") ?
GETPOST(
"civility_id",
'alpha') : $object->civility_id,
'civility_id',
'maxwidth150', 1);
1257 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>';
1261 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>';
1265 print
'<tr><td>'.$langs->trans(
"Gender").
'</td>';
1267 $arraygender = array(
'man'=>$langs->trans(
"Genderman"),
'woman'=>$langs->trans(
"Genderwoman"),
'other'=>$langs->trans(
"Genderother"));
1268 print
$form->selectarray(
'gender', $arraygender,
GETPOSTISSET(
'gender') ?
GETPOST(
'gender',
'alphanohtml') : $object->gender, 1, 0, 0,
'', 0, 0, 0,
'',
'', 1);
1272 print
'<tr><td>'.$langs->trans(
"Photo").
'</td>';
1273 print
'<td class="hideonsmartphone" valign="middle">';
1274 print
$form->showphoto(
'memberphoto', $object).
"\n";
1275 if ($caneditfieldmember) {
1276 if ($object->photo) {
1279 print
'<table class="nobordernopadding">';
1280 if ($object->photo) {
1281 print
'<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> '.$langs->trans(
"Delete").
'<br><br></td></tr>';
1283 print
'<tr><td>'.$langs->trans(
"PhotoFile").
'</td></tr>';
1286 $maxmin = $maxfilesizearray[
'maxmin'];
1288 print
'<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).
'">';
1290 print
'<input type="file" class="flat" name="photo" id="photoinput">';
1297 print
'<tr><td>'.(getDolGlobalString(
"ADHERENT_MAIL_REQUIRED") ?
'<span class="fieldrequired">' :
'').$langs->trans(
"EMail").(getDolGlobalString(
"ADHERENT_MAIL_REQUIRED") ?
'</span>' :
'').
'</td>';
1298 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>';
1301 print
'<tr><td>'.$form->editfieldkey(
'Web',
'member_url',
GETPOST(
'member_url',
'alpha'), $object, 0).
'</td>';
1302 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>';
1305 print
'<tr><td>'.$langs->trans(
"Address").
'</td><td>';
1306 print
'<textarea name="address" wrap="soft" class="quatrevingtpercent" rows="'.ROWS_2.
'">'.(
GETPOSTISSET(
"address") ?
GETPOST(
"address",
'alphanohtml', 2) : $object->address).
'</textarea>';
1310 print
'<tr><td>'.$langs->trans(
"Zip").
' / '.$langs->trans(
"Town").
'</td><td>';
1311 print $formcompany->select_ziptown((
GETPOSTISSET(
"zipcode") ?
GETPOST(
"zipcode",
'alphanohtml', 2) : $object->zip),
'zipcode', array(
'town',
'selectcountry_id',
'state_id'), 6);
1313 print $formcompany->select_ziptown((
GETPOSTISSET(
"town") ?
GETPOST(
"town",
'alphanohtml', 2) : $object->town),
'town', array(
'zipcode',
'selectcountry_id',
'state_id'));
1318 print
'<tr><td>'.$langs->trans(
'Country').
'</td><td>';
1319 print
img_picto(
'',
'country',
'class="pictofixedwidth"');
1320 print
$form->select_country(
GETPOSTISSET(
"country_id") ?
GETPOST(
"country_id",
"alpha") : $object->country_id,
'country_id');
1322 print
info_admin($langs->trans(
"YouCanChangeValuesForThisListFromDictionarySetup"), 1);
1327 if (empty($conf->global->MEMBER_DISABLE_STATE)) {
1328 print
'<tr><td>'.$langs->trans(
'State').
'</td><td>';
1329 print
img_picto(
'',
'state',
'class="pictofixedwidth"');
1330 print $formcompany->select_state($object->state_id,
GETPOSTISSET(
"country_id") ?
GETPOST(
"country_id",
"alpha") : $object->country_id);
1335 print
'<tr><td>'.$langs->trans(
"PhonePro").
'</td>';
1336 print
'<td>'.img_picto(
'',
'object_phoning',
'class="pictofixedwidth"').
'<input type="text" name="phone" value="'.(
GETPOSTISSET(
"phone") ?
GETPOST(
"phone") : $object->phone).
'"></td></tr>';
1339 print
'<tr><td>'.$langs->trans(
"PhonePerso").
'</td>';
1340 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>';
1343 print
'<tr><td>'.$langs->trans(
"PhoneMobile").
'</td>';
1344 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>';
1346 if (!empty($conf->socialnetworks->enabled)) {
1347 foreach ($socialnetworks as $key => $value) {
1348 if (!$value[
'active']) {
1351 print
'<tr><td>'.$langs->trans($value[
'label']).
'</td><td><input type="text" name="'.$key.
'" class="minwidth100" value="'.(
GETPOSTISSET($key) ?
GETPOST($key,
'alphanohtml') : $object->socialnetworks[$key]).
'"></td></tr>';
1356 print
"<tr><td>".$langs->trans(
"DateOfBirth").
"</td><td>\n";
1357 print
$form->selectDate(($object->birth ? $object->birth : -1),
'birth',
'',
'', 1,
'formsoc');
1358 print
"</td></tr>\n";
1361 print
"<tr><td>".$langs->trans(
"Public").
"</td><td>\n";
1362 print
$form->selectyesno(
"public", (
GETPOSTISSET(
"public") ?
GETPOST(
"public",
'alphanohtml', 2) : $object->public), 1);
1363 print
"</td></tr>\n";
1366 if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) {
1367 print
'<tr><td>'.$form->editfieldkey(
"Categories",
'memcats',
'', $object, 0).
'</td>';
1369 $cate_arbo =
$form->select_all_categories(Categorie::TYPE_MEMBER,
null,
null,
null,
null, 1);
1371 $cats = $c->containing($object->id, Categorie::TYPE_MEMBER);
1372 $arrayselected = array();
1373 if (is_array($cats)) {
1374 foreach ($cats as $cat) {
1375 $arrayselected[] = $cat->id;
1378 print
$form->multiselectarray(
'memcats', $cate_arbo, $arrayselected,
'', 0,
'', 0,
'100%');
1383 if (!empty($conf->societe->enabled)) {
1384 print
'<tr><td>'.$langs->trans(
"LinkedToDolibarrThirdParty").
'</td><td colspan="2" class="valeur">';
1385 if ($object->socid) {
1387 $result = $company->fetch($object->socid);
1388 print $company->getNomUrl(1);
1390 print $langs->trans(
"NoThirdPartyAssociatedToMember");
1396 print
'<tr><td>'.$langs->trans(
"LinkedToDolibarrUser").
'</td><td colspan="2" class="valeur">';
1397 if ($object->user_id) {
1398 $form->form_users($_SERVER[
'PHP_SELF'].
'?rowid='.$object->id, $object->user_id,
'none');
1400 print $langs->trans(
"NoDolibarrAccess");
1405 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_add.tpl.php';
1410 print
$form->buttonsSaveCancel(
"Save",
'');
1416 if ($id > 0 && $action !=
'edit') {
1417 $res = $object->fetch($id);
1421 $res = $object->fetch_optionals();
1427 $res = $adht->fetch($object->typeid);
1441 if ($action ==
'create_user') {
1443 if (empty($login)) {
1445 include_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
1448 if (empty($login)) {
1449 $login = strtolower(substr($object->firstname, 0, 4)).strtolower(substr($object->lastname, 0, 4));
1453 $formquestion = array(
1454 array(
'label' => $langs->trans(
"LoginToCreate"),
'type' =>
'text',
'name' =>
'login',
'value' => $login)
1456 if (!empty($conf->societe->enabled) && $object->socid > 0) {
1457 $object->fetch_thirdparty();
1458 $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")));
1461 if (!empty($conf->societe->enabled) && $object->socid <= 0) {
1462 $text .= $langs->trans(
"UserWillBeInternalUser").
'<br>';
1464 $text .= $langs->trans(
"ConfirmCreateLogin");
1465 print
$form->formconfirm($_SERVER[
"PHP_SELF"].
"?rowid=".$object->id, $langs->trans(
"CreateDolibarrLogin"), $text,
"confirm_create_user", $formquestion,
'yes');
1469 if ($action ==
'create_thirdparty') {
1471 $fullname = $object->getFullName($langs);
1473 if ($object->morphy ==
'mor') {
1474 $companyname = $object->company;
1475 if (!empty($fullname)) {
1476 $companyalias = $fullname;
1479 $companyname = $fullname;
1480 if (!empty($object->company)) {
1481 $companyalias = $object->company;
1486 $formquestion = array(
1487 array(
'label' => $langs->trans(
"NameToCreate"),
'type' =>
'text',
'name' =>
'companyname',
'value' => $companyname,
'morecss' =>
'minwidth300',
'moreattr' =>
'maxlength="128"'),
1488 array(
'label' => $langs->trans(
"AliasNames"),
'type' =>
'text',
'name' =>
'companyalias',
'value' => $companyalias,
'morecss' =>
'minwidth300',
'moreattr' =>
'maxlength="128"')
1491 print
$form->formconfirm($_SERVER[
"PHP_SELF"].
"?rowid=".$object->id, $langs->trans(
"CreateDolibarrThirdParty"), $langs->trans(
"ConfirmCreateThirdParty"),
"confirm_create_thirdparty", $formquestion,
'yes');
1495 if ($action ==
'valid') {
1496 $langs->load(
"mails");
1499 $adht->fetch($object->typeid);
1505 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
1508 $outputlangs =
new Translate(
'', $conf);
1509 $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
1511 $outputlangs->loadLangs(array(
"main",
"members",
"companies",
"install",
"other"));
1513 $arraydefaultmessage =
null;
1516 if (!empty($labeltouse)) {
1517 $arraydefaultmessage = $formmail->getEMailTemplate($db,
'member', $user, $outputlangs, 0, 1, $labeltouse);
1520 if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
1521 $subject = $arraydefaultmessage->topic;
1522 $msg = $arraydefaultmessage->content;
1530 $tmp = $langs->trans(
"SendingAnEMailToMember");
1531 $tmp .=
'<br>'.$langs->trans(
"MailFrom").
': <b>'.$conf->global->ADHERENT_MAIL_FROM.
'</b>, ';
1532 $tmp .=
'<br>'.$langs->trans(
"MailRecipient").
': <b>'.$object->email.
'</b>';
1534 $helpcontent .=
'<b>'.$langs->trans(
"MailFrom").
'</b>: '.$conf->global->ADHERENT_MAIL_FROM.
'<br>'.
"\n";
1535 $helpcontent .=
'<b>'.$langs->trans(
"MailRecipient").
'</b>: '.$object->email.
'<br>'.
"\n";
1536 $helpcontent .=
'<b>'.$langs->trans(
"Subject").
'</b>:<br>'.
"\n";
1537 $helpcontent .= $subjecttosend.
"\n";
1538 $helpcontent .=
"<br>";
1539 $helpcontent .=
'<b>'.$langs->trans(
"Content").
'</b>:<br>';
1541 $label =
$form->textwithpicto($tmp, $helpcontent, 1,
'help');
1544 $formquestion = array();
1545 if ($object->email) {
1546 $formquestion[] = array(
'type' =>
'checkbox',
'name' =>
'send_mail',
'label' => $label,
'value' => (
getDolGlobalString(
'ADHERENT_DEFAULT_SENDINFOBYMAIL') ?
true :
false));
1548 if (!empty($conf->mailman->enabled) && !empty($conf->global->ADHERENT_USE_MAILMAN)) {
1549 $formquestion[] = array(
'type'=>
'other',
'label'=>$langs->transnoentitiesnoconv(
"SynchroMailManEnabled"),
'value'=>
'');
1551 if (!empty($conf->mailman->enabled) && !empty($conf->global->ADHERENT_USE_SPIP)) {
1552 $formquestion[] = array(
'type'=>
'other',
'label'=>$langs->transnoentitiesnoconv(
"SynchroSpipEnabled"),
'value'=>
'');
1554 print
$form->formconfirm(
"card.php?rowid=".$id, $langs->trans(
"ValidateMember"), $langs->trans(
"ConfirmValidateMember"),
"confirm_valid", $formquestion,
'yes', 1, 220);
1558 if ($action ==
'resiliate') {
1559 $langs->load(
"mails");
1562 $adht->fetch($object->typeid);
1568 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
1571 $outputlangs =
new Translate(
'', $conf);
1572 $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
1574 $outputlangs->loadLangs(array(
"main",
"members"));
1576 $arraydefaultmessage =
null;
1579 if (!empty($labeltouse)) {
1580 $arraydefaultmessage = $formmail->getEMailTemplate($db,
'member', $user, $outputlangs, 0, 1, $labeltouse);
1583 if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
1584 $subject = $arraydefaultmessage->topic;
1585 $msg = $arraydefaultmessage->content;
1593 $tmp = $langs->trans(
"SendingAnEMailToMember");
1594 $tmp .=
'<br>('.$langs->trans(
"MailFrom").
': <b>'.$conf->global->ADHERENT_MAIL_FROM.
'</b>, ';
1595 $tmp .= $langs->trans(
"MailRecipient").
': <b>'.$object->email.
'</b>)';
1597 $helpcontent .=
'<b>'.$langs->trans(
"MailFrom").
'</b>: '.$conf->global->ADHERENT_MAIL_FROM.
'<br>'.
"\n";
1598 $helpcontent .=
'<b>'.$langs->trans(
"MailRecipient").
'</b>: '.$object->email.
'<br>'.
"\n";
1599 $helpcontent .=
'<b>'.$langs->trans(
"Subject").
'</b>:<br>'.
"\n";
1600 $helpcontent .= $subjecttosend.
"\n";
1601 $helpcontent .=
"<br>";
1602 $helpcontent .=
'<b>'.$langs->trans(
"Content").
'</b>:<br>';
1604 $label =
$form->textwithpicto($tmp, $helpcontent, 1,
'help');
1607 $formquestion = array();
1608 if ($object->email) {
1609 $formquestion[] = array(
'type' =>
'checkbox',
'name' =>
'send_mail',
'label' => $label,
'value' => (!empty($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL) ?
'true' :
'false'));
1612 $formquestion[] = array(
'type' =>
'hidden',
'name' =>
'backtopage',
'value' => ($backtopage !=
'1' ? $backtopage : $_SERVER[
"HTTP_REFERER"]));
1614 print
$form->formconfirm(
"card.php?rowid=".$id, $langs->trans(
"ResiliateMember"), $langs->trans(
"ConfirmResiliateMember"),
"confirm_resiliate", $formquestion,
'no', 1, 240);
1618 if ($action ==
'exclude') {
1619 $langs->load(
"mails");
1622 $adht->fetch($object->typeid);
1628 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
1631 $outputlangs =
new Translate(
'', $conf);
1632 $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
1634 $outputlangs->loadLangs(array(
"main",
"members"));
1636 $arraydefaultmessage =
null;
1637 $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_EXCLUSION;
1639 if (!empty($labeltouse)) {
1640 $arraydefaultmessage = $formmail->getEMailTemplate($db,
'member', $user, $outputlangs, 0, 1, $labeltouse);
1643 if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
1644 $subject = $arraydefaultmessage->topic;
1645 $msg = $arraydefaultmessage->content;
1653 $tmp = $langs->trans(
"SendingAnEMailToMember");
1654 $tmp .=
'<br>('.$langs->trans(
"MailFrom").
': <b>'.$conf->global->ADHERENT_MAIL_FROM.
'</b>, ';
1655 $tmp .= $langs->trans(
"MailRecipient").
': <b>'.$object->email.
'</b>)';
1657 $helpcontent .=
'<b>'.$langs->trans(
"MailFrom").
'</b>: '.$conf->global->ADHERENT_MAIL_FROM.
'<br>'.
"\n";
1658 $helpcontent .=
'<b>'.$langs->trans(
"MailRecipient").
'</b>: '.$object->email.
'<br>'.
"\n";
1659 $helpcontent .=
'<b>'.$langs->trans(
"Subject").
'</b>:<br>'.
"\n";
1660 $helpcontent .= $subjecttosend.
"\n";
1661 $helpcontent .=
"<br>";
1662 $helpcontent .=
'<b>'.$langs->trans(
"Content").
'</b>:<br>';
1664 $label =
$form->textwithpicto($tmp, $helpcontent, 1,
'help');
1667 $formquestion = array();
1668 if ($object->email) {
1669 $formquestion[] = array(
'type' =>
'checkbox',
'name' =>
'send_mail',
'label' => $label,
'value' => (!empty($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL) ?
'true' :
'false'));
1672 $formquestion[] = array(
'type' =>
'hidden',
'name' =>
'backtopage',
'value' => ($backtopage !=
'1' ? $backtopage : $_SERVER[
"HTTP_REFERER"]));
1674 print
$form->formconfirm(
"card.php?rowid=".$id, $langs->trans(
"ExcludeMember"), $langs->trans(
"ConfirmExcludeMember"),
"confirm_exclude", $formquestion,
'no', 1, 240);
1678 if ($action ==
'delete') {
1679 $formquestion = array();
1681 $formquestion[] = array(
'type' =>
'hidden',
'name' =>
'backtopage',
'value' => ($backtopage !=
'1' ? $backtopage : $_SERVER[
"HTTP_REFERER"]));
1683 print
$form->formconfirm(
"card.php?rowid=".$id, $langs->trans(
"DeleteMember"), $langs->trans(
"ConfirmDeleteMember"),
"confirm_delete", $formquestion,
'no', 1);
1687 if ($action ==
'add_spip') {
1688 print
$form->formconfirm(
"card.php?rowid=".$id, $langs->trans(
'AddIntoSpip'), $langs->trans(
'AddIntoSpipConfirmation'),
'confirm_add_spip');
1691 if ($action ==
'del_spip') {
1692 print
$form->formconfirm(
"card.php?rowid=$id", $langs->trans(
'DeleteIntoSpip'), $langs->trans(
'DeleteIntoSpipConfirmation'),
'confirm_del_spip');
1696 if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
1699 if (!empty($conf->societe->enabled)) {
1703 $linkback =
'<a href="'.DOL_URL_ROOT.
'/adherents/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
1705 $morehtmlref =
'<a href="'.DOL_URL_ROOT.
'/adherents/vcard.php?id='.$object->id.
'" class="refid">';
1706 $morehtmlref .=
img_picto($langs->trans(
"Download").
' '.$langs->trans(
"VCard"),
'vcard.png',
'class="valignmiddle marginleftonly paddingrightonly"');
1707 $morehtmlref .=
'</a>';
1710 dol_banner_tab($object,
'rowid', $linkback, 1,
'rowid',
'ref', $morehtmlref);
1712 print
'<div class="fichecenter">';
1713 print
'<div class="fichehalfleft">';
1715 print
'<div class="underbanner clearboth"></div>';
1716 print
'<table class="border tableforfield centpercent">';
1719 if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
1720 print
'<tr><td class="titlefield">'.$langs->trans(
"Login").
' / '.$langs->trans(
"Id").
'</td><td class="valeur">'.
dol_escape_htmltag($object->login).
'</td></tr>';
1724 print
'<tr><td class="titlefield">'.$langs->trans(
"Type").
'</td><td class="valeur">'.$adht->getNomUrl(1).
"</td></tr>\n";
1727 print
'<tr><td>'.$langs->trans(
"MemberNature").
'</td><td class="valeur" >'.$object->getmorphylib().
'</td>';
1731 print
'<tr><td>'.$langs->trans(
"Company").
'</td><td class="valeur">'.
dol_escape_htmltag($object->company).
'</td></tr>';
1734 print
'<tr><td>'.$langs->trans(
"UserTitle").
'</td><td class="valeur">'.$object->getCivilityLabel().
'</td>';
1738 if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
1739 print
'<tr><td>'.$langs->trans(
"Password").
'</td><td>';
1740 if ($object->pass) {
1741 print preg_replace(
'/./i',
'*', $object->pass);
1744 print
'<!-- '.$langs->trans(
"Crypted").
': '.$object->pass_indatabase_crypted.
' -->';
1746 print
'<span class="opacitymedium">'.$langs->trans(
"Hidden").
'</span>';
1748 if (!empty($object->pass_indatabase) && empty($object->user_id)) {
1749 $langs->load(
"errors");
1750 $htmltext = $langs->trans(
"WarningPasswordSetWithNoAccount");
1751 print
' '.$form->textwithpicto(
'', $htmltext, 1,
'warning');
1757 print
'<tr><td>'.$langs->trans(
"SubscriptionEndDate").
'</td><td class="valeur">';
1758 if ($object->datefin) {
1760 if ($object->hasDelay()) {
1761 print
" ".img_warning($langs->trans(
"Late"));
1764 if ($object->need_subscription == 0) {
1765 print $langs->trans(
"SubscriptionNotNeeded");
1766 } elseif (!$adht->subscription) {
1767 print $langs->trans(
"SubscriptionNotRecorded");
1769 print
" ".img_warning($langs->trans(
"Late"));
1772 print $langs->trans(
"SubscriptionNotReceived");
1774 print
" ".img_warning($langs->trans(
"Late"));
1784 print
'<div class="fichehalfright">';
1785 print
'<div class="underbanner clearboth"></div>';
1787 print
'<table class="border tableforfield centpercent">';
1790 if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) {
1791 print
'<tr><td>'.$langs->trans(
"Categories").
'</td>';
1792 print
'<td colspan="2">';
1793 print
$form->showCategories($object->id, Categorie::TYPE_MEMBER, 1);
1798 print
'<tr><td class="titlefield">'.$langs->trans(
"DateOfBirth").
'</td><td class="valeur">'.
dol_print_date($object->birth,
'day').
'</td></tr>';
1801 print
'<tr><td>'.$langs->trans(
"Public").
'</td><td class="valeur">'.
yn($object->public).
'</td></tr>';
1804 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
1807 if (!empty($conf->societe->enabled)) {
1809 $editenable = $user->rights->adherent->creer;
1810 print
$form->editfieldkey(
'LinkedToDolibarrThirdParty',
'thirdparty',
'', $object, $editenable);
1811 print
'</td><td colspan="2" class="valeur">';
1812 if ($action ==
'editthirdparty') {
1813 $htmlname =
'socid';
1814 print
'<form method="POST" action="'.$_SERVER[
'PHP_SELF'].
'" name="form'.$htmlname.
'">';
1815 print
'<input type="hidden" name="rowid" value="'.$object->id.
'">';
1816 print
'<input type="hidden" name="action" value="set'.$htmlname.
'">';
1817 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1818 print
'<table class="nobordernopadding">';
1820 print
$form->select_company($object->socid,
'socid',
'', 1);
1822 print
'<td class="left"><input type="submit" class="button button-edit" value="'.$langs->trans(
"Modify").
'"></td>';
1823 print
'</tr></table></form>';
1825 if ($object->socid) {
1827 $result = $company->fetch($object->socid);
1828 print $company->getNomUrl(1);
1831 $tmparray = $company->getOutstandingBills(
'customer');
1832 if (!empty($tmparray[
'refs'])) {
1833 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']).
')';
1838 print
'<span class="opacitymedium">'.$langs->trans(
"NoThirdPartyAssociatedToMember").
'</span>';
1846 $editenable = $user->rights->adherent->creer && $user->rights->user->user->creer;
1847 print
$form->editfieldkey(
'LinkedToDolibarrUser',
'login',
'', $object, $editenable);
1848 print
'</td><td colspan="2" class="valeur">';
1849 if ($action ==
'editlogin') {
1850 $form->form_users($_SERVER[
'PHP_SELF'].
'?rowid='.$object->id, $object->user_id,
'userid',
'');
1852 if ($object->user_id) {
1853 $linkeduser =
new User($db);
1854 $linkeduser->fetch($object->user_id);
1855 print $linkeduser->getNomUrl(-1);
1857 print
'<span class="opacitymedium">'.$langs->trans(
"NoDolibarrAccess").
'</span>';
1864 print
"</div></div>\n";
1865 print
'<div style="clear:both"></div>';
1874 print
'<div class="tabsAction">';
1877 $reshook = $hookmanager->executeHooks(
'addMoreActionsButtons',
$parameters, $object, $action);
1878 if (empty($reshook)) {
1879 if ($action !=
'editlogin' && $action !=
'editthirdparty') {
1881 if (empty($user->socid)) {
1883 print
'<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&action=presend&mode=init#formmailbeforetitle">'.$langs->trans(
'SendMail').
'</a>'.
"\n";
1902 if (!empty($user->rights->adherent->creer)) {
1903 print
'<a class="butAction" href="card.php?rowid='.$id.
'&action=edit&token='.
newToken().
'">'.$langs->trans(
"Modify").
'</a>'.
"\n";
1905 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"Modify").
'</span>'.
"\n";
1910 if ($user->rights->adherent->creer) {
1911 print
'<a class="butAction" href="card.php?rowid='.$id.
'&action=valid">'.$langs->trans(
"Validate").
'</a>'.
"\n";
1913 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"Validate").
'</span>'.
"\n";
1919 if ($user->rights->adherent->creer) {
1920 print
'<a class="butAction" href="card.php?rowid='.$id.
'&action=valid">'.$langs->trans(
"Reenable").
"</a>\n";
1922 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"Reenable").
'</span>'.
"\n";
1928 if ($user->rights->adherent->supprimer) {
1929 print
'<a class="butAction" href="card.php?rowid='.$id.
'&action=resiliate">'.$langs->trans(
"Resiliate").
"</a></span>\n";
1931 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"Resiliate").
'</span>'.
"\n";
1937 if ($user->rights->adherent->supprimer) {
1938 print
'<a class="butAction" href="card.php?rowid='.$id.
'&action=exclude">'.$langs->trans(
"Exclude").
"</a></span>\n";
1940 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"Exclude").
'</span>'.
"\n";
1945 if (!empty($conf->societe->enabled) && !$object->socid) {
1946 if ($user->rights->societe->creer) {
1948 print
'<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?rowid='.$object->id.
'&action=create_thirdparty" title="'.
dol_escape_htmltag($langs->trans(
"CreateDolibarrThirdPartyDesc")).
'">'.$langs->trans(
"CreateDolibarrThirdParty").
'</a>'.
"\n";
1950 print
'<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans(
"ValidateBefore")).
'">'.$langs->trans(
"CreateDolibarrThirdParty").
'</a>'.
"\n";
1953 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"CreateDolibarrThirdParty").
'</span>'.
"\n";
1958 if (!$user->socid && !$object->user_id) {
1959 if ($user->rights->user->user->creer) {
1961 print
'<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?rowid='.$object->id.
'&action=create_user" title="'.
dol_escape_htmltag($langs->trans(
"CreateDolibarrLoginDesc")).
'">'.$langs->trans(
"CreateDolibarrLogin").
'</a>'.
"\n";
1963 print
'<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans(
"ValidateBefore")).
'">'.$langs->trans(
"CreateDolibarrLogin").
'</a>'.
"\n";
1966 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"CreateDolibarrLogin").
'</span>'.
"\n";
1971 if (!empty($conf->mailmanspip->enabled) && !empty($conf->global->ADHERENT_USE_SPIP)) {
1972 $isinspip = $mailmanspip->is_in_spip($object);
1974 if ($isinspip == 1) {
1975 print
'<a class="butAction" href="card.php?rowid='.$object->id.
'&action=del_spip&token='.
newToken().
'">'.$langs->trans(
"DeleteIntoSpip").
'</a>'.
"\n";
1977 if ($isinspip == 0) {
1978 print
'<a class="butAction" href="card.php?rowid='.$object->id.
'&action=add_spip&token='.
newToken().
'">'.$langs->trans(
"AddIntoSpip").
'</a>'.
"\n";
1983 if ($user->rights->adherent->supprimer) {
1984 print
'<a class="butActionDelete" href="card.php?rowid='.$object->id.
'&action=delete&token='.
newToken().
'">'.$langs->trans(
"Delete").
'</a>'.
"\n";
1986 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"Delete").
'</span>'.
"\n";
1992 if ($isinspip == -1) {
1993 print
'<br><br><span class="error">'.$langs->trans(
'SPIPConnectionFailed').
': '.$mailmanspip->error.
'</span>';
1998 if (
GETPOST(
'modelselected')) {
1999 $action =
'presend';
2002 if ($action !=
'presend') {
2003 print
'<div class="fichecenter"><div class="fichehalfleft">';
2004 print
'<a name="builddoc"></a>';
2008 $filedir = $conf->adherent->dir_output.
'/'.
get_exdir(0, 0, 0, 1, $object,
'member');
2009 $urlsource = $_SERVER[
'PHP_SELF'].
'?id='.$object->id;
2010 $genallowed = $user->rights->adherent->lire;
2011 $delallowed = $user->rights->adherent->creer;
2013 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);
2014 $somethingshown = $formfile->numoffiles;
2028 $useonlinepayment = (!empty($conf->paypal->enabled) || !empty($conf->stripe->enabled) || !empty($conf->paybox->enabled));
2030 if ($useonlinepayment) {
2033 require_once DOL_DOCUMENT_ROOT.
'/core/lib/payments.lib.php';
2034 print showOnlinePaymentUrl(
'membersubscription', $object->ref);
2037 print
'</div><div class="fichehalfright">';
2041 $morehtmlcenter =
dolGetButtonTitle($langs->trans(
'SeeAll'),
'',
'fa fa-bars imgforviewmode', DOL_URL_ROOT.
'/adherents/agenda.php?id='.$object->id);
2044 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formactions.class.php';
2046 $somethingshown =
$formactions->showactions($object, $object->element, $socid, 1,
'listactions', $MAX,
'', $morehtmlcenter);
2048 print
'</div></div>';
2052 $modelmail =
'member';
2053 $defaulttopic =
'CardContent';
2054 $diroutput = $conf->adherent->dir_output;
2055 $trackid =
'mem'.$object->id;
2057 include DOL_DOCUMENT_ROOT.
'/core/tpl/card_presend.tpl.php';