34require
'../main.inc.php';
35require_once DOL_DOCUMENT_ROOT.
'/core/lib/member.lib.php';
36require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
37require_once DOL_DOCUMENT_ROOT.
'/core/lib/images.lib.php';
38require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
39require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
40require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent_type.class.php';
41require_once DOL_DOCUMENT_ROOT.
'/adherents/class/subscription.class.php';
42require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
43require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
44require_once DOL_DOCUMENT_ROOT.
'/core/class/extrafields.class.php';
45require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formadmin.class.php';
46require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
47require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
51$langs->loadLangs(array(
"companies",
"bills",
"members",
"users",
"other",
"paypal"));
55$action =
GETPOST(
'action',
'aZ09');
56$cancel =
GETPOST(
'cancel',
'alpha');
57$backtopage =
GETPOST(
'backtopage',
'alpha');
58$confirm =
GETPOST(
'confirm',
'alpha');
59$rowid =
GETPOST(
'rowid',
'int');
61$typeid =
GETPOST(
'typeid',
'int');
62$userid =
GETPOST(
'userid',
'int');
63$socid =
GETPOST(
'socid',
'int');
66if (isModEnabled(
'mailmanspip')) {
67 include_once DOL_DOCUMENT_ROOT.
'/mailmanspip/class/mailmanspip.class.php';
69 $langs->load(
'mailmanspip');
78$extrafields->fetch_name_optionals_label($object->table_element);
83$object->getCanvas($id);
84$canvas = $object->canvas ? $object->canvas :
GETPOST(
"canvas");
87 require_once DOL_DOCUMENT_ROOT.
'/core/class/canvas.class.php';
88 $objcanvas =
new Canvas($db, $action);
89 $objcanvas->getCanvas(
'adherent',
'membercard', $canvas);
93$hookmanager->initHooks(array(
'membercard',
'globalcard'));
96if ($id > 0 || !empty($ref)) {
98 $result = $object->fetch($id, $ref);
101 $canadduser = ($user->admin || $user->hasRight(
'user',
'user',
'creer'));
103 if ($object->user_id) {
105 $caneditfielduser = ((($user->id == $object->user_id) && $user->hasRight(
'user',
'self',
'creer'))
106 || (($user->id != $object->user_id) && $user->hasRight(
'user',
'user',
'creer')));
107 $caneditpassworduser = ((($user->id == $object->user_id) && $user->hasRight(
'user',
'self',
'password'))
108 || (($user->id != $object->user_id) && $user->hasRight(
'user',
'user',
'password')));
113$canaddmember = $user->hasRight(
'adherent',
'creer');
116 $caneditfieldmember = $user->hasRight(
'adherent',
'creer');
120$result =
restrictedArea($user,
'adherent', $object->id,
'',
'',
'socid',
'rowid', 0);
122if (!$user->hasRight(
'adherent',
'creer') && $action ==
'edit') {
126$linkofpubliclist = DOL_MAIN_URL_ROOT.
'/public/members/public_list.php'.((isModEnabled(
'multicompany')) ?
'?entity='.$conf->entity :
'');
133$parameters = array(
'id'=>$id,
'rowid'=>$id,
'objcanvas'=>$objcanvas,
'confirm'=>$confirm);
134$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
139if (empty($reshook)) {
140 $backurlforlist = DOL_URL_ROOT.
'/adherents/list.php';
142 if (empty($backtopage) || ($cancel && empty($id))) {
143 if (empty($backtopage) || ($cancel && strpos($backtopage,
'__ID__'))) {
144 if (empty($id) && (($action !=
'add' && $action !=
'create') || $cancel)) {
145 $backtopage = $backurlforlist;
147 $backtopage = DOL_URL_ROOT.
'/adherents/card.php?id='.((!empty($id) && $id > 0) ? $id :
'__ID__');
153 if (!empty($backtopageforcancel)) {
154 header(
"Location: ".$backtopageforcancel);
156 } elseif (!empty($backtopage)) {
157 header(
"Location: ".$backtopage);
163 if ($action ==
'setuserid' && ($user->hasRight(
'user',
'self',
'creer') || $user->hasRight(
'user',
'user',
'creer'))) {
165 if (!$user->hasRight(
'user',
'user',
'creer')) {
166 if ($userid != $user->id && $userid != $object->user_id) {
168 setEventMessages($langs->trans(
"ErrorUserPermissionAllowsToLinksToItselfOnly"),
null,
'errors');
173 if ($userid != $object->user_id) {
174 $result = $object->setUserId($userid);
183 if ($action ==
'setsocid') {
186 if ($socid != $object->socid) {
187 $sql =
"SELECT rowid FROM ".MAIN_DB_PREFIX.
"adherent";
188 $sql .=
" WHERE socid = ".((int) $socid);
189 $sql .=
" AND entity = ".$conf->entity;
190 $resql = $db->query($sql);
192 $obj = $db->fetch_object($resql);
193 if ($obj && $obj->rowid > 0) {
195 $othermember->fetch($obj->rowid);
196 $thirdparty =
new Societe($db);
197 $thirdparty->fetch($socid);
199 setEventMessages($langs->trans(
"ErrorMemberIsAlreadyLinkedToThisThirdParty", $othermember->getFullName($langs), $othermember->login, $thirdparty->name),
null,
'errors');
204 $result = $object->setThirdPartyId($socid);
215 if ($action ==
'confirm_create_user' && $confirm ==
'yes' && $user->hasRight(
'user',
'user',
'creer')) {
218 $nuser =
new User($db);
220 if (
GETPOST(
'internalorexternal',
'aZ09') ==
'internal') {
221 $tmpuser->fk_soc = 0;
224 $result = $nuser->create_from_member($tmpuser,
GETPOST(
'login',
'alphanohtml'));
227 $langs->load(
"errors");
230 setEventMessages($langs->trans(
"NewUserCreated", $nuser->login),
null,
'mesgs');
239 if ($action ==
'confirm_create_thirdparty' && $confirm ==
'yes' && $user->hasRight(
'societe',
'creer')) {
243 $result = $company->create_from_member($object,
GETPOST(
'companyname',
'alpha'),
GETPOST(
'companyalias',
'alpha'));
246 $langs->load(
"errors");
255 if ($action ==
'update' && !$cancel && $user->hasRight(
'adherent',
'creer')) {
256 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
262 $lastname =
GETPOST(
"lastname",
'alphanohtml');
263 $firstname =
GETPOST(
"firstname",
'alphanohtml');
264 $gender =
GETPOST(
"gender",
'alphanohtml');
265 $societe =
GETPOST(
"societe",
'alphanohtml');
266 $morphy =
GETPOST(
"morphy",
'alphanohtml');
267 $login =
GETPOST(
"login",
'alphanohtml');
268 if ($morphy !=
'mor' && empty($lastname)) {
270 $langs->load(
"errors");
271 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Lastname")),
null,
'errors');
273 if ($morphy !=
'mor' && (!isset($firstname) || $firstname ==
'')) {
275 $langs->load(
"errors");
276 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Firstname")),
null,
'errors');
278 if ($morphy ==
'mor' && empty($societe)) {
280 $langs->load(
"errors");
281 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Company")),
null,
'errors');
287 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Login")),
null,
'errors');
291 if ($result > 0 && !$error) {
292 $object->oldcopy =
dol_clone($object, 2);
295 $object->civility_id = trim(
GETPOST(
"civility_id",
'alphanohtml'));
296 $object->firstname = trim(
GETPOST(
"firstname",
'alphanohtml'));
297 $object->lastname = trim(
GETPOST(
"lastname",
'alphanohtml'));
298 $object->gender = trim(
GETPOST(
"gender",
'alphanohtml'));
299 $object->login = trim(
GETPOST(
"login",
'alphanohtml'));
300 if (GETPOSTISSET(
'pass')) {
301 $object->pass = trim(
GETPOST(
"pass",
'none'));
304 $object->societe = trim(
GETPOST(
"societe",
'alphanohtml'));
305 $object->company = trim(
GETPOST(
"societe",
'alphanohtml'));
307 $object->address = trim(
GETPOST(
"address",
'alphanohtml'));
308 $object->zip = trim(
GETPOST(
"zipcode",
'alphanohtml'));
309 $object->town = trim(
GETPOST(
"town",
'alphanohtml'));
310 $object->state_id =
GETPOST(
"state_id",
'int');
311 $object->country_id =
GETPOST(
"country_id",
'int');
313 $object->phone = trim(
GETPOST(
"phone",
'alpha'));
314 $object->phone_perso = trim(
GETPOST(
"phone_perso",
'alpha'));
315 $object->phone_mobile = trim(
GETPOST(
"phone_mobile",
'alpha'));
316 $object->email = preg_replace(
'/\s+/',
'',
GETPOST(
"member_email",
'alpha'));
317 $object->url = trim(
GETPOST(
'member_url',
'custom', 0, FILTER_SANITIZE_URL));
318 $object->socialnetworks = array();
319 foreach ($socialnetworks as $key => $value) {
320 if (GETPOSTISSET($key) &&
GETPOST($key,
'alphanohtml') !=
'') {
321 $object->socialnetworks[$key] = trim(
GETPOST($key,
'alphanohtml'));
324 $object->birth = $birthdate;
325 $object->default_lang =
GETPOST(
'default_lang',
'alpha');
326 $object->typeid =
GETPOST(
"typeid",
'int');
328 $object->morphy =
GETPOST(
"morphy",
'alpha');
330 if (
GETPOST(
'deletephoto',
'alpha')) {
332 } elseif (!empty($_FILES[
'photo'][
'name'])) {
337 $object->statut =
GETPOST(
"statut",
'alpha');
338 $object->status =
GETPOST(
"statut",
'alpha');
339 $object->public =
GETPOST(
"public",
'alpha');
342 $ret = $extrafields->setOptionalsFromPost(
null, $object,
'@GETPOSTISSET');
349 if ($object->user_id) {
350 if ($user->id != $object->user_id && !$user->hasRight(
'user',
'user',
'creer')) {
357 if (GETPOSTISSET(
'pass')) {
358 if ($object->user_id) {
360 if ($user->id == $object->user_id) {
361 if (!$user->hasRight(
'user',
'self',
'password')) {
365 if (!$user->hasRight(
'user',
'user',
'password')) {
373 $result = $object->update($user, 0, $nosyncuser, $nosyncuserpass);
375 if ($result >= 0 && !count($object->errors)) {
376 $categories =
GETPOST(
'memcats',
'array');
377 $object->setCategories($categories);
380 $dir = $conf->adherent->dir_output.
'/'.
get_exdir(0, 0, 0, 1, $object,
'member').
'/photos';
381 $file_OK = is_uploaded_file($_FILES[
'photo'][
'tmp_name']);
384 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
385 $fileimg = $conf->adherent->dir_output.
'/'.
get_exdir(0, 0, 0, 1, $object,
'member').
'/photos/'.$object->photo;
386 $dirthumbs = $conf->adherent->dir_output.
'/'.
get_exdir(0, 0, 0, 1, $object,
'member').
'/photos/thumbs';
396 if (!
dol_move_uploaded_file($_FILES[
'photo'][
'tmp_name'], $newfile, 1, 0, $_FILES[
'photo'][
'error']) > 0) {
400 $object->addThumbs($newfile);
407 switch ($_FILES[
'photo'][
'error']) {
410 $errors[] =
"ErrorFileSizeTooLarge";
413 $errors[] =
"ErrorFilePartiallyUploaded";
418 $rowid = $object->id;
422 if (!empty($backtopage)) {
423 header(
"Location: ".$backtopage);
438 if ($action ==
'add' && $user->hasRight(
'adherent',
'creer')) {
440 $object->canvas = $canvas;
443 if (GETPOSTISSET(
"birthday") &&
GETPOST(
"birthday") && GETPOSTISSET(
"birthmonth") &&
GETPOST(
"birthmonth") && GETPOSTISSET(
"birthyear") &&
GETPOST(
"birthyear")) {
446 $datesubscription =
'';
447 if (GETPOSTISSET(
"reday") && GETPOSTISSET(
"remonth") && GETPOSTISSET(
"reyear")) {
451 $typeid =
GETPOST(
"typeid",
'int');
452 $civility_id =
GETPOST(
"civility_id",
'alphanohtml');
453 $lastname =
GETPOST(
"lastname",
'alphanohtml');
454 $firstname =
GETPOST(
"firstname",
'alphanohtml');
455 $gender =
GETPOST(
"gender",
'alphanohtml');
456 $societe =
GETPOST(
"societe",
'alphanohtml');
457 $address =
GETPOST(
"address",
'alphanohtml');
458 $zip =
GETPOST(
"zipcode",
'alphanohtml');
459 $town =
GETPOST(
"town",
'alphanohtml');
460 $state_id =
GETPOST(
"state_id",
'int');
461 $country_id =
GETPOST(
"country_id",
'int');
463 $phone =
GETPOST(
"phone",
'alpha');
464 $phone_perso =
GETPOST(
"phone_perso",
'alpha');
465 $phone_mobile =
GETPOST(
"phone_mobile",
'alpha');
466 $email = preg_replace(
'/\s+/',
'',
GETPOST(
"member_email",
'alpha'));
467 $url = trim(
GETPOST(
'url',
'custom', 0, FILTER_SANITIZE_URL));
468 $login =
GETPOST(
"member_login",
'alphanohtml');
469 $pass =
GETPOST(
"password",
'none');
470 $photo =
GETPOST(
"photo",
'alphanohtml');
471 $morphy =
GETPOST(
"morphy",
'alphanohtml');
472 $public =
GETPOST(
"public",
'alphanohtml');
474 $userid =
GETPOST(
"userid",
'int');
475 $socid =
GETPOST(
"socid",
'int');
476 $default_lang =
GETPOST(
'default_lang',
'alpha');
478 $object->civility_id = $civility_id;
479 $object->firstname = $firstname;
480 $object->lastname = $lastname;
481 $object->gender = $gender;
482 $object->societe = $societe;
483 $object->company = $societe;
484 $object->address = $address;
486 $object->town = $town;
487 $object->state_id = $state_id;
488 $object->country_id = $country_id;
489 $object->phone = $phone;
490 $object->phone_perso = $phone_perso;
491 $object->phone_mobile = $phone_mobile;
492 $object->socialnetworks = array();
493 if (isModEnabled(
'socialnetworks')) {
494 foreach ($socialnetworks as $key => $value) {
495 if (GETPOSTISSET($key) &&
GETPOST($key,
'alphanohtml') !=
'') {
496 $object->socialnetworks[$key] =
GETPOST(
"member_".$key,
'alphanohtml');
501 $object->email = $email;
503 $object->login = $login;
504 $object->pass = $pass;
505 $object->birth = $birthdate;
506 $object->photo = $photo;
507 $object->typeid = $typeid;
509 $object->morphy = $morphy;
510 $object->user_id = $userid;
511 $object->socid = $socid;
512 $object->public = $public;
513 $object->default_lang = $default_lang;
515 $ret = $extrafields->setOptionalsFromPost(
null, $object);
521 if (empty($morphy) || $morphy ==
"-1") {
523 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"MemberNature")),
null,
'errors');
529 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Login")),
null,
'errors');
531 $sql =
"SELECT login FROM ".MAIN_DB_PREFIX.
"adherent WHERE login='".$db->escape($login).
"'";
532 $result = $db->query($sql);
534 $num = $db->num_rows($result);
538 $langs->load(
"errors");
539 setEventMessages($langs->trans(
"ErrorLoginAlreadyExists", $login),
null,
'errors');
544 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Password")),
null,
'errors');
547 if ($morphy ==
'mor' && empty($societe)) {
549 $langs->load(
"errors");
550 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Company")),
null,
'errors');
552 if ($morphy !=
'mor' && empty($lastname)) {
554 $langs->load(
"errors");
555 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Lastname")),
null,
'errors');
557 if ($morphy !=
'mor' && (!isset($firstname) || $firstname ==
'')) {
559 $langs->load(
"errors");
560 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Firstname")),
null,
'errors');
562 if (!($typeid > 0)) {
564 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Type")),
null,
'errors');
568 $langs->load(
"errors");
571 if (!empty($object->url) && !
isValidUrl($object->url)) {
572 $langs->load(
"errors");
573 setEventMessages($langs->trans(
"ErrorBadUrl", $object->url),
null,
'errors');
576 if (isset($public)) {
584 $result = $object->create($user);
587 $memcats =
GETPOST(
'memcats',
'array');
588 $object->setCategories($memcats);
592 $rowid = $object->id;
595 $backtopage = preg_replace(
'/__ID__/', $id, $backtopage);
608 $result = $company->create_from_member($object);
610 $langs->load(
"errors");
619 $action = ($result < 0 || !$error) ?
'' :
'create';
621 if (!$error && $backtopage) {
622 header(
"Location: ".$backtopage);
627 if ($user->hasRight(
'adherent',
'supprimer') && $action ==
'confirm_delete' && $confirm ==
'yes') {
628 $result = $object->delete($id, $user);
631 if (!empty($backtopage) && !preg_match(
'/'.preg_quote($_SERVER[
"PHP_SELF"],
'/').
'/', $backtopage)) {
632 header(
"Location: ".$backtopage);
635 header(
"Location: list.php");
643 if ($user->hasRight(
'adherent',
'creer') && $action ==
'confirm_valid' && $confirm ==
'yes') {
649 $adht->fetch($object->typeid);
651 $result = $object->validate($user);
653 if ($result >= 0 && !count($object->errors)) {
655 if ($object->email &&
GETPOST(
"send_mail")) {
660 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
664 $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
666 $outputlangs->loadLangs(array(
"main",
"members",
"companies",
"install",
"other"));
668 $arraydefaultmessage =
null;
671 if (!empty($labeltouse)) {
672 $arraydefaultmessage = $formmail->getEMailTemplate($db,
'member', $user, $outputlangs, 0, 1, $labeltouse);
675 if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
676 $subject = $arraydefaultmessage->topic;
677 $msg = $arraydefaultmessage->content;
680 if (empty($labeltouse) || (
int) $labeltouse === -1) {
682 $langs->load(
"errors");
683 setEventMessages(
'<a href="'.DOL_URL_ROOT.
'/adherents/admin/member_emails.php">'.$langs->trans(
'WarningMandatorySetupNotComplete').
'</a>',
null,
'errors');
691 $moreinheader =
'X-Dolibarr-Info: send_an_email by adherents/card.php'.
"\r\n";
693 $result = $object->sendEmail($texttosend, $subjecttosend, array(), array(), array(),
"",
"", 0, -1,
'', $moreinheader);
702 if ($object->error) {
717 if ($user->hasRight(
'adherent',
'supprimer') && $action ==
'confirm_resiliate') {
720 if ($confirm ==
'yes') {
722 $adht->fetch($object->typeid);
724 $result = $object->resiliate($user);
726 if ($result >= 0 && !count($object->errors)) {
727 if ($object->email &&
GETPOST(
"send_mail")) {
732 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
736 $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
738 $outputlangs->loadLangs(array(
"main",
"members",
"companies",
"install",
"other"));
740 $arraydefaultmessage =
null;
743 if (!empty($labeltouse)) {
744 $arraydefaultmessage = $formmail->getEMailTemplate($db,
'member', $user, $outputlangs, 0, 1, $labeltouse);
747 if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
748 $subject = $arraydefaultmessage->topic;
749 $msg = $arraydefaultmessage->content;
752 if (empty($labeltouse) || (
int) $labeltouse === -1) {
762 $moreinheader =
'X-Dolibarr-Info: send_an_email by adherents/card.php'.
"\r\n";
764 $result = $object->sendEmail($texttosend, $subjecttosend, array(), array(), array(),
"",
"", 0, -1,
'', $moreinheader);
774 if ($object->error) {
782 if (!empty($backtopage) && !$error) {
783 header(
"Location: ".$backtopage);
788 if ($user->hasRight(
'adherent',
'supprimer') && $action ==
'confirm_exclude') {
791 if ($confirm ==
'yes') {
793 $adht->fetch($object->typeid);
795 $result = $object->exclude($user);
797 if ($result >= 0 && !count($object->errors)) {
798 if ($object->email &&
GETPOST(
"send_mail")) {
803 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
807 $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
809 $outputlangs->loadLangs(array(
"main",
"members",
"companies",
"install",
"other"));
811 $arraydefaultmessage =
null;
814 if (!empty($labeltouse)) {
815 $arraydefaultmessage = $formmail->getEMailTemplate($db,
'member', $user, $outputlangs, 0, 1, $labeltouse);
818 if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
819 $subject = $arraydefaultmessage->topic;
820 $msg = $arraydefaultmessage->content;
823 if (empty($labeltouse) || (
int) $labeltouse === -1) {
833 $moreinheader =
'X-Dolibarr-Info: send_an_email by adherents/card.php'.
"\r\n";
835 $result = $object->sendEmail($texttosend, $subjecttosend, array(), array(), array(),
"",
"", 0, -1,
'', $moreinheader);
845 if ($object->error) {
853 if (!empty($backtopage) && !$error) {
854 header(
"Location: ".$backtopage);
860 if ($user->hasRight(
'adherent',
'supprimer') && $action ==
'confirm_del_spip' && $confirm ==
'yes') {
861 if (!count($object->errors)) {
862 if (!$mailmanspip->del_to_spip($object)) {
863 setEventMessages($langs->trans(
'DeleteIntoSpipError').
': '.$mailmanspip->error,
null,
'errors');
868 if ($user->hasRight(
'adherent',
'creer') && $action ==
'confirm_add_spip' && $confirm ==
'yes') {
869 if (!count($object->errors)) {
870 if (!$mailmanspip->add_to_spip($object)) {
871 setEventMessages($langs->trans(
'AddIntoSpipError').
': '.$mailmanspip->error,
null,
'errors');
877 include DOL_DOCUMENT_ROOT.
'/core/actions_printing.inc.php';
880 $upload_dir = $conf->adherent->dir_output;
881 $permissiontoadd = $user->hasRight(
'adherent',
'creer');
882 include DOL_DOCUMENT_ROOT.
'/core/actions_builddoc.inc.php';
885 $triggersendname =
'MEMBER_SENTBYMAIL';
887 $mode =
'emailfrommember';
888 $trackid =
'mem'.$object->id;
889 include DOL_DOCUMENT_ROOT.
'/core/actions_sendmails.inc.php';
897$form =
new Form($db);
902$title = $langs->trans(
"Member").
" - ".$langs->trans(
"Card");
903$help_url =
'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder';
906$countrynotdefined = $langs->trans(
"ErrorSetACountryFirst").
' ('.$langs->trans(
"SeeAbove").
')';
908if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
912 if (empty($object->error) && $id) {
914 $result = $object->fetch($id);
919 $objcanvas->assign_values($action, $object->id, $object->ref);
920 $objcanvas->display_canvas($action);
927 if ($action ==
'create') {
928 $object->canvas = $canvas;
929 $object->state_id =
GETPOST(
'state_id',
'int');
932 $object->country_id =
GETPOST(
'country_id',
'int') ?
GETPOST(
'country_id',
'int') : $mysoc->country_id;
933 if ($object->country_id) {
934 $tmparray =
getCountry($object->country_id,
'all');
935 $object->country_code = $tmparray[
'code'];
936 $object->country = $tmparray[
'label'];
940 if (!empty($socid)) {
945 if (!($soc->id > 0)) {
946 $langs->load(
"errors");
947 print($langs->trans(
'ErrorRecordNotFound'));
956 if ($conf->use_javascript_ajax) {
957 print
"\n".
'<script type="text/javascript">'.
"\n";
958 print
'jQuery(document).ready(function () {
959 jQuery("#selectcountry_id").change(function() {
960 document.formsoc.action.value="create";
961 document.formsoc.submit();
963 function initfieldrequired() {
964 jQuery("#tdcompany").removeClass("fieldrequired");
965 jQuery("#tdlastname").removeClass("fieldrequired");
966 jQuery("#tdfirstname").removeClass("fieldrequired");
967 if (jQuery("#morphy").val() == \'mor\') {
968 jQuery("#tdcompany").addClass("fieldrequired");
970 if (jQuery("#morphy").val() == \'phy\') {
971 jQuery("#tdlastname").addClass("fieldrequired");
972 jQuery("#tdfirstname").addClass("fieldrequired");
975 jQuery("#morphy").change(function() {
980 print
'</script>'.
"\n";
983 print
'<form name="formsoc" action="'.$_SERVER[
"PHP_SELF"].
'" method="post" enctype="multipart/form-data">';
984 print
'<input type="hidden" name="token" value="'.newToken().
'">';
985 print
'<input type="hidden" name="action" value="add">';
986 print
'<input type="hidden" name="socid" value="'.$socid.
'">';
988 print
'<input type="hidden" name="backtopage" value="'.($backtopage !=
'1' ? $backtopage : $_SERVER[
"HTTP_REFERER"]).
'">';
993 print
'<table class="border centpercent">';
998 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>';
1003 require_once DOL_DOCUMENT_ROOT.
'/core/lib/security2.lib.php';
1005 print
'<tr><td><span class="fieldrequired">'.$langs->trans(
"Password").
'</span></td><td>';
1006 print
'<input type="text" class="minwidth300" maxlength="50" name="password" value="'.dol_escape_htmltag($generated_password).
'">';
1011 print
'<tr><td class="fieldrequired">'.$langs->trans(
"MemberType").
'</td><td>';
1012 $listetype = $adht->liste_array(1);
1013 print
img_picto(
'', $adht->picto,
'class="pictofixedwidth"');
1014 if (count($listetype)) {
1015 print $form->selectarray(
"typeid", $listetype, (
GETPOST(
'typeid',
'int') ?
GETPOST(
'typeid',
'int') : $typeid), (count($listetype) > 1 ? 1 : 0), 0, 0,
'', 0, 0, 0,
'',
'minwidth150', 1);
1017 print
'<span class="error">'.$langs->trans(
"NoTypeDefinedGoToSetup").
'</span>';
1022 $morphys[
"phy"] = $langs->trans(
"Physical");
1023 $morphys[
"mor"] = $langs->trans(
"Moral");
1024 print
'<tr><td class="fieldrequired">'.$langs->trans(
"MemberNature").
"</td><td>\n";
1025 print $form->selectarray(
"morphy", $morphys, (
GETPOST(
'morphy',
'alpha') ?
GETPOST(
'morphy',
'alpha') : $object->morphy), 1, 0, 0,
'', 0, 0, 0,
'',
'', 1);
1029 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>';
1032 print
'<tr><td>'.$langs->trans(
"UserTitle").
'</td><td>';
1033 print $formcompany->select_civility(
GETPOST(
'civility_id',
'int') ?
GETPOST(
'civility_id',
'int') : $object->civility_id,
'civility_id',
'maxwidth150', 1).
'</td>';
1037 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>';
1041 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>';
1045 print
'<tr><td>'.$langs->trans(
"Gender").
'</td>';
1047 $arraygender = array(
'man'=>$langs->trans(
"Genderman"),
'woman'=>$langs->trans(
"Genderwoman"),
'other'=>$langs->trans(
"Genderother"));
1048 print $form->selectarray(
'gender', $arraygender,
GETPOST(
'gender',
'alphanohtml'), 1, 0, 0,
'', 0, 0, 0,
'',
'', 1);
1052 print
'<tr><td>'.(getDolGlobalString(
'ADHERENT_MAIL_REQUIRED') ?
'<span class="fieldrequired">' :
'').$langs->trans(
"EMail").(getDolGlobalString(
'ADHERENT_MAIL_REQUIRED') ?
'</span>' :
'').
'</td>';
1053 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>';
1056 print
'<tr><td>'.$form->editfieldkey(
'Web',
'member_url',
GETPOST(
'member_url',
'alpha'), $object, 0).
'</td>';
1057 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>';
1060 print
'<tr><td class="tdtop">'.$langs->trans(
"Address").
'</td><td>';
1061 print
'<textarea name="address" wrap="soft" class="quatrevingtpercent" rows="2">'.(GETPOSTISSET(
'address') ?
GETPOST(
'address',
'alphanohtml') : $soc->address).
'</textarea>';
1065 print
'<tr><td>'.$langs->trans(
"Zip").
' / '.$langs->trans(
"Town").
'</td><td>';
1066 print $formcompany->select_ziptown((GETPOSTISSET(
'zipcode') ?
GETPOST(
'zipcode',
'alphanohtml') : $soc->zip),
'zipcode', array(
'town',
'selectcountry_id',
'state_id'), 6);
1068 print $formcompany->select_ziptown((GETPOSTISSET(
'town') ?
GETPOST(
'town',
'alphanohtml') : $soc->town),
'town', array(
'zipcode',
'selectcountry_id',
'state_id'));
1072 if (empty($soc->country_id)) {
1073 $soc->country_id = $mysoc->country_id;
1074 $soc->country_code = $mysoc->country_code;
1075 $soc->state_id = $mysoc->state_id;
1077 print
'<tr><td>'.$langs->trans(
'Country').
'</td><td>';
1078 print
img_picto(
'',
'country',
'class="pictofixedwidth"');
1079 print $form->select_country(GETPOSTISSET(
'country_id') ?
GETPOST(
'country_id',
'alpha') : $soc->country_id,
'country_id');
1081 print
info_admin($langs->trans(
"YouCanChangeValuesForThisListFromDictionarySetup"), 1);
1087 print
'<tr><td>'.$langs->trans(
'State').
'</td><td>';
1088 if ($soc->country_id) {
1089 print
img_picto(
'',
'state',
'class="pictofixedwidth"');
1090 print $formcompany->select_state(GETPOSTISSET(
'state_id') ?
GETPOST(
'state_id',
'int') : $soc->state_id, $soc->country_code);
1092 print $countrynotdefined;
1098 print
'<tr><td>'.$langs->trans(
"PhonePro").
'</td>';
1099 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>';
1102 print
'<tr><td>'.$langs->trans(
"PhonePerso").
'</td>';
1103 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>';
1106 print
'<tr><td>'.$langs->trans(
"PhoneMobile").
'</td>';
1107 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>';
1109 if (isModEnabled(
'socialnetworks')) {
1110 foreach ($socialnetworks as $key => $value) {
1111 if (!$value[
'active']) {
1114 $val = (GETPOSTISSET(
'member_'.$key) ?
GETPOST(
'member_'.$key,
'alpha') : (empty($object->socialnetworks[$key]) ?
'' : $object->socialnetworks[$key]));
1115 print
'<tr><td>'.$langs->trans($value[
'label']).
'</td><td><input type="text" name="member_'.$key.
'" size="40" value="'.$val.
'"></td></tr>';
1120 print
"<tr><td>".$langs->trans(
"DateOfBirth").
"</td><td>\n";
1121 print $form->selectDate(($object->birth ? $object->birth : -1),
'birth',
'',
'', 1,
'formsoc');
1122 print
"</td></tr>\n";
1126 $htmltext = $langs->trans(
"Public",
getDolGlobalString(
'MAIN_INFO_SOCIETE_NOM'), $linkofpubliclist);
1127 print $form->textwithpicto($langs->trans(
"MembershipPublic"), $htmltext, 1,
'help',
'', 0, 3,
'membershippublic');
1128 print
"</td><td>\n";
1129 print $form->selectyesno(
"public", $object->public, 1);
1130 print
"</td></tr>\n";
1133 if (isModEnabled(
'categorie') && $user->hasRight(
'categorie',
'lire')) {
1134 print
'<tr><td>'.$form->editfieldkey(
"Categories",
'memcats',
'', $object, 0).
'</td><td>';
1135 $cate_arbo = $form->select_all_categories(Categorie::TYPE_MEMBER,
null,
'parent',
null,
null, 1);
1136 print
img_picto(
'',
'category').$form->multiselectarray(
'memcats', $cate_arbo,
GETPOST(
'memcats',
'array'),
null,
null,
'quatrevingtpercent widthcentpercentminusx', 0, 0);
1141 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_add.tpl.php';
1148 print $form->buttonsSaveCancel(
"AddMember");
1154 if ($action ==
'edit') {
1155 $res = $object->fetch($id);
1160 $res = $object->fetch_optionals();
1167 $adht->fetch($object->typeid);
1170 $country =
GETPOST(
'country',
'int');
1171 if (!empty($country) || $object->country_id) {
1172 $sql =
"SELECT rowid, code, label from ".MAIN_DB_PREFIX.
"c_country where rowid = ".(!empty($country) ? $country : $object->country_id);
1173 $resql = $db->query($sql);
1175 $obj = $db->fetch_object($resql);
1179 $object->country_id = $obj->rowid;
1180 $object->country_code = $obj->code;
1181 $object->country = $langs->trans(
"Country".$obj->code) ? $langs->trans(
"Country".$obj->code) : $obj->label;
1187 if ($conf->use_javascript_ajax) {
1188 print
"\n".
'<script type="text/javascript">';
1189 print
'jQuery(document).ready(function () {
1190 jQuery("#selectcountry_id").change(function() {
1191 document.formsoc.action.value="edit";
1192 document.formsoc.submit();
1194 function initfieldrequired() {
1195 jQuery("#tdcompany").removeClass("fieldrequired");
1196 jQuery("#tdlastname").removeClass("fieldrequired");
1197 jQuery("#tdfirstname").removeClass("fieldrequired");
1198 if (jQuery("#morphy").val() == \'mor\') {
1199 jQuery("#tdcompany").addClass("fieldrequired");
1201 if (jQuery("#morphy").val() == \'phy\') {
1202 jQuery("#tdlastname").addClass("fieldrequired");
1203 jQuery("#tdfirstname").addClass("fieldrequired");
1206 jQuery("#morphy").change(function() {
1207 initfieldrequired();
1209 initfieldrequired();
1211 print
'</script>'.
"\n";
1214 print
'<form name="formsoc" action="'.$_SERVER[
"PHP_SELF"].
'" method="post" enctype="multipart/form-data">';
1215 print
'<input type="hidden" name="token" value="'.newToken().
'" />';
1216 print
'<input type="hidden" name="action" value="update" />';
1217 print
'<input type="hidden" name="rowid" value="'.$id.
'" />';
1218 print
'<input type="hidden" name="statut" value="'.$object->statut.
'" />';
1220 print
'<input type="hidden" name="backtopage" value="'.($backtopage !=
'1' ? $backtopage : $_SERVER[
"HTTP_REFERER"]).
'">';
1225 print
'<table class="border centpercent">';
1228 print
'<tr><td class="titlefieldcreate">'.$langs->trans(
"Ref").
'</td><td class="valeur">'.$object->ref.
'</td></tr>';
1232 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>';
1237 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) :
'').
'"></td></tr>';
1241 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Type").
'</td><td>';
1242 if ($user->hasRight(
'adherent',
'creer')) {
1243 print $form->selectarray(
"typeid", $adht->liste_array(), (GETPOSTISSET(
"typeid") ?
GETPOST(
"typeid",
'int') : $object->typeid), 0, 0, 0,
'', 0, 0, 0,
'',
'', 1);
1245 print $adht->getNomUrl(1);
1246 print
'<input type="hidden" name="typeid" value="'.$object->typeid.
'">';
1251 $morphys[
"phy"] = $langs->trans(
"Physical");
1252 $morphys[
"mor"] = $langs->trans(
"Moral");
1253 print
'<tr><td><span class="fieldrequired">'.$langs->trans(
"MemberNature").
'</span></td><td>';
1254 print $form->selectarray(
"morphy", $morphys, (GETPOSTISSET(
"morphy") ?
GETPOST(
"morphy",
'alpha') : $object->morphy), 0, 0, 0,
'', 0, 0, 0,
'',
'', 1);
1258 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>';
1261 print
'<tr><td>'.$langs->trans(
"UserTitle").
'</td><td>';
1262 print $formcompany->select_civility(GETPOSTISSET(
"civility_id") ?
GETPOST(
"civility_id",
'alpha') : $object->civility_id,
'civility_id',
'maxwidth150', 1);
1267 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>';
1271 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>';
1275 print
'<tr><td>'.$langs->trans(
"Gender").
'</td>';
1277 $arraygender = array(
'man'=>$langs->trans(
"Genderman"),
'woman'=>$langs->trans(
"Genderwoman"),
'other'=>$langs->trans(
"Genderother"));
1278 print $form->selectarray(
'gender', $arraygender, GETPOSTISSET(
'gender') ?
GETPOST(
'gender',
'alphanohtml') : $object->gender, 1, 0, 0,
'', 0, 0, 0,
'',
'', 1);
1282 print
'<tr><td>'.$langs->trans(
"Photo").
'</td>';
1283 print
'<td class="hideonsmartphone" valign="middle">';
1284 print $form->showphoto(
'memberphoto', $object).
"\n";
1285 if ($caneditfieldmember) {
1286 if ($object->photo) {
1289 print
'<table class="nobordernopadding">';
1290 if ($object->photo) {
1291 print
'<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> '.$langs->trans(
"Delete").
'<br><br></td></tr>';
1293 print
'<tr><td>'.$langs->trans(
"PhotoFile").
'</td></tr>';
1296 $maxmin = $maxfilesizearray[
'maxmin'];
1298 print
'<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).
'">';
1300 print
'<input type="file" class="flat" name="photo" id="photoinput">';
1307 print
'<tr><td>'.(getDolGlobalString(
"ADHERENT_MAIL_REQUIRED") ?
'<span class="fieldrequired">' :
'').$langs->trans(
"EMail").(getDolGlobalString(
"ADHERENT_MAIL_REQUIRED") ?
'</span>' :
'').
'</td>';
1308 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>';
1311 print
'<tr><td>'.$form->editfieldkey(
'Web',
'member_url',
GETPOST(
'member_url',
'alpha'), $object, 0).
'</td>';
1312 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>';
1315 print
'<tr><td>'.$langs->trans(
"Address").
'</td><td>';
1316 print
'<textarea name="address" wrap="soft" class="quatrevingtpercent" rows="'.ROWS_2.
'">'.(GETPOSTISSET(
"address") ?
GETPOST(
"address",
'alphanohtml', 2) : $object->address).
'</textarea>';
1320 print
'<tr><td>'.$langs->trans(
"Zip").
' / '.$langs->trans(
"Town").
'</td><td>';
1321 print $formcompany->select_ziptown((GETPOSTISSET(
"zipcode") ?
GETPOST(
"zipcode",
'alphanohtml', 2) : $object->zip),
'zipcode', array(
'town',
'selectcountry_id',
'state_id'), 6);
1323 print $formcompany->select_ziptown((GETPOSTISSET(
"town") ?
GETPOST(
"town",
'alphanohtml', 2) : $object->town),
'town', array(
'zipcode',
'selectcountry_id',
'state_id'));
1328 print
'<tr><td>'.$langs->trans(
'Country').
'</td><td>';
1329 print
img_picto(
'',
'country',
'class="pictofixedwidth"');
1330 print $form->select_country(GETPOSTISSET(
"country_id") ?
GETPOST(
"country_id",
"alpha") : $object->country_id,
'country_id');
1332 print
info_admin($langs->trans(
"YouCanChangeValuesForThisListFromDictionarySetup"), 1);
1338 print
'<tr><td>'.$langs->trans(
'State').
'</td><td>';
1339 print
img_picto(
'',
'state',
'class="pictofixedwidth"');
1340 print $formcompany->select_state($object->state_id, GETPOSTISSET(
"country_id") ?
GETPOST(
"country_id",
"alpha") : $object->country_id);
1345 print
'<tr><td>'.$langs->trans(
"PhonePro").
'</td>';
1346 print
'<td>'.img_picto(
'',
'object_phoning',
'class="pictofixedwidth"').
'<input type="text" name="phone" value="'.(GETPOSTISSET(
"phone") ?
GETPOST(
"phone") : $object->phone).
'"></td></tr>';
1349 print
'<tr><td>'.$langs->trans(
"PhonePerso").
'</td>';
1350 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>';
1353 print
'<tr><td>'.$langs->trans(
"PhoneMobile").
'</td>';
1354 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>';
1356 if (isModEnabled(
'socialnetworks')) {
1357 foreach ($socialnetworks as $key => $value) {
1358 if (!$value[
'active']) {
1361 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>';
1366 print
"<tr><td>".$langs->trans(
"DateOfBirth").
"</td><td>\n";
1367 print $form->selectDate(($object->birth ? $object->birth : -1),
'birth',
'',
'', 1,
'formsoc');
1368 print
"</td></tr>\n";
1372 print
'<tr><td>'.$form->editfieldkey(
'DefaultLang',
'default_lang',
'', $object, 0).
'</td><td colspan="3">'.
"\n";
1373 print
img_picto(
'',
'language').$formadmin->select_language($object->default_lang,
'default_lang', 0, 0, 1);
1380 $htmltext = $langs->trans(
"Public",
getDolGlobalString(
'MAIN_INFO_SOCIETE_NOM'), $linkofpubliclist);
1381 print $form->textwithpicto($langs->trans(
"MembershipPublic"), $htmltext, 1,
'help',
'', 0, 3,
'membershippublic');
1382 print
"</td><td>\n";
1383 print $form->selectyesno(
"public", (GETPOSTISSET(
"public") ?
GETPOST(
"public",
'alphanohtml', 2) : $object->public), 1);
1384 print
"</td></tr>\n";
1387 if (isModEnabled(
'categorie') && $user->hasRight(
'categorie',
'lire')) {
1388 print
'<tr><td>'.$form->editfieldkey(
"Categories",
'memcats',
'', $object, 0).
'</td>';
1390 $cate_arbo = $form->select_all_categories(Categorie::TYPE_MEMBER,
null,
null,
null,
null, 1);
1392 $cats = $c->containing($object->id, Categorie::TYPE_MEMBER);
1393 $arrayselected = array();
1394 if (is_array($cats)) {
1395 foreach ($cats as $cat) {
1396 $arrayselected[] = $cat->id;
1399 print $form->multiselectarray(
'memcats', $cate_arbo, $arrayselected,
'', 0,
'', 0,
'100%');
1404 if (isModEnabled(
'societe')) {
1405 print
'<tr><td>'.$langs->trans(
"LinkedToDolibarrThirdParty").
'</td><td colspan="2" class="valeur">';
1406 if ($object->socid) {
1408 $result = $company->fetch($object->socid);
1409 print $company->getNomUrl(1);
1411 print $langs->trans(
"NoThirdPartyAssociatedToMember");
1417 print
'<tr><td>'.$langs->trans(
"LinkedToDolibarrUser").
'</td><td colspan="2" class="valeur">';
1418 if ($object->user_id) {
1419 $form->form_users($_SERVER[
'PHP_SELF'].
'?rowid='.$object->id, $object->user_id,
'none');
1421 print $langs->trans(
"NoDolibarrAccess");
1426 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_edit.tpl.php';
1431 print $form->buttonsSaveCancel(
"Save",
'Cancel');
1437 if ($id > 0 && $action !=
'edit') {
1438 $res = $object->fetch($id);
1443 $res = $object->fetch_optionals();
1450 $res = $adht->fetch($object->typeid);
1465 if ($action ==
'create_user') {
1466 $login = (GETPOSTISSET(
'login') ?
GETPOST(
'login',
'alphanohtml') : $object->login);
1467 if (empty($login)) {
1469 include_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
1472 if (empty($login)) {
1473 $login = strtolower(substr($object->firstname, 0, 4)).strtolower(substr($object->lastname, 0, 4));
1477 $formquestion = array(
1478 array(
'label' => $langs->trans(
"LoginToCreate"),
'type' =>
'text',
'name' =>
'login',
'value' => $login)
1480 if (isModEnabled(
'societe') && $object->socid > 0) {
1481 $object->fetch_thirdparty();
1482 $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")));
1485 if (isModEnabled(
'societe') && $object->socid <= 0) {
1486 $text .= $langs->trans(
"UserWillBeInternalUser").
'<br>';
1488 $text .= $langs->trans(
"ConfirmCreateLogin");
1489 print $form->formconfirm($_SERVER[
"PHP_SELF"].
"?rowid=".$object->id, $langs->trans(
"CreateDolibarrLogin"), $text,
"confirm_create_user", $formquestion,
'yes');
1493 if ($action ==
'create_thirdparty') {
1495 $fullname = $object->getFullName($langs);
1497 if ($object->morphy ==
'mor') {
1498 $companyname = $object->company;
1499 if (!empty($fullname)) {
1500 $companyalias = $fullname;
1503 $companyname = $fullname;
1504 if (!empty($object->company)) {
1505 $companyalias = $object->company;
1510 $formquestion = array(
1511 array(
'label' => $langs->trans(
"NameToCreate"),
'type' =>
'text',
'name' =>
'companyname',
'value' => $companyname,
'morecss' =>
'minwidth300',
'moreattr' =>
'maxlength="128"'),
1512 array(
'label' => $langs->trans(
"AliasNames"),
'type' =>
'text',
'name' =>
'companyalias',
'value' => $companyalias,
'morecss' =>
'minwidth300',
'moreattr' =>
'maxlength="128"')
1515 print $form->formconfirm($_SERVER[
"PHP_SELF"].
"?rowid=".$object->id, $langs->trans(
"CreateDolibarrThirdParty"), $langs->trans(
"ConfirmCreateThirdParty"),
"confirm_create_thirdparty", $formquestion,
'yes');
1519 if ($action ==
'valid') {
1520 $langs->load(
"mails");
1523 $adht->fetch($object->typeid);
1529 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
1532 $outputlangs =
new Translate(
'', $conf);
1533 $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
1535 $outputlangs->loadLangs(array(
"main",
"members",
"companies",
"install",
"other"));
1537 $arraydefaultmessage =
null;
1540 if (!empty($labeltouse)) {
1541 $arraydefaultmessage = $formmail->getEMailTemplate($db,
'member', $user, $outputlangs, 0, 1, $labeltouse);
1544 if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
1545 $subject = $arraydefaultmessage->topic;
1546 $msg = $arraydefaultmessage->content;
1554 $tmp = $langs->trans(
"SendingAnEMailToMember");
1555 $tmp .=
'<br>'.$langs->trans(
"MailFrom").
': <b>'.
getDolGlobalString(
'ADHERENT_MAIL_FROM').
'</b>, ';
1556 $tmp .=
'<br>'.$langs->trans(
"MailRecipient").
': <b>'.$object->email.
'</b>';
1558 $helpcontent .=
'<b>'.$langs->trans(
"MailFrom").
'</b>: '.
getDolGlobalString(
'ADHERENT_MAIL_FROM').
'<br>'.
"\n";
1559 $helpcontent .=
'<b>'.$langs->trans(
"MailRecipient").
'</b>: '.$object->email.
'<br>'.
"\n";
1560 $helpcontent .=
'<b>'.$langs->trans(
"Subject").
'</b>:<br>'.
"\n";
1561 $helpcontent .= $subjecttosend.
"\n";
1562 $helpcontent .=
"<br>";
1563 $helpcontent .=
'<b>'.$langs->trans(
"Content").
'</b>:<br>';
1565 $label = $form->textwithpicto($tmp, $helpcontent, 1,
'help');
1568 $formquestion = array();
1569 if ($object->email) {
1570 $formquestion[] = array(
'type' =>
'checkbox',
'name' =>
'send_mail',
'label' => $label,
'value' => (
getDolGlobalString(
'ADHERENT_DEFAULT_SENDINFOBYMAIL') ?
true : false));
1573 $formquestion[] = array(
'type'=>
'other',
'label'=>$langs->transnoentitiesnoconv(
"SynchroMailManEnabled"),
'value'=>
'');
1576 $formquestion[] = array(
'type'=>
'other',
'label'=>$langs->transnoentitiesnoconv(
"SynchroSpipEnabled"),
'value'=>
'');
1578 print $form->formconfirm(
"card.php?rowid=".$id, $langs->trans(
"ValidateMember"), $langs->trans(
"ConfirmValidateMember"),
"confirm_valid", $formquestion,
'yes', 1, 220);
1582 if ($action ==
'resiliate') {
1583 $langs->load(
"mails");
1586 $adht->fetch($object->typeid);
1592 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
1595 $outputlangs =
new Translate(
'', $conf);
1596 $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
1598 $outputlangs->loadLangs(array(
"main",
"members"));
1600 $arraydefaultmessage =
null;
1603 if (!empty($labeltouse)) {
1604 $arraydefaultmessage = $formmail->getEMailTemplate($db,
'member', $user, $outputlangs, 0, 1, $labeltouse);
1607 if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
1608 $subject = $arraydefaultmessage->topic;
1609 $msg = $arraydefaultmessage->content;
1617 $tmp = $langs->trans(
"SendingAnEMailToMember");
1618 $tmp .=
'<br>('.$langs->trans(
"MailFrom").
': <b>'.
getDolGlobalString(
'ADHERENT_MAIL_FROM').
'</b>, ';
1619 $tmp .= $langs->trans(
"MailRecipient").
': <b>'.$object->email.
'</b>)';
1621 $helpcontent .=
'<b>'.$langs->trans(
"MailFrom").
'</b>: '.
getDolGlobalString(
'ADHERENT_MAIL_FROM').
'<br>'.
"\n";
1622 $helpcontent .=
'<b>'.$langs->trans(
"MailRecipient").
'</b>: '.$object->email.
'<br>'.
"\n";
1623 $helpcontent .=
'<b>'.$langs->trans(
"Subject").
'</b>:<br>'.
"\n";
1624 $helpcontent .= $subjecttosend.
"\n";
1625 $helpcontent .=
"<br>";
1626 $helpcontent .=
'<b>'.$langs->trans(
"Content").
'</b>:<br>';
1628 $label = $form->textwithpicto($tmp, $helpcontent, 1,
'help');
1631 $formquestion = array();
1632 if ($object->email) {
1633 $formquestion[] = array(
'type' =>
'checkbox',
'name' =>
'send_mail',
'label' => $label,
'value' => (
getDolGlobalString(
'ADHERENT_DEFAULT_SENDINFOBYMAIL') ?
'true' :
'false'));
1636 $formquestion[] = array(
'type' =>
'hidden',
'name' =>
'backtopage',
'value' => ($backtopage !=
'1' ? $backtopage : $_SERVER[
"HTTP_REFERER"]));
1638 print $form->formconfirm(
"card.php?rowid=".$id, $langs->trans(
"ResiliateMember"), $langs->trans(
"ConfirmResiliateMember"),
"confirm_resiliate", $formquestion,
'no', 1, 240);
1642 if ($action ==
'exclude') {
1643 $langs->load(
"mails");
1646 $adht->fetch($object->typeid);
1652 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
1655 $outputlangs =
new Translate(
'', $conf);
1656 $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
1658 $outputlangs->loadLangs(array(
"main",
"members"));
1660 $arraydefaultmessage =
null;
1663 if (!empty($labeltouse)) {
1664 $arraydefaultmessage = $formmail->getEMailTemplate($db,
'member', $user, $outputlangs, 0, 1, $labeltouse);
1667 if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
1668 $subject = $arraydefaultmessage->topic;
1669 $msg = $arraydefaultmessage->content;
1677 $tmp = $langs->trans(
"SendingAnEMailToMember");
1678 $tmp .=
'<br>('.$langs->trans(
"MailFrom").
': <b>'.
getDolGlobalString(
'ADHERENT_MAIL_FROM').
'</b>, ';
1679 $tmp .= $langs->trans(
"MailRecipient").
': <b>'.$object->email.
'</b>)';
1681 $helpcontent .=
'<b>'.$langs->trans(
"MailFrom").
'</b>: '.
getDolGlobalString(
'ADHERENT_MAIL_FROM').
'<br>'.
"\n";
1682 $helpcontent .=
'<b>'.$langs->trans(
"MailRecipient").
'</b>: '.$object->email.
'<br>'.
"\n";
1683 $helpcontent .=
'<b>'.$langs->trans(
"Subject").
'</b>:<br>'.
"\n";
1684 $helpcontent .= $subjecttosend.
"\n";
1685 $helpcontent .=
"<br>";
1686 $helpcontent .=
'<b>'.$langs->trans(
"Content").
'</b>:<br>';
1688 $label = $form->textwithpicto($tmp, $helpcontent, 1,
'help');
1691 $formquestion = array();
1692 if ($object->email) {
1693 $formquestion[] = array(
'type' =>
'checkbox',
'name' =>
'send_mail',
'label' => $label,
'value' => (
getDolGlobalString(
'ADHERENT_DEFAULT_SENDINFOBYMAIL') ?
'true' :
'false'));
1696 $formquestion[] = array(
'type' =>
'hidden',
'name' =>
'backtopage',
'value' => ($backtopage !=
'1' ? $backtopage : $_SERVER[
"HTTP_REFERER"]));
1698 print $form->formconfirm(
"card.php?rowid=".$id, $langs->trans(
"ExcludeMember"), $langs->trans(
"ConfirmExcludeMember"),
"confirm_exclude", $formquestion,
'no', 1, 240);
1702 if ($action ==
'delete') {
1703 $formquestion = array();
1705 $formquestion[] = array(
'type' =>
'hidden',
'name' =>
'backtopage',
'value' => ($backtopage !=
'1' ? $backtopage : $_SERVER[
"HTTP_REFERER"]));
1707 print $form->formconfirm(
"card.php?rowid=".$id, $langs->trans(
"DeleteMember"), $langs->trans(
"ConfirmDeleteMember"),
"confirm_delete", $formquestion,
'no', 1);
1711 if ($action ==
'add_spip') {
1712 print $form->formconfirm(
"card.php?rowid=".$id, $langs->trans(
'AddIntoSpip'), $langs->trans(
'AddIntoSpipConfirmation'),
'confirm_add_spip');
1715 if ($action ==
'del_spip') {
1716 print $form->formconfirm(
"card.php?rowid=$id", $langs->trans(
'DeleteIntoSpip'), $langs->trans(
'DeleteIntoSpipConfirmation'),
'confirm_del_spip');
1723 if (isModEnabled(
'societe')) {
1727 $linkback =
'<a href="'.DOL_URL_ROOT.
'/adherents/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
1729 $morehtmlref =
'<a href="'.DOL_URL_ROOT.
'/adherents/vcard.php?id='.$object->id.
'" class="refid">';
1730 $morehtmlref .=
img_picto($langs->trans(
"Download").
' '.$langs->trans(
"VCard"),
'vcard.png',
'class="valignmiddle marginleftonly paddingrightonly"');
1731 $morehtmlref .=
'</a>';
1734 dol_banner_tab($object,
'rowid', $linkback, 1,
'rowid',
'ref', $morehtmlref);
1736 print
'<div class="fichecenter">';
1737 print
'<div class="fichehalfleft">';
1739 print
'<div class="underbanner clearboth"></div>';
1740 print
'<table class="border tableforfield centpercent">';
1744 print
'<tr><td class="titlefield">'.$langs->trans(
"Login").
' / '.$langs->trans(
"Id").
'</td><td class="valeur">'.
dol_escape_htmltag($object->login).
'</td></tr>';
1748 print
'<tr><td class="titlefield">'.$langs->trans(
"Type").
'</td>';
1749 print
'<td class="valeur">'.$adht->getNomUrl(1).
"</td></tr>\n";
1752 print
'<tr><td>'.$langs->trans(
"MemberNature").
'</td>';
1753 print
'<td class="valeur" >'.$object->getmorphylib(
'', 1).
'</td>';
1757 print
'<tr><td>'.$langs->trans(
"Company").
'</td><td class="valeur">'.
dol_escape_htmltag($object->company).
'</td></tr>';
1760 print
'<tr><td>'.$langs->trans(
"UserTitle").
'</td><td class="valeur">'.$object->getCivilityLabel().
'</td>';
1765 print
'<tr><td>'.$langs->trans(
"Password").
'</td><td>';
1766 if ($object->pass) {
1767 print preg_replace(
'/./i',
'*', $object->pass);
1770 print
'<!-- '.$langs->trans(
"Crypted").
': '.$object->pass_indatabase_crypted.
' -->';
1772 print
'<span class="opacitymedium">'.$langs->trans(
"Hidden").
'</span>';
1774 if (!empty($object->pass_indatabase) && empty($object->user_id)) {
1775 $langs->load(
"errors");
1776 $htmltext = $langs->trans(
"WarningPasswordSetWithNoAccount");
1777 print
' '.$form->textwithpicto(
'', $htmltext, 1,
'warning');
1783 print
'<tr><td>'.$langs->trans(
"SubscriptionEndDate").
'</td><td class="valeur">';
1784 if ($object->datefin) {
1786 if ($object->hasDelay()) {
1787 print
" ".img_warning($langs->trans(
"Late"));
1790 if ($object->need_subscription == 0) {
1791 print $langs->trans(
"SubscriptionNotNeeded");
1792 } elseif (!$adht->subscription) {
1793 print $langs->trans(
"SubscriptionNotRecorded");
1795 print
" ".img_warning($langs->trans(
"Late"));
1798 print $langs->trans(
"SubscriptionNotReceived");
1800 print
" ".img_warning($langs->trans(
"Late"));
1810 print
'<div class="fichehalfright">';
1811 print
'<div class="underbanner clearboth"></div>';
1813 print
'<table class="border tableforfield centpercent">';
1816 if (isModEnabled(
'categorie') && $user->hasRight(
'categorie',
'lire')) {
1817 print
'<tr><td>'.$langs->trans(
"Categories").
'</td>';
1818 print
'<td colspan="2">';
1819 print $form->showCategories($object->id, Categorie::TYPE_MEMBER, 1);
1824 print
'<tr><td class="titlefield">'.$langs->trans(
"DateOfBirth").
'</td><td class="valeur">'.
dol_print_date($object->birth,
'day').
'</td></tr>';
1828 require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
1829 print
'<tr><td>'.$langs->trans(
"DefaultLang").
'</td><td>';
1832 $langs->load(
"languages");
1833 $labellang = ($object->default_lang ? $langs->trans(
'Language_'.$object->default_lang) :
'');
1834 print
picto_from_langcode($object->default_lang,
'class="paddingrightonly saturatemedium opacitylow"');
1841 $htmltext = $langs->trans(
"Public",
getDolGlobalString(
'MAIN_INFO_SOCIETE_NOM'), $linkofpubliclist);
1842 print $form->textwithpicto($langs->trans(
"MembershipPublic"), $htmltext, 1,
'help',
'', 0, 3,
'membershippublic');
1843 print
'</td><td class="valeur">'.yn($object->public).
'</td></tr>';
1846 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
1849 if (isModEnabled(
'societe')) {
1851 $editenable = $user->hasRight(
'adherent',
'creer');
1852 print $form->editfieldkey(
'LinkedToDolibarrThirdParty',
'thirdparty',
'', $object, $editenable);
1853 print
'</td><td colspan="2" class="valeur">';
1854 if ($action ==
'editthirdparty') {
1855 $htmlname =
'socid';
1856 print
'<form method="POST" action="'.$_SERVER[
'PHP_SELF'].
'" name="form'.$htmlname.
'">';
1857 print
'<input type="hidden" name="rowid" value="'.$object->id.
'">';
1858 print
'<input type="hidden" name="action" value="set'.$htmlname.
'">';
1859 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1860 print
'<table class="nobordernopadding">';
1862 print $form->select_company($object->socid,
'socid',
'', 1);
1864 print
'<td class="left"><input type="submit" class="button button-edit" value="'.$langs->trans(
"Modify").
'"></td>';
1865 print
'</tr></table></form>';
1867 if ($object->socid) {
1869 $result = $company->fetch($object->socid);
1870 print $company->getNomUrl(1);
1873 $tmparray = $company->getOutstandingBills(
'customer');
1874 if (!empty($tmparray[
'refs'])) {
1875 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']).
')';
1880 print
'<span class="opacitymedium">'.$langs->trans(
"NoThirdPartyAssociatedToMember").
'</span>';
1888 $editenable = $user->hasRight(
'adherent',
'creer') && $user->hasRight(
'user',
'user',
'creer');
1889 print $form->editfieldkey(
'LinkedToDolibarrUser',
'login',
'', $object, $editenable);
1890 print
'</td><td colspan="2" class="valeur">';
1891 if ($action ==
'editlogin') {
1892 $form->form_users($_SERVER[
'PHP_SELF'].
'?rowid='.$object->id, $object->user_id,
'userid',
'');
1894 if ($object->user_id) {
1895 $linkeduser =
new User($db);
1896 $linkeduser->fetch($object->user_id);
1897 print $linkeduser->getNomUrl(-1);
1899 print
'<span class="opacitymedium">'.$langs->trans(
"NoDolibarrAccess").
'</span>';
1906 print
"</div></div>\n";
1907 print
'<div class="clearboth"></div>';
1916 print
'<div class="tabsAction">';
1918 $parameters = array();
1919 $reshook = $hookmanager->executeHooks(
'addMoreActionsButtons', $parameters, $object, $action);
1920 if (empty($reshook)) {
1921 if ($action !=
'editlogin' && $action !=
'editthirdparty') {
1923 if (empty($user->socid)) {
1925 print
'<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?id='.((int) $object->id).
'&action=presend&mode=init#formmailbeforetitle">'.$langs->trans(
'SendMail').
'</a>'.
"\n";
1944 if ($user->hasRight(
'adherent',
'creer')) {
1945 print
'<a class="butAction" href="card.php?rowid='.((int) $object->id).
'&action=edit&token='.newToken().
'">'.$langs->trans(
"Modify").
'</a>'.
"\n";
1947 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"Modify").
'</span>'.
"\n";
1952 if ($user->hasRight(
'adherent',
'creer')) {
1953 print
'<a class="butAction" href="card.php?rowid='.((int) $object->id).
'&action=valid&token='.newToken().
'">'.$langs->trans(
"Validate").
'</a>'.
"\n";
1955 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"Validate").
'</span>'.
"\n";
1961 if ($user->hasRight(
'adherent',
'creer')) {
1962 print
'<a class="butAction" href="card.php?rowid='.((int) $object->id).
'&action=valid">'.$langs->trans(
"Reenable").
"</a>\n";
1964 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"Reenable").
'</span>'.
"\n";
1970 if ($user->hasRight(
'adherent',
'supprimer')) {
1971 print
'<a class="butAction" href="card.php?rowid='.((int) $object->id).
'&action=resiliate">'.$langs->trans(
"Resiliate").
"</a></span>\n";
1973 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"Resiliate").
'</span>'.
"\n";
1979 if ($user->hasRight(
'adherent',
'supprimer')) {
1980 print
'<a class="butAction" href="card.php?rowid='.((int) $object->id).
'&action=exclude">'.$langs->trans(
"Exclude").
"</a></span>\n";
1982 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"Exclude").
'</span>'.
"\n";
1987 if (isModEnabled(
'societe') && !$object->socid) {
1988 if ($user->hasRight(
'societe',
'creer')) {
1990 print
'<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?rowid='.((int) $object->id).
'&action=create_thirdparty" title="'.
dol_escape_htmltag($langs->trans(
"CreateDolibarrThirdPartyDesc")).
'">'.$langs->trans(
"CreateDolibarrThirdParty").
'</a>'.
"\n";
1992 print
'<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans(
"ValidateBefore")).
'">'.$langs->trans(
"CreateDolibarrThirdParty").
'</a>'.
"\n";
1995 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"CreateDolibarrThirdParty").
'</span>'.
"\n";
2000 if (!$user->socid && !$object->user_id) {
2001 if ($user->hasRight(
'user',
'user',
'creer')) {
2003 print
'<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?rowid='.((int) $object->id).
'&action=create_user" title="'.
dol_escape_htmltag($langs->trans(
"CreateDolibarrLoginDesc")).
'">'.$langs->trans(
"CreateDolibarrLogin").
'</a>'.
"\n";
2005 print
'<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans(
"ValidateBefore")).
'">'.$langs->trans(
"CreateDolibarrLogin").
'</a>'.
"\n";
2008 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"CreateDolibarrLogin").
'</span>'.
"\n";
2014 $isinspip = $mailmanspip->is_in_spip($object);
2016 if ($isinspip == 1) {
2017 print
'<a class="butAction" href="card.php?rowid='.((int) $object->id).
'&action=del_spip&token='.newToken().
'">'.$langs->trans(
"DeleteIntoSpip").
'</a>'.
"\n";
2019 if ($isinspip == 0) {
2020 print
'<a class="butAction" href="card.php?rowid='.((int) $object->id).
'&action=add_spip&token='.newToken().
'">'.$langs->trans(
"AddIntoSpip").
'</a>'.
"\n";
2025 if ($user->hasRight(
'adherent',
'supprimer')) {
2026 print
'<a class="butActionDelete" href="card.php?rowid='.((int) $object->id).
'&action=delete&token='.newToken().
'">'.$langs->trans(
"Delete").
'</a>'.
"\n";
2028 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"Delete").
'</span>'.
"\n";
2034 if ($isinspip == -1) {
2035 print
'<br><br><span class="error">'.$langs->trans(
'SPIPConnectionFailed').
': '.$mailmanspip->error.
'</span>';
2040 if (
GETPOST(
'modelselected')) {
2041 $action =
'presend';
2044 if ($action !=
'presend') {
2045 print
'<div class="fichecenter"><div class="fichehalfleft">';
2046 print
'<a name="builddoc"></a>';
2050 $filedir = $conf->adherent->dir_output.
'/'.
get_exdir(0, 0, 0, 1, $object,
'member');
2051 $urlsource = $_SERVER[
'PHP_SELF'].
'?id='.$object->id;
2052 $genallowed = $user->hasRight(
'adherent',
'lire');
2053 $delallowed = $user->hasRight(
'adherent',
'creer');
2055 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);
2056 $somethingshown = $formfile->numoffiles;
2070 $useonlinepayment = (isModEnabled(
'paypal') || isModEnabled(
'stripe') || isModEnabled(
'paybox'));
2072 if ($useonlinepayment) {
2074 if (empty($amount)) {
2075 $amount = max($adht->amount, $object->first_subscription_amount, $object->last_subscription_amount);
2077 if (empty($amount)) {
2080 require_once DOL_DOCUMENT_ROOT.
'/core/lib/payments.lib.php';
2081 print showOnlinePaymentUrl(
'membersubscription', $object->ref, $amount);
2084 print
'</div><div class="fichehalfright">';
2088 $morehtmlcenter =
dolGetButtonTitle($langs->trans(
'SeeAll'),
'',
'fa fa-bars imgforviewmode', DOL_URL_ROOT.
'/adherents/agenda.php?id='.$object->id);
2091 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formactions.class.php';
2093 $somethingshown =
$formactions->showactions($object, $object->element, $socid, 1,
'listactions', $MAX,
'', $morehtmlcenter);
2095 print
'</div></div>';
2099 $modelmail =
'member';
2100 $defaulttopic =
'CardContent';
2101 $diroutput = $conf->adherent->dir_output;
2102 $trackid =
'mem'.$object->id;
2104 include DOL_DOCUMENT_ROOT.
'/core/tpl/card_presend.tpl.php';
if(preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) if(preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) if($action=='set') elseif( $action=='specimen') elseif($action=='setmodel') elseif( $action=='del') elseif($action=='setdoc') $formactions
View.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage members of a foundation.
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=0, $outputlangs='', $entconv=1, $searchlabel='')
Return country label, code or id from an id, code or label.
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='')
Make control on an uploaded file from an GUI page and move it to 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_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='rowid', $fieldref='ref', $morehtmlref='', $moreparam='', $nodbprefix=0, $morehtmlleft='', $morehtmlstatus='', $onlybanner=0, $morehtmlright='')
Show tab footer of a card.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed informations (by default a local PHP server timestamp) Re...
picto_from_langcode($codelang, $moreatt='', $notitlealt=0)
Return img flag of country for a language code or country code.
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dolGetButtonTitle($label, $helpText='', $iconClass='fa fa-file', $url='', $id='', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
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.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='')
Show information for admin users or standard users.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
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.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
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...
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 informations.
$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.