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/functions2.lib.php';
40require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
41require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent_type.class.php';
42require_once DOL_DOCUMENT_ROOT.
'/adherents/class/subscription.class.php';
43require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
44require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
45require_once DOL_DOCUMENT_ROOT.
'/core/class/extrafields.class.php';
46require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formadmin.class.php';
47require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
48require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
52$langs->loadLangs(array(
"companies",
"bills",
"members",
"users",
"other",
"paypal"));
56$action =
GETPOST(
'action',
'aZ09');
57$cancel =
GETPOST(
'cancel',
'alpha');
58$backtopage =
GETPOST(
'backtopage',
'alpha');
59$backtopageforcancel =
GETPOST(
'backtopageforcancel',
'alpha');
60$confirm =
GETPOST(
'confirm',
'alpha');
68if (isModEnabled(
'mailmanspip')) {
69 include_once DOL_DOCUMENT_ROOT.
'/mailmanspip/class/mailmanspip.class.php';
71 $langs->load(
'mailmanspip');
80$extrafields->fetch_name_optionals_label(
$object->table_element);
89 require_once DOL_DOCUMENT_ROOT.
'/core/class/canvas.class.php';
90 $objcanvas =
new Canvas($db, $action);
91 $objcanvas->getCanvas(
'adherent',
'membercard', $canvas);
95$hookmanager->initHooks(array(
'membercard',
'globalcard'));
98if ($id > 0 || !empty($ref)) {
100 $result =
$object->fetch($id, $ref);
103 $canadduser = ($user->admin || $user->hasRight(
'user',
'user',
'creer'));
107 $caneditfielduser = ((($user->id ==
$object->user_id) && $user->hasRight(
'user',
'self',
'creer'))
108 || (($user->id !=
$object->user_id) && $user->hasRight(
'user',
'user',
'creer')));
109 $caneditpassworduser = ((($user->id ==
$object->user_id) && $user->hasRight(
'user',
'self',
'password'))
110 || (($user->id !=
$object->user_id) && $user->hasRight(
'user',
'user',
'password')));
115$canaddmember = $user->hasRight(
'adherent',
'creer');
118 $caneditfieldmember = $user->hasRight(
'adherent',
'creer');
124if (!$user->hasRight(
'adherent',
'creer') && $action ==
'edit') {
128$linkofpubliclist = DOL_MAIN_URL_ROOT.
'/public/members/public_list.php'.((isModEnabled(
'multicompany')) ?
'?entity='.$conf->entity :
'');
135$parameters = array(
'id' => $id,
'rowid' => $id,
'objcanvas' => $objcanvas,
'confirm' => $confirm);
136$reshook = $hookmanager->executeHooks(
'doActions', $parameters,
$object, $action);
141if (empty($reshook)) {
142 $backurlforlist = DOL_URL_ROOT.
'/adherents/list.php';
144 if (empty($backtopage) || ($cancel && empty($id))) {
145 if (empty($backtopage) || ($cancel && strpos($backtopage,
'__ID__'))) {
146 if (empty($id) && (($action !=
'add' && $action !=
'create') || $cancel)) {
147 $backtopage = $backurlforlist;
149 $backtopage = DOL_URL_ROOT.
'/adherents/card.php?id='.((!empty($id) && $id > 0) ? $id :
'__ID__');
155 if (!empty($backtopageforcancel)) {
156 header(
"Location: ".$backtopageforcancel);
158 } elseif (!empty($backtopage)) {
159 header(
"Location: ".$backtopage);
165 if ($action ==
'setuserid' && ($user->hasRight(
'user',
'self',
'creer') || $user->hasRight(
'user',
'user',
'creer'))) {
167 if (!$user->hasRight(
'user',
'user',
'creer')) {
168 if ($userid != $user->id && $userid !=
$object->user_id) {
170 setEventMessages($langs->trans(
"ErrorUserPermissionAllowsToLinksToItselfOnly"),
null,
'errors');
175 if ($userid !=
$object->user_id) {
176 $result =
$object->setUserId($userid);
185 if ($action ==
'setsocid' && $caneditfieldmember) {
188 if ($socid !=
$object->socid) {
189 $sql =
"SELECT rowid FROM ".MAIN_DB_PREFIX.
"adherent";
190 $sql .=
" WHERE socid = ".((int) $socid);
191 $sql .=
" AND entity = ".$conf->entity;
192 $resql = $db->query($sql);
194 $obj = $db->fetch_object($resql);
195 if ($obj && $obj->rowid > 0) {
197 $othermember->fetch($obj->rowid);
198 $thirdparty =
new Societe($db);
199 $thirdparty->fetch($socid);
201 setEventMessages($langs->trans(
"ErrorMemberIsAlreadyLinkedToThisThirdParty", $othermember->getFullName($langs), $othermember->login, $thirdparty->name),
null,
'errors');
206 $result =
$object->setThirdPartyId($socid);
217 if ($action ==
'confirm_create_user' && $confirm ==
'yes' && $user->hasRight(
'user',
'user',
'creer')) {
220 $nuser =
new User($db);
222 if (
GETPOST(
'internalorexternal',
'aZ09') ==
'internal') {
223 $tmpuser->fk_soc = 0;
226 $result = $nuser->create_from_member($tmpuser,
GETPOST(
'login',
'alphanohtml'));
229 $langs->load(
"errors");
232 setEventMessages($langs->trans(
"NewUserCreated", $nuser->login),
null,
'mesgs');
241 if ($action ==
'confirm_create_thirdparty' && $confirm ==
'yes' && $user->hasRight(
'societe',
'creer')) {
245 $result = $company->create_from_member(
$object,
GETPOST(
'companyname',
'alpha'),
GETPOST(
'companyalias',
'alpha'));
248 $langs->load(
"errors");
257 if ($action ==
'update' && !$cancel && $user->hasRight(
'adherent',
'creer')) {
258 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
264 $lastname =
GETPOST(
"lastname",
'alphanohtml');
265 $firstname =
GETPOST(
"firstname",
'alphanohtml');
266 $gender =
GETPOST(
"gender",
'alphanohtml');
267 $societe =
GETPOST(
"societe",
'alphanohtml');
268 $morphy =
GETPOST(
"morphy",
'alphanohtml');
269 $login =
GETPOST(
"login",
'alphanohtml');
270 if ($morphy !=
'mor' && empty($lastname)) {
272 $langs->load(
"errors");
273 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Lastname")),
null,
'errors');
275 if ($morphy !=
'mor' && (!isset($firstname) || $firstname ==
'')) {
277 $langs->load(
"errors");
278 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Firstname")),
null,
'errors');
280 if ($morphy ==
'mor' && empty($societe)) {
282 $langs->load(
"errors");
283 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Company")),
null,
'errors');
289 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Login")),
null,
'errors');
293 if ($result > 0 && !$error) {
297 $object->civility_id = trim(
GETPOST(
"civility_id",
'alphanohtml'));
302 if (GETPOSTISSET(
'pass')) {
318 $object->email = preg_replace(
'/\s+/',
'',
GETPOST(
"member_email",
'alpha'));
319 $object->url = trim(
GETPOST(
'member_url',
'custom', 0, FILTER_SANITIZE_URL));
320 $object->socialnetworks = array();
321 foreach ($socialnetworks as $key => $value) {
322 if (GETPOSTISSET($key) &&
GETPOST($key,
'alphanohtml') !=
'') {
323 $object->socialnetworks[$key] = trim(
GETPOST($key,
'alphanohtml'));
332 if (
GETPOST(
'deletephoto',
'alpha')) {
334 } elseif (!empty($_FILES[
'photo'][
'name'])) {
344 $ret = $extrafields->setOptionalsFromPost(
null,
$object,
'@GETPOSTISSET');
352 if ($user->id !=
$object->user_id && !$user->hasRight(
'user',
'user',
'creer')) {
359 if (GETPOSTISSET(
'pass')) {
362 if ($user->id ==
$object->user_id) {
363 if (!$user->hasRight(
'user',
'self',
'password')) {
367 if (!$user->hasRight(
'user',
'user',
'password')) {
375 $result =
$object->update($user, 0, $nosyncuser, $nosyncuserpass);
377 if ($result >= 0 && !count(
$object->errors)) {
378 $categories =
GETPOST(
'memcats',
'array');
379 $object->setCategories($categories);
382 $dir = $conf->adherent->dir_output.
'/'.
get_exdir(0, 0, 0, 1,
$object,
'member').
'/photos';
383 $file_OK = is_uploaded_file($_FILES[
'photo'][
'tmp_name']);
386 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
388 $dirthumbs = $conf->adherent->dir_output.
'/'.
get_exdir(0, 0, 0, 1,
$object,
'member').
'/photos/thumbs';
398 if (!
dol_move_uploaded_file($_FILES[
'photo'][
'tmp_name'], $newfile, 1, 0, $_FILES[
'photo'][
'error']) > 0) {
409 switch ($_FILES[
'photo'][
'error']) {
412 $errors[] =
"ErrorFileSizeTooLarge";
415 $errors[] =
"ErrorFilePartiallyUploaded";
424 if (!empty($backtopage)) {
425 header(
"Location: ".$backtopage);
440 if ($action ==
'add' && $user->hasRight(
'adherent',
'creer')) {
445 if (GETPOSTISSET(
"birthday") &&
GETPOST(
"birthday") && GETPOSTISSET(
"birthmonth") &&
GETPOST(
"birthmonth") && GETPOSTISSET(
"birthyear") &&
GETPOST(
"birthyear")) {
448 $datesubscription =
'';
449 if (GETPOSTISSET(
"reday") && GETPOSTISSET(
"remonth") && GETPOSTISSET(
"reyear")) {
454 $civility_id =
GETPOST(
"civility_id",
'alphanohtml');
455 $lastname =
GETPOST(
"lastname",
'alphanohtml');
456 $firstname =
GETPOST(
"firstname",
'alphanohtml');
457 $gender =
GETPOST(
"gender",
'alphanohtml');
458 $societe =
GETPOST(
"societe",
'alphanohtml');
459 $address =
GETPOST(
"address",
'alphanohtml');
460 $zip =
GETPOST(
"zipcode",
'alphanohtml');
461 $town =
GETPOST(
"town",
'alphanohtml');
465 $phone =
GETPOST(
"phone",
'alpha');
466 $phone_perso =
GETPOST(
"phone_perso",
'alpha');
467 $phone_mobile =
GETPOST(
"phone_mobile",
'alpha');
468 $email = preg_replace(
'/\s+/',
'',
GETPOST(
"member_email",
'alpha'));
469 $url = trim(
GETPOST(
'url',
'custom', 0, FILTER_SANITIZE_URL));
470 $login =
GETPOST(
"member_login",
'alphanohtml');
471 $pass =
GETPOST(
"password",
'none');
472 $photo =
GETPOST(
"photo",
'alphanohtml');
473 $morphy =
GETPOST(
"morphy",
'alphanohtml');
474 $public =
GETPOST(
"public",
'alphanohtml');
478 $default_lang =
GETPOST(
'default_lang',
'alpha');
480 $object->civility_id = $civility_id;
481 $object->firstname = $firstname;
490 $object->country_id = $country_id;
492 $object->phone_perso = $phone_perso;
493 $object->phone_mobile = $phone_mobile;
494 $object->socialnetworks = array();
495 if (isModEnabled(
'socialnetworks')) {
496 foreach ($socialnetworks as $key => $value) {
497 if (GETPOSTISSET($key) &&
GETPOST($key,
'alphanohtml') !=
'') {
498 $object->socialnetworks[$key] =
GETPOST(
"member_".$key,
'alphanohtml');
515 $object->default_lang = $default_lang;
517 $ret = $extrafields->setOptionalsFromPost(
null,
$object);
523 if (empty($morphy) || $morphy ==
"-1") {
525 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"MemberNature")),
null,
'errors');
531 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Login")),
null,
'errors');
533 $sql =
"SELECT login FROM ".MAIN_DB_PREFIX.
"adherent WHERE login='".$db->escape($login).
"'";
534 $result = $db->query($sql);
536 $num = $db->num_rows($result);
540 $langs->load(
"errors");
541 setEventMessages($langs->trans(
"ErrorLoginAlreadyExists", $login),
null,
'errors');
546 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Password")),
null,
'errors');
549 if ($morphy ==
'mor' && empty($societe)) {
551 $langs->load(
"errors");
552 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Company")),
null,
'errors');
554 if ($morphy !=
'mor' && empty($lastname)) {
556 $langs->load(
"errors");
557 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Lastname")),
null,
'errors');
559 if ($morphy !=
'mor' && (!isset($firstname) || $firstname ==
'')) {
561 $langs->load(
"errors");
562 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Firstname")),
null,
'errors');
564 if (!($typeid > 0)) {
566 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Type")),
null,
'errors');
570 $langs->load(
"errors");
574 $langs->load(
"errors");
578 if (isset($public)) {
586 $result =
$object->create($user);
589 $memcats =
GETPOST(
'memcats',
'array');
590 $object->setCategories($memcats);
597 $backtopage = preg_replace(
'/__ID__/', (
string) $id, $backtopage);
610 $result = $company->create_from_member(
$object);
612 $langs->load(
"errors");
621 $action = ($result < 0 || !$error) ?
'' :
'create';
623 if (!$error && $backtopage) {
624 header(
"Location: ".$backtopage);
629 if ($user->hasRight(
'adherent',
'supprimer') && $action ==
'confirm_delete' && $confirm ==
'yes') {
630 $result =
$object->delete($user);
633 if (!empty($backtopage) && !preg_match(
'/'.preg_quote($_SERVER[
"PHP_SELF"],
'/').
'/', $backtopage)) {
634 header(
"Location: ".$backtopage);
637 header(
"Location: list.php");
645 if ($user->hasRight(
'adherent',
'creer') && $action ==
'confirm_valid' && $confirm ==
'yes') {
653 $result =
$object->validate($user);
655 if ($result >= 0 && !count(
$object->errors)) {
662 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
666 $outputlangs->setDefaultLang(empty(
$object->thirdparty->default_lang) ? $mysoc->default_lang :
$object->thirdparty->default_lang);
668 $outputlangs->loadLangs(array(
"main",
"members",
"companies",
"install",
"other"));
670 $arraydefaultmessage =
null;
673 if (!empty($labeltouse)) {
674 $arraydefaultmessage = $formmail->getEMailTemplate($db,
'member', $user, $outputlangs, 0, 1, $labeltouse);
677 if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
678 $subject = $arraydefaultmessage->topic;
679 $msg = $arraydefaultmessage->content;
682 if (empty($labeltouse) || (
int) $labeltouse === -1) {
684 $langs->load(
"errors");
685 setEventMessages(
'<a href="'.DOL_URL_ROOT.
'/adherents/admin/member_emails.php">'.$langs->trans(
'WarningMandatorySetupNotComplete').
'</a>',
null,
'errors');
693 $moreinheader =
'X-Dolibarr-Info: send_an_email by adherents/card.php'.
"\r\n";
695 $result =
$object->sendEmail($texttosend, $subjecttosend, array(), array(), array(),
"",
"", 0, -1,
'', $moreinheader);
715 if ($user->hasRight(
'adherent',
'supprimer') && $action ==
'confirm_resiliate') {
718 if ($confirm ==
'yes') {
722 $result =
$object->resiliate($user);
724 if ($result >= 0 && !count(
$object->errors)) {
730 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
734 $outputlangs->setDefaultLang(empty(
$object->thirdparty->default_lang) ? $mysoc->default_lang :
$object->thirdparty->default_lang);
736 $outputlangs->loadLangs(array(
"main",
"members",
"companies",
"install",
"other"));
738 $arraydefaultmessage =
null;
741 if (!empty($labeltouse)) {
742 $arraydefaultmessage = $formmail->getEMailTemplate($db,
'member', $user, $outputlangs, 0, 1, $labeltouse);
745 if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
746 $subject = $arraydefaultmessage->topic;
747 $msg = $arraydefaultmessage->content;
750 if (empty($labeltouse) || (
int) $labeltouse === -1) {
760 $moreinheader =
'X-Dolibarr-Info: send_an_email by adherents/card.php'.
"\r\n";
762 $result =
$object->sendEmail($texttosend, $subjecttosend, array(), array(), array(),
"",
"", 0, -1,
'', $moreinheader);
776 if (!empty($backtopage) && !$error) {
777 header(
"Location: ".$backtopage);
782 if ($user->hasRight(
'adherent',
'supprimer') && $action ==
'confirm_exclude') {
785 if ($confirm ==
'yes') {
789 $result =
$object->exclude($user);
791 if ($result >= 0 && !count(
$object->errors)) {
797 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
801 $outputlangs->setDefaultLang(empty(
$object->thirdparty->default_lang) ? $mysoc->default_lang :
$object->thirdparty->default_lang);
803 $outputlangs->loadLangs(array(
"main",
"members",
"companies",
"install",
"other"));
805 $arraydefaultmessage =
null;
808 if (!empty($labeltouse)) {
809 $arraydefaultmessage = $formmail->getEMailTemplate($db,
'member', $user, $outputlangs, 0, 1, $labeltouse);
812 if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
813 $subject = $arraydefaultmessage->topic;
814 $msg = $arraydefaultmessage->content;
817 if (empty($labeltouse) || (
int) $labeltouse === -1) {
827 $moreinheader =
'X-Dolibarr-Info: send_an_email by adherents/card.php'.
"\r\n";
829 $result =
$object->sendEmail($texttosend, $subjecttosend, array(), array(), array(),
"",
"", 0, -1,
'', $moreinheader);
843 if (!empty($backtopage) && !$error) {
844 header(
"Location: ".$backtopage);
849 if ($action ==
'update_extras' && $user->hasRight(
'adherent',
'creer')) {
851 $attribute_name =
GETPOST(
'attribute',
'restricthtml');
854 $ret = $extrafields->setOptionalsFromPost(
null,
$object, $attribute_name);
859 $result =
$object->updateExtraField($attribute_name,
'MEMBER_MODIFY');
866 $action =
'edit_extras';
871 if ($user->hasRight(
'adherent',
'supprimer') && $action ==
'confirm_del_spip' && $confirm ==
'yes') {
873 if (!$mailmanspip->del_to_spip(
$object)) {
874 setEventMessages($langs->trans(
'DeleteIntoSpipError').
': '.$mailmanspip->error,
null,
'errors');
879 if ($user->hasRight(
'adherent',
'creer') && $action ==
'confirm_add_spip' && $confirm ==
'yes') {
881 if (!$mailmanspip->add_to_spip(
$object)) {
882 setEventMessages($langs->trans(
'AddIntoSpipError').
': '.$mailmanspip->error,
null,
'errors');
888 include DOL_DOCUMENT_ROOT.
'/core/actions_printing.inc.php';
891 $upload_dir = $conf->adherent->dir_output;
892 $permissiontoadd = $user->hasRight(
'adherent',
'creer');
893 include DOL_DOCUMENT_ROOT.
'/core/actions_builddoc.inc.php';
896 $triggersendname =
'MEMBER_SENTBYMAIL';
898 $mode =
'emailfrommember';
899 $trackid =
'mem'.$object->id;
900 include DOL_DOCUMENT_ROOT.
'/core/actions_sendmails.inc.php';
908$form =
new Form($db);
913$title = $langs->trans(
"Member").
" - ".$langs->trans(
"Card");
914$help_url =
'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder';
917$countrynotdefined = $langs->trans(
"ErrorSetACountryFirst").
' ('.$langs->trans(
"SeeAbove").
')';
919if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
923 if (empty(
$object->error) && $id) {
931 $objcanvas->display_canvas($action);
938 if ($action ==
'create') {
946 $object->country_code = $tmparray[
'code'];
947 $object->country = $tmparray[
'label'];
951 if (!empty($socid)) {
956 if (!($soc->id > 0)) {
957 $langs->load(
"errors");
958 print($langs->trans(
'ErrorRecordNotFound'));
967 if ($conf->use_javascript_ajax) {
968 print
"\n".
'<script type="text/javascript">'.
"\n";
969 print
'jQuery(document).ready(function () {
970 jQuery("#selectcountry_id").change(function() {
971 document.formsoc.action.value="create";
972 document.formsoc.submit();
974 function initfieldrequired() {
975 jQuery("#tdcompany").removeClass("fieldrequired");
976 jQuery("#tdlastname").removeClass("fieldrequired");
977 jQuery("#tdfirstname").removeClass("fieldrequired");
978 if (jQuery("#morphy").val() == \'mor\') {
979 jQuery("#tdcompany").addClass("fieldrequired");
981 if (jQuery("#morphy").val() == \'phy\') {
982 jQuery("#tdlastname").addClass("fieldrequired");
983 jQuery("#tdfirstname").addClass("fieldrequired");
986 jQuery("#morphy").change(function() {
991 print
'</script>'.
"\n";
994 print
'<form name="formsoc" action="'.$_SERVER[
"PHP_SELF"].
'" method="post" enctype="multipart/form-data">';
995 print
'<input type="hidden" name="token" value="'.newToken().
'">';
996 print
'<input type="hidden" name="action" value="add">';
997 print
'<input type="hidden" name="socid" value="'.$socid.
'">';
999 print
'<input type="hidden" name="backtopage" value="'.($backtopage !=
'1' ? $backtopage : $_SERVER[
"HTTP_REFERER"]).
'">';
1004 print
'<table class="border centpercent">';
1009 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>';
1014 require_once DOL_DOCUMENT_ROOT.
'/core/lib/security2.lib.php';
1016 print
'<tr><td><span class="fieldrequired">'.$langs->trans(
"Password").
'</span></td><td>';
1017 print
'<input type="text" class="minwidth300" maxlength="50" name="password" value="'.dol_escape_htmltag($generated_password).
'">';
1022 print
'<tr><td class="fieldrequired">'.$langs->trans(
"MemberType").
'</td><td>';
1023 $listetype = $adht->liste_array(1);
1024 print
img_picto(
'', $adht->picto,
'class="pictofixedwidth"');
1025 if (count($listetype)) {
1026 print $form->selectarray(
"typeid", $listetype, (
GETPOSTINT(
'typeid') ?
GETPOSTINT(
'typeid') : $typeid), (count($listetype) > 1 ? 1 : 0), 0, 0,
'', 0, 0, 0,
'',
'minwidth200', 1);
1028 print
'<span class="error">'.$langs->trans(
"NoTypeDefinedGoToSetup").
'</span>';
1030 if ($user->hasRight(
'member',
'configurer')) {
1031 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>';
1037 $morphys[
"phy"] = $langs->trans(
"Physical");
1038 $morphys[
"mor"] = $langs->trans(
"Moral");
1039 print
'<tr><td class="fieldrequired">'.$langs->trans(
"MemberNature").
"</td><td>\n";
1040 print $form->selectarray(
"morphy", $morphys, (
GETPOST(
'morphy',
'alpha') ?
GETPOST(
'morphy',
'alpha') :
$object->morphy), 1, 0, 0,
'', 0, 0, 0,
'',
'minwidth200', 1);
1044 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>';
1047 print
'<tr><td>'.$langs->trans(
"UserTitle").
'</td><td>';
1048 print $formcompany->select_civility(
GETPOSTINT(
'civility_id') ?
GETPOSTINT(
'civility_id') :
$object->civility_id,
'civility_id',
'maxwidth150', 1).
'</td>';
1052 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>';
1056 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>';
1060 print
'<tr><td>'.$langs->trans(
"Gender").
'</td>';
1062 $arraygender = array(
'man' => $langs->trans(
"Genderman"),
'woman' => $langs->trans(
"Genderwoman"),
'other' => $langs->trans(
"Genderother"));
1063 print $form->selectarray(
'gender', $arraygender,
GETPOST(
'gender',
'alphanohtml'), 1, 0, 0,
'', 0, 0, 0,
'',
'minwidth100', 1);
1067 print
'<tr><td>'.(getDolGlobalString(
'ADHERENT_MAIL_REQUIRED') ?
'<span class="fieldrequired">' :
'').$langs->trans(
"EMail").(getDolGlobalString(
'ADHERENT_MAIL_REQUIRED') ?
'</span>' :
'').
'</td>';
1068 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>';
1071 print
'<tr><td>'.$form->editfieldkey(
'Web',
'member_url',
GETPOST(
'member_url',
'alpha'),
$object, 0).
'</td>';
1072 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>';
1075 print
'<tr><td class="tdtop">'.$langs->trans(
"Address").
'</td><td>';
1076 print
'<textarea name="address" wrap="soft" class="quatrevingtpercent" rows="2">'.(GETPOSTISSET(
'address') ?
GETPOST(
'address',
'alphanohtml') : $soc->address).
'</textarea>';
1080 print
'<tr><td>'.$langs->trans(
"Zip").
' / '.$langs->trans(
"Town").
'</td><td>';
1081 print $formcompany->select_ziptown((GETPOSTISSET(
'zipcode') ?
GETPOST(
'zipcode',
'alphanohtml') : $soc->zip),
'zipcode', array(
'town',
'selectcountry_id',
'state_id'), 6);
1083 print $formcompany->select_ziptown((GETPOSTISSET(
'town') ?
GETPOST(
'town',
'alphanohtml') : $soc->town),
'town', array(
'zipcode',
'selectcountry_id',
'state_id'));
1087 if (empty($soc->country_id)) {
1088 $soc->country_id = $mysoc->country_id;
1089 $soc->country_code = $mysoc->country_code;
1090 $soc->state_id = $mysoc->state_id;
1092 print
'<tr><td>'.$langs->trans(
'Country').
'</td><td>';
1093 print
img_picto(
'',
'country',
'class="pictofixedwidth"');
1094 print $form->select_country(GETPOSTISSET(
'country_id') ?
GETPOST(
'country_id',
'alpha') : $soc->country_id,
'country_id');
1096 print
info_admin($langs->trans(
"YouCanChangeValuesForThisListFromDictionarySetup"), 1);
1102 print
'<tr><td>'.$langs->trans(
'State').
'</td><td>';
1103 if ($soc->country_id || GETPOSTISSET(
'country_id')) {
1104 print
img_picto(
'',
'state',
'class="pictofixedwidth"');
1105 print $formcompany->select_state(GETPOSTISSET(
'state_id') ?
GETPOSTINT(
'state_id') : $soc->state_id, GETPOSTISSET(
'country_id') ?
GETPOSTINT(
'country_id') : $soc->country_code);
1107 print $countrynotdefined;
1113 print
'<tr><td>'.$langs->trans(
"PhonePro").
'</td>';
1114 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>';
1117 print
'<tr><td>'.$langs->trans(
"PhonePerso").
'</td>';
1118 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>';
1121 print
'<tr><td>'.$langs->trans(
"PhoneMobile").
'</td>';
1122 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>';
1124 if (isModEnabled(
'socialnetworks')) {
1125 foreach ($socialnetworks as $key => $value) {
1126 if (!$value[
'active']) {
1129 $val = (GETPOSTISSET(
'member_'.$key) ?
GETPOST(
'member_'.$key,
'alpha') : (empty(
$object->socialnetworks[$key]) ?
'' :
$object->socialnetworks[$key]));
1130 print
'<tr><td>'.$langs->trans($value[
'label']).
'</td><td><input type="text" name="member_'.$key.
'" size="40" value="'.$val.
'"></td></tr>';
1135 print
"<tr><td>".$langs->trans(
"DateOfBirth").
"</td><td>\n";
1136 print
img_picto(
'',
'object_calendar',
'class="pictofixedwidth"').$form->selectDate((
$object->birth ?
$object->birth : -1),
'birth', 0, 0, 1,
'formsoc');
1137 print
"</td></tr>\n";
1141 $htmltext = $langs->trans(
"Public",
getDolGlobalString(
'MAIN_INFO_SOCIETE_NOM'), $linkofpubliclist);
1142 print $form->textwithpicto($langs->trans(
"MembershipPublic"), $htmltext, 1,
'help',
'', 0, 3,
'membershippublic');
1143 print
"</td><td>\n";
1144 print $form->selectyesno(
"public",
$object->public, 1,
false, 0, 1);
1145 print
"</td></tr>\n";
1148 if (isModEnabled(
'category') && $user->hasRight(
'categorie',
'lire')) {
1149 print
'<tr><td>'.$form->editfieldkey(
"Categories",
'memcats',
'',
$object, 0).
'</td><td>';
1150 $cate_arbo = $form->select_all_categories(Categorie::TYPE_MEMBER,
'',
'parent', 64, 0, 3);
1151 print
img_picto(
'',
'category').$form->multiselectarray(
'memcats', $cate_arbo,
GETPOST(
'memcats',
'array'), 0, 0,
'quatrevingtpercent widthcentpercentminusx', 0, 0);
1156 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_add.tpl.php';
1163 print $form->buttonsSaveCancel(
"AddMember");
1169 if ($action ==
'edit') {
1175 $res =
$object->fetch_optionals();
1182 $adht->fetch(
$object->typeid);
1186 if (!empty($country) ||
$object->country_id) {
1187 $sql =
"SELECT rowid, code, label from ".MAIN_DB_PREFIX.
"c_country";
1188 $sql .=
" WHERE rowid = ".(int) (!empty($country) ? $country :
$object->country_id);
1189 $resql = $db->query($sql);
1191 $obj = $db->fetch_object($resql);
1195 $object->country_id = $obj->rowid;
1196 $object->country_code = $obj->code;
1197 $object->country = $langs->trans(
"Country".$obj->code) ? $langs->trans(
"Country".$obj->code) : $obj->label;
1203 if ($conf->use_javascript_ajax) {
1204 print
"\n".
'<script type="text/javascript">';
1205 print
'jQuery(document).ready(function () {
1206 jQuery("#selectcountry_id").change(function() {
1207 document.formsoc.action.value="edit";
1208 document.formsoc.submit();
1210 function initfieldrequired() {
1211 jQuery("#tdcompany").removeClass("fieldrequired");
1212 jQuery("#tdlastname").removeClass("fieldrequired");
1213 jQuery("#tdfirstname").removeClass("fieldrequired");
1214 if (jQuery("#morphy").val() == \'mor\') {
1215 jQuery("#tdcompany").addClass("fieldrequired");
1217 if (jQuery("#morphy").val() == \'phy\') {
1218 jQuery("#tdlastname").addClass("fieldrequired");
1219 jQuery("#tdfirstname").addClass("fieldrequired");
1222 jQuery("#morphy").change(function() {
1223 initfieldrequired();
1225 initfieldrequired();
1227 print
'</script>'.
"\n";
1230 print
'<form name="formsoc" action="'.$_SERVER[
"PHP_SELF"].
'" method="post" enctype="multipart/form-data">';
1231 print
'<input type="hidden" name="token" value="'.newToken().
'" />';
1232 print
'<input type="hidden" name="action" value="update" />';
1233 print
'<input type="hidden" name="rowid" value="'.$id.
'" />';
1234 print
'<input type="hidden" name="statut" value="'.$object->status.
'" />';
1236 print
'<input type="hidden" name="backtopage" value="'.($backtopage !=
'1' ? $backtopage : $_SERVER[
"HTTP_REFERER"]).
'">';
1241 print
'<table class="border centpercent">';
1244 print
'<tr><td class="titlefieldcreate">'.$langs->trans(
"Ref").
'</td><td class="valeur">'.
$object->ref.
'</td></tr>';
1248 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>';
1253 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Password").
'</td><td><input type="password" name="pass" class="minwidth300" maxlength="50" value="'.
dol_escape_htmltag(GETPOSTISSET(
"pass") ?
GETPOST(
"pass",
'none', 2) :
'').
'"></td></tr>';
1257 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Type").
'</td><td>';
1258 if ($user->hasRight(
'adherent',
'creer')) {
1259 print $form->selectarray(
"typeid", $adht->liste_array(), (GETPOSTISSET(
"typeid") ?
GETPOSTINT(
"typeid") :
$object->typeid), 0, 0, 0,
'', 0, 0, 0,
'',
'minwidth200', 1);
1261 print $adht->getNomUrl(1);
1262 print
'<input type="hidden" name="typeid" value="'.$object->typeid.
'">';
1267 $morphys[
"phy"] = $langs->trans(
"Physical");
1268 $morphys[
"mor"] = $langs->trans(
"Moral");
1269 print
'<tr><td><span class="fieldrequired">'.$langs->trans(
"MemberNature").
'</span></td><td>';
1270 print $form->selectarray(
"morphy", $morphys, (GETPOSTISSET(
"morphy") ?
GETPOST(
"morphy",
'alpha') :
$object->morphy), 0, 0, 0,
'', 0, 0, 0,
'',
'minwidth200', 1);
1274 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>';
1277 print
'<tr><td>'.$langs->trans(
"UserTitle").
'</td><td>';
1278 print $formcompany->select_civility(GETPOSTISSET(
"civility_id") ?
GETPOST(
"civility_id",
'alpha') :
$object->civility_id,
'civility_id',
'maxwidth150', 1);
1283 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>';
1287 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>';
1291 print
'<tr><td>'.$langs->trans(
"Gender").
'</td>';
1293 $arraygender = array(
'man' => $langs->trans(
"Genderman"),
'woman' => $langs->trans(
"Genderwoman"),
'other' => $langs->trans(
"Genderother"));
1294 print $form->selectarray(
'gender', $arraygender, GETPOSTISSET(
'gender') ?
GETPOST(
'gender',
'alphanohtml') :
$object->gender, 1, 0, 0,
'', 0, 0, 0,
'',
'minwidth100', 1);
1298 print
'<tr><td>'.$langs->trans(
"Photo").
'</td>';
1299 print
'<td class="hideonsmartphone" valign="middle">';
1300 print $form->showphoto(
'memberphoto',
$object).
"\n";
1301 if ($caneditfieldmember) {
1305 print
'<table class="nobordernopadding">';
1307 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>';
1311 $maxmin = $maxfilesizearray[
'maxmin'];
1313 print
'<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).
'">';
1315 print
'<input type="file" class="flat" name="photo" id="photoinput">';
1322 print
'<tr><td>'.(getDolGlobalString(
"ADHERENT_MAIL_REQUIRED") ?
'<span class="fieldrequired">' :
'').$langs->trans(
"EMail").(getDolGlobalString(
"ADHERENT_MAIL_REQUIRED") ?
'</span>' :
'').
'</td>';
1323 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>';
1326 print
'<tr><td>'.$form->editfieldkey(
'Web',
'member_url',
GETPOST(
'member_url',
'alpha'),
$object, 0).
'</td>';
1327 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>';
1330 print
'<tr><td>'.$langs->trans(
"Address").
'</td><td>';
1331 print
'<textarea name="address" wrap="soft" class="quatrevingtpercent" rows="'.ROWS_2.
'">'.(GETPOSTISSET(
"address") ?
GETPOST(
"address",
'alphanohtml', 2) :
$object->address).
'</textarea>';
1335 print
'<tr><td>'.$langs->trans(
"Zip").
' / '.$langs->trans(
"Town").
'</td><td>';
1336 print $formcompany->select_ziptown((GETPOSTISSET(
"zipcode") ?
GETPOST(
"zipcode",
'alphanohtml', 2) :
$object->zip),
'zipcode', array(
'town',
'selectcountry_id',
'state_id'), 6);
1338 print $formcompany->select_ziptown((GETPOSTISSET(
"town") ?
GETPOST(
"town",
'alphanohtml', 2) :
$object->town),
'town', array(
'zipcode',
'selectcountry_id',
'state_id'));
1343 print
'<tr><td>'.$langs->trans(
'Country').
'</td><td>';
1344 print
img_picto(
'',
'country',
'class="pictofixedwidth"');
1345 print $form->select_country(GETPOSTISSET(
"country_id") ?
GETPOST(
"country_id",
"alpha") :
$object->country_id,
'country_id');
1347 print
info_admin($langs->trans(
"YouCanChangeValuesForThisListFromDictionarySetup"), 1);
1353 print
'<tr><td>'.$langs->trans(
'State').
'</td><td>';
1354 print
img_picto(
'',
'state',
'class="pictofixedwidth"');
1355 print $formcompany->select_state(
$object->state_id, GETPOSTISSET(
"country_id") ?
GETPOST(
"country_id",
"alpha") :
$object->country_id);
1360 print
'<tr><td>'.$langs->trans(
"PhonePro").
'</td>';
1361 print
'<td>'.img_picto(
'',
'object_phoning',
'class="pictofixedwidth"').
'<input type="text" name="phone" value="'.(GETPOSTISSET(
"phone") ?
GETPOST(
"phone") :
$object->phone).
'"></td></tr>';
1364 print
'<tr><td>'.$langs->trans(
"PhonePerso").
'</td>';
1365 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>';
1368 print
'<tr><td>'.$langs->trans(
"PhoneMobile").
'</td>';
1369 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>';
1371 if (isModEnabled(
'socialnetworks')) {
1372 foreach ($socialnetworks as $key => $value) {
1373 if (!$value[
'active']) {
1376 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>';
1381 print
"<tr><td>".$langs->trans(
"DateOfBirth").
"</td><td>\n";
1382 print
img_picto(
'',
'object_calendar',
'class="pictofixedwidth"').$form->selectDate((
$object->birth ?
$object->birth : -1),
'birth', 0, 0, 1,
'formsoc');
1383 print
"</td></tr>\n";
1387 print
'<tr><td>'.$form->editfieldkey(
'DefaultLang',
'default_lang',
'',
$object, 0).
'</td><td colspan="3">'.
"\n";
1388 print
img_picto(
'',
'language',
'class="pictofixedwidth"').$formadmin->select_language(
$object->default_lang,
'default_lang', 0, 0, 1);
1395 $htmltext = $langs->trans(
"Public",
getDolGlobalString(
'MAIN_INFO_SOCIETE_NOM'), $linkofpubliclist);
1396 print $form->textwithpicto($langs->trans(
"MembershipPublic"), $htmltext, 1,
'help',
'', 0, 3,
'membershippublic');
1397 print
"</td><td>\n";
1398 print $form->selectyesno(
"public", (GETPOSTISSET(
"public") ?
GETPOST(
"public",
'alphanohtml', 2) :
$object->public), 1, false, 0, 1);
1399 print
"</td></tr>\n";
1402 if (isModEnabled(
'category') && $user->hasRight(
'categorie',
'lire')) {
1403 print
'<tr><td>'.$form->editfieldkey(
"Categories",
'memcats',
'',
$object, 0).
'</td>';
1405 $cate_arbo = $form->select_all_categories(Categorie::TYPE_MEMBER,
'',
'', 64, 0, 3);
1407 $cats = $c->containing(
$object->id, Categorie::TYPE_MEMBER);
1408 $arrayselected = array();
1409 if (is_array($cats)) {
1410 foreach ($cats as $cat) {
1411 $arrayselected[] = $cat->id;
1414 print
img_picto(
'',
'category',
'class="pictofixedwidth"');
1415 print $form->multiselectarray(
'memcats', $cate_arbo, $arrayselected, 0, 0,
'widthcentpercentminusx', 0,
'100%');
1420 if (isModEnabled(
'societe')) {
1421 print
'<tr><td>'.$langs->trans(
"LinkedToDolibarrThirdParty").
'</td><td colspan="2" class="valeur">';
1424 $result = $company->fetch(
$object->socid);
1425 print $company->getNomUrl(1);
1427 print $langs->trans(
"NoThirdPartyAssociatedToMember");
1433 print
'<tr><td>'.$langs->trans(
"LinkedToDolibarrUser").
'</td><td colspan="2" class="valeur">';
1435 $form->form_users($_SERVER[
'PHP_SELF'].
'?rowid='.
$object->id,
$object->user_id,
'none');
1437 print $langs->trans(
"NoDolibarrAccess");
1442 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_edit.tpl.php';
1447 print $form->buttonsSaveCancel(
"Save",
'Cancel');
1453 if ($id > 0 && $action !=
'edit') {
1459 $res =
$object->fetch_optionals();
1466 $res = $adht->fetch(
$object->typeid);
1481 if ($action ==
'create_user') {
1482 $login = (GETPOSTISSET(
'login') ?
GETPOST(
'login',
'alphanohtml') :
$object->login);
1483 if (empty($login)) {
1485 include_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
1488 if (empty($login)) {
1489 $login = strtolower(substr(
$object->firstname, 0, 4)).strtolower(substr(
$object->lastname, 0, 4));
1493 $formquestion = array(
1494 array(
'label' => $langs->trans(
"LoginToCreate"),
'type' =>
'text',
'name' =>
'login',
'value' => $login)
1496 if (isModEnabled(
'societe') &&
$object->socid > 0) {
1498 $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")));
1501 if (isModEnabled(
'societe') &&
$object->socid <= 0) {
1502 $text .= $langs->trans(
"UserWillBeInternalUser").
'<br>';
1504 $text .= $langs->trans(
"ConfirmCreateLogin");
1505 print $form->formconfirm($_SERVER[
"PHP_SELF"].
"?rowid=".
$object->id, $langs->trans(
"CreateDolibarrLogin"), $text,
"confirm_create_user", $formquestion,
'yes');
1509 if ($action ==
'create_thirdparty') {
1511 $fullname =
$object->getFullName($langs);
1513 if (
$object->morphy ==
'mor') {
1514 $companyname =
$object->company;
1515 if (!empty($fullname)) {
1516 $companyalias = $fullname;
1519 $companyname = $fullname;
1520 if (!empty(
$object->company)) {
1521 $companyalias =
$object->company;
1526 $formquestion = array(
1527 array(
'label' => $langs->trans(
"NameToCreate"),
'type' =>
'text',
'name' =>
'companyname',
'value' => $companyname,
'morecss' =>
'minwidth300',
'moreattr' =>
'maxlength="128"'),
1528 array(
'label' => $langs->trans(
"AliasNames"),
'type' =>
'text',
'name' =>
'companyalias',
'value' => $companyalias,
'morecss' =>
'minwidth300',
'moreattr' =>
'maxlength="128"')
1531 print $form->formconfirm($_SERVER[
"PHP_SELF"].
"?rowid=".
$object->id, $langs->trans(
"CreateDolibarrThirdParty"), $langs->trans(
"ConfirmCreateThirdParty"),
"confirm_create_thirdparty", $formquestion,
'yes');
1535 if ($action ==
'valid') {
1536 $langs->load(
"mails");
1539 $adht->fetch(
$object->typeid);
1545 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
1548 $outputlangs =
new Translate(
'', $conf);
1549 $outputlangs->setDefaultLang(empty(
$object->thirdparty->default_lang) ? $mysoc->default_lang :
$object->thirdparty->default_lang);
1551 $outputlangs->loadLangs(array(
"main",
"members",
"companies",
"install",
"other"));
1553 $arraydefaultmessage =
null;
1556 if (!empty($labeltouse)) {
1557 $arraydefaultmessage = $formmail->getEMailTemplate($db,
'member', $user, $outputlangs, 0, 1, $labeltouse);
1560 if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
1561 $subject = $arraydefaultmessage->topic;
1562 $msg = $arraydefaultmessage->content;
1570 $tmp = $langs->trans(
"SendingAnEMailToMember");
1571 $tmp .=
'<br>'.$langs->trans(
"MailFrom").
': <b>'.
getDolGlobalString(
'ADHERENT_MAIL_FROM').
'</b>, ';
1572 $tmp .=
'<br>'.$langs->trans(
"MailRecipient").
': <b>'.
$object->email.
'</b>';
1574 $helpcontent .=
'<b>'.$langs->trans(
"MailFrom").
'</b>: '.
getDolGlobalString(
'ADHERENT_MAIL_FROM').
'<br>'.
"\n";
1575 $helpcontent .=
'<b>'.$langs->trans(
"MailRecipient").
'</b>: '.
$object->email.
'<br>'.
"\n";
1576 $helpcontent .=
'<b>'.$langs->trans(
"Subject").
'</b>:<br>'.
"\n";
1577 $helpcontent .= $subjecttosend.
"\n";
1578 $helpcontent .=
"<br>";
1579 $helpcontent .=
'<b>'.$langs->trans(
"Content").
'</b>:<br>';
1582 $label = $form->textwithpicto($tmp, $helpcontent, 1,
'help');
1585 $formquestion = array();
1587 $formquestion[] = array(
'type' =>
'checkbox',
'name' =>
'send_mail',
'label' => $label,
'value' => (
getDolGlobalString(
'ADHERENT_DEFAULT_SENDINFOBYMAIL') ?
true : false));
1590 $formquestion[] = array(
'type' =>
'other',
'label' => $langs->transnoentitiesnoconv(
"SynchroMailManEnabled"),
'value' =>
'');
1593 $formquestion[] = array(
'type' =>
'other',
'label' => $langs->transnoentitiesnoconv(
"SynchroSpipEnabled"),
'value' =>
'');
1595 print $form->formconfirm(
"card.php?rowid=".$id, $langs->trans(
"ValidateMember"), $langs->trans(
"ConfirmValidateMember"),
"confirm_valid", $formquestion,
'yes', 1, 220);
1599 if ($action ==
'resiliate') {
1600 $langs->load(
"mails");
1603 $adht->fetch(
$object->typeid);
1609 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
1612 $outputlangs =
new Translate(
'', $conf);
1613 $outputlangs->setDefaultLang(empty(
$object->thirdparty->default_lang) ? $mysoc->default_lang :
$object->thirdparty->default_lang);
1615 $outputlangs->loadLangs(array(
"main",
"members"));
1617 $arraydefaultmessage =
null;
1620 if (!empty($labeltouse)) {
1621 $arraydefaultmessage = $formmail->getEMailTemplate($db,
'member', $user, $outputlangs, 0, 1, $labeltouse);
1624 if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
1625 $subject = $arraydefaultmessage->topic;
1626 $msg = $arraydefaultmessage->content;
1634 $tmp = $langs->trans(
"SendingAnEMailToMember");
1635 $tmp .=
'<br>('.$langs->trans(
"MailFrom").
': <b>'.
getDolGlobalString(
'ADHERENT_MAIL_FROM').
'</b>, ';
1636 $tmp .= $langs->trans(
"MailRecipient").
': <b>'.
$object->email.
'</b>)';
1638 $helpcontent .=
'<b>'.$langs->trans(
"MailFrom").
'</b>: '.
getDolGlobalString(
'ADHERENT_MAIL_FROM').
'<br>'.
"\n";
1639 $helpcontent .=
'<b>'.$langs->trans(
"MailRecipient").
'</b>: '.
$object->email.
'<br>'.
"\n";
1640 $helpcontent .=
'<b>'.$langs->trans(
"Subject").
'</b>:<br>'.
"\n";
1641 $helpcontent .= $subjecttosend.
"\n";
1642 $helpcontent .=
"<br>";
1643 $helpcontent .=
'<b>'.$langs->trans(
"Content").
'</b>:<br>';
1646 $label = $form->textwithpicto($tmp, $helpcontent, 1,
'help');
1649 $formquestion = array();
1651 $formquestion[] = array(
'type' =>
'checkbox',
'name' =>
'send_mail',
'label' => $label,
'value' => (
getDolGlobalString(
'ADHERENT_DEFAULT_SENDINFOBYMAIL') ?
'true' :
'false'));
1654 $formquestion[] = array(
'type' =>
'hidden',
'name' =>
'backtopage',
'value' => ($backtopage !=
'1' ? $backtopage : $_SERVER[
"HTTP_REFERER"]));
1656 print $form->formconfirm(
"card.php?rowid=".$id, $langs->trans(
"ResiliateMember"), $langs->trans(
"ConfirmResiliateMember"),
"confirm_resiliate", $formquestion,
'no', 1, 240);
1660 if ($action ==
'exclude') {
1661 $langs->load(
"mails");
1664 $adht->fetch(
$object->typeid);
1670 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
1673 $outputlangs =
new Translate(
'', $conf);
1674 $outputlangs->setDefaultLang(empty(
$object->thirdparty->default_lang) ? $mysoc->default_lang :
$object->thirdparty->default_lang);
1676 $outputlangs->loadLangs(array(
"main",
"members"));
1678 $arraydefaultmessage =
null;
1681 if (!empty($labeltouse)) {
1682 $arraydefaultmessage = $formmail->getEMailTemplate($db,
'member', $user, $outputlangs, 0, 1, $labeltouse);
1685 if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
1686 $subject = $arraydefaultmessage->topic;
1687 $msg = $arraydefaultmessage->content;
1695 $tmp = $langs->trans(
"SendingAnEMailToMember");
1696 $tmp .=
'<br>('.$langs->trans(
"MailFrom").
': <b>'.
getDolGlobalString(
'ADHERENT_MAIL_FROM').
'</b>, ';
1697 $tmp .= $langs->trans(
"MailRecipient").
': <b>'.
$object->email.
'</b>)';
1699 $helpcontent .=
'<b>'.$langs->trans(
"MailFrom").
'</b>: '.
getDolGlobalString(
'ADHERENT_MAIL_FROM').
'<br>'.
"\n";
1700 $helpcontent .=
'<b>'.$langs->trans(
"MailRecipient").
'</b>: '.
$object->email.
'<br>'.
"\n";
1701 $helpcontent .=
'<b>'.$langs->trans(
"Subject").
'</b>:<br>'.
"\n";
1702 $helpcontent .= $subjecttosend.
"\n";
1703 $helpcontent .=
"<br>";
1704 $helpcontent .=
'<b>'.$langs->trans(
"Content").
'</b>:<br>';
1707 $label = $form->textwithpicto($tmp, $helpcontent, 1,
'help');
1710 $formquestion = array();
1712 $formquestion[] = array(
'type' =>
'checkbox',
'name' =>
'send_mail',
'label' => $label,
'value' => (
getDolGlobalString(
'ADHERENT_DEFAULT_SENDINFOBYMAIL') ?
'true' :
'false'));
1715 $formquestion[] = array(
'type' =>
'hidden',
'name' =>
'backtopage',
'value' => ($backtopage !=
'1' ? $backtopage : $_SERVER[
"HTTP_REFERER"]));
1717 print $form->formconfirm(
"card.php?rowid=".$id, $langs->trans(
"ExcludeMember"), $langs->trans(
"ConfirmExcludeMember"),
"confirm_exclude", $formquestion,
'no', 1, 240);
1721 if ($action ==
'delete') {
1722 $formquestion = array();
1724 $formquestion[] = array(
'type' =>
'hidden',
'name' =>
'backtopage',
'value' => ($backtopage !=
'1' ? $backtopage : $_SERVER[
"HTTP_REFERER"]));
1726 print $form->formconfirm(
"card.php?rowid=".$id, $langs->trans(
"DeleteMember"), $langs->trans(
"ConfirmDeleteMember"),
"confirm_delete", $formquestion,
'no', 1);
1730 if ($action ==
'add_spip') {
1731 print $form->formconfirm(
"card.php?rowid=".$id, $langs->trans(
'AddIntoSpip'), $langs->trans(
'AddIntoSpipConfirmation'),
'confirm_add_spip');
1734 if ($action ==
'del_spip') {
1735 print $form->formconfirm(
"card.php?rowid=$id", $langs->trans(
'DeleteIntoSpip'), $langs->trans(
'DeleteIntoSpipConfirmation'),
'confirm_del_spip');
1742 if (isModEnabled(
'societe')) {
1746 $linkback =
'<a href="'.DOL_URL_ROOT.
'/adherents/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
1748 $morehtmlref =
'<a href="'.DOL_URL_ROOT.
'/adherents/vcard.php?id='.
$object->id.
'" class="refid">';
1749 $morehtmlref .=
img_picto($langs->trans(
"Download").
' '.$langs->trans(
"VCard"),
'vcard.png',
'class="valignmiddle marginleftonly paddingrightonly"');
1750 $morehtmlref .=
'</a>';
1753 dol_banner_tab(
$object,
'rowid', $linkback, 1,
'rowid',
'ref', $morehtmlref);
1755 print
'<div class="fichecenter">';
1756 print
'<div class="fichehalfleft">';
1758 print
'<div class="underbanner clearboth"></div>';
1759 print
'<table class="border tableforfield centpercent">';
1763 print
'<tr><td class="titlefield">'.$langs->trans(
"Login").
' / '.$langs->trans(
"Id").
'</td><td class="valeur">'.
dol_escape_htmltag(
$object->login).
'</td></tr>';
1767 print
'<tr><td class="titlefield">'.$langs->trans(
"Type").
'</td>';
1768 print
'<td class="valeur">'.$adht->getNomUrl(1).
"</td></tr>\n";
1771 print
'<tr><td>'.$langs->trans(
"MemberNature").
'</td>';
1772 print
'<td class="valeur" >'.$object->getmorphylib(
'', 1).
'</td>';
1779 print
'<tr><td>'.$langs->trans(
"UserTitle").
'</td><td class="valeur">'.
$object->getCivilityLabel().
'</td>';
1784 print
'<tr><td>'.$langs->trans(
"Password").
'</td><td>';
1786 print preg_replace(
'/./i',
'*',
$object->pass);
1789 print
'<!-- '.$langs->trans(
"Crypted").
': '.
$object->pass_indatabase_crypted.
' -->';
1791 print
'<span class="opacitymedium">'.$langs->trans(
"Hidden").
'</span>';
1793 if (!empty(
$object->pass_indatabase) && empty(
$object->user_id)) {
1794 $langs->load(
"errors");
1795 $htmltext = $langs->trans(
"WarningPasswordSetWithNoAccount");
1796 print
' '.$form->textwithpicto(
'', $htmltext, 1,
'warning');
1802 print
'<tr><td>'.$langs->trans(
"SubscriptionEndDate").
'</td><td class="valeur">';
1806 print
" ".img_warning($langs->trans(
"Late"));
1809 if (
$object->need_subscription == 0) {
1810 print $langs->trans(
"SubscriptionNotNeeded");
1811 } elseif (!$adht->subscription) {
1812 print $langs->trans(
"SubscriptionNotRecorded");
1814 print
" ".img_warning($langs->trans(
"Late"));
1817 print $langs->trans(
"SubscriptionNotReceived");
1819 print
" ".img_warning($langs->trans(
"Late"));
1829 print
'<div class="fichehalfright">';
1830 print
'<div class="underbanner clearboth"></div>';
1832 print
'<table class="border tableforfield centpercent">';
1835 if (isModEnabled(
'category') && $user->hasRight(
'categorie',
'lire')) {
1836 print
'<tr><td>'.$langs->trans(
"Categories").
'</td>';
1837 print
'<td colspan="2">';
1838 print $form->showCategories(
$object->id, Categorie::TYPE_MEMBER, 1);
1843 print
'<tr><td class="titlefield">'.$langs->trans(
"DateOfBirth").
'</td><td class="valeur">'.
dol_print_date(
$object->birth,
'day').
'</td></tr>';
1847 require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
1848 print
'<tr><td>'.$langs->trans(
"DefaultLang").
'</td><td>';
1851 $langs->load(
"languages");
1852 $labellang = (
$object->default_lang ? $langs->trans(
'Language_'.
$object->default_lang) :
'');
1860 $htmltext = $langs->trans(
"Public",
getDolGlobalString(
'MAIN_INFO_SOCIETE_NOM'), $linkofpubliclist);
1861 print $form->textwithpicto($langs->trans(
"MembershipPublic"), $htmltext, 1,
'help',
'', 0, 3,
'membershippublic');
1862 print
'</td><td class="valeur">'.yn(
$object->public).
'</td></tr>';
1865 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
1868 if (isModEnabled(
'societe')) {
1870 $editenable = $user->hasRight(
'adherent',
'creer');
1871 print $form->editfieldkey(
'LinkedToDolibarrThirdParty',
'thirdparty',
'',
$object, $editenable);
1872 print
'</td><td colspan="2" class="valeur">';
1873 if ($action ==
'editthirdparty') {
1874 $htmlname =
'socid';
1875 print
'<form method="POST" action="'.$_SERVER[
'PHP_SELF'].
'" name="form'.$htmlname.
'">';
1876 print
'<input type="hidden" name="rowid" value="'.$object->id.
'">';
1877 print
'<input type="hidden" name="action" value="set'.$htmlname.
'">';
1878 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1879 print
'<table class="nobordernopadding">';
1881 print $form->select_company(
$object->socid,
'socid',
'', 1);
1883 print
'<td class="left"><input type="submit" class="button button-edit smallpaddingimp" value="'.$langs->trans(
"Modify").
'"></td>';
1884 print
'</tr></table></form>';
1888 $result = $company->fetch(
$object->socid);
1889 print $company->getNomUrl(1);
1892 $tmparray = $company->getOutstandingBills(
'customer');
1893 if (!empty($tmparray[
'refs'])) {
1894 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']).
')';
1899 print
'<span class="opacitymedium">'.$langs->trans(
"NoThirdPartyAssociatedToMember").
'</span>';
1907 $editenable = $user->hasRight(
'adherent',
'creer') && $user->hasRight(
'user',
'user',
'creer');
1908 print $form->editfieldkey(
'LinkedToDolibarrUser',
'login',
'',
$object, $editenable);
1909 print
'</td><td colspan="2" class="valeur">';
1910 if ($action ==
'editlogin') {
1911 $form->form_users($_SERVER[
'PHP_SELF'].
'?rowid='.
$object->id,
$object->user_id,
'userid',
'');
1914 $linkeduser =
new User($db);
1915 $linkeduser->fetch(
$object->user_id);
1916 print $linkeduser->getNomUrl(-1);
1918 print
'<span class="opacitymedium">'.$langs->trans(
"NoDolibarrAccess").
'</span>';
1925 print
"</div></div>\n";
1926 print
'<div class="clearboth"></div>';
1935 print
'<div class="tabsAction">';
1937 $parameters = array();
1938 $reshook = $hookmanager->executeHooks(
'addMoreActionsButtons', $parameters,
$object, $action);
1939 if (empty($reshook)) {
1940 if ($action !=
'editlogin' && $action !=
'editthirdparty') {
1942 if (empty($user->socid)) {
1944 print
'<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?id='.((int)
$object->id).
'&action=presend&mode=init#formmailbeforetitle">'.$langs->trans(
'SendMail').
'</a>'.
"\n";
1963 if ($user->hasRight(
'adherent',
'creer')) {
1964 print
'<a class="butAction" href="card.php?rowid='.((int)
$object->id).
'&action=edit&token='.
newToken().
'">'.$langs->trans(
"Modify").
'</a>'.
"\n";
1966 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"Modify").
'</span>'.
"\n";
1971 if ($user->hasRight(
'adherent',
'creer')) {
1972 print
'<a class="butAction" href="card.php?rowid='.((int)
$object->id).
'&action=valid&token='.
newToken().
'">'.$langs->trans(
"Validate").
'</a>'.
"\n";
1974 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"Validate").
'</span>'.
"\n";
1980 if ($user->hasRight(
'adherent',
'creer')) {
1981 print
'<a class="butAction" href="card.php?rowid='.((int)
$object->id).
'&action=valid&token='.
newToken().
'">'.$langs->trans(
"Reenable").
"</a>\n";
1983 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"Reenable").
'</span>'.
"\n";
1989 if ($user->hasRight(
'adherent',
'supprimer')) {
1990 print
'<a class="butAction" href="card.php?rowid='.((int)
$object->id).
'&action=resiliate&token='.
newToken().
'">'.$langs->trans(
"Resiliate").
"</a></span>\n";
1992 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"Resiliate").
'</span>'.
"\n";
1998 if ($user->hasRight(
'adherent',
'supprimer')) {
1999 print
'<a class="butAction" href="card.php?rowid='.((int)
$object->id).
'&action=exclude&token='.
newToken().
'">'.$langs->trans(
"Exclude").
"</a></span>\n";
2001 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"Exclude").
'</span>'.
"\n";
2006 if (isModEnabled(
'societe') && !
$object->socid) {
2007 if ($user->hasRight(
'societe',
'creer')) {
2009 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";
2011 print
'<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans(
"ValidateBefore")).
'">'.$langs->trans(
"CreateDolibarrThirdParty").
'</a>'.
"\n";
2014 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"CreateDolibarrThirdParty").
'</span>'.
"\n";
2019 if (!$user->socid && !
$object->user_id) {
2020 if ($user->hasRight(
'user',
'user',
'creer')) {
2022 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";
2024 print
'<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans(
"ValidateBefore")).
'">'.$langs->trans(
"CreateDolibarrLogin").
'</a>'.
"\n";
2027 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"CreateDolibarrLogin").
'</span>'.
"\n";
2033 $isinspip = $mailmanspip->is_in_spip(
$object);
2035 if ($isinspip == 1) {
2036 print
'<a class="butAction" href="card.php?rowid='.((int)
$object->id).
'&action=del_spip&token='.
newToken().
'">'.$langs->trans(
"DeleteIntoSpip").
'</a>'.
"\n";
2038 if ($isinspip == 0) {
2039 print
'<a class="butAction" href="card.php?rowid='.((int)
$object->id).
'&action=add_spip&token='.
newToken().
'">'.$langs->trans(
"AddIntoSpip").
'</a>'.
"\n";
2044 if ($user->hasRight(
'adherent',
'supprimer')) {
2045 print
'<a class="butActionDelete" href="card.php?rowid='.((int)
$object->id).
'&action=delete&token='.
newToken().
'">'.$langs->trans(
"Delete").
'</a>'.
"\n";
2047 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"Delete").
'</span>'.
"\n";
2053 if ($isinspip == -1) {
2054 print
'<br><br><span class="error">'.$langs->trans(
'SPIPConnectionFailed').
': '.$mailmanspip->error.
'</span>';
2059 if (
GETPOST(
'modelselected')) {
2060 $action =
'presend';
2063 if ($action !=
'presend') {
2064 print
'<div class="fichecenter"><div class="fichehalfleft">';
2065 print
'<a name="builddoc"></a>';
2069 $filedir = $conf->adherent->dir_output.
'/'.
get_exdir(0, 0, 0, 1,
$object,
'member');
2070 $urlsource = $_SERVER[
'PHP_SELF'].
'?id='.
$object->id;
2071 $genallowed = $user->hasRight(
'adherent',
'lire');
2072 $delallowed = $user->hasRight(
'adherent',
'creer');
2074 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);
2075 $somethingshown = $formfile->numoffiles;
2090 include_once DOL_DOCUMENT_ROOT.
'/core/lib/payments.lib.php';
2091 $validpaymentmethod = getValidOnlinePaymentMethods(
'');
2092 $useonlinepayment = count($validpaymentmethod);
2094 if ($useonlinepayment) {
2096 if (empty($amount)) {
2097 $amount = max($adht->amount,
$object->first_subscription_amount,
$object->last_subscription_amount);
2099 if (empty($amount)) {
2102 require_once DOL_DOCUMENT_ROOT.
'/core/lib/payments.lib.php';
2103 print showOnlinePaymentUrl(
'membersubscription',
$object->ref, $amount);
2106 print
'</div><div class="fichehalfright">';
2110 $morehtmlcenter =
'';
2111 $messagingUrl = DOL_URL_ROOT.
'/adherents/messaging.php?rowid='.
$object->id;
2112 $morehtmlcenter .=
dolGetButtonTitle($langs->trans(
'ShowAsConversation'),
'',
'fa fa-comments imgforviewmode', $messagingUrl,
'', 1);
2113 $morehtmlcenter .=
dolGetButtonTitle($langs->trans(
'SeeAll'),
'',
'fa fa-bars imgforviewmode', DOL_URL_ROOT.
'/adherents/agenda.php?id='.
$object->id);
2116 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formactions.class.php';
2118 $somethingshown = $formactions->showactions(
$object,
$object->element, $socid, 1,
'listactions', $MAXEVENT,
'', $morehtmlcenter);
2120 print
'</div></div>';
2124 $modelmail =
'member';
2125 $defaulttopic =
'CardContent';
2126 $diroutput = $conf->adherent->dir_output;
2127 $trackid =
'mem'.$object->id;
2129 include DOL_DOCUMENT_ROOT.
'/core/tpl/card_presend.tpl.php';
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage members of a foundation.
const STATUS_EXCLUDED
Excluded.
const STATUS_DRAFT
Draft status.
const STATUS_RESILIATED
Resiliated.
const STATUS_VALIDATED
Validated status.
Class to manage members type.
Class to manage categories.
Class to manage mailman and spip.
Class to manage third parties objects (customers, suppliers, prospects...)
Class to manage translations.
Class to manage Dolibarr users.
getCountry($searchkey, $withcode='', $dbtouse=null, $outputlangs=null, $entconv=1, $searchlabel='')
Return country label, code or id from an id, code or label.
dol_delete_dir_recursive($dir, $count=0, $nophperrors=0, $onlysub=0, &$countdeleted=0, $indexdatabase=1, $nolog=0)
Remove a directory $dir and its subdirectories (or only files and subdirectories)
dol_delete_file($file, $disableglob=0, $nophperrors=0, $nohook=0, $object=null, $allowdotdot=false, $indexdatabase=1, $nolog=0)
Remove a file or several files with a mask.
dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disablevirusscan=0, $uploaderrorcode=0, $nohook=0, $varfiles='addedfile', $upload_dir='')
Check validity of a file upload from an GUI page, and move it to its final destination.
dol_buildlogin($lastname, $firstname)
Build a login from lastname, firstname.
isValidUrl($url, $http=0, $pass=0, $port=0, $path=0, $query=0, $anchor=0)
Url string validation <http[s]> :// [user[:pass]@] hostname [port] [/path] [?getquery] [anchor].
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed information (by default a local PHP server timestamp) Rep...
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
picto_from_langcode($codelang, $moreatt='', $notitlealt=0)
Return img flag of country for a language code or country code.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
dolGetButtonTitle($label, $helpText='', $iconClass='fa fa-file', $url='', $id='', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
newToken()
Return the value of token currently saved into session with name 'newtoken'.
dol_clone($object, $native=0)
Create a clone of instance of object (new instance with same value for each properties) With native =...
dol_concatdesc($text1, $text2, $forxml=false, $invert=false)
Concat 2 descriptions with a new line between them (second operand after first one with appropriate n...
complete_substitutions_array(&$substitutionarray, $outputlangs, $object=null, $parameters=null, $callfunc="completesubstitutionarray")
Complete the $substitutionarray with more entries coming from external module that had set the "subst...
make_substitutions($text, $substitutionarray, $outputlangs=null, $converttextinhtmlifnecessary=0)
Make substitution into a text string, replacing keys with vals from $substitutionarray (oldval=>newva...
getArrayOfSocialNetworks()
Get array of social network dictionary.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dol_htmlentitiesbr($stringtoencode, $nl2brmode=0, $pagecodefrom='UTF-8', $removelasteolbr=1)
This function is called to encode a string into a HTML string but differs from htmlentities because a...
getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $object=null, $include=null)
Return array of possible common substitutions.
isValidEmail($address, $acceptsupervisorkey=0, $acceptuserkey=0)
Return true if email syntax is ok.
getDolGlobalString($key, $default='')
Return 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...
image_format_supported($file, $acceptsvg=0)
Return if a filename is file name of a supported image format.
member_prepare_head(Adherent $object)
Return array head with list of tabs to view object information.
$conf db name
Only used if Module[ID]Name translation string is not found.
getRandomPassword($generic=false, $replaceambiguouschars=null, $length=32)
Return a generated password using default module.
getMaxFileSizeArray()
Return the max allowed for file upload.
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.