34require
'../main.inc.php';
44require_once DOL_DOCUMENT_ROOT.
'/core/lib/member.lib.php';
45require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
46require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
47require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent_type.class.php';
48require_once DOL_DOCUMENT_ROOT.
'/adherents/class/subscription.class.php';
49require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
50require_once DOL_DOCUMENT_ROOT.
'/product/class/product.class.php';
51require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingjournal.class.php';
52require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
53require_once DOL_DOCUMENT_ROOT.
'/commande/class/commande.class.php';
55$langs->loadLangs(array(
"companies",
"bills",
"orders",
"members",
"users",
"mails",
'other'));
57$action =
GETPOST(
'action',
'aZ09');
58$confirm =
GETPOST(
'confirm',
'alpha');
59$contextpage =
GETPOST(
'contextpage',
'aZ09');
60$optioncss =
GETPOST(
'optioncss',
'aZ');
64$ref =
GETPOST(
'ref',
'alphanohtml');
66$cancel =
GETPOST(
'cancel',
'alpha');
70$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
71$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
73if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
77$offset = $limit * $page;
83 $sortfield =
"c.rowid";
94$extrafields->fetch_name_optionals_label(
$object->table_element);
99$hookmanager->initHooks(array(
'subscription'));
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$permissiontoaddmember = $user->hasRight(
'adherent',
'creer');
129$permissiontoeditextra = $permissiontoaddmember;
130if (
GETPOST(
'attribute',
'aZ09') && isset($extrafields->attributes[
$object->table_element][
'perms'][
GETPOST(
'attribute',
'aZ09')])) {
132 $permissiontoeditextra =
dol_eval((
string) $extrafields->attributes[
$object->table_element][
'perms'][
GETPOST(
'attribute',
'aZ09')]);
139$invoices_to_link_post =
GETPOST(
'invoices_to_link',
'array:int');
140$orders_to_link_post =
GETPOST(
'orders_to_link',
'array:int');
141$invoicereftolink_post =
GETPOST(
'invoicereftolink',
'alpha');
142$orderreftolink_post =
GETPOST(
'orderreftolink',
'alpha');
148$parameters = array();
149$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
151 setEventMessages($hookmanager->error, $hookmanager->errors,
'errors');
154if (empty($reshook) && $action ==
'update_extras' && $permissiontoeditextra) {
157 $attribute_name =
GETPOST(
'attribute',
'aZ09');
160 $ret = $extrafields->setOptionalsFromPost(
null, $object, $attribute_name);
165 $result =
$object->updateExtraField($attribute_name,
'MEMBER_MODIFY');
172 $action =
'edit_extras';
177if (empty($reshook) && $action ==
'confirm_create_thirdparty' && $confirm ==
'yes' && $user->hasRight(
'societe',
'creer')) {
181 $result = $company->create_from_member($object,
GETPOST(
'companyname',
'alpha'),
GETPOST(
'companyalias',
'alpha'),
GETPOST(
'customercode',
'alpha'));
184 $langs->load(
"errors");
185 setEventMessages($company->error, $company->errors,
'errors');
189 $action =
'createsubscription';
196if (empty($reshook) && $action ==
'setuserid' && ($user->hasRight(
'user',
'self',
'creer') || $user->hasRight(
'user',
'user',
'creer'))) {
198 if (!$user->hasRight(
'user',
'user',
'creer')) {
201 setEventMessages($langs->trans(
"ErrorUserPermissionAllowsToLinksToItselfOnly"),
null,
'errors');
209 dol_print_error(
null,
$object->error);
216if (empty($reshook) && $action ==
'setsocid' && $permissiontoaddmember) {
219 $sql =
"SELECT rowid FROM " . MAIN_DB_PREFIX .
"adherent";
220 $sql .=
" WHERE fk_soc = " . ((int)
GETPOSTINT(
'socid'));
221 $resql = $db->query($sql);
223 $obj = $db->fetch_object($resql);
224 if ($obj && $obj->rowid > 0) {
226 $othermember->fetch($obj->rowid);
227 $thirdparty =
new Societe($db);
230 setEventMessages($langs->trans(
"ErrorMemberIsAlreadyLinkedToThisThirdParty", $othermember->getFullName($langs), $othermember->login, $thirdparty->name),
null,
'errors');
237 dol_print_error(
null,
$object->error);
244if (empty($reshook) && $user->hasRight(
'adherent',
'cotisation',
'creer') && $action ==
'subscription' && !$cancel) {
247 $langs->load(
"banks");
249 $result =
$object->fetch($rowid);
250 $result = $adht->fetch(
$object->typeid);
253 $datesubscription = 0;
255 $defaultdelay = !empty($adht->duration_value) ? $adht->duration_value : 1;
256 $defaultdelayunit = !empty($adht->duration_unit) ? $adht->duration_unit :
'y';
272 $operation =
GETPOST(
"operation",
"alphanohtml");
273 $num_chq =
GETPOST(
"num_chq",
"alphanohtml");
274 $emetteur_nom =
GETPOST(
"chqemetteur");
275 $emetteur_banque =
GETPOST(
"chqbank");
276 $option =
GETPOST(
"paymentsave");
277 if (empty($option)) {
280 $sendalsoemail =
GETPOST(
"sendmail",
'alpha');
283 if (!$datesubscription) {
285 $langs->load(
"errors");
286 $errmsg = $langs->trans(
"ErrorBadDateFormat", $langs->transnoentitiesnoconv(
"DateSubscription"));
287 setEventMessages($errmsg,
null,
'errors');
288 $action =
'createsubscription';
290 if (
GETPOST(
'end') && !$datesubend) {
292 $langs->load(
"errors");
293 $errmsg = $langs->trans(
"ErrorBadDateFormat", $langs->transnoentitiesnoconv(
"DateEndSubscription"));
294 setEventMessages($errmsg,
null,
'errors');
295 $action =
'createsubscription';
300 if (($option ==
'bankviainvoice' || $option ==
'bankdirect') && !$paymentdate) {
302 $errmsg = $langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"DatePayment"));
303 setEventMessages($errmsg,
null,
'errors');
304 $action =
'createsubscription';
308 if ($adht->subscription) {
309 if (!is_numeric($amount)) {
311 $errmsg = $langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Amount"));
312 setEventMessages($errmsg,
null,
'errors');
314 $action =
'createsubscription';
320 $errmsg = $langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Label"));
321 setEventMessages($errmsg,
null,
'errors');
323 $action =
'createsubscription';
325 if (
GETPOST(
"paymentsave") !=
'invoiceonly' && !
GETPOST(
"operation") &&
GETPOST(
"paymentsave") !=
'linktoobject') {
326 $errmsg = $langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"PaymentMode"));
327 setEventMessages($errmsg,
null,
'errors');
329 $action =
'createsubscription';
331 if (
GETPOST(
"paymentsave") !=
'invoiceonly' && !(
GETPOSTINT(
"accountid") > 0) &&
GETPOST(
"paymentsave") !=
'linktoobject') {
332 $errmsg = $langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"FinancialAccount"));
333 setEventMessages($errmsg,
null,
'errors');
335 $action =
'createsubscription';
339 $errmsg = $langs->trans(
"ErrorDoNotProvideAccountsIfNullAmount");
340 setEventMessages($errmsg,
null,
'errors');
342 $action =
'createsubscription';
350 if ($action ==
'subscription' && $option !=
'linktoobject' && $user->hasRight(
'adherent',
'cotisation',
'creer')) {
351 $link_inputs_exist = (!empty($invoices_to_link_post) || !empty($orders_to_link_post) || !empty($invoicereftolink_post) || !empty($orderreftolink_post));
352 if ($link_inputs_exist) {
353 setEventMessages($langs->trans(
"ErrorLinkFieldsFilledButPaymentSaveNone"),
null,
'errors');
355 $action =
'createsubscription';
359 if ($action ==
'subscription' && $option ==
'linktoobject' && $user->hasRight(
'adherent',
'cotisation',
'creer')) {
360 if (!empty($invoicereftolink_post)) {
361 $tmpinvoice =
new Facture($db);
362 if ($tmpinvoice->fetch(0, $invoicereftolink_post) <= 0) {
364 setEventMessages($langs->trans(
"ErrorInvoiceNotFound", $invoicereftolink_post),
null,
'errors');
365 $action =
'createsubscription';
369 if (!empty($orderreftolink_post)) {
371 if ($tmporder->fetch(0, $orderreftolink_post) <= 0) {
373 setEventMessages($langs->trans(
"ErrorOrderNotFound", $orderreftolink_post),
null,
'errors');
374 $action =
'createsubscription';
380 if (!$error && $action ==
'subscription') {
384 $crowid =
$object->subscription($datesubscription, (
float) $amount, $accountid, $operation, $label, $num_chq, $emetteur_nom, $emetteur_banque, $datesubend);
392 $result =
$object->subscriptionComplementaryActions($crowid, $option, $accountid, $datesubscription, $paymentdate, $operation, $label, (
float) $amount, $num_chq, $emetteur_nom, $emetteur_banque);
402 if ($option ==
'linktoobject' && $crowid > 0) {
404 if ($subscription->fetch($crowid) > 0) {
407 $adhlink->fetch($subscription->fk_adherent);
408 $thirdpartyidtolink = $adhlink->fk_soc;
412 $existinglinks = array();
416 if (!empty($invoices_to_link_post)) {
417 foreach ($invoices_to_link_post as $invoiceid) {
418 $tmpinvoice =
new Facture($db);
419 if ($tmpinvoice->fetch($invoiceid) > 0) {
420 if ($tmpinvoice->socid != $thirdpartyidtolink) {
421 setEventMessages($langs->trans(
"ErrorInvoiceNotLinkedToThirdpartyOfMember", $tmpinvoice->ref),
null,
'errors');
424 if (!empty($existinglinks[
'facture-'.$tmpinvoice->id])) {
427 if ($subscription->add_object_linked(
'facture', $tmpinvoice->id) > 0) {
429 $existinglinks[
'facture-'.$tmpinvoice->id] = 1;
431 setEventMessages($subscription->error, $subscription->errors,
'errors');
439 if (!empty($invoicereftolink_post)) {
440 $tmpinvoice =
new Facture($db);
441 if ($tmpinvoice->fetch(0, $invoicereftolink_post) > 0) {
442 if (!empty($existinglinks[
'facture-'.$tmpinvoice->id])) {
443 setEventMessages($langs->trans(
"ErrorObjectAlreadyLinked", $tmpinvoice->ref),
null,
'warnings');
444 } elseif ($subscription->add_object_linked(
'facture', $tmpinvoice->id) > 0) {
446 $existinglinks[
'facture-'.$tmpinvoice->id] = 1;
448 setEventMessages($subscription->error, $subscription->errors,
'errors');
451 setEventMessages($langs->trans(
"ErrorInvoiceNotFound", $invoicereftolink_post),
null,
'errors');
457 if (!empty($orders_to_link_post)) {
458 foreach ($orders_to_link_post as $orderid) {
460 if ($tmporder->fetch($orderid) > 0) {
461 if ($tmporder->socid != $thirdpartyidtolink) {
462 setEventMessages($langs->trans(
"ErrorOrderNotLinkedToThirdpartyOfMember", $tmporder->ref),
null,
'errors');
465 if (!empty($existinglinks[
'commande-'.$tmporder->id])) {
468 if ($subscription->add_object_linked(
'commande', $tmporder->id) > 0) {
470 $existinglinks[
'commande-'.$tmporder->id] = 1;
472 setEventMessages($subscription->error, $subscription->errors,
'errors');
480 if (!empty($orderreftolink_post)) {
482 if ($tmporder->fetch(0, $orderreftolink_post) > 0) {
483 if (!empty($existinglinks[
'commande-'.$tmporder->id])) {
484 setEventMessages($langs->trans(
"ErrorObjectAlreadyLinked", $tmporder->ref),
null,
'warnings');
485 } elseif ($subscription->add_object_linked(
'commande', $tmporder->id) > 0) {
487 $existinglinks[
'commande-'.$tmporder->id] = 1;
489 setEventMessages($subscription->error, $subscription->errors,
'errors');
492 setEventMessages($langs->trans(
"ErrorOrderNotFound", $orderreftolink_post),
null,
'errors');
497 if ($nbcreatedlinks > 0) {
498 setEventMessages($langs->trans(
"XLinksCreated", $nbcreatedlinks),
null,
'mesgs');
501 unset($subscription);
508 $action =
'createsubscription';
512 setEventMessages(
"SubscriptionRecorded",
null,
'mesgs');
518 if (
$object->email && $sendalsoemail) {
520 'datesubscription' => $datesubscription,
522 'accountid' => $accountid,
523 'operation' => $operation,
525 'num_chq' => $num_chq,
526 'emetteur_nom' => $emetteur_nom,
527 'emetteur_banque' => $emetteur_banque,
528 'datesubend' => $datesubend
530 $reshook = $hookmanager->executeHooks(
'sendMail', $parameters, $object, $action);
532 setEventMessages($hookmanager->error, $hookmanager->errors,
'errors');
535 if (empty($reshook)) {
540 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
544 $outputlangs->setDefaultLang(!empty(
$object->default_lang) ?
$object->default_lang : (empty(
$object->thirdparty->default_lang) ?
$mysoc->default_lang :
$object->thirdparty->default_lang));
546 $outputlangs->loadLangs(array(
"main",
"members"));
549 $arraydefaultmessage =
null;
552 if (!empty($labeltouse)) {
553 $arraydefaultmessage = $formmail->getEMailTemplate($db,
'member', $user, $outputlangs, 0, 1, $labeltouse);
556 if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
557 $subject = (string) $arraydefaultmessage->topic;
558 $msg = (string) $arraydefaultmessage->content;
561 $substitutionarray = getCommonSubstitutionArray($outputlangs, 0,
null, $object);
568 $listofpaths = array();
569 $listofnames = array();
570 $listofmimes = array();
571 if (is_object(
$object->invoice) && (!is_object($arraydefaultmessage) || intval($arraydefaultmessage->joinfiles))) {
572 $invoicediroutput =
$conf->facture->dir_output;
574 $file = $fileparams[
'fullname'];
576 $listofpaths = array($file);
577 $listofnames = array(basename($file));
581 $moreinheader =
'X-Dolibarr-Info: send_an_email by adherents/subscription.php'.
"\r\n";
583 $result =
$object->sendEmail($texttosend, $subjecttosend, $listofpaths, $listofmimes, $listofnames,
"",
"", 0, -1,
'', $moreinheader);
588 setEventMessages($langs->trans(
"EmailSentToMember",
$object->email),
null,
'mesgs');
592 setEventMessages($langs->trans(
"NoEmailSentToMember"),
null,
'mesgs');
613$form =
new Form($db);
617$title = $langs->trans(
"Member").
" - ".$langs->trans(
"Subscriptions");
618$help_url =
"EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder";
620llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'mod-member page-card_subscription');
624if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
625 $param .=
'&contextpage='.urlencode($contextpage);
627if ($limit > 0 && $limit !=
$conf->liste_limit) {
628 $param .=
'&limit='.((int) $limit);
630$param .=
'&id='.$rowid;
631if ($optioncss !=
'') {
632 $param .=
'&optioncss='.urlencode($optioncss);
639 $langs->load(
"errors");
640 print $langs->trans(
"ErrorRecordNotFound");
646$defaultdelay = !empty($adht->duration_value) ? $adht->duration_value : 1;
647$defaultdelayunit = !empty($adht->duration_unit) ? $adht->duration_unit :
'y';
659print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
660print
'<input type="hidden" name="token" value="'.newToken().
'">';
661print
'<input type="hidden" name="rowid" value="'.$object->id.
'">';
665$linkback =
'<a href="'.dolBuildUrl(DOL_URL_ROOT.
'/adherents/list.php', [
'restore_lastsearch_values' => 1]).
'">'.$langs->trans(
"BackToList").
'</a>';
667$morehtmlref =
'<a href="'.DOL_URL_ROOT.
'/adherents/vcard.php?id='.
$object->id.
'" class="refid" tabindex="-1">';
668$morehtmlref .= img_picto($langs->trans(
"Download").
' '.$langs->trans(
"VCard"),
'vcard',
'class="valignmiddle marginleftonly paddingrightonly"');
669$morehtmlref .=
'</a>';
671dol_banner_tab($object,
'rowid', $linkback, 1,
'rowid',
'ref', $morehtmlref);
673print
'<div class="fichecenter">';
674print
'<div class="fichehalfleft">';
676print
'<div class="underbanner clearboth"></div>';
677print
'<table class="border centpercent tableforfield">';
681 print
'<tr><td class="titlefieldmiddle">'.$langs->trans(
"Login").
' / '.$langs->trans(
"Id").
'</td><td class="valeur">'.
dol_escape_htmltag(
$object->login).
'</td></tr>';
685print
'<tr><td class="titlefieldmiddle">'.$langs->trans(
"Type").
'</td>';
686print
'<td class="valeur">'.$adht->getNomUrl(1).
"</td></tr>\n";
689print
'<tr><td>'.$langs->trans(
"MemberNature").
'</td>';
690print
'<td class="valeur" >'.$object->getmorphylib(
'', 1).
'</td>';
697print
'<tr><td>'.$langs->trans(
"UserTitle").
'</td><td class="valeur">'.
$object->getCivilityLabel().
'</td>';
702 print
'<tr><td>'.$langs->trans(
"Password").
'</td><td>';
704 print preg_replace(
'/./i',
'*',
$object->pass);
707 print
'<!-- '.$langs->trans(
"Crypted").
': '.
$object->pass_indatabase_crypted.
' -->';
709 print
'<span class="opacitymedium">'.$langs->trans(
"Hidden").
'</span>';
711 if (!empty(
$object->pass_indatabase) && empty(
$object->user_id)) {
712 $langs->load(
"errors");
713 $htmltext = $langs->trans(
"WarningPasswordSetWithNoAccount");
714 print
' '.$form->textwithpicto(
'', $htmltext, 1,
'warning');
720print
'<tr><td>'.$langs->trans(
"SubscriptionEndDate").
'</td><td class="valeur">';
724 print
" ".img_warning($langs->trans(
"Late"));
727 if (
$object->need_subscription == 0) {
728 print $langs->trans(
"SubscriptionNotNeeded");
729 } elseif (!$adht->subscription) {
730 print $langs->trans(
"SubscriptionNotRecorded");
732 print
" ".img_warning($langs->trans(
"Late"));
735 print $langs->trans(
"SubscriptionNotReceived");
737 print
" ".img_warning($langs->trans(
"Late"));
747print
'<div class="fichehalfright">';
748print
'<div class="underbanner clearboth"></div>';
750print
'<table class="border tableforfield centpercent">';
753if (
isModEnabled(
'category') && $user->hasRight(
'categorie',
'lire')) {
754 print
'<tr><td>'.$langs->trans(
"Categories").
'</td>';
755 print
'<td colspan="2">';
756 print $form->showCategories(
$object->id, Categorie::TYPE_MEMBER, 1);
761print
'<tr><td class="titlefieldmiddle">'.$langs->trans(
"DateOfBirth").
'</td><td class="valeur">'.
dol_print_date(
$object->birth,
'day').
'</td></tr>';
765 require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
766 print
'<tr><td>'.$langs->trans(
"DefaultLang").
'</td><td>';
769 $langs->load(
"languages");
770 $labellang = (
$object->default_lang ? $langs->trans(
'Language_'.
$object->default_lang) :
'');
777$linkofpubliclist = DOL_MAIN_URL_ROOT.
'/public/members/public_list.php'.((
isModEnabled(
'multicompany')) ?
'?entity='.
$conf->entity :
'');
778print
'<tr><td>'.$form->textwithpicto($langs->trans(
"MembershipPublic"), $langs->trans(
"Public",
getDolGlobalString(
'MAIN_INFO_SOCIETE_NOM'), $linkofpubliclist), 1,
'help',
'', 0, 3,
'publicfile').
'</td><td class="valeur">'.yn(
$object->public).
'</td></tr>';
782include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
787 print
'<table class="nobordernopadding centpercent"><tr><td>';
788 print $langs->trans(
"LinkedToDolibarrThirdParty");
790 if ($action !=
'editthirdparty' && $user->hasRight(
'adherent',
'creer')) {
791 print
'<td class="right"><a class="editfielda" href="'.$_SERVER[
"PHP_SELF"].
'?action=editthirdparty&token='.
newToken().
'&rowid='.
$object->id.
'">'.img_edit($langs->trans(
'SetLinkToThirdParty'), 1).
'</a></td>';
793 print
'</tr></table>';
794 print
'</td><td colspan="2" class="valeur">';
795 if ($action ==
'editthirdparty') {
797 print
'<form method="POST" action="'.$_SERVER[
'PHP_SELF'].
'" name="form'.$htmlname.
'">';
798 print
'<input type="hidden" name="rowid" value="'.$object->id.
'">';
799 print
'<input type="hidden" name="action" value="set'.$htmlname.
'">';
800 print
'<input type="hidden" name="token" value="'.newToken().
'">';
801 print
'<table class="nobordernopadding">';
803 print $form->select_company(
$object->socid,
'socid',
'', 1);
805 print
'<td class="left"><input type="submit" class="button button-edit" value="'.$langs->trans(
"Modify").
'"></td>';
806 print
'</tr></table></form>';
810 $result = $company->fetch(
$object->socid);
811 print $company->getNomUrl(1);
814 $tmparray = $company->getOutstandingBills(
'customer');
815 if (!empty($tmparray[
'refs'])) {
816 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']).
')';
821 print
'<span class="opacitymedium">'.$langs->trans(
"NoThirdPartyAssociatedToMember").
'</span>';
829print
'<table class="nobordernopadding centpercent"><tr><td>';
830print $langs->trans(
"LinkedToDolibarrUser");
832if ($action !=
'editlogin' && $user->hasRight(
'adherent',
'creer')) {
833 print
'<td class="right">';
834 if ($user->hasRight(
"user",
"user",
"creer")) {
835 print
'<a class="editfielda" href="'.$_SERVER[
"PHP_SELF"].
'?action=editlogin&token='.
newToken().
'&rowid='.
$object->id.
'">'.img_edit($langs->trans(
'SetLinkToUser'), 1).
'</a>';
839print
'</tr></table>';
840print
'</td><td colspan="2" class="valeur">';
841if ($action ==
'editlogin') {
842 $form->form_users($_SERVER[
'PHP_SELF'].
'?rowid='.
$object->id, (
string)
$object->user_id,
'userid', array());
845 $linkeduser =
new User($db);
846 $linkeduser->fetch(
$object->user_id);
847 print $linkeduser->getNomUrl(-1);
849 print
'<span class="opacitymedium">'.$langs->trans(
"NoDolibarrAccess").
'</span>';
856print
"</div></div>\n";
857print
'<div class="clearboth"></div>';
867if ($user->hasRight(
'adherent',
'cotisation',
'creer')) {
868 if ($action !=
'createsubscription' && $action !=
'create_thirdparty') {
869 print
'<div class="tabsAction">';
872 print
'<div class="inline-block divButAction"><a class="butAction" href="'.dolBuildUrl($_SERVER[
"PHP_SELF"], [
'rowid' => $rowid,
'action' =>
'createsubscription'],
true).
'">'.$langs->trans(
"AddSubscription").
"</a></div>";
874 print
'<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans(
"ValidateBefore")).
'">'.$langs->trans(
"AddSubscription").
'</a></div>';
884if ($action !=
'createsubscription' && $action !=
'create_thirdparty') {
885 $sql =
"SELECT d.rowid, d.firstname, d.lastname, d.societe, d.fk_adherent_type as type,";
886 $sql .=
" c.rowid as crowid, c.subscription,";
887 $sql .=
" c.datec, c.fk_type as cfk_type,";
888 $sql .=
" c.dateadh as dateh, c.note as clabel,";
890 $sql .=
" c.fk_bank,";
891 $sql .=
" b.rowid as bid,";
892 $sql .=
" ba.rowid as baid, ba.label, ba.bank, ba.ref, ba.account_number, ba.fk_accountancy_journal, ba.number, ba.currency_code";
893 $sql .=
" FROM ".MAIN_DB_PREFIX.
"adherent as d, ".MAIN_DB_PREFIX.
"subscription as c";
894 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"bank as b ON c.fk_bank = b.rowid";
895 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"bank_account as ba ON b.fk_account = ba.rowid";
896 $sql .=
" WHERE d.rowid = c.fk_adherent AND d.rowid=".((int) $rowid);
897 $sql .= $db->order($sortfield, $sortorder);
899 $result = $db->query($sql);
903 $num = $db->num_rows($result);
905 print
'<div class="div-table-responsive-no-min">';
906 print
'<table class="noborder centpercent">'.
"\n";
908 print
'<tr class="liste_titre">';
910 print_liste_field_titre(
'DateCreation', $_SERVER[
"PHP_SELF"],
'',
'', $param,
'', $sortfield, $sortorder,
'center ');
912 print_liste_field_titre(
'DateStart', $_SERVER[
"PHP_SELF"],
'',
'', $param,
'', $sortfield, $sortorder,
'center ');
913 print_liste_field_titre(
'DateEnd', $_SERVER[
"PHP_SELF"],
'',
'', $param,
'', $sortfield, $sortorder,
'center ');
917 print_liste_field_titre(
'Account', $_SERVER[
"PHP_SELF"],
'',
'', $param,
'', $sortfield, $sortorder,
'right ');
921 $accountstatic =
new Account($db);
927 $objp = $db->fetch_object($result);
929 $adh->id = $objp->rowid;
930 $adh->typeid = $objp->type;
932 $subscriptionstatic->ref = $objp->crowid;
933 $subscriptionstatic->id = $objp->crowid;
934 $subscriptionstatic->note_public = $objp->clabel;
936 $typeid = $objp->cfk_type;
938 $adht->fetch($typeid);
941 print
'<tr class="oddeven">';
942 print
'<td class="tdoverflowmax150">'.$subscriptionstatic->getNomUrl(1).
'</td>';
943 print
'<td class="center nowraponall">'.dol_print_date($db->jdate($objp->datec),
'dayhour').
"</td>\n";
944 print
'<td class="center tdoverflowmax125">';
946 print $adht->getNomUrl(1);
949 print
'<td class="center">'.dol_print_date($db->jdate($objp->dateh),
'day').
"</td>\n";
950 print
'<td class="center">'.dol_print_date($db->jdate($objp->datef),
'day').
"</td>\n";
951 print
'<td class="right amount">'.price($objp->subscription).
'</td>';
952 print
'<td class="left">'.$objp->clabel.
'</td>';
954 print
'<td class="tdoverflowmax100 right">';
956 $accountstatic->label = $objp->label;
957 $accountstatic->id = $objp->baid;
958 $accountstatic->number = $objp->number;
959 $accountstatic->account_number = $objp->account_number;
960 $accountstatic->currency_code = $objp->currency_code;
962 if (
isModEnabled(
'accounting') && $objp->fk_accountancy_journal > 0) {
964 $accountingjournal->fetch($objp->fk_accountancy_journal);
966 $accountstatic->accountancy_journal = $accountingjournal->getNomUrl(0, 1, 1,
'', 1);
969 $accountstatic->ref = $objp->ref;
970 print $accountstatic->getNomUrl(1);
985 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"None").
'</span></td></tr>';
991 dol_print_error($db);
996if (($action !=
'createsubscription' && $action !=
'create_thirdparty')) {
999 include_once DOL_DOCUMENT_ROOT.
'/core/lib/payments.lib.php';
1000 $validpaymentmethod = getValidOnlinePaymentMethods(
'');
1001 $useonlinepayment = count($validpaymentmethod);
1003 if ($useonlinepayment) {
1006 require_once DOL_DOCUMENT_ROOT.
'/core/lib/payments.lib.php';
1007 print showOnlinePaymentUrl(
'membersubscription',
$object->ref);
1015if (($action ==
'createsubscription' || $action ==
'create_thirdparty') && $user->hasRight(
'adherent',
'cotisation',
'creer')) {
1023 $bankviainvoice = 0;
1025 if (
GETPOST(
'paymentsave') ==
'bankdirect') {
1028 if (
GETPOST(
'paymentsave') ==
'invoiceonly') {
1031 if (
GETPOST(
'paymentsave') ==
'bankviainvoice') {
1032 $bankviainvoice = 1;
1036 $bankviainvoice = 1;
1044 print
"\n\n<!-- Form add subscription -->\n";
1046 if (
$conf->use_javascript_ajax) {
1048 print
"\n".
'<script type="text/javascript">';
1049 print
'$(document).ready(function () {
1050 $(".bankswitchclass, .bankswitchclass2").'.(($bankdirect || $bankviainvoice) ?
'show()' :
'hide()').
';
1051 $(".linkobjectswitchclass").'.(
GETPOST(
'paymentsave',
'aZ09') ==
'linktoobject' ?
'show()' :
'hide()').
';
1052 $("#none, #invoiceonly").click(function() {
1053 $(".bankswitchclass").hide();
1054 $(".bankswitchclass2").hide();
1055 $(".linkobjectswitchclass").hide();
1057 $("#bankdirect, #bankviainvoice").click(function() {
1058 $(".bankswitchclass").show();
1059 $(".bankswitchclass2").show();
1060 $(".linkobjectswitchclass").hide();
1062 $("#linktoobject").click(function() {
1063 $(".bankswitchclass").hide();
1064 $(".bankswitchclass2").hide();
1065 $(".linkobjectswitchclass").show();
1067 $("#selectoperation").change(function() {
1068 var code = $(this).val();
1071 $(".fieldrequireddyn").addClass("fieldrequired");
1072 if ($("#fieldchqemetteur").val() == "")
1074 $("#fieldchqemetteur").val($("#memberlabel").val());
1079 $(".fieldrequireddyn").removeClass("fieldrequired");
1084 print
'$("#'.GETPOST(
'paymentsave',
'aZ09').
'").prop("checked", true);';
1087 print
'</script>'.
"\n";
1092 if ($action ==
'create_thirdparty') {
1094 $fullname =
$object->getFullName($langs);
1096 if (
$object->morphy ==
'mor') {
1097 $companyname =
$object->company;
1098 if (!empty($fullname)) {
1099 $companyalias = $fullname;
1102 $companyname = $fullname;
1103 if (!empty(
$object->company)) {
1104 $companyalias =
$object->company;
1109 $formquestion = array(
1110 array(
'label' => $langs->trans(
"NameToCreate"),
'type' =>
'text',
'name' =>
'companyname',
'value' => $companyname,
'morecss' =>
'minwidth300',
'moreattr' =>
'maxlength="128"'),
1111 array(
'label' => $langs->trans(
"AliasNames"),
'type' =>
'text',
'name' =>
'companyalias',
'value' => $companyalias,
'morecss' =>
'minwidth300',
'moreattr' =>
'maxlength="128"')
1115 $tmpcompany =
new Societe($db);
1116 $tmpcompany->name = (string) $companyname;
1117 $tmpcompany->get_codeclient($tmpcompany, 0);
1118 $customercode = $tmpcompany->code_client;
1119 $formquestion[] = array(
1120 'label' => $langs->trans(
"CustomerCode"),
1122 'name' =>
'customercode',
1123 'value' => $customercode,
1124 'morecss' =>
'minwidth300',
1125 'moreattr' =>
'maxlength="128"',
1130 print $form->formconfirm($_SERVER[
"PHP_SELF"].
"?rowid=".
$object->id, $langs->trans(
"CreateDolibarrThirdParty"), $langs->trans(
"ConfirmCreateThirdParty"),
"confirm_create_thirdparty", $formquestion, 1);
1134 print
'<form name="subscription" method="POST" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
1135 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1136 print
'<input type="hidden" name="action" value="subscription">';
1137 print
'<input type="hidden" name="rowid" value="'.$rowid.
'">';
1138 print
'<input type="hidden" name="memberlabel" id="memberlabel" value="'.dol_escape_htmltag(
$object->getFullName($langs)).
'">';
1139 print
'<input type="hidden" name="thirdpartylabel" id="thirdpartylabel" value="'.dol_escape_htmltag(
$object->company).
'">';
1143 print
'<div class="div-table-responsive">';
1144 print
'<table class="border centpercent">'.
"\n";
1156 print
'<td class="fieldrequired">'.$langs->trans(
"DateSubscription").
'</td><td>';
1181 print $form->selectDate($datefrom,
'', 0, 0, 0,
"subscription", 1, 1);
1191 } elseif (
getDolGlobalInt(
'MEMBER_SUBSCRIPTION_SUGGEST_END_OF_YEAR')) {
1197 print
'<tr><td>'.$langs->trans(
"DateEndSubscription").
'</td><td>';
1198 print $form->selectDate($dateto,
'end', 0, 0, 0,
"subscription", 1, 0);
1201 if ($adht->subscription) {
1203 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Amount").
'</td>';
1204 print
'<td><input autofocus class="width50" type="text" name="subscription" value="'.(GETPOSTISSET(
'subscription') ?
GETPOST(
'subscription') : (is_null($adht->
amount) ?
'' :
price($adht->
amount, 0,
'', 0))).
'"> '.$langs->trans(
"Currency".
getDolCurrency()) .
'</td></tr>';
1207 print
'<tr><td>'.$langs->trans(
"Note").
'</td>';
1208 print
'<td><input name="label" type="text" size="32" value="';
1212 print
'"></td></tr>';
1218 $result = $company->fetch(
$object->socid);
1222 print
'<tr><td class="tdtop fieldrequired">'.$langs->trans(
'MoreActions');
1224 print
'<td class="line-height-large">';
1226 print
'<input type="radio" class="moreaction" id="none" name="paymentsave" value="none"'.(empty($bankdirect) && empty($invoiceonly) && empty($bankviainvoice) ?
' checked' :
'').
'>';
1227 print
'<label for="none"> '.$langs->trans(
"None").
'</label><br>';
1230 print
'<input type="radio" class="moreaction" id="bankdirect" name="paymentsave" value="bankdirect"'.(!empty($bankdirect) ?
' checked' :
'');
1231 print
'><label for="bankdirect"> '.$langs->trans(
"MoreActionBankDirect").
'</label><br>';
1235 print
'<input type="radio" class="moreaction" id="invoiceonly" name="paymentsave" value="invoiceonly"'.(!empty($invoiceonly) ?
' checked' :
'');
1237 print
'><label for="invoiceonly"> '.$langs->trans(
"MoreActionInvoiceOnly");
1239 print
' ('.$langs->trans(
"ThirdParty").
': '.$company->getNomUrl(1).
')';
1243 print img_warning($langs->trans(
"NoThirdPartyAssociatedToMember"));
1245 print $langs->trans(
"NoThirdPartyAssociatedToMember");
1246 print
' - <a href="'.$_SERVER[
"PHP_SELF"].
'?rowid='.
$object->id.
'&action=create_thirdparty&token='.
newToken().
'">';
1247 print $langs->trans(
"CreateDolibarrThirdParty");
1251 print
'. <span class="opacitymedium">'.$langs->trans(
"NoVatOnSubscription", 0).
'</span>';
1255 $result = $prodtmp->fetch(
getDolGlobalInt(
'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS'));
1257 setEventMessage($prodtmp->error,
'errors');
1259 print
'. '.$langs->transnoentitiesnoconv(
"ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS", $prodtmp->getNomUrl(1));
1261 print
'</label><br>';
1265 print
'<input type="radio" class="moreaction" id="bankviainvoice" name="paymentsave" value="bankviainvoice"'.(!empty($bankviainvoice) ?
' checked' :
'');
1267 print
'><label for="bankviainvoice"> '.$langs->trans(
"MoreActionBankViaInvoice");
1269 print
' ('.$langs->trans(
"ThirdParty").
': '.$company->getNomUrl(1).
')';
1273 print img_warning($langs->trans(
"NoThirdPartyAssociatedToMember"));
1275 print $langs->trans(
"NoThirdPartyAssociatedToMember");
1276 print
' - <a href="'.$_SERVER[
"PHP_SELF"].
'?rowid='.
$object->id.
'&action=create_thirdparty&token='.
newToken().
'">';
1277 print $langs->trans(
"CreateDolibarrThirdParty");
1281 print
'. <span class="opacitymedium">'.$langs->trans(
"NoVatOnSubscription", 0).
'</span>';
1285 $result = $prodtmp->fetch(
getDolGlobalInt(
'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS'));
1287 setEventMessage($prodtmp->error,
'errors');
1289 print
'. '.$langs->transnoentitiesnoconv(
"ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS", $prodtmp->getNomUrl(1));
1291 print
'</label><br>';
1295 print
'<input type="radio" class="moreaction" id="linktoobject" name="paymentsave" value="linktoobject">';
1296 print
'<label for="linktoobject"> '.$langs->trans(
"MoreActionLinkToExistingObject").
'</label><br>';
1300 $showproject = (
isModEnabled(
'project') && $user->hasRight(
'projet',
'lire'));
1301 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
1302 $projectstatic =
new Project($db);
1304 print
'<div class="linkobjectswitchclass" style="margin-left: 20px; margin-top: 5px; display:none;">';
1307 if (
isModEnabled(
'invoice') && $user->hasRight(
'facture',
'lire')) {
1308 $sql_invoices =
"SELECT f.rowid, f.fk_projet";
1309 $sql_invoices .=
" FROM ".MAIN_DB_PREFIX.
"facture as f";
1310 $sql_invoices .=
" WHERE f.fk_soc = ".((int)
$object->socid).
" AND f.entity IN (".
getEntity(
'invoice').
")";
1311 $sql_invoices .= $db->order(
"f.datef",
"DESC");
1313 $sql_invoices .= $db->plimit(5);
1315 print
'<div class="div-table-responsive-no-min">';
1316 print
'<table class="noborder allwidth">';
1317 print
'<tr class="liste_titre">';
1319 print
'<td colspan="2" class="left">'.$langs->trans(
"LastBills", 5).
'</td>';
1320 print
'<td>'.$langs->trans(
"RefCustomer").
'</td>';
1322 print
'<td>'.$langs->trans(
"Project").
'</td>';
1324 print
'<td class="center">'.$langs->trans(
"Date").
'</td>';
1325 print
'<td class="right">'.$langs->trans(
"AmountHT").
'</td>';
1326 print
'<td class="right">'.$langs->trans(
"Status").
'</td>';
1329 $resql_invoices = $db->query($sql_invoices);
1330 if ($resql_invoices) {
1331 $num_invoices = $db->num_rows($resql_invoices);
1332 $invoicestatic =
new Facture($db);
1335 while ($j < $num_invoices) {
1336 $objinv = $db->fetch_object($resql_invoices);
1337 $invoicestatic->fetch($objinv->rowid);
1339 print
'<tr class="oddeven">';
1340 print
'<td class="center" style="padding: 4px;"><input type="checkbox" name="invoices_to_link[]" value="'.$invoicestatic->id.
'" style="width: 14px; height: 14px;"'.(is_array($invoices_to_link_post) && in_array($invoicestatic->id, $invoices_to_link_post) ?
' checked' :
'').
'></td>';
1341 print
'<td class="linkedcol-name tdoverflowmax150">'.$invoicestatic->getNomUrl(1).
'</td>';
1342 print
'<td class="linkedcol-ref tdoverflowmax150 nopaddingtopimp nopaddingbottomimp" title="'.dol_escape_htmltag($invoicestatic->ref_client).
'">';
1343 if ($invoicestatic->ref_client) {
1344 print
'<span class="small">'.dol_escape_htmltag($invoicestatic->ref_client).
'</span>';
1350 $project_label =
' ';
1351 if (!empty($objinv->fk_projet) && $projectstatic->fetch($objinv->fk_projet) > 0) {
1352 $project_label = $projectstatic->getNomUrl(1);
1354 print
'<td class="linkedcol-project">'.$project_label.
'</td>';
1356 print
'<td class="linkedcol-date center">'.dol_print_date($invoicestatic->date,
'day').
'</td>';
1357 print
'<td class="linkedcol-amount right">'.price($invoicestatic->total_ht).
'</td>';
1358 print
'<td class="linkedcol-statut right">'.$invoicestatic->getLibStatut(3).
'</td>';
1362 $colspan = $showproject ? 7 : 6;
1363 if (!$num_invoices) {
1364 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"None").
'</span></td></tr>';
1367 dol_print_error($db);
1371 print
'<tr class="liste_titre">';
1373 print
'<td><input type="text" name="invoicereftolink" placeholder="'.dol_escape_htmltag($langs->trans(
"Ref")).
'" style="width: 95%;" value="'.
dol_escape_htmltag($invoicereftolink_post).
'"></td>';
1374 print
'<td colspan="'.($showproject ? 5 : 4).
'"></td>';
1384 if (
isModEnabled(
'order') && $user->hasRight(
'commande',
'lire')) {
1385 $sql_orders =
"SELECT c.rowid, c.fk_projet";
1386 $sql_orders .=
" FROM ".MAIN_DB_PREFIX.
"commande as c";
1387 $sql_orders .=
" WHERE c.fk_soc = ".((int)
$object->socid).
" AND c.entity IN (".
getEntity(
'commande').
")";
1388 $sql_orders .= $db->order(
"c.date_commande",
"DESC");
1390 $sql_orders .= $db->plimit(5);
1392 print
'<div class="div-table-responsive-no-min">';
1393 print
'<table class="noborder allwidth">';
1394 print
'<tr class="liste_titre">';
1396 print
'<td colspan="2" class="left">'.$langs->trans(
"LastOrders", 5).
'</td>';
1397 print
'<td>'.$langs->trans(
"RefCustomer").
'</td>';
1399 print
'<td>'.$langs->trans(
"Project").
'</td>';
1401 print
'<td class="center">'.$langs->trans(
"Date").
'</td>';
1402 print
'<td class="right">'.$langs->trans(
"AmountHT").
'</td>';
1403 print
'<td class="right">'.$langs->trans(
"Status").
'</td>';
1406 $resql_orders = $db->query($sql_orders);
1407 if ($resql_orders) {
1408 $num_orders = $db->num_rows($resql_orders);
1412 while ($j < $num_orders) {
1413 $objord = $db->fetch_object($resql_orders);
1414 $orderstatic->fetch($objord->rowid);
1416 print
'<tr class="oddeven">';
1417 print
'<td class="center" style="padding: 4px;"><input type="checkbox" name="orders_to_link[]" value="'.$orderstatic->id.
'" style="width: 14px; height: 14px;"'.(is_array($orders_to_link_post) && in_array($orderstatic->id, $orders_to_link_post) ?
' checked' :
'').
'></td>';
1418 print
'<td class="linkedcol-name tdoverflowmax150">'.$orderstatic->getNomUrl(1).
'</td>';
1419 print
'<td class="linkedcol-ref tdoverflowmax150 nopaddingtopimp nopaddingbottomimp" title="'.dol_escape_htmltag($orderstatic->ref_client).
'">';
1420 if ($orderstatic->ref_client) {
1421 print
'<span class="small">'.dol_escape_htmltag($orderstatic->ref_client).
'</span>';
1427 $project_label =
' ';
1428 if (!empty($objord->fk_projet) && $projectstatic->fetch($objord->fk_projet) > 0) {
1429 $project_label = $projectstatic->getNomUrl(1);
1431 print
'<td class="linkedcol-project">'.$project_label.
'</td>';
1433 print
'<td class="linkedcol-date center">'.dol_print_date($orderstatic->date,
'day').
'</td>';
1434 print
'<td class="linkedcol-amount right">'.price($orderstatic->total_ht).
'</td>';
1435 print
'<td class="linkedcol-statut right">'.$orderstatic->getLibStatut(3).
'</td>';
1439 $colspan = $showproject ? 7 : 6;
1441 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"None").
'</span></td></tr>';
1444 dol_print_error($db);
1448 print
'<tr class="liste_titre">';
1450 print
'<td><input type="text" name="orderreftolink" placeholder="'.dol_escape_htmltag($langs->trans(
"Ref")).
'" style="width: 95%;" value="'.
dol_escape_htmltag($orderreftolink_post).
'"></td>';
1451 print
'<td colspan="'.($showproject ? 5 : 4).
'"></td>';
1464 print
'<tr class="bankswitchclass"><td class="fieldrequired">'.$langs->trans(
"FinancialAccount").
'</td><td>';
1465 print img_picto(
'',
'bank_account',
'class="pictofixedwidth"');
1466 $form->select_comptes(
GETPOST(
'accountid'),
'accountid', 0,
'', 2,
'', 0,
'minwidth200');
1467 print
"</td></tr>\n";
1470 print
'<tr class="bankswitchclass"><td class="fieldrequired">'.$langs->trans(
"PaymentMode").
'</td><td>';
1471 print $form->select_types_paiements(
GETPOST(
'operation'),
'operation',
'', 2, 1, 0, 0, 1,
'minwidth200', 1);
1472 print
"</td></tr>\n";
1475 print
'<tr class="bankswitchclass"><td class="fieldrequired">'.$langs->trans(
"DatePayment").
'</td><td>';
1476 print $form->selectDate(isset($paymentdate) ? $paymentdate : -1,
'payment', 0, 0, 1,
'subscription', 1, 1);
1477 print
"</td></tr>\n";
1479 print
'<tr class="bankswitchclass2"><td>'.$langs->trans(
'Numero');
1480 print
' <em>('.$langs->trans(
"ChequeOrTransferNumber").
')</em>';
1482 print
'<td><input id="fieldnum_chq" name="num_chq" type="text" size="8" value="'.(!
GETPOST(
'num_chq') ?
'' :
GETPOST(
'num_chq')).
'"></td></tr>';
1484 print
'<tr class="bankswitchclass2 fieldrequireddyn"><td>'.$langs->trans(
'CheckTransmitter');
1485 print
' <em>('.$langs->trans(
"ChequeMaker").
')</em>';
1487 print
'<td><input id="fieldchqemetteur" name="chqemetteur" size="32" type="text" value="'.(!
GETPOST(
'chqemetteur') ?
'' :
GETPOST(
'chqemetteur')).
'"></td></tr>';
1489 print
'<tr class="bankswitchclass2"><td>'.$langs->trans(
'Bank');
1490 print
' <em>('.$langs->trans(
"ChequeBank").
')</em>';
1492 print
'<td><input id="chqbank" name="chqbank" size="32" type="text" value="'.(!
GETPOST(
'chqbank') ?
'' :
GETPOST(
'chqbank')).
'"></td></tr>';
1496 print
'<tr><td></td><td></td></tr>';
1498 print
'<tr><td>'.$langs->trans(
"SendAcknowledgementByMail").
'</td>';
1501 print $langs->trans(
"NoEMail");
1504 $adht->fetch(
$object->typeid);
1511 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
1515 $outputlangs->setDefaultLang(!empty(
$object->default_lang) ?
$object->default_lang : (empty(
$object->thirdparty->default_lang) ?
$mysoc->default_lang :
$object->thirdparty->default_lang));
1517 $outputlangs->loadLangs(array(
"main",
"members"));
1519 $arraydefaultmessage =
null;
1522 if (!empty($labeltouse)) {
1523 $arraydefaultmessage = $formmail->getEMailTemplate($db,
'member', $user, $outputlangs, 0, 1, $labeltouse);
1526 if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
1527 $subject = (string) $arraydefaultmessage->topic;
1528 $msg = (string) $arraydefaultmessage->content;
1531 $substitutionarray = getCommonSubstitutionArray($outputlangs, 0,
null, $object);
1536 $tmp =
'<input name="sendmail" type="checkbox"'.(GETPOST(
'sendmail',
'alpha') ?
' checked' : (
getDolGlobalString(
'ADHERENT_DEFAULT_SENDINFOBYMAIL') ?
' checked' :
'')).
'>';
1538 $helpcontent .=
'<b>'.$langs->trans(
"MailFrom").
'</b>: '.
getDolGlobalString(
'ADHERENT_MAIL_FROM',
$conf->email_from).
'<br>'.
"\n";
1539 $helpcontent .=
'<b>'.$langs->trans(
"MailRecipient").
'</b>: '.
$object->email.
'<br>'.
"\n";
1540 $helpcontent .=
'<b>'.$langs->trans(
"MailTopic").
'</b>:<br>'.
"\n";
1541 if ($subjecttosend) {
1542 $helpcontent .= $subjecttosend.
"\n";
1544 $langs->load(
"errors");
1545 $helpcontent .=
'<span class="error">'.$langs->trans(
"ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv(
"Module310Name")).
'</span>'.
"\n";
1547 $helpcontent .=
"<br>";
1548 $helpcontent .=
'<b>'.$langs->trans(
"MailText").
'</b>:<br>';
1552 $langs->load(
"errors");
1553 $helpcontent .=
'<span class="error">'.$langs->trans(
"ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv(
"Module310Name")).
'</span>'.
"\n";
1556 print $form->textwithpicto($tmp, $helpcontent, 1,
'help',
'', 0, 2,
'helpemailtosend');
1565 print
'<div class="center">';
1566 $parameters = array();
1567 $reshook = $hookmanager->executeHooks(
'addMoreActionsButtons', $parameters, $object, $action);
1568 if (empty($reshook)) {
1569 print
'<input type="submit" class="button" name="add" value="'.$langs->trans(
"AddSubscription").
'">';
1570 print
' ';
1571 print
'<input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans(
"Cancel").
'">';
1577 print
"\n<!-- End form subscription -->\n\n";
$id
Support class for third parties, contacts, members, users or resources.
if(! $sortfield) if(! $sortorder) $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.
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
Class to manage bank accounts.
Class to manage accounting journals.
Class to manage members of a foundation.
const STATUS_VALIDATED
Validated status.
Class to manage members type.
Class to manage customers orders.
Class to manage invoices.
Class to manage products or services.
Class to manage projects.
Class to manage third parties objects (customers, suppliers, prospects...)
Class to manage subscriptions of foundation members.
Class to manage translations.
Class to manage Dolibarr users.
dol_get_first_day($year, $month=1, $gm=false)
Return GMT time for first day of a month or year.
dol_get_last_day($year, $month=12, $gm=false)
Return GMT time for last day of a month or year.
dol_time_plus_duree($time, $duration_value, $duration_unit, $ruleforendofmonth=0, $tz='')
Add a delay to a date.
dol_most_recent_file($dir, $regexfilter='', $excludefilter=array('(\.meta|_preview.*\.png) $', '^\.'), $nohook=0, $mode=0, $limit=0)
Return file(s) into a directory (by default most recent)
dol_now($mode='gmt')
Return date for now.
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...
price2num($amount, $rounding='', $option=0, $currencycode='')
Function that return a number with universal decimal format (decimal separator is '.
dol_mimetype($file, $default='application/octet-stream', $mode=0)
Return MIME type of a file from its name with extension.
dol_eval($s, $returnvalue=1, $hideerrors=1, $onlysimplestring='1')
Replace eval function to add more security.
price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code='')
Function to format a value into an amount for visual output Function used into PDF and HTML pages.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0, $nodefault=0)
Return value of a param into GET or POST supervariable.
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...
getDolCurrency()
Return the main currency ('EUR', 'USD', ...)
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...
GETPOSTINT($paramname, $method=0, $nodefault=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_clone($srcobject, $native=2)
Create a clone of instance of object (new instance with same value for each properties) With native =...
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false, $decorate=0)
Output date in a string format according to outputlangs (or langs if not defined).
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
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...
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
getEntity($element, $shared=1, $currentobject=null)
Get list of entity id to use.
picto_from_langcode($codelang, $moreatt='', $notitlealt=0)
Return img flag of country for a language code or country code.
print_liste_field_titre($name, $file="", $field="", $begin="", $param="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0, $morecssdiv='')
Show tabs of a record.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
member_prepare_head(Adherent $object)
Return array head with list of tabs to view object information.
print $langs trans('Date')." left Ref Label right Qty right Price right TotalHT right TotalTTC right right right right right right right right right centpercent right TotalHT right n right VAT right n right TotalVAT right n No sujeto a RE IRPF right TotalLT1 right n right TotalLT2 right n right TotalTTC right n takeposcustomercurrency takeposcustomercurrency takeposcustomercurrency takeposcustomercurrency right TotalTTC takeposcustomercurrency right takeposcustomercurrency n right Paid right PaymentTypeShortLIQ right SELECT p pos_change as p datep as p p num_paiement as f pf amount as amount
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $nodie=0, $mode='')
Check permissions of a user to show a page and an object.