';
+ }
+
+ // Send card by email
+ // TODO Remove this to replace with a template
+ if ($user->rights->adherent->creer)
+ {
+ if ($object->statut >= 1)
+ {
+ if ($object->email) print '
';
if (! empty($this->withtocccreadonly))
@@ -645,7 +644,7 @@ class FormMail extends Form
// Ask delivery receipt
if (! empty($this->withdeliveryreceipt))
{
- $out.= '
'.$langs->trans("DeliveryReceipt").'
';
+ $out.= '
'.$langs->trans("DeliveryReceipt").'
';
if (! empty($this->withdeliveryreceiptreadonly))
{
@@ -677,7 +676,7 @@ class FormMail extends Form
$defaulttopic=make_substitutions($defaulttopic,$this->substit);
$out.= '
';
- $out.= '
'.$langs->trans("MailTopic").'
';
+ $out.= '
'.$langs->trans("MailTopic").'
';
$out.= '
';
if ($this->withtopicreadonly)
{
@@ -695,7 +694,7 @@ class FormMail extends Form
if (! empty($this->withfile))
{
$out.= '
';
- $out.= '
'.$langs->trans("MailFile").'
';
+ $out.= '
'.$langs->trans("MailFile").'
';
$out.= '
';
if (! empty($this->withmaindocfile))
@@ -785,7 +784,8 @@ class FormMail extends Form
$typeforonlinepayment='free';
if ($this->param["models"]=='order_send') $typeforonlinepayment='order'; // TODO use detection on something else than template
if ($this->param["models"]=='facture_send') $typeforonlinepayment='invoice'; // TODO use detection on something else than template
- $url=getOnlinePaymentUrl(0, $typeforonlinepayment, $this->substit['__REF__']);
+ if ($this->param["models"]=='member_send') $typeforonlinepayment='member'; // TODO use detection on something else than template
+ $url=getOnlinePaymentUrl(0, $typeforonlinepayment, $this->substit['__REF__']);
//$paymenturl=str_replace('\n',"\n",$langs->transnoentitiesnoconv("PredefinedMailContentLink",$url));
$paymenturl=$url;
}
@@ -825,7 +825,7 @@ class FormMail extends Form
}
$out.= '
';
- $out.= '
'.$langs->trans("MailText").'
';
+ $out.= '
'.$langs->trans("MailText").'
';
$out.= '
';
if ($this->withbodyreadonly)
{
diff --git a/htdocs/core/tpl/card_presend.tpl.php b/htdocs/core/tpl/card_presend.tpl.php
index 502dfb33df6..9e0d6f09fcf 100644
--- a/htdocs/core/tpl/card_presend.tpl.php
+++ b/htdocs/core/tpl/card_presend.tpl.php
@@ -73,13 +73,16 @@ if ($action == 'presend')
// Build document if it not exists
if (! $file || ! is_readable($file)) {
- $result = $object->generateDocument(GETPOST('model') ? GETPOST('model') : $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
- if ($result <= 0) {
- dol_print_error($db, $object->error, $object->errors);
- exit();
+ if ($object->element != 'member')
+ {
+ $result = $object->generateDocument(GETPOST('model') ? GETPOST('model') : $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
+ if ($result <= 0) {
+ dol_print_error($db, $object->error, $object->errors);
+ exit();
+ }
+ $fileparams = dol_most_recent_file($diroutput . '/' . $ref, preg_quote($ref, '/').'[^\-]+');
+ $file = $fileparams['fullname'];
}
- $fileparams = dol_most_recent_file($diroutput . '/' . $ref, preg_quote($ref, '/').'[^\-]+');
- $file = $fileparams['fullname'];
}
print '';
@@ -120,6 +123,10 @@ if ($action == 'presend')
$liste[$key] = $value;
}
}
+ elseif ($object->element == 'member')
+ {
+ $liste['thirdparty'] = $object->getFullName($langs)." <".$object->email.">";
+ }
else
{
foreach ($object->thirdparty->thirdparty_and_contact_email_array(1) as $key => $value) {
diff --git a/htdocs/install/mysql/data/llx_c_action_trigger.sql b/htdocs/install/mysql/data/llx_c_action_trigger.sql
index 51811f25a86..ccc1f9b77bd 100644
--- a/htdocs/install/mysql/data/llx_c_action_trigger.sql
+++ b/htdocs/install/mysql/data/llx_c_action_trigger.sql
@@ -73,6 +73,7 @@ insert into llx_c_action_trigger (code,label,description,elementtype,rang) value
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('SHIPPING_VALIDATE','Shipping validated','Executed when a shipping is validated','shipping',20);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('SHIPPING_SENTBYMAIL','Shipping sent by mail','Executed when a shipping is sent by mail','shipping',21);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_VALIDATE','Member validated','Executed when a member is validated','member',22);
+insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_SENTBYMAIL','Mails sent from member card','Executed when you send email from member card','member',23);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_SUBSCRIPTION','Member subscribed','Executed when a member is subscribed','member',24);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_RESILIATE','Member resiliated','Executed when a member is resiliated','member',25);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_DELETE','Member deleted','Executed when a member is deleted','member',26);
diff --git a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql
index c3df19fee06..23467355174 100644
--- a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql
+++ b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql
@@ -42,6 +42,8 @@ ALTER TABLE llx_website_page ADD COLUMN fk_user_modif integer;
-- For 7.0
+insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_SENTBYMAIL','Mails sent from member card','Executed when you send email from member card','member',23);
+
ALTER TABLE llx_ecm_files MODIFY label varchar(128) NOT NULL;
ALTER TABLE llx_ecm_files ADD COLUMN share varchar(128) NULL after label;
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index 1e855abc41a..7aefde7340c 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -1694,6 +1694,7 @@ MailToSendSupplierOrder=To send supplier order
MailToSendSupplierInvoice=To send supplier invoice
MailToSendContract=To send a contract
MailToThirdparty=To send email from third party page
+MailToMember=To send email from member page
ByDefaultInList=Show by default on list view
YouUseLastStableVersion=You use the latest stable version
TitleExampleForMajorRelease=Example of message you can use to announce this major release (feel free to use it on your web sites)