NEW Can send an email to a user from its card.
This commit is contained in:
parent
caae7e4171
commit
b29d0385e6
@ -116,6 +116,7 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
|
|||||||
if (method_exists($object,"fetch_thirdparty") && $object->element != 'societe')
|
if (method_exists($object,"fetch_thirdparty") && $object->element != 'societe')
|
||||||
{
|
{
|
||||||
$result=$object->fetch_thirdparty();
|
$result=$object->fetch_thirdparty();
|
||||||
|
if ($object->element == 'user' && $result == 0) $result=1; // Even if not found, we consider ok
|
||||||
$thirdparty=$object->thirdparty;
|
$thirdparty=$object->thirdparty;
|
||||||
$sendtosocid=$thirdparty->id;
|
$sendtosocid=$thirdparty->id;
|
||||||
}
|
}
|
||||||
@ -187,7 +188,7 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
|
|||||||
{
|
{
|
||||||
$tmparray[] = $thirdparty->name.' <'.$thirdparty->email.'>';
|
$tmparray[] = $thirdparty->name.' <'.$thirdparty->email.'>';
|
||||||
}
|
}
|
||||||
else // Id du contact
|
elseif ($val) // Id du contact
|
||||||
{
|
{
|
||||||
$tmparray[] = $thirdparty->contact_get_property((int) $val,'email');
|
$tmparray[] = $thirdparty->contact_get_property((int) $val,'email');
|
||||||
$sendtoid[] = $val;
|
$sendtoid[] = $val;
|
||||||
@ -217,7 +218,7 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
|
|||||||
{
|
{
|
||||||
$tmparray[] = $thirdparty->name.' <'.$thirdparty->email.'>';
|
$tmparray[] = $thirdparty->name.' <'.$thirdparty->email.'>';
|
||||||
}
|
}
|
||||||
else // Id du contact
|
elseif ($val) // Id du contact
|
||||||
{
|
{
|
||||||
$tmparray[] = $thirdparty->contact_get_property((int) $val,'email');
|
$tmparray[] = $thirdparty->contact_get_property((int) $val,'email');
|
||||||
//$sendtoid[] = $val; TODO Add also id of contact in CC ?
|
//$sendtoid[] = $val; TODO Add also id of contact in CC ?
|
||||||
|
|||||||
@ -153,6 +153,11 @@ class CMailFile
|
|||||||
$this->error='ErrorSubjectIsRequired';
|
$this->error='ErrorSubjectIsRequired';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (empty($msg))
|
||||||
|
{
|
||||||
|
dol_syslog("CMailFile::CMailfile: Try to send an email with empty body");
|
||||||
|
$msg='.'; // Avoid empty message (with empty message conten show a multipart structure)
|
||||||
|
}
|
||||||
|
|
||||||
// Detect if message is HTML (use fast method)
|
// Detect if message is HTML (use fast method)
|
||||||
if ($msgishtml == -1)
|
if ($msgishtml == -1)
|
||||||
|
|||||||
@ -634,11 +634,11 @@ class FormMail extends Form
|
|||||||
if ($this->withtopicreadonly)
|
if ($this->withtopicreadonly)
|
||||||
{
|
{
|
||||||
$out.= $defaulttopic;
|
$out.= $defaulttopic;
|
||||||
$out.= '<input type="hidden" size="60" id="subject" name="subject" value="'.$defaulttopic.'" />';
|
$out.= '<input type="hidden" class="quatrevingtpercent" id="subject" name="subject" value="'.$defaulttopic.'" />';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$out.= '<input type="text" size="60" id="subject" name="subject" value="'. ((isset($_POST["subject"]) && ! $_POST['modelselected'])?$_POST["subject"]:($defaulttopic?$defaulttopic:'')) .'" />';
|
$out.= '<input type="text" class="quatrevingtpercent" id="subject" name="subject" value="'. ((isset($_POST["subject"]) && ! $_POST['modelselected'])?$_POST["subject"]:($defaulttopic?$defaulttopic:'')) .'" />';
|
||||||
}
|
}
|
||||||
$out.= "</td></tr>\n";
|
$out.= "</td></tr>\n";
|
||||||
}
|
}
|
||||||
|
|||||||
1034
htdocs/user/card.php
1034
htdocs/user/card.php
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user