35require
'../main.inc.php';
45require_once DOL_DOCUMENT_ROOT.
'/core/lib/member.lib.php';
46require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
47require_once DOL_DOCUMENT_ROOT.
'/core/lib/images.lib.php';
48require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
49require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
50require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
51require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent_type.class.php';
52require_once DOL_DOCUMENT_ROOT.
'/adherents/class/subscription.class.php';
53require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
54require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
55require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formadmin.class.php';
56require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
57require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
60$langs->loadLangs(array(
"companies",
"bills",
"members",
"users",
"other",
"paypal"));
64$action =
GETPOST(
'action',
'aZ09');
65$cancel =
GETPOST(
'cancel',
'alpha');
66$backtopage =
GETPOST(
'backtopage',
'alpha');
67$backtopageforcancel =
GETPOST(
'backtopageforcancel',
'alpha');
68$confirm =
GETPOST(
'confirm',
'alpha');
78 include_once DOL_DOCUMENT_ROOT.
'/mailmanspip/class/mailmanspip.class.php';
80 $langs->load(
'mailmanspip');
92$extrafields->fetch_name_optionals_label(
$object->table_element);
100if (!empty($canvas)) {
101 require_once DOL_DOCUMENT_ROOT.
'/core/class/canvas.class.php';
103 $objcanvas->getCanvas(
'adherent',
'membercard', $canvas);
107$hookmanager->initHooks(array(
'membercard',
'globalcard'));
110if ($id > 0 || !empty($ref)) {
112 $result =
$object->fetch($id, $ref);
115 $canadduser = ($user->admin || $user->hasRight(
'user',
'user',
'creer'));
119 $caneditfielduser = ((($user->id ==
$object->user_id) && $user->hasRight(
'user',
'self',
'creer'))
120 || (($user->id !=
$object->user_id) && $user->hasRight(
'user',
'user',
'creer')));
121 $caneditpassworduser = ((($user->id ==
$object->user_id) && $user->hasRight(
'user',
'self',
'password'))
122 || (($user->id !=
$object->user_id) && $user->hasRight(
'user',
'user',
'password')));
127$canaddmember = $user->hasRight(
'adherent',
'creer');
128$caneditfieldmember =
false;
131 $caneditfieldmember = $user->hasRight(
'adherent',
'creer');
133$permissiontoeditextra = $canaddmember;
134if (
GETPOST(
'attribute',
'aZ09') && isset($extrafields->attributes[
$object->table_element][
'perms'][
GETPOST(
'attribute',
'aZ09')])) {
136 $permissiontoeditextra =
dol_eval((
string) $extrafields->attributes[
$object->table_element][
'perms'][
GETPOST(
'attribute',
'aZ09')]);
142if (!$user->hasRight(
'adherent',
'creer') && $action ==
'edit') {
146$linkofpubliclist = DOL_MAIN_URL_ROOT.
'/public/members/public_list.php'.((
isModEnabled(
'multicompany')) ?
'?entity='.
$conf->entity :
'');
153$parameters = array(
'id' => $id,
'rowid' => $id,
'objcanvas' => $objcanvas,
'confirm' => $confirm);
154$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
159if (empty($reshook)) {
160 $backurlforlist = DOL_URL_ROOT.
'/adherents/list.php';
162 if (empty($backtopage) || ($cancel && empty($id))) {
163 if (empty($backtopage) || ($cancel && strpos($backtopage,
'__ID__'))) {
164 if (empty($id) && (($action !=
'add' && $action !=
'create') || $cancel)) {
165 $backtopage = $backurlforlist;
167 $backtopage = DOL_URL_ROOT.
'/adherents/card.php?id='.((!empty($id) &&
$id > 0) ? $id :
'__ID__');
173 if (!empty($backtopageforcancel)) {
174 header(
"Location: ".$backtopageforcancel);
176 } elseif (!empty($backtopage)) {
177 header(
"Location: ".$backtopage);
183 if ($action ==
'setuserid' && ($user->hasRight(
'user',
'self',
'creer') || $user->hasRight(
'user',
'user',
'creer'))) {
185 if (!$user->hasRight(
'user',
'user',
'creer')) {
186 if ($userid != $user->id && $userid !=
$object->user_id) {
188 setEventMessages($langs->trans(
"ErrorUserPermissionAllowsToLinksToItselfOnly"),
null,
'errors');
193 if ($userid !=
$object->user_id) {
194 $result =
$object->setUserId($userid);
203 if ($action ==
'setsocid' && $caneditfieldmember) {
206 if ($socid !=
$object->socid) {
207 $sql =
"SELECT rowid FROM ".MAIN_DB_PREFIX.
"adherent";
208 $sql .=
" WHERE socid = ".((int) $socid);
209 $sql .=
" AND entity = ".((int)
$conf->entity);
210 $resql =
$db->query($sql);
212 $obj =
$db->fetch_object($resql);
213 if ($obj && $obj->rowid > 0) {
215 $othermember->fetch($obj->rowid);
217 $thirdparty->fetch($socid);
219 setEventMessages($langs->trans(
"ErrorMemberIsAlreadyLinkedToThisThirdParty", $othermember->getFullName($langs), $othermember->login, $thirdparty->name),
null,
'errors');
224 $result =
$object->setThirdPartyId($socid);
235 if ($action ==
'confirm_create_user' && $confirm ==
'yes' && $user->hasRight(
'user',
'user',
'creer')) {
240 if (
GETPOST(
'internalorexternal',
'aZ09') ==
'internal') {
241 $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");
275 if ($action ==
'confirm_merge' && $confirm ==
'yes' && $user->hasRight(
'adherent',
'creer')) {
276 $member_origin_id =
GETPOSTINT(
'member_origin');
279 if ($member_origin_id <= 0) {
280 $langs->load(
'errors');
281 setEventMessages($langs->trans(
'MergeOriginMemberIsMAndatory'),
null,
'errors');
283 if (!$error && $member_origin->fetch($member_origin_id) < 1) {
288 $result =
$object->mergeMembers($member_origin_id);
299 if ($action ==
'update' && !$cancel && $user->hasRight(
'adherent',
'creer')) {
300 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
306 $lastname =
GETPOST(
"lastname",
'alphanohtml');
307 $firstname =
GETPOST(
"firstname",
'alphanohtml');
308 $gender =
GETPOST(
"gender",
'alphanohtml');
309 $societe =
GETPOST(
"societe",
'alphanohtml');
310 $morphy =
GETPOST(
"morphy",
'alphanohtml');
311 $login =
GETPOST(
"login",
'alphanohtml');
312 if ($morphy !=
'mor' && empty($lastname)) {
314 $langs->load(
"errors");
315 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Lastname")),
null,
'errors');
317 if ($morphy !=
'mor' && (!isset($firstname) || $firstname ==
'')) {
319 $langs->load(
"errors");
320 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Firstname")),
null,
'errors');
322 if ($morphy ==
'mor' && empty($societe)) {
324 $langs->load(
"errors");
325 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Company")),
null,
'errors');
331 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Login")),
null,
'errors');
335 if ($result > 0 && !$error) {
339 $object->civility_code = trim(
GETPOST(
"civility_code",
'alphanohtml'));
360 $object->email = preg_replace(
'/\s+/',
'',
GETPOST(
"member_email",
'alpha'));
362 $object->socialnetworks = array();
363 foreach ($socialnetworks as $key => $value) {
365 $object->socialnetworks[$key] = trim(
GETPOST($key,
'alphanohtml'));
375 if (!empty($_FILES[
'photo'][
'name'])) {
376 $current_photo =
$object->photo;
380 $current_photo =
$object->photo;
390 $ret = $extrafields->setOptionalsFromPost(
null, $object,
'@GETPOSTISSET');
398 if ($user->id !=
$object->user_id && !$user->hasRight(
'user',
'user',
'creer')) {
408 if ($user->id ==
$object->user_id) {
409 if (!$user->hasRight(
'user',
'self',
'password')) {
413 if (!$user->hasRight(
'user',
'user',
'password')) {
421 $nosyncthirdparty =
getDolGlobalInt(
'MEMBER_NO_SYNC_LINKED_THIRDPARTY');
423 $result =
$object->update($user, 0, $nosyncuser, $nosyncuserpass, $nosyncthirdparty);
425 if ($result >= 0 && !count(
$object->errors)) {
426 $categories =
GETPOST(
'memcats',
'array');
427 $object->setCategories($categories);
430 $dir =
$conf->member->dir_output.
'/'.
get_exdir(0, 0, 0, 1, $object,
'member').
'/photos';
431 $file_OK = is_uploaded_file($_FILES[
'photo'][
'tmp_name']);
432 if (
GETPOST(
'deletephoto') && $current_photo) {
433 $fileimg = $dir.
'/'.$current_photo;
434 $dirthumbs = $dir.
'/thumbs';
440 if ($current_photo !=
$object->photo) {
441 $fileimg = $dir.
'/'.$current_photo;
442 $dirthumbs = $dir.
'/thumbs';
451 $resultupload =
dol_move_uploaded_file($_FILES[
'photo'][
'tmp_name'], $newfile, 1, 0, $_FILES[
'photo'][
'error']);
453 if (!is_numeric($resultupload) || $resultupload <= 0) {
461 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
473 switch ($_FILES[
'photo'][
'error']) {
476 $errors[] =
"ErrorFileSizeTooLarge";
479 $errors[] =
"ErrorFilePartiallyUploaded";
488 if (!empty($backtopage)) {
489 header(
"Location: ".$backtopage);
504 if ($action ==
'add' && $user->hasRight(
'adherent',
'creer')) {
512 $datesubscription =
'';
518 $civility_code =
GETPOST(
"civility_code",
'alphanohtml');
519 $lastname =
GETPOST(
"lastname",
'alphanohtml');
520 $firstname =
GETPOST(
"firstname",
'alphanohtml');
521 $gender =
GETPOST(
"gender",
'alphanohtml');
522 $societe =
GETPOST(
"societe",
'alphanohtml');
523 $address =
GETPOST(
"address",
'alphanohtml');
524 $zip =
GETPOST(
"zipcode",
'alphanohtml');
525 $town =
GETPOST(
"town",
'alphanohtml');
529 $phone =
GETPOST(
"phone",
'alpha');
530 $phone_perso =
GETPOST(
"phone_perso",
'alpha');
531 $phone_mobile =
GETPOST(
"phone_mobile",
'alpha');
532 $email = preg_replace(
'/\s+/',
'',
GETPOST(
"member_email",
'aZ09arobase'));
533 $url = trim(
GETPOST(
'url',
'url'));
534 $login =
GETPOST(
"member_login",
'alphanohtml');
535 $pass =
GETPOST(
"password",
'password');
536 $photo =
GETPOST(
"photo",
'alphanohtml');
537 $morphy =
GETPOST(
"morphy",
'alphanohtml');
542 $default_lang =
GETPOST(
'default_lang',
'alpha');
544 $object->civility_code = $civility_code;
545 $object->firstname = $firstname;
554 $object->country_id = $country_id;
556 $object->phone_perso = $phone_perso;
557 $object->phone_mobile = $phone_mobile;
558 $object->socialnetworks = array();
560 foreach ($socialnetworks as $key => $value) {
562 $object->socialnetworks[$key] =
GETPOST(
"member_".$key,
'alphanohtml');
579 $object->default_lang = $default_lang;
581 $ret = $extrafields->setOptionalsFromPost(
null, $object);
587 if (empty($morphy) || $morphy ==
"-1") {
589 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"MemberNature")),
null,
'errors');
595 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Login")),
null,
'errors');
597 $sql =
"SELECT login FROM ".MAIN_DB_PREFIX.
"adherent WHERE login='".
$db->escape($login).
"'";
598 $result =
$db->query($sql);
601 $num =
$db->num_rows($result);
605 $langs->load(
"errors");
606 setEventMessages($langs->trans(
"ErrorLoginAlreadyExists", $login),
null,
'errors');
611 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Password")),
null,
'errors');
614 if ($morphy ==
'mor' && empty($societe)) {
616 $langs->load(
"errors");
617 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Company")),
null,
'errors');
619 if ($morphy !=
'mor' && empty($lastname)) {
621 $langs->load(
"errors");
622 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Lastname")),
null,
'errors');
624 if ($morphy !=
'mor' && (!isset($firstname) || $firstname ==
'')) {
626 $langs->load(
"errors");
627 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Firstname")),
null,
'errors');
629 if (!($typeid > 0)) {
631 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Type")),
null,
'errors');
635 $langs->load(
"errors");
639 $langs->load(
"errors");
647 $result =
$object->create($user);
650 $memcats =
GETPOST(
'memcats',
'array');
651 $object->setCategories($memcats);
658 $backtopage = preg_replace(
'/__ID__/', (
string) $id, $backtopage);
671 $result = $company->create_from_member($object);
673 $langs->load(
"errors");
682 $action = ($result < 0 || !$error) ?
'' :
'create';
684 if (!$error && $backtopage) {
685 header(
"Location: ".$backtopage);
690 if ($user->hasRight(
'adherent',
'supprimer') && $action ==
'confirm_delete' && $confirm ==
'yes') {
691 $result =
$object->delete($user);
694 if (!empty($backtopage) && !preg_match(
'/'.preg_quote($_SERVER[
"PHP_SELF"],
'/').
'/', $backtopage)) {
695 header(
"Location: ".$backtopage);
698 header(
"Location: list.php");
706 if ($user->hasRight(
'adherent',
'creer') && $action ==
'confirm_valid' && $confirm ==
'yes') {
714 $result =
$object->validate($user);
716 if ($result >= 0 && !count(
$object->errors)) {
723 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
727 $outputlangs->setDefaultLang(empty(
$object->thirdparty->default_lang) ?
$mysoc->default_lang :
$object->thirdparty->default_lang);
729 $outputlangs->loadLangs(array(
"main",
"members",
"companies",
"install",
"other"));
731 $arraydefaultmessage =
null;
734 if (!empty($labeltouse)) {
735 $arraydefaultmessage = $formmail->getEMailTemplate(
$db,
'member', $user, $outputlangs, 0, 1, $labeltouse);
738 if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
739 $subject = (
string) $arraydefaultmessage->topic;
740 $msg = (
string) $arraydefaultmessage->content;
743 if (empty($labeltouse) || (
int) $labeltouse === -1) {
745 $langs->load(
"errors");
746 setEventMessages(
'<a href="'.DOL_URL_ROOT.
'/adherents/admin/member_emails.php">'.$langs->trans(
'WarningMandatorySetupNotComplete').
'</a>',
null,
'errors');
749 $substitutionarray = getCommonSubstitutionArray($outputlangs, 0,
null, $object);
754 $moreinheader =
'X-Dolibarr-Info: send_an_email by adherents/card.php'.
"\r\n";
756 $result =
$object->sendEmail($texttosend, $subjecttosend, array(), array(), array(),
"",
"", 0, -1,
'', $moreinheader);
776 if ($user->hasRight(
'adherent',
'supprimer') && $action ==
'confirm_resiliate') {
779 if ($confirm ==
'yes') {
783 $result =
$object->resiliate($user);
785 if ($result >= 0 && !count(
$object->errors)) {
791 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
795 $outputlangs->setDefaultLang(empty(
$object->thirdparty->default_lang) ?
$mysoc->default_lang :
$object->thirdparty->default_lang);
797 $outputlangs->loadLangs(array(
"main",
"members",
"companies",
"install",
"other"));
799 $arraydefaultmessage =
null;
802 if (!empty($labeltouse)) {
803 $arraydefaultmessage = $formmail->getEMailTemplate(
$db,
'member', $user, $outputlangs, 0, 1, $labeltouse);
806 if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
807 $subject = (
string) $arraydefaultmessage->topic;
808 $msg = (
string) $arraydefaultmessage->content;
811 if (empty($labeltouse) || (
int) $labeltouse === -1) {
816 $substitutionarray = getCommonSubstitutionArray($outputlangs, 0,
null, $object);
821 $moreinheader =
'X-Dolibarr-Info: send_an_email by adherents/card.php'.
"\r\n";
823 $result =
$object->sendEmail($texttosend, $subjecttosend, array(), array(), array(),
"",
"", 0, -1,
'', $moreinheader);
837 if (!empty($backtopage) && !$error) {
838 header(
"Location: ".$backtopage);
843 if ($user->hasRight(
'adherent',
'supprimer') && $action ==
'confirm_exclude') {
846 if ($confirm ==
'yes') {
850 $result =
$object->exclude($user);
852 if ($result >= 0 && !count(
$object->errors)) {
858 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
862 $outputlangs->setDefaultLang(empty(
$object->thirdparty->default_lang) ?
$mysoc->default_lang :
$object->thirdparty->default_lang);
864 $outputlangs->loadLangs(array(
"main",
"members",
"companies",
"install",
"other"));
866 $arraydefaultmessage =
null;
869 if (!empty($labeltouse)) {
870 $arraydefaultmessage = $formmail->getEMailTemplate(
$db,
'member', $user, $outputlangs, 0, 1, $labeltouse);
873 if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
874 $subject = (
string) $arraydefaultmessage->topic;
875 $msg = (
string) $arraydefaultmessage->content;
878 if (empty($labeltouse) || (
int) $labeltouse === -1) {
883 $substitutionarray = getCommonSubstitutionArray($outputlangs, 0,
null, $object);
888 $moreinheader =
'X-Dolibarr-Info: send_an_email by adherents/card.php'.
"\r\n";
890 $result =
$object->sendEmail($texttosend, $subjecttosend, array(), array(), array(),
"",
"", 0, -1,
'', $moreinheader);
904 if (!empty($backtopage) && !$error) {
905 header(
"Location: ".$backtopage);
910 if ($action ==
'update_extras' && $permissiontoeditextra) {
912 $attribute_name =
GETPOST(
'attribute',
'aZ09');
915 $ret = $extrafields->setOptionalsFromPost(
null, $object, $attribute_name);
920 $result =
$object->updateExtraField($attribute_name,
'MEMBER_MODIFY');
927 $action =
'edit_extras';
932 if (is_object($mailmanspip)) {
933 if ($user->hasRight(
'adherent',
'supprimer') && $action ==
'confirm_del_spip' && $confirm ==
'yes') {
935 if (!$mailmanspip->del_to_spip($object)) {
936 setEventMessages($langs->trans(
'DeleteIntoSpipError').
': '.$mailmanspip->error,
null,
'errors');
941 if ($user->hasRight(
'adherent',
'creer') && $action ==
'confirm_add_spip' && $confirm ==
'yes') {
943 if (!$mailmanspip->add_to_spip($object)) {
944 setEventMessages($langs->trans(
'AddIntoSpipError').
': '.$mailmanspip->error,
null,
'errors');
951 include DOL_DOCUMENT_ROOT.
'/core/actions_printing.inc.php';
954 $upload_dir =
$conf->member->dir_output;
955 $permissiontoadd = $user->hasRight(
'adherent',
'creer');
956 include DOL_DOCUMENT_ROOT.
'/core/actions_builddoc.inc.php';
959 $triggersendname =
'MEMBER_SENTBYMAIL';
961 $mode =
'emailfrommember';
962 $trackid =
'mem'.$object->id;
963 include DOL_DOCUMENT_ROOT.
'/core/actions_sendmails.inc.php';
976$title = $langs->trans(
"Member").
" - ".$langs->trans(
"Card");
977$help_url =
'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder';
979llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'mod-member page-card');
981$countrynotdefined = $langs->trans(
"ErrorSetACountryFirst").
' ('.$langs->trans(
"SeeAbove").
')';
983if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
987 if (empty(
$object->error) && $id) {
995 $objcanvas->display_canvas($action);
1002 if ($action ==
'create') {
1010 $object->country_code = $tmparray[
'code'];
1011 $object->country = $tmparray[
'label'];
1015 if (!empty($socid)) {
1017 $soc->fetch($socid);
1020 if (!($soc->id > 0)) {
1021 $langs->load(
"errors");
1022 print($langs->trans(
'ErrorRecordNotFound'));
1031 if (
$conf->use_javascript_ajax) {
1032 print
"\n".
'<script type="text/javascript">'.
"\n";
1033 print
'jQuery(document).ready(function () {
1034 jQuery("#selectcountry_id").change(function() {
1035 document.formsoc.action.value="create";
1036 document.formsoc.submit();
1038 function initfieldrequired() {
1039 jQuery("#tdcompany").removeClass("fieldrequired");
1040 jQuery("#tdlastname").removeClass("fieldrequired");
1041 jQuery("#tdfirstname").removeClass("fieldrequired");
1042 if (jQuery(\'input[name="morphy"]:checked\').val() == \'mor\') {
1043 jQuery("#tdcompany").addClass("fieldrequired");
1045 if (jQuery(\'input[name="morphy"]:checked\').val() == \'phy\') {
1046 jQuery("#tdlastname").addClass("fieldrequired");
1047 jQuery("#tdfirstname").addClass("fieldrequired");
1050 jQuery(\'input[name="morphy"]\').change(function() {
1051 initfieldrequired();
1053 initfieldrequired();
1055 print
'</script>'.
"\n";
1058 print
'<form name="formsoc" action="'.$_SERVER[
"PHP_SELF"].
'" method="post" enctype="multipart/form-data" spellcheck="false">';
1059 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1060 print
'<input type="hidden" name="action" value="add">';
1061 print
'<input type="hidden" name="socid" value="'.$socid.
'">';
1063 print
'<input type="hidden" name="backtopage" value="'.($backtopage !=
'1' ? $backtopage : $_SERVER[
"HTTP_REFERER"]).
'">';
1068 print
'<table class="border centpercent">';
1073 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>';
1078 require_once DOL_DOCUMENT_ROOT.
'/core/lib/security2.lib.php';
1080 print
'<tr><td><span class="fieldrequired">'.$langs->trans(
"Password").
'</span></td><td>';
1081 print
'<input type="password" class="minwidth300" maxlength="50" name="password" value="'.dol_escape_htmltag(
GETPOST(
'password') ?
GETPOST(
'password') : $generated_password).
'">';
1086 print
'<tr><td class="fieldrequired">'.$langs->trans(
"MemberType").
'</td><td>';
1087 $listetype = $adht->liste_array(1);
1088 print
img_picto(
'', $adht->picto,
'class="pictofixedwidth"');
1089 if (count($listetype)) {
1090 print $form->selectarray(
"typeid", $listetype, (
GETPOSTINT(
'typeid') ?
GETPOSTINT(
'typeid') : $typeid), (count($listetype) > 1 ? 1 : 0), 0, 0,
'', 0, 0, 0,
'',
'minwidth200', 1);
1092 print
'<span class="error">'.$langs->trans(
"NoTypeDefinedGoToSetup").
'</span>';
1094 if ($user->hasRight(
'member',
'configurer')) {
1095 print
' <a href="'.dolBuildUrl(DOL_URL_ROOT.
'/adherents/type.php', [
'action' =>
'create',
'backtopage' =>
dolBuildUrl($_SERVER[
"PHP_SELF"], [
'action' =>
'create',
'typeid' =>
'--IDFORBACKTOPAGE--'])]).
'"><span class="fa fa-plus-circle valignmiddle paddingleft" title="'.$langs->trans(
"NewMemberType").
'"></span></a>';
1101 "phy" => $langs->trans(
"Physical"),
1102 "mor" => $langs->trans(
"Moral"),
1104 $checkednature =
GETPOST(
"morphy",
'alpha');
1105 $listetype_natures = $adht->morphyByType(1);
1106 $listetype_natures_json = json_encode($listetype_natures);
1108 print
'<tr><td class="fieldrequired">'.$langs->trans(
"MemberNature").
"</td><td>\n";
1109 print
'<span id="spannature1" class="nonature-back spannature paddinglarge marginrightonly"><label for="phisicalinput" class="spanlabel">'.$morphys[
"phy"].
'</label><input id="phisicalinput" class="flat checkforselect marginleftonly valignmiddle" type="radio" name="morphy" value="phy"'.($checkednature ==
"phy" ?
' checked="checked"' :
'').
'></span>';
1110 print
'<span id="spannature2" class="nonature-back spannature paddinglarge marginrightonly"><label for="moralinput" class="spanlabel">'.$morphys[
"mor"].
'</label><input id="moralinput" class="flat checkforselect marginleftonly valignmiddle" type="radio" name="morphy" value="mor"'.($checkednature ==
"mor" ?
' checked="checked"' :
'').
'></span>';
1113 if (
$conf->use_javascript_ajax) {
1115 var listetype_natures = $listetype_natures_json;
1118 jQuery(function($) {
1119 function refreshNatureCss() {
1120 $(".spannature").each(function(index) {
1121 let $span = $("#spannature" + (index + 1));
1122 let checked = $span.find(".checkforselect").is(":checked");
1126 $span.addClass("member-individual-back").removeClass("nonature-back member-company-back");
1127 } else if (index === 1) {
1128 $span.addClass("member-company-back").removeClass("nonature-back member-individual-back");
1131 $span.removeClass("member-individual-back member-company-back")
1132 .addClass("nonature-back");
1137 $(".spannature").on("click", function() {
1138 console.log("Nature clicked");
1142 $("#typeid").on("change", function() {
1143 let morphy = listetype_natures[$(this).val()];
1145 let $phyInput = $("#phisicalinput");
1146 let $morInput = $("#moralinput");
1147 let $tdLast = $("#tdlastname");
1148 let $tdFirst = $("#tdfirstname");
1149 let $tdCompany = $("#tdcompany");
1150 let $span1 = $("#spannature1");
1151 let $span2 = $("#spannature2");
1155 $phyInput.prop({disabled: false, checked: true});
1156 $morInput.prop({disabled: true, checked: false});
1157 $span1.addClass("member-individual-back").removeClass("nonature-back");
1158 $span2.removeClass("member-company-back").addClass("nonature-back");
1159 $tdLast.addClass("fieldrequired");
1160 $tdFirst.addClass("fieldrequired");
1161 $tdCompany.removeClass("fieldrequired");
1165 $phyInput.prop({disabled: true, checked: false});
1166 $morInput.prop({disabled: false, checked: true});
1167 $span2.addClass("member-company-back").removeClass("nonature-back");
1168 $span1.removeClass("member-individual-back").addClass("nonature-back");
1169 $tdCompany.addClass("fieldrequired");
1170 $tdLast.removeClass("fieldrequired");
1171 $tdFirst.removeClass("fieldrequired");
1175 $phyInput.prop({disabled: false, checked: false});
1176 $morInput.prop({disabled: false, checked: false});
1177 $span1.removeClass("member-individual-back").addClass("nonature-back");
1178 $span2.removeClass("member-company-back").addClass("nonature-back");
1191 print
'<tr><td id="tdcompany">'.$langs->trans(
"Company").
' / '.$langs->trans(
"Organization").
'</td><td>'.
img_picto(
'',
'company',
'class="pictofixedwidth"').
'<input type="text" name="societe" class="minwidth300" maxlength="128" value="'.(
GETPOSTISSET(
'societe') ?
GETPOST(
'societe',
'alphanohtml') : $soc->
name).
'"></td></tr>';
1195 print
'<tr><td>'.$langs->trans(
"UserTitle").
'</td><td>';
1196 print $formcompany->select_civility(
GETPOSTISSET(
'civility_code') ?
GETPOST(
'civility_code',
"aZ09") :
$object->civility_code,
'civility_code',
'maxwidth150', 1);
1202 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>';
1206 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>';
1210 print
'<tr><td>'.$langs->trans(
"Gender").
'</td>';
1212 $arraygender = array(
'man' => $langs->trans(
"Genderman"),
'woman' => $langs->trans(
"Genderwoman"),
'other' => $langs->trans(
"Genderother"));
1213 print $form->selectarray(
'gender', $arraygender,
GETPOST(
'gender',
'alphanohtml'), 1, 0, 0,
'', 0, 0, 0,
'',
'minwidth100', 1);
1217 print
'<tr><td>'.(getDolGlobalString(
'ADHERENT_MAIL_REQUIRED') ?
'<span class="fieldrequired">' :
'').$langs->trans(
"EMail").(getDolGlobalString(
'ADHERENT_MAIL_REQUIRED') ?
'</span>' :
'').
'</td>';
1218 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',
'alpha') : $soc->
email).
'"></td></tr>';
1221 print
'<tr><td>'.$form->editfieldkey(
'Web',
'member_url',
GETPOST(
'member_url',
'alpha'), $object, 0).
'</td>';
1222 print
'<td>'.img_picto(
'',
'globe',
'class="pictofixedwidth"').
' <input type="text" class="maxwidth500 widthcentpercentminusx" name="member_url" id="member_url" value="'.(
GETPOSTISSET(
'member_url') ?
GETPOST(
'member_url',
'alpha') :
$object->url).
'"></td></tr>';
1225 print
'<tr><td class="tdtop">'.$langs->trans(
"Address").
'</td><td>';
1226 print
'<textarea name="address" wrap="soft" class="quatrevingtpercent" rows="2">'.(GETPOSTISSET(
'address') ?
GETPOST(
'address',
'alphanohtml') : $soc->
address).
'</textarea>';
1230 print
'<tr><td>'.$langs->trans(
"Zip").
' / '.$langs->trans(
"Town").
'</td><td>';
1231 print $formcompany->select_ziptown((
GETPOSTISSET(
'zipcode') ?
GETPOST(
'zipcode',
'alphanohtml') : $soc->zip),
'zipcode', array(
'town',
'selectcountry_id',
'state_id'), 6);
1233 print $formcompany->select_ziptown((
GETPOSTISSET(
'town') ?
GETPOST(
'town',
'alphanohtml') : $soc->town),
'town', array(
'zipcode',
'selectcountry_id',
'state_id'));
1237 if (empty($soc->country_id)) {
1238 $soc->country_id =
$mysoc->country_id;
1239 $soc->country_code =
$mysoc->country_code;
1240 $soc->state_id =
$mysoc->state_id;
1242 print
'<tr><td>'.$langs->trans(
'Country').
'</td><td>';
1243 print
img_picto(
'',
'country',
'class="pictofixedwidth"');
1244 print $form->select_country(
GETPOSTISSET(
'country_id') ?
GETPOST(
'country_id',
'alpha') : $soc->country_id,
'country_id');
1246 print
info_admin($langs->trans(
"YouCanChangeValuesForThisListFromDictionarySetup"), 1);
1252 print
'<tr><td>'.$langs->trans(
'State').
'</td><td>';
1254 print
img_picto(
'',
'state',
'class="pictofixedwidth"');
1257 print $countrynotdefined;
1263 print
'<tr><td>'.$langs->trans(
"PhonePro").
'</td>';
1264 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>';
1267 print
'<tr><td>'.$langs->trans(
"PhonePerso").
'</td>';
1268 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>';
1271 print
'<tr><td>'.$langs->trans(
"PhoneMobile").
'</td>';
1272 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>';
1275 foreach ($socialnetworks as $key => $value) {
1276 if (!$value[
'active']) {
1280 print
'<tr><td>'.$langs->trans($value[
'label']).
'</td><td><input type="text" name="member_'.$key.
'" size="40" value="'.$val.
'"></td></tr>';
1285 print
"<tr><td>".$langs->trans(
"DateOfBirth").
"</td><td>\n";
1286 print
img_picto(
'',
'object_calendar',
'class="pictofixedwidth"').$form->selectDate((
$object->birth ?
$object->birth : -1),
'birth', 0, 0, 1,
'formsoc');
1287 print
"</td></tr>\n";
1291 $htmltext = $langs->trans(
"Public",
getDolGlobalString(
'MAIN_INFO_SOCIETE_NOM'), $linkofpubliclist);
1292 print $form->textwithpicto($langs->trans(
"MembershipPublic"), $htmltext, 1,
'help',
'', 0, 3,
'membershippublic');
1293 print
"</td><td>\n";
1294 print $form->selectyesno(
"public",
$object->public, 1,
false, 0, 1);
1295 print
"</td></tr>\n";
1298 if (
isModEnabled(
'category') && $user->hasRight(
'categorie',
'lire')) {
1299 print
'<tr><td>'.$form->editfieldkey(
"Categories",
'memcats',
'', $object, 0).
'</td><td>';
1300 print $form->selectCategories(Categorie::TYPE_MEMBER,
'memcats', $object);
1305 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_add.tpl.php';
1312 print $form->buttonsSaveCancel(
"AddMember");
1318 if ($action ==
'edit') {
1324 $res =
$object->fetch_optionals();
1331 $adht->fetch(
$object->typeid);
1335 if (!empty($country) ||
$object->country_id) {
1336 $sql =
"SELECT rowid, code, label from ".MAIN_DB_PREFIX.
"c_country";
1337 $sql .=
" WHERE rowid = ".(int) (!empty($country) ? $country :
$object->country_id);
1338 $resql =
$db->query($sql);
1340 $obj =
$db->fetch_object($resql);
1345 if (is_object($obj)) {
1346 $object->country_id = $obj->rowid;
1347 $object->country_code = $obj->code;
1348 $object->country = $langs->trans(
"Country".$obj->code) ? $langs->trans(
"Country".$obj->code) : $obj->label;
1355 if (
$conf->use_javascript_ajax) {
1356 print
"\n".
'<script type="text/javascript">';
1357 print
'jQuery(document).ready(function () {
1358 jQuery("#selectcountry_id").change(function() {
1359 document.formsoc.action.value="edit";
1360 document.formsoc.submit();
1362 function initfieldrequired() {
1363 jQuery("#tdcompany").removeClass("fieldrequired");
1364 jQuery("#tdlastname").removeClass("fieldrequired");
1365 jQuery("#tdfirstname").removeClass("fieldrequired");
1366 if (jQuery(\'input[name="morphy"]:checked\').val() == \'mor\') {
1367 jQuery("#tdcompany").addClass("fieldrequired");
1369 if (jQuery(\'input[name="morphy"]:checked\').val() == \'phy\') {
1370 jQuery("#tdlastname").addClass("fieldrequired");
1371 jQuery("#tdfirstname").addClass("fieldrequired");
1374 jQuery(\'input[name="morphy"]\').change(function() {
1375 initfieldrequired();
1377 initfieldrequired();
1379 print
'</script>'.
"\n";
1382 print
'<form name="formsoc" action="'.$_SERVER[
"PHP_SELF"].
'" method="post" enctype="multipart/form-data">';
1383 print
'<input type="hidden" name="token" value="'.newToken().
'" />';
1384 print
'<input type="hidden" name="action" value="update" />';
1385 print
'<input type="hidden" name="rowid" value="'.$id.
'" />';
1386 print
'<input type="hidden" name="statut" value="'.$object->status.
'" />';
1388 print
'<input type="hidden" name="backtopage" value="'.($backtopage !=
'1' ? $backtopage : $_SERVER[
"HTTP_REFERER"]).
'">';
1393 print
'<table class="border centpercent">';
1396 print
'<tr><td class="titlefieldcreate">'.$langs->trans(
"Ref").
'</td><td class="valeur">'.
$object->ref.
'</td></tr>';
1400 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>';
1405 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>';
1409 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Type").
'</td><td>';
1410 if ($user->hasRight(
'adherent',
'creer')) {
1411 print $form->selectarray(
"typeid", $adht->liste_array(), (
GETPOSTISSET(
"typeid") ?
GETPOSTINT(
"typeid") :
$object->typeid), 0, 0, 0,
'', 0, 0, 0,
'',
'minwidth200', 1);
1413 print $adht->getNomUrl(1);
1414 print
'<input type="hidden" name="typeid" value="'.$object->typeid.
'">';
1419 $morphys[
"phy"] = $langs->trans(
"Physical");
1420 $morphys[
"mor"] = $langs->trans(
"Moral");
1422 print
'<tr><td><span class="fieldrequired">'.$langs->trans(
"MemberNature").
'</span></td><td>';
1423 print
'<span id="spannature1" class="member-individual-back spannature paddinglarge marginrightonly"><label for="phisicalinput" class="">'.$morphys[
"phy"].
'<input id="phisicalinput" class="flat checkforselect marginleftonly valignmiddle" type="radio" name="morphy" value="phy"'.($checkednature ==
"phy" ?
' checked="checked"' :
'').
'></label></span>';
1424 print
'<span id="spannature1" class="member-company-back spannature paddinglarge marginrightonly"><label for="moralinput" class="">'.$morphys[
"mor"].
'<input id="moralinput" class="flat checkforselect marginleftonly valignmiddle" type="radio" name="morphy" value="mor"'.($checkednature ==
"mor" ?
' checked="checked"' :
'').
'></label></span>';
1428 print
'<tr><td id="tdcompany">'.$langs->trans(
"Company").
'</td><td>'.
img_picto(
'',
'company',
'class="pictofixedwidth"').
'<input type="text" name="societe" class="minwidth300" maxlength="128" value="'.(
GETPOSTISSET(
"societe") ?
GETPOST(
"societe",
'alphanohtml', 2) :
$object->company).
'"></td></tr>';
1432 print
'<tr><td>'.$langs->trans(
"UserTitle").
'</td><td>';
1433 print $formcompany->select_civility(
GETPOSTISSET(
"civility_code") ?
GETPOST(
"civility_code",
'aZ09') :
$object->civility_code,
'civility_code',
'maxwidth150', 1);
1439 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>';
1443 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>';
1447 print
'<tr><td>'.$langs->trans(
"Gender").
'</td>';
1449 $arraygender = array(
'man' => $langs->trans(
"Genderman"),
'woman' => $langs->trans(
"Genderwoman"),
'other' => $langs->trans(
"Genderother"));
1450 print $form->selectarray(
'gender', $arraygender,
GETPOSTISSET(
'gender') ?
GETPOST(
'gender',
'alphanohtml') :
$object->gender, 1, 0, 0,
'', 0, 0, 0,
'',
'minwidth100', 1);
1454 print
'<tr><td>'.$langs->trans(
"Photo").
'</td>';
1455 print
'<td class="hideonsmartphone" valign="middle">';
1456 print $form->showphoto(
'memberphoto', $object).
"\n";
1457 if ($caneditfieldmember) {
1461 print
'<table class="nobordernopadding">';
1463 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>';
1467 $maxmin = $maxfilesizearray[
'maxmin'];
1469 print
'<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).
'">';
1471 print
'<input type="file" class="flat" name="photo" id="photoinput">';
1478 print
'<tr><td>'.(getDolGlobalString(
"ADHERENT_MAIL_REQUIRED") ?
'<span class="fieldrequired">' :
'').$langs->trans(
"EMail").(getDolGlobalString(
"ADHERENT_MAIL_REQUIRED") ?
'</span>' :
'').
'</td>';
1479 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>';
1482 print
'<tr><td>'.$form->editfieldkey(
'Web',
'member_url',
GETPOST(
'member_url',
'alpha'), $object, 0).
'</td>';
1483 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>';
1486 print
'<tr><td>'.$langs->trans(
"Address").
'</td><td>';
1487 print
'<textarea name="address" wrap="soft" class="quatrevingtpercent" rows="'.ROWS_2.
'">'.(
GETPOSTISSET(
"address") ?
GETPOST(
"address",
'alphanohtml', 2) :
$object->
address).
'</textarea>';
1491 print
'<tr><td>'.$langs->trans(
"Zip").
' / '.$langs->trans(
"Town").
'</td><td>';
1492 print $formcompany->select_ziptown((
GETPOSTISSET(
"zipcode") ?
GETPOST(
"zipcode",
'alphanohtml', 2) :
$object->zip),
'zipcode', array(
'town',
'selectcountry_id',
'state_id'), 6);
1494 print $formcompany->select_ziptown((
GETPOSTISSET(
"town") ?
GETPOST(
"town",
'alphanohtml', 2) :
$object->town),
'town', array(
'zipcode',
'selectcountry_id',
'state_id'));
1499 print
'<tr><td>'.$langs->trans(
'Country').
'</td><td>';
1500 print
img_picto(
'',
'country',
'class="pictofixedwidth"');
1501 print $form->select_country(
GETPOSTISSET(
"country_id") ?
GETPOST(
"country_id",
"alpha") :
$object->country_id,
'country_id');
1503 print
info_admin($langs->trans(
"YouCanChangeValuesForThisListFromDictionarySetup"), 1);
1509 print
'<tr><td>'.$langs->trans(
'State').
'</td><td>';
1510 print
img_picto(
'',
'state',
'class="pictofixedwidth"');
1516 print
'<tr><td>'.$langs->trans(
"PhonePro").
'</td>';
1517 print
'<td>'.img_picto(
'',
'object_phoning',
'class="pictofixedwidth"').
'<input type="text" name="phone" value="'.(
GETPOSTISSET(
"phone") ?
GETPOST(
"phone") :
$object->phone).
'"></td></tr>';
1520 print
'<tr><td>'.$langs->trans(
"PhonePerso").
'</td>';
1521 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>';
1524 print
'<tr><td>'.$langs->trans(
"PhoneMobile").
'</td>';
1525 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>';
1528 foreach ($socialnetworks as $key => $value) {
1529 if (!$value[
'active']) {
1532 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>';
1537 print
"<tr><td>".$langs->trans(
"DateOfBirth").
"</td><td>\n";
1538 print
img_picto(
'',
'object_calendar',
'class="pictofixedwidth"').$form->selectDate((
$object->birth ?
$object->birth : -1),
'birth', 0, 0, 1,
'formsoc');
1539 print
"</td></tr>\n";
1543 print
'<tr><td>'.$form->editfieldkey(
'DefaultLang',
'default_lang',
'', $object, 0).
'</td><td colspan="3">'.
"\n";
1544 print
img_picto(
'',
'language',
'class="pictofixedwidth"').$formadmin->select_language(
$object->default_lang,
'default_lang', 0, array(), 1);
1551 $htmltext = $langs->trans(
"Public",
getDolGlobalString(
'MAIN_INFO_SOCIETE_NOM'), $linkofpubliclist);
1552 print $form->textwithpicto($langs->trans(
"MembershipPublic"), $htmltext, 1,
'help',
'', 0, 3,
'membershippublic');
1553 print
"</td><td>\n";
1554 print $form->selectyesno(
"public", (
GETPOSTISSET(
"public") ?
GETPOST(
"public",
'alphanohtml', 2) :
$object->public), 1, false, 0, 1);
1555 print
"</td></tr>\n";
1558 if (
isModEnabled(
'category') && $user->hasRight(
'categorie',
'lire')) {
1559 print
'<tr><td>'.$form->editfieldkey(
"Categories",
'memcats',
'', $object, 0).
'</td>';
1561 print $form->selectCategories(Categorie::TYPE_MEMBER,
'memcats', $object);
1567 print
'<tr><td>'.$langs->trans(
"LinkedToDolibarrThirdParty").
'</td><td colspan="2" class="valeur">';
1570 $result = $company->fetch(
$object->socid);
1571 print $company->getNomUrl(1);
1573 print $langs->trans(
"NoThirdPartyAssociatedToMember");
1579 print
'<tr><td>'.$langs->trans(
"LinkedToDolibarrUser").
'</td><td colspan="2" class="valeur">';
1581 $form->form_users($_SERVER[
'PHP_SELF'].
'?rowid='.
$object->id, (
string)
$object->user_id,
'none');
1583 print $langs->trans(
"NoDolibarrAccess");
1588 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_edit.tpl.php';
1593 print $form->buttonsSaveCancel(
"Save",
'Cancel');
1599 if ($id > 0 && $action !=
'edit') {
1605 $res =
$object->fetch_optionals();
1612 $res = $adht->fetch(
$object->typeid);
1624 print
dol_get_fiche_head($head,
'general', $langs->trans(
"Member"), -1,
'user', 0,
'',
'', 0,
'', 1);
1627 if ($action ==
'create_user') {
1629 if (empty($login)) {
1631 include_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
1634 if (empty($login)) {
1635 $login = strtolower(substr(
$object->firstname, 0, 4)).strtolower(substr(
$object->lastname, 0, 4));
1639 $formquestion = array(
1640 array(
'label' => $langs->trans(
"LoginToCreate"),
'type' =>
'text',
'name' =>
'login',
'value' => $login)
1644 $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")));
1648 $text .= $langs->trans(
"UserWillBeInternalUser").
'<br>';
1650 $text .= $langs->trans(
"ConfirmCreateLogin");
1651 print $form->formconfirm($_SERVER[
"PHP_SELF"].
"?rowid=".
$object->id, $langs->trans(
"CreateDolibarrLogin"), $text,
"confirm_create_user", $formquestion,
'yes');
1655 if ($action ==
'create_thirdparty') {
1657 $fullname =
$object->getFullName($langs);
1659 if (
$object->morphy ==
'mor') {
1661 if (!empty($fullname)) {
1662 $companyalias = (
string) $fullname;
1665 $companyname = $fullname;
1666 if (!empty(
$object->company)) {
1672 $formquestion = array(
1673 array(
'label' => $langs->trans(
"NameToCreate"),
'type' =>
'text',
'name' =>
'companyname',
'value' => $companyname,
'morecss' =>
'minwidth300',
'moreattr' =>
'maxlength="128"'),
1674 array(
'label' => $langs->trans(
"AliasNames"),
'type' =>
'text',
'name' =>
'companyalias',
'value' => $companyalias,
'morecss' =>
'minwidth300',
'moreattr' =>
'maxlength="128"')
1677 print $form->formconfirm($_SERVER[
"PHP_SELF"].
"?rowid=".
$object->id, $langs->trans(
"CreateDolibarrThirdParty"), $langs->trans(
"ConfirmCreateThirdParty"),
"confirm_create_thirdparty", $formquestion,
'yes');
1681 if ($action ==
'valid') {
1682 $langs->load(
"mails");
1685 $adht->fetch(
$object->typeid);
1691 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
1695 $outputlangs->setDefaultLang(empty(
$object->thirdparty->default_lang) ?
$mysoc->default_lang :
$object->thirdparty->default_lang);
1697 $outputlangs->loadLangs(array(
"main",
"members",
"companies",
"install",
"other"));
1699 $arraydefaultmessage =
null;
1702 if (!empty($labeltouse)) {
1703 $arraydefaultmessage = $formmail->getEMailTemplate(
$db,
'member', $user, $outputlangs, 0, 1, $labeltouse);
1706 if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
1707 $subject = (
string) $arraydefaultmessage->topic;
1708 $msg = (
string) $arraydefaultmessage->content;
1711 $substitutionarray = getCommonSubstitutionArray($outputlangs, 0,
null, $object);
1716 $tmp = $langs->trans(
"SendingAnEMailToMember");
1717 $tmp .=
'<br>'.$langs->trans(
"MailFrom").
': <b>'.
getDolGlobalString(
'ADHERENT_MAIL_FROM',
$conf->email_from).
'</b>, ';
1718 $tmp .=
'<br>'.$langs->trans(
"MailRecipient").
': <b>'.
$object->email.
'</b>';
1720 $helpcontent .=
'<b>'.$langs->trans(
"MailFrom").
'</b>: '.
getDolGlobalString(
'ADHERENT_MAIL_FROM',
$conf->email_from).
'<br>'.
"\n";
1721 $helpcontent .=
'<b>'.$langs->trans(
"MailRecipient").
'</b>: '.
$object->email.
'<br>'.
"\n";
1722 $helpcontent .=
'<b>'.$langs->trans(
"Subject").
'</b>:<br>'.
"\n";
1723 $helpcontent .= $subjecttosend.
"\n";
1724 $helpcontent .=
"<br>";
1725 $helpcontent .=
'<b>'.$langs->trans(
"Content").
'</b>:<br>';
1728 $label = $form->textwithpicto($tmp, $helpcontent, 1,
'help');
1731 $formquestion = array();
1733 $formquestion[] = array(
'type' =>
'checkbox',
'name' =>
'send_mail',
'label' => $label,
'value' => (
getDolGlobalString(
'ADHERENT_DEFAULT_SENDINFOBYMAIL') ?
true : false));
1736 $formquestion[] = array(
'type' =>
'other',
'label' => $langs->transnoentitiesnoconv(
"SynchroMailManEnabled"),
'value' =>
'');
1739 $formquestion[] = array(
'type' =>
'other',
'label' => $langs->transnoentitiesnoconv(
"SynchroSpipEnabled"),
'value' =>
'');
1741 print $form->formconfirm(
"card.php?rowid=".$id, $langs->trans(
"ValidateMember"), $langs->trans(
"ConfirmValidateMember"),
"confirm_valid", $formquestion,
'yes', 1, 0);
1745 if ($action ==
'resiliate') {
1746 $langs->load(
"mails");
1749 $adht->fetch(
$object->typeid);
1755 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
1759 $outputlangs->setDefaultLang(empty(
$object->thirdparty->default_lang) ?
$mysoc->default_lang :
$object->thirdparty->default_lang);
1761 $outputlangs->loadLangs(array(
"main",
"members"));
1763 $arraydefaultmessage =
null;
1766 if (!empty($labeltouse)) {
1767 $arraydefaultmessage = $formmail->getEMailTemplate(
$db,
'member', $user, $outputlangs, 0, 1, $labeltouse);
1770 if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
1771 $subject = (
string) $arraydefaultmessage->topic;
1772 $msg = (
string) $arraydefaultmessage->content;
1775 $substitutionarray = getCommonSubstitutionArray($outputlangs, 0,
null, $object);
1780 $tmp = $langs->trans(
"SendingAnEMailToMember");
1781 $tmp .=
'<br>('.$langs->trans(
"MailFrom").
': <b>'.
getDolGlobalString(
'ADHERENT_MAIL_FROM',
$conf->email_from).
'</b>, ';
1782 $tmp .= $langs->trans(
"MailRecipient").
': <b>'.
$object->email.
'</b>)';
1784 $helpcontent .=
'<b>'.$langs->trans(
"MailFrom").
'</b>: '.
getDolGlobalString(
'ADHERENT_MAIL_FROM',
$conf->email_from).
'<br>'.
"\n";
1785 $helpcontent .=
'<b>'.$langs->trans(
"MailRecipient").
'</b>: '.
$object->email.
'<br>'.
"\n";
1786 $helpcontent .=
'<b>'.$langs->trans(
"Subject").
'</b>:<br>'.
"\n";
1787 $helpcontent .= $subjecttosend.
"\n";
1788 $helpcontent .=
"<br>";
1789 $helpcontent .=
'<b>'.$langs->trans(
"Content").
'</b>:<br>';
1792 $label = $form->textwithpicto($tmp, $helpcontent, 1,
'help');
1795 $formquestion = array();
1797 $formquestion[] = array(
'type' =>
'checkbox',
'name' =>
'send_mail',
'label' => $label,
'value' => (
getDolGlobalString(
'ADHERENT_DEFAULT_SENDINFOBYMAIL') ?
'true' :
'false'));
1800 $formquestion[] = array(
'type' =>
'hidden',
'name' =>
'backtopage',
'value' => ($backtopage !=
'1' ? $backtopage : $_SERVER[
"HTTP_REFERER"]));
1802 print $form->formconfirm(
"card.php?rowid=".$id, $langs->trans(
"ResiliateMember"), $langs->trans(
"ConfirmResiliateMember"),
"confirm_resiliate", $formquestion,
'no', 1, 240);
1806 if ($action ==
'exclude') {
1807 $langs->load(
"mails");
1810 $adht->fetch(
$object->typeid);
1816 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
1820 $outputlangs->setDefaultLang(empty(
$object->thirdparty->default_lang) ?
$mysoc->default_lang :
$object->thirdparty->default_lang);
1822 $outputlangs->loadLangs(array(
"main",
"members"));
1824 $arraydefaultmessage =
null;
1827 if (!empty($labeltouse)) {
1828 $arraydefaultmessage = $formmail->getEMailTemplate(
$db,
'member', $user, $outputlangs, 0, 1, $labeltouse);
1831 if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
1832 $subject = (
string) $arraydefaultmessage->topic;
1833 $msg = (
string) $arraydefaultmessage->content;
1836 $substitutionarray = getCommonSubstitutionArray($outputlangs, 0,
null, $object);
1841 $tmp = $langs->trans(
"SendingAnEMailToMember");
1842 $tmp .=
'<br>('.$langs->trans(
"MailFrom").
': <b>'.
getDolGlobalString(
'ADHERENT_MAIL_FROM',
$conf->email_from).
'</b>, ';
1843 $tmp .= $langs->trans(
"MailRecipient").
': <b>'.
$object->email.
'</b>)';
1845 $helpcontent .=
'<b>'.$langs->trans(
"MailFrom").
'</b>: '.
getDolGlobalString(
'ADHERENT_MAIL_FROM',
$conf->email_from).
'<br>'.
"\n";
1846 $helpcontent .=
'<b>'.$langs->trans(
"MailRecipient").
'</b>: '.
$object->email.
'<br>'.
"\n";
1847 $helpcontent .=
'<b>'.$langs->trans(
"Subject").
'</b>:<br>'.
"\n";
1848 $helpcontent .= $subjecttosend.
"\n";
1849 $helpcontent .=
"<br>";
1850 $helpcontent .=
'<b>'.$langs->trans(
"Content").
'</b>:<br>';
1853 $label = $form->textwithpicto($tmp, $helpcontent, 1,
'help');
1856 $formquestion = array();
1858 $formquestion[] = array(
'type' =>
'checkbox',
'name' =>
'send_mail',
'label' => $label,
'value' => (
getDolGlobalString(
'ADHERENT_DEFAULT_SENDINFOBYMAIL') ?
'true' :
'false'));
1861 $formquestion[] = array(
'type' =>
'hidden',
'name' =>
'backtopage',
'value' => ($backtopage !=
'1' ? $backtopage : $_SERVER[
"HTTP_REFERER"]));
1863 print $form->formconfirm(
"card.php?rowid=".$id, $langs->trans(
"ExcludeMember"), $langs->trans(
"ConfirmExcludeMember"),
"confirm_exclude", $formquestion,
'no', 1, 240);
1867 if ($action ==
'delete') {
1868 $formquestion = array();
1870 $formquestion[] = array(
'type' =>
'hidden',
'name' =>
'backtopage',
'value' => ($backtopage !=
'1' ? $backtopage : $_SERVER[
"HTTP_REFERER"]));
1872 print $form->formconfirm(
"card.php?rowid=".$id, $langs->trans(
"DeleteMember"), $langs->trans(
"ConfirmDeleteMember"),
"confirm_delete", $formquestion,
'no', 1);
1876 if ($action ==
'add_spip') {
1877 print $form->formconfirm(
"card.php?rowid=".$id, $langs->trans(
'AddIntoSpip'), $langs->trans(
'AddIntoSpipConfirmation'),
'confirm_add_spip');
1881 if ($action ==
'merge') {
1882 $formquestion = array(
1884 'name' =>
'member_origin',
1885 'label' => $langs->trans(
'MergeOriginMember'),
1887 'value' => $form->selectMembers(
'',
'member_origin',
'', 0, 1,
'', 0, array(), 0,
'SelectMember', 0,
'minwidth200', array(), 1, array(
$object->id))
1891 print $form->formconfirm($_SERVER[
"PHP_SELF"].
"?id=".
$object->id, $langs->trans(
"MergeMembers"), $langs->trans(
"ConfirmMergeMembers"),
"confirm_merge", $formquestion,
'no', 1, 300);
1895 if ($action ==
'del_spip') {
1896 print $form->formconfirm(
"card.php?rowid=$id", $langs->trans(
'DeleteIntoSpip'), $langs->trans(
'DeleteIntoSpipConfirmation'),
'confirm_del_spip');
1907 $linkback =
'<a href="'.dolBuildUrl(DOL_URL_ROOT.
'/adherents/list.php', [
'restore_lastsearch_values' => 1]).
'">'.$langs->trans(
"BackToList").
'</a>';
1909 $morehtmlref =
'<a href="'.dolBuildUrl(DOL_URL_ROOT.
'/adherents/vcard.php', [
'id' =>
$object->id]).
'" class="refid valignmiddle">';
1910 $morehtmlref .=
img_picto($langs->trans(
"Download").
' '.$langs->trans(
"VCard"),
'vcard',
'class="valignmiddle marginleftonly paddingrightonly"');
1911 $morehtmlref .=
'</a>';
1914 dol_banner_tab($object,
'rowid', $linkback, 1,
'rowid',
'ref', $morehtmlref);
1916 print
'<div class="fichecenter">';
1917 print
'<div class="fichehalfleft">';
1919 print
'<div class="underbanner clearboth"></div>';
1920 print
'<table class="border tableforfield centpercent">';
1924 print
'<tr><td class="titlefieldmiddle">'.$langs->trans(
"Login").
' / '.$langs->trans(
"Id").
'</td><td class="valeur">'.
dol_escape_htmltag(
$object->login).
'</td></tr>';
1928 print
'<tr><td class="titlefieldmiddle">'.$langs->trans(
"Type").
'</td>';
1929 print
'<td class="valeur">'.$adht->getNomUrl(1).
"</td></tr>\n";
1932 print
'<tr><td>'.$langs->trans(
"MemberNature").
'</td>';
1933 print
'<td class="valeur">'.$object->getmorphylib(
'', 1).
'</td>';
1940 print
'<tr><td>'.$langs->trans(
"UserTitle").
'</td><td class="valeur">'.
$object->getCivilityLabel().
'</td>';
1945 print
'<tr><td>'.$langs->trans(
"Password").
'</td><td>';
1947 print preg_replace(
'/./i',
'*',
$object->pass);
1950 print
'<!-- '.$langs->trans(
"Crypted").
': '.
$object->pass_indatabase_crypted.
' -->';
1952 print
'<span class="opacitymedium">'.$langs->trans(
"Hidden").
'</span>';
1954 if (!empty(
$object->pass_indatabase) && empty(
$object->user_id)) {
1955 $langs->load(
"errors");
1956 $htmltext = $langs->trans(
"WarningPasswordSetWithNoAccount");
1957 print
' '.$form->textwithpicto(
'', $htmltext, 1,
'warning');
1963 print
'<tr><td>'.$langs->trans(
"SubscriptionEndDate").
'</td><td class="valeur">';
1967 print
" ".img_warning($langs->trans(
"Late"));
1970 if (
$object->need_subscription == 0) {
1971 print $langs->trans(
"SubscriptionNotNeeded");
1972 } elseif (!$adht->subscription) {
1973 print $langs->trans(
"SubscriptionNotRecorded");
1975 print
" ".img_warning($langs->trans(
"Late"));
1978 print $langs->trans(
"SubscriptionNotReceived");
1980 print
" ".img_warning($langs->trans(
"Late"));
1990 print
'<div class="fichehalfright">';
1991 print
'<div class="underbanner clearboth"></div>';
1993 print
'<table class="border tableforfield centpercent">';
1996 if (
isModEnabled(
'category') && $user->hasRight(
'categorie',
'lire')) {
1997 print
'<tr><td>'.$langs->trans(
"Categories").
'</td>';
1999 print $form->showCategories(
$object->id, Categorie::TYPE_MEMBER, 1);
2004 print
'<tr><td class="titlefieldmiddle">'.$langs->trans(
"DateOfBirth").
'</td><td class="valeur">'.
dol_print_date(
$object->birth,
'day').
'</td></tr>';
2008 require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
2009 print
'<tr><td>'.$langs->trans(
"DefaultLang").
'</td><td>';
2012 $langs->load(
"languages");
2013 $labellang = (
$object->default_lang ? $langs->trans(
'Language_'.
$object->default_lang) :
'');
2021 $htmltext = $langs->trans(
"Public",
getDolGlobalString(
'MAIN_INFO_SOCIETE_NOM'), $linkofpubliclist);
2022 print $form->textwithpicto($langs->trans(
"MembershipPublic"), $htmltext, 1,
'help',
'', 0, 3,
'membershippublic');
2023 print
'</td><td class="valeur">'.yn(
$object->public).
'</td></tr>';
2026 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
2031 $editenable = $user->hasRight(
'adherent',
'creer');
2032 print $form->editfieldkey(
'LinkedToDolibarrThirdParty',
'thirdparty',
'', $object, $editenable);
2033 print
'</td><td colspan="2" class="valeur">';
2034 if ($action ==
'editthirdparty') {
2035 $htmlname =
'socid';
2036 print
'<form method="POST" action="'.$_SERVER[
'PHP_SELF'].
'" name="form'.$htmlname.
'">';
2037 print
'<input type="hidden" name="rowid" value="'.$object->id.
'">';
2038 print
'<input type="hidden" name="action" value="set'.$htmlname.
'">';
2039 print
'<input type="hidden" name="token" value="'.newToken().
'">';
2040 print
'<table class="nobordernopadding">';
2042 print $form->select_company(
$object->socid,
'socid',
'', 1);
2044 print
'<td class="left"><input type="submit" class="button button-edit smallpaddingimp" value="'.$langs->trans(
"Modify").
'"></td>';
2045 print
'</tr></table></form>';
2049 $result = $company->fetch(
$object->socid);
2050 print $company->getNomUrl(1);
2053 $tmparray = $company->getOutstandingBills(
'customer');
2054 if (!empty($tmparray[
'refs'])) {
2055 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']).
')';
2060 print
'<span class="opacitymedium">'.$langs->trans(
"NoThirdPartyAssociatedToMember").
'</span>';
2068 $editenable = $user->hasRight(
'adherent',
'creer') && $user->hasRight(
'user',
'user',
'creer');
2069 print $form->editfieldkey(
'LinkedToDolibarrUser',
'login',
'', $object, (
int) $editenable);
2070 print
'</td><td colspan="2" class="valeur">';
2071 if ($action ==
'editlogin') {
2072 $form->form_users($_SERVER[
'PHP_SELF'].
'?rowid='.
$object->id, (
string)
$object->user_id,
'userid', array());
2076 $linkeduser->fetch(
$object->user_id);
2077 print $linkeduser->getNomUrl(-1);
2079 print
'<span class="opacitymedium">'.$langs->trans(
"NoDolibarrAccess").
'</span>';
2086 print
"</div></div>\n";
2087 print
'<div class="clearboth"></div>';
2096 print
'<div class="tabsAction">';
2098 $parameters = array();
2099 $reshook = $hookmanager->executeHooks(
'addMoreActionsButtons', $parameters, $object, $action);
2100 if (empty($reshook)) {
2101 if ($action !=
'editlogin' && $action !=
'editthirdparty') {
2103 if (empty($user->socid)) {
2105 print
dolGetButtonAction(
'', $langs->trans(
'SendMail'),
'email',
dolBuildUrl($_SERVER[
"PHP_SELF"], [
'id' =>
$object->id,
'action' =>
'presend',
'mode' =>
'init'],
true).
'#formmailbeforetitle',
'');
2124 if ($user->hasRight(
'adherent',
'creer')) {
2125 print
'<a class="butAction" href="'.dolBuildUrl($_SERVER[
"PHP_SELF"], [
'id' =>
$object->id,
'action' =>
'edit'],
true).
'">'.$langs->trans(
"Modify").
'</a>'.
"\n";
2127 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"Modify").
'</span>'.
"\n";
2132 if ($user->hasRight(
'adherent',
'creer')) {
2133 print
'<a class="butAction" href="'.dolBuildUrl($_SERVER[
"PHP_SELF"], [
'id' =>
$object->id,
'action' =>
'valid'],
true).
'">'.$langs->trans(
"Validate").
'</a>'.
"\n";
2135 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"Validate").
'</span>'.
"\n";
2141 if ($user->hasRight(
'adherent',
'creer')) {
2142 print
'<a class="butAction" href="'.dolBuildUrl($_SERVER[
"PHP_SELF"], [
'id' =>
$object->id,
'action' =>
'valid'],
true).
'">'.$langs->trans(
"Reenable").
"</a>\n";
2144 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"Reenable").
'</span>'.
"\n";
2150 if ($user->hasRight(
'adherent',
'supprimer')) {
2151 print
'<a class="butAction" href="'.dolBuildUrl($_SERVER[
"PHP_SELF"], [
'id' =>
$object->id,
'action' =>
'resiliate'],
true).
'">'.$langs->trans(
"Resiliate").
"</a></span>\n";
2153 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"Resiliate").
'</span>'.
"\n";
2159 if ($user->hasRight(
'adherent',
'supprimer')) {
2160 print
'<a class="butAction" href="'.dolBuildUrl($_SERVER[
"PHP_SELF"], [
'id' =>
$object->id,
'action' =>
'exclude'],
true).
'">'.$langs->trans(
"Exclude").
"</a></span>\n";
2162 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"Exclude").
'</span>'.
"\n";
2168 if ($user->hasRight(
'societe',
'creer')) {
2170 print
'<a class="butAction" href="'.dolBuildUrl($_SERVER[
"PHP_SELF"], [
'id' =>
$object->id,
'action' =>
'create_thirdparty'],
true).
'" title="'.
dol_escape_htmltag($langs->trans(
"CreateDolibarrThirdPartyDesc")).
'">'.$langs->trans(
"CreateDolibarrThirdParty").
'</a>'.
"\n";
2172 print
'<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans(
"ValidateBefore")).
'">'.$langs->trans(
"CreateDolibarrThirdParty").
'</a>'.
"\n";
2175 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"CreateDolibarrThirdParty").
'</span>'.
"\n";
2180 if (!$user->socid && !
$object->user_id) {
2181 if ($user->hasRight(
'user',
'user',
'creer')) {
2183 print
'<a class="butAction" href="'.dolBuildUrl($_SERVER[
"PHP_SELF"], [
'id' =>
$object->id,
'action' =>
'create_user'],
true).
'" title="'.
dol_escape_htmltag($langs->trans(
"CreateDolibarrLoginDesc")).
'">'.$langs->trans(
"CreateDolibarrLogin").
'</a>'.
"\n";
2185 print
'<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans(
"ValidateBefore")).
'">'.$langs->trans(
"CreateDolibarrLogin").
'</a>'.
"\n";
2188 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"CreateDolibarrLogin").
'</span>'.
"\n";
2194 $isinspip = $mailmanspip->is_in_spip($object);
2196 if ($isinspip == 1) {
2197 print
'<a class="butAction" href="'.dolBuildUrl($_SERVER[
"PHP_SELF"], [
'id' =>
$object->id,
'action' =>
'del_spip'],
true).
'">'.$langs->trans(
"DeleteIntoSpip").
'</a>'.
"\n";
2199 if ($isinspip == 0) {
2200 print
'<a class="butAction" href="'.dolBuildUrl($_SERVER[
"PHP_SELF"], [
'id' =>
$object->id,
'action' =>
'add_spip'],
true).
'">'.$langs->trans(
"AddIntoSpip").
'</a>'.
"\n";
2205 print
dolGetButtonAction($langs->trans(
'MergeMembers'), $langs->trans(
'Merge'),
'danger',
dolBuildUrl($_SERVER[
"PHP_SELF"], [
'id' =>
$object->id,
'action' =>
'merge'],
true),
'', $user->hasRight(
'adherent',
'supprimer'));
2208 if ($user->hasRight(
'adherent',
'supprimer')) {
2209 print
'<a class="butActionDelete" href="'.dolBuildUrl($_SERVER[
"PHP_SELF"], [
'id' =>
$object->id,
'action' =>
'delete'],
true).
'">'.$langs->trans(
"Delete").
'</a>'.
"\n";
2211 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"Delete").
'</span>'.
"\n";
2217 if ($isinspip == -1) {
2218 print
'<br><br><span class="error">'.$langs->trans(
'SPIPConnectionFailed').
': '.$mailmanspip->error.
'</span>';
2223 if (
GETPOST(
'modelselected')) {
2224 $action =
'presend';
2227 if ($action !=
'presend') {
2228 print
'<div class="fichecenter"><div class="fichehalfleft">';
2229 print
'<a name="builddoc"></a>';
2233 $filedir =
$conf->member->dir_output.
'/'.
get_exdir(0, 0, 0, 1, $object,
'member');
2234 $urlsource = $_SERVER[
'PHP_SELF'].
'?id='.
$object->id;
2235 $genallowed = $user->hasRight(
'adherent',
'lire');
2236 $delallowed = $user->hasRight(
'adherent',
'creer');
2238 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);
2239 $somethingshown = $formfile->numoffiles;
2247 include_once DOL_DOCUMENT_ROOT.
'/core/lib/payments.lib.php';
2248 $validpaymentmethod = getValidOnlinePaymentMethods(
'');
2249 $useonlinepayment = count($validpaymentmethod);
2251 if ($useonlinepayment) {
2253 if (empty($amount)) {
2254 $amount = max($adht->amount,
$object->first_subscription_amount,
$object->last_subscription_amount);
2256 if (empty($amount)) {
2259 require_once DOL_DOCUMENT_ROOT.
'/core/lib/payments.lib.php';
2260 print showOnlinePaymentUrl(
'membersubscription',
$object->ref, $amount);
2263 print
'</div><div class="fichehalfright">';
2267 $morehtmlcenter =
'';
2268 $messagingUrl =
dolBuildUrl(DOL_URL_ROOT.
'/adherents/messaging.php', [
'id' =>
$object->id]);
2269 $morehtmlcenter .=
dolGetButtonTitle($langs->trans(
'ShowAsConversation'),
'',
'fa fa-comments imgforviewmode', $messagingUrl,
'', 1);
2273 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formactions.class.php';
2275 $somethingshown = $formactions->showactions($object,
$object->element, $socid, 1,
'listactions', $MAXEVENT,
'', $morehtmlcenter);
2277 print
'</div></div>';
2281 $modelmail =
'member';
2282 $defaulttopic =
'CardContent';
2283 $diroutput =
$conf->member->dir_output;
2284 $trackid =
'mem'.$object->id;
2286 include DOL_DOCUMENT_ROOT.
'/core/tpl/card_presend.tpl.php';
$id
Support class for third parties, contacts, members, users or resources.
if(! $sortfield) if(! $sortorder) $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.
addFileIntoDatabaseIndex($dir, $file, $fullpathorig='', $mode='uploaded', $setsharekey=0, $object=null, $forceFullTextIndexation='')
Add a file into database index.
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.
deleteFilesIntoDatabaseIndex($dir, $file, $mode='uploaded', $object=null)
Delete files into database index using search criteria.
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...
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)
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.
dolBuildUrl($url, $params=[], $addtoken=false, $anchor='')
Return path of url.
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.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1, $includequotes=0, $allowdash=0)
Clean a string to use it as a file name.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0, $nodefault=0)
Return value of a param into GET or POST supervariable.
dolGetButtonAction($label, $text='', $actionType='default', $url='', $id='', $userRight=1, $params=array())
Function dolGetButtonAction.
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.
GETPOSTINT($paramname, $method=0, $nodefault=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_clone($srcobject, $native=2)
Create a clone of instance of object (new instance with same value for each properties) With native =...
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false, $decorate=0)
Output date in a string format according to outputlangs (or langs if not defined).
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
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.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='', $picto='', $textonpictotooltip='', $cssfordropdown='info_admin')
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.
print $langs trans("Show") . '< td style="' . $timeColor . '" align="center"> s</td > badge status0 badge status4 badge status3 Error badge status8< td align="center">< span class="badge ' . $badge . '"></span ></td >< td align="center">< a href="#" class="button button-small" onclick="openLogModal(this)" data-req="' . dol_escape_htmltag($reqSafe) . '" data-res="' . dol_escape_htmltag($resSafe) . '" data-err="' . dol_escape_htmltag($errSafe) . '">< span class="fa fa-search-plus"></span ></a ></td ></tr >< tr >< td colspan="' . $colspan . '" class="opacitymedium"></td ></tr ></table ></div ></form > logModal none logModal none s a JSON string
buildzip.php
member_prepare_head(Adherent $object)
Return array head with list of tabs to view object information.
$conf db name
Only used if Module[ID]Name translation string is not found.
getRandomPassword($generic=false, $replaceambiguouschars=null, $length=32)
Return a generated password using default module.
getMaxFileSizeArray()
Return the max allowed for file upload.
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.