From 53edb86ffb908cb379cbf5e89d5a012a382cf968 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 23 Mar 2018 19:35:25 +0100 Subject: [PATCH] Make sending of email for member module ok with new email template archi --- htdocs/adherents/card.php | 133 +++++++++++++++--- htdocs/adherents/class/adherent.class.php | 3 +- .../adherents/class/adherent_type.class.php | 24 ++-- htdocs/adherents/subscription.php | 57 +++++++- htdocs/core/class/html.form.class.php | 2 +- .../core/class/html.formticketsup.class.php | 10 +- htdocs/core/lib/member.lib.php | 2 + htdocs/core/tpl/notes.tpl.php | 4 +- htdocs/public/members/new.php | 41 +++++- htdocs/public/payment/paymentok.php | 28 +++- htdocs/theme/eldy/style.css.php | 3 +- htdocs/theme/md/style.css.php | 3 +- 12 files changed, 252 insertions(+), 58 deletions(-) diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 41a49bd386d..2e1526c89cb 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -238,21 +238,6 @@ if (empty($reshook)) } } - /* - if ($action == 'confirm_sendinfo' && $confirm == 'yes') - { - if ($object->email) - { - $from=$conf->email_from; - if (! empty($conf->global->ADHERENT_MAIL_FROM)) $from=$conf->global->ADHERENT_MAIL_FROM; - - $result=$object->send_an_email($langs->transnoentitiesnoconv("ThisIsContentOfYourCard")."\n\n%INFOS%\n\n",$langs->transnoentitiesnoconv("CardContent")); - - $langs->load("mails"); - setEventMessages($langs->trans("MailSuccessfulySent", $from, $object->email), null, 'mesgs'); - } - }*/ - if ($action == 'update' && ! $cancel && $user->rights->adherent->creer) { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; @@ -630,7 +615,34 @@ if (empty($reshook)) // Send confirmation email (according to parameters of member type. Otherwise generic) if ($object->email && GETPOST("send_mail")) { - $result=$object->send_an_email($adht->getMailOnValid(),$conf->global->ADHERENT_MAIL_VALID_SUBJECT,array(),array(),array(),"","",0,2); + $subject = ''; + $msg= ''; + + // Send subscription email + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $formmail=new FormMail($db); + // Set output language + $outputlangs = new Translate('', $conf); + $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang); + $outputlangs->loadLangs(array("main", "members")); + // Get email content fro mtemplae + $arraydefaultmessage=null; + $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION; + + if (! empty($labeltouse)) $arraydefaultmessage=$formmail->getEMailTemplate($db, 'member', $user, $outputlangs, 0, 1, $labeltouse); + + if (! empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) + { + $subject = $arraydefaultmessage->topic; + $msg = $arraydefaultmessage->content; + } + + $substitutionarray=getCommonSubstitutionArray($outputlangs, 0, null, $object); + complete_substitutions_array($substitutionarray, $outputlangs, $object); + $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); + $texttosend = make_substitutions(dol_concatdesc($msg, $adht->getMailOnValid()), $substitutionarray, $outputlangs); + + $result=$object->send_an_email($texttosend, $subjecttosend, array(), array(), array(), "", "", 0, 2); if ($result < 0) { $error++; @@ -674,7 +686,34 @@ if (empty($reshook)) { if ($object->email && GETPOST("send_mail")) { - $result=$object->send_an_email($adht->getMailOnResiliate(),$conf->global->ADHERENT_MAIL_RESIL_SUBJECT,array(),array(),array(),"","",0,-1); + $subject = ''; + $msg= ''; + + // Send subscription email + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $formmail=new FormMail($db); + // Set output language + $outputlangs = new Translate('', $conf); + $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang); + $outputlangs->loadLangs(array("main", "members")); + // Get email content fro mtemplae + $arraydefaultmessage=null; + $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_CANCELATION; + + if (! empty($labeltouse)) $arraydefaultmessage=$formmail->getEMailTemplate($db, 'member', $user, $outputlangs, 0, 1, $labeltouse); + + if (! empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) + { + $subject = $arraydefaultmessage->topic; + $msg = $arraydefaultmessage->content; + } + + $substitutionarray=getCommonSubstitutionArray($outputlangs, 0, null, $object); + complete_substitutions_array($substitutionarray, $outputlangs, $object); + $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); + $texttosend = make_substitutions(dol_concatdesc($msg, $adht->getMailOnResiliate()), $substitutionarray, $outputlangs); + + $result=$object->send_an_email($texttosend, $subjecttosend, array(), array(), array(), "", "", 0, -1); } if ($result < 0) { @@ -1350,8 +1389,32 @@ else $adht = new AdherentType($db); $adht->fetch($object->typeid); - $subjecttosend=$object->makeSubstitution($conf->global->ADHERENT_MAIL_VALID_SUBJECT); - $texttosend=$object->makeSubstitution($adht->getMailOnValid()); + $subject = ''; + $msg= ''; + + // Send subscription email + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $formmail=new FormMail($db); + // Set output language + $outputlangs = new Translate('', $conf); + $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang); + $outputlangs->loadLangs(array("main", "members")); + // Get email content fro mtemplae + $arraydefaultmessage=null; + $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION; + + if (! empty($labeltouse)) $arraydefaultmessage=$formmail->getEMailTemplate($db, 'member', $user, $outputlangs, 0, 1, $labeltouse); + + if (! empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) + { + $subject = $arraydefaultmessage->topic; + $msg = $arraydefaultmessage->content; + } + + $substitutionarray=getCommonSubstitutionArray($outputlangs, 0, null, $object); + complete_substitutions_array($substitutionarray, $outputlangs, $object); + $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); + $texttosend = make_substitutions(dol_concatdesc($msg, $adht->getMailOnValid()), $substitutionarray, $outputlangs); $tmp=$langs->trans("SendingAnEMailToMember"); $tmp.='
'.$langs->trans("MailFrom").': '.$conf->global->ADHERENT_MAIL_FROM.', '; @@ -1375,7 +1438,7 @@ else if (! empty($conf->mailman->enabled) && ! empty($conf->global->ADHERENT_USE_SPIP)) { $formquestion[]=array('type'=>'other','label'=>$langs->transnoentitiesnoconv("SynchroSpipEnabled"),'value'=>''); } - print $form->formconfirm("card.php?rowid=".$id,$langs->trans("ValidateMember"),$langs->trans("ConfirmValidateMember"),"confirm_valid",$formquestion,1,1); + print $form->formconfirm("card.php?rowid=".$id, $langs->trans("ValidateMember"), $langs->trans("ConfirmValidateMember"), "confirm_valid", $formquestion, '1', 1, 220); } // Confirm send card by mail @@ -1392,8 +1455,32 @@ else $adht = new AdherentType($db); $adht->fetch($object->typeid); - $subjecttosend=$object->makeSubstitution($conf->global->ADHERENT_MAIL_RESIL_SUBJECT); - $texttosend=$object->makeSubstitution($adht->getMailOnResiliate()); + $subject = ''; + $msg= ''; + + // Send subscription email + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $formmail=new FormMail($db); + // Set output language + $outputlangs = new Translate('', $conf); + $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang); + $outputlangs->loadLangs(array("main", "members")); + // Get email content fro mtemplae + $arraydefaultmessage=null; + $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_CANCELATION; + + if (! empty($labeltouse)) $arraydefaultmessage=$formmail->getEMailTemplate($db, 'member', $user, $outputlangs, 0, 1, $labeltouse); + + if (! empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) + { + $subject = $arraydefaultmessage->topic; + $msg = $arraydefaultmessage->content; + } + + $substitutionarray=getCommonSubstitutionArray($outputlangs, 0, null, $object); + complete_substitutions_array($substitutionarray, $outputlangs, $object); + $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); + $texttosend = make_substitutions(dol_concatdesc($msg, $adht->getMailOnResiliate()), $substitutionarray, $outputlangs); $tmp=$langs->trans("SendingAnEMailToMember"); $tmp.='
('.$langs->trans("MailFrom").': '.$conf->global->ADHERENT_MAIL_FROM.', '; @@ -1623,7 +1710,7 @@ else $parameters = array(); $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been if (empty($reshook)) { - if ($action != 'valid' && $action != 'editlogin' && $action != 'editthirdparty') + if ($action != 'editlogin' && $action != 'editthirdparty') { // Send if ($object->statut == 1) { diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 3ef7af75ceb..5323355eb11 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -2556,7 +2556,7 @@ class Adherent extends CommonObject // Send reminder email include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; - include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; + $formmail=new FormMail($db); $outputlangs = new Translate('', $conf); $outputlangs->setDefaultLang(empty($adherent->thirdparty->default_lang) ? $mysoc->default_lang : $adherent->thirdparty->default_lang); @@ -2578,6 +2578,7 @@ class Adherent extends CommonObject $from = $conf->global->ADHERENT_MAIL_FROM; $to = $adherent->email; + include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; $cmail = new CMailFile($subject, $to, $from, $msg, array(), array(), array(), '', '', 0, 1); $result = $cmail->sendfile(); if (! $result) diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index 71f18f01e4a..2393d5dad3b 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -499,7 +499,7 @@ class AdherentType extends CommonObject /** * getMailOnValid * - * @return string Return mail model + * @return string Return mail content of type or empty */ function getMailOnValid() { @@ -509,16 +509,14 @@ class AdherentType extends CommonObject { return $this->mail_valid; } - else - { - return $conf->global->ADHERENT_MAIL_VALID; - } + + return ''; } /** * getMailOnSubscription * - * @return string Return mail model + * @return string Return mail content of type or empty */ function getMailOnSubscription() { @@ -529,16 +527,14 @@ class AdherentType extends CommonObject { return $this->mail_subscription; } - else - { - return $conf->global->ADHERENT_MAIL_COTIS; - } + + return ''; } /** * getMailOnResiliate * - * @return string Return mail model + * @return string Return mail model content of type or empty */ function getMailOnResiliate() { @@ -549,10 +545,8 @@ class AdherentType extends CommonObject { return $this->mail_resiliate; } - else - { - return $conf->global->ADHERENT_MAIL_RESIL; - } + + return ''; } } diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index 9d164307e91..3e4af5438c6 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -349,8 +349,32 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && ! // Send confirmation Email if ($object->email && $sendalsoemail) { - $subjecttosend=$object->makeSubstitution($conf->global->ADHERENT_MAIL_COTIS_SUBJECT); - $texttosend=$object->makeSubstitution($adht->getMailOnSubscription()); + $subject = ''; + $msg= ''; + + // Send subscription email + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $formmail=new FormMail($db); + // Set output language + $outputlangs = new Translate('', $conf); + $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang); + $outputlangs->loadLangs(array("main", "members")); + // Get email content fro mtemplae + $arraydefaultmessage=null; + $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION; + + if (! empty($labeltouse)) $arraydefaultmessage=$formmail->getEMailTemplate($db, 'member', $user, $outputlangs, 0, 1, $labeltouse); + + if (! empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) + { + $subject = $arraydefaultmessage->topic; + $msg = $arraydefaultmessage->content; + } + + $substitutionarray=getCommonSubstitutionArray($outputlangs, 0, null, $object); + complete_substitutions_array($substitutionarray, $outputlangs, $object); + $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); + $texttosend = make_substitutions(dol_concatdesc($msg, $adht->getMailOnSubscription()), $substitutionarray, $outputlangs); // Attach a file ? $file=''; @@ -1018,8 +1042,33 @@ if ($rowid > 0) $adht = new AdherentType($db); $adht->fetch($object->typeid); - $subjecttosend=$object->makeSubstitution($conf->global->ADHERENT_MAIL_COTIS_SUBJECT); - $texttosend=$object->makeSubstitution($adht->getMailOnSubscription()); + // Send subscription email + $subject = ''; + $msg= ''; + + // Send subscription email + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $formmail=new FormMail($db); + // Set output language + $outputlangs = new Translate('', $conf); + $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang); + $outputlangs->loadLangs(array("main", "members")); + // Get email content fro mtemplae + $arraydefaultmessage=null; + $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION; + + if (! empty($labeltouse)) $arraydefaultmessage=$formmail->getEMailTemplate($db, 'member', $user, $outputlangs, 0, 1, $labeltouse); + + if (! empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) + { + $subject = $arraydefaultmessage->topic; + $msg = $arraydefaultmessage->content; + } + + $substitutionarray=getCommonSubstitutionArray($outputlangs, 0, null, $object); + complete_substitutions_array($substitutionarray, $outputlangs, $object); + $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); + $texttosend = make_substitutions(dol_concatdesc($msg, $adht->getMailOnSubscription()), $substitutionarray, $outputlangs); $tmp='global->ADHERENT_DEFAULT_SENDINFOBYMAIL)?' checked':'')).'>'; $helpcontent=''; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 8c575b6478e..8e9fa3bec4e 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3597,7 +3597,7 @@ class Form * @param string $action Action * @param array $formquestion An array with complementary inputs to add into forms: array(array('label'=> ,'type'=> , )) * type can be 'hidden', 'text', 'password', 'checkbox', 'radio', 'date', ... - * @param string $selectedchoice "" or "no" or "yes" + * @param string $selectedchoice '' or 'no' or 'yes' or '1' or '0' * @param int $useajax 0=No, 1=Yes, 2=Yes but submit page with &confirm=no if choice is No, 'xxx'=Yes and preoutput confirm box with div id=dialog-confirm-xxx * @param int $height Force height of box * @param int $width Force width of box ('999' or '90%'). Ignored and forced to 90% on smartphones. diff --git a/htdocs/core/class/html.formticketsup.class.php b/htdocs/core/class/html.formticketsup.class.php index 3310b83eb09..b86ebc95442 100644 --- a/htdocs/core/class/html.formticketsup.class.php +++ b/htdocs/core/class/html.formticketsup.class.php @@ -808,7 +808,7 @@ class FormTicketsup // External users can't send message email - if ($user->rights->ticketsup->write && !$user->societe_id) { + if ($user->rights->ticketsup->write && !$user->socid) { print ''; $checkbox_selected = ( GETPOST('send_email') == "1" ? ' checked' : ''); print ' '; @@ -839,7 +839,7 @@ class FormTicketsup print ""; } - if (!$user->societe_id) { + if (! $user->socid) { print ''; $checkbox_selected = ( GETPOST('private_message') == "1" ? ' checked' : ''); print ' '; @@ -902,7 +902,7 @@ class FormTicketsup // Intro // External users can't send message email - if ($user->rights->ticketsup->write && !$user->societe_id) { + if ($user->rights->ticketsup->write && !$user->socid) { $mail_intro = GETPOST('mail_intro') ? GETPOST('mail_intro') : $conf->global->TICKETS_MESSAGE_MAIL_INTRO; print ''; @@ -945,7 +945,7 @@ class FormTicketsup $doleditor = new DolEditor('message', $defaultmessage, '100%', 350, 'dolibarr_details', '', false, true, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_2, 70); $doleditor->Create(); print ''; - if ($user->rights->ticketsup->write && !$user->societe_id) { + if ($user->rights->ticketsup->write && !$user->socid) { print $form->textwithpicto('', $langs->trans("TicketMessageHelp"), 1, 'help'); } @@ -953,7 +953,7 @@ class FormTicketsup // Signature // External users can't send message email - if ($user->rights->ticketsup->write && !$user->societe_id) { + if ($user->rights->ticketsup->write && !$user->socid) { $mail_signature = GETPOST('mail_signature') ? GETPOST('mail_signature') : $conf->global->TICKETS_MESSAGE_MAIL_SIGNATURE; print ''; diff --git a/htdocs/core/lib/member.lib.php b/htdocs/core/lib/member.lib.php index 4da1ed91fae..3148d484ab5 100644 --- a/htdocs/core/lib/member.lib.php +++ b/htdocs/core/lib/member.lib.php @@ -55,9 +55,11 @@ function member_prepare_head(Adherent $object) if (! empty($user->rights->adherent->cotisation->lire)) { + $nbSubscription = is_array($object->subscriptions)?count($object->subscriptions):0; $head[$h][0] = DOL_URL_ROOT.'/adherents/subscription.php?rowid='.$object->id; $head[$h][1] = $langs->trans("Subscriptions"); $head[$h][2] = 'subscription'; + if ($nbSubscription > 0) $head[$h][1].= ' '.$nbSubscription.''; $h++; } diff --git a/htdocs/core/tpl/notes.tpl.php b/htdocs/core/tpl/notes.tpl.php index 5cee06b5dae..7ba077f065b 100644 --- a/htdocs/core/tpl/notes.tpl.php +++ b/htdocs/core/tpl/notes.tpl.php @@ -79,7 +79,7 @@ print '
'."\n"; if ($module != 'product') { // No public note yet on products print '
'."\n"; - print '
'."\n"; + print '
'."\n"; print $form->editfieldkey("NotePublic", $note_public, $value_public, $object, $permission, $typeofdata, $moreparam, '', 0); print '
'."\n"; print '
'."\n"; @@ -89,7 +89,7 @@ if ($module != 'product') { } if (empty($user->societe_id)) { print '
'."\n"; - print '
'."\n"; + print '
'."\n"; print $form->editfieldkey("NotePrivate", $note_private, $value_private, $object, $permission, $typeofdata, $moreparam, '', 0); print '
'."\n"; print '
'."\n"; diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index 9c93808e819..63924ac6b1d 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -256,11 +256,46 @@ if ($action == 'add') if ($result > 0) { require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; + $object = $adh; - // Send email to say it has been created and will be validated soon... - if (! empty($conf->global->ADHERENT_AUTOREGISTER_MAIL) && ! empty($conf->global->ADHERENT_AUTOREGISTER_MAIL_SUBJECT)) + if ($object->email) { - $result=$adh->send_an_email($conf->global->ADHERENT_AUTOREGISTER_MAIL,$conf->global->ADHERENT_AUTOREGISTER_MAIL_SUBJECT,array(),array(),array(),"","",0,-1); + $subject = ''; + $msg= ''; + + // Send subscription email + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $formmail=new FormMail($db); + // Set output language + $outputlangs = new Translate('', $conf); + $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang); + $outputlangs->loadLangs(array("main", "members")); + // Get email content fro mtemplae + $arraydefaultmessage=null; + $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_AUTOREGISTER; + + if (! empty($labeltouse)) $arraydefaultmessage=$formmail->getEMailTemplate($db, 'member', $user, $outputlangs, 0, 1, $labeltouse); + + if (! empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) + { + $subject = $arraydefaultmessage->topic; + $msg = $arraydefaultmessage->content; + } + + $substitutionarray=getCommonSubstitutionArray($outputlangs, 0, null, $object); + complete_substitutions_array($substitutionarray, $outputlangs, $object); + $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); + $texttosend = make_substitutions(dol_concatdesc($msg, $adht->getMailOnValid()), $substitutionarray, $outputlangs); + + if ($subjecttosend && $texttosend) + { + $result=$object->send_an_email($texttosend, $subjecttosend, array(), array(), array(), "", "", 0, -1); + } + /*if ($result < 0) + { + $error++; + setEventMessages($object->error, $object->errors, 'errors'); + }*/ } // Send email to the foundation to say a new member subscribed with autosubscribe form diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index 285bf2920eb..daeb43ba465 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -394,8 +394,32 @@ if ($ispaymentok) // Send confirmation Email if ($object->email && $sendalsoemail) { - $subjecttosend=$object->makeSubstitution($conf->global->ADHERENT_MAIL_COTIS_SUBJECT); - $texttosend=$object->makeSubstitution($adht->getMailOnSubscription()); + $subject = ''; + $msg= ''; + + // Send subscription email + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $formmail=new FormMail($db); + // Set output language + $outputlangs = new Translate('', $conf); + $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang); + $outputlangs->loadLangs(array("main", "members")); + // Get email content fro mtemplae + $arraydefaultmessage=null; + $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION; + + if (! empty($labeltouse)) $arraydefaultmessage=$formmail->getEMailTemplate($db, 'member', $user, $outputlangs, 0, 1, $labeltouse); + + if (! empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) + { + $subject = $arraydefaultmessage->topic; + $msg = $arraydefaultmessage->content; + } + + $substitutionarray=getCommonSubstitutionArray($outputlangs, 0, null, $object); + complete_substitutions_array($substitutionarray, $outputlangs, $object); + $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); + $texttosend = make_substitutions(dol_concatdesc($msg, $adht->getMailOnSubscription()), $substitutionarray, $outputlangs); // Attach a file ? $file=''; diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 1eeec0c189f..550a867418b 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -1345,7 +1345,8 @@ div.nopadding { vertical-align: text-bottom; } .fiche .arearef img.pictoedit, .fiche .arearef span.pictoedit, -.fiche .fichecenter img.pictoedit, .fiche .fichecenter span.pictoedit { +.fiche .fichecenter img.pictoedit, .fiche .fichecenter span.pictoedit, +.tagtdnote span.pictoedit { opacity: 0.4; } .colorthumb { diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index a9ff6ebd09b..619d627c33d 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1350,7 +1350,8 @@ table.noborder tr.liste_titre td { vertical-align: text-bottom; } .fiche .arearef img.pictoedit, .fiche .arearef span.pictoedit, -.fiche .fichecenter img.pictoedit, .fiche .fichecenter span.pictoedit { +.fiche .fichecenter img.pictoedit, .fiche .fichecenter span.pictoedit, +.tagtdnote span.pictoedit { opacity: 0.9; } img.hideonsmartphone.pictoactionview {