35require
'../main.inc.php';
36require_once DOL_DOCUMENT_ROOT.
'/core/lib/member.lib.php';
37require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
38require_once DOL_DOCUMENT_ROOT.
'/core/lib/images.lib.php';
39require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
40require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
41require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
42require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent_type.class.php';
43require_once DOL_DOCUMENT_ROOT.
'/adherents/class/subscription.class.php';
44require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
45require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
46require_once DOL_DOCUMENT_ROOT.
'/core/class/extrafields.class.php';
47require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formadmin.class.php';
48require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
49require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
62$langs->loadLangs(array(
"companies",
"bills",
"members",
"users",
"other",
"paypal"));
66$action =
GETPOST(
'action',
'aZ09');
67$cancel =
GETPOST(
'cancel',
'alpha');
68$backtopage =
GETPOST(
'backtopage',
'alpha');
69$backtopageforcancel =
GETPOST(
'backtopageforcancel',
'alpha');
70$confirm =
GETPOST(
'confirm',
'alpha');
79if (isModEnabled(
'mailmanspip')) {
80 include_once DOL_DOCUMENT_ROOT.
'/mailmanspip/class/mailmanspip.class.php';
82 $langs->load(
'mailmanspip');
93$extrafields->fetch_name_optionals_label(
$object->table_element);
101if (!empty($canvas)) {
102 require_once DOL_DOCUMENT_ROOT.
'/core/class/canvas.class.php';
103 $objcanvas =
new Canvas($db, $action);
104 $objcanvas->getCanvas(
'adherent',
'membercard', $canvas);
108$hookmanager->initHooks(array(
'membercard',
'globalcard'));
111if ($id > 0 || !empty($ref)) {
113 $result =
$object->fetch($id, $ref);
116 $canadduser = ($user->admin || $user->hasRight(
'user',
'user',
'creer'));
120 $caneditfielduser = ((($user->id ==
$object->user_id) && $user->hasRight(
'user',
'self',
'creer'))
121 || (($user->id !=
$object->user_id) && $user->hasRight(
'user',
'user',
'creer')));
122 $caneditpassworduser = ((($user->id ==
$object->user_id) && $user->hasRight(
'user',
'self',
'password'))
123 || (($user->id !=
$object->user_id) && $user->hasRight(
'user',
'user',
'password')));
128$canaddmember = $user->hasRight(
'adherent',
'creer');
129$caneditfieldmember =
false;
132 $caneditfieldmember = $user->hasRight(
'adherent',
'creer');
138if (!$user->hasRight(
'adherent',
'creer') && $action ==
'edit') {
142$linkofpubliclist = DOL_MAIN_URL_ROOT.
'/public/members/public_list.php'.((isModEnabled(
'multicompany')) ?
'?entity='.
$conf->entity :
'');
149$parameters = array(
'id' => $id,
'rowid' => $id,
'objcanvas' => $objcanvas,
'confirm' => $confirm);
150$reshook = $hookmanager->executeHooks(
'doActions', $parameters,
$object, $action);
155if (empty($reshook)) {
156 $backurlforlist = DOL_URL_ROOT.
'/adherents/list.php';
158 if (empty($backtopage) || ($cancel && empty($id))) {
159 if (empty($backtopage) || ($cancel && strpos($backtopage,
'__ID__'))) {
160 if (empty($id) && (($action !=
'add' && $action !=
'create') || $cancel)) {
161 $backtopage = $backurlforlist;
163 $backtopage = DOL_URL_ROOT.
'/adherents/card.php?id='.((!empty($id) &&
$id > 0) ? $id :
'__ID__');
169 if (!empty($backtopageforcancel)) {
170 header(
"Location: ".$backtopageforcancel);
172 } elseif (!empty($backtopage)) {
173 header(
"Location: ".$backtopage);
179 if ($action ==
'setuserid' && ($user->hasRight(
'user',
'self',
'creer') || $user->hasRight(
'user',
'user',
'creer'))) {
181 if (!$user->hasRight(
'user',
'user',
'creer')) {
182 if ($userid != $user->id && $userid !=
$object->user_id) {
184 setEventMessages($langs->trans(
"ErrorUserPermissionAllowsToLinksToItselfOnly"),
null,
'errors');
189 if ($userid !=
$object->user_id) {
190 $result =
$object->setUserId($userid);
199 if ($action ==
'setsocid' && $caneditfieldmember) {
202 if ($socid !=
$object->socid) {
203 $sql =
"SELECT rowid FROM ".MAIN_DB_PREFIX.
"adherent";
204 $sql .=
" WHERE socid = ".((int) $socid);
205 $sql .=
" AND entity = ".$conf->entity;
206 $resql = $db->query($sql);
208 $obj = $db->fetch_object($resql);
209 if ($obj && $obj->rowid > 0) {
211 $othermember->fetch($obj->rowid);
212 $thirdparty =
new Societe($db);
213 $thirdparty->fetch($socid);
215 setEventMessages($langs->trans(
"ErrorMemberIsAlreadyLinkedToThisThirdParty", $othermember->getFullName($langs), $othermember->login, $thirdparty->name),
null,
'errors');
220 $result =
$object->setThirdPartyId($socid);
231 if ($action ==
'confirm_create_user' && $confirm ==
'yes' && $user->hasRight(
'user',
'user',
'creer')) {
234 $nuser =
new User($db);
236 if (
GETPOST(
'internalorexternal',
'aZ09') ==
'internal') {
237 $tmpuser->fk_soc = 0;
240 $result = $nuser->create_from_member($tmpuser,
GETPOST(
'login',
'alphanohtml'));
243 $langs->load(
"errors");
246 setEventMessages($langs->trans(
"NewUserCreated", $nuser->login),
null,
'mesgs');
255 if ($action ==
'confirm_create_thirdparty' && $confirm ==
'yes' && $user->hasRight(
'societe',
'creer')) {
259 $result = $company->create_from_member(
$object,
GETPOST(
'companyname',
'alpha'),
GETPOST(
'companyalias',
'alpha'));
262 $langs->load(
"errors");
271 if ($action ==
'update' && !$cancel && $user->hasRight(
'adherent',
'creer')) {
272 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
278 $lastname =
GETPOST(
"lastname",
'alphanohtml');
279 $firstname =
GETPOST(
"firstname",
'alphanohtml');
280 $gender =
GETPOST(
"gender",
'alphanohtml');
281 $societe =
GETPOST(
"societe",
'alphanohtml');
282 $morphy =
GETPOST(
"morphy",
'alphanohtml');
283 $login =
GETPOST(
"login",
'alphanohtml');
284 if ($morphy !=
'mor' && empty($lastname)) {
286 $langs->load(
"errors");
287 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Lastname")),
null,
'errors');
289 if ($morphy !=
'mor' && (!isset($firstname) || $firstname ==
'')) {
291 $langs->load(
"errors");
292 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Firstname")),
null,
'errors');
294 if ($morphy ==
'mor' && empty($societe)) {
296 $langs->load(
"errors");
297 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Company")),
null,
'errors');
303 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Login")),
null,
'errors');
307 if ($result > 0 && !$error) {
311 $object->civility_id = trim(
GETPOST(
"civility_id",
'alphanohtml'));
316 if (GETPOSTISSET(
'pass')) {
332 $object->email = preg_replace(
'/\s+/',
'',
GETPOST(
"member_email",
'alpha'));
333 $object->url = trim(
GETPOST(
'member_url',
'custom', 0, FILTER_SANITIZE_URL));
334 $object->socialnetworks = array();
335 foreach ($socialnetworks as $key => $value) {
336 if (GETPOSTISSET($key) &&
GETPOST($key,
'alphanohtml') !=
'') {
337 $object->socialnetworks[$key] = trim(
GETPOST($key,
'alphanohtml'));
346 if (
GETPOST(
'deletephoto',
'alpha')) {
348 } elseif (!empty($_FILES[
'photo'][
'name'])) {
358 $ret = $extrafields->setOptionalsFromPost(
null,
$object,
'@GETPOSTISSET');
366 if ($user->id !=
$object->user_id && !$user->hasRight(
'user',
'user',
'creer')) {
373 if (GETPOSTISSET(
'pass')) {
376 if ($user->id ==
$object->user_id) {
377 if (!$user->hasRight(
'user',
'self',
'password')) {
381 if (!$user->hasRight(
'user',
'user',
'password')) {
389 $result =
$object->update($user, 0, $nosyncuser, $nosyncuserpass);
391 if ($result >= 0 && !count(
$object->errors)) {
392 $categories =
GETPOST(
'memcats',
'array');
393 $object->setCategories($categories);
397 $file_OK = is_uploaded_file($_FILES[
'photo'][
'tmp_name']);
400 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
402 $dirthumbs =
$conf->adherent->dir_output.
'/'.
get_exdir(0, 0, 0, 1,
$object,
'member').
'/photos/thumbs';
412 if (!
dol_move_uploaded_file($_FILES[
'photo'][
'tmp_name'], $newfile, 1, 0, $_FILES[
'photo'][
'error']) > 0) {
423 switch ($_FILES[
'photo'][
'error']) {
426 $errors[] =
"ErrorFileSizeTooLarge";
429 $errors[] =
"ErrorFilePartiallyUploaded";
438 if (!empty($backtopage)) {
439 header(
"Location: ".$backtopage);
454 if ($action ==
'add' && $user->hasRight(
'adherent',
'creer')) {
459 if (GETPOSTISSET(
"birthday") &&
GETPOST(
"birthday") && GETPOSTISSET(
"birthmonth") &&
GETPOST(
"birthmonth") && GETPOSTISSET(
"birthyear") &&
GETPOST(
"birthyear")) {
462 $datesubscription =
'';
463 if (GETPOSTISSET(
"reday") && GETPOSTISSET(
"remonth") && GETPOSTISSET(
"reyear")) {
468 $civility_id =
GETPOST(
"civility_id",
'alphanohtml');
469 $lastname =
GETPOST(
"lastname",
'alphanohtml');
470 $firstname =
GETPOST(
"firstname",
'alphanohtml');
471 $gender =
GETPOST(
"gender",
'alphanohtml');
472 $societe =
GETPOST(
"societe",
'alphanohtml');
473 $address =
GETPOST(
"address",
'alphanohtml');
474 $zip =
GETPOST(
"zipcode",
'alphanohtml');
475 $town =
GETPOST(
"town",
'alphanohtml');
479 $phone =
GETPOST(
"phone",
'alpha');
480 $phone_perso =
GETPOST(
"phone_perso",
'alpha');
481 $phone_mobile =
GETPOST(
"phone_mobile",
'alpha');
482 $email = preg_replace(
'/\s+/',
'',
GETPOST(
"member_email",
'aZ09arobase'));
483 $url = trim(
GETPOST(
'url',
'custom', 0, FILTER_SANITIZE_URL));
484 $login =
GETPOST(
"member_login",
'alphanohtml');
485 $pass =
GETPOST(
"password",
'password');
486 $photo =
GETPOST(
"photo",
'alphanohtml');
487 $morphy =
GETPOST(
"morphy",
'alphanohtml');
492 $default_lang =
GETPOST(
'default_lang',
'alpha');
494 $object->civility_id = $civility_id;
495 $object->firstname = $firstname;
504 $object->country_id = $country_id;
506 $object->phone_perso = $phone_perso;
507 $object->phone_mobile = $phone_mobile;
508 $object->socialnetworks = array();
509 if (isModEnabled(
'socialnetworks')) {
510 foreach ($socialnetworks as $key => $value) {
511 if (GETPOSTISSET($key) &&
GETPOST($key,
'alphanohtml') !=
'') {
512 $object->socialnetworks[$key] =
GETPOST(
"member_".$key,
'alphanohtml');
529 $object->default_lang = $default_lang;
531 $ret = $extrafields->setOptionalsFromPost(
null,
$object);
537 if (empty($morphy) || $morphy ==
"-1") {
539 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"MemberNature")),
null,
'errors');
545 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Login")),
null,
'errors');
547 $sql =
"SELECT login FROM ".MAIN_DB_PREFIX.
"adherent WHERE login='".$db->escape($login).
"'";
548 $result = $db->query($sql);
551 $num = $db->num_rows($result);
555 $langs->load(
"errors");
556 setEventMessages($langs->trans(
"ErrorLoginAlreadyExists", $login),
null,
'errors');
561 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Password")),
null,
'errors');
564 if ($morphy ==
'mor' && empty($societe)) {
566 $langs->load(
"errors");
567 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Company")),
null,
'errors');
569 if ($morphy !=
'mor' && empty($lastname)) {
571 $langs->load(
"errors");
572 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Lastname")),
null,
'errors');
574 if ($morphy !=
'mor' && (!isset($firstname) || $firstname ==
'')) {
576 $langs->load(
"errors");
577 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Firstname")),
null,
'errors');
579 if (!($typeid > 0)) {
581 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Type")),
null,
'errors');
585 $langs->load(
"errors");
589 $langs->load(
"errors");
593 if (isset($public)) {
601 $result =
$object->create($user);
604 $memcats =
GETPOST(
'memcats',
'array');
605 $object->setCategories($memcats);
612 $backtopage = preg_replace(
'/__ID__/', (
string) $id, $backtopage);
625 $result = $company->create_from_member(
$object);
627 $langs->load(
"errors");
636 $action = ($result < 0 || !$error) ?
'' :
'create';
638 if (!$error && $backtopage) {
639 header(
"Location: ".$backtopage);
644 if ($user->hasRight(
'adherent',
'supprimer') && $action ==
'confirm_delete' && $confirm ==
'yes') {
645 $result =
$object->delete($user);
648 if (!empty($backtopage) && !preg_match(
'/'.preg_quote($_SERVER[
"PHP_SELF"],
'/').
'/', $backtopage)) {
649 header(
"Location: ".$backtopage);
652 header(
"Location: list.php");
660 if ($user->hasRight(
'adherent',
'creer') && $action ==
'confirm_valid' && $confirm ==
'yes') {
668 $result =
$object->validate($user);
670 if ($result >= 0 && !count(
$object->errors)) {
677 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
681 $outputlangs->setDefaultLang(empty(
$object->thirdparty->default_lang) ? $mysoc->default_lang :
$object->thirdparty->default_lang);
683 $outputlangs->loadLangs(array(
"main",
"members",
"companies",
"install",
"other"));
685 $arraydefaultmessage =
null;
688 if (!empty($labeltouse)) {
689 $arraydefaultmessage = $formmail->getEMailTemplate($db,
'member', $user, $outputlangs, 0, 1, $labeltouse);
692 if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
693 $subject = $arraydefaultmessage->topic;
694 $msg = $arraydefaultmessage->content;
697 if (empty($labeltouse) || (
int) $labeltouse === -1) {
699 $langs->load(
"errors");
700 setEventMessages(
'<a href="'.DOL_URL_ROOT.
'/adherents/admin/member_emails.php">'.$langs->trans(
'WarningMandatorySetupNotComplete').
'</a>',
null,
'errors');
708 $moreinheader =
'X-Dolibarr-Info: send_an_email by adherents/card.php'.
"\r\n";
710 $result =
$object->sendEmail($texttosend, $subjecttosend, array(), array(), array(),
"",
"", 0, -1,
'', $moreinheader);
730 if ($user->hasRight(
'adherent',
'supprimer') && $action ==
'confirm_resiliate') {
733 if ($confirm ==
'yes') {
737 $result =
$object->resiliate($user);
739 if ($result >= 0 && !count(
$object->errors)) {
745 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
749 $outputlangs->setDefaultLang(empty(
$object->thirdparty->default_lang) ? $mysoc->default_lang :
$object->thirdparty->default_lang);
751 $outputlangs->loadLangs(array(
"main",
"members",
"companies",
"install",
"other"));
753 $arraydefaultmessage =
null;
756 if (!empty($labeltouse)) {
757 $arraydefaultmessage = $formmail->getEMailTemplate($db,
'member', $user, $outputlangs, 0, 1, $labeltouse);
760 if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
761 $subject = $arraydefaultmessage->topic;
762 $msg = $arraydefaultmessage->content;
765 if (empty($labeltouse) || (
int) $labeltouse === -1) {
775 $moreinheader =
'X-Dolibarr-Info: send_an_email by adherents/card.php'.
"\r\n";
777 $result =
$object->sendEmail($texttosend, $subjecttosend, array(), array(), array(),
"",
"", 0, -1,
'', $moreinheader);
791 if (!empty($backtopage) && !$error) {
792 header(
"Location: ".$backtopage);
797 if ($user->hasRight(
'adherent',
'supprimer') && $action ==
'confirm_exclude') {
800 if ($confirm ==
'yes') {
804 $result =
$object->exclude($user);
806 if ($result >= 0 && !count(
$object->errors)) {
812 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
816 $outputlangs->setDefaultLang(empty(
$object->thirdparty->default_lang) ? $mysoc->default_lang :
$object->thirdparty->default_lang);
818 $outputlangs->loadLangs(array(
"main",
"members",
"companies",
"install",
"other"));
820 $arraydefaultmessage =
null;
823 if (!empty($labeltouse)) {
824 $arraydefaultmessage = $formmail->getEMailTemplate($db,
'member', $user, $outputlangs, 0, 1, $labeltouse);
827 if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
828 $subject = $arraydefaultmessage->topic;
829 $msg = $arraydefaultmessage->content;
832 if (empty($labeltouse) || (
int) $labeltouse === -1) {
842 $moreinheader =
'X-Dolibarr-Info: send_an_email by adherents/card.php'.
"\r\n";
844 $result =
$object->sendEmail($texttosend, $subjecttosend, array(), array(), array(),
"",
"", 0, -1,
'', $moreinheader);
858 if (!empty($backtopage) && !$error) {
859 header(
"Location: ".$backtopage);
865 if (is_object($mailmanspip)) {
866 if ($user->hasRight(
'adherent',
'supprimer') && $action ==
'confirm_del_spip' && $confirm ==
'yes') {
868 if (!$mailmanspip->del_to_spip(
$object)) {
869 setEventMessages($langs->trans(
'DeleteIntoSpipError').
': '.$mailmanspip->error,
null,
'errors');
874 if ($user->hasRight(
'adherent',
'creer') && $action ==
'confirm_add_spip' && $confirm ==
'yes') {
876 if (!$mailmanspip->add_to_spip(
$object)) {
877 setEventMessages($langs->trans(
'AddIntoSpipError').
': '.$mailmanspip->error,
null,
'errors');
884 include DOL_DOCUMENT_ROOT.
'/core/actions_printing.inc.php';
887 $upload_dir =
$conf->adherent->dir_output;
888 $permissiontoadd = $user->hasRight(
'adherent',
'creer');
889 include DOL_DOCUMENT_ROOT.
'/core/actions_builddoc.inc.php';
892 $triggersendname =
'MEMBER_SENTBYMAIL';
894 $mode =
'emailfrommember';
895 $trackid =
'mem'.$object->id;
896 include DOL_DOCUMENT_ROOT.
'/core/actions_sendmails.inc.php';
904$form =
new Form($db);
909$title = $langs->trans(
"Member").
" - ".$langs->trans(
"Card");
910$help_url =
'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder';
912llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'mod-member page-card');
914$countrynotdefined = $langs->trans(
"ErrorSetACountryFirst").
' ('.$langs->trans(
"SeeAbove").
')';
916if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
920 if (empty(
$object->error) && $id) {
928 $objcanvas->display_canvas($action);
935 if ($action ==
'create') {
943 $object->country_code = $tmparray[
'code'];
944 $object->country = $tmparray[
'label'];
948 if (!empty($socid)) {
953 if (!($soc->id > 0)) {
954 $langs->load(
"errors");
955 print($langs->trans(
'ErrorRecordNotFound'));
964 if (
$conf->use_javascript_ajax) {
965 print
"\n".
'<script type="text/javascript">'.
"\n";
966 print
'jQuery(document).ready(function () {
967 jQuery("#selectcountry_id").change(function() {
968 document.formsoc.action.value="create";
969 document.formsoc.submit();
971 function initfieldrequired() {
972 jQuery("#tdcompany").removeClass("fieldrequired");
973 jQuery("#tdlastname").removeClass("fieldrequired");
974 jQuery("#tdfirstname").removeClass("fieldrequired");
975 if (jQuery(\'input[name="morphy"]:checked\').val() == \'mor\') {
976 jQuery("#tdcompany").addClass("fieldrequired");
978 if (jQuery(\'input[name="morphy"]:checked\').val() == \'phy\') {
979 jQuery("#tdlastname").addClass("fieldrequired");
980 jQuery("#tdfirstname").addClass("fieldrequired");
983 jQuery(\'input[name="morphy"]\').change(function() {
988 print
'</script>'.
"\n";
991 print
'<form name="formsoc" action="'.$_SERVER[
"PHP_SELF"].
'" method="post" enctype="multipart/form-data">';
992 print
'<input type="hidden" name="token" value="'.newToken().
'">';
993 print
'<input type="hidden" name="action" value="add">';
994 print
'<input type="hidden" name="socid" value="'.$socid.
'">';
996 print
'<input type="hidden" name="backtopage" value="'.($backtopage !=
'1' ? $backtopage : $_SERVER[
"HTTP_REFERER"]).
'">';
1001 print
'<table class="border centpercent">';
1006 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>';
1011 require_once DOL_DOCUMENT_ROOT.
'/core/lib/security2.lib.php';
1013 print
'<tr><td><span class="fieldrequired">'.$langs->trans(
"Password").
'</span></td><td>';
1014 print
'<input type="text" class="minwidth300" maxlength="50" name="password" value="'.dol_escape_htmltag($generated_password).
'">';
1019 print
'<tr><td class="fieldrequired">'.$langs->trans(
"MemberType").
'</td><td>';
1020 $listetype = $adht->liste_array(1);
1021 print
img_picto(
'', $adht->picto,
'class="pictofixedwidth"');
1022 if (count($listetype)) {
1023 print $form->selectarray(
"typeid", $listetype, (
GETPOSTINT(
'typeid') ?
GETPOSTINT(
'typeid') : $typeid), (count($listetype) > 1 ? 1 : 0), 0, 0,
'', 0, 0, 0,
'',
'minwidth200', 1);
1025 print
'<span class="error">'.$langs->trans(
"NoTypeDefinedGoToSetup").
'</span>';
1027 if ($user->hasRight(
'member',
'configurer')) {
1028 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>';
1034 $morphys[
"phy"] = $langs->trans(
"Physical");
1035 $morphys[
"mor"] = $langs->trans(
"Moral");
1036 $checkednature = (GETPOSTISSET(
"morphy") ?
GETPOST(
"morphy",
'alpha') :
$object->morphy);
1037 print
'<tr><td class="fieldrequired">'.$langs->trans(
"MemberNature").
"</td><td>\n";
1038 print
'<span id="spannature1" class="nonature-back spannature paddinglarge marginrightonly"><label for="phisicalinput" class="valignmiddle">'.$morphys[
"phy"].
'<input id="phisicalinput" class="flat checkforselect marginleftonly valignmiddle" type="radio" name="morphy" value="phy"'.($checkednature ==
"phy" ?
' checked="checked"' :
'').
'></label></span>';
1039 print
'<span id="spannature2" class="nonature-back spannature paddinglarge marginrightonly"><label for="moralinput" class="valignmiddle">'.$morphys[
"mor"].
'<input id="moralinput" class="flat checkforselect marginleftonly valignmiddle" type="radio" name="morphy" value="mor"'.($checkednature ==
"mor" ?
' checked="checked"' :
'').
'></label></span>';
1042 if (
$conf->use_javascript_ajax) {
1044 function refreshNatureCss() {
1045 jQuery(".spannature").each(function( index ) {
1046 console.log(jQuery("#spannature"+(index+1)+" .checkforselect").is(":checked"));
1047 if (jQuery("#spannature"+(index+1)+" .checkforselect").is(":checked")) {
1049 jQuery("#spannature"+(index+1)).addClass("member-individual-back").removeClass("nonature-back");
1052 jQuery("#spannature"+(index+1)).addClass("member-company-back").removeClass("nonature-back");
1055 jQuery("#spannature"+(index+1)).removeClass("member-individual-back").removeClass("member-company-back").addClass("nonature-back");
1059 jQuery(".spannature").click(function(){
1060 console.log("We click on a nature");
1070 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>';
1073 print
'<tr><td>'.$langs->trans(
"UserTitle").
'</td><td>';
1074 print $formcompany->select_civility(
GETPOSTINT(
'civility_id') ?
GETPOSTINT(
'civility_id') :
$object->civility_id,
'civility_id',
'maxwidth150', 1).
'</td>';
1078 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>';
1082 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>';
1086 print
'<tr><td>'.$langs->trans(
"Gender").
'</td>';
1088 $arraygender = array(
'man' => $langs->trans(
"Genderman"),
'woman' => $langs->trans(
"Genderwoman"),
'other' => $langs->trans(
"Genderother"));
1089 print $form->selectarray(
'gender', $arraygender,
GETPOST(
'gender',
'alphanohtml'), 1, 0, 0,
'', 0, 0, 0,
'',
'minwidth100', 1);
1093 print
'<tr><td>'.(getDolGlobalString(
'ADHERENT_MAIL_REQUIRED') ?
'<span class="fieldrequired">' :
'').$langs->trans(
"EMail").(getDolGlobalString(
'ADHERENT_MAIL_REQUIRED') ?
'</span>' :
'').
'</td>';
1094 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>';
1097 print
'<tr><td>'.$form->editfieldkey(
'Web',
'member_url',
GETPOST(
'member_url',
'alpha'),
$object, 0).
'</td>';
1098 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>';
1101 print
'<tr><td class="tdtop">'.$langs->trans(
"Address").
'</td><td>';
1102 print
'<textarea name="address" wrap="soft" class="quatrevingtpercent" rows="2">'.(GETPOSTISSET(
'address') ?
GETPOST(
'address',
'alphanohtml') : $soc->
address).
'</textarea>';
1106 print
'<tr><td>'.$langs->trans(
"Zip").
' / '.$langs->trans(
"Town").
'</td><td>';
1107 print $formcompany->select_ziptown((GETPOSTISSET(
'zipcode') ?
GETPOST(
'zipcode',
'alphanohtml') : $soc->zip),
'zipcode', array(
'town',
'selectcountry_id',
'state_id'), 6);
1109 print $formcompany->select_ziptown((GETPOSTISSET(
'town') ?
GETPOST(
'town',
'alphanohtml') : $soc->town),
'town', array(
'zipcode',
'selectcountry_id',
'state_id'));
1113 if (empty($soc->country_id)) {
1114 $soc->country_id = $mysoc->country_id;
1115 $soc->country_code = $mysoc->country_code;
1116 $soc->state_id = $mysoc->state_id;
1118 print
'<tr><td>'.$langs->trans(
'Country').
'</td><td>';
1119 print
img_picto(
'',
'country',
'class="pictofixedwidth"');
1120 print $form->select_country(GETPOSTISSET(
'country_id') ?
GETPOST(
'country_id',
'alpha') : $soc->country_id,
'country_id');
1122 print
info_admin($langs->trans(
"YouCanChangeValuesForThisListFromDictionarySetup"), 1);
1128 print
'<tr><td>'.$langs->trans(
'State').
'</td><td>';
1129 if ($soc->country_id || GETPOSTISSET(
'country_id')) {
1130 print
img_picto(
'',
'state',
'class="pictofixedwidth"');
1131 print $formcompany->select_state(GETPOSTISSET(
'state_id') ?
GETPOSTINT(
'state_id') : $soc->state_id, GETPOSTISSET(
'country_id') ?
GETPOSTINT(
'country_id') : $soc->country_code);
1133 print $countrynotdefined;
1139 print
'<tr><td>'.$langs->trans(
"PhonePro").
'</td>';
1140 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>';
1143 print
'<tr><td>'.$langs->trans(
"PhonePerso").
'</td>';
1144 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>';
1147 print
'<tr><td>'.$langs->trans(
"PhoneMobile").
'</td>';
1148 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>';
1150 if (isModEnabled(
'socialnetworks')) {
1151 foreach ($socialnetworks as $key => $value) {
1152 if (!$value[
'active']) {
1155 $val = (GETPOSTISSET(
'member_'.$key) ?
GETPOST(
'member_'.$key,
'alpha') : (empty(
$object->socialnetworks[$key]) ?
'' :
$object->socialnetworks[$key]));
1156 print
'<tr><td>'.$langs->trans($value[
'label']).
'</td><td><input type="text" name="member_'.$key.
'" size="40" value="'.$val.
'"></td></tr>';
1161 print
"<tr><td>".$langs->trans(
"DateOfBirth").
"</td><td>\n";
1162 print
img_picto(
'',
'object_calendar',
'class="pictofixedwidth"').$form->selectDate((
$object->birth ?
$object->birth : -1),
'birth', 0, 0, 1,
'formsoc');
1163 print
"</td></tr>\n";
1167 $htmltext = $langs->trans(
"Public",
getDolGlobalString(
'MAIN_INFO_SOCIETE_NOM'), $linkofpubliclist);
1168 print $form->textwithpicto($langs->trans(
"MembershipPublic"), $htmltext, 1,
'help',
'', 0, 3,
'membershippublic');
1169 print
"</td><td>\n";
1170 print $form->selectyesno(
"public",
$object->public, 1,
false, 0, 1);
1171 print
"</td></tr>\n";
1174 if (isModEnabled(
'category') && $user->hasRight(
'categorie',
'lire')) {
1175 print
'<tr><td>'.$form->editfieldkey(
"Categories",
'memcats',
'',
$object, 0).
'</td><td>';
1176 $cate_arbo = $form->select_all_categories(Categorie::TYPE_MEMBER,
'',
'parent', 64, 0, 3);
1177 print
img_picto(
'',
'category').$form->multiselectarray(
'memcats', $cate_arbo,
GETPOST(
'memcats',
'array'), 0, 0,
'quatrevingtpercent widthcentpercentminusx', 0, 0);
1182 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_add.tpl.php';
1189 print $form->buttonsSaveCancel(
"AddMember");
1195 if ($action ==
'edit') {
1201 $res =
$object->fetch_optionals();
1208 $adht->fetch(
$object->typeid);
1212 if (!empty($country) ||
$object->country_id) {
1213 $sql =
"SELECT rowid, code, label from ".MAIN_DB_PREFIX.
"c_country";
1214 $sql .=
" WHERE rowid = ".(int) (!empty($country) ? $country :
$object->country_id);
1215 $resql = $db->query($sql);
1217 $obj = $db->fetch_object($resql);
1222 if (is_object($obj)) {
1223 $object->country_id = $obj->rowid;
1224 $object->country_code = $obj->code;
1225 $object->country = $langs->trans(
"Country".$obj->code) ? $langs->trans(
"Country".$obj->code) : $obj->label;
1232 if (
$conf->use_javascript_ajax) {
1233 print
"\n".
'<script type="text/javascript">';
1234 print
'jQuery(document).ready(function () {
1235 jQuery("#selectcountry_id").change(function() {
1236 document.formsoc.action.value="edit";
1237 document.formsoc.submit();
1239 function initfieldrequired() {
1240 jQuery("#tdcompany").removeClass("fieldrequired");
1241 jQuery("#tdlastname").removeClass("fieldrequired");
1242 jQuery("#tdfirstname").removeClass("fieldrequired");
1243 if (jQuery(\'input[name="morphy"]:checked\').val() == \'mor\') {
1244 jQuery("#tdcompany").addClass("fieldrequired");
1246 if (jQuery(\'input[name="morphy"]:checked\').val() == \'phy\') {
1247 jQuery("#tdlastname").addClass("fieldrequired");
1248 jQuery("#tdfirstname").addClass("fieldrequired");
1251 jQuery(\'input[name="morphy"]\').change(function() {
1252 initfieldrequired();
1254 initfieldrequired();
1256 print
'</script>'.
"\n";
1259 print
'<form name="formsoc" action="'.$_SERVER[
"PHP_SELF"].
'" method="post" enctype="multipart/form-data">';
1260 print
'<input type="hidden" name="token" value="'.newToken().
'" />';
1261 print
'<input type="hidden" name="action" value="update" />';
1262 print
'<input type="hidden" name="rowid" value="'.$id.
'" />';
1263 print
'<input type="hidden" name="statut" value="'.$object->status.
'" />';
1265 print
'<input type="hidden" name="backtopage" value="'.($backtopage !=
'1' ? $backtopage : $_SERVER[
"HTTP_REFERER"]).
'">';
1270 print
'<table class="border centpercent">';
1273 print
'<tr><td class="titlefieldcreate">'.$langs->trans(
"Ref").
'</td><td class="valeur">'.
$object->ref.
'</td></tr>';
1277 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>';
1282 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>';
1286 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Type").
'</td><td>';
1287 if ($user->hasRight(
'adherent',
'creer')) {
1288 print $form->selectarray(
"typeid", $adht->liste_array(), (GETPOSTISSET(
"typeid") ?
GETPOSTINT(
"typeid") :
$object->typeid), 0, 0, 0,
'', 0, 0, 0,
'',
'minwidth200', 1);
1290 print $adht->getNomUrl(1);
1291 print
'<input type="hidden" name="typeid" value="'.$object->typeid.
'">';
1296 $morphys[
"phy"] = $langs->trans(
"Physical");
1297 $morphys[
"mor"] = $langs->trans(
"Moral");
1298 $checkednature = (GETPOSTISSET(
"morphy") ?
GETPOST(
"morphy",
'alpha') :
$object->morphy);
1299 print
'<tr><td><span class="fieldrequired">'.$langs->trans(
"MemberNature").
'</span></td><td>';
1300 print
'<span id="spannature1" class="member-individual-back spannature paddinglarge marginrightonly"><label for="phisicalinput" class="valignmiddle">'.$morphys[
"phy"].
'<input id="phisicalinput" class="flat checkforselect marginleftonly valignmiddle" type="radio" name="morphy" value="phy"'.($checkednature ==
"phy" ?
' checked="checked"' :
'').
'></label></span>';
1301 print
'<span id="spannature1" class="member-company-back spannature paddinglarge marginrightonly"><label for="moralinput" class="valignmiddle">'.$morphys[
"mor"].
'<input id="moralinput" class="flat checkforselect marginleftonly valignmiddle" type="radio" name="morphy" value="mor"'.($checkednature ==
"mor" ?
' checked="checked"' :
'').
'></label></span>';
1305 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>';
1308 print
'<tr><td>'.$langs->trans(
"UserTitle").
'</td><td>';
1309 print $formcompany->select_civility(GETPOSTISSET(
"civility_id") ?
GETPOST(
"civility_id",
'alpha') :
$object->civility_id,
'civility_id',
'maxwidth150', 1);
1314 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>';
1318 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>';
1322 print
'<tr><td>'.$langs->trans(
"Gender").
'</td>';
1324 $arraygender = array(
'man' => $langs->trans(
"Genderman"),
'woman' => $langs->trans(
"Genderwoman"),
'other' => $langs->trans(
"Genderother"));
1325 print $form->selectarray(
'gender', $arraygender, GETPOSTISSET(
'gender') ?
GETPOST(
'gender',
'alphanohtml') :
$object->gender, 1, 0, 0,
'', 0, 0, 0,
'',
'minwidth100', 1);
1329 print
'<tr><td>'.$langs->trans(
"Photo").
'</td>';
1330 print
'<td class="hideonsmartphone" valign="middle">';
1331 print $form->showphoto(
'memberphoto',
$object).
"\n";
1332 if ($caneditfieldmember) {
1336 print
'<table class="nobordernopadding">';
1338 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>';
1342 $maxmin = $maxfilesizearray[
'maxmin'];
1344 print
'<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).
'">';
1346 print
'<input type="file" class="flat" name="photo" id="photoinput">';
1353 print
'<tr><td>'.(getDolGlobalString(
"ADHERENT_MAIL_REQUIRED") ?
'<span class="fieldrequired">' :
'').$langs->trans(
"EMail").(getDolGlobalString(
"ADHERENT_MAIL_REQUIRED") ?
'</span>' :
'').
'</td>';
1354 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>';
1357 print
'<tr><td>'.$form->editfieldkey(
'Web',
'member_url',
GETPOST(
'member_url',
'alpha'),
$object, 0).
'</td>';
1358 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>';
1361 print
'<tr><td>'.$langs->trans(
"Address").
'</td><td>';
1362 print
'<textarea name="address" wrap="soft" class="quatrevingtpercent" rows="'.ROWS_2.
'">'.(GETPOSTISSET(
"address") ?
GETPOST(
"address",
'alphanohtml', 2) :
$object->
address).
'</textarea>';
1366 print
'<tr><td>'.$langs->trans(
"Zip").
' / '.$langs->trans(
"Town").
'</td><td>';
1367 print $formcompany->select_ziptown((GETPOSTISSET(
"zipcode") ?
GETPOST(
"zipcode",
'alphanohtml', 2) :
$object->zip),
'zipcode', array(
'town',
'selectcountry_id',
'state_id'), 6);
1369 print $formcompany->select_ziptown((GETPOSTISSET(
"town") ?
GETPOST(
"town",
'alphanohtml', 2) :
$object->town),
'town', array(
'zipcode',
'selectcountry_id',
'state_id'));
1374 print
'<tr><td>'.$langs->trans(
'Country').
'</td><td>';
1375 print
img_picto(
'',
'country',
'class="pictofixedwidth"');
1376 print $form->select_country(GETPOSTISSET(
"country_id") ?
GETPOST(
"country_id",
"alpha") :
$object->country_id,
'country_id');
1378 print
info_admin($langs->trans(
"YouCanChangeValuesForThisListFromDictionarySetup"), 1);
1384 print
'<tr><td>'.$langs->trans(
'State').
'</td><td>';
1385 print
img_picto(
'',
'state',
'class="pictofixedwidth"');
1386 print $formcompany->select_state(
$object->state_id, GETPOSTISSET(
"country_id") ?
GETPOST(
"country_id",
"alpha") :
$object->country_id);
1391 print
'<tr><td>'.$langs->trans(
"PhonePro").
'</td>';
1392 print
'<td>'.img_picto(
'',
'object_phoning',
'class="pictofixedwidth"').
'<input type="text" name="phone" value="'.(GETPOSTISSET(
"phone") ?
GETPOST(
"phone") :
$object->phone).
'"></td></tr>';
1395 print
'<tr><td>'.$langs->trans(
"PhonePerso").
'</td>';
1396 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>';
1399 print
'<tr><td>'.$langs->trans(
"PhoneMobile").
'</td>';
1400 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>';
1402 if (isModEnabled(
'socialnetworks')) {
1403 foreach ($socialnetworks as $key => $value) {
1404 if (!$value[
'active']) {
1407 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>';
1412 print
"<tr><td>".$langs->trans(
"DateOfBirth").
"</td><td>\n";
1413 print
img_picto(
'',
'object_calendar',
'class="pictofixedwidth"').$form->selectDate((
$object->birth ?
$object->birth : -1),
'birth', 0, 0, 1,
'formsoc');
1414 print
"</td></tr>\n";
1418 print
'<tr><td>'.$form->editfieldkey(
'DefaultLang',
'default_lang',
'',
$object, 0).
'</td><td colspan="3">'.
"\n";
1419 print
img_picto(
'',
'language',
'class="pictofixedwidth"').$formadmin->select_language(
$object->default_lang,
'default_lang', 0, array(), 1);
1426 $htmltext = $langs->trans(
"Public",
getDolGlobalString(
'MAIN_INFO_SOCIETE_NOM'), $linkofpubliclist);
1427 print $form->textwithpicto($langs->trans(
"MembershipPublic"), $htmltext, 1,
'help',
'', 0, 3,
'membershippublic');
1428 print
"</td><td>\n";
1429 print $form->selectyesno(
"public", (GETPOSTISSET(
"public") ?
GETPOST(
"public",
'alphanohtml', 2) :
$object->public), 1, false, 0, 1);
1430 print
"</td></tr>\n";
1433 if (isModEnabled(
'category') && $user->hasRight(
'categorie',
'lire')) {
1434 print
'<tr><td>'.$form->editfieldkey(
"Categories",
'memcats',
'',
$object, 0).
'</td>';
1436 $cate_arbo = $form->select_all_categories(Categorie::TYPE_MEMBER,
'',
'', 64, 0, 3);
1438 $cats = $c->containing(
$object->id, Categorie::TYPE_MEMBER);
1439 $arrayselected = array();
1440 if (is_array($cats)) {
1441 foreach ($cats as $cat) {
1442 $arrayselected[] = $cat->id;
1445 print
img_picto(
'',
'category',
'class="pictofixedwidth"');
1446 print $form->multiselectarray(
'memcats', $cate_arbo, $arrayselected, 0, 0,
'widthcentpercentminusx', 0,
'100%');
1451 if (isModEnabled(
'societe')) {
1452 print
'<tr><td>'.$langs->trans(
"LinkedToDolibarrThirdParty").
'</td><td colspan="2" class="valeur">';
1455 $result = $company->fetch(
$object->socid);
1456 print $company->getNomUrl(1);
1458 print $langs->trans(
"NoThirdPartyAssociatedToMember");
1464 print
'<tr><td>'.$langs->trans(
"LinkedToDolibarrUser").
'</td><td colspan="2" class="valeur">';
1466 $form->form_users($_SERVER[
'PHP_SELF'].
'?rowid='.
$object->id,
$object->user_id,
'none');
1468 print $langs->trans(
"NoDolibarrAccess");
1473 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_edit.tpl.php';
1478 print $form->buttonsSaveCancel(
"Save",
'Cancel');
1484 if ($id > 0 && $action !=
'edit') {
1490 $res =
$object->fetch_optionals();
1497 $res = $adht->fetch(
$object->typeid);
1509 print
dol_get_fiche_head($head,
'general', $langs->trans(
"Member"), -1,
'user', 0,
'',
'', 0,
'', 1);
1512 if ($action ==
'create_user') {
1513 $login = (GETPOSTISSET(
'login') ?
GETPOST(
'login',
'alphanohtml') :
$object->login);
1514 if (empty($login)) {
1516 include_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
1519 if (empty($login)) {
1520 $login = strtolower(substr(
$object->firstname, 0, 4)).strtolower(substr(
$object->lastname, 0, 4));
1524 $formquestion = array(
1525 array(
'label' => $langs->trans(
"LoginToCreate"),
'type' =>
'text',
'name' =>
'login',
'value' => $login)
1527 if (isModEnabled(
'societe') &&
$object->socid > 0) {
1529 $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")));
1532 if (isModEnabled(
'societe') &&
$object->socid <= 0) {
1533 $text .= $langs->trans(
"UserWillBeInternalUser").
'<br>';
1535 $text .= $langs->trans(
"ConfirmCreateLogin");
1536 print $form->formconfirm($_SERVER[
"PHP_SELF"].
"?rowid=".
$object->id, $langs->trans(
"CreateDolibarrLogin"), $text,
"confirm_create_user", $formquestion,
'yes');
1540 if ($action ==
'create_thirdparty') {
1542 $fullname =
$object->getFullName($langs);
1544 if (
$object->morphy ==
'mor') {
1545 $companyname =
$object->company;
1546 if (!empty($fullname)) {
1547 $companyalias = $fullname;
1550 $companyname = $fullname;
1551 if (!empty(
$object->company)) {
1552 $companyalias =
$object->company;
1557 $formquestion = array(
1558 array(
'label' => $langs->trans(
"NameToCreate"),
'type' =>
'text',
'name' =>
'companyname',
'value' => $companyname,
'morecss' =>
'minwidth300',
'moreattr' =>
'maxlength="128"'),
1559 array(
'label' => $langs->trans(
"AliasNames"),
'type' =>
'text',
'name' =>
'companyalias',
'value' => $companyalias,
'morecss' =>
'minwidth300',
'moreattr' =>
'maxlength="128"')
1562 print $form->formconfirm($_SERVER[
"PHP_SELF"].
"?rowid=".
$object->id, $langs->trans(
"CreateDolibarrThirdParty"), $langs->trans(
"ConfirmCreateThirdParty"),
"confirm_create_thirdparty", $formquestion,
'yes');
1566 if ($action ==
'valid') {
1567 $langs->load(
"mails");
1570 $adht->fetch(
$object->typeid);
1576 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
1580 $outputlangs->setDefaultLang(empty(
$object->thirdparty->default_lang) ? $mysoc->default_lang :
$object->thirdparty->default_lang);
1582 $outputlangs->loadLangs(array(
"main",
"members",
"companies",
"install",
"other"));
1584 $arraydefaultmessage =
null;
1587 if (!empty($labeltouse)) {
1588 $arraydefaultmessage = $formmail->getEMailTemplate($db,
'member', $user, $outputlangs, 0, 1, $labeltouse);
1591 if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
1592 $subject = $arraydefaultmessage->topic;
1593 $msg = $arraydefaultmessage->content;
1601 $tmp = $langs->trans(
"SendingAnEMailToMember");
1602 $tmp .=
'<br>'.$langs->trans(
"MailFrom").
': <b>'.
getDolGlobalString(
'ADHERENT_MAIL_FROM').
'</b>, ';
1603 $tmp .=
'<br>'.$langs->trans(
"MailRecipient").
': <b>'.
$object->email.
'</b>';
1605 $helpcontent .=
'<b>'.$langs->trans(
"MailFrom").
'</b>: '.
getDolGlobalString(
'ADHERENT_MAIL_FROM').
'<br>'.
"\n";
1606 $helpcontent .=
'<b>'.$langs->trans(
"MailRecipient").
'</b>: '.
$object->email.
'<br>'.
"\n";
1607 $helpcontent .=
'<b>'.$langs->trans(
"Subject").
'</b>:<br>'.
"\n";
1608 $helpcontent .= $subjecttosend.
"\n";
1609 $helpcontent .=
"<br>";
1610 $helpcontent .=
'<b>'.$langs->trans(
"Content").
'</b>:<br>';
1613 $label = $form->textwithpicto($tmp, $helpcontent, 1,
'help');
1616 $formquestion = array();
1618 $formquestion[] = array(
'type' =>
'checkbox',
'name' =>
'send_mail',
'label' => $label,
'value' => (
getDolGlobalString(
'ADHERENT_DEFAULT_SENDINFOBYMAIL') ?
true : false));
1621 $formquestion[] = array(
'type' =>
'other',
'label' => $langs->transnoentitiesnoconv(
"SynchroMailManEnabled"),
'value' =>
'');
1624 $formquestion[] = array(
'type' =>
'other',
'label' => $langs->transnoentitiesnoconv(
"SynchroSpipEnabled"),
'value' =>
'');
1626 print $form->formconfirm(
"card.php?rowid=".$id, $langs->trans(
"ValidateMember"), $langs->trans(
"ConfirmValidateMember"),
"confirm_valid", $formquestion,
'yes', 1, 250);
1630 if ($action ==
'resiliate') {
1631 $langs->load(
"mails");
1634 $adht->fetch(
$object->typeid);
1640 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
1644 $outputlangs->setDefaultLang(empty(
$object->thirdparty->default_lang) ? $mysoc->default_lang :
$object->thirdparty->default_lang);
1646 $outputlangs->loadLangs(array(
"main",
"members"));
1648 $arraydefaultmessage =
null;
1651 if (!empty($labeltouse)) {
1652 $arraydefaultmessage = $formmail->getEMailTemplate($db,
'member', $user, $outputlangs, 0, 1, $labeltouse);
1655 if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
1656 $subject = $arraydefaultmessage->topic;
1657 $msg = $arraydefaultmessage->content;
1665 $tmp = $langs->trans(
"SendingAnEMailToMember");
1666 $tmp .=
'<br>('.$langs->trans(
"MailFrom").
': <b>'.
getDolGlobalString(
'ADHERENT_MAIL_FROM').
'</b>, ';
1667 $tmp .= $langs->trans(
"MailRecipient").
': <b>'.
$object->email.
'</b>)';
1669 $helpcontent .=
'<b>'.$langs->trans(
"MailFrom").
'</b>: '.
getDolGlobalString(
'ADHERENT_MAIL_FROM').
'<br>'.
"\n";
1670 $helpcontent .=
'<b>'.$langs->trans(
"MailRecipient").
'</b>: '.
$object->email.
'<br>'.
"\n";
1671 $helpcontent .=
'<b>'.$langs->trans(
"Subject").
'</b>:<br>'.
"\n";
1672 $helpcontent .= $subjecttosend.
"\n";
1673 $helpcontent .=
"<br>";
1674 $helpcontent .=
'<b>'.$langs->trans(
"Content").
'</b>:<br>';
1677 $label = $form->textwithpicto($tmp, $helpcontent, 1,
'help');
1680 $formquestion = array();
1682 $formquestion[] = array(
'type' =>
'checkbox',
'name' =>
'send_mail',
'label' => $label,
'value' => (
getDolGlobalString(
'ADHERENT_DEFAULT_SENDINFOBYMAIL') ?
'true' :
'false'));
1685 $formquestion[] = array(
'type' =>
'hidden',
'name' =>
'backtopage',
'value' => ($backtopage !=
'1' ? $backtopage : $_SERVER[
"HTTP_REFERER"]));
1687 print $form->formconfirm(
"card.php?rowid=".$id, $langs->trans(
"ResiliateMember"), $langs->trans(
"ConfirmResiliateMember"),
"confirm_resiliate", $formquestion,
'no', 1, 240);
1691 if ($action ==
'exclude') {
1692 $langs->load(
"mails");
1695 $adht->fetch(
$object->typeid);
1701 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
1705 $outputlangs->setDefaultLang(empty(
$object->thirdparty->default_lang) ? $mysoc->default_lang :
$object->thirdparty->default_lang);
1707 $outputlangs->loadLangs(array(
"main",
"members"));
1709 $arraydefaultmessage =
null;
1712 if (!empty($labeltouse)) {
1713 $arraydefaultmessage = $formmail->getEMailTemplate($db,
'member', $user, $outputlangs, 0, 1, $labeltouse);
1716 if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
1717 $subject = $arraydefaultmessage->topic;
1718 $msg = $arraydefaultmessage->content;
1726 $tmp = $langs->trans(
"SendingAnEMailToMember");
1727 $tmp .=
'<br>('.$langs->trans(
"MailFrom").
': <b>'.
getDolGlobalString(
'ADHERENT_MAIL_FROM').
'</b>, ';
1728 $tmp .= $langs->trans(
"MailRecipient").
': <b>'.
$object->email.
'</b>)';
1730 $helpcontent .=
'<b>'.$langs->trans(
"MailFrom").
'</b>: '.
getDolGlobalString(
'ADHERENT_MAIL_FROM').
'<br>'.
"\n";
1731 $helpcontent .=
'<b>'.$langs->trans(
"MailRecipient").
'</b>: '.
$object->email.
'<br>'.
"\n";
1732 $helpcontent .=
'<b>'.$langs->trans(
"Subject").
'</b>:<br>'.
"\n";
1733 $helpcontent .= $subjecttosend.
"\n";
1734 $helpcontent .=
"<br>";
1735 $helpcontent .=
'<b>'.$langs->trans(
"Content").
'</b>:<br>';
1738 $label = $form->textwithpicto($tmp, $helpcontent, 1,
'help');
1741 $formquestion = array();
1743 $formquestion[] = array(
'type' =>
'checkbox',
'name' =>
'send_mail',
'label' => $label,
'value' => (
getDolGlobalString(
'ADHERENT_DEFAULT_SENDINFOBYMAIL') ?
'true' :
'false'));
1746 $formquestion[] = array(
'type' =>
'hidden',
'name' =>
'backtopage',
'value' => ($backtopage !=
'1' ? $backtopage : $_SERVER[
"HTTP_REFERER"]));
1748 print $form->formconfirm(
"card.php?rowid=".$id, $langs->trans(
"ExcludeMember"), $langs->trans(
"ConfirmExcludeMember"),
"confirm_exclude", $formquestion,
'no', 1, 240);
1752 if ($action ==
'delete') {
1753 $formquestion = array();
1755 $formquestion[] = array(
'type' =>
'hidden',
'name' =>
'backtopage',
'value' => ($backtopage !=
'1' ? $backtopage : $_SERVER[
"HTTP_REFERER"]));
1757 print $form->formconfirm(
"card.php?rowid=".$id, $langs->trans(
"DeleteMember"), $langs->trans(
"ConfirmDeleteMember"),
"confirm_delete", $formquestion,
'no', 1);
1761 if ($action ==
'add_spip') {
1762 print $form->formconfirm(
"card.php?rowid=".$id, $langs->trans(
'AddIntoSpip'), $langs->trans(
'AddIntoSpipConfirmation'),
'confirm_add_spip');
1765 if ($action ==
'del_spip') {
1766 print $form->formconfirm(
"card.php?rowid=$id", $langs->trans(
'DeleteIntoSpip'), $langs->trans(
'DeleteIntoSpipConfirmation'),
'confirm_del_spip');
1773 if (isModEnabled(
'societe')) {
1777 $linkback =
'<a href="'.DOL_URL_ROOT.
'/adherents/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
1779 $morehtmlref =
'<a href="'.DOL_URL_ROOT.
'/adherents/vcard.php?id='.
$object->id.
'" class="refid">';
1780 $morehtmlref .=
img_picto($langs->trans(
"Download").
' '.$langs->trans(
"VCard"),
'vcard.png',
'class="valignmiddle marginleftonly paddingrightonly"');
1781 $morehtmlref .=
'</a>';
1784 dol_banner_tab(
$object,
'rowid', $linkback, 1,
'rowid',
'ref', $morehtmlref);
1786 print
'<div class="fichecenter">';
1787 print
'<div class="fichehalfleft">';
1789 print
'<div class="underbanner clearboth"></div>';
1790 print
'<table class="border tableforfield centpercent">';
1794 print
'<tr><td class="titlefield">'.$langs->trans(
"Login").
' / '.$langs->trans(
"Id").
'</td><td class="valeur">'.
dol_escape_htmltag(
$object->login).
'</td></tr>';
1798 print
'<tr><td class="titlefield">'.$langs->trans(
"Type").
'</td>';
1799 print
'<td class="valeur">'.$adht->getNomUrl(1).
"</td></tr>\n";
1802 print
'<tr><td>'.$langs->trans(
"MemberNature").
'</td>';
1803 print
'<td class="valeur" >'.$object->getmorphylib(
'', 1).
'</td>';
1810 print
'<tr><td>'.$langs->trans(
"UserTitle").
'</td><td class="valeur">'.
$object->getCivilityLabel().
'</td>';
1815 print
'<tr><td>'.$langs->trans(
"Password").
'</td><td>';
1817 print preg_replace(
'/./i',
'*',
$object->pass);
1820 print
'<!-- '.$langs->trans(
"Crypted").
': '.
$object->pass_indatabase_crypted.
' -->';
1822 print
'<span class="opacitymedium">'.$langs->trans(
"Hidden").
'</span>';
1824 if (!empty(
$object->pass_indatabase) && empty(
$object->user_id)) {
1825 $langs->load(
"errors");
1826 $htmltext = $langs->trans(
"WarningPasswordSetWithNoAccount");
1827 print
' '.$form->textwithpicto(
'', $htmltext, 1,
'warning');
1833 print
'<tr><td>'.$langs->trans(
"SubscriptionEndDate").
'</td><td class="valeur">';
1837 print
" ".img_warning($langs->trans(
"Late"));
1840 if (
$object->need_subscription == 0) {
1841 print $langs->trans(
"SubscriptionNotNeeded");
1842 } elseif (!$adht->subscription) {
1843 print $langs->trans(
"SubscriptionNotRecorded");
1845 print
" ".img_warning($langs->trans(
"Late"));
1848 print $langs->trans(
"SubscriptionNotReceived");
1850 print
" ".img_warning($langs->trans(
"Late"));
1860 print
'<div class="fichehalfright">';
1861 print
'<div class="underbanner clearboth"></div>';
1863 print
'<table class="border tableforfield centpercent">';
1866 if (isModEnabled(
'category') && $user->hasRight(
'categorie',
'lire')) {
1867 print
'<tr><td>'.$langs->trans(
"Categories").
'</td>';
1868 print
'<td colspan="2">';
1869 print $form->showCategories(
$object->id, Categorie::TYPE_MEMBER, 1);
1874 print
'<tr><td class="titlefield">'.$langs->trans(
"DateOfBirth").
'</td><td class="valeur">'.
dol_print_date(
$object->birth,
'day').
'</td></tr>';
1878 require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
1879 print
'<tr><td>'.$langs->trans(
"DefaultLang").
'</td><td>';
1882 $langs->load(
"languages");
1883 $labellang = (
$object->default_lang ? $langs->trans(
'Language_'.
$object->default_lang) :
'');
1891 $htmltext = $langs->trans(
"Public",
getDolGlobalString(
'MAIN_INFO_SOCIETE_NOM'), $linkofpubliclist);
1892 print $form->textwithpicto($langs->trans(
"MembershipPublic"), $htmltext, 1,
'help',
'', 0, 3,
'membershippublic');
1893 print
'</td><td class="valeur">'.yn(
$object->public).
'</td></tr>';
1896 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
1899 if (isModEnabled(
'societe')) {
1901 $editenable = $user->hasRight(
'adherent',
'creer');
1902 print $form->editfieldkey(
'LinkedToDolibarrThirdParty',
'thirdparty',
'',
$object, $editenable);
1903 print
'</td><td colspan="2" class="valeur">';
1904 if ($action ==
'editthirdparty') {
1905 $htmlname =
'socid';
1906 print
'<form method="POST" action="'.$_SERVER[
'PHP_SELF'].
'" name="form'.$htmlname.
'">';
1907 print
'<input type="hidden" name="rowid" value="'.$object->id.
'">';
1908 print
'<input type="hidden" name="action" value="set'.$htmlname.
'">';
1909 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1910 print
'<table class="nobordernopadding">';
1912 print $form->select_company(
$object->socid,
'socid',
'', 1);
1914 print
'<td class="left"><input type="submit" class="button button-edit smallpaddingimp" value="'.$langs->trans(
"Modify").
'"></td>';
1915 print
'</tr></table></form>';
1919 $result = $company->fetch(
$object->socid);
1920 print $company->getNomUrl(1);
1923 $tmparray = $company->getOutstandingBills(
'customer');
1924 if (!empty($tmparray[
'refs'])) {
1925 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']).
')';
1930 print
'<span class="opacitymedium">'.$langs->trans(
"NoThirdPartyAssociatedToMember").
'</span>';
1938 $editenable = $user->hasRight(
'adherent',
'creer') && $user->hasRight(
'user',
'user',
'creer');
1939 print $form->editfieldkey(
'LinkedToDolibarrUser',
'login',
'',
$object, $editenable);
1940 print
'</td><td colspan="2" class="valeur">';
1941 if ($action ==
'editlogin') {
1942 $form->form_users($_SERVER[
'PHP_SELF'].
'?rowid='.
$object->id,
$object->user_id,
'userid', array());
1945 $linkeduser =
new User($db);
1946 $linkeduser->fetch(
$object->user_id);
1947 print $linkeduser->getNomUrl(-1);
1949 print
'<span class="opacitymedium">'.$langs->trans(
"NoDolibarrAccess").
'</span>';
1956 print
"</div></div>\n";
1957 print
'<div class="clearboth"></div>';
1966 print
'<div class="tabsAction">';
1968 $parameters = array();
1969 $reshook = $hookmanager->executeHooks(
'addMoreActionsButtons', $parameters,
$object, $action);
1970 if (empty($reshook)) {
1971 if ($action !=
'editlogin' && $action !=
'editthirdparty') {
1973 if (empty($user->socid)) {
1975 print
'<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?id='.((int)
$object->id).
'&action=presend&mode=init#formmailbeforetitle">'.$langs->trans(
'SendMail').
'</a>'.
"\n";
1994 if ($user->hasRight(
'adherent',
'creer')) {
1995 print
'<a class="butAction" href="card.php?rowid='.((int)
$object->id).
'&action=edit&token='.
newToken().
'">'.$langs->trans(
"Modify").
'</a>'.
"\n";
1997 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"Modify").
'</span>'.
"\n";
2002 if ($user->hasRight(
'adherent',
'creer')) {
2003 print
'<a class="butAction" href="card.php?rowid='.((int)
$object->id).
'&action=valid&token='.
newToken().
'">'.$langs->trans(
"Validate").
'</a>'.
"\n";
2005 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"Validate").
'</span>'.
"\n";
2011 if ($user->hasRight(
'adherent',
'creer')) {
2012 print
'<a class="butAction" href="card.php?rowid='.((int)
$object->id).
'&action=valid&token='.
newToken().
'">'.$langs->trans(
"Reenable").
"</a>\n";
2014 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"Reenable").
'</span>'.
"\n";
2020 if ($user->hasRight(
'adherent',
'supprimer')) {
2021 print
'<a class="butAction" href="card.php?rowid='.((int)
$object->id).
'&action=resiliate&token='.
newToken().
'">'.$langs->trans(
"Resiliate").
"</a></span>\n";
2023 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"Resiliate").
'</span>'.
"\n";
2029 if ($user->hasRight(
'adherent',
'supprimer')) {
2030 print
'<a class="butAction" href="card.php?rowid='.((int)
$object->id).
'&action=exclude&token='.
newToken().
'">'.$langs->trans(
"Exclude").
"</a></span>\n";
2032 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"Exclude").
'</span>'.
"\n";
2037 if (isModEnabled(
'societe') && !
$object->socid) {
2038 if ($user->hasRight(
'societe',
'creer')) {
2040 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";
2042 print
'<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans(
"ValidateBefore")).
'">'.$langs->trans(
"CreateDolibarrThirdParty").
'</a>'.
"\n";
2045 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"CreateDolibarrThirdParty").
'</span>'.
"\n";
2050 if (!$user->socid && !
$object->user_id) {
2051 if ($user->hasRight(
'user',
'user',
'creer')) {
2053 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";
2055 print
'<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans(
"ValidateBefore")).
'">'.$langs->trans(
"CreateDolibarrLogin").
'</a>'.
"\n";
2058 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"CreateDolibarrLogin").
'</span>'.
"\n";
2064 $isinspip = $mailmanspip->is_in_spip(
$object);
2066 if ($isinspip == 1) {
2067 print
'<a class="butAction" href="card.php?rowid='.((int)
$object->id).
'&action=del_spip&token='.
newToken().
'">'.$langs->trans(
"DeleteIntoSpip").
'</a>'.
"\n";
2069 if ($isinspip == 0) {
2070 print
'<a class="butAction" href="card.php?rowid='.((int)
$object->id).
'&action=add_spip&token='.
newToken().
'">'.$langs->trans(
"AddIntoSpip").
'</a>'.
"\n";
2075 if ($user->hasRight(
'adherent',
'supprimer')) {
2076 print
'<a class="butActionDelete" href="card.php?rowid='.((int)
$object->id).
'&action=delete&token='.
newToken().
'">'.$langs->trans(
"Delete").
'</a>'.
"\n";
2078 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"Delete").
'</span>'.
"\n";
2084 if ($isinspip == -1) {
2085 print
'<br><br><span class="error">'.$langs->trans(
'SPIPConnectionFailed').
': '.$mailmanspip->error.
'</span>';
2090 if (
GETPOST(
'modelselected')) {
2091 $action =
'presend';
2094 if ($action !=
'presend') {
2095 print
'<div class="fichecenter"><div class="fichehalfleft">';
2096 print
'<a name="builddoc"></a>';
2101 $urlsource = $_SERVER[
'PHP_SELF'].
'?id='.
$object->id;
2102 $genallowed = $user->hasRight(
'adherent',
'lire');
2103 $delallowed = $user->hasRight(
'adherent',
'creer');
2105 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);
2106 $somethingshown = $formfile->numoffiles;
2114 include_once DOL_DOCUMENT_ROOT.
'/core/lib/payments.lib.php';
2115 $validpaymentmethod = getValidOnlinePaymentMethods(
'');
2116 $useonlinepayment = count($validpaymentmethod);
2118 if ($useonlinepayment) {
2120 if (empty($amount)) {
2121 $amount = max($adht->amount,
$object->first_subscription_amount,
$object->last_subscription_amount);
2123 if (empty($amount)) {
2126 require_once DOL_DOCUMENT_ROOT.
'/core/lib/payments.lib.php';
2127 print showOnlinePaymentUrl(
'membersubscription',
$object->ref, $amount);
2130 print
'</div><div class="fichehalfright">';
2134 $morehtmlcenter =
'';
2135 $messagingUrl = DOL_URL_ROOT.
'/adherents/messaging.php?rowid='.
$object->id;
2136 $morehtmlcenter .=
dolGetButtonTitle($langs->trans(
'ShowAsConversation'),
'',
'fa fa-comments imgforviewmode', $messagingUrl,
'', 1);
2137 $morehtmlcenter .=
dolGetButtonTitle($langs->trans(
'SeeAll'),
'',
'fa fa-bars imgforviewmode', DOL_URL_ROOT.
'/adherents/agenda.php?id='.
$object->id);
2140 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formactions.class.php';
2142 $somethingshown = $formactions->showactions(
$object,
$object->element, $socid, 1,
'listactions', $MAXEVENT,
'', $morehtmlcenter);
2144 print
'</div></div>';
2148 $modelmail =
'member';
2149 $defaulttopic =
'CardContent';
2150 $diroutput =
$conf->adherent->dir_output;
2151 $trackid =
'mem'.$object->id;
2153 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.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
picto_from_langcode($codelang, $moreatt='', $notitlealt=0)
Return img flag of country for a language code or country code.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
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_concatdesc($text1, $text2, $forxml=false, $invert=false)
Concat 2 descriptions with a new line between them (second operand after first one with appropriate n...
complete_substitutions_array(&$substitutionarray, $outputlangs, $object=null, $parameters=null, $callfunc="completesubstitutionarray")
Complete the $substitutionarray with more entries coming from external module that had set the "subst...
make_substitutions($text, $substitutionarray, $outputlangs=null, $converttextinhtmlifnecessary=0)
Make substitution into a text string, replacing keys with vals from $substitutionarray (oldval=>newva...
getArrayOfSocialNetworks()
Get array of social network dictionary.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_clone($object, $native=2)
Create a clone of instance of object (new instance with same value for each properties) With native =...
dol_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...
div refaddress div address
image_format_supported($file, $acceptsvg=0)
Return if a filename is file name of a supported image format.
member_prepare_head(Adherent $object)
Return array head with list of tabs to view object information.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
$conf db name
Only used if Module[ID]Name translation string is not found.
getRandomPassword($generic=false, $replaceambiguouschars=null, $length=32)
Return a generated password using default module.
getMaxFileSizeArray()
Return the max allowed for file upload.
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.