31 require
'../main.inc.php';
32 require_once DOL_DOCUMENT_ROOT.
'/core/lib/member.lib.php';
33 require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
34 require_once DOL_DOCUMENT_ROOT.
'/core/lib/images.lib.php';
35 require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
36 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
37 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent_type.class.php';
38 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/subscription.class.php';
39 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
40 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
41 require_once DOL_DOCUMENT_ROOT.
'/core/class/extrafields.class.php';
42 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
43 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
46 $langs->loadLangs(array(
"companies",
"bills",
"members",
"users",
"other",
"paypal"));
48 $action =
GETPOST(
'action',
'aZ09');
49 $cancel =
GETPOST(
'cancel',
'alpha');
50 $backtopage =
GETPOST(
'backtopage',
'alpha');
51 $confirm =
GETPOST(
'confirm',
'alpha');
52 $rowid =
GETPOST(
'rowid',
'int');
54 $typeid =
GETPOST(
'typeid',
'int');
55 $userid =
GETPOST(
'userid',
'int');
56 $socid =
GETPOST(
'socid',
'int');
58 if (!empty($conf->mailmanspip->enabled)) {
59 include_once DOL_DOCUMENT_ROOT.
'/mailmanspip/class/mailmanspip.class.php';
61 $langs->load(
'mailmanspip');
70 $extrafields->fetch_name_optionals_label($object->table_element);
75 $object->getCanvas($id);
76 $canvas = $object->canvas ? $object->canvas :
GETPOST(
"canvas");
78 if (!empty($canvas)) {
79 require_once DOL_DOCUMENT_ROOT.
'/core/class/canvas.class.php';
80 $objcanvas =
new Canvas($db, $action);
81 $objcanvas->getCanvas(
'adherent',
'membercard', $canvas);
85 $result =
restrictedArea($user,
'adherent', $id,
'',
'',
'socid',
'rowid', 0);
89 $result = $object->fetch($id);
92 $canadduser = ($user->admin || $user->rights->user->user->creer);
94 if ($object->user_id) {
96 $caneditfielduser = ((($user->id == $object->user_id) && $user->rights->user->self->creer)
97 || (($user->id != $object->user_id) && $user->rights->user->user->creer));
98 $caneditpassworduser = ((($user->id == $object->user_id) && $user->rights->user->self->password)
99 || (($user->id != $object->user_id) && $user->rights->user->user->password));
104 $canaddmember = $user->rights->adherent->creer;
107 $caneditfieldmember = $user->rights->adherent->creer;
111 $hookmanager->initHooks(array(
'membercard',
'globalcard'));
119 $parameters = array(
'id'=>$id,
'rowid'=>$id,
'objcanvas'=>$objcanvas,
'confirm'=>$confirm);
120 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
121 if ($reshook < 0)
setEventMessages($hookmanager->error, $hookmanager->errors,
'errors');
123 if (empty($reshook)) {
125 if (!empty($backtopage)) {
126 header(
"Location: ".$backtopage);
132 if ($action ==
'setuserid' && ($user->rights->user->self->creer || $user->rights->user->user->creer)) {
134 if (empty($user->rights->user->user->creer)) {
135 if ($userid != $user->id && $userid != $object->user_id) {
137 setEventMessages($langs->trans(
"ErrorUserPermissionAllowsToLinksToItselfOnly"), null,
'errors');
142 if ($userid != $object->user_id) {
143 $result = $object->setUserId($userid);
150 if ($action ==
'setsocid') {
153 if ($socid != $object->socid) {
154 $sql =
"SELECT rowid FROM ".MAIN_DB_PREFIX.
"adherent";
155 $sql .=
" WHERE socid = ".((int) $socid);
156 $sql .=
" AND entity = ".$conf->entity;
157 $resql = $db->query($sql);
159 $obj = $db->fetch_object(
$resql);
160 if ($obj && $obj->rowid > 0) {
162 $othermember->fetch($obj->rowid);
163 $thirdparty =
new Societe($db);
164 $thirdparty->fetch($socid);
166 setEventMessages($langs->trans(
"ErrorMemberIsAlreadyLinkedToThisThirdParty", $othermember->getFullName($langs), $othermember->login, $thirdparty->name), null,
'errors');
171 $result = $object->setThirdPartyId($socid);
180 if ($action ==
'confirm_create_user' && $confirm ==
'yes' && $user->rights->user->user->creer) {
183 $nuser =
new User($db);
185 if (
GETPOST(
'internalorexternal',
'aZ09') ==
'internal') {
186 $tmpuser->fk_soc = 0;
189 $result = $nuser->create_from_member($tmpuser,
GETPOST(
'login',
'alphanohtml'));
192 $langs->load(
"errors");
195 setEventMessages($langs->trans(
"NewUserCreated", $nuser->login), null,
'mesgs');
204 if ($action ==
'confirm_create_thirdparty' && $confirm ==
'yes' && $user->rights->societe->creer) {
208 $result = $company->create_from_member($object,
GETPOST(
'companyname',
'alpha'),
GETPOST(
'companyalias',
'alpha'));
211 $langs->load(
"errors");
220 if ($action ==
'update' && !$cancel && $user->rights->adherent->creer) {
221 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
228 $lastname =
GETPOST(
"lastname",
'alphanohtml');
229 $firstname =
GETPOST(
"firstname",
'alphanohtml');
230 $gender =
GETPOST(
"gender",
'alphanohtml');
231 $societe =
GETPOST(
"societe",
'alphanohtml');
232 $morphy =
GETPOST(
"morphy",
'alphanohtml');
233 $login =
GETPOST(
"login",
'alphanohtml');
234 if ($morphy !=
'mor' && empty($lastname)) {
236 $langs->load(
"errors");
237 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Lastname")), null,
'errors');
239 if ($morphy !=
'mor' && (!isset($firstname) || $firstname ==
'')) {
241 $langs->load(
"errors");
242 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Firstname")), null,
'errors');
244 if ($morphy ==
'mor' && empty($societe)) {
246 $langs->load(
"errors");
247 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Company")), null,
'errors');
250 if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
253 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Login")), null,
'errors');
257 if ($result > 0 && !$error) {
258 $object->oldcopy = clone $object;
261 $object->civility_id = trim(
GETPOST(
"civility_id",
'alphanohtml'));
262 $object->firstname = trim(
GETPOST(
"firstname",
'alphanohtml'));
263 $object->lastname = trim(
GETPOST(
"lastname",
'alphanohtml'));
264 $object->gender = trim(
GETPOST(
"gender",
'alphanohtml'));
265 $object->login = trim(
GETPOST(
"login",
'alphanohtml'));
266 $object->pass = trim(
GETPOST(
"pass",
'alpha'));
268 $object->societe = trim(
GETPOST(
"societe",
'alphanohtml'));
269 $object->company = trim(
GETPOST(
"societe",
'alphanohtml'));
271 $object->address = trim(
GETPOST(
"address",
'alphanohtml'));
272 $object->zip = trim(
GETPOST(
"zipcode",
'alphanohtml'));
273 $object->town = trim(
GETPOST(
"town",
'alphanohtml'));
274 $object->state_id =
GETPOST(
"state_id",
'int');
275 $object->country_id =
GETPOST(
"country_id",
'int');
277 $object->phone = trim(
GETPOST(
"phone",
'alpha'));
278 $object->phone_perso = trim(
GETPOST(
"phone_perso",
'alpha'));
279 $object->phone_mobile = trim(
GETPOST(
"phone_mobile",
'alpha'));
280 $object->email = preg_replace(
'/\s+/',
'',
GETPOST(
"member_email",
'alpha'));
281 $object->socialnetworks = array();
282 foreach ($socialnetworks as $key => $value) {
284 $object->socialnetworks[$key] = trim(
GETPOST($key,
'alphanohtml'));
291 $object->birth = $birthdate;
293 $object->typeid =
GETPOST(
"typeid",
'int');
295 $object->morphy =
GETPOST(
"morphy",
'alpha');
297 if (
GETPOST(
'deletephoto',
'alpha')) $object->photo =
'';
302 $object->public =
GETPOST("public", 'alpha');
305 $ret = $extrafields->setOptionalsFromPost(null, $object);
306 if ($ret < 0) $error++;
310 if ($object->user_id) {
311 if ($user->id != $object->user_id && empty($user->rights->user->user->creer)) $nosyncuser = 1;
316 if ($object->user_id) {
317 if ($user->id != $object->user_id && empty($user->rights->user->user->password)) $nosyncuserpass = 1;
320 $result = $object->update($user, 0, $nosyncuser, $nosyncuserpass);
322 if ($result >= 0 && !count($object->errors)) {
323 $categories =
GETPOST(
'memcats',
'array');
324 $object->setCategories($categories);
327 $dir = $conf->adherent->dir_output.
'/'.
get_exdir(0, 0, 0, 1, $object,
'member').
'/photos';
328 $file_OK = is_uploaded_file($_FILES[
'photo'][
'tmp_name']);
331 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
332 $fileimg = $conf->adherent->dir_output.
'/'.
get_exdir(0, 0, 0, 1, $object,
'member').
'/photos/'.$object->photo;
333 $dirthumbs = $conf->adherent->dir_output.
'/'.
get_exdir(0, 0, 0, 1, $object,
'member').
'/photos/thumbs';
343 if (!
dol_move_uploaded_file($_FILES[
'photo'][
'tmp_name'], $newfile, 1, 0, $_FILES[
'photo'][
'error']) > 0) {
347 $object->addThumbs($newfile);
354 switch ($_FILES[
'photo'][
'error']) {
357 $errors[] =
"ErrorFileSizeTooLarge";
360 $errors[] =
"ErrorFilePartiallyUploaded";
365 $rowid = $object->id;
369 if (!empty($backtopage)) {
370 header(
"Location: ".$backtopage);
382 if ($action ==
'add' && $user->rights->adherent->creer) {
383 if ($canvas) $object->canvas = $canvas;
388 $datesubscription =
'';
393 $typeid =
GETPOST(
"typeid",
'int');
394 $civility_id =
GETPOST(
"civility_id",
'alphanohtml');
395 $lastname =
GETPOST(
"lastname",
'alphanohtml');
396 $firstname =
GETPOST(
"firstname",
'alphanohtml');
397 $gender =
GETPOST(
"gender",
'alphanohtml');
398 $societe =
GETPOST(
"societe",
'alphanohtml');
399 $address =
GETPOST(
"address",
'alphanohtml');
400 $zip =
GETPOST(
"zipcode",
'alphanohtml');
401 $town =
GETPOST(
"town",
'alphanohtml');
402 $state_id =
GETPOST(
"state_id",
'int');
403 $country_id =
GETPOST(
"country_id",
'int');
405 $phone =
GETPOST(
"phone",
'alpha');
406 $phone_perso =
GETPOST(
"phone_perso",
'alpha');
407 $phone_mobile =
GETPOST(
"phone_mobile",
'alpha');
412 $email = preg_replace(
'/\s+/',
'',
GETPOST(
"member_email",
'alpha'));
413 $login =
GETPOST(
"member_login",
'alphanohtml');
414 $pass =
GETPOST(
"password",
'alpha');
415 $photo =
GETPOST(
"photo",
'alpha');
416 $morphy =
GETPOST(
"morphy",
'alphanohtml');
417 $public =
GETPOST(
"public",
'alphanohtml');
419 $userid =
GETPOST(
"userid",
'int');
420 $socid =
GETPOST(
"socid",
'int');
422 $object->civility_id = $civility_id;
423 $object->firstname = $firstname;
424 $object->lastname = $lastname;
425 $object->gender = $gender;
426 $object->societe = $societe;
427 $object->company = $societe;
428 $object->address = $address;
430 $object->town = $town;
431 $object->state_id = $state_id;
432 $object->country_id = $country_id;
433 $object->phone = $phone;
434 $object->phone_perso = $phone_perso;
435 $object->phone_mobile = $phone_mobile;
436 $object->socialnetworks = array();
437 if (!empty($conf->socialnetworks->enabled)) {
438 foreach ($socialnetworks as $key => $value) {
440 $object->socialnetworks[$key] =
GETPOST(
"member_".$key,
'alphanohtml');
450 $object->email = $email;
451 $object->login = $login;
452 $object->pass = $pass;
453 $object->birth = $birthdate;
454 $object->photo = $photo;
455 $object->typeid = $typeid;
457 $object->morphy = $morphy;
458 $object->user_id = $userid;
459 $object->socid = $socid;
460 $object->public = $public;
463 $ret = $extrafields->setOptionalsFromPost(null, $object);
464 if ($ret < 0) $error++;
467 if (empty($morphy) || $morphy ==
"-1") {
469 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"MemberNature")), null,
'errors');
472 if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
475 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Login")), null,
'errors');
477 $sql =
"SELECT login FROM ".MAIN_DB_PREFIX.
"adherent WHERE login='".$db->escape($login).
"'";
478 $result = $db->query($sql);
480 $num = $db->num_rows($result);
484 $langs->load(
"errors");
485 setEventMessages($langs->trans(
"ErrorLoginAlreadyExists", $login), null,
'errors');
490 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Password")), null,
'errors');
493 if ($morphy ==
'mor' && empty($societe)) {
495 $langs->load(
"errors");
496 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Company")), null,
'errors');
498 if ($morphy !=
'mor' && empty($lastname)) {
500 $langs->load(
"errors");
501 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Lastname")), null,
'errors');
503 if ($morphy !=
'mor' && (!isset($firstname) || $firstname ==
'')) {
505 $langs->load(
"errors");
506 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Firstname")), null,
'errors');
508 if (!($typeid > 0)) {
510 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Type")), null,
'errors');
512 if ($conf->global->ADHERENT_MAIL_REQUIRED && !isValidEMail($email)) {
514 $langs->load(
"errors");
518 if (isset($public)) $public = 1;
524 $result = $object->create($user);
527 $memcats =
GETPOST(
'memcats',
'array');
528 $object->setCategories($memcats);
531 $rowid = $object->id;
537 if ($object->error) {
550 if ($user->rights->adherent->supprimer && $action ==
'confirm_delete' && $confirm ==
'yes') {
551 $result = $object->delete($id, $user);
553 if (!empty($backtopage)) {
554 header(
"Location: ".$backtopage);
557 header(
"Location: list.php");
561 $errmesg = $object->error;
565 if ($user->rights->adherent->creer && $action ==
'confirm_valid' && $confirm ==
'yes') {
571 $adht->fetch($object->typeid);
573 $result = $object->validate($user);
575 if ($result >= 0 && !count($object->errors)) {
577 if ($object->email &&
GETPOST(
"send_mail")) {
582 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
586 $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
588 $outputlangs->loadLangs(array(
"main",
"members"));
590 $arraydefaultmessage = null;
591 $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION;
593 if (!empty($labeltouse)) $arraydefaultmessage = $formmail->getEMailTemplate($db,
'member', $user, $outputlangs, 0, 1, $labeltouse);
595 if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
596 $subject = $arraydefaultmessage->topic;
597 $msg = $arraydefaultmessage->content;
600 if (empty($labeltouse) || (
int) $labeltouse === -1) {
610 $moreinheader =
'X-Dolibarr-Info: send_an_email by adherents/card.php'.
"\r\n";
612 $result = $object->send_an_email($texttosend, $subjecttosend, array(), array(), array(),
"",
"", 0, -1,
'', $moreinheader);
621 if ($object->error) {
636 if ($user->rights->adherent->supprimer && $action ==
'confirm_resign') {
639 if ($confirm ==
'yes') {
641 $adht->fetch($object->typeid);
643 $result = $object->resiliate($user);
645 if ($result >= 0 && !count($object->errors)) {
646 if ($object->email &&
GETPOST(
"send_mail")) {
651 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
655 $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
657 $outputlangs->loadLangs(array(
"main",
"members"));
659 $arraydefaultmessage = null;
660 $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_CANCELATION;
662 if (!empty($labeltouse)) $arraydefaultmessage = $formmail->getEMailTemplate($db,
'member', $user, $outputlangs, 0, 1, $labeltouse);
664 if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
665 $subject = $arraydefaultmessage->topic;
666 $msg = $arraydefaultmessage->content;
669 if (empty($labeltouse) || (
int) $labeltouse === -1) {
679 $moreinheader =
'X-Dolibarr-Info: send_an_email by adherents/card.php'.
"\r\n";
681 $result = $object->send_an_email($texttosend, $subjecttosend, array(), array(), array(),
"",
"", 0, -1,
'', $moreinheader);
691 if ($object->error) {
699 if (!empty($backtopage) && !$error) {
700 header(
"Location: ".$backtopage);
706 if ($user->rights->adherent->supprimer && $action ==
'confirm_del_spip' && $confirm ==
'yes') {
707 if (!count($object->errors)) {
708 if (!$mailmanspip->del_to_spip($object)) {
709 setEventMessages($langs->trans(
'DeleteIntoSpipError').
': '.$mailmanspip->error, null,
'errors');
714 if ($user->rights->adherent->creer && $action ==
'confirm_add_spip' && $confirm ==
'yes') {
715 if (!count($object->errors)) {
716 if (!$mailmanspip->add_to_spip($object)) {
717 setEventMessages($langs->trans(
'AddIntoSpipError').
': '.$mailmanspip->error, null,
'errors');
723 include DOL_DOCUMENT_ROOT.
'/core/actions_printing.inc.php';
726 $upload_dir = $conf->adherent->dir_output;
727 $permissiontoadd = $user->rights->adherent->creer;
728 include DOL_DOCUMENT_ROOT.
'/core/actions_builddoc.inc.php';
731 $triggersendname =
'MEMBER_SENTBYMAIL';
733 $mode =
'emailfrommember';
734 $trackid =
'mem'.$object->id;
735 include DOL_DOCUMENT_ROOT.
'/core/actions_sendmails.inc.php';
743 $form =
new Form($db);
747 $title = $langs->trans(
"Member").
" - ".$langs->trans(
"Card");
748 $help_url =
'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros';
751 $countrynotdefined = $langs->trans(
"ErrorSetACountryFirst").
' ('.$langs->trans(
"SeeAbove").
')';
753 if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
757 if (empty($object->error) && $id) {
759 $result = $object->fetch($id);
762 $objcanvas->assign_values($action, $object->id, $object->ref);
763 $objcanvas->display_canvas($action);
769 if ($action ==
'create') {
775 $object->canvas = $canvas;
776 $object->state_id =
GETPOST(
'state_id',
'int');
779 $object->country_id =
GETPOST(
'country_id',
'int') ?
GETPOST(
'country_id',
'int') : $mysoc->country_id;
780 if ($object->country_id) {
781 $tmparray =
getCountry($object->country_id,
'all');
782 $object->country_code = $tmparray[
'code'];
783 $object->country = $tmparray[
'label'];
786 if (!empty($socid)) {
788 if ($socid > 0) $object->fetch($socid);
790 if (!($object->id > 0)) {
791 $langs->load(
"errors");
792 print($langs->trans(
'ErrorRecordNotFound'));
801 if ($conf->use_javascript_ajax) {
802 print "\n".
'<script type="text/javascript" language="javascript">';
803 print 'jQuery(document).ready(function () {
804 jQuery("#selectcountry_id").change(function() {
805 document.formsoc.action.value="create";
806 document.formsoc.submit();
808 function initfieldrequired()
810 jQuery("#tdcompany").removeClass("fieldrequired");
811 jQuery("#tdlastname").removeClass("fieldrequired");
812 jQuery("#tdfirstname").removeClass("fieldrequired");
813 if (jQuery("#morphy").val() == \'mor\')
815 jQuery("#tdcompany").addClass("fieldrequired");
817 if (jQuery("#morphy").val() == \'phy\')
819 jQuery("#tdlastname").addClass("fieldrequired");
820 jQuery("#tdfirstname").addClass("fieldrequired");
823 jQuery("#morphy").change(function() {
828 print '</script>'.
"\n";
831 print '<form name="formsoc" action="'.$_SERVER[
"PHP_SELF"].
'" method="post" enctype="multipart/form-data">';
832 print '<input type="hidden" name="token" value="'.newToken().
'">';
833 print '<input type="hidden" name="action" value="add">';
834 print '<input type="hidden" name="socid" value="'.$socid.
'">';
835 if ($backtopage)
print '<input type="hidden" name="backtopage" value="'.($backtopage !=
'1' ? $backtopage :
$_SERVER[
"HTTP_REFERER"]).
'">';
839 print '<table class="border centpercent">';
843 if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
844 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>';
848 if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
849 require_once DOL_DOCUMENT_ROOT.
'/core/lib/security2.lib.php';
851 print '<tr><td><span class="fieldrequired">'.$langs->trans(
"Password").
'</span></td><td>';
852 print '<input type="text" class="minwidth300" maxlength="50" name="password" value="'.$generated_password.
'">';
857 print '<tr><td class="fieldrequired">'.$langs->trans(
"MemberType").
'</td><td>';
858 $listetype = $adht->liste_array(1);
859 if (count($listetype)) {
860 print $form->selectarray(
"typeid", $listetype, (
GETPOST(
'typeid',
'int') ?
GETPOST(
'typeid',
'int') : $typeid), (count($listetype) > 1 ? 1 : 0), 0, 0,
'', 0, 0, 0,
'',
'', 1);
862 print '<font class="error">'.$langs->trans(
"NoTypeDefinedGoToSetup").
'</font>';
867 $morphys[
"phy"] = $langs->trans(
"Physical");
868 $morphys[
"mor"] = $langs->trans(
"Moral");
869 print '<tr><td class="fieldrequired">'.$langs->trans(
"MemberNature").
"</td><td>\n";
870 print $form->selectarray(
"morphy", $morphys, (
GETPOST(
'morphy',
'alpha') ?
GETPOST(
'morphy',
'alpha') : $object->morphy), 1, 0, 0,
'', 0, 0, 0,
'',
'', 1);
874 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') : $object->company).
'"></td></tr>';
877 print '<tr><td>'.$langs->trans(
"UserTitle").
'</td><td>';
878 print $formcompany->select_civility(
GETPOST(
'civility_id',
'int') ?
GETPOST(
'civility_id',
'int') : $object->civility_id,
'civility_id',
'maxwidth150', 1).
'</td>';
882 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>';
886 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>';
890 print '<tr><td>'.$langs->trans(
"Gender").
'</td>';
892 $arraygender = array(
'man'=>$langs->trans(
"Genderman"),
'woman'=>$langs->trans(
"Genderwoman"),
'other'=>$langs->trans(
"Genderother"));
893 print $form->selectarray(
'gender', $arraygender,
GETPOST(
'gender',
'alphanohtml'), 1, 0, 0,
'', 0, 0, 0,
'',
'', 1);
897 print '<tr><td>'.($conf->global->ADHERENT_MAIL_REQUIRED ?
'<span class="fieldrequired">' :
'').$langs->trans(
"EMail").($conf->global->ADHERENT_MAIL_REQUIRED ?
'</span>' :
'').
'</td>';
898 print '<td>'.img_picto(
'',
'object_email').
' <input type="text" name="member_email" class="minwidth300" maxlength="255" value="'.(
GETPOSTISSET(
'member_email') ?
GETPOST(
'member_email',
'alpha') : $object->email).
'"></td></tr>';
901 print '<tr><td class="tdtop">'.$langs->trans(
"Address").
'</td><td>';
902 print '<textarea name="address" wrap="soft" class="quatrevingtpercent" rows="2">'.(GETPOSTISSET(
'address') ?
GETPOST(
'address',
'alphanohtml') : $object->address).
'</textarea>';
906 print '<tr><td>'.$langs->trans(
"Zip").
' / '.$langs->trans(
"Town").
'</td><td>';
907 print $formcompany->select_ziptown((
GETPOSTISSET(
'zipcode') ?
GETPOST(
'zipcode',
'alphanohtml') : $object->zip),
'zipcode', array(
'town',
'selectcountry_id',
'state_id'), 6);
909 print $formcompany->select_ziptown((
GETPOSTISSET(
'town') ?
GETPOST(
'town',
'alphanohtml') : $object->town),
'town', array(
'zipcode',
'selectcountry_id',
'state_id'));
913 $object->country_id = $object->country_id ? $object->country_id : $mysoc->country_id;
914 print '<tr><td width="25%">'.$langs->trans(
'Country').
'</td><td>';
915 print $form->select_country(
GETPOSTISSET(
'country_id') ?
GETPOST(
'country_id',
'alpha') : $object->country_id,
'country_id');
916 if ($user->admin)
print info_admin($langs->trans(
"YouCanChangeValuesForThisListFromDictionarySetup"), 1);
920 if (empty($conf->global->MEMBER_DISABLE_STATE)) {
921 print
'<tr><td>'.$langs->trans(
'State').
'</td><td>';
922 if ($object->country_id) {
923 print $formcompany->select_state(
GETPOSTISSET(
'state_id') ?
GETPOST(
'state_id',
'int') : $object->state_id, $object->country_code);
925 print $countrynotdefined;
931 print
'<tr><td>'.$langs->trans(
"PhonePro").
'</td>';
932 print
'<td>'.img_picto(
'',
'object_phoning').
' <input type="text" name="phone" size="20" value="'.(
GETPOSTISSET(
'phone') ?
GETPOST(
'phone',
'alpha') : $object->phone).
'"></td></tr>';
935 print
'<tr><td>'.$langs->trans(
"PhonePerso").
'</td>';
936 print
'<td>'.img_picto(
'',
'object_phoning').
' <input type="text" name="phone_perso" size="20" value="'.(
GETPOSTISSET(
'phone_perso') ?
GETPOST(
'phone_perso',
'alpha') : $object->phone_perso).
'"></td></tr>';
939 print
'<tr><td>'.$langs->trans(
"PhoneMobile").
'</td>';
940 print
'<td>'.img_picto(
'',
'object_phoning_mobile').
' <input type="text" name="phone_mobile" size="20" value="'.(
GETPOSTISSET(
'phone_mobile') ?
GETPOST(
'phone_mobile',
'alpha') : $object->phone_mobile).
'"></td></tr>';
942 if (!empty($conf->socialnetworks->enabled)) {
943 foreach ($socialnetworks as $key => $value) {
944 if (!$value[
'active'])
break;
945 print
'<tr><td>'.$langs->trans($value[
'label']).
'</td><td><input type="text" name="member_'.$key.
'" size="40" value="'.(
GETPOSTISSET(
'member_'.$key) ?
GETPOST(
'member_'.$key,
'alpha') : $object->socialnetworks[$key]).
'"></td></tr>';
950 print
"<tr><td>".$langs->trans(
"DateOfBirth").
"</td><td>\n";
951 print $form->selectDate(($object->birth ? $object->birth : -1),
'birth',
'',
'', 1,
'formsoc');
952 print
"</td></tr>\n";
955 print
"<tr><td>".$langs->trans(
"Public").
"</td><td>\n";
956 print $form->selectyesno(
"public", $object->public, 1);
957 print
"</td></tr>\n";
960 if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) {
961 print
'<tr><td>'.$form->editfieldkey(
"Categories",
'memcats',
'', $object, 0).
'</td><td>';
962 $cate_arbo = $form->select_all_categories(Categorie::TYPE_MEMBER, null,
'parent', null, null, 1);
963 print
img_picto(
'',
'category').$form->multiselectarray(
'memcats', $cate_arbo,
GETPOST(
'memcats',
'array'), null, null,
'quatrevingtpercent widthcentpercentminusx', 0, 0);
968 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_add.tpl.php';
975 print
'<div class="center">';
976 print
'<input type="submit" name="button" class="button" value="'.$langs->trans(
"AddMember").
'">';
977 print
' ';
978 if (!empty($backtopage)) {
979 print
'<input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans(
"Cancel").
'">';
981 print
'<input type="button" class="button button-cancel" value="'.$langs->trans(
"Cancel").
'" onClick="javascript:history.go(-1)">';
988 if ($action ==
'edit') {
995 $res = $object->fetch($id);
999 $res = $object->fetch_optionals();
1005 $adht->fetch($object->typeid);
1008 $country =
GETPOST(
'country',
'int');
1009 if (!empty($country) || $object->country_id) {
1010 $sql =
"SELECT rowid, code, label from ".MAIN_DB_PREFIX.
"c_country where rowid = ".(!empty($country) ? $country : $object->country_id);
1011 $resql = $db->query($sql);
1013 $obj = $db->fetch_object(
$resql);
1017 $object->country_id = $obj->rowid;
1018 $object->country_code = $obj->code;
1019 $object->country = $langs->trans(
"Country".$obj->code) ? $langs->trans(
"Country".$obj->code) : $obj->label;
1025 if ($conf->use_javascript_ajax) {
1026 print
"\n".
'<script type="text/javascript" language="javascript">';
1027 print
'jQuery(document).ready(function () {
1028 jQuery("#selectcountry_id").change(function() {
1029 document.formsoc.action.value="edit";
1030 document.formsoc.submit();
1032 function initfieldrequired()
1034 jQuery("#tdcompany").removeClass("fieldrequired");
1035 jQuery("#tdlastname").removeClass("fieldrequired");
1036 jQuery("#tdfirstname").removeClass("fieldrequired");
1037 if (jQuery("#morphy").val() == \'mor\')
1039 jQuery("#tdcompany").addClass("fieldrequired");
1041 if (jQuery("#morphy").val() == \'phy\')
1043 jQuery("#tdlastname").addClass("fieldrequired");
1044 jQuery("#tdfirstname").addClass("fieldrequired");
1047 jQuery("#morphy").change(function() {
1048 initfieldrequired();
1050 initfieldrequired();
1052 print
'</script>'.
"\n";
1055 print
'<form name="formsoc" action="'.$_SERVER[
"PHP_SELF"].
'" method="post" enctype="multipart/form-data">';
1056 print
'<input type="hidden" name="token" value="'.newToken().
'" />';
1057 print
'<input type="hidden" name="action" value="update" />';
1058 print
'<input type="hidden" name="rowid" value="'.$id.
'" />';
1059 print
'<input type="hidden" name="statut" value="'.$object->statut.
'" />';
1060 if ($backtopage) print
'<input type="hidden" name="backtopage" value="'.($backtopage !=
'1' ? $backtopage :
$_SERVER[
"HTTP_REFERER"]).
'">';
1064 print
'<table class="border centpercent">';
1067 print
'<tr><td class="titlefieldcreate">'.$langs->trans(
"Ref").
'</td><td class="valeur">'.$object->id.
'</td></tr>';
1070 if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
1071 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>';
1075 if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
1076 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Password").
'</td><td><input type="password" name="pass" class="minwidth300" maxlength="50" value="'.(
GETPOSTISSET(
"pass") ?
GETPOST(
"pass",
'', 2) : $object->pass).
'"></td></tr>';
1079 $morphys[
"phy"] = $langs->trans(
"Physical");
1080 $morphys[
"mor"] = $langs->trans(
"Moral");
1081 print
'<tr><td><span class="fieldrequired">'.$langs->trans(
"MemberNature").
'</span></td><td>';
1082 print $form->selectarray(
"morphy", $morphys, (
GETPOSTISSET(
"morphy") ?
GETPOST(
"morphy",
'alpha') : $object->morphy), 0, 0, 0,
'', 0, 0, 0,
'',
'', 1);
1086 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Type").
'</td><td>';
1087 if ($user->rights->adherent->creer) {
1088 print $form->selectarray(
"typeid", $adht->liste_array(), (
GETPOSTISSET(
"typeid") ?
GETPOST(
"typeid",
'int') : $object->typeid), 0, 0, 0,
'', 0, 0, 0,
'',
'', 1);
1090 print $adht->getNomUrl(1);
1091 print
'<input type="hidden" name="typeid" value="'.$object->typeid.
'">';
1096 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>';
1099 print
'<tr><td>'.$langs->trans(
"UserTitle").
'</td><td>';
1100 print $formcompany->select_civility(
GETPOSTISSET(
"civility_id") ?
GETPOST(
"civility_id",
'alpha') : $object->civility_id,
'civility_id',
'maxwidth150', 1);
1105 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>';
1109 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>';
1113 print
'<tr><td>'.$langs->trans(
"Gender").
'</td>';
1115 $arraygender = array(
'man'=>$langs->trans(
"Genderman"),
'woman'=>$langs->trans(
"Genderwoman"),
'other'=>$langs->trans(
"Genderother"));
1116 print $form->selectarray(
'gender', $arraygender,
GETPOSTISSET(
'gender') ?
GETPOST(
'gender',
'alphanohtml') : $object->gender, 1, 0, 0,
'', 0, 0, 0,
'',
'', 1);
1120 print
'<tr><td>'.$langs->trans(
"Photo").
'</td>';
1121 print
'<td class="hideonsmartphone" valign="middle">';
1122 print $form->showphoto(
'memberphoto', $object).
"\n";
1123 if ($caneditfieldmember) {
1124 if ($object->photo) print
"<br>\n";
1125 print
'<table class="nobordernopadding">';
1126 if ($object->photo) print
'<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> '.$langs->trans(
"Delete").
'<br><br></td></tr>';
1127 print
'<tr><td>'.$langs->trans(
"PhotoFile").
'</td></tr>';
1128 print
'<tr><td><input type="file" class="flat" name="photo" id="photoinput"></td></tr>';
1134 print
'<tr><td>'.($conf->global->ADHERENT_MAIL_REQUIRED ?
'<span class="fieldrequired">' :
'').$langs->trans(
"EMail").($conf->global->ADHERENT_MAIL_REQUIRED ?
'</span>' :
'').
'</td>';
1135 print
'<td>'.img_picto(
'',
'object_email').
' <input type="text" name="member_email" class="minwidth300" maxlength="255" value="'.(
GETPOSTISSET(
"member_email") ?
GETPOST(
"member_email",
'', 2) : $object->email).
'"></td></tr>';
1138 print
'<tr><td>'.$langs->trans(
"Address").
'</td><td>';
1139 print
'<textarea name="address" wrap="soft" class="quatrevingtpercent" rows="'.ROWS_2.
'">'.(
GETPOSTISSET(
"address") ?
GETPOST(
"address",
'alphanohtml', 2) : $object->address).
'</textarea>';
1143 print
'<tr><td>'.$langs->trans(
"Zip").
' / '.$langs->trans(
"Town").
'</td><td>';
1144 print $formcompany->select_ziptown((
GETPOSTISSET(
"zipcode") ?
GETPOST(
"zipcode",
'alphanohtml', 2) : $object->zip),
'zipcode', array(
'town',
'selectcountry_id',
'state_id'), 6);
1146 print $formcompany->select_ziptown((
GETPOSTISSET(
"town") ?
GETPOST(
"town",
'alphanohtml', 2) : $object->town),
'town', array(
'zipcode',
'selectcountry_id',
'state_id'));
1151 print
'<tr><td>'.$langs->trans(
'Country').
'</td><td>';
1152 print $form->select_country(
GETPOSTISSET(
"country_id") ?
GETPOST(
"country_id",
"alpha") : $object->country_id,
'country_id');
1153 if ($user->admin) print
info_admin($langs->trans(
"YouCanChangeValuesForThisListFromDictionarySetup"), 1);
1157 if (empty($conf->global->MEMBER_DISABLE_STATE)) {
1158 print
'<tr><td>'.$langs->trans(
'State').
'</td><td>';
1159 print $formcompany->select_state($object->state_id,
GETPOSTISSET(
"country_id") ?
GETPOST(
"country_id",
"alpha") : $object->country_id);
1164 print
'<tr><td>'.$langs->trans(
"PhonePro").
'</td>';
1165 print
'<td>'.img_picto(
'',
'object_phoning').
' <input type="text" name="phone" value="'.(
GETPOSTISSET(
"phone") ?
GETPOST(
"phone") : $object->phone).
'"></td></tr>';
1168 print
'<tr><td>'.$langs->trans(
"PhonePerso").
'</td>';
1169 print
'<td>'.img_picto(
'',
'object_phoning').
' <input type="text" name="phone_perso" value="'.(
GETPOSTISSET(
"phone_perso") ?
GETPOST(
"phone_perso") : $object->phone_perso).
'"></td></tr>';
1172 print
'<tr><td>'.$langs->trans(
"PhoneMobile").
'</td>';
1173 print
'<td>'.img_picto(
'',
'object_phoning_mobile').
' <input type="text" name="phone_mobile" value="'.(
GETPOSTISSET(
"phone_mobile") ?
GETPOST(
"phone_mobile") : $object->phone_mobile).
'"></td></tr>';
1175 if (!empty($conf->socialnetworks->enabled)) {
1176 foreach ($socialnetworks as $key => $value) {
1177 if (!$value[
'active'])
break;
1178 print
'<tr><td>'.$langs->trans($value[
'label']).
'</td><td><input type="text" name="'.$key.
'" class="minwidth100" value="'.(
GETPOSTISSET($key) ?
GETPOST($key,
'alphanohtml') : $object->socialnetworks[$key]).
'"></td></tr>';
1183 print
"<tr><td>".$langs->trans(
"DateOfBirth").
"</td><td>\n";
1184 print $form->selectDate(($object->birth ? $object->birth : -1),
'birth',
'',
'', 1,
'formsoc');
1185 print
"</td></tr>\n";
1188 print
"<tr><td>".$langs->trans(
"Public").
"</td><td>\n";
1189 print $form->selectyesno(
"public", (
GETPOSTISSET(
"public") ?
GETPOST(
"public",
'alphanohtml', 2) : $object->public), 1);
1190 print
"</td></tr>\n";
1193 if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) {
1194 print
'<tr><td>'.$form->editfieldkey(
"Categories",
'memcats',
'', $object, 0).
'</td>';
1196 $cate_arbo = $form->select_all_categories(Categorie::TYPE_MEMBER, null, null, null, null, 1);
1198 $cats = $c->containing($object->id, Categorie::TYPE_MEMBER);
1199 $arrayselected = array();
1200 if (is_array($cats)) {
1201 foreach ($cats as $cat) {
1202 $arrayselected[] = $cat->id;
1205 print $form->multiselectarray(
'memcats', $cate_arbo, $arrayselected,
'', 0,
'', 0,
'100%');
1210 if (!empty($conf->societe->enabled)) {
1211 print
'<tr><td>'.$langs->trans(
"LinkedToDolibarrThirdParty").
'</td><td colspan="2" class="valeur">';
1212 if ($object->socid) {
1214 $result = $company->fetch($object->socid);
1215 print $company->getNomUrl(1);
1217 print $langs->trans(
"NoThirdPartyAssociatedToMember");
1223 print
'<tr><td>'.$langs->trans(
"LinkedToDolibarrUser").
'</td><td colspan="2" class="valeur">';
1224 if ($object->user_id) {
1225 $form->form_users(
$_SERVER[
'PHP_SELF'].
'?rowid='.$object->id, $object->user_id,
'none');
1226 }
else print $langs->trans(
"NoDolibarrAccess");
1230 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_add.tpl.php';
1235 print
'<div class="center">';
1236 print
'<input type="submit" class="button button-save" name="save" value="'.$langs->trans(
"Save").
'">';
1237 print
' ';
1238 print
'<input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans(
"Cancel").
'">';
1244 if ($id > 0 && $action !=
'edit') {
1251 $res = $object->fetch($id);
1255 $res = $object->fetch_optionals();
1261 $res = $adht->fetch($object->typeid);
1275 if ($action ==
'create_user') {
1277 if (empty($login)) {
1279 include_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
1282 if (empty($login)) $login = strtolower(substr($object->firstname, 0, 4)).strtolower(substr($object->lastname, 0, 4));
1285 $formquestion = array(
1286 array(
'label' => $langs->trans(
"LoginToCreate"),
'type' =>
'text',
'name' =>
'login',
'value' => $login)
1288 if (!empty($conf->societe->enabled) && $object->socid > 0) {
1289 $object->fetch_thirdparty();
1290 $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")));
1293 if (!empty($conf->societe->enabled) && $object->socid <= 0) {
1294 $text .= $langs->trans(
"UserWillBeInternalUser").
'<br>';
1296 $text .= $langs->trans(
"ConfirmCreateLogin");
1297 print $form->formconfirm(
$_SERVER[
"PHP_SELF"].
"?rowid=".$object->id, $langs->trans(
"CreateDolibarrLogin"), $text,
"confirm_create_user", $formquestion,
'yes');
1301 if ($action ==
'create_thirdparty') {
1303 $fullname = $object->getFullName($langs);
1305 if ($object->morphy ==
'mor') {
1306 $companyname = $object->company;
1307 if (!empty($fullname)) $companyalias = $fullname;
1309 $companyname = $fullname;
1310 if (!empty($object->company)) $companyalias = $object->company;
1314 $formquestion = array(
1315 array(
'label' => $langs->trans(
"NameToCreate"),
'type' =>
'text',
'name' =>
'companyname',
'value' => $companyname,
'morecss' =>
'minwidth300',
'moreattr' =>
'maxlength="128"'),
1316 array(
'label' => $langs->trans(
"AliasNames"),
'type' =>
'text',
'name' =>
'companyalias',
'value' => $companyalias,
'morecss' =>
'minwidth300',
'moreattr' =>
'maxlength="128"')
1319 print $form->formconfirm(
$_SERVER[
"PHP_SELF"].
"?rowid=".$object->id, $langs->trans(
"CreateDolibarrThirdParty"), $langs->trans(
"ConfirmCreateThirdParty"),
"confirm_create_thirdparty", $formquestion,
'yes');
1323 if ($action ==
'valid') {
1324 $langs->load(
"mails");
1327 $adht->fetch($object->typeid);
1333 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
1336 $outputlangs =
new Translate(
'', $conf);
1337 $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
1339 $outputlangs->loadLangs(array(
"main",
"members"));
1341 $arraydefaultmessage = null;
1342 $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION;
1344 if (!empty($labeltouse)) $arraydefaultmessage = $formmail->getEMailTemplate($db,
'member', $user, $outputlangs, 0, 1, $labeltouse);
1346 if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
1347 $subject = $arraydefaultmessage->topic;
1348 $msg = $arraydefaultmessage->content;
1356 $tmp = $langs->trans(
"SendingAnEMailToMember");
1357 $tmp .=
'<br>'.$langs->trans(
"MailFrom").
': <b>'.$conf->global->ADHERENT_MAIL_FROM.
'</b>, ';
1358 $tmp .=
'<br>'.$langs->trans(
"MailRecipient").
': <b>'.$object->email.
'</b>';
1360 $helpcontent .=
'<b>'.$langs->trans(
"MailFrom").
'</b>: '.$conf->global->ADHERENT_MAIL_FROM.
'<br>'.
"\n";
1361 $helpcontent .=
'<b>'.$langs->trans(
"MailRecipient").
'</b>: '.$object->email.
'<br>'.
"\n";
1362 $helpcontent .=
'<b>'.$langs->trans(
"Subject").
'</b>:<br>'.
"\n";
1363 $helpcontent .= $subjecttosend.
"\n";
1364 $helpcontent .=
"<br>";
1365 $helpcontent .=
'<b>'.$langs->trans(
"Content").
'</b>:<br>';
1367 $label = $form->textwithpicto($tmp, $helpcontent, 1,
'help');
1370 $formquestion = array();
1371 if ($object->email) $formquestion[] = array(
'type' =>
'checkbox',
'name' =>
'send_mail',
'label' => $label,
'value' => ($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL ?
true:
false));
1372 if (!empty($conf->mailman->enabled) && !empty($conf->global->ADHERENT_USE_MAILMAN)) {
1373 $formquestion[] = array(
'type'=>
'other',
'label'=>$langs->transnoentitiesnoconv(
"SynchroMailManEnabled"),
'value'=>
'');
1375 if (!empty($conf->mailman->enabled) && !empty($conf->global->ADHERENT_USE_SPIP)) {
1376 $formquestion[] = array(
'type'=>
'other',
'label'=>$langs->transnoentitiesnoconv(
"SynchroSpipEnabled"),
'value'=>
'');
1378 print $form->formconfirm(
"card.php?rowid=".$id, $langs->trans(
"ValidateMember"), $langs->trans(
"ConfirmValidateMember"),
"confirm_valid", $formquestion,
'yes', 1, 220);
1382 if ($action ==
'resign') {
1383 $langs->load(
"mails");
1386 $adht->fetch($object->typeid);
1392 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
1395 $outputlangs =
new Translate(
'', $conf);
1396 $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
1398 $outputlangs->loadLangs(array(
"main",
"members"));
1400 $arraydefaultmessage = null;
1401 $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_CANCELATION;
1403 if (!empty($labeltouse)) $arraydefaultmessage = $formmail->getEMailTemplate($db,
'member', $user, $outputlangs, 0, 1, $labeltouse);
1405 if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
1406 $subject = $arraydefaultmessage->topic;
1407 $msg = $arraydefaultmessage->content;
1415 $tmp = $langs->trans(
"SendingAnEMailToMember");
1416 $tmp .=
'<br>('.$langs->trans(
"MailFrom").
': <b>'.$conf->global->ADHERENT_MAIL_FROM.
'</b>, ';
1417 $tmp .= $langs->trans(
"MailRecipient").
': <b>'.$object->email.
'</b>)';
1419 $helpcontent .=
'<b>'.$langs->trans(
"MailFrom").
'</b>: '.$conf->global->ADHERENT_MAIL_FROM.
'<br>'.
"\n";
1420 $helpcontent .=
'<b>'.$langs->trans(
"MailRecipient").
'</b>: '.$object->email.
'<br>'.
"\n";
1421 $helpcontent .=
'<b>'.$langs->trans(
"Subject").
'</b>:<br>'.
"\n";
1422 $helpcontent .= $subjecttosend.
"\n";
1423 $helpcontent .=
"<br>";
1424 $helpcontent .=
'<b>'.$langs->trans(
"Content").
'</b>:<br>';
1426 $label = $form->textwithpicto($tmp, $helpcontent, 1,
'help');
1429 $formquestion = array();
1430 if ($object->email) $formquestion[] = array(
'type' =>
'checkbox',
'name' =>
'send_mail',
'label' => $label,
'value' => (!empty($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL) ?
'true' :
'false'));
1431 if ($backtopage) $formquestion[] = array(
'type' =>
'hidden',
'name' =>
'backtopage',
'value' => ($backtopage !=
'1' ? $backtopage :
$_SERVER[
"HTTP_REFERER"]));
1432 print $form->formconfirm(
"card.php?rowid=".$id, $langs->trans(
"ResiliateMember"), $langs->trans(
"ConfirmResiliateMember"),
"confirm_resign", $formquestion,
'no', 1, 240);
1436 if ($action ==
'delete') {
1437 $formquestion = array();
1438 if ($backtopage) $formquestion[] = array(
'type' =>
'hidden',
'name' =>
'backtopage',
'value' => ($backtopage !=
'1' ? $backtopage :
$_SERVER[
"HTTP_REFERER"]));
1439 print $form->formconfirm(
"card.php?rowid=".$id, $langs->trans(
"DeleteMember"), $langs->trans(
"ConfirmDeleteMember"),
"confirm_delete", $formquestion,
'no', 1);
1443 if ($action ==
'add_spip') {
1444 print $form->formconfirm(
"card.php?rowid=".$id, $langs->trans(
'AddIntoSpip'), $langs->trans(
'AddIntoSpipConfirmation'),
'confirm_add_spip');
1447 if ($action ==
'del_spip') {
1448 print $form->formconfirm(
"card.php?rowid=$id", $langs->trans(
'DeleteIntoSpip'), $langs->trans(
'DeleteIntoSpipConfirmation'),
'confirm_del_spip');
1452 if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) $rowspan++;
1453 if (!empty($conf->societe->enabled)) $rowspan++;
1455 $linkback =
'<a href="'.DOL_URL_ROOT.
'/adherents/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
1459 print
'<div class="fichecenter">';
1460 print
'<div class="fichehalfleft">';
1462 print
'<div class="underbanner clearboth"></div>';
1463 print
'<table class="border tableforfield centpercent">';
1466 if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
1467 print
'<tr><td class="titlefield">'.$langs->trans(
"Login").
' / '.$langs->trans(
"Id").
'</td><td class="valeur">'.
dol_escape_htmltag($object->login).
'</td></tr>';
1471 print
'<tr><td class="titlefield">'.$langs->trans(
"Type").
'</td><td class="valeur">'.$adht->getNomUrl(1).
"</td></tr>\n";
1474 print
'<tr><td>'.$langs->trans(
"MemberNature").
'</td><td class="valeur" >'.$object->getmorphylib().
'</td>';
1478 print
'<tr><td>'.$langs->trans(
"Gender").
'</td>';
1480 if ($object->gender) print $langs->trans(
"Gender".$object->gender);
1484 print
'<tr><td>'.$langs->trans(
"Company").
'</td><td class="valeur">'.
dol_escape_htmltag($object->company).
'</td></tr>';
1487 print
'<tr><td>'.$langs->trans(
"UserTitle").
'</td><td class="valeur">'.$object->getCivilityLabel().
'</td>';
1491 if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
1492 print
'<tr><td>'.$langs->trans(
"Password").
'</td><td>'.preg_replace(
'/./i',
'*', $object->pass);
1493 if ($object->pass) {
1494 print preg_replace(
'/./i',
'*', $object->pass);
1497 print $langs->trans(
"Crypted").
': '.$object->pass_indatabase_crypted;
1499 print $langs->trans(
"Hidden");
1502 if ((!empty($object->pass) || !empty($object->pass_crypted)) && empty($object->user_id)) {
1503 $langs->load(
"errors");
1504 $htmltext = $langs->trans(
"WarningPasswordSetWithNoAccount");
1505 print
' '.$form->textwithpicto(
'', $htmltext, 1,
'warning');
1511 print
'<tr><td>'.$langs->trans(
"SubscriptionEndDate").
'</td><td class="valeur">';
1512 if ($object->datefin) {
1514 if ($object->hasDelay()) {
1515 print
" ".img_warning($langs->trans(
"Late"));
1518 if ($object->need_subscription == 0) {
1519 print $langs->trans(
"SubscriptionNotNeeded");
1520 } elseif (!$adht->subscription) {
1521 print $langs->trans(
"SubscriptionNotRecorded");
1522 if ($object->statut > 0) print
" ".img_warning($langs->trans(
"Late"));
1524 print $langs->trans(
"SubscriptionNotReceived");
1525 if ($object->statut > 0) print
" ".img_warning($langs->trans(
"Late"));
1534 print
'<div class="fichehalfright"><div class="ficheaddleft">';
1535 print
'<div class="underbanner clearboth"></div>';
1537 print
'<table class="border tableforfield tableforfield" width="100%">';
1540 print
'<tr><td class="titlefield">'.$langs->trans(
"DateOfBirth").
'</td><td class="valeur">'.
dol_print_date($object->birth,
'day').
'</td></tr>';
1543 print
'<tr><td>'.$langs->trans(
"Public").
'</td><td class="valeur">'.
yn($object->public).
'</td></tr>';
1546 if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) {
1547 print
'<tr><td>'.$langs->trans(
"Categories").
'</td>';
1548 print
'<td colspan="2">';
1549 print $form->showCategories($object->id, Categorie::TYPE_MEMBER, 1);
1554 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
1557 if (!empty($conf->societe->enabled)) {
1559 $editenable = $user->rights->adherent->creer;
1560 print $form->editfieldkey(
'LinkedToDolibarrThirdParty',
'thirdparty',
'', $object, $editenable);
1561 print
'</td><td colspan="2" class="valeur">';
1562 if ($action ==
'editthirdparty') {
1563 $htmlname =
'socid';
1564 print
'<form method="POST" action="'.$_SERVER[
'PHP_SELF'].
'" name="form'.$htmlname.
'">';
1565 print
'<input type="hidden" name="rowid" value="'.$object->id.
'">';
1566 print
'<input type="hidden" name="action" value="set'.$htmlname.
'">';
1567 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1568 print
'<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
1570 print $form->select_company($object->socid,
'socid',
'', 1);
1572 print
'<td class="left"><input type="submit" class="button" value="'.$langs->trans(
"Modify").
'"></td>';
1573 print
'</tr></table></form>';
1575 if ($object->socid) {
1577 $result = $company->fetch($object->socid);
1578 print $company->getNomUrl(1);
1580 print $langs->trans(
"NoThirdPartyAssociatedToMember");
1588 $editenable = $user->rights->adherent->creer && $user->rights->user->user->creer;
1589 print $form->editfieldkey(
'LinkedToDolibarrUser',
'login',
'', $object, $editenable);
1590 print
'</td><td colspan="2" class="valeur">';
1591 if ($action ==
'editlogin') {
1592 $form->form_users(
$_SERVER[
'PHP_SELF'].
'?rowid='.$object->id, $object->user_id,
'userid',
'');
1594 if ($object->user_id) {
1595 $linkeduser =
new User($db);
1596 $linkeduser->fetch($object->user_id);
1597 print $linkeduser->getNomUrl(-1);
1599 print $langs->trans(
"NoDolibarrAccess");
1606 print $langs->trans(
"VCard").
'</td><td colspan="3">';
1607 print
'<a href="'.DOL_URL_ROOT.
'/adherents/vcard.php?id='.$object->id.
'">';
1608 print
img_picto($langs->trans(
"Download"),
'vcard.png',
'class="paddingrightonly"');
1609 print $langs->trans(
"Download");
1615 print
"</div></div></div>\n";
1616 print
'<div style="clear:both"></div>';
1625 print
'<div class="tabsAction">';
1626 $parameters = array();
1627 $reshook = $hookmanager->executeHooks(
'addMoreActionsButtons', $parameters, $object, $action);
1628 if (empty($reshook)) {
1629 if ($action !=
'editlogin' && $action !=
'editthirdparty') {
1631 if (empty($user->socid)) {
1632 if ($object->statut == 1) {
1633 print
'<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&action=presend&mode=init#formmailbeforetitle">'.$langs->trans(
'SendMail').
'</a></div>';
1658 if ($user->rights->adherent->creer) {
1659 print
'<div class="inline-block divButAction"><a class="butAction" href="card.php?rowid='.$id.
'&action=edit">'.$langs->trans(
"Modify").
"</a></div>";
1661 print
'<div class="inline-block divButAction"><font class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"Modify").
'</font></div>';
1665 if ($object->statut == -1) {
1666 if ($user->rights->adherent->creer) {
1667 print
'<div class="inline-block divButAction"><a class="butAction" href="card.php?rowid='.$id.
'&action=valid">'.$langs->trans(
"Validate").
"</a></div>\n";
1669 print
'<div class="inline-block divButAction"><font class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"Validate").
'</font></div>';
1674 if ($object->statut == 0) {
1675 if ($user->rights->adherent->creer) {
1676 print
'<div class="inline-block divButAction"><a class="butAction" href="card.php?rowid='.$id.
'&action=valid">'.$langs->trans(
"Reenable").
"</a></div>\n";
1678 print
'<div class="inline-block divButAction"><font class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"Reenable").
"</font></div>";
1683 if ($object->statut >= 1) {
1684 if ($user->rights->adherent->supprimer) {
1685 print
'<div class="inline-block divButAction"><a class="butAction" href="card.php?rowid='.$id.
'&action=resign">'.$langs->trans(
"Resiliate").
"</a></div>\n";
1687 print
'<div class="inline-block divButAction"><font class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"Resiliate").
"</font></div>";
1692 if (!empty($conf->societe->enabled) && !$object->socid) {
1693 if ($user->rights->societe->creer) {
1694 if ($object->statut != -1) print
'<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?rowid='.$object->id.
'&action=create_thirdparty">'.$langs->trans(
"CreateDolibarrThirdParty").
'</a></div>';
1695 else print
'<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans(
"ValidateBefore")).
'">'.$langs->trans(
"CreateDolibarrThirdParty").
'</a></div>';
1697 print
'<div class="inline-block divButAction"><font class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"CreateDolibarrThirdParty").
"</font></div>";
1702 if (!$user->socid && !$object->user_id) {
1703 if ($user->rights->user->user->creer) {
1704 if ($object->statut != -1) print
'<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?rowid='.$object->id.
'&action=create_user">'.$langs->trans(
"CreateDolibarrLogin").
'</a></div>';
1705 else print
'<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans(
"ValidateBefore")).
'">'.$langs->trans(
"CreateDolibarrLogin").
'</a></div>';
1707 print
'<div class="inline-block divButAction"><font class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"CreateDolibarrLogin").
"</font></div>";
1712 if (!empty($conf->mailmanspip->enabled) && !empty($conf->global->ADHERENT_USE_SPIP)) {
1713 $isinspip = $mailmanspip->is_in_spip($object);
1715 if ($isinspip == 1) {
1716 print
'<div class="inline-block divButAction"><a class="butAction" href="card.php?rowid='.$object->id.
'&action=del_spip">'.$langs->trans(
"DeleteIntoSpip").
"</a></div>\n";
1718 if ($isinspip == 0) {
1719 print
'<div class="inline-block divButAction"><a class="butAction" href="card.php?rowid='.$object->id.
'&action=add_spip">'.$langs->trans(
"AddIntoSpip").
"</a></div>\n";
1724 if ($user->rights->adherent->supprimer) {
1725 print
'<div class="inline-block divButAction"><a class="butActionDelete" href="card.php?rowid='.$object->id.
'&action=delete&token='.
newToken().
'">'.$langs->trans(
"Delete").
"</a></div>\n";
1727 print
'<div class="inline-block divButAction"><font class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"Delete").
"</font></div>";
1733 if ($isinspip == -1) {
1734 print
'<br><br><font class="error">'.$langs->trans(
'SPIPConnectionFailed').
': '.$mailmanspip->error.
'</font>';
1739 if (
GETPOST(
'modelselected')) {
1740 $action =
'presend';
1743 if ($action !=
'presend') {
1744 print
'<div class="fichecenter"><div class="fichehalfleft">';
1745 print
'<a name="builddoc"></a>';
1751 $filedir = $conf->adherent->dir_output.
'/'.
get_exdir(0, 0, 0, 0, $object,
'member');
1752 $urlsource =
$_SERVER[
'PHP_SELF'].
'?id='.$object->id;
1753 $genallowed = $user->rights->adherent->lire;
1754 $delallowed = $user->rights->adherent->creer;
1756 print $formfile->showdocuments(
'member', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0,
'',
'',
'', $object->default_lang,
'', $object);
1757 $somethingshown = $formfile->numoffiles;
1769 $useonlinepayment = (!empty($conf->paypal->enabled) || !empty($conf->stripe->enabled) || !empty($conf->paybox->enabled));
1771 if ($useonlinepayment) {
1774 require_once DOL_DOCUMENT_ROOT.
'/core/lib/payments.lib.php';
1775 print showOnlinePaymentUrl(
'membersubscription', $object->ref);
1778 print
'</div><div class="fichehalfright"><div class="ficheaddleft">';
1782 $morehtmlright =
'<a href="'.DOL_URL_ROOT.
'/adherents/agenda.php?id='.$object->id.
'">';
1783 $morehtmlright .= $langs->trans(
"SeeAll");
1784 $morehtmlright .=
'</a>';
1787 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formactions.class.php';
1789 $somethingshown =
$formactions->showactions($object,
'member', $socid, 1,
'listactions', $MAX,
'', $morehtmlright);
1791 print
'</div></div></div>';
1795 $modelmail =
'member';
1796 $defaulttopic =
'CardContent';
1797 $diroutput = $conf->adherent->dir_output;
1798 $trackid =
'mem'.$object->id;
1800 include DOL_DOCUMENT_ROOT.
'/core/tpl/card_presend.tpl.php';
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
if(preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) if(preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) if($action== 'set') elseif($action== 'specimen') elseif($action== 'setmodel') elseif($action== 'del') elseif($action== 'setdoc') $formactions
View.
yn($yesno, $case=1, $color=0)
Return yes or no in current language.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm= 'auto', $check=1)
Return a timestamp date built from detailed informations (by default a local PHP server timestamp) Re...
if(!empty($arrayfields['u.datec']['checked'])) print_liste_field_titre("DateCreationShort"u if(!empty($arrayfields['u.tms']['checked'])) print_liste_field_titre("DateModificationShort"u if(!empty($arrayfields['u.statut']['checked'])) print_liste_field_titre("Status"u statut
getArrayOfSocialNetworks()
Get array of social network dictionary.
Class to manage Dolibarr users.
dol_clone($object, $native=0)
Create a clone of instance of object (new instance with same value for properties) With native = 0: P...
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...
member_prepare_head(Adherent $object)
Return array head with list of tabs to view object informations.
dol_buildlogin($lastname, $firstname)
Build a login from lastname, firstname.
$conf db name
Only used if Module[ID]Name translation string is not found.
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...
image_format_supported($file, $acceptsvg=0)
Return if a filename is file name of a supported image format.
getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $object=null)
Return array of possible common substitutions.
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname.
Class to manage third parties objects (customers, suppliers, prospects...)
Class to manage categories.
load_fiche_titre($titre, $morehtmlright= '', $picto= 'generic', $pictoisfullpath=0, $id= '', $morecssontable= '', $morehtmlcenter= '')
Load a title with picto.
img_picto($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt= '', $morecss= '', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
get_exdir($num, $level, $alpha, $withoutslash, $object, $modulepart= '')
Return a path to have a the directory according to object where files are stored. ...
dol_delete_dir_recursive($dir, $count=0, $nophperrors=0, $onlysub=0, &$countdeleted=0)
Remove a directory $dir and its subdirectories (or only files and subdirectories) ...
Class to manage members of a foundation.
dol_delete_file($file, $disableglob=0, $nophperrors=0, $nohook=0, $object=null, $allowdotdot=false, $indexdatabase=1)
Remove a file or several files with a mask.
getRandomPassword($generic=false, $replaceambiguouschars=null, $length=32)
Return a generated password using default module.
restrictedArea($user, $features, $objectid=0, $tableandshare= '', $feature2= '', $dbt_keyfield= 'fk_soc', $dbt_select= 'rowid', $isdraft=0)
Check permissions of a user to show a page and an object.
Class to manage translations.
dol_sanitizeFileName($str, $newstr= '_', $unaccent=1)
Clean a string to use it as a file name.
dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disablevirusscan=0, $uploaderrorcode=0, $nohook=0, $varfiles= 'addedfile', $upload_dir= '')
Make control on an uploaded file from an GUI page and move it to final destination.
Class to manage members type.
print $_SERVER["PHP_SELF"]
Edit parameters.
dol_get_fiche_head($links=array(), $active= '', $title= '', $notab=0, $picto= '', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limittoshow=0, $moretabssuffix= '')
Show tabs of a record.
print
Draft customers invoices.
dol_print_date($time, $format= '', $tzoutput= 'auto', $outputlangs= '', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) if(!empty($conf->don->enabled)&&$user->rights->don->lire) if(!empty($conf->tax->enabled)&&$user->rights->tax->charges->lire) if(!empty($conf->facture->enabled)&&!empty($conf->commande->enabled)&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
newToken()
Return the value of token currently saved into session with name 'newtoken'.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
make_substitutions($text, $substitutionarray, $outputlangs=null)
Make substitution into a text string, replacing keys with vals from $substitutionarray (oldval=>newva...
dol_banner_tab($object, $paramid, $morehtml= '', $shownav=1, $fieldid= 'rowid', $fieldref= 'ref', $morehtmlref= '', $moreparam= '', $nodbprefix=0, $morehtmlleft= '', $morehtmlstatus= '', $onlybanner=0, $morehtmlright= '')
Show tab footer of a card.
Class to manage mailman and spip.
if(!defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN'
Draft customers invoices.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin= '1', $morecss= '', $textfordropdown= '')
Show information for admin users or standard users.
getCountry($searchkey, $withcode= '', $dbtouse=0, $outputlangs= '', $entconv=1, $searchlabel= '')
Return country label, code or id from an id, code or label.
dol_mkdir($dir, $dataroot= '', $newmask=null)
Creation of a directory (this can create recursive subdir)
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...
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $keepmoretags= '', $escapeonlyhtmltags=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields...