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);
864 if ($action ==
'update_extras' && $user->hasRight(
'adherent',
'creer')) {
866 $attribute_name =
GETPOST(
'attribute',
'restricthtml');
869 $ret = $extrafields->setOptionalsFromPost(
null,
$object, $attribute_name);
874 $result =
$object->updateExtraField($attribute_name,
'MEMBER_MODIFY');
881 $action =
'edit_extras';
886 if (is_object($mailmanspip)) {
887 if ($user->hasRight(
'adherent',
'supprimer') && $action ==
'confirm_del_spip' && $confirm ==
'yes') {
889 if (!$mailmanspip->del_to_spip(
$object)) {
890 setEventMessages($langs->trans(
'DeleteIntoSpipError').
': '.$mailmanspip->error,
null,
'errors');
895 if ($user->hasRight(
'adherent',
'creer') && $action ==
'confirm_add_spip' && $confirm ==
'yes') {
897 if (!$mailmanspip->add_to_spip(
$object)) {
898 setEventMessages($langs->trans(
'AddIntoSpipError').
': '.$mailmanspip->error,
null,
'errors');
905 include DOL_DOCUMENT_ROOT.
'/core/actions_printing.inc.php';
908 $upload_dir =
$conf->adherent->dir_output;
909 $permissiontoadd = $user->hasRight(
'adherent',
'creer');
910 include DOL_DOCUMENT_ROOT.
'/core/actions_builddoc.inc.php';
913 $triggersendname =
'MEMBER_SENTBYMAIL';
915 $mode =
'emailfrommember';
916 $trackid =
'mem'.$object->id;
917 include DOL_DOCUMENT_ROOT.
'/core/actions_sendmails.inc.php';
925$form =
new Form($db);
930$title = $langs->trans(
"Member").
" - ".$langs->trans(
"Card");
931$help_url =
'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder';
933llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'mod-member page-card');
935$countrynotdefined = $langs->trans(
"ErrorSetACountryFirst").
' ('.$langs->trans(
"SeeAbove").
')';
937if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
941 if (empty(
$object->error) && $id) {
949 $objcanvas->display_canvas($action);
956 if ($action ==
'create') {
964 $object->country_code = $tmparray[
'code'];
965 $object->country = $tmparray[
'label'];
969 if (!empty($socid)) {
974 if (!($soc->id > 0)) {
975 $langs->load(
"errors");
976 print($langs->trans(
'ErrorRecordNotFound'));
985 if (
$conf->use_javascript_ajax) {
986 print
"\n".
'<script type="text/javascript">'.
"\n";
987 print
'jQuery(document).ready(function () {
988 jQuery("#selectcountry_id").change(function() {
989 document.formsoc.action.value="create";
990 document.formsoc.submit();
992 function initfieldrequired() {
993 jQuery("#tdcompany").removeClass("fieldrequired");
994 jQuery("#tdlastname").removeClass("fieldrequired");
995 jQuery("#tdfirstname").removeClass("fieldrequired");
996 if (jQuery(\'input[name="morphy"]:checked\').val() == \'mor\') {
997 jQuery("#tdcompany").addClass("fieldrequired");
999 if (jQuery(\'input[name="morphy"]:checked\').val() == \'phy\') {
1000 jQuery("#tdlastname").addClass("fieldrequired");
1001 jQuery("#tdfirstname").addClass("fieldrequired");
1004 jQuery(\'input[name="morphy"]\').change(function() {
1005 initfieldrequired();
1007 initfieldrequired();
1009 print
'</script>'.
"\n";
1012 print
'<form name="formsoc" action="'.$_SERVER[
"PHP_SELF"].
'" method="post" enctype="multipart/form-data">';
1013 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1014 print
'<input type="hidden" name="action" value="add">';
1015 print
'<input type="hidden" name="socid" value="'.$socid.
'">';
1017 print
'<input type="hidden" name="backtopage" value="'.($backtopage !=
'1' ? $backtopage : $_SERVER[
"HTTP_REFERER"]).
'">';
1022 print
'<table class="border centpercent">';
1027 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>';
1032 require_once DOL_DOCUMENT_ROOT.
'/core/lib/security2.lib.php';
1034 print
'<tr><td><span class="fieldrequired">'.$langs->trans(
"Password").
'</span></td><td>';
1035 print
'<input type="text" class="minwidth300" maxlength="50" name="password" value="'.dol_escape_htmltag($generated_password).
'">';
1040 print
'<tr><td class="fieldrequired">'.$langs->trans(
"MemberType").
'</td><td>';
1041 $listetype = $adht->liste_array(1);
1042 print
img_picto(
'', $adht->picto,
'class="pictofixedwidth"');
1043 if (count($listetype)) {
1044 print $form->selectarray(
"typeid", $listetype, (
GETPOSTINT(
'typeid') ?
GETPOSTINT(
'typeid') : $typeid), (count($listetype) > 1 ? 1 : 0), 0, 0,
'', 0, 0, 0,
'',
'minwidth200', 1);
1046 print
'<span class="error">'.$langs->trans(
"NoTypeDefinedGoToSetup").
'</span>';
1048 if ($user->hasRight(
'member',
'configurer')) {
1049 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>';
1055 $morphys[
"phy"] = $langs->trans(
"Physical");
1056 $morphys[
"mor"] = $langs->trans(
"Moral");
1057 $checkednature =
GETPOST(
"morphy",
'alpha');
1059 print
'<tr><td class="fieldrequired">'.$langs->trans(
"MemberNature").
"</td><td>\n";
1060 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>';
1061 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>';
1064 if (
$conf->use_javascript_ajax) {
1066 function refreshNatureCss() {
1067 jQuery(".spannature").each(function( index ) {
1068 console.log(jQuery("#spannature"+(index+1)+" .checkforselect").is(":checked"));
1069 if (jQuery("#spannature"+(index+1)+" .checkforselect").is(":checked")) {
1071 jQuery("#spannature"+(index+1)).addClass("member-individual-back").removeClass("nonature-back");
1074 jQuery("#spannature"+(index+1)).addClass("member-company-back").removeClass("nonature-back");
1077 jQuery("#spannature"+(index+1)).removeClass("member-individual-back").removeClass("member-company-back").addClass("nonature-back");
1081 jQuery(".spannature").click(function(){
1082 console.log("We click on a nature");
1092 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>';
1095 print
'<tr><td>'.$langs->trans(
"UserTitle").
'</td><td>';
1096 print $formcompany->select_civility(
GETPOSTINT(
'civility_id') ?
GETPOSTINT(
'civility_id') :
$object->civility_id,
'civility_id',
'maxwidth150', 1).
'</td>';
1100 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>';
1104 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>';
1108 print
'<tr><td>'.$langs->trans(
"Gender").
'</td>';
1110 $arraygender = array(
'man' => $langs->trans(
"Genderman"),
'woman' => $langs->trans(
"Genderwoman"),
'other' => $langs->trans(
"Genderother"));
1111 print $form->selectarray(
'gender', $arraygender,
GETPOST(
'gender',
'alphanohtml'), 1, 0, 0,
'', 0, 0, 0,
'',
'minwidth100', 1);
1115 print
'<tr><td>'.(getDolGlobalString(
'ADHERENT_MAIL_REQUIRED') ?
'<span class="fieldrequired">' :
'').$langs->trans(
"EMail").(getDolGlobalString(
'ADHERENT_MAIL_REQUIRED') ?
'</span>' :
'').
'</td>';
1116 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>';
1119 print
'<tr><td>'.$form->editfieldkey(
'Web',
'member_url',
GETPOST(
'member_url',
'alpha'),
$object, 0).
'</td>';
1120 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>';
1123 print
'<tr><td class="tdtop">'.$langs->trans(
"Address").
'</td><td>';
1124 print
'<textarea name="address" wrap="soft" class="quatrevingtpercent" rows="2">'.(GETPOSTISSET(
'address') ?
GETPOST(
'address',
'alphanohtml') : $soc->
address).
'</textarea>';
1128 print
'<tr><td>'.$langs->trans(
"Zip").
' / '.$langs->trans(
"Town").
'</td><td>';
1129 print $formcompany->select_ziptown((GETPOSTISSET(
'zipcode') ?
GETPOST(
'zipcode',
'alphanohtml') : $soc->zip),
'zipcode', array(
'town',
'selectcountry_id',
'state_id'), 6);
1131 print $formcompany->select_ziptown((GETPOSTISSET(
'town') ?
GETPOST(
'town',
'alphanohtml') : $soc->town),
'town', array(
'zipcode',
'selectcountry_id',
'state_id'));
1135 if (empty($soc->country_id)) {
1136 $soc->country_id = $mysoc->country_id;
1137 $soc->country_code = $mysoc->country_code;
1138 $soc->state_id = $mysoc->state_id;
1140 print
'<tr><td>'.$langs->trans(
'Country').
'</td><td>';
1141 print
img_picto(
'',
'country',
'class="pictofixedwidth"');
1142 print $form->select_country(GETPOSTISSET(
'country_id') ?
GETPOST(
'country_id',
'alpha') : $soc->country_id,
'country_id');
1144 print
info_admin($langs->trans(
"YouCanChangeValuesForThisListFromDictionarySetup"), 1);
1150 print
'<tr><td>'.$langs->trans(
'State').
'</td><td>';
1151 if ($soc->country_id || GETPOSTISSET(
'country_id')) {
1152 print
img_picto(
'',
'state',
'class="pictofixedwidth"');
1153 print $formcompany->select_state(GETPOSTISSET(
'state_id') ?
GETPOSTINT(
'state_id') : $soc->state_id, GETPOSTISSET(
'country_id') ?
GETPOSTINT(
'country_id') : $soc->country_code);
1155 print $countrynotdefined;
1161 print
'<tr><td>'.$langs->trans(
"PhonePro").
'</td>';
1162 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>';
1165 print
'<tr><td>'.$langs->trans(
"PhonePerso").
'</td>';
1166 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>';
1169 print
'<tr><td>'.$langs->trans(
"PhoneMobile").
'</td>';
1170 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>';
1172 if (isModEnabled(
'socialnetworks')) {
1173 foreach ($socialnetworks as $key => $value) {
1174 if (!$value[
'active']) {
1177 $val = (GETPOSTISSET(
'member_'.$key) ?
GETPOST(
'member_'.$key,
'alpha') : (empty(
$object->socialnetworks[$key]) ?
'' :
$object->socialnetworks[$key]));
1178 print
'<tr><td>'.$langs->trans($value[
'label']).
'</td><td><input type="text" name="member_'.$key.
'" size="40" value="'.$val.
'"></td></tr>';
1183 print
"<tr><td>".$langs->trans(
"DateOfBirth").
"</td><td>\n";
1184 print
img_picto(
'',
'object_calendar',
'class="pictofixedwidth"').$form->selectDate((
$object->birth ?
$object->birth : -1),
'birth', 0, 0, 1,
'formsoc');
1185 print
"</td></tr>\n";
1189 $htmltext = $langs->trans(
"Public",
getDolGlobalString(
'MAIN_INFO_SOCIETE_NOM'), $linkofpubliclist);
1190 print $form->textwithpicto($langs->trans(
"MembershipPublic"), $htmltext, 1,
'help',
'', 0, 3,
'membershippublic');
1191 print
"</td><td>\n";
1192 print $form->selectyesno(
"public",
$object->public, 1,
false, 0, 1);
1193 print
"</td></tr>\n";
1196 if (isModEnabled(
'category') && $user->hasRight(
'categorie',
'lire')) {
1197 print
'<tr><td>'.$form->editfieldkey(
"Categories",
'memcats',
'',
$object, 0).
'</td><td>';
1198 $cate_arbo = $form->select_all_categories(Categorie::TYPE_MEMBER,
'',
'parent', 64, 0, 3);
1199 print
img_picto(
'',
'category').$form->multiselectarray(
'memcats', $cate_arbo,
GETPOST(
'memcats',
'array'), 0, 0,
'quatrevingtpercent widthcentpercentminusx', 0, 0);
1204 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_add.tpl.php';
1211 print $form->buttonsSaveCancel(
"AddMember");
1217 if ($action ==
'edit') {
1223 $res =
$object->fetch_optionals();
1230 $adht->fetch(
$object->typeid);
1234 if (!empty($country) ||
$object->country_id) {
1235 $sql =
"SELECT rowid, code, label from ".MAIN_DB_PREFIX.
"c_country";
1236 $sql .=
" WHERE rowid = ".(int) (!empty($country) ? $country :
$object->country_id);
1237 $resql = $db->query($sql);
1239 $obj = $db->fetch_object($resql);
1244 if (is_object($obj)) {
1245 $object->country_id = $obj->rowid;
1246 $object->country_code = $obj->code;
1247 $object->country = $langs->trans(
"Country".$obj->code) ? $langs->trans(
"Country".$obj->code) : $obj->label;
1254 if (
$conf->use_javascript_ajax) {
1255 print
"\n".
'<script type="text/javascript">';
1256 print
'jQuery(document).ready(function () {
1257 jQuery("#selectcountry_id").change(function() {
1258 document.formsoc.action.value="edit";
1259 document.formsoc.submit();
1261 function initfieldrequired() {
1262 jQuery("#tdcompany").removeClass("fieldrequired");
1263 jQuery("#tdlastname").removeClass("fieldrequired");
1264 jQuery("#tdfirstname").removeClass("fieldrequired");
1265 if (jQuery(\'input[name="morphy"]:checked\').val() == \'mor\') {
1266 jQuery("#tdcompany").addClass("fieldrequired");
1268 if (jQuery(\'input[name="morphy"]:checked\').val() == \'phy\') {
1269 jQuery("#tdlastname").addClass("fieldrequired");
1270 jQuery("#tdfirstname").addClass("fieldrequired");
1273 jQuery(\'input[name="morphy"]\').change(function() {
1274 initfieldrequired();
1276 initfieldrequired();
1278 print
'</script>'.
"\n";
1281 print
'<form name="formsoc" action="'.$_SERVER[
"PHP_SELF"].
'" method="post" enctype="multipart/form-data">';
1282 print
'<input type="hidden" name="token" value="'.newToken().
'" />';
1283 print
'<input type="hidden" name="action" value="update" />';
1284 print
'<input type="hidden" name="rowid" value="'.$id.
'" />';
1285 print
'<input type="hidden" name="statut" value="'.$object->status.
'" />';
1287 print
'<input type="hidden" name="backtopage" value="'.($backtopage !=
'1' ? $backtopage : $_SERVER[
"HTTP_REFERER"]).
'">';
1292 print
'<table class="border centpercent">';
1295 print
'<tr><td class="titlefieldcreate">'.$langs->trans(
"Ref").
'</td><td class="valeur">'.
$object->ref.
'</td></tr>';
1299 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>';
1304 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>';
1308 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Type").
'</td><td>';
1309 if ($user->hasRight(
'adherent',
'creer')) {
1310 print $form->selectarray(
"typeid", $adht->liste_array(), (GETPOSTISSET(
"typeid") ?
GETPOSTINT(
"typeid") :
$object->typeid), 0, 0, 0,
'', 0, 0, 0,
'',
'minwidth200', 1);
1312 print $adht->getNomUrl(1);
1313 print
'<input type="hidden" name="typeid" value="'.$object->typeid.
'">';
1318 $morphys[
"phy"] = $langs->trans(
"Physical");
1319 $morphys[
"mor"] = $langs->trans(
"Moral");
1320 $checkednature = (GETPOSTISSET(
"morphy") ?
GETPOST(
"morphy",
'alpha') :
$object->morphy);
1321 print
'<tr><td><span class="fieldrequired">'.$langs->trans(
"MemberNature").
'</span></td><td>';
1322 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>';
1323 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>';
1327 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>';
1330 print
'<tr><td>'.$langs->trans(
"UserTitle").
'</td><td>';
1331 print $formcompany->select_civility(GETPOSTISSET(
"civility_id") ?
GETPOST(
"civility_id",
'alpha') :
$object->civility_id,
'civility_id',
'maxwidth150', 1);
1336 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>';
1340 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>';
1344 print
'<tr><td>'.$langs->trans(
"Gender").
'</td>';
1346 $arraygender = array(
'man' => $langs->trans(
"Genderman"),
'woman' => $langs->trans(
"Genderwoman"),
'other' => $langs->trans(
"Genderother"));
1347 print $form->selectarray(
'gender', $arraygender, GETPOSTISSET(
'gender') ?
GETPOST(
'gender',
'alphanohtml') :
$object->gender, 1, 0, 0,
'', 0, 0, 0,
'',
'minwidth100', 1);
1351 print
'<tr><td>'.$langs->trans(
"Photo").
'</td>';
1352 print
'<td class="hideonsmartphone" valign="middle">';
1353 print $form->showphoto(
'memberphoto',
$object).
"\n";
1354 if ($caneditfieldmember) {
1358 print
'<table class="nobordernopadding">';
1360 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>';
1364 $maxmin = $maxfilesizearray[
'maxmin'];
1366 print
'<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).
'">';
1368 print
'<input type="file" class="flat" name="photo" id="photoinput">';
1375 print
'<tr><td>'.(getDolGlobalString(
"ADHERENT_MAIL_REQUIRED") ?
'<span class="fieldrequired">' :
'').$langs->trans(
"EMail").(getDolGlobalString(
"ADHERENT_MAIL_REQUIRED") ?
'</span>' :
'').
'</td>';
1376 print
'<td>'.img_picto(
'',
'object_email',
'class="pictofixedwidth"').
'<input type="text" name="member_email" class="minwidth300" maxlength="255" value="'.(GETPOSTISSET(
"member_email") ?
GETPOST(
"member_email",
'alphanohtml', 2) :
$object->
email).
'"></td></tr>';
1379 print
'<tr><td>'.$form->editfieldkey(
'Web',
'member_url',
GETPOST(
'member_url',
'alpha'),
$object, 0).
'</td>';
1380 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>';
1383 print
'<tr><td>'.$langs->trans(
"Address").
'</td><td>';
1384 print
'<textarea name="address" wrap="soft" class="quatrevingtpercent" rows="'.ROWS_2.
'">'.(GETPOSTISSET(
"address") ?
GETPOST(
"address",
'alphanohtml', 2) :
$object->
address).
'</textarea>';
1388 print
'<tr><td>'.$langs->trans(
"Zip").
' / '.$langs->trans(
"Town").
'</td><td>';
1389 print $formcompany->select_ziptown((GETPOSTISSET(
"zipcode") ?
GETPOST(
"zipcode",
'alphanohtml', 2) :
$object->zip),
'zipcode', array(
'town',
'selectcountry_id',
'state_id'), 6);
1391 print $formcompany->select_ziptown((GETPOSTISSET(
"town") ?
GETPOST(
"town",
'alphanohtml', 2) :
$object->town),
'town', array(
'zipcode',
'selectcountry_id',
'state_id'));
1396 print
'<tr><td>'.$langs->trans(
'Country').
'</td><td>';
1397 print
img_picto(
'',
'country',
'class="pictofixedwidth"');
1398 print $form->select_country(GETPOSTISSET(
"country_id") ?
GETPOST(
"country_id",
"alpha") :
$object->country_id,
'country_id');
1400 print
info_admin($langs->trans(
"YouCanChangeValuesForThisListFromDictionarySetup"), 1);
1406 print
'<tr><td>'.$langs->trans(
'State').
'</td><td>';
1407 print
img_picto(
'',
'state',
'class="pictofixedwidth"');
1408 print $formcompany->select_state(
$object->state_id, GETPOSTISSET(
"country_id") ?
GETPOST(
"country_id",
"alpha") :
$object->country_id);
1413 print
'<tr><td>'.$langs->trans(
"PhonePro").
'</td>';
1414 print
'<td>'.img_picto(
'',
'object_phoning',
'class="pictofixedwidth"').
'<input type="text" name="phone" value="'.(GETPOSTISSET(
"phone") ?
GETPOST(
"phone") :
$object->phone).
'"></td></tr>';
1417 print
'<tr><td>'.$langs->trans(
"PhonePerso").
'</td>';
1418 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>';
1421 print
'<tr><td>'.$langs->trans(
"PhoneMobile").
'</td>';
1422 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>';
1424 if (isModEnabled(
'socialnetworks')) {
1425 foreach ($socialnetworks as $key => $value) {
1426 if (!$value[
'active']) {
1429 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>';
1434 print
"<tr><td>".$langs->trans(
"DateOfBirth").
"</td><td>\n";
1435 print
img_picto(
'',
'object_calendar',
'class="pictofixedwidth"').$form->selectDate((
$object->birth ?
$object->birth : -1),
'birth', 0, 0, 1,
'formsoc');
1436 print
"</td></tr>\n";
1440 print
'<tr><td>'.$form->editfieldkey(
'DefaultLang',
'default_lang',
'',
$object, 0).
'</td><td colspan="3">'.
"\n";
1441 print
img_picto(
'',
'language',
'class="pictofixedwidth"').$formadmin->select_language(
$object->default_lang,
'default_lang', 0, array(), 1);
1448 $htmltext = $langs->trans(
"Public",
getDolGlobalString(
'MAIN_INFO_SOCIETE_NOM'), $linkofpubliclist);
1449 print $form->textwithpicto($langs->trans(
"MembershipPublic"), $htmltext, 1,
'help',
'', 0, 3,
'membershippublic');
1450 print
"</td><td>\n";
1451 print $form->selectyesno(
"public", (GETPOSTISSET(
"public") ?
GETPOST(
"public",
'alphanohtml', 2) :
$object->public), 1, false, 0, 1);
1452 print
"</td></tr>\n";
1455 if (isModEnabled(
'category') && $user->hasRight(
'categorie',
'lire')) {
1456 print
'<tr><td>'.$form->editfieldkey(
"Categories",
'memcats',
'',
$object, 0).
'</td>';
1458 $cate_arbo = $form->select_all_categories(Categorie::TYPE_MEMBER,
'',
'', 64, 0, 3);
1460 $cats =
$c->containing(
$object->id, Categorie::TYPE_MEMBER);
1461 $arrayselected = array();
1462 if (is_array($cats)) {
1463 foreach ($cats as $cat) {
1464 $arrayselected[] = $cat->id;
1467 print
img_picto(
'',
'category',
'class="pictofixedwidth"');
1468 print $form->multiselectarray(
'memcats', $cate_arbo, $arrayselected, 0, 0,
'widthcentpercentminusx', 0,
'100%');
1473 if (isModEnabled(
'societe')) {
1474 print
'<tr><td>'.$langs->trans(
"LinkedToDolibarrThirdParty").
'</td><td colspan="2" class="valeur">';
1477 $result = $company->fetch(
$object->socid);
1478 print $company->getNomUrl(1);
1480 print $langs->trans(
"NoThirdPartyAssociatedToMember");
1486 print
'<tr><td>'.$langs->trans(
"LinkedToDolibarrUser").
'</td><td colspan="2" class="valeur">';
1488 $form->form_users($_SERVER[
'PHP_SELF'].
'?rowid='.
$object->id,
$object->user_id,
'none');
1490 print $langs->trans(
"NoDolibarrAccess");
1495 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_edit.tpl.php';
1500 print $form->buttonsSaveCancel(
"Save",
'Cancel');
1506 if ($id > 0 && $action !=
'edit') {
1512 $res =
$object->fetch_optionals();
1519 $res = $adht->fetch(
$object->typeid);
1531 print
dol_get_fiche_head($head,
'general', $langs->trans(
"Member"), -1,
'user', 0,
'',
'', 0,
'', 1);
1534 if ($action ==
'create_user') {
1535 $login = (GETPOSTISSET(
'login') ?
GETPOST(
'login',
'alphanohtml') :
$object->login);
1536 if (empty($login)) {
1538 include_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
1541 if (empty($login)) {
1542 $login = strtolower(substr(
$object->firstname, 0, 4)).strtolower(substr(
$object->lastname, 0, 4));
1546 $formquestion = array(
1547 array(
'label' => $langs->trans(
"LoginToCreate"),
'type' =>
'text',
'name' =>
'login',
'value' => $login)
1549 if (isModEnabled(
'societe') &&
$object->socid > 0) {
1551 $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")));
1554 if (isModEnabled(
'societe') &&
$object->socid <= 0) {
1555 $text .= $langs->trans(
"UserWillBeInternalUser").
'<br>';
1557 $text .= $langs->trans(
"ConfirmCreateLogin");
1558 print $form->formconfirm($_SERVER[
"PHP_SELF"].
"?rowid=".
$object->id, $langs->trans(
"CreateDolibarrLogin"), $text,
"confirm_create_user", $formquestion,
'yes');
1562 if ($action ==
'create_thirdparty') {
1564 $fullname =
$object->getFullName($langs);
1566 if (
$object->morphy ==
'mor') {
1567 $companyname =
$object->company;
1568 if (!empty($fullname)) {
1569 $companyalias = $fullname;
1572 $companyname = $fullname;
1573 if (!empty(
$object->company)) {
1574 $companyalias =
$object->company;
1579 $formquestion = array(
1580 array(
'label' => $langs->trans(
"NameToCreate"),
'type' =>
'text',
'name' =>
'companyname',
'value' => $companyname,
'morecss' =>
'minwidth300',
'moreattr' =>
'maxlength="128"'),
1581 array(
'label' => $langs->trans(
"AliasNames"),
'type' =>
'text',
'name' =>
'companyalias',
'value' => $companyalias,
'morecss' =>
'minwidth300',
'moreattr' =>
'maxlength="128"')
1584 print $form->formconfirm($_SERVER[
"PHP_SELF"].
"?rowid=".
$object->id, $langs->trans(
"CreateDolibarrThirdParty"), $langs->trans(
"ConfirmCreateThirdParty"),
"confirm_create_thirdparty", $formquestion,
'yes');
1588 if ($action ==
'valid') {
1589 $langs->load(
"mails");
1592 $adht->fetch(
$object->typeid);
1598 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
1602 $outputlangs->setDefaultLang(empty(
$object->thirdparty->default_lang) ? $mysoc->default_lang :
$object->thirdparty->default_lang);
1604 $outputlangs->loadLangs(array(
"main",
"members",
"companies",
"install",
"other"));
1606 $arraydefaultmessage =
null;
1609 if (!empty($labeltouse)) {
1610 $arraydefaultmessage = $formmail->getEMailTemplate($db,
'member', $user, $outputlangs, 0, 1, $labeltouse);
1613 if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
1614 $subject = $arraydefaultmessage->topic;
1615 $msg = $arraydefaultmessage->content;
1623 $tmp = $langs->trans(
"SendingAnEMailToMember");
1624 $tmp .=
'<br>'.$langs->trans(
"MailFrom").
': <b>'.
getDolGlobalString(
'ADHERENT_MAIL_FROM').
'</b>, ';
1625 $tmp .=
'<br>'.$langs->trans(
"MailRecipient").
': <b>'.
$object->email.
'</b>';
1627 $helpcontent .=
'<b>'.$langs->trans(
"MailFrom").
'</b>: '.
getDolGlobalString(
'ADHERENT_MAIL_FROM').
'<br>'.
"\n";
1628 $helpcontent .=
'<b>'.$langs->trans(
"MailRecipient").
'</b>: '.
$object->email.
'<br>'.
"\n";
1629 $helpcontent .=
'<b>'.$langs->trans(
"Subject").
'</b>:<br>'.
"\n";
1630 $helpcontent .= $subjecttosend.
"\n";
1631 $helpcontent .=
"<br>";
1632 $helpcontent .=
'<b>'.$langs->trans(
"Content").
'</b>:<br>';
1635 $label = $form->textwithpicto($tmp, $helpcontent, 1,
'help');
1638 $formquestion = array();
1640 $formquestion[] = array(
'type' =>
'checkbox',
'name' =>
'send_mail',
'label' => $label,
'value' => (
getDolGlobalString(
'ADHERENT_DEFAULT_SENDINFOBYMAIL') ?
true : false));
1643 $formquestion[] = array(
'type' =>
'other',
'label' => $langs->transnoentitiesnoconv(
"SynchroMailManEnabled"),
'value' =>
'');
1646 $formquestion[] = array(
'type' =>
'other',
'label' => $langs->transnoentitiesnoconv(
"SynchroSpipEnabled"),
'value' =>
'');
1648 print $form->formconfirm(
"card.php?rowid=".$id, $langs->trans(
"ValidateMember"), $langs->trans(
"ConfirmValidateMember"),
"confirm_valid", $formquestion,
'yes', 1, 250);
1652 if ($action ==
'resiliate') {
1653 $langs->load(
"mails");
1656 $adht->fetch(
$object->typeid);
1662 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
1666 $outputlangs->setDefaultLang(empty(
$object->thirdparty->default_lang) ? $mysoc->default_lang :
$object->thirdparty->default_lang);
1668 $outputlangs->loadLangs(array(
"main",
"members"));
1670 $arraydefaultmessage =
null;
1673 if (!empty($labeltouse)) {
1674 $arraydefaultmessage = $formmail->getEMailTemplate($db,
'member', $user, $outputlangs, 0, 1, $labeltouse);
1677 if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
1678 $subject = $arraydefaultmessage->topic;
1679 $msg = $arraydefaultmessage->content;
1687 $tmp = $langs->trans(
"SendingAnEMailToMember");
1688 $tmp .=
'<br>('.$langs->trans(
"MailFrom").
': <b>'.
getDolGlobalString(
'ADHERENT_MAIL_FROM').
'</b>, ';
1689 $tmp .= $langs->trans(
"MailRecipient").
': <b>'.
$object->email.
'</b>)';
1691 $helpcontent .=
'<b>'.$langs->trans(
"MailFrom").
'</b>: '.
getDolGlobalString(
'ADHERENT_MAIL_FROM').
'<br>'.
"\n";
1692 $helpcontent .=
'<b>'.$langs->trans(
"MailRecipient").
'</b>: '.
$object->email.
'<br>'.
"\n";
1693 $helpcontent .=
'<b>'.$langs->trans(
"Subject").
'</b>:<br>'.
"\n";
1694 $helpcontent .= $subjecttosend.
"\n";
1695 $helpcontent .=
"<br>";
1696 $helpcontent .=
'<b>'.$langs->trans(
"Content").
'</b>:<br>';
1699 $label = $form->textwithpicto($tmp, $helpcontent, 1,
'help');
1702 $formquestion = array();
1704 $formquestion[] = array(
'type' =>
'checkbox',
'name' =>
'send_mail',
'label' => $label,
'value' => (
getDolGlobalString(
'ADHERENT_DEFAULT_SENDINFOBYMAIL') ?
'true' :
'false'));
1707 $formquestion[] = array(
'type' =>
'hidden',
'name' =>
'backtopage',
'value' => ($backtopage !=
'1' ? $backtopage : $_SERVER[
"HTTP_REFERER"]));
1709 print $form->formconfirm(
"card.php?rowid=".$id, $langs->trans(
"ResiliateMember"), $langs->trans(
"ConfirmResiliateMember"),
"confirm_resiliate", $formquestion,
'no', 1, 240);
1713 if ($action ==
'exclude') {
1714 $langs->load(
"mails");
1717 $adht->fetch(
$object->typeid);
1723 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
1727 $outputlangs->setDefaultLang(empty(
$object->thirdparty->default_lang) ? $mysoc->default_lang :
$object->thirdparty->default_lang);
1729 $outputlangs->loadLangs(array(
"main",
"members"));
1731 $arraydefaultmessage =
null;
1734 if (!empty($labeltouse)) {
1735 $arraydefaultmessage = $formmail->getEMailTemplate($db,
'member', $user, $outputlangs, 0, 1, $labeltouse);
1738 if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
1739 $subject = $arraydefaultmessage->topic;
1740 $msg = $arraydefaultmessage->content;
1748 $tmp = $langs->trans(
"SendingAnEMailToMember");
1749 $tmp .=
'<br>('.$langs->trans(
"MailFrom").
': <b>'.
getDolGlobalString(
'ADHERENT_MAIL_FROM').
'</b>, ';
1750 $tmp .= $langs->trans(
"MailRecipient").
': <b>'.
$object->email.
'</b>)';
1752 $helpcontent .=
'<b>'.$langs->trans(
"MailFrom").
'</b>: '.
getDolGlobalString(
'ADHERENT_MAIL_FROM').
'<br>'.
"\n";
1753 $helpcontent .=
'<b>'.$langs->trans(
"MailRecipient").
'</b>: '.
$object->email.
'<br>'.
"\n";
1754 $helpcontent .=
'<b>'.$langs->trans(
"Subject").
'</b>:<br>'.
"\n";
1755 $helpcontent .= $subjecttosend.
"\n";
1756 $helpcontent .=
"<br>";
1757 $helpcontent .=
'<b>'.$langs->trans(
"Content").
'</b>:<br>';
1760 $label = $form->textwithpicto($tmp, $helpcontent, 1,
'help');
1763 $formquestion = array();
1765 $formquestion[] = array(
'type' =>
'checkbox',
'name' =>
'send_mail',
'label' => $label,
'value' => (
getDolGlobalString(
'ADHERENT_DEFAULT_SENDINFOBYMAIL') ?
'true' :
'false'));
1768 $formquestion[] = array(
'type' =>
'hidden',
'name' =>
'backtopage',
'value' => ($backtopage !=
'1' ? $backtopage : $_SERVER[
"HTTP_REFERER"]));
1770 print $form->formconfirm(
"card.php?rowid=".$id, $langs->trans(
"ExcludeMember"), $langs->trans(
"ConfirmExcludeMember"),
"confirm_exclude", $formquestion,
'no', 1, 240);
1774 if ($action ==
'delete') {
1775 $formquestion = array();
1777 $formquestion[] = array(
'type' =>
'hidden',
'name' =>
'backtopage',
'value' => ($backtopage !=
'1' ? $backtopage : $_SERVER[
"HTTP_REFERER"]));
1779 print $form->formconfirm(
"card.php?rowid=".$id, $langs->trans(
"DeleteMember"), $langs->trans(
"ConfirmDeleteMember"),
"confirm_delete", $formquestion,
'no', 1);
1783 if ($action ==
'add_spip') {
1784 print $form->formconfirm(
"card.php?rowid=".$id, $langs->trans(
'AddIntoSpip'), $langs->trans(
'AddIntoSpipConfirmation'),
'confirm_add_spip');
1787 if ($action ==
'del_spip') {
1788 print $form->formconfirm(
"card.php?rowid=$id", $langs->trans(
'DeleteIntoSpip'), $langs->trans(
'DeleteIntoSpipConfirmation'),
'confirm_del_spip');
1795 if (isModEnabled(
'societe')) {
1799 $linkback =
'<a href="'.DOL_URL_ROOT.
'/adherents/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
1801 $morehtmlref =
'<a href="'.DOL_URL_ROOT.
'/adherents/vcard.php?id='.
$object->id.
'" class="refid">';
1802 $morehtmlref .=
img_picto($langs->trans(
"Download").
' '.$langs->trans(
"VCard"),
'vcard.png',
'class="valignmiddle marginleftonly paddingrightonly"');
1803 $morehtmlref .=
'</a>';
1806 dol_banner_tab(
$object,
'rowid', $linkback, 1,
'rowid',
'ref', $morehtmlref);
1808 print
'<div class="fichecenter">';
1809 print
'<div class="fichehalfleft">';
1811 print
'<div class="underbanner clearboth"></div>';
1812 print
'<table class="border tableforfield centpercent">';
1816 print
'<tr><td class="titlefield">'.$langs->trans(
"Login").
' / '.$langs->trans(
"Id").
'</td><td class="valeur">'.
dol_escape_htmltag(
$object->login).
'</td></tr>';
1820 print
'<tr><td class="titlefield">'.$langs->trans(
"Type").
'</td>';
1821 print
'<td class="valeur">'.$adht->getNomUrl(1).
"</td></tr>\n";
1824 print
'<tr><td>'.$langs->trans(
"MemberNature").
'</td>';
1825 print
'<td class="valeur" >'.$object->getmorphylib(
'', 1).
'</td>';
1832 print
'<tr><td>'.$langs->trans(
"UserTitle").
'</td><td class="valeur">'.
$object->getCivilityLabel().
'</td>';
1837 print
'<tr><td>'.$langs->trans(
"Password").
'</td><td>';
1839 print preg_replace(
'/./i',
'*',
$object->pass);
1842 print
'<!-- '.$langs->trans(
"Crypted").
': '.
$object->pass_indatabase_crypted.
' -->';
1844 print
'<span class="opacitymedium">'.$langs->trans(
"Hidden").
'</span>';
1846 if (!empty(
$object->pass_indatabase) && empty(
$object->user_id)) {
1847 $langs->load(
"errors");
1848 $htmltext = $langs->trans(
"WarningPasswordSetWithNoAccount");
1849 print
' '.$form->textwithpicto(
'', $htmltext, 1,
'warning');
1855 print
'<tr><td>'.$langs->trans(
"SubscriptionEndDate").
'</td><td class="valeur">';
1859 print
" ".img_warning($langs->trans(
"Late"));
1862 if (
$object->need_subscription == 0) {
1863 print $langs->trans(
"SubscriptionNotNeeded");
1864 } elseif (!$adht->subscription) {
1865 print $langs->trans(
"SubscriptionNotRecorded");
1867 print
" ".img_warning($langs->trans(
"Late"));
1870 print $langs->trans(
"SubscriptionNotReceived");
1872 print
" ".img_warning($langs->trans(
"Late"));
1882 print
'<div class="fichehalfright">';
1883 print
'<div class="underbanner clearboth"></div>';
1885 print
'<table class="border tableforfield centpercent">';
1888 if (isModEnabled(
'category') && $user->hasRight(
'categorie',
'lire')) {
1889 print
'<tr><td>'.$langs->trans(
"Categories").
'</td>';
1890 print
'<td colspan="2">';
1891 print $form->showCategories(
$object->id, Categorie::TYPE_MEMBER, 1);
1896 print
'<tr><td class="titlefield">'.$langs->trans(
"DateOfBirth").
'</td><td class="valeur">'.
dol_print_date(
$object->birth,
'day').
'</td></tr>';
1900 require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
1901 print
'<tr><td>'.$langs->trans(
"DefaultLang").
'</td><td>';
1904 $langs->load(
"languages");
1905 $labellang = (
$object->default_lang ? $langs->trans(
'Language_'.
$object->default_lang) :
'');
1913 $htmltext = $langs->trans(
"Public",
getDolGlobalString(
'MAIN_INFO_SOCIETE_NOM'), $linkofpubliclist);
1914 print $form->textwithpicto($langs->trans(
"MembershipPublic"), $htmltext, 1,
'help',
'', 0, 3,
'membershippublic');
1915 print
'</td><td class="valeur">'.yn(
$object->public).
'</td></tr>';
1918 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
1921 if (isModEnabled(
'societe')) {
1923 $editenable = $user->hasRight(
'adherent',
'creer');
1924 print $form->editfieldkey(
'LinkedToDolibarrThirdParty',
'thirdparty',
'',
$object, $editenable);
1925 print
'</td><td colspan="2" class="valeur">';
1926 if ($action ==
'editthirdparty') {
1927 $htmlname =
'socid';
1928 print
'<form method="POST" action="'.$_SERVER[
'PHP_SELF'].
'" name="form'.$htmlname.
'">';
1929 print
'<input type="hidden" name="rowid" value="'.$object->id.
'">';
1930 print
'<input type="hidden" name="action" value="set'.$htmlname.
'">';
1931 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1932 print
'<table class="nobordernopadding">';
1934 print $form->select_company(
$object->socid,
'socid',
'', 1);
1936 print
'<td class="left"><input type="submit" class="button button-edit smallpaddingimp" value="'.$langs->trans(
"Modify").
'"></td>';
1937 print
'</tr></table></form>';
1941 $result = $company->fetch(
$object->socid);
1942 print $company->getNomUrl(1);
1945 $tmparray = $company->getOutstandingBills(
'customer');
1946 if (!empty($tmparray[
'refs'])) {
1947 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']).
')';
1952 print
'<span class="opacitymedium">'.$langs->trans(
"NoThirdPartyAssociatedToMember").
'</span>';
1960 $editenable = $user->hasRight(
'adherent',
'creer') && $user->hasRight(
'user',
'user',
'creer');
1961 print $form->editfieldkey(
'LinkedToDolibarrUser',
'login',
'',
$object, $editenable);
1962 print
'</td><td colspan="2" class="valeur">';
1963 if ($action ==
'editlogin') {
1964 $form->form_users($_SERVER[
'PHP_SELF'].
'?rowid='.
$object->id,
$object->user_id,
'userid', array());
1967 $linkeduser =
new User($db);
1968 $linkeduser->fetch(
$object->user_id);
1969 print $linkeduser->getNomUrl(-1);
1971 print
'<span class="opacitymedium">'.$langs->trans(
"NoDolibarrAccess").
'</span>';
1978 print
"</div></div>\n";
1979 print
'<div class="clearboth"></div>';
1988 print
'<div class="tabsAction">';
1990 $parameters = array();
1991 $reshook = $hookmanager->executeHooks(
'addMoreActionsButtons', $parameters,
$object, $action);
1992 if (empty($reshook)) {
1993 if ($action !=
'editlogin' && $action !=
'editthirdparty') {
1995 if (empty($user->socid)) {
1997 print
'<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?id='.((int)
$object->id).
'&action=presend&mode=init#formmailbeforetitle">'.$langs->trans(
'SendMail').
'</a>'.
"\n";
2016 if ($user->hasRight(
'adherent',
'creer')) {
2017 print
'<a class="butAction" href="card.php?rowid='.((int)
$object->id).
'&action=edit&token='.
newToken().
'">'.$langs->trans(
"Modify").
'</a>'.
"\n";
2019 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"Modify").
'</span>'.
"\n";
2024 if ($user->hasRight(
'adherent',
'creer')) {
2025 print
'<a class="butAction" href="card.php?rowid='.((int)
$object->id).
'&action=valid&token='.
newToken().
'">'.$langs->trans(
"Validate").
'</a>'.
"\n";
2027 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"Validate").
'</span>'.
"\n";
2033 if ($user->hasRight(
'adherent',
'creer')) {
2034 print
'<a class="butAction" href="card.php?rowid='.((int)
$object->id).
'&action=valid&token='.
newToken().
'">'.$langs->trans(
"Reenable").
"</a>\n";
2036 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"Reenable").
'</span>'.
"\n";
2042 if ($user->hasRight(
'adherent',
'supprimer')) {
2043 print
'<a class="butAction" href="card.php?rowid='.((int)
$object->id).
'&action=resiliate&token='.
newToken().
'">'.$langs->trans(
"Resiliate").
"</a></span>\n";
2045 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"Resiliate").
'</span>'.
"\n";
2051 if ($user->hasRight(
'adherent',
'supprimer')) {
2052 print
'<a class="butAction" href="card.php?rowid='.((int)
$object->id).
'&action=exclude&token='.
newToken().
'">'.$langs->trans(
"Exclude").
"</a></span>\n";
2054 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"Exclude").
'</span>'.
"\n";
2059 if (isModEnabled(
'societe') && !
$object->socid) {
2060 if ($user->hasRight(
'societe',
'creer')) {
2062 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";
2064 print
'<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans(
"ValidateBefore")).
'">'.$langs->trans(
"CreateDolibarrThirdParty").
'</a>'.
"\n";
2067 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"CreateDolibarrThirdParty").
'</span>'.
"\n";
2072 if (!$user->socid && !
$object->user_id) {
2073 if ($user->hasRight(
'user',
'user',
'creer')) {
2075 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";
2077 print
'<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans(
"ValidateBefore")).
'">'.$langs->trans(
"CreateDolibarrLogin").
'</a>'.
"\n";
2080 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"CreateDolibarrLogin").
'</span>'.
"\n";
2086 $isinspip = $mailmanspip->is_in_spip(
$object);
2088 if ($isinspip == 1) {
2089 print
'<a class="butAction" href="card.php?rowid='.((int)
$object->id).
'&action=del_spip&token='.
newToken().
'">'.$langs->trans(
"DeleteIntoSpip").
'</a>'.
"\n";
2091 if ($isinspip == 0) {
2092 print
'<a class="butAction" href="card.php?rowid='.((int)
$object->id).
'&action=add_spip&token='.
newToken().
'">'.$langs->trans(
"AddIntoSpip").
'</a>'.
"\n";
2097 if ($user->hasRight(
'adherent',
'supprimer')) {
2098 print
'<a class="butActionDelete" href="card.php?rowid='.((int)
$object->id).
'&action=delete&token='.
newToken().
'">'.$langs->trans(
"Delete").
'</a>'.
"\n";
2100 print
'<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"Delete").
'</span>'.
"\n";
2106 if ($isinspip == -1) {
2107 print
'<br><br><span class="error">'.$langs->trans(
'SPIPConnectionFailed').
': '.$mailmanspip->error.
'</span>';
2112 if (
GETPOST(
'modelselected')) {
2113 $action =
'presend';
2116 if ($action !=
'presend') {
2117 print
'<div class="fichecenter"><div class="fichehalfleft">';
2118 print
'<a name="builddoc"></a>';
2123 $urlsource = $_SERVER[
'PHP_SELF'].
'?id='.
$object->id;
2124 $genallowed = $user->hasRight(
'adherent',
'lire');
2125 $delallowed = $user->hasRight(
'adherent',
'creer');
2127 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);
2128 $somethingshown = $formfile->numoffiles;
2136 include_once DOL_DOCUMENT_ROOT.
'/core/lib/payments.lib.php';
2137 $validpaymentmethod = getValidOnlinePaymentMethods(
'');
2138 $useonlinepayment = count($validpaymentmethod);
2140 if ($useonlinepayment) {
2142 if (empty($amount)) {
2143 $amount = max($adht->amount,
$object->first_subscription_amount,
$object->last_subscription_amount);
2145 if (empty($amount)) {
2148 require_once DOL_DOCUMENT_ROOT.
'/core/lib/payments.lib.php';
2149 print showOnlinePaymentUrl(
'membersubscription',
$object->ref, $amount);
2152 print
'</div><div class="fichehalfright">';
2156 $morehtmlcenter =
'';
2157 $messagingUrl = DOL_URL_ROOT.
'/adherents/messaging.php?rowid='.
$object->id;
2158 $morehtmlcenter .=
dolGetButtonTitle($langs->trans(
'ShowAsConversation'),
'',
'fa fa-comments imgforviewmode', $messagingUrl,
'', 1);
2159 $morehtmlcenter .=
dolGetButtonTitle($langs->trans(
'SeeAll'),
'',
'fa fa-bars imgforviewmode', DOL_URL_ROOT.
'/adherents/agenda.php?id='.
$object->id);
2162 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formactions.class.php';
2164 $somethingshown = $formactions->showactions(
$object,
$object->element, $socid, 1,
'listactions', $MAXEVENT,
'', $morehtmlcenter);
2166 print
'</div></div>';
2170 $modelmail =
'member';
2171 $defaulttopic =
'CardContent';
2172 $diroutput =
$conf->adherent->dir_output;
2173 $trackid =
'mem'.$object->id;
2175 include DOL_DOCUMENT_ROOT.
'/core/tpl/card_presend.tpl.php';
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Class to manage members of a foundation.
const STATUS_EXCLUDED
Excluded.
const STATUS_DRAFT
Draft status.
const STATUS_RESILIATED
Resiliated (membership end and was not renew)
const STATUS_VALIDATED
Validated status.
Class to manage members type.
Class to manage 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_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_delete_dir_recursive($dir, $count=0, $nophperrors=0, $onlysub=0, &$countdeleted=0, $indexdatabase=1, $nolog=0, $level=0)
Remove a directory $dir and its subdirectories (or only files and subdirectories)
dol_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, $allowothertags=array())
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_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.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1, $includequotes=0)
Clean a string to use it as a file name.
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.