35require
'../main.inc.php';
36require_once DOL_DOCUMENT_ROOT.
'/core/lib/member.lib.php';
37require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
38require_once DOL_DOCUMENT_ROOT.
'/core/lib/images.lib.php';
39require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
40require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
41require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
42require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent_type.class.php';
43require_once DOL_DOCUMENT_ROOT.
'/adherents/class/subscription.class.php';
44require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
45require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
46require_once DOL_DOCUMENT_ROOT.
'/core/class/extrafields.class.php';
47require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formadmin.class.php';
48require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
49require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
53$langs->loadLangs(array(
"companies",
"bills",
"members",
"users",
"other",
"paypal"));
57$action =
GETPOST(
'action',
'aZ09');
58$cancel =
GETPOST(
'cancel',
'alpha');
59$backtopage =
GETPOST(
'backtopage',
'alpha');
60$backtopageforcancel =
GETPOST(
'backtopageforcancel',
'alpha');
61$confirm =
GETPOST(
'confirm',
'alpha');
69if (isModEnabled(
'mailmanspip')) {
70 include_once DOL_DOCUMENT_ROOT.
'/mailmanspip/class/mailmanspip.class.php';
72 $langs->load(
'mailmanspip');
81$extrafields->fetch_name_optionals_label(
$object->table_element);
90 require_once DOL_DOCUMENT_ROOT.
'/core/class/canvas.class.php';
91 $objcanvas =
new Canvas($db, $action);
92 $objcanvas->getCanvas(
'adherent',
'membercard', $canvas);
96$hookmanager->initHooks(array(
'membercard',
'globalcard'));
99if ($id > 0 || !empty($ref)) {
101 $result =
$object->fetch($id, $ref);
104 $canadduser = ($user->admin || $user->hasRight(
'user',
'user',
'creer'));
108 $caneditfielduser = ((($user->id ==
$object->user_id) && $user->hasRight(
'user',
'self',
'creer'))
109 || (($user->id !=
$object->user_id) && $user->hasRight(
'user',
'user',
'creer')));
110 $caneditpassworduser = ((($user->id ==
$object->user_id) && $user->hasRight(
'user',
'self',
'password'))
111 || (($user->id !=
$object->user_id) && $user->hasRight(
'user',
'user',
'password')));
116$canaddmember = $user->hasRight(
'adherent',
'creer');
119 $caneditfieldmember = $user->hasRight(
'adherent',
'creer');
125if (!$user->hasRight(
'adherent',
'creer') && $action ==
'edit') {
129$linkofpubliclist = DOL_MAIN_URL_ROOT.
'/public/members/public_list.php'.((isModEnabled(
'multicompany')) ?
'?entity='.$conf->entity :
'');
136$parameters = array(
'id' => $id,
'rowid' => $id,
'objcanvas' => $objcanvas,
'confirm' => $confirm);
137$reshook = $hookmanager->executeHooks(
'doActions', $parameters,
$object, $action);
142if (empty($reshook)) {
143 $backurlforlist = DOL_URL_ROOT.
'/adherents/list.php';
145 if (empty($backtopage) || ($cancel && empty($id))) {
146 if (empty($backtopage) || ($cancel && strpos($backtopage,
'__ID__'))) {
147 if (empty($id) && (($action !=
'add' && $action !=
'create') || $cancel)) {
148 $backtopage = $backurlforlist;
150 $backtopage = DOL_URL_ROOT.
'/adherents/card.php?id='.((!empty($id) &&
$id > 0) ? $id :
'__ID__');
156 if (!empty($backtopageforcancel)) {
157 header(
"Location: ".$backtopageforcancel);
159 } elseif (!empty($backtopage)) {
160 header(
"Location: ".$backtopage);
166 if ($action ==
'setuserid' && ($user->hasRight(
'user',
'self',
'creer') || $user->hasRight(
'user',
'user',
'creer'))) {
168 if (!$user->hasRight(
'user',
'user',
'creer')) {
169 if ($userid != $user->id && $userid !=
$object->user_id) {
171 setEventMessages($langs->trans(
"ErrorUserPermissionAllowsToLinksToItselfOnly"),
null,
'errors');
176 if ($userid !=
$object->user_id) {
177 $result =
$object->setUserId($userid);
186 if ($action ==
'setsocid' && $caneditfieldmember) {
189 if ($socid !=
$object->socid) {
190 $sql =
"SELECT rowid FROM ".MAIN_DB_PREFIX.
"adherent";
191 $sql .=
" WHERE socid = ".((int) $socid);
192 $sql .=
" AND entity = ".$conf->entity;
193 $resql = $db->query($sql);
195 $obj = $db->fetch_object($resql);
196 if ($obj && $obj->rowid > 0) {
198 $othermember->fetch($obj->rowid);
199 $thirdparty =
new Societe($db);
200 $thirdparty->fetch($socid);
202 setEventMessages($langs->trans(
"ErrorMemberIsAlreadyLinkedToThisThirdParty", $othermember->getFullName($langs), $othermember->login, $thirdparty->name),
null,
'errors');
207 $result =
$object->setThirdPartyId($socid);
218 if ($action ==
'confirm_create_user' && $confirm ==
'yes' && $user->hasRight(
'user',
'user',
'creer')) {
221 $nuser =
new User($db);
223 if (
GETPOST(
'internalorexternal',
'aZ09') ==
'internal') {
224 $tmpuser->fk_soc = 0;
227 $result = $nuser->create_from_member($tmpuser,
GETPOST(
'login',
'alphanohtml'));
230 $langs->load(
"errors");
233 setEventMessages($langs->trans(
"NewUserCreated", $nuser->login),
null,
'mesgs');
242 if ($action ==
'confirm_create_thirdparty' && $confirm ==
'yes' && $user->hasRight(
'societe',
'creer')) {
246 $result = $company->create_from_member(
$object,
GETPOST(
'companyname',
'alpha'),
GETPOST(
'companyalias',
'alpha'));
249 $langs->load(
"errors");
258 if ($action ==
'update' && !$cancel && $user->hasRight(
'adherent',
'creer')) {
259 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
265 $lastname =
GETPOST(
"lastname",
'alphanohtml');
266 $firstname =
GETPOST(
"firstname",
'alphanohtml');
267 $gender =
GETPOST(
"gender",
'alphanohtml');
268 $societe =
GETPOST(
"societe",
'alphanohtml');
269 $morphy =
GETPOST(
"morphy",
'alphanohtml');
270 $login =
GETPOST(
"login",
'alphanohtml');
271 if ($morphy !=
'mor' && empty($lastname)) {
273 $langs->load(
"errors");
274 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Lastname")),
null,
'errors');
276 if ($morphy !=
'mor' && (!isset($firstname) || $firstname ==
'')) {
278 $langs->load(
"errors");
279 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Firstname")),
null,
'errors');
281 if ($morphy ==
'mor' && empty($societe)) {
283 $langs->load(
"errors");
284 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Company")),
null,
'errors');
290 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Login")),
null,
'errors');
294 if ($result > 0 && !$error) {
298 $object->civility_id = trim(
GETPOST(
"civility_id",
'alphanohtml'));
303 if (GETPOSTISSET(
'pass')) {
319 $object->email = preg_replace(
'/\s+/',
'',
GETPOST(
"member_email",
'alpha'));
320 $object->url = trim(
GETPOST(
'member_url',
'custom', 0, FILTER_SANITIZE_URL));
321 $object->socialnetworks = array();
322 foreach ($socialnetworks as $key => $value) {
323 if (GETPOSTISSET($key) &&
GETPOST($key,
'alphanohtml') !=
'') {
324 $object->socialnetworks[$key] = trim(
GETPOST($key,
'alphanohtml'));
333 if (
GETPOST(
'deletephoto',
'alpha')) {
335 } elseif (!empty($_FILES[
'photo'][
'name'])) {
345 $ret = $extrafields->setOptionalsFromPost(
null,
$object,
'@GETPOSTISSET');
353 if ($user->id !=
$object->user_id && !$user->hasRight(
'user',
'user',
'creer')) {
360 if (GETPOSTISSET(
'pass')) {
363 if ($user->id ==
$object->user_id) {
364 if (!$user->hasRight(
'user',
'self',
'password')) {
368 if (!$user->hasRight(
'user',
'user',
'password')) {
376 $result =
$object->update($user, 0, $nosyncuser, $nosyncuserpass);
378 if ($result >= 0 && !count(
$object->errors)) {
379 $categories =
GETPOST(
'memcats',
'array');
380 $object->setCategories($categories);
383 $dir = $conf->adherent->dir_output.
'/'.
get_exdir(0, 0, 0, 1,
$object,
'member').
'/photos';
384 $file_OK = is_uploaded_file($_FILES[
'photo'][
'tmp_name']);
387 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
389 $dirthumbs = $conf->adherent->dir_output.
'/'.
get_exdir(0, 0, 0, 1,
$object,
'member').
'/photos/thumbs';
399 if (!
dol_move_uploaded_file($_FILES[
'photo'][
'tmp_name'], $newfile, 1, 0, $_FILES[
'photo'][
'error']) > 0) {
410 switch ($_FILES[
'photo'][
'error']) {
413 $errors[] =
"ErrorFileSizeTooLarge";
416 $errors[] =
"ErrorFilePartiallyUploaded";
425 if (!empty($backtopage)) {
426 header(
"Location: ".$backtopage);
441 if ($action ==
'add' && $user->hasRight(
'adherent',
'creer')) {
446 if (GETPOSTISSET(
"birthday") &&
GETPOST(
"birthday") && GETPOSTISSET(
"birthmonth") &&
GETPOST(
"birthmonth") && GETPOSTISSET(
"birthyear") &&
GETPOST(
"birthyear")) {
449 $datesubscription =
'';
450 if (GETPOSTISSET(
"reday") && GETPOSTISSET(
"remonth") && GETPOSTISSET(
"reyear")) {
455 $civility_id =
GETPOST(
"civility_id",
'alphanohtml');
456 $lastname =
GETPOST(
"lastname",
'alphanohtml');
457 $firstname =
GETPOST(
"firstname",
'alphanohtml');
458 $gender =
GETPOST(
"gender",
'alphanohtml');
459 $societe =
GETPOST(
"societe",
'alphanohtml');
460 $address =
GETPOST(
"address",
'alphanohtml');
461 $zip =
GETPOST(
"zipcode",
'alphanohtml');
462 $town =
GETPOST(
"town",
'alphanohtml');
466 $phone =
GETPOST(
"phone",
'alpha');
467 $phone_perso =
GETPOST(
"phone_perso",
'alpha');
468 $phone_mobile =
GETPOST(
"phone_mobile",
'alpha');
469 $email = preg_replace(
'/\s+/',
'',
GETPOST(
"member_email",
'aZ09arobase'));
470 $url = trim(
GETPOST(
'url',
'custom', 0, FILTER_SANITIZE_URL));
471 $login =
GETPOST(
"member_login",
'alphanohtml');
472 $pass =
GETPOST(
"password",
'password');
473 $photo =
GETPOST(
"photo",
'alphanohtml');
474 $morphy =
GETPOST(
"morphy",
'alphanohtml');
479 $default_lang =
GETPOST(
'default_lang',
'alpha');
481 $object->civility_id = $civility_id;
482 $object->firstname = $firstname;
491 $object->country_id = $country_id;
493 $object->phone_perso = $phone_perso;
494 $object->phone_mobile = $phone_mobile;
495 $object->socialnetworks = array();
496 if (isModEnabled(
'socialnetworks')) {
497 foreach ($socialnetworks as $key => $value) {
498 if (GETPOSTISSET($key) &&
GETPOST($key,
'alphanohtml') !=
'') {
499 $object->socialnetworks[$key] =
GETPOST(
"member_".$key,
'alphanohtml');
516 $object->default_lang = $default_lang;
518 $ret = $extrafields->setOptionalsFromPost(
null,
$object);
524 if (empty($morphy) || $morphy ==
"-1") {
526 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"MemberNature")),
null,
'errors');
532 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Login")),
null,
'errors');
534 $sql =
"SELECT login FROM ".MAIN_DB_PREFIX.
"adherent WHERE login='".$db->escape($login).
"'";
535 $result = $db->query($sql);
537 $num = $db->num_rows($result);
541 $langs->load(
"errors");
542 setEventMessages($langs->trans(
"ErrorLoginAlreadyExists", $login),
null,
'errors');
547 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Password")),
null,
'errors');
550 if ($morphy ==
'mor' && empty($societe)) {
552 $langs->load(
"errors");
553 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Company")),
null,
'errors');
555 if ($morphy !=
'mor' && empty($lastname)) {
557 $langs->load(
"errors");
558 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Lastname")),
null,
'errors');
560 if ($morphy !=
'mor' && (!isset($firstname) || $firstname ==
'')) {
562 $langs->load(
"errors");
563 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Firstname")),
null,
'errors');
565 if (!($typeid > 0)) {
567 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Type")),
null,
'errors');
571 $langs->load(
"errors");
575 $langs->load(
"errors");
579 if (isset($public)) {
587 $result =
$object->create($user);
590 $memcats =
GETPOST(
'memcats',
'array');
591 $object->setCategories($memcats);
598 $backtopage = preg_replace(
'/__ID__/', (
string) $id, $backtopage);
611 $result = $company->create_from_member(
$object);
613 $langs->load(
"errors");
622 $action = ($result < 0 || !$error) ?
'' :
'create';
624 if (!$error && $backtopage) {
625 header(
"Location: ".$backtopage);
630 if ($user->hasRight(
'adherent',
'supprimer') && $action ==
'confirm_delete' && $confirm ==
'yes') {
631 $result =
$object->delete($user);
634 if (!empty($backtopage) && !preg_match(
'/'.preg_quote($_SERVER[
"PHP_SELF"],
'/').
'/', $backtopage)) {
635 header(
"Location: ".$backtopage);
638 header(
"Location: list.php");
646 if ($user->hasRight(
'adherent',
'creer') && $action ==
'confirm_valid' && $confirm ==
'yes') {
654 $result =
$object->validate($user);
656 if ($result >= 0 && !count(
$object->errors)) {
663 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
667 $outputlangs->setDefaultLang(empty(
$object->thirdparty->default_lang) ? $mysoc->default_lang :
$object->thirdparty->default_lang);
669 $outputlangs->loadLangs(array(
"main",
"members",
"companies",
"install",
"other"));
671 $arraydefaultmessage =
null;
674 if (!empty($labeltouse)) {
675 $arraydefaultmessage = $formmail->getEMailTemplate($db,
'member', $user, $outputlangs, 0, 1, $labeltouse);
678 if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
679 $subject = $arraydefaultmessage->topic;
680 $msg = $arraydefaultmessage->content;
683 if (empty($labeltouse) || (
int) $labeltouse === -1) {
685 $langs->load(
"errors");
686 setEventMessages(
'<a href="'.DOL_URL_ROOT.
'/adherents/admin/member_emails.php">'.$langs->trans(
'WarningMandatorySetupNotComplete').
'</a>',
null,
'errors');
694 $moreinheader =
'X-Dolibarr-Info: send_an_email by adherents/card.php'.
"\r\n";
696 $result =
$object->sendEmail($texttosend, $subjecttosend, array(), array(), array(),
"",
"", 0, -1,
'', $moreinheader);
716 if ($user->hasRight(
'adherent',
'supprimer') && $action ==
'confirm_resiliate') {
719 if ($confirm ==
'yes') {
723 $result =
$object->resiliate($user);
725 if ($result >= 0 && !count(
$object->errors)) {
731 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
735 $outputlangs->setDefaultLang(empty(
$object->thirdparty->default_lang) ? $mysoc->default_lang :
$object->thirdparty->default_lang);
737 $outputlangs->loadLangs(array(
"main",
"members",
"companies",
"install",
"other"));
739 $arraydefaultmessage =
null;
742 if (!empty($labeltouse)) {
743 $arraydefaultmessage = $formmail->getEMailTemplate($db,
'member', $user, $outputlangs, 0, 1, $labeltouse);
746 if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
747 $subject = $arraydefaultmessage->topic;
748 $msg = $arraydefaultmessage->content;
751 if (empty($labeltouse) || (
int) $labeltouse === -1) {
761 $moreinheader =
'X-Dolibarr-Info: send_an_email by adherents/card.php'.
"\r\n";
763 $result =
$object->sendEmail($texttosend, $subjecttosend, array(), array(), array(),
"",
"", 0, -1,
'', $moreinheader);
777 if (!empty($backtopage) && !$error) {
778 header(
"Location: ".$backtopage);
783 if ($user->hasRight(
'adherent',
'supprimer') && $action ==
'confirm_exclude') {
786 if ($confirm ==
'yes') {
790 $result =
$object->exclude($user);
792 if ($result >= 0 && !count(
$object->errors)) {
798 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
802 $outputlangs->setDefaultLang(empty(
$object->thirdparty->default_lang) ? $mysoc->default_lang :
$object->thirdparty->default_lang);
804 $outputlangs->loadLangs(array(
"main",
"members",
"companies",
"install",
"other"));
806 $arraydefaultmessage =
null;
809 if (!empty($labeltouse)) {
810 $arraydefaultmessage = $formmail->getEMailTemplate($db,
'member', $user, $outputlangs, 0, 1, $labeltouse);
813 if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
814 $subject = $arraydefaultmessage->topic;
815 $msg = $arraydefaultmessage->content;
818 if (empty($labeltouse) || (
int) $labeltouse === -1) {
828 $moreinheader =
'X-Dolibarr-Info: send_an_email by adherents/card.php'.
"\r\n";
830 $result =
$object->sendEmail($texttosend, $subjecttosend, array(), array(), array(),
"",
"", 0, -1,
'', $moreinheader);
844 if (!empty($backtopage) && !$error) {
845 header(
"Location: ".$backtopage);
851 if ($user->hasRight(
'adherent',
'supprimer') && $action ==
'confirm_del_spip' && $confirm ==
'yes') {
853 if (!$mailmanspip->del_to_spip(
$object)) {
854 setEventMessages($langs->trans(
'DeleteIntoSpipError').
': '.$mailmanspip->error,
null,
'errors');
859 if ($user->hasRight(
'adherent',
'creer') && $action ==
'confirm_add_spip' && $confirm ==
'yes') {
861 if (!$mailmanspip->add_to_spip(
$object)) {
862 setEventMessages($langs->trans(
'AddIntoSpipError').
': '.$mailmanspip->error,
null,
'errors');
868 include DOL_DOCUMENT_ROOT.
'/core/actions_printing.inc.php';
871 $upload_dir = $conf->adherent->dir_output;
872 $permissiontoadd = $user->hasRight(
'adherent',
'creer');
873 include DOL_DOCUMENT_ROOT.
'/core/actions_builddoc.inc.php';
876 $triggersendname =
'MEMBER_SENTBYMAIL';
878 $mode =
'emailfrommember';
879 $trackid =
'mem'.$object->id;
880 include DOL_DOCUMENT_ROOT.
'/core/actions_sendmails.inc.php';
888$form =
new Form($db);
893$title = $langs->trans(
"Member").
" - ".$langs->trans(
"Card");
894$help_url =
'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder';
896llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'mod-member page-card');
898$countrynotdefined = $langs->trans(
"ErrorSetACountryFirst").
' ('.$langs->trans(
"SeeAbove").
')';
900if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
904 if (empty(
$object->error) && $id) {
912 $objcanvas->display_canvas($action);
919 if ($action ==
'create') {
927 $object->country_code = $tmparray[
'code'];
928 $object->country = $tmparray[
'label'];
932 if (!empty($socid)) {
937 if (!($soc->id > 0)) {
938 $langs->load(
"errors");
939 print($langs->trans(
'ErrorRecordNotFound'));
948 if ($conf->use_javascript_ajax) {
949 print
"\n".
'<script type="text/javascript">'.
"\n";
950 print
'jQuery(document).ready(function () {
951 jQuery("#selectcountry_id").change(function() {
952 document.formsoc.action.value="create";
953 document.formsoc.submit();
955 function initfieldrequired() {
956 jQuery("#tdcompany").removeClass("fieldrequired");
957 jQuery("#tdlastname").removeClass("fieldrequired");
958 jQuery("#tdfirstname").removeClass("fieldrequired");
959 if (jQuery("#morphy").val() == \'mor\') {
960 jQuery("#tdcompany").addClass("fieldrequired");
962 if (jQuery("#morphy").val() == \'phy\') {
963 jQuery("#tdlastname").addClass("fieldrequired");
964 jQuery("#tdfirstname").addClass("fieldrequired");
967 jQuery("#morphy").change(function() {
972 print
'</script>'.
"\n";
975 print
'<form name="formsoc" action="'.$_SERVER[
"PHP_SELF"].
'" method="post" enctype="multipart/form-data">';
976 print
'<input type="hidden" name="token" value="'.newToken().
'">';
977 print
'<input type="hidden" name="action" value="add">';
978 print
'<input type="hidden" name="socid" value="'.$socid.
'">';
980 print
'<input type="hidden" name="backtopage" value="'.($backtopage !=
'1' ? $backtopage : $_SERVER[
"HTTP_REFERER"]).
'">';
985 print
'<table class="border centpercent">';
990 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>';
995 require_once DOL_DOCUMENT_ROOT.
'/core/lib/security2.lib.php';
997 print
'<tr><td><span class="fieldrequired">'.$langs->trans(
"Password").
'</span></td><td>';
998 print
'<input type="text" class="minwidth300" maxlength="50" name="password" value="'.dol_escape_htmltag($generated_password).
'">';
1003 print
'<tr><td class="fieldrequired">'.$langs->trans(
"MemberType").
'</td><td>';
1004 $listetype = $adht->liste_array(1);
1005 print
img_picto(
'', $adht->picto,
'class="pictofixedwidth"');
1006 if (count($listetype)) {
1007 print $form->selectarray(
"typeid", $listetype, (
GETPOSTINT(
'typeid') ?
GETPOSTINT(
'typeid') : $typeid), (count($listetype) > 1 ? 1 : 0), 0, 0,
'', 0, 0, 0,
'',
'minwidth200', 1);
1009 print
'<span class="error">'.$langs->trans(
"NoTypeDefinedGoToSetup").
'</span>';
1011 if ($user->hasRight(
'member',
'configurer')) {
1012 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>';
1018 $morphys[
"phy"] = $langs->trans(
"Physical");
1019 $morphys[
"mor"] = $langs->trans(
"Moral");
1020 print
'<tr><td class="fieldrequired">'.$langs->trans(
"MemberNature").
"</td><td>\n";
1021 print $form->selectarray(
"morphy", $morphys, (
GETPOST(
'morphy',
'alpha') ?
GETPOST(
'morphy',
'alpha') :
$object->morphy), 1, 0, 0,
'', 0, 0, 0,
'',
'minwidth200', 1);
1025 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>';
1028 print
'<tr><td>'.$langs->trans(
"UserTitle").
'</td><td>';
1029 print $formcompany->select_civility(
GETPOSTINT(
'civility_id') ?
GETPOSTINT(
'civility_id') :
$object->civility_id,
'civility_id',
'maxwidth150', 1).
'</td>';
1033 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>';
1037 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>';
1041 print
'<tr><td>'.$langs->trans(
"Gender").
'</td>';
1043 $arraygender = array(
'man' => $langs->trans(
"Genderman"),
'woman' => $langs->trans(
"Genderwoman"),
'other' => $langs->trans(
"Genderother"));
1044 print $form->selectarray(
'gender', $arraygender,
GETPOST(
'gender',
'alphanohtml'), 1, 0, 0,
'', 0, 0, 0,
'',
'minwidth100', 1);
1048 print
'<tr><td>'.(getDolGlobalString(
'ADHERENT_MAIL_REQUIRED') ?
'<span class="fieldrequired">' :
'').$langs->trans(
"EMail").(getDolGlobalString(
'ADHERENT_MAIL_REQUIRED') ?
'</span>' :
'').
'</td>';
1049 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>';
1052 print
'<tr><td>'.$form->editfieldkey(
'Web',
'member_url',
GETPOST(
'member_url',
'alpha'),
$object, 0).
'</td>';
1053 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>';
1056 print
'<tr><td class="tdtop">'.$langs->trans(
"Address").
'</td><td>';
1057 print
'<textarea name="address" wrap="soft" class="quatrevingtpercent" rows="2">'.(GETPOSTISSET(
'address') ?
GETPOST(
'address',
'alphanohtml') : $soc->address).
'</textarea>';
1061 print
'<tr><td>'.$langs->trans(
"Zip").
' / '.$langs->trans(
"Town").
'</td><td>';
1062 print $formcompany->select_ziptown((GETPOSTISSET(
'zipcode') ?
GETPOST(
'zipcode',
'alphanohtml') : $soc->zip),
'zipcode', array(
'town',
'selectcountry_id',
'state_id'), 6);
1064 print $formcompany->select_ziptown((GETPOSTISSET(
'town') ?
GETPOST(
'town',
'alphanohtml') : $soc->town),
'town', array(
'zipcode',
'selectcountry_id',
'state_id'));
1068 if (empty($soc->country_id)) {
1069 $soc->country_id = $mysoc->country_id;
1070 $soc->country_code = $mysoc->country_code;
1071 $soc->state_id = $mysoc->state_id;
1073 print
'<tr><td>'.$langs->trans(
'Country').
'</td><td>';
1074 print
img_picto(
'',
'country',
'class="pictofixedwidth"');
1075 print $form->select_country(GETPOSTISSET(
'country_id') ?
GETPOST(
'country_id',
'alpha') : $soc->country_id,
'country_id');
1077 print
info_admin($langs->trans(
"YouCanChangeValuesForThisListFromDictionarySetup"), 1);
1083 print
'<tr><td>'.$langs->trans(
'State').
'</td><td>';
1084 if ($soc->country_id) {
1085 print
img_picto(
'',
'state',
'class="pictofixedwidth"');
1086 print $formcompany->select_state(GETPOSTISSET(
'state_id') ?
GETPOSTINT(
'state_id') : $soc->state_id, $soc->country_code);
1088 print $countrynotdefined;
1094 print
'<tr><td>'.$langs->trans(
"PhonePro").
'</td>';
1095 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>';
1098 print
'<tr><td>'.$langs->trans(
"PhonePerso").
'</td>';
1099 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>';
1102 print
'<tr><td>'.$langs->trans(
"PhoneMobile").
'</td>';
1103 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>';
1105 if (isModEnabled(
'socialnetworks')) {
1106 foreach ($socialnetworks as $key => $value) {
1107 if (!$value[
'active']) {
1110 $val = (GETPOSTISSET(
'member_'.$key) ?
GETPOST(
'member_'.$key,
'alpha') : (empty(
$object->socialnetworks[$key]) ?
'' :
$object->socialnetworks[$key]));
1111 print
'<tr><td>'.$langs->trans($value[
'label']).
'</td><td><input type="text" name="member_'.$key.
'" size="40" value="'.$val.
'"></td></tr>';
1116 print
"<tr><td>".$langs->trans(
"DateOfBirth").
"</td><td>\n";
1117 print
img_picto(
'',
'object_calendar',
'class="pictofixedwidth"').$form->selectDate((
$object->birth ?
$object->birth : -1),
'birth', 0, 0, 1,
'formsoc');
1118 print
"</td></tr>\n";
1122 $htmltext = $langs->trans(
"Public",
getDolGlobalString(
'MAIN_INFO_SOCIETE_NOM'), $linkofpubliclist);
1123 print $form->textwithpicto($langs->trans(
"MembershipPublic"), $htmltext, 1,
'help',
'', 0, 3,
'membershippublic');
1124 print
"</td><td>\n";
1125 print $form->selectyesno(
"public",
$object->public, 1,
false, 0, 1);
1126 print
"</td></tr>\n";
1129 if (isModEnabled(
'category') && $user->hasRight(
'categorie',
'lire')) {
1130 print
'<tr><td>'.$form->editfieldkey(
"Categories",
'memcats',
'',
$object, 0).
'</td><td>';
1131 $cate_arbo = $form->select_all_categories(Categorie::TYPE_MEMBER,
'',
'parent', 64, 0, 3);
1132 print
img_picto(
'',
'category').$form->multiselectarray(
'memcats', $cate_arbo,
GETPOST(
'memcats',
'array'), 0, 0,
'quatrevingtpercent widthcentpercentminusx', 0, 0);
1137 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_add.tpl.php';
1144 print $form->buttonsSaveCancel(
"AddMember");
1150 if ($action ==
'edit') {
1156 $res =
$object->fetch_optionals();
1163 $adht->fetch(
$object->typeid);
1167 if (!empty($country) ||
$object->country_id) {
1168 $sql =
"SELECT rowid, code, label from ".MAIN_DB_PREFIX.
"c_country";
1169 $sql .=
" WHERE rowid = ".(int) (!empty($country) ? $country :
$object->country_id);
1170 $resql = $db->query($sql);
1172 $obj = $db->fetch_object($resql);
1176 $object->country_id = $obj->rowid;
1177 $object->country_code = $obj->code;
1178 $object->country = $langs->trans(
"Country".$obj->code) ? $langs->trans(
"Country".$obj->code) : $obj->label;
1184 if ($conf->use_javascript_ajax) {
1185 print
"\n".
'<script type="text/javascript">';
1186 print
'jQuery(document).ready(function () {
1187 jQuery("#selectcountry_id").change(function() {
1188 document.formsoc.action.value="edit";
1189 document.formsoc.submit();
1191 function initfieldrequired() {
1192 jQuery("#tdcompany").removeClass("fieldrequired");
1193 jQuery("#tdlastname").removeClass("fieldrequired");
1194 jQuery("#tdfirstname").removeClass("fieldrequired");
1195 if (jQuery("#morphy").val() == \'mor\') {
1196 jQuery("#tdcompany").addClass("fieldrequired");
1198 if (jQuery("#morphy").val() == \'phy\') {
1199 jQuery("#tdlastname").addClass("fieldrequired");
1200 jQuery("#tdfirstname").addClass("fieldrequired");
1203 jQuery("#morphy").change(function() {
1204 initfieldrequired();
1206 initfieldrequired();
1208 print
'</script>'.
"\n";
1211 print
'<form name="formsoc" action="'.$_SERVER[
"PHP_SELF"].
'" method="post" enctype="multipart/form-data">';
1212 print
'<input type="hidden" name="token" value="'.newToken().
'" />';
1213 print
'<input type="hidden" name="action" value="update" />';
1214 print
'<input type="hidden" name="rowid" value="'.$id.
'" />';
1215 print
'<input type="hidden" name="statut" value="'.$object->status.
'" />';
1217 print
'<input type="hidden" name="backtopage" value="'.($backtopage !=
'1' ? $backtopage : $_SERVER[
"HTTP_REFERER"]).
'">';
1222 print
'<table class="border centpercent">';
1225 print
'<tr><td class="titlefieldcreate">'.$langs->trans(
"Ref").
'</td><td class="valeur">'.
$object->ref.
'</td></tr>';
1229 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>';
1234 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Password").
'</td><td><input type="password" name="pass" class="minwidth300" maxlength="50" value="'.
dol_escape_htmltag(GETPOSTISSET(
"pass") ?
GETPOST(
"pass",
'password', 2) :
'').
'"></td></tr>';
1238 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Type").
'</td><td>';
1239 if ($user->hasRight(
'adherent',
'creer')) {
1240 print $form->selectarray(
"typeid", $adht->liste_array(), (GETPOSTISSET(
"typeid") ?
GETPOSTINT(
"typeid") :
$object->typeid), 0, 0, 0,
'', 0, 0, 0,
'',
'minwidth200', 1);
1242 print $adht->getNomUrl(1);
1243 print
'<input type="hidden" name="typeid" value="'.$object->typeid.
'">';
1248 $morphys[
"phy"] = $langs->trans(
"Physical");
1249 $morphys[
"mor"] = $langs->trans(
"Moral");
1250 print
'<tr><td><span class="fieldrequired">'.$langs->trans(
"MemberNature").
'</span></td><td>';
1251 print $form->selectarray(
"morphy", $morphys, (GETPOSTISSET(
"morphy") ?
GETPOST(
"morphy",
'alpha') :
$object->morphy), 0, 0, 0,
'', 0, 0, 0,
'',
'minwidth200', 1);
1255 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>';
1258 print
'<tr><td>'.$langs->trans(
"UserTitle").
'</td><td>';
1259 print $formcompany->select_civility(GETPOSTISSET(
"civility_id") ?
GETPOST(
"civility_id",
'alpha') :
$object->civility_id,
'civility_id',
'maxwidth150', 1);
1264 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>';
1268 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>';
1272 print
'<tr><td>'.$langs->trans(
"Gender").
'</td>';
1274 $arraygender = array(
'man' => $langs->trans(
"Genderman"),
'woman' => $langs->trans(
"Genderwoman"),
'other' => $langs->trans(
"Genderother"));
1275 print $form->selectarray(
'gender', $arraygender, GETPOSTISSET(
'gender') ?
GETPOST(
'gender',
'alphanohtml') :
$object->gender, 1, 0, 0,
'', 0, 0, 0,
'',
'minwidth100', 1);
1279 print
'<tr><td>'.$langs->trans(
"Photo").
'</td>';
1280 print
'<td class="hideonsmartphone" valign="middle">';
1281 print $form->showphoto(
'memberphoto',
$object).
"\n";
1282 if ($caneditfieldmember) {
1286 print
'<table class="nobordernopadding">';
1288 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>';
1292 $maxmin = $maxfilesizearray[
'maxmin'];
1294 print
'<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).
'">';
1296 print
'<input type="file" class="flat" name="photo" id="photoinput">';
1303 print
'<tr><td>'.(getDolGlobalString(
"ADHERENT_MAIL_REQUIRED") ?
'<span class="fieldrequired">' :
'').$langs->trans(
"EMail").(getDolGlobalString(
"ADHERENT_MAIL_REQUIRED") ?
'</span>' :
'').
'</td>';
1304 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>';
1307 print
'<tr><td>'.$form->editfieldkey(
'Web',
'member_url',
GETPOST(
'member_url',
'alpha'),
$object, 0).
'</td>';
1308 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>';
1311 print
'<tr><td>'.$langs->trans(
"Address").
'</td><td>';
1312 print
'<textarea name="address" wrap="soft" class="quatrevingtpercent" rows="'.ROWS_2.
'">'.(GETPOSTISSET(
"address") ?
GETPOST(
"address",
'alphanohtml', 2) :
$object->address).
'</textarea>';
1316 print
'<tr><td>'.$langs->trans(
"Zip").
' / '.$langs->trans(
"Town").
'</td><td>';
1317 print $formcompany->select_ziptown((GETPOSTISSET(
"zipcode") ?
GETPOST(
"zipcode",
'alphanohtml', 2) :
$object->zip),
'zipcode', array(
'town',
'selectcountry_id',
'state_id'), 6);
1319 print $formcompany->select_ziptown((GETPOSTISSET(
"town") ?
GETPOST(
"town",
'alphanohtml', 2) :
$object->town),
'town', array(
'zipcode',
'selectcountry_id',
'state_id'));
1324 print
'<tr><td>'.$langs->trans(
'Country').
'</td><td>';
1325 print
img_picto(
'',
'country',
'class="pictofixedwidth"');
1326 print $form->select_country(GETPOSTISSET(
"country_id") ?
GETPOST(
"country_id",
"alpha") :
$object->country_id,
'country_id');
1328 print
info_admin($langs->trans(
"YouCanChangeValuesForThisListFromDictionarySetup"), 1);
1334 print
'<tr><td>'.$langs->trans(
'State').
'</td><td>';
1335 print
img_picto(
'',
'state',
'class="pictofixedwidth"');
1336 print $formcompany->select_state(
$object->state_id, GETPOSTISSET(
"country_id") ?
GETPOST(
"country_id",
"alpha") :
$object->country_id);
1341 print
'<tr><td>'.$langs->trans(
"PhonePro").
'</td>';
1342 print
'<td>'.img_picto(
'',
'object_phoning',
'class="pictofixedwidth"').
'<input type="text" name="phone" value="'.(GETPOSTISSET(
"phone") ?
GETPOST(
"phone") :
$object->phone).
'"></td></tr>';
1345 print
'<tr><td>'.$langs->trans(
"PhonePerso").
'</td>';
1346 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>';
1349 print
'<tr><td>'.$langs->trans(
"PhoneMobile").
'</td>';
1350 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>';
1352 if (isModEnabled(
'socialnetworks')) {
1353 foreach ($socialnetworks as $key => $value) {
1354 if (!$value[
'active']) {
1357 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>';
1362 print
"<tr><td>".$langs->trans(
"DateOfBirth").
"</td><td>\n";
1363 print
img_picto(
'',
'object_calendar',
'class="pictofixedwidth"').$form->selectDate((
$object->birth ?
$object->birth : -1),
'birth', 0, 0, 1,
'formsoc');
1364 print
"</td></tr>\n";
1368 print
'<tr><td>'.$form->editfieldkey(
'DefaultLang',
'default_lang',
'',
$object, 0).
'</td><td colspan="3">'.
"\n";
1369 print
img_picto(
'',
'language',
'class="pictofixedwidth"').$formadmin->select_language(
$object->default_lang,
'default_lang', 0, 0, 1);
1376 $htmltext = $langs->trans(
"Public",
getDolGlobalString(
'MAIN_INFO_SOCIETE_NOM'), $linkofpubliclist);
1377 print $form->textwithpicto($langs->trans(
"MembershipPublic"), $htmltext, 1,
'help',
'', 0, 3,
'membershippublic');
1378 print
"</td><td>\n";
1379 print $form->selectyesno(
"public", (GETPOSTISSET(
"public") ?
GETPOST(
"public",
'alphanohtml', 2) :
$object->public), 1, false, 0, 1);
1380 print
"</td></tr>\n";
1383 if (isModEnabled(
'category') && $user->hasRight(
'categorie',
'lire')) {
1384 print
'<tr><td>'.$form->editfieldkey(
"Categories",
'memcats',
'',
$object, 0).
'</td>';
1386 $cate_arbo = $form->select_all_categories(Categorie::TYPE_MEMBER,
'',
'', 64, 0, 3);
1388 $cats = $c->containing(
$object->id, Categorie::TYPE_MEMBER);
1389 $arrayselected = array();
1390 if (is_array($cats)) {
1391 foreach ($cats as $cat) {
1392 $arrayselected[] = $cat->id;
1395 print
img_picto(
'',
'category',
'class="pictofixedwidth"');
1396 print $form->multiselectarray(
'memcats', $cate_arbo, $arrayselected, 0, 0,
'widthcentpercentminusx', 0,
'100%');
1401 if (isModEnabled(
'societe')) {
1402 print
'<tr><td>'.$langs->trans(
"LinkedToDolibarrThirdParty").
'</td><td colspan="2" class="valeur">';
1405 $result = $company->fetch(
$object->socid);
1406 print $company->getNomUrl(1);
1408 print $langs->trans(
"NoThirdPartyAssociatedToMember");
1414 print
'<tr><td>'.$langs->trans(
"LinkedToDolibarrUser").
'</td><td colspan="2" class="valeur">';
1416 $form->form_users($_SERVER[
'PHP_SELF'].
'?rowid='.
$object->id,
$object->user_id,
'none');
1418 print $langs->trans(
"NoDolibarrAccess");
1423 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_edit.tpl.php';
1428 print $form->buttonsSaveCancel(
"Save",
'Cancel');
1434 if ($id > 0 && $action !=
'edit') {
1440 $res =
$object->fetch_optionals();
1447 $res = $adht->fetch(
$object->typeid);
1459 print
dol_get_fiche_head($head,
'general', $langs->trans(
"Member"), -1,
'user', 0,
'',
'', 0,
'', 1);
1462 if ($action ==
'create_user') {
1463 $login = (GETPOSTISSET(
'login') ?
GETPOST(
'login',
'alphanohtml') :
$object->login);
1464 if (empty($login)) {
1466 include_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
1469 if (empty($login)) {
1470 $login = strtolower(substr(
$object->firstname, 0, 4)).strtolower(substr(
$object->lastname, 0, 4));
1474 $formquestion = array(
1475 array(
'label' => $langs->trans(
"LoginToCreate"),
'type' =>
'text',
'name' =>
'login',
'value' => $login)
1477 if (isModEnabled(
'societe') &&
$object->socid > 0) {
1479 $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")));
1482 if (isModEnabled(
'societe') &&
$object->socid <= 0) {
1483 $text .= $langs->trans(
"UserWillBeInternalUser").
'<br>';
1485 $text .= $langs->trans(
"ConfirmCreateLogin");
1486 print $form->formconfirm($_SERVER[
"PHP_SELF"].
"?rowid=".
$object->id, $langs->trans(
"CreateDolibarrLogin"), $text,
"confirm_create_user", $formquestion,
'yes');
1490 if ($action ==
'create_thirdparty') {
1492 $fullname =
$object->getFullName($langs);
1494 if (
$object->morphy ==
'mor') {
1495 $companyname =
$object->company;
1496 if (!empty($fullname)) {
1497 $companyalias = $fullname;
1500 $companyname = $fullname;
1501 if (!empty(
$object->company)) {
1502 $companyalias =
$object->company;
1507 $formquestion = array(
1508 array(
'label' => $langs->trans(
"NameToCreate"),
'type' =>
'text',
'name' =>
'companyname',
'value' => $companyname,
'morecss' =>
'minwidth300',
'moreattr' =>
'maxlength="128"'),
1509 array(
'label' => $langs->trans(
"AliasNames"),
'type' =>
'text',
'name' =>
'companyalias',
'value' => $companyalias,
'morecss' =>
'minwidth300',
'moreattr' =>
'maxlength="128"')
1512 print $form->formconfirm($_SERVER[
"PHP_SELF"].
"?rowid=".
$object->id, $langs->trans(
"CreateDolibarrThirdParty"), $langs->trans(
"ConfirmCreateThirdParty"),
"confirm_create_thirdparty", $formquestion,
'yes');
1516 if ($action ==
'valid') {
1517 $langs->load(
"mails");
1520 $adht->fetch(
$object->typeid);
1526 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
1529 $outputlangs =
new Translate(
'', $conf);
1530 $outputlangs->setDefaultLang(empty(
$object->thirdparty->default_lang) ? $mysoc->default_lang :
$object->thirdparty->default_lang);
1532 $outputlangs->loadLangs(array(
"main",
"members",
"companies",
"install",
"other"));
1534 $arraydefaultmessage =
null;
1537 if (!empty($labeltouse)) {
1538 $arraydefaultmessage = $formmail->getEMailTemplate($db,
'member', $user, $outputlangs, 0, 1, $labeltouse);
1541 if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
1542 $subject = $arraydefaultmessage->topic;
1543 $msg = $arraydefaultmessage->content;
1551 $tmp = $langs->trans(
"SendingAnEMailToMember");
1552 $tmp .=
'<br>'.$langs->trans(
"MailFrom").
': <b>'.
getDolGlobalString(
'ADHERENT_MAIL_FROM').
'</b>, ';
1553 $tmp .=
'<br>'.$langs->trans(
"MailRecipient").
': <b>'.
$object->email.
'</b>';
1555 $helpcontent .=
'<b>'.$langs->trans(
"MailFrom").
'</b>: '.
getDolGlobalString(
'ADHERENT_MAIL_FROM').
'<br>'.
"\n";
1556 $helpcontent .=
'<b>'.$langs->trans(
"MailRecipient").
'</b>: '.
$object->email.
'<br>'.
"\n";
1557 $helpcontent .=
'<b>'.$langs->trans(
"Subject").
'</b>:<br>'.
"\n";
1558 $helpcontent .= $subjecttosend.
"\n";
1559 $helpcontent .=
"<br>";
1560 $helpcontent .=
'<b>'.$langs->trans(
"Content").
'</b>:<br>';
1563 $label = $form->textwithpicto($tmp, $helpcontent, 1,
'help');
1566 $formquestion = array();
1568 $formquestion[] = array(
'type' =>
'checkbox',
'name' =>
'send_mail',
'label' => $label,
'value' => (
getDolGlobalString(
'ADHERENT_DEFAULT_SENDINFOBYMAIL') ?
true : false));
1571 $formquestion[] = array(
'type' =>
'other',
'label' => $langs->transnoentitiesnoconv(
"SynchroMailManEnabled"),
'value' =>
'');
1574 $formquestion[] = array(
'type' =>
'other',
'label' => $langs->transnoentitiesnoconv(
"SynchroSpipEnabled"),
'value' =>
'');
1576 print $form->formconfirm(
"card.php?rowid=".$id, $langs->trans(
"ValidateMember"), $langs->trans(
"ConfirmValidateMember"),
"confirm_valid", $formquestion,
'yes', 1, 220);
1580 if ($action ==
'resiliate') {
1581 $langs->load(
"mails");
1584 $adht->fetch(
$object->typeid);
1590 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
1593 $outputlangs =
new Translate(
'', $conf);
1594 $outputlangs->setDefaultLang(empty(
$object->thirdparty->default_lang) ? $mysoc->default_lang :
$object->thirdparty->default_lang);
1596 $outputlangs->loadLangs(array(
"main",
"members"));
1598 $arraydefaultmessage =
null;
1601 if (!empty($labeltouse)) {
1602 $arraydefaultmessage = $formmail->getEMailTemplate($db,
'member', $user, $outputlangs, 0, 1, $labeltouse);
1605 if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
1606 $subject = $arraydefaultmessage->topic;
1607 $msg = $arraydefaultmessage->content;
1615 $tmp = $langs->trans(
"SendingAnEMailToMember");
1616 $tmp .=
'<br>('.$langs->trans(
"MailFrom").
': <b>'.
getDolGlobalString(
'ADHERENT_MAIL_FROM').
'</b>, ';
1617 $tmp .= $langs->trans(
"MailRecipient").
': <b>'.
$object->email.
'</b>)';
1619 $helpcontent .=
'<b>'.$langs->trans(
"MailFrom").
'</b>: '.
getDolGlobalString(
'ADHERENT_MAIL_FROM').
'<br>'.
"\n";
1620 $helpcontent .=
'<b>'.$langs->trans(
"MailRecipient").
'</b>: '.
$object->email.
'<br>'.
"\n";
1621 $helpcontent .=
'<b>'.$langs->trans(
"Subject").
'</b>:<br>'.
"\n";
1622 $helpcontent .= $subjecttosend.
"\n";
1623 $helpcontent .=
"<br>";
1624 $helpcontent .=
'<b>'.$langs->trans(
"Content").
'</b>:<br>';
1627 $label = $form->textwithpicto($tmp, $helpcontent, 1,
'help');
1630 $formquestion = array();
1632 $formquestion[] = array(
'type' =>
'checkbox',
'name' =>
'send_mail',
'label' => $label,
'value' => (
getDolGlobalString(
'ADHERENT_DEFAULT_SENDINFOBYMAIL') ?
'true' :
'false'));
1635 $formquestion[] = array(
'type' =>
'hidden',
'name' =>
'backtopage',
'value' => ($backtopage !=
'1' ? $backtopage : $_SERVER[
"HTTP_REFERER"]));
1637 print $form->formconfirm(
"card.php?rowid=".$id, $langs->trans(
"ResiliateMember"), $langs->trans(
"ConfirmResiliateMember"),
"confirm_resiliate", $formquestion,
'no', 1, 240);
1641 if ($action ==
'exclude') {
1642 $langs->load(
"mails");
1645 $adht->fetch(
$object->typeid);
1651 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
1654 $outputlangs =
new Translate(
'', $conf);
1655 $outputlangs->setDefaultLang(empty(
$object->thirdparty->default_lang) ? $mysoc->default_lang :
$object->thirdparty->default_lang);
1657 $outputlangs->loadLangs(array(
"main",
"members"));
1659 $arraydefaultmessage =
null;
1662 if (!empty($labeltouse)) {
1663 $arraydefaultmessage = $formmail->getEMailTemplate($db,
'member', $user, $outputlangs, 0, 1, $labeltouse);
1666 if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
1667 $subject = $arraydefaultmessage->topic;
1668 $msg = $arraydefaultmessage->content;
1676 $tmp = $langs->trans(
"SendingAnEMailToMember");
1677 $tmp .=
'<br>('.$langs->trans(
"MailFrom").
': <b>'.
getDolGlobalString(
'ADHERENT_MAIL_FROM').
'</b>, ';
1678 $tmp .= $langs->trans(
"MailRecipient").
': <b>'.
$object->email.
'</b>)';
1680 $helpcontent .=
'<b>'.$langs->trans(
"MailFrom").
'</b>: '.
getDolGlobalString(
'ADHERENT_MAIL_FROM').
'<br>'.
"\n";
1681 $helpcontent .=
'<b>'.$langs->trans(
"MailRecipient").
'</b>: '.
$object->email.
'<br>'.
"\n";
1682 $helpcontent .=
'<b>'.$langs->trans(
"Subject").
'</b>:<br>'.
"\n";
1683 $helpcontent .= $subjecttosend.
"\n";
1684 $helpcontent .=
"<br>";
1685 $helpcontent .=
'<b>'.$langs->trans(
"Content").
'</b>:<br>';
1688 $label = $form->textwithpicto($tmp, $helpcontent, 1,
'help');
1691 $formquestion = array();
1693 $formquestion[] = array(
'type' =>
'checkbox',
'name' =>
'send_mail',
'label' => $label,
'value' => (
getDolGlobalString(
'ADHERENT_DEFAULT_SENDINFOBYMAIL') ?
'true' :
'false'));
1696 $formquestion[] = array(
'type' =>
'hidden',
'name' =>
'backtopage',
'value' => ($backtopage !=
'1' ? $backtopage : $_SERVER[
"HTTP_REFERER"]));
1698 print $form->formconfirm(
"card.php?rowid=".$id, $langs->trans(
"ExcludeMember"), $langs->trans(
"ConfirmExcludeMember"),
"confirm_exclude", $formquestion,
'no', 1, 240);
1702 if ($action ==
'delete') {
1703 $formquestion = array();
1705 $formquestion[] = array(
'type' =>
'hidden',
'name' =>
'backtopage',
'value' => ($backtopage !=
'1' ? $backtopage : $_SERVER[
"HTTP_REFERER"]));
1707 print $form->formconfirm(
"card.php?rowid=".$id, $langs->trans(
"DeleteMember"), $langs->trans(
"ConfirmDeleteMember"),
"confirm_delete", $formquestion,
'no', 1);
1711 if ($action ==
'add_spip') {
1712 print $form->formconfirm(
"card.php?rowid=".$id, $langs->trans(
'AddIntoSpip'), $langs->trans(
'AddIntoSpipConfirmation'),
'confirm_add_spip');
1715 if ($action ==
'del_spip') {
1716 print $form->formconfirm(
"card.php?rowid=$id", $langs->trans(
'DeleteIntoSpip'), $langs->trans(
'DeleteIntoSpipConfirmation'),
'confirm_del_spip');
1723 if (isModEnabled(
'societe')) {
1727 $linkback =
'<a href="'.DOL_URL_ROOT.
'/adherents/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
1729 $morehtmlref =
'<a href="'.DOL_URL_ROOT.
'/adherents/vcard.php?id='.
$object->id.
'" class="refid">';
1730 $morehtmlref .=
img_picto($langs->trans(
"Download").
' '.$langs->trans(
"VCard"),
'vcard.png',
'class="valignmiddle marginleftonly paddingrightonly"');
1731 $morehtmlref .=
'</a>';
1734 dol_banner_tab(
$object,
'rowid', $linkback, 1,
'rowid',
'ref', $morehtmlref);
1736 print
'<div class="fichecenter">';
1737 print
'<div class="fichehalfleft">';
1739 print
'<div class="underbanner clearboth"></div>';
1740 print
'<table class="border tableforfield centpercent">';
1744 print
'<tr><td class="titlefield">'.$langs->trans(
"Login").
' / '.$langs->trans(
"Id").
'</td><td class="valeur">'.
dol_escape_htmltag(
$object->login).
'</td></tr>';
1748 print
'<tr><td class="titlefield">'.$langs->trans(
"Type").
'</td>';
1749 print
'<td class="valeur">'.$adht->getNomUrl(1).
"</td></tr>\n";
1752 print
'<tr><td>'.$langs->trans(
"MemberNature").
'</td>';
1753 print
'<td class="valeur" >'.$object->getmorphylib(
'', 1).
'</td>';
1760 print
'<tr><td>'.$langs->trans(
"UserTitle").
'</td><td class="valeur">'.
$object->getCivilityLabel().
'</td>';
1765 print
'<tr><td>'.$langs->trans(
"Password").
'</td><td>';
1767 print preg_replace(
'/./i',
'*',
$object->pass);
1770 print
'<!-- '.$langs->trans(
"Crypted").
': '.
$object->pass_indatabase_crypted.
' -->';
1772 print
'<span class="opacitymedium">'.$langs->trans(
"Hidden").
'</span>';
1774 if (!empty(
$object->pass_indatabase) && empty(
$object->user_id)) {
1775 $langs->load(
"errors");
1776 $htmltext = $langs->trans(
"WarningPasswordSetWithNoAccount");
1777 print
' '.$form->textwithpicto(
'', $htmltext, 1,
'warning');
1783 print
'<tr><td>'.$langs->trans(
"SubscriptionEndDate").
'</td><td class="valeur">';
1787 print
" ".img_warning($langs->trans(
"Late"));
1790 if (
$object->need_subscription == 0) {
1791 print $langs->trans(
"SubscriptionNotNeeded");
1792 } elseif (!$adht->subscription) {
1793 print $langs->trans(
"SubscriptionNotRecorded");
1795 print
" ".img_warning($langs->trans(
"Late"));
1798 print $langs->trans(
"SubscriptionNotReceived");
1800 print
" ".img_warning($langs->trans(
"Late"));
1810 print
'<div class="fichehalfright">';
1811 print
'<div class="underbanner clearboth"></div>';
1813 print
'<table class="border tableforfield centpercent">';
1816 if (isModEnabled(
'category') && $user->hasRight(
'categorie',
'lire')) {
1817 print
'<tr><td>'.$langs->trans(
"Categories").
'</td>';
1818 print
'<td colspan="2">';
1819 print $form->showCategories(
$object->id, Categorie::TYPE_MEMBER, 1);
1824 print
'<tr><td class="titlefield">'.$langs->trans(
"DateOfBirth").
'</td><td class="valeur">'.
dol_print_date(
$object->birth,
'day').
'</td></tr>';
1828 require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
1829 print
'<tr><td>'.$langs->trans(
"DefaultLang").
'</td><td>';
1832 $langs->load(
"languages");
1833 $labellang = (
$object->default_lang ? $langs->trans(
'Language_'.
$object->default_lang) :
'');
1841 $htmltext = $langs->trans(
"Public",
getDolGlobalString(
'MAIN_INFO_SOCIETE_NOM'), $linkofpubliclist);
1842 print $form->textwithpicto($langs->trans(
"MembershipPublic"), $htmltext, 1,
'help',
'', 0, 3,
'membershippublic');
1843 print
'</td><td class="valeur">'.yn(
$object->public).
'</td></tr>';
1846 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
1849 if (isModEnabled(
'societe')) {
1851 $editenable = $user->hasRight(
'adherent',
'creer');
1852 print $form->editfieldkey(
'LinkedToDolibarrThirdParty',
'thirdparty',
'',
$object, $editenable);
1853 print
'</td><td colspan="2" class="valeur">';
1854 if ($action ==
'editthirdparty') {
1855 $htmlname =
'socid';
1856 print
'<form method="POST" action="'.$_SERVER[
'PHP_SELF'].
'" name="form'.$htmlname.
'">';
1857 print
'<input type="hidden" name="rowid" value="'.$object->id.
'">';
1858 print
'<input type="hidden" name="action" value="set'.$htmlname.
'">';
1859 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1860 print
'<table class="nobordernopadding">';
1862 print $form->select_company(
$object->socid,
'socid',
'', 1);
1864 print
'<td class="left"><input type="submit" class="button button-edit smallpaddingimp" value="'.$langs->trans(
"Modify").
'"></td>';
1865 print
'</tr></table></form>';
1869 $result = $company->fetch(
$object->socid);
1870 print $company->getNomUrl(1);
1873 $tmparray = $company->getOutstandingBills(
'customer');
1874 if (!empty($tmparray[
'refs'])) {
1875 print
' - '.img_picto($langs->trans(
"Invoices"),
'bill',
'class="paddingright"').
'<a href="'.DOL_URL_ROOT.
'/compta/facture/list.php?socid='.
$object->socid.
'">'.$langs->trans(
"Invoices").
' ('.count($tmparray[
'refs']).
')';
1880 print
'<span class="opacitymedium">'.$langs->trans(
"NoThirdPartyAssociatedToMember").
'</span>';
1888 $editenable = $user->hasRight(
'adherent',
'creer') && $user->hasRight(
'user',
'user',
'creer');
1889 print $form->editfieldkey(
'LinkedToDolibarrUser',
'login',
'',
$object, $editenable);
1890 print
'</td><td colspan="2" class="valeur">';
1891 if ($action ==
'editlogin') {
1892 $form->form_users($_SERVER[
'PHP_SELF'].
'?rowid='.
$object->id,
$object->user_id,
'userid',
'');
1895 $linkeduser =
new User($db);
1896 $linkeduser->fetch(
$object->user_id);
1897 print $linkeduser->getNomUrl(-1);
1899 print
'<span class="opacitymedium">'.$langs->trans(
"NoDolibarrAccess").
'</span>';
1906 print
"</div></div>\n";
1907 print
'<div class="clearboth"></div>';
1916 print
'<div class="tabsAction">';
1918 $parameters = array();
1919 $reshook = $hookmanager->executeHooks(
'addMoreActionsButtons', $parameters,
$object, $action);
1920 if (empty($reshook)) {
1921 if ($action !=
'editlogin' && $action !=
'editthirdparty') {
1923 if (empty($user->socid)) {
1925 print
'<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?id='.((int)
$object->id).
'&action=presend&mode=init#formmailbeforetitle">'.$langs->trans(
'SendMail').
'</a>'.
"\n";
1944 if ($user->hasRight(
'adherent',
'creer')) {
1945 print
'<a class="butAction" href="card.php?rowid='.((int)
$object->id).
'&action=edit&token='.
newToken().
'">'.$langs->trans(
"Modify").
'</a>'.
"\n";
1947 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"Modify").
'</span>'.
"\n";
1952 if ($user->hasRight(
'adherent',
'creer')) {
1953 print
'<a class="butAction" href="card.php?rowid='.((int)
$object->id).
'&action=valid&token='.
newToken().
'">'.$langs->trans(
"Validate").
'</a>'.
"\n";
1955 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"Validate").
'</span>'.
"\n";
1961 if ($user->hasRight(
'adherent',
'creer')) {
1962 print
'<a class="butAction" href="card.php?rowid='.((int)
$object->id).
'&action=valid&token='.
newToken().
'">'.$langs->trans(
"Reenable").
"</a>\n";
1964 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"Reenable").
'</span>'.
"\n";
1970 if ($user->hasRight(
'adherent',
'supprimer')) {
1971 print
'<a class="butAction" href="card.php?rowid='.((int)
$object->id).
'&action=resiliate&token='.
newToken().
'">'.$langs->trans(
"Resiliate").
"</a></span>\n";
1973 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"Resiliate").
'</span>'.
"\n";
1979 if ($user->hasRight(
'adherent',
'supprimer')) {
1980 print
'<a class="butAction" href="card.php?rowid='.((int)
$object->id).
'&action=exclude&token='.
newToken().
'">'.$langs->trans(
"Exclude").
"</a></span>\n";
1982 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"Exclude").
'</span>'.
"\n";
1987 if (isModEnabled(
'societe') && !
$object->socid) {
1988 if ($user->hasRight(
'societe',
'creer')) {
1990 print
'<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?rowid='.((int)
$object->id).
'&action=create_thirdparty&token='.
newToken().
'" title="'.
dol_escape_htmltag($langs->trans(
"CreateDolibarrThirdPartyDesc")).
'">'.$langs->trans(
"CreateDolibarrThirdParty").
'</a>'.
"\n";
1992 print
'<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans(
"ValidateBefore")).
'">'.$langs->trans(
"CreateDolibarrThirdParty").
'</a>'.
"\n";
1995 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"CreateDolibarrThirdParty").
'</span>'.
"\n";
2000 if (!$user->socid && !
$object->user_id) {
2001 if ($user->hasRight(
'user',
'user',
'creer')) {
2003 print
'<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?rowid='.((int)
$object->id).
'&action=create_user&token='.
newToken().
'" title="'.
dol_escape_htmltag($langs->trans(
"CreateDolibarrLoginDesc")).
'">'.$langs->trans(
"CreateDolibarrLogin").
'</a>'.
"\n";
2005 print
'<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans(
"ValidateBefore")).
'">'.$langs->trans(
"CreateDolibarrLogin").
'</a>'.
"\n";
2008 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"CreateDolibarrLogin").
'</span>'.
"\n";
2014 $isinspip = $mailmanspip->is_in_spip(
$object);
2016 if ($isinspip == 1) {
2017 print
'<a class="butAction" href="card.php?rowid='.((int)
$object->id).
'&action=del_spip&token='.
newToken().
'">'.$langs->trans(
"DeleteIntoSpip").
'</a>'.
"\n";
2019 if ($isinspip == 0) {
2020 print
'<a class="butAction" href="card.php?rowid='.((int)
$object->id).
'&action=add_spip&token='.
newToken().
'">'.$langs->trans(
"AddIntoSpip").
'</a>'.
"\n";
2025 if ($user->hasRight(
'adherent',
'supprimer')) {
2026 print
'<a class="butActionDelete" href="card.php?rowid='.((int)
$object->id).
'&action=delete&token='.
newToken().
'">'.$langs->trans(
"Delete").
'</a>'.
"\n";
2028 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"Delete").
'</span>'.
"\n";
2034 if ($isinspip == -1) {
2035 print
'<br><br><span class="error">'.$langs->trans(
'SPIPConnectionFailed').
': '.$mailmanspip->error.
'</span>';
2040 if (
GETPOST(
'modelselected')) {
2041 $action =
'presend';
2044 if ($action !=
'presend') {
2045 print
'<div class="fichecenter"><div class="fichehalfleft">';
2046 print
'<a name="builddoc"></a>';
2050 $filedir = $conf->adherent->dir_output.
'/'.
get_exdir(0, 0, 0, 1,
$object,
'member');
2051 $urlsource = $_SERVER[
'PHP_SELF'].
'?id='.
$object->id;
2052 $genallowed = $user->hasRight(
'adherent',
'lire');
2053 $delallowed = $user->hasRight(
'adherent',
'creer');
2055 print $formfile->showdocuments(
'member', $filename, $filedir, $urlsource, $genallowed, $delallowed,
$object->model_pdf, 1, 0, 0, 28, 0,
'',
'',
'', (empty(
$object->default_lang) ?
'' :
$object->default_lang),
'',
$object);
2056 $somethingshown = $formfile->numoffiles;
2071 include_once DOL_DOCUMENT_ROOT.
'/core/lib/payments.lib.php';
2072 $validpaymentmethod = getValidOnlinePaymentMethods(
'');
2073 $useonlinepayment = count($validpaymentmethod);
2075 if ($useonlinepayment) {
2077 if (empty($amount)) {
2078 $amount = max($adht->amount,
$object->first_subscription_amount,
$object->last_subscription_amount);
2080 if (empty($amount)) {
2083 require_once DOL_DOCUMENT_ROOT.
'/core/lib/payments.lib.php';
2084 print showOnlinePaymentUrl(
'membersubscription',
$object->ref, $amount);
2087 print
'</div><div class="fichehalfright">';
2091 $morehtmlcenter =
'';
2092 $messagingUrl = DOL_URL_ROOT.
'/adherents/messaging.php?rowid='.
$object->id;
2093 $morehtmlcenter .=
dolGetButtonTitle($langs->trans(
'ShowAsConversation'),
'',
'fa fa-comments imgforviewmode', $messagingUrl,
'', 1);
2094 $morehtmlcenter .=
dolGetButtonTitle($langs->trans(
'SeeAll'),
'',
'fa fa-bars imgforviewmode', DOL_URL_ROOT.
'/adherents/agenda.php?id='.
$object->id);
2097 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formactions.class.php';
2099 $somethingshown = $formactions->showactions(
$object,
$object->element, $socid, 1,
'listactions', $MAXEVENT,
'', $morehtmlcenter);
2101 print
'</div></div>';
2105 $modelmail =
'member';
2106 $defaulttopic =
'CardContent';
2107 $diroutput = $conf->adherent->dir_output;
2108 $trackid =
'mem'.$object->id;
2110 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($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Class to manage members of a foundation.
const STATUS_EXCLUDED
Excluded.
const STATUS_DRAFT
Draft status.
const STATUS_RESILIATED
Resiliated.
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.
print $script_file $mode $langs defaultlang(is_numeric($duration_value) ? " delay=". $duration_value :"").(is_numeric($duration_value2) ? " after cd cd cd description as p label as s rowid as s nom as s email
Sender: Who sends the email ("Sender" has sent emails on behalf of "From").
dol_delete_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 a Dolibarr global constant string value.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='', $picto='')
Show information in HTML for admin users or standard users.
get_exdir($num, $level, $alpha, $withoutslash, $object, $modulepart='')
Return a path to have a the directory according to object where files are stored.
dol_mkdir($dir, $dataroot='', $newmask='')
Creation of a directory (this can create recursive subdir)
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
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.