35require
'../main.inc.php';
36require_once DOL_DOCUMENT_ROOT.
'/core/lib/member.lib.php';
37require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
38require_once DOL_DOCUMENT_ROOT.
'/core/lib/images.lib.php';
39require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
40require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
41require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
42require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent_type.class.php';
43require_once DOL_DOCUMENT_ROOT.
'/adherents/class/subscription.class.php';
44require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
45require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
46require_once DOL_DOCUMENT_ROOT.
'/core/class/extrafields.class.php';
47require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formadmin.class.php';
48require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
49require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
62$langs->loadLangs(array(
"companies",
"bills",
"members",
"users",
"other",
"paypal"));
66$action =
GETPOST(
'action',
'aZ09');
67$cancel =
GETPOST(
'cancel',
'alpha');
68$backtopage =
GETPOST(
'backtopage',
'alpha');
69$backtopageforcancel =
GETPOST(
'backtopageforcancel',
'alpha');
70$confirm =
GETPOST(
'confirm',
'alpha');
79if (isModEnabled(
'mailmanspip')) {
80 include_once DOL_DOCUMENT_ROOT.
'/mailmanspip/class/mailmanspip.class.php';
82 $langs->load(
'mailmanspip');
93$extrafields->fetch_name_optionals_label(
$object->table_element);
101if (!empty($canvas)) {
102 require_once DOL_DOCUMENT_ROOT.
'/core/class/canvas.class.php';
103 $objcanvas =
new Canvas($db, $action);
104 $objcanvas->getCanvas(
'adherent',
'membercard', $canvas);
108$hookmanager->initHooks(array(
'membercard',
'globalcard'));
111if ($id > 0 || !empty($ref)) {
113 $result =
$object->fetch($id, $ref);
116 $canadduser = ($user->admin || $user->hasRight(
'user',
'user',
'creer'));
120 $caneditfielduser = ((($user->id ==
$object->user_id) && $user->hasRight(
'user',
'self',
'creer'))
121 || (($user->id !=
$object->user_id) && $user->hasRight(
'user',
'user',
'creer')));
122 $caneditpassworduser = ((($user->id ==
$object->user_id) && $user->hasRight(
'user',
'self',
'password'))
123 || (($user->id !=
$object->user_id) && $user->hasRight(
'user',
'user',
'password')));
128$canaddmember = $user->hasRight(
'adherent',
'creer');
129$caneditfieldmember =
false;
132 $caneditfieldmember = $user->hasRight(
'adherent',
'creer');
134$permissiontoeditextra = $canaddmember;
135if (
GETPOST(
'attribute',
'aZ09') && isset($extrafields->attributes[
$object->table_element][
'perms'][
GETPOST(
'attribute',
'aZ09')])) {
137 $permissiontoeditextra =
dol_eval((
string) $extrafields->attributes[
$object->table_element][
'perms'][
GETPOST(
'attribute',
'aZ09')]);
143if (!$user->hasRight(
'adherent',
'creer') && $action ==
'edit') {
147$linkofpubliclist = DOL_MAIN_URL_ROOT.
'/public/members/public_list.php'.((isModEnabled(
'multicompany')) ?
'?entity='.
$conf->entity :
'');
154$parameters = array(
'id' => $id,
'rowid' => $id,
'objcanvas' => $objcanvas,
'confirm' => $confirm);
155$reshook = $hookmanager->executeHooks(
'doActions', $parameters,
$object, $action);
160if (empty($reshook)) {
161 $backurlforlist = DOL_URL_ROOT.
'/adherents/list.php';
163 if (empty($backtopage) || ($cancel && empty($id))) {
164 if (empty($backtopage) || ($cancel && strpos($backtopage,
'__ID__'))) {
165 if (empty($id) && (($action !=
'add' && $action !=
'create') || $cancel)) {
166 $backtopage = $backurlforlist;
168 $backtopage = DOL_URL_ROOT.
'/adherents/card.php?id='.((!empty($id) &&
$id > 0) ? $id :
'__ID__');
174 if (!empty($backtopageforcancel)) {
175 header(
"Location: ".$backtopageforcancel);
177 } elseif (!empty($backtopage)) {
178 header(
"Location: ".$backtopage);
184 if ($action ==
'setuserid' && ($user->hasRight(
'user',
'self',
'creer') || $user->hasRight(
'user',
'user',
'creer'))) {
186 if (!$user->hasRight(
'user',
'user',
'creer')) {
187 if ($userid != $user->id && $userid !=
$object->user_id) {
189 setEventMessages($langs->trans(
"ErrorUserPermissionAllowsToLinksToItselfOnly"),
null,
'errors');
194 if ($userid !=
$object->user_id) {
195 $result =
$object->setUserId($userid);
204 if ($action ==
'setsocid' && $caneditfieldmember) {
207 if ($socid !=
$object->socid) {
208 $sql =
"SELECT rowid FROM ".MAIN_DB_PREFIX.
"adherent";
209 $sql .=
" WHERE socid = ".((int) $socid);
210 $sql .=
" AND entity = ".$conf->entity;
211 $resql = $db->query($sql);
213 $obj = $db->fetch_object($resql);
214 if ($obj && $obj->rowid > 0) {
216 $othermember->fetch($obj->rowid);
217 $thirdparty =
new Societe($db);
218 $thirdparty->fetch($socid);
220 setEventMessages($langs->trans(
"ErrorMemberIsAlreadyLinkedToThisThirdParty", $othermember->getFullName($langs), $othermember->login, $thirdparty->name),
null,
'errors');
225 $result =
$object->setThirdPartyId($socid);
236 if ($action ==
'confirm_create_user' && $confirm ==
'yes' && $user->hasRight(
'user',
'user',
'creer')) {
239 $nuser =
new User($db);
241 if (
GETPOST(
'internalorexternal',
'aZ09') ==
'internal') {
242 $tmpuser->fk_soc = 0;
245 $result = $nuser->create_from_member($tmpuser,
GETPOST(
'login',
'alphanohtml'));
248 $langs->load(
"errors");
251 setEventMessages($langs->trans(
"NewUserCreated", $nuser->login),
null,
'mesgs');
260 if ($action ==
'confirm_create_thirdparty' && $confirm ==
'yes' && $user->hasRight(
'societe',
'creer')) {
264 $result = $company->create_from_member(
$object,
GETPOST(
'companyname',
'alpha'),
GETPOST(
'companyalias',
'alpha'));
267 $langs->load(
"errors");
276 if ($action ==
'update' && !$cancel && $user->hasRight(
'adherent',
'creer')) {
277 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
283 $lastname =
GETPOST(
"lastname",
'alphanohtml');
284 $firstname =
GETPOST(
"firstname",
'alphanohtml');
285 $gender =
GETPOST(
"gender",
'alphanohtml');
286 $societe =
GETPOST(
"societe",
'alphanohtml');
287 $morphy =
GETPOST(
"morphy",
'alphanohtml');
288 $login =
GETPOST(
"login",
'alphanohtml');
289 if ($morphy !=
'mor' && empty($lastname)) {
291 $langs->load(
"errors");
292 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Lastname")),
null,
'errors');
294 if ($morphy !=
'mor' && (!isset($firstname) || $firstname ==
'')) {
296 $langs->load(
"errors");
297 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Firstname")),
null,
'errors');
299 if ($morphy ==
'mor' && empty($societe)) {
301 $langs->load(
"errors");
302 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Company")),
null,
'errors');
308 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Login")),
null,
'errors');
312 if ($result > 0 && !$error) {
316 $object->civility_id = trim(
GETPOST(
"civility_id",
'alphanohtml'));
321 if (GETPOSTISSET(
'pass')) {
337 $object->email = preg_replace(
'/\s+/',
'',
GETPOST(
"member_email",
'alpha'));
339 $object->socialnetworks = array();
340 foreach ($socialnetworks as $key => $value) {
341 if (GETPOSTISSET($key) &&
GETPOST($key,
'alphanohtml') !=
'') {
342 $object->socialnetworks[$key] = trim(
GETPOST($key,
'alphanohtml'));
351 if (
GETPOST(
'deletephoto',
'alpha')) {
353 } elseif (!empty($_FILES[
'photo'][
'name'])) {
363 $ret = $extrafields->setOptionalsFromPost(
null,
$object,
'@GETPOSTISSET');
371 if ($user->id !=
$object->user_id && !$user->hasRight(
'user',
'user',
'creer')) {
378 if (GETPOSTISSET(
'pass')) {
381 if ($user->id ==
$object->user_id) {
382 if (!$user->hasRight(
'user',
'self',
'password')) {
386 if (!$user->hasRight(
'user',
'user',
'password')) {
394 $result =
$object->update($user, 0, $nosyncuser, $nosyncuserpass);
396 if ($result >= 0 && !count(
$object->errors)) {
397 $categories =
GETPOST(
'memcats',
'array');
398 $object->setCategories($categories);
402 $file_OK = is_uploaded_file($_FILES[
'photo'][
'tmp_name']);
405 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
407 $dirthumbs =
$conf->member->dir_output.
'/'.
get_exdir(0, 0, 0, 1,
$object,
'member').
'/photos/thumbs';
417 if (!
dol_move_uploaded_file($_FILES[
'photo'][
'tmp_name'], $newfile, 1, 0, $_FILES[
'photo'][
'error']) > 0) {
428 switch ($_FILES[
'photo'][
'error']) {
431 $errors[] =
"ErrorFileSizeTooLarge";
434 $errors[] =
"ErrorFilePartiallyUploaded";
443 if (!empty($backtopage)) {
444 header(
"Location: ".$backtopage);
459 if ($action ==
'add' && $user->hasRight(
'adherent',
'creer')) {
464 if (GETPOSTISSET(
"birthday") &&
GETPOST(
"birthday") && GETPOSTISSET(
"birthmonth") &&
GETPOST(
"birthmonth") && GETPOSTISSET(
"birthyear") &&
GETPOST(
"birthyear")) {
467 $datesubscription =
'';
468 if (GETPOSTISSET(
"reday") && GETPOSTISSET(
"remonth") && GETPOSTISSET(
"reyear")) {
473 $civility_id =
GETPOST(
"civility_id",
'alphanohtml');
474 $lastname =
GETPOST(
"lastname",
'alphanohtml');
475 $firstname =
GETPOST(
"firstname",
'alphanohtml');
476 $gender =
GETPOST(
"gender",
'alphanohtml');
477 $societe =
GETPOST(
"societe",
'alphanohtml');
478 $address =
GETPOST(
"address",
'alphanohtml');
479 $zip =
GETPOST(
"zipcode",
'alphanohtml');
480 $town =
GETPOST(
"town",
'alphanohtml');
484 $phone =
GETPOST(
"phone",
'alpha');
485 $phone_perso =
GETPOST(
"phone_perso",
'alpha');
486 $phone_mobile =
GETPOST(
"phone_mobile",
'alpha');
487 $email = preg_replace(
'/\s+/',
'',
GETPOST(
"member_email",
'aZ09arobase'));
488 $url = trim(
GETPOST(
'url',
'url'));
489 $login =
GETPOST(
"member_login",
'alphanohtml');
490 $pass =
GETPOST(
"password",
'password');
491 $photo =
GETPOST(
"photo",
'alphanohtml');
492 $morphy =
GETPOST(
"morphy",
'alphanohtml');
497 $default_lang =
GETPOST(
'default_lang',
'alpha');
499 $object->civility_id = $civility_id;
500 $object->firstname = $firstname;
509 $object->country_id = $country_id;
511 $object->phone_perso = $phone_perso;
512 $object->phone_mobile = $phone_mobile;
513 $object->socialnetworks = array();
514 if (isModEnabled(
'socialnetworks')) {
515 foreach ($socialnetworks as $key => $value) {
516 if (GETPOSTISSET($key) &&
GETPOST($key,
'alphanohtml') !=
'') {
517 $object->socialnetworks[$key] =
GETPOST(
"member_".$key,
'alphanohtml');
534 $object->default_lang = $default_lang;
536 $ret = $extrafields->setOptionalsFromPost(
null,
$object);
542 if (empty($morphy) || $morphy ==
"-1") {
544 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"MemberNature")),
null,
'errors');
550 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Login")),
null,
'errors');
552 $sql =
"SELECT login FROM ".MAIN_DB_PREFIX.
"adherent WHERE login='".$db->escape($login).
"'";
553 $result = $db->query($sql);
556 $num = $db->num_rows($result);
560 $langs->load(
"errors");
561 setEventMessages($langs->trans(
"ErrorLoginAlreadyExists", $login),
null,
'errors');
566 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Password")),
null,
'errors');
569 if ($morphy ==
'mor' && empty($societe)) {
571 $langs->load(
"errors");
572 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Company")),
null,
'errors');
574 if ($morphy !=
'mor' && empty($lastname)) {
576 $langs->load(
"errors");
577 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Lastname")),
null,
'errors');
579 if ($morphy !=
'mor' && (!isset($firstname) || $firstname ==
'')) {
581 $langs->load(
"errors");
582 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Firstname")),
null,
'errors');
584 if (!($typeid > 0)) {
586 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Type")),
null,
'errors');
590 $langs->load(
"errors");
594 $langs->load(
"errors");
598 if (isset($public)) {
606 $result =
$object->create($user);
609 $memcats =
GETPOST(
'memcats',
'array');
610 $object->setCategories($memcats);
617 $backtopage = preg_replace(
'/__ID__/', (
string) $id, $backtopage);
630 $result = $company->create_from_member(
$object);
632 $langs->load(
"errors");
641 $action = ($result < 0 || !$error) ?
'' :
'create';
643 if (!$error && $backtopage) {
644 header(
"Location: ".$backtopage);
649 if ($user->hasRight(
'adherent',
'supprimer') && $action ==
'confirm_delete' && $confirm ==
'yes') {
650 $result =
$object->delete($user);
653 if (!empty($backtopage) && !preg_match(
'/'.preg_quote($_SERVER[
"PHP_SELF"],
'/').
'/', $backtopage)) {
654 header(
"Location: ".$backtopage);
657 header(
"Location: list.php");
665 if ($user->hasRight(
'adherent',
'creer') && $action ==
'confirm_valid' && $confirm ==
'yes') {
673 $result =
$object->validate($user);
675 if ($result >= 0 && !count(
$object->errors)) {
682 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
686 $outputlangs->setDefaultLang(empty(
$object->thirdparty->default_lang) ? $mysoc->default_lang :
$object->thirdparty->default_lang);
688 $outputlangs->loadLangs(array(
"main",
"members",
"companies",
"install",
"other"));
690 $arraydefaultmessage =
null;
693 if (!empty($labeltouse)) {
694 $arraydefaultmessage = $formmail->getEMailTemplate($db,
'member', $user, $outputlangs, 0, 1, $labeltouse);
697 if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
698 $subject = (string) $arraydefaultmessage->topic;
699 $msg = (string) $arraydefaultmessage->content;
702 if (empty($labeltouse) || (
int) $labeltouse === -1) {
704 $langs->load(
"errors");
705 setEventMessages(
'<a href="'.DOL_URL_ROOT.
'/adherents/admin/member_emails.php">'.$langs->trans(
'WarningMandatorySetupNotComplete').
'</a>',
null,
'errors');
708 $substitutionarray = getCommonSubstitutionArray($outputlangs, 0,
null,
$object);
713 $moreinheader =
'X-Dolibarr-Info: send_an_email by adherents/card.php'.
"\r\n";
715 $result =
$object->sendEmail($texttosend, $subjecttosend, array(), array(), array(),
"",
"", 0, -1,
'', $moreinheader);
735 if ($user->hasRight(
'adherent',
'supprimer') && $action ==
'confirm_resiliate') {
738 if ($confirm ==
'yes') {
742 $result =
$object->resiliate($user);
744 if ($result >= 0 && !count(
$object->errors)) {
750 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
754 $outputlangs->setDefaultLang(empty(
$object->thirdparty->default_lang) ? $mysoc->default_lang :
$object->thirdparty->default_lang);
756 $outputlangs->loadLangs(array(
"main",
"members",
"companies",
"install",
"other"));
758 $arraydefaultmessage =
null;
761 if (!empty($labeltouse)) {
762 $arraydefaultmessage = $formmail->getEMailTemplate($db,
'member', $user, $outputlangs, 0, 1, $labeltouse);
765 if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
766 $subject = (string) $arraydefaultmessage->topic;
767 $msg = (string) $arraydefaultmessage->content;
770 if (empty($labeltouse) || (
int) $labeltouse === -1) {
775 $substitutionarray = getCommonSubstitutionArray($outputlangs, 0,
null,
$object);
780 $moreinheader =
'X-Dolibarr-Info: send_an_email by adherents/card.php'.
"\r\n";
782 $result =
$object->sendEmail($texttosend, $subjecttosend, array(), array(), array(),
"",
"", 0, -1,
'', $moreinheader);
796 if (!empty($backtopage) && !$error) {
797 header(
"Location: ".$backtopage);
802 if ($user->hasRight(
'adherent',
'supprimer') && $action ==
'confirm_exclude') {
805 if ($confirm ==
'yes') {
809 $result =
$object->exclude($user);
811 if ($result >= 0 && !count(
$object->errors)) {
817 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
821 $outputlangs->setDefaultLang(empty(
$object->thirdparty->default_lang) ? $mysoc->default_lang :
$object->thirdparty->default_lang);
823 $outputlangs->loadLangs(array(
"main",
"members",
"companies",
"install",
"other"));
825 $arraydefaultmessage =
null;
828 if (!empty($labeltouse)) {
829 $arraydefaultmessage = $formmail->getEMailTemplate($db,
'member', $user, $outputlangs, 0, 1, $labeltouse);
832 if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
833 $subject = (string) $arraydefaultmessage->topic;
834 $msg = (string) $arraydefaultmessage->content;
837 if (empty($labeltouse) || (
int) $labeltouse === -1) {
842 $substitutionarray = getCommonSubstitutionArray($outputlangs, 0,
null,
$object);
847 $moreinheader =
'X-Dolibarr-Info: send_an_email by adherents/card.php'.
"\r\n";
849 $result =
$object->sendEmail($texttosend, $subjecttosend, array(), array(), array(),
"",
"", 0, -1,
'', $moreinheader);
863 if (!empty($backtopage) && !$error) {
864 header(
"Location: ".$backtopage);
869 if ($action ==
'update_extras' && $permissiontoeditextra) {
871 $attribute_name =
GETPOST(
'attribute',
'aZ09');
874 $ret = $extrafields->setOptionalsFromPost(
null,
$object, $attribute_name);
879 $result =
$object->updateExtraField($attribute_name,
'MEMBER_MODIFY');
886 $action =
'edit_extras';
891 if (is_object($mailmanspip)) {
892 if ($user->hasRight(
'adherent',
'supprimer') && $action ==
'confirm_del_spip' && $confirm ==
'yes') {
894 if (!$mailmanspip->del_to_spip(
$object)) {
895 setEventMessages($langs->trans(
'DeleteIntoSpipError').
': '.$mailmanspip->error,
null,
'errors');
900 if ($user->hasRight(
'adherent',
'creer') && $action ==
'confirm_add_spip' && $confirm ==
'yes') {
902 if (!$mailmanspip->add_to_spip(
$object)) {
903 setEventMessages($langs->trans(
'AddIntoSpipError').
': '.$mailmanspip->error,
null,
'errors');
910 include DOL_DOCUMENT_ROOT.
'/core/actions_printing.inc.php';
913 $upload_dir =
$conf->member->dir_output;
914 $permissiontoadd = $user->hasRight(
'adherent',
'creer');
915 include DOL_DOCUMENT_ROOT.
'/core/actions_builddoc.inc.php';
918 $triggersendname =
'MEMBER_SENTBYMAIL';
920 $mode =
'emailfrommember';
921 $trackid =
'mem'.$object->id;
922 include DOL_DOCUMENT_ROOT.
'/core/actions_sendmails.inc.php';
930$form =
new Form($db);
935$title = $langs->trans(
"Member").
" - ".$langs->trans(
"Card");
936$help_url =
'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder';
938llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'mod-member page-card');
940$countrynotdefined = $langs->trans(
"ErrorSetACountryFirst").
' ('.$langs->trans(
"SeeAbove").
')';
942if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
946 if (empty(
$object->error) && $id) {
954 $objcanvas->display_canvas($action);
961 if ($action ==
'create') {
969 $object->country_code = $tmparray[
'code'];
970 $object->country = $tmparray[
'label'];
974 if (!empty($socid)) {
979 if (!($soc->id > 0)) {
980 $langs->load(
"errors");
981 print($langs->trans(
'ErrorRecordNotFound'));
990 if (
$conf->use_javascript_ajax) {
991 print
"\n".
'<script type="text/javascript">'.
"\n";
992 print
'jQuery(document).ready(function () {
993 jQuery("#selectcountry_id").change(function() {
994 document.formsoc.action.value="create";
995 document.formsoc.submit();
997 function initfieldrequired() {
998 jQuery("#tdcompany").removeClass("fieldrequired");
999 jQuery("#tdlastname").removeClass("fieldrequired");
1000 jQuery("#tdfirstname").removeClass("fieldrequired");
1001 if (jQuery(\'input[name="morphy"]:checked\').val() == \'mor\') {
1002 jQuery("#tdcompany").addClass("fieldrequired");
1004 if (jQuery(\'input[name="morphy"]:checked\').val() == \'phy\') {
1005 jQuery("#tdlastname").addClass("fieldrequired");
1006 jQuery("#tdfirstname").addClass("fieldrequired");
1009 jQuery(\'input[name="morphy"]\').change(function() {
1010 initfieldrequired();
1012 initfieldrequired();
1014 print
'</script>'.
"\n";
1017 print
'<form name="formsoc" action="'.$_SERVER[
"PHP_SELF"].
'" method="post" enctype="multipart/form-data">';
1018 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1019 print
'<input type="hidden" name="action" value="add">';
1020 print
'<input type="hidden" name="socid" value="'.$socid.
'">';
1022 print
'<input type="hidden" name="backtopage" value="'.($backtopage !=
'1' ? $backtopage : $_SERVER[
"HTTP_REFERER"]).
'">';
1027 print
'<table class="border centpercent">';
1032 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>';
1037 require_once DOL_DOCUMENT_ROOT.
'/core/lib/security2.lib.php';
1039 print
'<tr><td><span class="fieldrequired">'.$langs->trans(
"Password").
'</span></td><td>';
1040 print
'<input type="text" class="minwidth300" maxlength="50" name="password" value="'.dol_escape_htmltag($generated_password).
'">';
1045 print
'<tr><td class="fieldrequired">'.$langs->trans(
"MemberType").
'</td><td>';
1046 $listetype = $adht->liste_array(1);
1047 print
img_picto(
'', $adht->picto,
'class="pictofixedwidth"');
1048 if (count($listetype)) {
1049 print $form->selectarray(
"typeid", $listetype, (
GETPOSTINT(
'typeid') ?
GETPOSTINT(
'typeid') : $typeid), (count($listetype) > 1 ? 1 : 0), 0, 0,
'', 0, 0, 0,
'',
'minwidth200', 1);
1051 print
'<span class="error">'.$langs->trans(
"NoTypeDefinedGoToSetup").
'</span>';
1053 if ($user->hasRight(
'member',
'configurer')) {
1054 print
' <a href="'.DOL_URL_ROOT.
'/adherents/type.php?action=create&backtopage='.urlencode($_SERVER[
"PHP_SELF"].
'?action=create&typeid=--IDFORBACKTOPAGE--').
'"><span class="fa fa-plus-circle valignmiddle paddingleft" title="'.$langs->trans(
"NewMemberType").
'"></span></a>';
1060 $morphys[
"phy"] = $langs->trans(
"Physical");
1061 $morphys[
"mor"] = $langs->trans(
"Moral");
1062 $checkednature =
GETPOST(
"morphy",
'alpha');
1064 print
'<tr><td class="fieldrequired">'.$langs->trans(
"MemberNature").
"</td><td>\n";
1065 print
'<span id="spannature1" class="nonature-back spannature paddinglarge marginrightonly"><label for="phisicalinput" class="valignmiddle">'.$morphys[
"phy"].
'<input id="phisicalinput" class="flat checkforselect marginleftonly valignmiddle" type="radio" name="morphy" value="phy"'.($checkednature ==
"phy" ?
' checked="checked"' :
'').
'></label></span>';
1066 print
'<span id="spannature2" class="nonature-back spannature paddinglarge marginrightonly"><label for="moralinput" class="valignmiddle">'.$morphys[
"mor"].
'<input id="moralinput" class="flat checkforselect marginleftonly valignmiddle" type="radio" name="morphy" value="mor"'.($checkednature ==
"mor" ?
' checked="checked"' :
'').
'></label></span>';
1069 if (
$conf->use_javascript_ajax) {
1071 function refreshNatureCss() {
1072 jQuery(".spannature").each(function( index ) {
1073 console.log(jQuery("#spannature"+(index+1)+" .checkforselect").is(":checked"));
1074 if (jQuery("#spannature"+(index+1)+" .checkforselect").is(":checked")) {
1076 jQuery("#spannature"+(index+1)).addClass("member-individual-back").removeClass("nonature-back");
1079 jQuery("#spannature"+(index+1)).addClass("member-company-back").removeClass("nonature-back");
1082 jQuery("#spannature"+(index+1)).removeClass("member-individual-back").removeClass("member-company-back").addClass("nonature-back");
1086 jQuery(".spannature").click(function(){
1087 console.log("We click on a nature");
1097 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>';
1100 print
'<tr><td>'.$langs->trans(
"UserTitle").
'</td><td>';
1101 print $formcompany->select_civility(
GETPOSTINT(
'civility_id') ?
GETPOSTINT(
'civility_id') :
$object->civility_id,
'civility_id',
'maxwidth150', 1).
'</td>';
1105 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>';
1109 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>';
1113 print
'<tr><td>'.$langs->trans(
"Gender").
'</td>';
1115 $arraygender = array(
'man' => $langs->trans(
"Genderman"),
'woman' => $langs->trans(
"Genderwoman"),
'other' => $langs->trans(
"Genderother"));
1116 print $form->selectarray(
'gender', $arraygender,
GETPOST(
'gender',
'alphanohtml'), 1, 0, 0,
'', 0, 0, 0,
'',
'minwidth100', 1);
1120 print
'<tr><td>'.(getDolGlobalString(
'ADHERENT_MAIL_REQUIRED') ?
'<span class="fieldrequired">' :
'').$langs->trans(
"EMail").(getDolGlobalString(
'ADHERENT_MAIL_REQUIRED') ?
'</span>' :
'').
'</td>';
1121 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>';
1124 print
'<tr><td>'.$form->editfieldkey(
'Web',
'member_url',
GETPOST(
'member_url',
'alpha'),
$object, 0).
'</td>';
1125 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>';
1128 print
'<tr><td class="tdtop">'.$langs->trans(
"Address").
'</td><td>';
1129 print
'<textarea name="address" wrap="soft" class="quatrevingtpercent" rows="2">'.(GETPOSTISSET(
'address') ?
GETPOST(
'address',
'alphanohtml') : $soc->
address).
'</textarea>';
1133 print
'<tr><td>'.$langs->trans(
"Zip").
' / '.$langs->trans(
"Town").
'</td><td>';
1134 print $formcompany->select_ziptown((GETPOSTISSET(
'zipcode') ?
GETPOST(
'zipcode',
'alphanohtml') : $soc->zip),
'zipcode', array(
'town',
'selectcountry_id',
'state_id'), 6);
1136 print $formcompany->select_ziptown((GETPOSTISSET(
'town') ?
GETPOST(
'town',
'alphanohtml') : $soc->town),
'town', array(
'zipcode',
'selectcountry_id',
'state_id'));
1140 if (empty($soc->country_id)) {
1141 $soc->country_id = $mysoc->country_id;
1142 $soc->country_code = $mysoc->country_code;
1143 $soc->state_id = $mysoc->state_id;
1145 print
'<tr><td>'.$langs->trans(
'Country').
'</td><td>';
1146 print
img_picto(
'',
'country',
'class="pictofixedwidth"');
1147 print $form->select_country(GETPOSTISSET(
'country_id') ?
GETPOST(
'country_id',
'alpha') : $soc->country_id,
'country_id');
1149 print
info_admin($langs->trans(
"YouCanChangeValuesForThisListFromDictionarySetup"), 1);
1155 print
'<tr><td>'.$langs->trans(
'State').
'</td><td>';
1156 if ($soc->country_id || GETPOSTISSET(
'country_id')) {
1157 print
img_picto(
'',
'state',
'class="pictofixedwidth"');
1158 print $formcompany->select_state(GETPOSTISSET(
'state_id') ?
GETPOSTINT(
'state_id') : $soc->state_id, GETPOSTISSET(
'country_id') ?
GETPOSTINT(
'country_id') : $soc->country_code);
1160 print $countrynotdefined;
1166 print
'<tr><td>'.$langs->trans(
"PhonePro").
'</td>';
1167 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>';
1170 print
'<tr><td>'.$langs->trans(
"PhonePerso").
'</td>';
1171 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>';
1174 print
'<tr><td>'.$langs->trans(
"PhoneMobile").
'</td>';
1175 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>';
1177 if (isModEnabled(
'socialnetworks')) {
1178 foreach ($socialnetworks as $key => $value) {
1179 if (!$value[
'active']) {
1182 $val = (GETPOSTISSET(
'member_'.$key) ?
GETPOST(
'member_'.$key,
'alpha') : (empty(
$object->socialnetworks[$key]) ?
'' :
$object->socialnetworks[$key]));
1183 print
'<tr><td>'.$langs->trans($value[
'label']).
'</td><td><input type="text" name="member_'.$key.
'" size="40" value="'.$val.
'"></td></tr>';
1188 print
"<tr><td>".$langs->trans(
"DateOfBirth").
"</td><td>\n";
1189 print
img_picto(
'',
'object_calendar',
'class="pictofixedwidth"').$form->selectDate((
$object->birth ?
$object->birth : -1),
'birth', 0, 0, 1,
'formsoc');
1190 print
"</td></tr>\n";
1194 $htmltext = $langs->trans(
"Public",
getDolGlobalString(
'MAIN_INFO_SOCIETE_NOM'), $linkofpubliclist);
1195 print $form->textwithpicto($langs->trans(
"MembershipPublic"), $htmltext, 1,
'help',
'', 0, 3,
'membershippublic');
1196 print
"</td><td>\n";
1197 print $form->selectyesno(
"public",
$object->public, 1,
false, 0, 1);
1198 print
"</td></tr>\n";
1201 if (isModEnabled(
'category') && $user->hasRight(
'categorie',
'lire')) {
1202 print
'<tr><td>'.$form->editfieldkey(
"Categories",
'memcats',
'',
$object, 0).
'</td><td>';
1203 print $form->selectCategories(Categorie::TYPE_MEMBER,
'memcats',
$object);
1208 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_add.tpl.php';
1215 print $form->buttonsSaveCancel(
"AddMember");
1221 if ($action ==
'edit') {
1227 $res =
$object->fetch_optionals();
1234 $adht->fetch(
$object->typeid);
1238 if (!empty($country) ||
$object->country_id) {
1239 $sql =
"SELECT rowid, code, label from ".MAIN_DB_PREFIX.
"c_country";
1240 $sql .=
" WHERE rowid = ".(int) (!empty($country) ? $country :
$object->country_id);
1241 $resql = $db->query($sql);
1243 $obj = $db->fetch_object($resql);
1248 if (is_object($obj)) {
1249 $object->country_id = $obj->rowid;
1250 $object->country_code = $obj->code;
1251 $object->country = $langs->trans(
"Country".$obj->code) ? $langs->trans(
"Country".$obj->code) : $obj->label;
1258 if (
$conf->use_javascript_ajax) {
1259 print
"\n".
'<script type="text/javascript">';
1260 print
'jQuery(document).ready(function () {
1261 jQuery("#selectcountry_id").change(function() {
1262 document.formsoc.action.value="edit";
1263 document.formsoc.submit();
1265 function initfieldrequired() {
1266 jQuery("#tdcompany").removeClass("fieldrequired");
1267 jQuery("#tdlastname").removeClass("fieldrequired");
1268 jQuery("#tdfirstname").removeClass("fieldrequired");
1269 if (jQuery(\'input[name="morphy"]:checked\').val() == \'mor\') {
1270 jQuery("#tdcompany").addClass("fieldrequired");
1272 if (jQuery(\'input[name="morphy"]:checked\').val() == \'phy\') {
1273 jQuery("#tdlastname").addClass("fieldrequired");
1274 jQuery("#tdfirstname").addClass("fieldrequired");
1277 jQuery(\'input[name="morphy"]\').change(function() {
1278 initfieldrequired();
1280 initfieldrequired();
1282 print
'</script>'.
"\n";
1285 print
'<form name="formsoc" action="'.$_SERVER[
"PHP_SELF"].
'" method="post" enctype="multipart/form-data">';
1286 print
'<input type="hidden" name="token" value="'.newToken().
'" />';
1287 print
'<input type="hidden" name="action" value="update" />';
1288 print
'<input type="hidden" name="rowid" value="'.$id.
'" />';
1289 print
'<input type="hidden" name="statut" value="'.$object->status.
'" />';
1291 print
'<input type="hidden" name="backtopage" value="'.($backtopage !=
'1' ? $backtopage : $_SERVER[
"HTTP_REFERER"]).
'">';
1296 print
'<table class="border centpercent">';
1299 print
'<tr><td class="titlefieldcreate">'.$langs->trans(
"Ref").
'</td><td class="valeur">'.
$object->ref.
'</td></tr>';
1303 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>';
1308 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Password").
'</td><td><input type="password" name="pass" class="minwidth300" maxlength="50" value="'.
dol_escape_htmltag(GETPOSTISSET(
"pass") ?
GETPOST(
"pass",
'password', 2) :
'').
'"></td></tr>';
1312 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Type").
'</td><td>';
1313 if ($user->hasRight(
'adherent',
'creer')) {
1314 print $form->selectarray(
"typeid", $adht->liste_array(), (GETPOSTISSET(
"typeid") ?
GETPOSTINT(
"typeid") :
$object->typeid), 0, 0, 0,
'', 0, 0, 0,
'',
'minwidth200', 1);
1316 print $adht->getNomUrl(1);
1317 print
'<input type="hidden" name="typeid" value="'.$object->typeid.
'">';
1322 $morphys[
"phy"] = $langs->trans(
"Physical");
1323 $morphys[
"mor"] = $langs->trans(
"Moral");
1324 $checkednature = (GETPOSTISSET(
"morphy") ?
GETPOST(
"morphy",
'alpha') :
$object->morphy);
1325 print
'<tr><td><span class="fieldrequired">'.$langs->trans(
"MemberNature").
'</span></td><td>';
1326 print
'<span id="spannature1" class="member-individual-back spannature paddinglarge marginrightonly"><label for="phisicalinput" class="valignmiddle">'.$morphys[
"phy"].
'<input id="phisicalinput" class="flat checkforselect marginleftonly valignmiddle" type="radio" name="morphy" value="phy"'.($checkednature ==
"phy" ?
' checked="checked"' :
'').
'></label></span>';
1327 print
'<span id="spannature1" class="member-company-back spannature paddinglarge marginrightonly"><label for="moralinput" class="valignmiddle">'.$morphys[
"mor"].
'<input id="moralinput" class="flat checkforselect marginleftonly valignmiddle" type="radio" name="morphy" value="mor"'.($checkednature ==
"mor" ?
' checked="checked"' :
'').
'></label></span>';
1331 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>';
1334 print
'<tr><td>'.$langs->trans(
"UserTitle").
'</td><td>';
1335 print $formcompany->select_civility(GETPOSTISSET(
"civility_id") ?
GETPOST(
"civility_id",
'alpha') :
$object->civility_id,
'civility_id',
'maxwidth150', 1);
1340 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>';
1344 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>';
1348 print
'<tr><td>'.$langs->trans(
"Gender").
'</td>';
1350 $arraygender = array(
'man' => $langs->trans(
"Genderman"),
'woman' => $langs->trans(
"Genderwoman"),
'other' => $langs->trans(
"Genderother"));
1351 print $form->selectarray(
'gender', $arraygender, GETPOSTISSET(
'gender') ?
GETPOST(
'gender',
'alphanohtml') :
$object->gender, 1, 0, 0,
'', 0, 0, 0,
'',
'minwidth100', 1);
1355 print
'<tr><td>'.$langs->trans(
"Photo").
'</td>';
1356 print
'<td class="hideonsmartphone" valign="middle">';
1357 print $form->showphoto(
'memberphoto',
$object).
"\n";
1358 if ($caneditfieldmember) {
1362 print
'<table class="nobordernopadding">';
1364 print
'<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"><label for="photodelete" class="paddingleft">'.$langs->trans(
"Delete").
'</label><br></td></tr>';
1368 $maxmin = $maxfilesizearray[
'maxmin'];
1370 print
'<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).
'">';
1372 print
'<input type="file" class="flat" name="photo" id="photoinput">';
1379 print
'<tr><td>'.(getDolGlobalString(
"ADHERENT_MAIL_REQUIRED") ?
'<span class="fieldrequired">' :
'').$langs->trans(
"EMail").(getDolGlobalString(
"ADHERENT_MAIL_REQUIRED") ?
'</span>' :
'').
'</td>';
1380 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",
'alphanohtml', 2) :
$object->
email).
'"></td></tr>';
1383 print
'<tr><td>'.$form->editfieldkey(
'Web',
'member_url',
GETPOST(
'member_url',
'alpha'),
$object, 0).
'</td>';
1384 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>';
1387 print
'<tr><td>'.$langs->trans(
"Address").
'</td><td>';
1388 print
'<textarea name="address" wrap="soft" class="quatrevingtpercent" rows="'.ROWS_2.
'">'.(GETPOSTISSET(
"address") ?
GETPOST(
"address",
'alphanohtml', 2) :
$object->
address).
'</textarea>';
1392 print
'<tr><td>'.$langs->trans(
"Zip").
' / '.$langs->trans(
"Town").
'</td><td>';
1393 print $formcompany->select_ziptown((GETPOSTISSET(
"zipcode") ?
GETPOST(
"zipcode",
'alphanohtml', 2) :
$object->zip),
'zipcode', array(
'town',
'selectcountry_id',
'state_id'), 6);
1395 print $formcompany->select_ziptown((GETPOSTISSET(
"town") ?
GETPOST(
"town",
'alphanohtml', 2) :
$object->town),
'town', array(
'zipcode',
'selectcountry_id',
'state_id'));
1400 print
'<tr><td>'.$langs->trans(
'Country').
'</td><td>';
1401 print
img_picto(
'',
'country',
'class="pictofixedwidth"');
1402 print $form->select_country(GETPOSTISSET(
"country_id") ?
GETPOST(
"country_id",
"alpha") :
$object->country_id,
'country_id');
1404 print
info_admin($langs->trans(
"YouCanChangeValuesForThisListFromDictionarySetup"), 1);
1410 print
'<tr><td>'.$langs->trans(
'State').
'</td><td>';
1411 print
img_picto(
'',
'state',
'class="pictofixedwidth"');
1412 print $formcompany->select_state(
$object->state_id, GETPOSTISSET(
"country_id") ?
GETPOST(
"country_id",
"alpha") :
$object->country_id);
1417 print
'<tr><td>'.$langs->trans(
"PhonePro").
'</td>';
1418 print
'<td>'.img_picto(
'',
'object_phoning',
'class="pictofixedwidth"').
'<input type="text" name="phone" value="'.(GETPOSTISSET(
"phone") ?
GETPOST(
"phone") :
$object->phone).
'"></td></tr>';
1421 print
'<tr><td>'.$langs->trans(
"PhonePerso").
'</td>';
1422 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>';
1425 print
'<tr><td>'.$langs->trans(
"PhoneMobile").
'</td>';
1426 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>';
1428 if (isModEnabled(
'socialnetworks')) {
1429 foreach ($socialnetworks as $key => $value) {
1430 if (!$value[
'active']) {
1433 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>';
1438 print
"<tr><td>".$langs->trans(
"DateOfBirth").
"</td><td>\n";
1439 print
img_picto(
'',
'object_calendar',
'class="pictofixedwidth"').$form->selectDate((
$object->birth ?
$object->birth : -1),
'birth', 0, 0, 1,
'formsoc');
1440 print
"</td></tr>\n";
1444 print
'<tr><td>'.$form->editfieldkey(
'DefaultLang',
'default_lang',
'',
$object, 0).
'</td><td colspan="3">'.
"\n";
1445 print
img_picto(
'',
'language',
'class="pictofixedwidth"').$formadmin->select_language(
$object->default_lang,
'default_lang', 0, array(), 1);
1452 $htmltext = $langs->trans(
"Public",
getDolGlobalString(
'MAIN_INFO_SOCIETE_NOM'), $linkofpubliclist);
1453 print $form->textwithpicto($langs->trans(
"MembershipPublic"), $htmltext, 1,
'help',
'', 0, 3,
'membershippublic');
1454 print
"</td><td>\n";
1455 print $form->selectyesno(
"public", (GETPOSTISSET(
"public") ?
GETPOST(
"public",
'alphanohtml', 2) :
$object->public), 1, false, 0, 1);
1456 print
"</td></tr>\n";
1459 if (isModEnabled(
'category') && $user->hasRight(
'categorie',
'lire')) {
1460 print
'<tr><td>'.$form->editfieldkey(
"Categories",
'memcats',
'',
$object, 0).
'</td>';
1462 print $form->selectCategories(Categorie::TYPE_MEMBER,
'memcats',
$object);
1467 if (isModEnabled(
'societe')) {
1468 print
'<tr><td>'.$langs->trans(
"LinkedToDolibarrThirdParty").
'</td><td colspan="2" class="valeur">';
1471 $result = $company->fetch(
$object->socid);
1472 print $company->getNomUrl(1);
1474 print $langs->trans(
"NoThirdPartyAssociatedToMember");
1480 print
'<tr><td>'.$langs->trans(
"LinkedToDolibarrUser").
'</td><td colspan="2" class="valeur">';
1482 $form->form_users($_SERVER[
'PHP_SELF'].
'?rowid='.
$object->id, (
string)
$object->user_id,
'none');
1484 print $langs->trans(
"NoDolibarrAccess");
1489 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_edit.tpl.php';
1494 print $form->buttonsSaveCancel(
"Save",
'Cancel');
1500 if ($id > 0 && $action !=
'edit') {
1506 $res =
$object->fetch_optionals();
1513 $res = $adht->fetch(
$object->typeid);
1525 print
dol_get_fiche_head($head,
'general', $langs->trans(
"Member"), -1,
'user', 0,
'',
'', 0,
'', 1);
1528 if ($action ==
'create_user') {
1529 $login = (GETPOSTISSET(
'login') ?
GETPOST(
'login',
'alphanohtml') :
$object->login);
1530 if (empty($login)) {
1532 include_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
1535 if (empty($login)) {
1536 $login = strtolower(substr(
$object->firstname, 0, 4)).strtolower(substr(
$object->lastname, 0, 4));
1540 $formquestion = array(
1541 array(
'label' => $langs->trans(
"LoginToCreate"),
'type' =>
'text',
'name' =>
'login',
'value' => $login)
1543 if (isModEnabled(
'societe') &&
$object->socid > 0) {
1545 $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")));
1548 if (isModEnabled(
'societe') &&
$object->socid <= 0) {
1549 $text .= $langs->trans(
"UserWillBeInternalUser").
'<br>';
1551 $text .= $langs->trans(
"ConfirmCreateLogin");
1552 print $form->formconfirm($_SERVER[
"PHP_SELF"].
"?rowid=".
$object->id, $langs->trans(
"CreateDolibarrLogin"), $text,
"confirm_create_user", $formquestion,
'yes');
1556 if ($action ==
'create_thirdparty') {
1558 $fullname =
$object->getFullName($langs);
1560 if (
$object->morphy ==
'mor') {
1561 $companyname = (string)
$object->company;
1562 if (!empty($fullname)) {
1563 $companyalias = (string) $fullname;
1566 $companyname = $fullname;
1567 if (!empty(
$object->company)) {
1568 $companyalias = (string)
$object->company;
1573 $formquestion = array(
1574 array(
'label' => $langs->trans(
"NameToCreate"),
'type' =>
'text',
'name' =>
'companyname',
'value' => $companyname,
'morecss' =>
'minwidth300',
'moreattr' =>
'maxlength="128"'),
1575 array(
'label' => $langs->trans(
"AliasNames"),
'type' =>
'text',
'name' =>
'companyalias',
'value' => $companyalias,
'morecss' =>
'minwidth300',
'moreattr' =>
'maxlength="128"')
1578 print $form->formconfirm($_SERVER[
"PHP_SELF"].
"?rowid=".
$object->id, $langs->trans(
"CreateDolibarrThirdParty"), $langs->trans(
"ConfirmCreateThirdParty"),
"confirm_create_thirdparty", $formquestion,
'yes');
1582 if ($action ==
'valid') {
1583 $langs->load(
"mails");
1586 $adht->fetch(
$object->typeid);
1592 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
1596 $outputlangs->setDefaultLang(empty(
$object->thirdparty->default_lang) ? $mysoc->default_lang :
$object->thirdparty->default_lang);
1598 $outputlangs->loadLangs(array(
"main",
"members",
"companies",
"install",
"other"));
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 = (string) $arraydefaultmessage->topic;
1609 $msg = (string) $arraydefaultmessage->content;
1612 $substitutionarray = getCommonSubstitutionArray($outputlangs, 0,
null,
$object);
1617 $tmp = $langs->trans(
"SendingAnEMailToMember");
1618 $tmp .=
'<br>'.$langs->trans(
"MailFrom").
': <b>'.
getDolGlobalString(
'ADHERENT_MAIL_FROM',
$conf->email_from).
'</b>, ';
1619 $tmp .=
'<br>'.$langs->trans(
"MailRecipient").
': <b>'.
$object->email.
'</b>';
1621 $helpcontent .=
'<b>'.$langs->trans(
"MailFrom").
'</b>: '.
getDolGlobalString(
'ADHERENT_MAIL_FROM',
$conf->email_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>';
1629 $label = $form->textwithpicto($tmp, $helpcontent, 1,
'help');
1632 $formquestion = array();
1634 $formquestion[] = array(
'type' =>
'checkbox',
'name' =>
'send_mail',
'label' => $label,
'value' => (
getDolGlobalString(
'ADHERENT_DEFAULT_SENDINFOBYMAIL') ?
true : false));
1637 $formquestion[] = array(
'type' =>
'other',
'label' => $langs->transnoentitiesnoconv(
"SynchroMailManEnabled"),
'value' =>
'');
1640 $formquestion[] = array(
'type' =>
'other',
'label' => $langs->transnoentitiesnoconv(
"SynchroSpipEnabled"),
'value' =>
'');
1642 print $form->formconfirm(
"card.php?rowid=".$id, $langs->trans(
"ValidateMember"), $langs->trans(
"ConfirmValidateMember"),
"confirm_valid", $formquestion,
'yes', 1, 250);
1646 if ($action ==
'resiliate') {
1647 $langs->load(
"mails");
1650 $adht->fetch(
$object->typeid);
1656 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
1660 $outputlangs->setDefaultLang(empty(
$object->thirdparty->default_lang) ? $mysoc->default_lang :
$object->thirdparty->default_lang);
1662 $outputlangs->loadLangs(array(
"main",
"members"));
1664 $arraydefaultmessage =
null;
1667 if (!empty($labeltouse)) {
1668 $arraydefaultmessage = $formmail->getEMailTemplate($db,
'member', $user, $outputlangs, 0, 1, $labeltouse);
1671 if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
1672 $subject = (string) $arraydefaultmessage->topic;
1673 $msg = (string) $arraydefaultmessage->content;
1676 $substitutionarray = getCommonSubstitutionArray($outputlangs, 0,
null,
$object);
1681 $tmp = $langs->trans(
"SendingAnEMailToMember");
1682 $tmp .=
'<br>('.$langs->trans(
"MailFrom").
': <b>'.
getDolGlobalString(
'ADHERENT_MAIL_FROM',
$conf->email_from).
'</b>, ';
1683 $tmp .= $langs->trans(
"MailRecipient").
': <b>'.
$object->email.
'</b>)';
1685 $helpcontent .=
'<b>'.$langs->trans(
"MailFrom").
'</b>: '.
getDolGlobalString(
'ADHERENT_MAIL_FROM',
$conf->email_from).
'<br>'.
"\n";
1686 $helpcontent .=
'<b>'.$langs->trans(
"MailRecipient").
'</b>: '.
$object->email.
'<br>'.
"\n";
1687 $helpcontent .=
'<b>'.$langs->trans(
"Subject").
'</b>:<br>'.
"\n";
1688 $helpcontent .= $subjecttosend.
"\n";
1689 $helpcontent .=
"<br>";
1690 $helpcontent .=
'<b>'.$langs->trans(
"Content").
'</b>:<br>';
1693 $label = $form->textwithpicto($tmp, $helpcontent, 1,
'help');
1696 $formquestion = array();
1698 $formquestion[] = array(
'type' =>
'checkbox',
'name' =>
'send_mail',
'label' => $label,
'value' => (
getDolGlobalString(
'ADHERENT_DEFAULT_SENDINFOBYMAIL') ?
'true' :
'false'));
1701 $formquestion[] = array(
'type' =>
'hidden',
'name' =>
'backtopage',
'value' => ($backtopage !=
'1' ? $backtopage : $_SERVER[
"HTTP_REFERER"]));
1703 print $form->formconfirm(
"card.php?rowid=".$id, $langs->trans(
"ResiliateMember"), $langs->trans(
"ConfirmResiliateMember"),
"confirm_resiliate", $formquestion,
'no', 1, 240);
1707 if ($action ==
'exclude') {
1708 $langs->load(
"mails");
1711 $adht->fetch(
$object->typeid);
1717 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
1721 $outputlangs->setDefaultLang(empty(
$object->thirdparty->default_lang) ? $mysoc->default_lang :
$object->thirdparty->default_lang);
1723 $outputlangs->loadLangs(array(
"main",
"members"));
1725 $arraydefaultmessage =
null;
1728 if (!empty($labeltouse)) {
1729 $arraydefaultmessage = $formmail->getEMailTemplate($db,
'member', $user, $outputlangs, 0, 1, $labeltouse);
1732 if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
1733 $subject = (string) $arraydefaultmessage->topic;
1734 $msg = (string) $arraydefaultmessage->content;
1737 $substitutionarray = getCommonSubstitutionArray($outputlangs, 0,
null,
$object);
1742 $tmp = $langs->trans(
"SendingAnEMailToMember");
1743 $tmp .=
'<br>('.$langs->trans(
"MailFrom").
': <b>'.
getDolGlobalString(
'ADHERENT_MAIL_FROM',
$conf->email_from).
'</b>, ';
1744 $tmp .= $langs->trans(
"MailRecipient").
': <b>'.
$object->email.
'</b>)';
1746 $helpcontent .=
'<b>'.$langs->trans(
"MailFrom").
'</b>: '.
getDolGlobalString(
'ADHERENT_MAIL_FROM',
$conf->email_from).
'<br>'.
"\n";
1747 $helpcontent .=
'<b>'.$langs->trans(
"MailRecipient").
'</b>: '.
$object->email.
'<br>'.
"\n";
1748 $helpcontent .=
'<b>'.$langs->trans(
"Subject").
'</b>:<br>'.
"\n";
1749 $helpcontent .= $subjecttosend.
"\n";
1750 $helpcontent .=
"<br>";
1751 $helpcontent .=
'<b>'.$langs->trans(
"Content").
'</b>:<br>';
1754 $label = $form->textwithpicto($tmp, $helpcontent, 1,
'help');
1757 $formquestion = array();
1759 $formquestion[] = array(
'type' =>
'checkbox',
'name' =>
'send_mail',
'label' => $label,
'value' => (
getDolGlobalString(
'ADHERENT_DEFAULT_SENDINFOBYMAIL') ?
'true' :
'false'));
1762 $formquestion[] = array(
'type' =>
'hidden',
'name' =>
'backtopage',
'value' => ($backtopage !=
'1' ? $backtopage : $_SERVER[
"HTTP_REFERER"]));
1764 print $form->formconfirm(
"card.php?rowid=".$id, $langs->trans(
"ExcludeMember"), $langs->trans(
"ConfirmExcludeMember"),
"confirm_exclude", $formquestion,
'no', 1, 240);
1768 if ($action ==
'delete') {
1769 $formquestion = array();
1771 $formquestion[] = array(
'type' =>
'hidden',
'name' =>
'backtopage',
'value' => ($backtopage !=
'1' ? $backtopage : $_SERVER[
"HTTP_REFERER"]));
1773 print $form->formconfirm(
"card.php?rowid=".$id, $langs->trans(
"DeleteMember"), $langs->trans(
"ConfirmDeleteMember"),
"confirm_delete", $formquestion,
'no', 1);
1777 if ($action ==
'add_spip') {
1778 print $form->formconfirm(
"card.php?rowid=".$id, $langs->trans(
'AddIntoSpip'), $langs->trans(
'AddIntoSpipConfirmation'),
'confirm_add_spip');
1781 if ($action ==
'del_spip') {
1782 print $form->formconfirm(
"card.php?rowid=$id", $langs->trans(
'DeleteIntoSpip'), $langs->trans(
'DeleteIntoSpipConfirmation'),
'confirm_del_spip');
1789 if (isModEnabled(
'societe')) {
1793 $linkback =
'<a href="'.DOL_URL_ROOT.
'/adherents/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
1795 $morehtmlref =
'<a href="'.DOL_URL_ROOT.
'/adherents/vcard.php?id='.
$object->id.
'" class="refid">';
1796 $morehtmlref .=
img_picto($langs->trans(
"Download").
' '.$langs->trans(
"VCard"),
'vcard.png',
'class="valignmiddle marginleftonly paddingrightonly"');
1797 $morehtmlref .=
'</a>';
1800 dol_banner_tab(
$object,
'rowid', $linkback, 1,
'rowid',
'ref', $morehtmlref);
1802 print
'<div class="fichecenter">';
1803 print
'<div class="fichehalfleft">';
1805 print
'<div class="underbanner clearboth"></div>';
1806 print
'<table class="border tableforfield centpercent">';
1810 print
'<tr><td class="titlefield">'.$langs->trans(
"Login").
' / '.$langs->trans(
"Id").
'</td><td class="valeur">'.
dol_escape_htmltag(
$object->login).
'</td></tr>';
1814 print
'<tr><td class="titlefield">'.$langs->trans(
"Type").
'</td>';
1815 print
'<td class="valeur">'.$adht->getNomUrl(1).
"</td></tr>\n";
1818 print
'<tr><td>'.$langs->trans(
"MemberNature").
'</td>';
1819 print
'<td class="valeur" >'.$object->getmorphylib(
'', 1).
'</td>';
1826 print
'<tr><td>'.$langs->trans(
"UserTitle").
'</td><td class="valeur">'.
$object->getCivilityLabel().
'</td>';
1831 print
'<tr><td>'.$langs->trans(
"Password").
'</td><td>';
1833 print preg_replace(
'/./i',
'*',
$object->pass);
1836 print
'<!-- '.$langs->trans(
"Crypted").
': '.
$object->pass_indatabase_crypted.
' -->';
1838 print
'<span class="opacitymedium">'.$langs->trans(
"Hidden").
'</span>';
1840 if (!empty(
$object->pass_indatabase) && empty(
$object->user_id)) {
1841 $langs->load(
"errors");
1842 $htmltext = $langs->trans(
"WarningPasswordSetWithNoAccount");
1843 print
' '.$form->textwithpicto(
'', $htmltext, 1,
'warning');
1849 print
'<tr><td>'.$langs->trans(
"SubscriptionEndDate").
'</td><td class="valeur">';
1853 print
" ".img_warning($langs->trans(
"Late"));
1856 if (
$object->need_subscription == 0) {
1857 print $langs->trans(
"SubscriptionNotNeeded");
1858 } elseif (!$adht->subscription) {
1859 print $langs->trans(
"SubscriptionNotRecorded");
1861 print
" ".img_warning($langs->trans(
"Late"));
1864 print $langs->trans(
"SubscriptionNotReceived");
1866 print
" ".img_warning($langs->trans(
"Late"));
1876 print
'<div class="fichehalfright">';
1877 print
'<div class="underbanner clearboth"></div>';
1879 print
'<table class="border tableforfield centpercent">';
1882 if (isModEnabled(
'category') && $user->hasRight(
'categorie',
'lire')) {
1883 print
'<tr><td>'.$langs->trans(
"Categories").
'</td>';
1884 print
'<td colspan="2">';
1885 print $form->showCategories(
$object->id, Categorie::TYPE_MEMBER, 1);
1890 print
'<tr><td class="titlefield">'.$langs->trans(
"DateOfBirth").
'</td><td class="valeur">'.
dol_print_date(
$object->birth,
'day').
'</td></tr>';
1894 require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
1895 print
'<tr><td>'.$langs->trans(
"DefaultLang").
'</td><td>';
1898 $langs->load(
"languages");
1899 $labellang = (
$object->default_lang ? $langs->trans(
'Language_'.
$object->default_lang) :
'');
1907 $htmltext = $langs->trans(
"Public",
getDolGlobalString(
'MAIN_INFO_SOCIETE_NOM'), $linkofpubliclist);
1908 print $form->textwithpicto($langs->trans(
"MembershipPublic"), $htmltext, 1,
'help',
'', 0, 3,
'membershippublic');
1909 print
'</td><td class="valeur">'.yn(
$object->public).
'</td></tr>';
1912 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
1915 if (isModEnabled(
'societe')) {
1917 $editenable = $user->hasRight(
'adherent',
'creer');
1918 print $form->editfieldkey(
'LinkedToDolibarrThirdParty',
'thirdparty',
'',
$object, $editenable);
1919 print
'</td><td colspan="2" class="valeur">';
1920 if ($action ==
'editthirdparty') {
1921 $htmlname =
'socid';
1922 print
'<form method="POST" action="'.$_SERVER[
'PHP_SELF'].
'" name="form'.$htmlname.
'">';
1923 print
'<input type="hidden" name="rowid" value="'.$object->id.
'">';
1924 print
'<input type="hidden" name="action" value="set'.$htmlname.
'">';
1925 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1926 print
'<table class="nobordernopadding">';
1928 print $form->select_company(
$object->socid,
'socid',
'', 1);
1930 print
'<td class="left"><input type="submit" class="button button-edit smallpaddingimp" value="'.$langs->trans(
"Modify").
'"></td>';
1931 print
'</tr></table></form>';
1935 $result = $company->fetch(
$object->socid);
1936 print $company->getNomUrl(1);
1939 $tmparray = $company->getOutstandingBills(
'customer');
1940 if (!empty($tmparray[
'refs'])) {
1941 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']).
')';
1946 print
'<span class="opacitymedium">'.$langs->trans(
"NoThirdPartyAssociatedToMember").
'</span>';
1954 $editenable = $user->hasRight(
'adherent',
'creer') && $user->hasRight(
'user',
'user',
'creer');
1955 print $form->editfieldkey(
'LinkedToDolibarrUser',
'login',
'',
$object, (
int) $editenable);
1956 print
'</td><td colspan="2" class="valeur">';
1957 if ($action ==
'editlogin') {
1958 $form->form_users($_SERVER[
'PHP_SELF'].
'?rowid='.
$object->id, (
string)
$object->user_id,
'userid', array());
1961 $linkeduser =
new User($db);
1962 $linkeduser->fetch(
$object->user_id);
1963 print $linkeduser->getNomUrl(-1);
1965 print
'<span class="opacitymedium">'.$langs->trans(
"NoDolibarrAccess").
'</span>';
1972 print
"</div></div>\n";
1973 print
'<div class="clearboth"></div>';
1982 print
'<div class="tabsAction">';
1984 $parameters = array();
1985 $reshook = $hookmanager->executeHooks(
'addMoreActionsButtons', $parameters,
$object, $action);
1986 if (empty($reshook)) {
1987 if ($action !=
'editlogin' && $action !=
'editthirdparty') {
1989 if (empty($user->socid)) {
1991 print
'<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?id='.((int)
$object->id).
'&action=presend&mode=init#formmailbeforetitle">'.$langs->trans(
'SendMail').
'</a>'.
"\n";
2010 if ($user->hasRight(
'adherent',
'creer')) {
2011 print
'<a class="butAction" href="card.php?rowid='.((int)
$object->id).
'&action=edit&token='.
newToken().
'">'.$langs->trans(
"Modify").
'</a>'.
"\n";
2013 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"Modify").
'</span>'.
"\n";
2018 if ($user->hasRight(
'adherent',
'creer')) {
2019 print
'<a class="butAction" href="card.php?rowid='.((int)
$object->id).
'&action=valid&token='.
newToken().
'">'.$langs->trans(
"Validate").
'</a>'.
"\n";
2021 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"Validate").
'</span>'.
"\n";
2027 if ($user->hasRight(
'adherent',
'creer')) {
2028 print
'<a class="butAction" href="card.php?rowid='.((int)
$object->id).
'&action=valid&token='.
newToken().
'">'.$langs->trans(
"Reenable").
"</a>\n";
2030 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"Reenable").
'</span>'.
"\n";
2036 if ($user->hasRight(
'adherent',
'supprimer')) {
2037 print
'<a class="butAction" href="card.php?rowid='.((int)
$object->id).
'&action=resiliate&token='.
newToken().
'">'.$langs->trans(
"Resiliate").
"</a></span>\n";
2039 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"Resiliate").
'</span>'.
"\n";
2045 if ($user->hasRight(
'adherent',
'supprimer')) {
2046 print
'<a class="butAction" href="card.php?rowid='.((int)
$object->id).
'&action=exclude&token='.
newToken().
'">'.$langs->trans(
"Exclude").
"</a></span>\n";
2048 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"Exclude").
'</span>'.
"\n";
2053 if (isModEnabled(
'societe') && !
$object->socid) {
2054 if ($user->hasRight(
'societe',
'creer')) {
2056 print
'<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?rowid='.((int)
$object->id).
'&action=create_thirdparty&token='.
newToken().
'" title="'.
dol_escape_htmltag($langs->trans(
"CreateDolibarrThirdPartyDesc")).
'">'.$langs->trans(
"CreateDolibarrThirdParty").
'</a>'.
"\n";
2058 print
'<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans(
"ValidateBefore")).
'">'.$langs->trans(
"CreateDolibarrThirdParty").
'</a>'.
"\n";
2061 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"CreateDolibarrThirdParty").
'</span>'.
"\n";
2066 if (!$user->socid && !
$object->user_id) {
2067 if ($user->hasRight(
'user',
'user',
'creer')) {
2069 print
'<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?rowid='.((int)
$object->id).
'&action=create_user&token='.
newToken().
'" title="'.
dol_escape_htmltag($langs->trans(
"CreateDolibarrLoginDesc")).
'">'.$langs->trans(
"CreateDolibarrLogin").
'</a>'.
"\n";
2071 print
'<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans(
"ValidateBefore")).
'">'.$langs->trans(
"CreateDolibarrLogin").
'</a>'.
"\n";
2074 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"CreateDolibarrLogin").
'</span>'.
"\n";
2080 $isinspip = $mailmanspip->is_in_spip(
$object);
2082 if ($isinspip == 1) {
2083 print
'<a class="butAction" href="card.php?rowid='.((int)
$object->id).
'&action=del_spip&token='.
newToken().
'">'.$langs->trans(
"DeleteIntoSpip").
'</a>'.
"\n";
2085 if ($isinspip == 0) {
2086 print
'<a class="butAction" href="card.php?rowid='.((int)
$object->id).
'&action=add_spip&token='.
newToken().
'">'.$langs->trans(
"AddIntoSpip").
'</a>'.
"\n";
2091 if ($user->hasRight(
'adherent',
'supprimer')) {
2092 print
'<a class="butActionDelete" href="card.php?rowid='.((int)
$object->id).
'&action=delete&token='.
newToken().
'">'.$langs->trans(
"Delete").
'</a>'.
"\n";
2094 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"Delete").
'</span>'.
"\n";
2100 if ($isinspip == -1) {
2101 print
'<br><br><span class="error">'.$langs->trans(
'SPIPConnectionFailed').
': '.$mailmanspip->error.
'</span>';
2106 if (
GETPOST(
'modelselected')) {
2107 $action =
'presend';
2110 if ($action !=
'presend') {
2111 print
'<div class="fichecenter"><div class="fichehalfleft">';
2112 print
'<a name="builddoc"></a>';
2117 $urlsource = $_SERVER[
'PHP_SELF'].
'?id='.
$object->id;
2118 $genallowed = $user->hasRight(
'adherent',
'lire');
2119 $delallowed = $user->hasRight(
'adherent',
'creer');
2121 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);
2122 $somethingshown = $formfile->numoffiles;
2130 include_once DOL_DOCUMENT_ROOT.
'/core/lib/payments.lib.php';
2131 $validpaymentmethod = getValidOnlinePaymentMethods(
'');
2132 $useonlinepayment = count($validpaymentmethod);
2134 if ($useonlinepayment) {
2136 if (empty($amount)) {
2137 $amount = max($adht->amount,
$object->first_subscription_amount,
$object->last_subscription_amount);
2139 if (empty($amount)) {
2142 require_once DOL_DOCUMENT_ROOT.
'/core/lib/payments.lib.php';
2143 print showOnlinePaymentUrl(
'membersubscription',
$object->ref, $amount);
2146 print
'</div><div class="fichehalfright">';
2150 $morehtmlcenter =
'';
2151 $messagingUrl = DOL_URL_ROOT.
'/adherents/messaging.php?rowid='.
$object->id;
2152 $morehtmlcenter .=
dolGetButtonTitle($langs->trans(
'ShowAsConversation'),
'',
'fa fa-comments imgforviewmode', $messagingUrl,
'', 1);
2153 $morehtmlcenter .=
dolGetButtonTitle($langs->trans(
'SeeAll'),
'',
'fa fa-bars imgforviewmode', DOL_URL_ROOT.
'/adherents/agenda.php?id='.
$object->id);
2156 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formactions.class.php';
2158 $somethingshown = $formactions->showactions(
$object,
$object->element, $socid, 1,
'listactions', $MAXEVENT,
'', $morehtmlcenter);
2160 print
'</div></div>';
2164 $modelmail =
'member';
2165 $defaulttopic =
'CardContent';
2166 $diroutput =
$conf->member->dir_output;
2167 $trackid =
'mem'.$object->id;
2169 include DOL_DOCUMENT_ROOT.
'/core/tpl/card_presend.tpl.php';
$id
Support class for third parties, contacts, members, users or resources.
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Class to manage members of a foundation.
const STATUS_EXCLUDED
Excluded.
const STATUS_DRAFT
Draft status.
const STATUS_RESILIATED
Resiliated (membership end and was not renew)
const STATUS_VALIDATED
Validated status.
Class to manage members type.
Class to manage mailman and spip.
Class to manage third parties objects (customers, suppliers, prospects...)
Class to manage translations.
Class to manage Dolibarr users.
getCountry($searchkey, $withcode='', $dbtouse=null, $outputlangs=null, $entconv=1, $searchlabel='')
Return country label, code or id from an id, code or label.
print $script_file $mode $langs defaultlang(is_numeric($duration_value) ? " delay=". $duration_value :"").(is_numeric($duration_value2) ? " after cd cd cd description as p label as s rowid as s nom as s email
Sender: Who sends the email ("Sender" has sent emails on behalf of "From").
dol_delete_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_delete_dir_recursive($dir, $count=0, $nophperrors=0, $onlysub=0, &$countdeleted=0, $indexdatabase=1, $nolog=0, $level=0)
Remove a directory $dir and its subdirectories (or only files and subdirectories)
dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disablevirusscan=0, $uploaderrorcode=0, $nohook=0, $keyforsourcefile='addedfile', $upload_dir='', $mode=0)
Check validity of a file upload from an GUI page, and move it to its final destination.
dol_buildlogin($lastname, $firstname)
Build a login from lastname, firstname.
isValidUrl($url, $http=0, $pass=0, $port=0, $path=0, $query=0, $anchor=0)
Url string validation <http[s]> :// [user[:pass]@] hostname [port] [/path] [?getquery] [anchor].
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed information (by default a local PHP server timestamp) Rep...
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
picto_from_langcode($codelang, $moreatt='', $notitlealt=0)
Return img flag of country for a language code or country code.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0, $morecssdiv='')
Show tabs of a record.
dolGetButtonTitle($label, $helpText='', $iconClass='fa fa-file', $url='', $id='', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
dol_eval($s, $returnvalue=1, $hideerrors=1, $onlysimplestring='1')
Replace eval function to add more security.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
newToken()
Return the value of token currently saved into session with name 'newtoken'.
dol_concatdesc($text1, $text2, $forxml=false, $invert=false)
Concat 2 descriptions with a new line between them (second operand after first one with appropriate n...
complete_substitutions_array(&$substitutionarray, $outputlangs, $object=null, $parameters=null, $callfunc="completesubstitutionarray")
Complete the $substitutionarray with more entries coming from external module that had set the "subst...
make_substitutions($text, $substitutionarray, $outputlangs=null, $converttextinhtmlifnecessary=0)
Make substitution into a text string, replacing keys with vals from $substitutionarray (oldval=>newva...
getArrayOfSocialNetworks()
Get array of social network dictionary.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_clone($object, $native=2)
Create a clone of instance of object (new instance with same value for each properties) With native =...
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dol_htmlentitiesbr($stringtoencode, $nl2brmode=0, $pagecodefrom='UTF-8', $removelasteolbr=1)
This function is called to encode a string into a HTML string but differs from htmlentities because a...
isValidEmail($address, $acceptsupervisorkey=0, $acceptuserkey=0)
Return true if email syntax is ok.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1, $includequotes=0)
Clean a string to use it as a file name.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='', $picto='')
Show information in HTML for admin users or standard users.
get_exdir($num, $level, $alpha, $withoutslash, $object, $modulepart='')
Return a path to have a the directory according to object where files are stored.
dol_mkdir($dir, $dataroot='', $newmask='')
Creation of a directory (this can create recursive subdir)
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
div refaddress div address
image_format_supported($file, $acceptsvg=0)
Return if a filename is file name of a supported image format.
member_prepare_head(Adherent $object)
Return array head with list of tabs to view object information.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
$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.