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);
850 if ($user->hasRight(
'adherent',
'supprimer') && $action ==
'confirm_del_spip' && $confirm ==
'yes') {
852 if (!$mailmanspip->del_to_spip(
$object)) {
853 setEventMessages($langs->trans(
'DeleteIntoSpipError').
': '.$mailmanspip->error,
null,
'errors');
858 if ($user->hasRight(
'adherent',
'creer') && $action ==
'confirm_add_spip' && $confirm ==
'yes') {
860 if (!$mailmanspip->add_to_spip(
$object)) {
861 setEventMessages($langs->trans(
'AddIntoSpipError').
': '.$mailmanspip->error,
null,
'errors');
867 include DOL_DOCUMENT_ROOT.
'/core/actions_printing.inc.php';
870 $upload_dir = $conf->adherent->dir_output;
871 $permissiontoadd = $user->hasRight(
'adherent',
'creer');
872 include DOL_DOCUMENT_ROOT.
'/core/actions_builddoc.inc.php';
875 $triggersendname =
'MEMBER_SENTBYMAIL';
877 $mode =
'emailfrommember';
878 $trackid =
'mem'.$object->id;
879 include DOL_DOCUMENT_ROOT.
'/core/actions_sendmails.inc.php';
887$form =
new Form($db);
892$title = $langs->trans(
"Member").
" - ".$langs->trans(
"Card");
893$help_url =
'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder';
896$countrynotdefined = $langs->trans(
"ErrorSetACountryFirst").
' ('.$langs->trans(
"SeeAbove").
')';
898if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
902 if (empty(
$object->error) && $id) {
910 $objcanvas->display_canvas($action);
917 if ($action ==
'create') {
925 $object->country_code = $tmparray[
'code'];
926 $object->country = $tmparray[
'label'];
930 if (!empty($socid)) {
935 if (!($soc->id > 0)) {
936 $langs->load(
"errors");
937 print($langs->trans(
'ErrorRecordNotFound'));
946 if ($conf->use_javascript_ajax) {
947 print
"\n".
'<script type="text/javascript">'.
"\n";
948 print
'jQuery(document).ready(function () {
949 jQuery("#selectcountry_id").change(function() {
950 document.formsoc.action.value="create";
951 document.formsoc.submit();
953 function initfieldrequired() {
954 jQuery("#tdcompany").removeClass("fieldrequired");
955 jQuery("#tdlastname").removeClass("fieldrequired");
956 jQuery("#tdfirstname").removeClass("fieldrequired");
957 if (jQuery("#morphy").val() == \'mor\') {
958 jQuery("#tdcompany").addClass("fieldrequired");
960 if (jQuery("#morphy").val() == \'phy\') {
961 jQuery("#tdlastname").addClass("fieldrequired");
962 jQuery("#tdfirstname").addClass("fieldrequired");
965 jQuery("#morphy").change(function() {
970 print
'</script>'.
"\n";
973 print
'<form name="formsoc" action="'.$_SERVER[
"PHP_SELF"].
'" method="post" enctype="multipart/form-data">';
974 print
'<input type="hidden" name="token" value="'.newToken().
'">';
975 print
'<input type="hidden" name="action" value="add">';
976 print
'<input type="hidden" name="socid" value="'.$socid.
'">';
978 print
'<input type="hidden" name="backtopage" value="'.($backtopage !=
'1' ? $backtopage : $_SERVER[
"HTTP_REFERER"]).
'">';
983 print
'<table class="border centpercent">';
988 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>';
993 require_once DOL_DOCUMENT_ROOT.
'/core/lib/security2.lib.php';
995 print
'<tr><td><span class="fieldrequired">'.$langs->trans(
"Password").
'</span></td><td>';
996 print
'<input type="text" class="minwidth300" maxlength="50" name="password" value="'.dol_escape_htmltag($generated_password).
'">';
1001 print
'<tr><td class="fieldrequired">'.$langs->trans(
"MemberType").
'</td><td>';
1002 $listetype = $adht->liste_array(1);
1003 print
img_picto(
'', $adht->picto,
'class="pictofixedwidth"');
1004 if (count($listetype)) {
1005 print $form->selectarray(
"typeid", $listetype, (
GETPOSTINT(
'typeid') ?
GETPOSTINT(
'typeid') : $typeid), (count($listetype) > 1 ? 1 : 0), 0, 0,
'', 0, 0, 0,
'',
'minwidth200', 1);
1007 print
'<span class="error">'.$langs->trans(
"NoTypeDefinedGoToSetup").
'</span>';
1009 if ($user->hasRight(
'member',
'configurer')) {
1010 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>';
1016 $morphys[
"phy"] = $langs->trans(
"Physical");
1017 $morphys[
"mor"] = $langs->trans(
"Moral");
1018 print
'<tr><td class="fieldrequired">'.$langs->trans(
"MemberNature").
"</td><td>\n";
1019 print $form->selectarray(
"morphy", $morphys, (
GETPOST(
'morphy',
'alpha') ?
GETPOST(
'morphy',
'alpha') :
$object->morphy), 1, 0, 0,
'', 0, 0, 0,
'',
'minwidth200', 1);
1023 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>';
1026 print
'<tr><td>'.$langs->trans(
"UserTitle").
'</td><td>';
1027 print $formcompany->select_civility(
GETPOSTINT(
'civility_id') ?
GETPOSTINT(
'civility_id') :
$object->civility_id,
'civility_id',
'maxwidth150', 1).
'</td>';
1031 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>';
1035 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>';
1039 print
'<tr><td>'.$langs->trans(
"Gender").
'</td>';
1041 $arraygender = array(
'man' => $langs->trans(
"Genderman"),
'woman' => $langs->trans(
"Genderwoman"),
'other' => $langs->trans(
"Genderother"));
1042 print $form->selectarray(
'gender', $arraygender,
GETPOST(
'gender',
'alphanohtml'), 1, 0, 0,
'', 0, 0, 0,
'',
'minwidth100', 1);
1046 print
'<tr><td>'.(getDolGlobalString(
'ADHERENT_MAIL_REQUIRED') ?
'<span class="fieldrequired">' :
'').$langs->trans(
"EMail").(getDolGlobalString(
'ADHERENT_MAIL_REQUIRED') ?
'</span>' :
'').
'</td>';
1047 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>';
1050 print
'<tr><td>'.$form->editfieldkey(
'Web',
'member_url',
GETPOST(
'member_url',
'alpha'),
$object, 0).
'</td>';
1051 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>';
1054 print
'<tr><td class="tdtop">'.$langs->trans(
"Address").
'</td><td>';
1055 print
'<textarea name="address" wrap="soft" class="quatrevingtpercent" rows="2">'.(GETPOSTISSET(
'address') ?
GETPOST(
'address',
'alphanohtml') : $soc->address).
'</textarea>';
1059 print
'<tr><td>'.$langs->trans(
"Zip").
' / '.$langs->trans(
"Town").
'</td><td>';
1060 print $formcompany->select_ziptown((GETPOSTISSET(
'zipcode') ?
GETPOST(
'zipcode',
'alphanohtml') : $soc->zip),
'zipcode', array(
'town',
'selectcountry_id',
'state_id'), 6);
1062 print $formcompany->select_ziptown((GETPOSTISSET(
'town') ?
GETPOST(
'town',
'alphanohtml') : $soc->town),
'town', array(
'zipcode',
'selectcountry_id',
'state_id'));
1066 if (empty($soc->country_id)) {
1067 $soc->country_id = $mysoc->country_id;
1068 $soc->country_code = $mysoc->country_code;
1069 $soc->state_id = $mysoc->state_id;
1071 print
'<tr><td>'.$langs->trans(
'Country').
'</td><td>';
1072 print
img_picto(
'',
'country',
'class="pictofixedwidth"');
1073 print $form->select_country(GETPOSTISSET(
'country_id') ?
GETPOST(
'country_id',
'alpha') : $soc->country_id,
'country_id');
1075 print
info_admin($langs->trans(
"YouCanChangeValuesForThisListFromDictionarySetup"), 1);
1081 print
'<tr><td>'.$langs->trans(
'State').
'</td><td>';
1082 if ($soc->country_id || GETPOSTISSET(
'country_id')) {
1083 print
img_picto(
'',
'state',
'class="pictofixedwidth"');
1084 print $formcompany->select_state(GETPOSTISSET(
'state_id') ?
GETPOSTINT(
'state_id') : $soc->state_id, GETPOSTISSET(
'country_id') ?
GETPOSTINT(
'country_id') : $soc->country_code);
1086 print $countrynotdefined;
1092 print
'<tr><td>'.$langs->trans(
"PhonePro").
'</td>';
1093 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>';
1096 print
'<tr><td>'.$langs->trans(
"PhonePerso").
'</td>';
1097 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>';
1100 print
'<tr><td>'.$langs->trans(
"PhoneMobile").
'</td>';
1101 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>';
1103 if (isModEnabled(
'socialnetworks')) {
1104 foreach ($socialnetworks as $key => $value) {
1105 if (!$value[
'active']) {
1108 $val = (GETPOSTISSET(
'member_'.$key) ?
GETPOST(
'member_'.$key,
'alpha') : (empty(
$object->socialnetworks[$key]) ?
'' :
$object->socialnetworks[$key]));
1109 print
'<tr><td>'.$langs->trans($value[
'label']).
'</td><td><input type="text" name="member_'.$key.
'" size="40" value="'.$val.
'"></td></tr>';
1114 print
"<tr><td>".$langs->trans(
"DateOfBirth").
"</td><td>\n";
1115 print
img_picto(
'',
'object_calendar',
'class="pictofixedwidth"').$form->selectDate((
$object->birth ?
$object->birth : -1),
'birth', 0, 0, 1,
'formsoc');
1116 print
"</td></tr>\n";
1120 $htmltext = $langs->trans(
"Public",
getDolGlobalString(
'MAIN_INFO_SOCIETE_NOM'), $linkofpubliclist);
1121 print $form->textwithpicto($langs->trans(
"MembershipPublic"), $htmltext, 1,
'help',
'', 0, 3,
'membershippublic');
1122 print
"</td><td>\n";
1123 print $form->selectyesno(
"public",
$object->public, 1,
false, 0, 1);
1124 print
"</td></tr>\n";
1127 if (isModEnabled(
'category') && $user->hasRight(
'categorie',
'lire')) {
1128 print
'<tr><td>'.$form->editfieldkey(
"Categories",
'memcats',
'',
$object, 0).
'</td><td>';
1129 $cate_arbo = $form->select_all_categories(Categorie::TYPE_MEMBER,
'',
'parent', 64, 0, 3);
1130 print
img_picto(
'',
'category').$form->multiselectarray(
'memcats', $cate_arbo,
GETPOST(
'memcats',
'array'), 0, 0,
'quatrevingtpercent widthcentpercentminusx', 0, 0);
1135 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_add.tpl.php';
1142 print $form->buttonsSaveCancel(
"AddMember");
1148 if ($action ==
'edit') {
1154 $res =
$object->fetch_optionals();
1161 $adht->fetch(
$object->typeid);
1165 if (!empty($country) ||
$object->country_id) {
1166 $sql =
"SELECT rowid, code, label from ".MAIN_DB_PREFIX.
"c_country";
1167 $sql .=
" WHERE rowid = ".(int) (!empty($country) ? $country :
$object->country_id);
1168 $resql = $db->query($sql);
1170 $obj = $db->fetch_object($resql);
1174 $object->country_id = $obj->rowid;
1175 $object->country_code = $obj->code;
1176 $object->country = $langs->trans(
"Country".$obj->code) ? $langs->trans(
"Country".$obj->code) : $obj->label;
1182 if ($conf->use_javascript_ajax) {
1183 print
"\n".
'<script type="text/javascript">';
1184 print
'jQuery(document).ready(function () {
1185 jQuery("#selectcountry_id").change(function() {
1186 document.formsoc.action.value="edit";
1187 document.formsoc.submit();
1189 function initfieldrequired() {
1190 jQuery("#tdcompany").removeClass("fieldrequired");
1191 jQuery("#tdlastname").removeClass("fieldrequired");
1192 jQuery("#tdfirstname").removeClass("fieldrequired");
1193 if (jQuery("#morphy").val() == \'mor\') {
1194 jQuery("#tdcompany").addClass("fieldrequired");
1196 if (jQuery("#morphy").val() == \'phy\') {
1197 jQuery("#tdlastname").addClass("fieldrequired");
1198 jQuery("#tdfirstname").addClass("fieldrequired");
1201 jQuery("#morphy").change(function() {
1202 initfieldrequired();
1204 initfieldrequired();
1206 print
'</script>'.
"\n";
1209 print
'<form name="formsoc" action="'.$_SERVER[
"PHP_SELF"].
'" method="post" enctype="multipart/form-data">';
1210 print
'<input type="hidden" name="token" value="'.newToken().
'" />';
1211 print
'<input type="hidden" name="action" value="update" />';
1212 print
'<input type="hidden" name="rowid" value="'.$id.
'" />';
1213 print
'<input type="hidden" name="statut" value="'.$object->status.
'" />';
1215 print
'<input type="hidden" name="backtopage" value="'.($backtopage !=
'1' ? $backtopage : $_SERVER[
"HTTP_REFERER"]).
'">';
1220 print
'<table class="border centpercent">';
1223 print
'<tr><td class="titlefieldcreate">'.$langs->trans(
"Ref").
'</td><td class="valeur">'.
$object->ref.
'</td></tr>';
1227 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>';
1232 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>';
1236 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Type").
'</td><td>';
1237 if ($user->hasRight(
'adherent',
'creer')) {
1238 print $form->selectarray(
"typeid", $adht->liste_array(), (GETPOSTISSET(
"typeid") ?
GETPOSTINT(
"typeid") :
$object->typeid), 0, 0, 0,
'', 0, 0, 0,
'',
'minwidth200', 1);
1240 print $adht->getNomUrl(1);
1241 print
'<input type="hidden" name="typeid" value="'.$object->typeid.
'">';
1246 $morphys[
"phy"] = $langs->trans(
"Physical");
1247 $morphys[
"mor"] = $langs->trans(
"Moral");
1248 print
'<tr><td><span class="fieldrequired">'.$langs->trans(
"MemberNature").
'</span></td><td>';
1249 print $form->selectarray(
"morphy", $morphys, (GETPOSTISSET(
"morphy") ?
GETPOST(
"morphy",
'alpha') :
$object->morphy), 0, 0, 0,
'', 0, 0, 0,
'',
'minwidth200', 1);
1253 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>';
1256 print
'<tr><td>'.$langs->trans(
"UserTitle").
'</td><td>';
1257 print $formcompany->select_civility(GETPOSTISSET(
"civility_id") ?
GETPOST(
"civility_id",
'alpha') :
$object->civility_id,
'civility_id',
'maxwidth150', 1);
1262 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>';
1266 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>';
1270 print
'<tr><td>'.$langs->trans(
"Gender").
'</td>';
1272 $arraygender = array(
'man' => $langs->trans(
"Genderman"),
'woman' => $langs->trans(
"Genderwoman"),
'other' => $langs->trans(
"Genderother"));
1273 print $form->selectarray(
'gender', $arraygender, GETPOSTISSET(
'gender') ?
GETPOST(
'gender',
'alphanohtml') :
$object->gender, 1, 0, 0,
'', 0, 0, 0,
'',
'minwidth100', 1);
1277 print
'<tr><td>'.$langs->trans(
"Photo").
'</td>';
1278 print
'<td class="hideonsmartphone" valign="middle">';
1279 print $form->showphoto(
'memberphoto',
$object).
"\n";
1280 if ($caneditfieldmember) {
1284 print
'<table class="nobordernopadding">';
1286 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>';
1290 $maxmin = $maxfilesizearray[
'maxmin'];
1292 print
'<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).
'">';
1294 print
'<input type="file" class="flat" name="photo" id="photoinput">';
1301 print
'<tr><td>'.(getDolGlobalString(
"ADHERENT_MAIL_REQUIRED") ?
'<span class="fieldrequired">' :
'').$langs->trans(
"EMail").(getDolGlobalString(
"ADHERENT_MAIL_REQUIRED") ?
'</span>' :
'').
'</td>';
1302 print
'<td>'.img_picto(
'',
'object_email',
'class="pictofixedwidth"').
'<input type="text" name="member_email" class="minwidth300" maxlength="255" value="'.(GETPOSTISSET(
"member_email") ?
GETPOST(
"member_email",
'', 2) :
$object->email).
'"></td></tr>';
1305 print
'<tr><td>'.$form->editfieldkey(
'Web',
'member_url',
GETPOST(
'member_url',
'alpha'),
$object, 0).
'</td>';
1306 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>';
1309 print
'<tr><td>'.$langs->trans(
"Address").
'</td><td>';
1310 print
'<textarea name="address" wrap="soft" class="quatrevingtpercent" rows="'.ROWS_2.
'">'.(GETPOSTISSET(
"address") ?
GETPOST(
"address",
'alphanohtml', 2) :
$object->address).
'</textarea>';
1314 print
'<tr><td>'.$langs->trans(
"Zip").
' / '.$langs->trans(
"Town").
'</td><td>';
1315 print $formcompany->select_ziptown((GETPOSTISSET(
"zipcode") ?
GETPOST(
"zipcode",
'alphanohtml', 2) :
$object->zip),
'zipcode', array(
'town',
'selectcountry_id',
'state_id'), 6);
1317 print $formcompany->select_ziptown((GETPOSTISSET(
"town") ?
GETPOST(
"town",
'alphanohtml', 2) :
$object->town),
'town', array(
'zipcode',
'selectcountry_id',
'state_id'));
1322 print
'<tr><td>'.$langs->trans(
'Country').
'</td><td>';
1323 print
img_picto(
'',
'country',
'class="pictofixedwidth"');
1324 print $form->select_country(GETPOSTISSET(
"country_id") ?
GETPOST(
"country_id",
"alpha") :
$object->country_id,
'country_id');
1326 print
info_admin($langs->trans(
"YouCanChangeValuesForThisListFromDictionarySetup"), 1);
1332 print
'<tr><td>'.$langs->trans(
'State').
'</td><td>';
1333 print
img_picto(
'',
'state',
'class="pictofixedwidth"');
1334 print $formcompany->select_state(
$object->state_id, GETPOSTISSET(
"country_id") ?
GETPOST(
"country_id",
"alpha") :
$object->country_id);
1339 print
'<tr><td>'.$langs->trans(
"PhonePro").
'</td>';
1340 print
'<td>'.img_picto(
'',
'object_phoning',
'class="pictofixedwidth"').
'<input type="text" name="phone" value="'.(GETPOSTISSET(
"phone") ?
GETPOST(
"phone") :
$object->phone).
'"></td></tr>';
1343 print
'<tr><td>'.$langs->trans(
"PhonePerso").
'</td>';
1344 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>';
1347 print
'<tr><td>'.$langs->trans(
"PhoneMobile").
'</td>';
1348 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>';
1350 if (isModEnabled(
'socialnetworks')) {
1351 foreach ($socialnetworks as $key => $value) {
1352 if (!$value[
'active']) {
1355 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>';
1360 print
"<tr><td>".$langs->trans(
"DateOfBirth").
"</td><td>\n";
1361 print
img_picto(
'',
'object_calendar',
'class="pictofixedwidth"').$form->selectDate((
$object->birth ?
$object->birth : -1),
'birth', 0, 0, 1,
'formsoc');
1362 print
"</td></tr>\n";
1366 print
'<tr><td>'.$form->editfieldkey(
'DefaultLang',
'default_lang',
'',
$object, 0).
'</td><td colspan="3">'.
"\n";
1367 print
img_picto(
'',
'language',
'class="pictofixedwidth"').$formadmin->select_language(
$object->default_lang,
'default_lang', 0, 0, 1);
1374 $htmltext = $langs->trans(
"Public",
getDolGlobalString(
'MAIN_INFO_SOCIETE_NOM'), $linkofpubliclist);
1375 print $form->textwithpicto($langs->trans(
"MembershipPublic"), $htmltext, 1,
'help',
'', 0, 3,
'membershippublic');
1376 print
"</td><td>\n";
1377 print $form->selectyesno(
"public", (GETPOSTISSET(
"public") ?
GETPOST(
"public",
'alphanohtml', 2) :
$object->public), 1, false, 0, 1);
1378 print
"</td></tr>\n";
1381 if (isModEnabled(
'category') && $user->hasRight(
'categorie',
'lire')) {
1382 print
'<tr><td>'.$form->editfieldkey(
"Categories",
'memcats',
'',
$object, 0).
'</td>';
1384 $cate_arbo = $form->select_all_categories(Categorie::TYPE_MEMBER,
'',
'', 64, 0, 3);
1386 $cats = $c->containing(
$object->id, Categorie::TYPE_MEMBER);
1387 $arrayselected = array();
1388 if (is_array($cats)) {
1389 foreach ($cats as $cat) {
1390 $arrayselected[] = $cat->id;
1393 print
img_picto(
'',
'category',
'class="pictofixedwidth"');
1394 print $form->multiselectarray(
'memcats', $cate_arbo, $arrayselected, 0, 0,
'widthcentpercentminusx', 0,
'100%');
1399 if (isModEnabled(
'societe')) {
1400 print
'<tr><td>'.$langs->trans(
"LinkedToDolibarrThirdParty").
'</td><td colspan="2" class="valeur">';
1403 $result = $company->fetch(
$object->socid);
1404 print $company->getNomUrl(1);
1406 print $langs->trans(
"NoThirdPartyAssociatedToMember");
1412 print
'<tr><td>'.$langs->trans(
"LinkedToDolibarrUser").
'</td><td colspan="2" class="valeur">';
1414 $form->form_users($_SERVER[
'PHP_SELF'].
'?rowid='.
$object->id,
$object->user_id,
'none');
1416 print $langs->trans(
"NoDolibarrAccess");
1421 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_edit.tpl.php';
1426 print $form->buttonsSaveCancel(
"Save",
'Cancel');
1432 if ($id > 0 && $action !=
'edit') {
1438 $res =
$object->fetch_optionals();
1445 $res = $adht->fetch(
$object->typeid);
1460 if ($action ==
'create_user') {
1461 $login = (GETPOSTISSET(
'login') ?
GETPOST(
'login',
'alphanohtml') :
$object->login);
1462 if (empty($login)) {
1464 include_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
1467 if (empty($login)) {
1468 $login = strtolower(substr(
$object->firstname, 0, 4)).strtolower(substr(
$object->lastname, 0, 4));
1472 $formquestion = array(
1473 array(
'label' => $langs->trans(
"LoginToCreate"),
'type' =>
'text',
'name' =>
'login',
'value' => $login)
1475 if (isModEnabled(
'societe') &&
$object->socid > 0) {
1477 $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")));
1480 if (isModEnabled(
'societe') &&
$object->socid <= 0) {
1481 $text .= $langs->trans(
"UserWillBeInternalUser").
'<br>';
1483 $text .= $langs->trans(
"ConfirmCreateLogin");
1484 print $form->formconfirm($_SERVER[
"PHP_SELF"].
"?rowid=".
$object->id, $langs->trans(
"CreateDolibarrLogin"), $text,
"confirm_create_user", $formquestion,
'yes');
1488 if ($action ==
'create_thirdparty') {
1490 $fullname =
$object->getFullName($langs);
1492 if (
$object->morphy ==
'mor') {
1493 $companyname =
$object->company;
1494 if (!empty($fullname)) {
1495 $companyalias = $fullname;
1498 $companyname = $fullname;
1499 if (!empty(
$object->company)) {
1500 $companyalias =
$object->company;
1505 $formquestion = array(
1506 array(
'label' => $langs->trans(
"NameToCreate"),
'type' =>
'text',
'name' =>
'companyname',
'value' => $companyname,
'morecss' =>
'minwidth300',
'moreattr' =>
'maxlength="128"'),
1507 array(
'label' => $langs->trans(
"AliasNames"),
'type' =>
'text',
'name' =>
'companyalias',
'value' => $companyalias,
'morecss' =>
'minwidth300',
'moreattr' =>
'maxlength="128"')
1510 print $form->formconfirm($_SERVER[
"PHP_SELF"].
"?rowid=".
$object->id, $langs->trans(
"CreateDolibarrThirdParty"), $langs->trans(
"ConfirmCreateThirdParty"),
"confirm_create_thirdparty", $formquestion,
'yes');
1514 if ($action ==
'valid') {
1515 $langs->load(
"mails");
1518 $adht->fetch(
$object->typeid);
1524 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
1527 $outputlangs =
new Translate(
'', $conf);
1528 $outputlangs->setDefaultLang(empty(
$object->thirdparty->default_lang) ? $mysoc->default_lang :
$object->thirdparty->default_lang);
1530 $outputlangs->loadLangs(array(
"main",
"members",
"companies",
"install",
"other"));
1532 $arraydefaultmessage =
null;
1535 if (!empty($labeltouse)) {
1536 $arraydefaultmessage = $formmail->getEMailTemplate($db,
'member', $user, $outputlangs, 0, 1, $labeltouse);
1539 if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
1540 $subject = $arraydefaultmessage->topic;
1541 $msg = $arraydefaultmessage->content;
1549 $tmp = $langs->trans(
"SendingAnEMailToMember");
1550 $tmp .=
'<br>'.$langs->trans(
"MailFrom").
': <b>'.
getDolGlobalString(
'ADHERENT_MAIL_FROM').
'</b>, ';
1551 $tmp .=
'<br>'.$langs->trans(
"MailRecipient").
': <b>'.
$object->email.
'</b>';
1553 $helpcontent .=
'<b>'.$langs->trans(
"MailFrom").
'</b>: '.
getDolGlobalString(
'ADHERENT_MAIL_FROM').
'<br>'.
"\n";
1554 $helpcontent .=
'<b>'.$langs->trans(
"MailRecipient").
'</b>: '.
$object->email.
'<br>'.
"\n";
1555 $helpcontent .=
'<b>'.$langs->trans(
"Subject").
'</b>:<br>'.
"\n";
1556 $helpcontent .= $subjecttosend.
"\n";
1557 $helpcontent .=
"<br>";
1558 $helpcontent .=
'<b>'.$langs->trans(
"Content").
'</b>:<br>';
1561 $label = $form->textwithpicto($tmp, $helpcontent, 1,
'help');
1564 $formquestion = array();
1566 $formquestion[] = array(
'type' =>
'checkbox',
'name' =>
'send_mail',
'label' => $label,
'value' => (
getDolGlobalString(
'ADHERENT_DEFAULT_SENDINFOBYMAIL') ?
true : false));
1569 $formquestion[] = array(
'type' =>
'other',
'label' => $langs->transnoentitiesnoconv(
"SynchroMailManEnabled"),
'value' =>
'');
1572 $formquestion[] = array(
'type' =>
'other',
'label' => $langs->transnoentitiesnoconv(
"SynchroSpipEnabled"),
'value' =>
'');
1574 print $form->formconfirm(
"card.php?rowid=".$id, $langs->trans(
"ValidateMember"), $langs->trans(
"ConfirmValidateMember"),
"confirm_valid", $formquestion,
'yes', 1, 220);
1578 if ($action ==
'resiliate') {
1579 $langs->load(
"mails");
1582 $adht->fetch(
$object->typeid);
1588 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
1591 $outputlangs =
new Translate(
'', $conf);
1592 $outputlangs->setDefaultLang(empty(
$object->thirdparty->default_lang) ? $mysoc->default_lang :
$object->thirdparty->default_lang);
1594 $outputlangs->loadLangs(array(
"main",
"members"));
1596 $arraydefaultmessage =
null;
1599 if (!empty($labeltouse)) {
1600 $arraydefaultmessage = $formmail->getEMailTemplate($db,
'member', $user, $outputlangs, 0, 1, $labeltouse);
1603 if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
1604 $subject = $arraydefaultmessage->topic;
1605 $msg = $arraydefaultmessage->content;
1613 $tmp = $langs->trans(
"SendingAnEMailToMember");
1614 $tmp .=
'<br>('.$langs->trans(
"MailFrom").
': <b>'.
getDolGlobalString(
'ADHERENT_MAIL_FROM').
'</b>, ';
1615 $tmp .= $langs->trans(
"MailRecipient").
': <b>'.
$object->email.
'</b>)';
1617 $helpcontent .=
'<b>'.$langs->trans(
"MailFrom").
'</b>: '.
getDolGlobalString(
'ADHERENT_MAIL_FROM').
'<br>'.
"\n";
1618 $helpcontent .=
'<b>'.$langs->trans(
"MailRecipient").
'</b>: '.
$object->email.
'<br>'.
"\n";
1619 $helpcontent .=
'<b>'.$langs->trans(
"Subject").
'</b>:<br>'.
"\n";
1620 $helpcontent .= $subjecttosend.
"\n";
1621 $helpcontent .=
"<br>";
1622 $helpcontent .=
'<b>'.$langs->trans(
"Content").
'</b>:<br>';
1625 $label = $form->textwithpicto($tmp, $helpcontent, 1,
'help');
1628 $formquestion = array();
1630 $formquestion[] = array(
'type' =>
'checkbox',
'name' =>
'send_mail',
'label' => $label,
'value' => (
getDolGlobalString(
'ADHERENT_DEFAULT_SENDINFOBYMAIL') ?
'true' :
'false'));
1633 $formquestion[] = array(
'type' =>
'hidden',
'name' =>
'backtopage',
'value' => ($backtopage !=
'1' ? $backtopage : $_SERVER[
"HTTP_REFERER"]));
1635 print $form->formconfirm(
"card.php?rowid=".$id, $langs->trans(
"ResiliateMember"), $langs->trans(
"ConfirmResiliateMember"),
"confirm_resiliate", $formquestion,
'no', 1, 240);
1639 if ($action ==
'exclude') {
1640 $langs->load(
"mails");
1643 $adht->fetch(
$object->typeid);
1649 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
1652 $outputlangs =
new Translate(
'', $conf);
1653 $outputlangs->setDefaultLang(empty(
$object->thirdparty->default_lang) ? $mysoc->default_lang :
$object->thirdparty->default_lang);
1655 $outputlangs->loadLangs(array(
"main",
"members"));
1657 $arraydefaultmessage =
null;
1660 if (!empty($labeltouse)) {
1661 $arraydefaultmessage = $formmail->getEMailTemplate($db,
'member', $user, $outputlangs, 0, 1, $labeltouse);
1664 if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
1665 $subject = $arraydefaultmessage->topic;
1666 $msg = $arraydefaultmessage->content;
1674 $tmp = $langs->trans(
"SendingAnEMailToMember");
1675 $tmp .=
'<br>('.$langs->trans(
"MailFrom").
': <b>'.
getDolGlobalString(
'ADHERENT_MAIL_FROM').
'</b>, ';
1676 $tmp .= $langs->trans(
"MailRecipient").
': <b>'.
$object->email.
'</b>)';
1678 $helpcontent .=
'<b>'.$langs->trans(
"MailFrom").
'</b>: '.
getDolGlobalString(
'ADHERENT_MAIL_FROM').
'<br>'.
"\n";
1679 $helpcontent .=
'<b>'.$langs->trans(
"MailRecipient").
'</b>: '.
$object->email.
'<br>'.
"\n";
1680 $helpcontent .=
'<b>'.$langs->trans(
"Subject").
'</b>:<br>'.
"\n";
1681 $helpcontent .= $subjecttosend.
"\n";
1682 $helpcontent .=
"<br>";
1683 $helpcontent .=
'<b>'.$langs->trans(
"Content").
'</b>:<br>';
1686 $label = $form->textwithpicto($tmp, $helpcontent, 1,
'help');
1689 $formquestion = array();
1691 $formquestion[] = array(
'type' =>
'checkbox',
'name' =>
'send_mail',
'label' => $label,
'value' => (
getDolGlobalString(
'ADHERENT_DEFAULT_SENDINFOBYMAIL') ?
'true' :
'false'));
1694 $formquestion[] = array(
'type' =>
'hidden',
'name' =>
'backtopage',
'value' => ($backtopage !=
'1' ? $backtopage : $_SERVER[
"HTTP_REFERER"]));
1696 print $form->formconfirm(
"card.php?rowid=".$id, $langs->trans(
"ExcludeMember"), $langs->trans(
"ConfirmExcludeMember"),
"confirm_exclude", $formquestion,
'no', 1, 240);
1700 if ($action ==
'delete') {
1701 $formquestion = array();
1703 $formquestion[] = array(
'type' =>
'hidden',
'name' =>
'backtopage',
'value' => ($backtopage !=
'1' ? $backtopage : $_SERVER[
"HTTP_REFERER"]));
1705 print $form->formconfirm(
"card.php?rowid=".$id, $langs->trans(
"DeleteMember"), $langs->trans(
"ConfirmDeleteMember"),
"confirm_delete", $formquestion,
'no', 1);
1709 if ($action ==
'add_spip') {
1710 print $form->formconfirm(
"card.php?rowid=".$id, $langs->trans(
'AddIntoSpip'), $langs->trans(
'AddIntoSpipConfirmation'),
'confirm_add_spip');
1713 if ($action ==
'del_spip') {
1714 print $form->formconfirm(
"card.php?rowid=$id", $langs->trans(
'DeleteIntoSpip'), $langs->trans(
'DeleteIntoSpipConfirmation'),
'confirm_del_spip');
1721 if (isModEnabled(
'societe')) {
1725 $linkback =
'<a href="'.DOL_URL_ROOT.
'/adherents/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
1727 $morehtmlref =
'<a href="'.DOL_URL_ROOT.
'/adherents/vcard.php?id='.
$object->id.
'" class="refid">';
1728 $morehtmlref .=
img_picto($langs->trans(
"Download").
' '.$langs->trans(
"VCard"),
'vcard.png',
'class="valignmiddle marginleftonly paddingrightonly"');
1729 $morehtmlref .=
'</a>';
1732 dol_banner_tab(
$object,
'rowid', $linkback, 1,
'rowid',
'ref', $morehtmlref);
1734 print
'<div class="fichecenter">';
1735 print
'<div class="fichehalfleft">';
1737 print
'<div class="underbanner clearboth"></div>';
1738 print
'<table class="border tableforfield centpercent">';
1742 print
'<tr><td class="titlefield">'.$langs->trans(
"Login").
' / '.$langs->trans(
"Id").
'</td><td class="valeur">'.
dol_escape_htmltag(
$object->login).
'</td></tr>';
1746 print
'<tr><td class="titlefield">'.$langs->trans(
"Type").
'</td>';
1747 print
'<td class="valeur">'.$adht->getNomUrl(1).
"</td></tr>\n";
1750 print
'<tr><td>'.$langs->trans(
"MemberNature").
'</td>';
1751 print
'<td class="valeur" >'.$object->getmorphylib(
'', 1).
'</td>';
1758 print
'<tr><td>'.$langs->trans(
"UserTitle").
'</td><td class="valeur">'.
$object->getCivilityLabel().
'</td>';
1763 print
'<tr><td>'.$langs->trans(
"Password").
'</td><td>';
1765 print preg_replace(
'/./i',
'*',
$object->pass);
1768 print
'<!-- '.$langs->trans(
"Crypted").
': '.
$object->pass_indatabase_crypted.
' -->';
1770 print
'<span class="opacitymedium">'.$langs->trans(
"Hidden").
'</span>';
1772 if (!empty(
$object->pass_indatabase) && empty(
$object->user_id)) {
1773 $langs->load(
"errors");
1774 $htmltext = $langs->trans(
"WarningPasswordSetWithNoAccount");
1775 print
' '.$form->textwithpicto(
'', $htmltext, 1,
'warning');
1781 print
'<tr><td>'.$langs->trans(
"SubscriptionEndDate").
'</td><td class="valeur">';
1785 print
" ".img_warning($langs->trans(
"Late"));
1788 if (
$object->need_subscription == 0) {
1789 print $langs->trans(
"SubscriptionNotNeeded");
1790 } elseif (!$adht->subscription) {
1791 print $langs->trans(
"SubscriptionNotRecorded");
1793 print
" ".img_warning($langs->trans(
"Late"));
1796 print $langs->trans(
"SubscriptionNotReceived");
1798 print
" ".img_warning($langs->trans(
"Late"));
1808 print
'<div class="fichehalfright">';
1809 print
'<div class="underbanner clearboth"></div>';
1811 print
'<table class="border tableforfield centpercent">';
1814 if (isModEnabled(
'category') && $user->hasRight(
'categorie',
'lire')) {
1815 print
'<tr><td>'.$langs->trans(
"Categories").
'</td>';
1816 print
'<td colspan="2">';
1817 print $form->showCategories(
$object->id, Categorie::TYPE_MEMBER, 1);
1822 print
'<tr><td class="titlefield">'.$langs->trans(
"DateOfBirth").
'</td><td class="valeur">'.
dol_print_date(
$object->birth,
'day').
'</td></tr>';
1826 require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
1827 print
'<tr><td>'.$langs->trans(
"DefaultLang").
'</td><td>';
1830 $langs->load(
"languages");
1831 $labellang = (
$object->default_lang ? $langs->trans(
'Language_'.
$object->default_lang) :
'');
1839 $htmltext = $langs->trans(
"Public",
getDolGlobalString(
'MAIN_INFO_SOCIETE_NOM'), $linkofpubliclist);
1840 print $form->textwithpicto($langs->trans(
"MembershipPublic"), $htmltext, 1,
'help',
'', 0, 3,
'membershippublic');
1841 print
'</td><td class="valeur">'.yn(
$object->public).
'</td></tr>';
1844 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
1847 if (isModEnabled(
'societe')) {
1849 $editenable = $user->hasRight(
'adherent',
'creer');
1850 print $form->editfieldkey(
'LinkedToDolibarrThirdParty',
'thirdparty',
'',
$object, $editenable);
1851 print
'</td><td colspan="2" class="valeur">';
1852 if ($action ==
'editthirdparty') {
1853 $htmlname =
'socid';
1854 print
'<form method="POST" action="'.$_SERVER[
'PHP_SELF'].
'" name="form'.$htmlname.
'">';
1855 print
'<input type="hidden" name="rowid" value="'.$object->id.
'">';
1856 print
'<input type="hidden" name="action" value="set'.$htmlname.
'">';
1857 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1858 print
'<table class="nobordernopadding">';
1860 print $form->select_company(
$object->socid,
'socid',
'', 1);
1862 print
'<td class="left"><input type="submit" class="button button-edit smallpaddingimp" value="'.$langs->trans(
"Modify").
'"></td>';
1863 print
'</tr></table></form>';
1867 $result = $company->fetch(
$object->socid);
1868 print $company->getNomUrl(1);
1871 $tmparray = $company->getOutstandingBills(
'customer');
1872 if (!empty($tmparray[
'refs'])) {
1873 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']).
')';
1878 print
'<span class="opacitymedium">'.$langs->trans(
"NoThirdPartyAssociatedToMember").
'</span>';
1886 $editenable = $user->hasRight(
'adherent',
'creer') && $user->hasRight(
'user',
'user',
'creer');
1887 print $form->editfieldkey(
'LinkedToDolibarrUser',
'login',
'',
$object, $editenable);
1888 print
'</td><td colspan="2" class="valeur">';
1889 if ($action ==
'editlogin') {
1890 $form->form_users($_SERVER[
'PHP_SELF'].
'?rowid='.
$object->id,
$object->user_id,
'userid',
'');
1893 $linkeduser =
new User($db);
1894 $linkeduser->fetch(
$object->user_id);
1895 print $linkeduser->getNomUrl(-1);
1897 print
'<span class="opacitymedium">'.$langs->trans(
"NoDolibarrAccess").
'</span>';
1904 print
"</div></div>\n";
1905 print
'<div class="clearboth"></div>';
1914 print
'<div class="tabsAction">';
1916 $parameters = array();
1917 $reshook = $hookmanager->executeHooks(
'addMoreActionsButtons', $parameters,
$object, $action);
1918 if (empty($reshook)) {
1919 if ($action !=
'editlogin' && $action !=
'editthirdparty') {
1921 if (empty($user->socid)) {
1923 print
'<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?id='.((int)
$object->id).
'&action=presend&mode=init#formmailbeforetitle">'.$langs->trans(
'SendMail').
'</a>'.
"\n";
1942 if ($user->hasRight(
'adherent',
'creer')) {
1943 print
'<a class="butAction" href="card.php?rowid='.((int)
$object->id).
'&action=edit&token='.
newToken().
'">'.$langs->trans(
"Modify").
'</a>'.
"\n";
1945 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"Modify").
'</span>'.
"\n";
1950 if ($user->hasRight(
'adherent',
'creer')) {
1951 print
'<a class="butAction" href="card.php?rowid='.((int)
$object->id).
'&action=valid&token='.
newToken().
'">'.$langs->trans(
"Validate").
'</a>'.
"\n";
1953 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"Validate").
'</span>'.
"\n";
1959 if ($user->hasRight(
'adherent',
'creer')) {
1960 print
'<a class="butAction" href="card.php?rowid='.((int)
$object->id).
'&action=valid&token='.
newToken().
'">'.$langs->trans(
"Reenable").
"</a>\n";
1962 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"Reenable").
'</span>'.
"\n";
1968 if ($user->hasRight(
'adherent',
'supprimer')) {
1969 print
'<a class="butAction" href="card.php?rowid='.((int)
$object->id).
'&action=resiliate&token='.
newToken().
'">'.$langs->trans(
"Resiliate").
"</a></span>\n";
1971 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"Resiliate").
'</span>'.
"\n";
1977 if ($user->hasRight(
'adherent',
'supprimer')) {
1978 print
'<a class="butAction" href="card.php?rowid='.((int)
$object->id).
'&action=exclude&token='.
newToken().
'">'.$langs->trans(
"Exclude").
"</a></span>\n";
1980 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"Exclude").
'</span>'.
"\n";
1985 if (isModEnabled(
'societe') && !
$object->socid) {
1986 if ($user->hasRight(
'societe',
'creer')) {
1988 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";
1990 print
'<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans(
"ValidateBefore")).
'">'.$langs->trans(
"CreateDolibarrThirdParty").
'</a>'.
"\n";
1993 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"CreateDolibarrThirdParty").
'</span>'.
"\n";
1998 if (!$user->socid && !
$object->user_id) {
1999 if ($user->hasRight(
'user',
'user',
'creer')) {
2001 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";
2003 print
'<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans(
"ValidateBefore")).
'">'.$langs->trans(
"CreateDolibarrLogin").
'</a>'.
"\n";
2006 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"CreateDolibarrLogin").
'</span>'.
"\n";
2012 $isinspip = $mailmanspip->is_in_spip(
$object);
2014 if ($isinspip == 1) {
2015 print
'<a class="butAction" href="card.php?rowid='.((int)
$object->id).
'&action=del_spip&token='.
newToken().
'">'.$langs->trans(
"DeleteIntoSpip").
'</a>'.
"\n";
2017 if ($isinspip == 0) {
2018 print
'<a class="butAction" href="card.php?rowid='.((int)
$object->id).
'&action=add_spip&token='.
newToken().
'">'.$langs->trans(
"AddIntoSpip").
'</a>'.
"\n";
2023 if ($user->hasRight(
'adherent',
'supprimer')) {
2024 print
'<a class="butActionDelete" href="card.php?rowid='.((int)
$object->id).
'&action=delete&token='.
newToken().
'">'.$langs->trans(
"Delete").
'</a>'.
"\n";
2026 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"Delete").
'</span>'.
"\n";
2032 if ($isinspip == -1) {
2033 print
'<br><br><span class="error">'.$langs->trans(
'SPIPConnectionFailed').
': '.$mailmanspip->error.
'</span>';
2038 if (
GETPOST(
'modelselected')) {
2039 $action =
'presend';
2042 if ($action !=
'presend') {
2043 print
'<div class="fichecenter"><div class="fichehalfleft">';
2044 print
'<a name="builddoc"></a>';
2048 $filedir = $conf->adherent->dir_output.
'/'.
get_exdir(0, 0, 0, 1,
$object,
'member');
2049 $urlsource = $_SERVER[
'PHP_SELF'].
'?id='.
$object->id;
2050 $genallowed = $user->hasRight(
'adherent',
'lire');
2051 $delallowed = $user->hasRight(
'adherent',
'creer');
2053 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);
2054 $somethingshown = $formfile->numoffiles;
2069 include_once DOL_DOCUMENT_ROOT.
'/core/lib/payments.lib.php';
2070 $validpaymentmethod = getValidOnlinePaymentMethods(
'');
2071 $useonlinepayment = count($validpaymentmethod);
2073 if ($useonlinepayment) {
2075 if (empty($amount)) {
2076 $amount = max($adht->amount,
$object->first_subscription_amount,
$object->last_subscription_amount);
2078 if (empty($amount)) {
2081 require_once DOL_DOCUMENT_ROOT.
'/core/lib/payments.lib.php';
2082 print showOnlinePaymentUrl(
'membersubscription',
$object->ref, $amount);
2085 print
'</div><div class="fichehalfright">';
2089 $morehtmlcenter =
'';
2090 $messagingUrl = DOL_URL_ROOT.
'/adherents/messaging.php?rowid='.
$object->id;
2091 $morehtmlcenter .=
dolGetButtonTitle($langs->trans(
'ShowAsConversation'),
'',
'fa fa-comments imgforviewmode', $messagingUrl,
'', 1);
2092 $morehtmlcenter .=
dolGetButtonTitle($langs->trans(
'SeeAll'),
'',
'fa fa-bars imgforviewmode', DOL_URL_ROOT.
'/adherents/agenda.php?id='.
$object->id);
2095 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formactions.class.php';
2097 $somethingshown = $formactions->showactions(
$object,
$object->element, $socid, 1,
'listactions', $MAXEVENT,
'', $morehtmlcenter);
2099 print
'</div></div>';
2103 $modelmail =
'member';
2104 $defaulttopic =
'CardContent';
2105 $diroutput = $conf->adherent->dir_output;
2106 $trackid =
'mem'.$object->id;
2108 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.