Merge branch '4.0' of git@github.com:Dolibarr/dolibarr.git into 5.0
Conflicts: htdocs/commande/class/api_commande.class.php htdocs/core/class/CMailFile.class.php htdocs/societe/class/api_contact.class.php
This commit is contained in:
commit
c42b48636a
@ -162,7 +162,7 @@ export res=$?
|
||||
|
||||
|
||||
# ---------------------------- copy demo files
|
||||
export documentdir=`cat $mydir/../../htdocs/conf/conf.php | grep '^\$dolibarr_main_data_root' | sed -e 's/$dolibarr_main_data_root=//' | sed -e 's/;//' | sed -e "s/'//g" `
|
||||
export documentdir=`cat $mydir/../../htdocs/conf/conf.php | grep '^\$dolibarr_main_data_root' | sed -e 's/$dolibarr_main_data_root=//' | sed -e 's/;//' | sed -e "s/'//g" | sed -e 's/"//g' `
|
||||
if [ "x$documentdir" != "x" ]
|
||||
then
|
||||
echo cp -pr $mydir/documents_demo/* "$documentdir/"
|
||||
@ -174,7 +174,7 @@ then
|
||||
echo cp -pr $mydir/../../doc/images/* "$documentdir/ecm/Images"
|
||||
cp -pr $mydir/../../doc/images/* "$documentdir/ecm/Images"
|
||||
else
|
||||
echo Detection of documents directory failed so demo files were not copied.
|
||||
echo Detection of documents directory $documentdir failed so demo files were not copied.
|
||||
fi
|
||||
|
||||
|
||||
|
||||
@ -194,7 +194,7 @@ class CommandeApi extends DolibarrApi
|
||||
* @return array Array of order objects
|
||||
*/
|
||||
function getListForSoc($socid = 0) {
|
||||
return getList(0,"s.rowid","ASC",0,0,$socid);
|
||||
return $this->getList(0,"s.rowid","ASC",0,0,$socid);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -131,6 +131,7 @@ class Contact extends CommonObject
|
||||
$clause = "AND";
|
||||
}
|
||||
$sql.= ' '.$clause.' sp.entity IN ('.getEntity($this->element, 1).')';
|
||||
$sql.= " AND (sp.priv='0' OR (sp.priv='1' AND sp.fk_user_creat=".$user->id."))";
|
||||
if ($user->societe_id > 0) $sql.=" AND sp.fk_soc = ".$user->societe_id;
|
||||
|
||||
$resql=$this->db->query($sql);
|
||||
|
||||
@ -155,7 +155,7 @@ class CMailFile
|
||||
}
|
||||
|
||||
if (! empty($conf->global->MAIN_MAIL_FORCE_CONTENT_TYPE_TO_HTML)) $this->msgishtml=1; // To force to send everything with content type html.
|
||||
|
||||
|
||||
// Detect images
|
||||
if ($this->msgishtml)
|
||||
{
|
||||
@ -210,9 +210,10 @@ class CMailFile
|
||||
$this->addr_bcc = $addr_bcc;
|
||||
$this->deliveryreceipt = $deliveryreceipt;
|
||||
$this->trackid = $trackid;
|
||||
|
||||
$smtp_headers = $this->write_smtpheaders();
|
||||
if (! empty($moreinheader)) $smtp_headers.=$moreinheader; // $moreinheader contains the \r\n
|
||||
|
||||
|
||||
// Define mime_headers
|
||||
$mime_headers = $this->write_mimeheaders($filename_list, $mimefilename_list);
|
||||
|
||||
@ -272,8 +273,9 @@ class CMailFile
|
||||
$smtps->setFrom($this->getValidAddress($from,0,1));
|
||||
$smtps->setTrackId($trackid);
|
||||
$smtps->setReplyTo($this->getValidAddress($from,0,1)); // Set property with this->smtps->setReplyTo after constructor if you want to use another value than the From
|
||||
|
||||
if (! empty($moreinheader)) $smtps->setMoreInHeader($moreinheader);
|
||||
|
||||
|
||||
if (! empty($this->html))
|
||||
{
|
||||
if (!empty($css))
|
||||
@ -478,16 +480,16 @@ class CMailFile
|
||||
'maildao'
|
||||
));
|
||||
$reshook = $hookmanager->executeHooks('doactions', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if (! empty($reshook))
|
||||
if (! empty($reshook))
|
||||
{
|
||||
$this->error = "Error in hook maildao doactions " . $reshook;
|
||||
dol_syslog("CMailFile::sendfile: mail end error=" . $this->error, LOG_ERR);
|
||||
|
||||
|
||||
return $reshook;
|
||||
}
|
||||
|
||||
// Check number of recipient is lower or equal than MAIL_MAX_NB_OF_RECIPIENTS_IN_SAME_EMAIL
|
||||
if (empty($conf->global->MAIL_MAX_NB_OF_RECIPIENTS_IN_SAME_EMAIL)) $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_IN_SAME_EMAIL=10;
|
||||
if (empty($conf->global->MAIL_MAX_NB_OF_RECIPIENTS_TO_IN_SAME_EMAIL)) $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_TO_IN_SAME_EMAIL=10;
|
||||
$tmparray1 = explode(',', $this->addr_to);
|
||||
if (count($tmparray1) > $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_TO_IN_SAME_EMAIL)
|
||||
{
|
||||
@ -495,6 +497,7 @@ class CMailFile
|
||||
dol_syslog("CMailFile::sendfile: mail end error=" . $this->error, LOG_WARNING);
|
||||
return false;
|
||||
}
|
||||
if (empty($conf->global->MAIL_MAX_NB_OF_RECIPIENTS_CC_IN_SAME_EMAIL)) $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_CC_IN_SAME_EMAIL=10;
|
||||
$tmparray2 = explode(',', $this->addr_cc);
|
||||
if (count($tmparray2) > $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_CC_IN_SAME_EMAIL)
|
||||
{
|
||||
@ -502,6 +505,7 @@ class CMailFile
|
||||
dol_syslog("CMailFile::sendfile: mail end error=" . $this->error, LOG_WARNING);
|
||||
return false;
|
||||
}
|
||||
if (empty($conf->global->MAIL_MAX_NB_OF_RECIPIENTS_BCC_IN_SAME_EMAIL)) $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_BCC_IN_SAME_EMAIL=10;
|
||||
$tmparray3 = explode(',', $this->addr_bcc);
|
||||
if (count($tmparray3) > $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_BCC_IN_SAME_EMAIL)
|
||||
{
|
||||
@ -509,14 +513,14 @@ class CMailFile
|
||||
dol_syslog("CMailFile::sendfile: mail end error=" . $this->error, LOG_WARNING);
|
||||
return false;
|
||||
}
|
||||
if (empty($conf->global->MAIL_MAX_NB_OF_RECIPIENTS_IN_SAME_EMAIL)) $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_IN_SAME_EMAIL=10;
|
||||
if ((count($tmparray1)+count($tmparray2)+count($tmparray3)) > $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_IN_SAME_EMAIL)
|
||||
{
|
||||
$this->error = 'Too much recipients in to:, cc:, bcc:';
|
||||
dol_syslog("CMailFile::sendfile: mail end error=" . $this->error, LOG_WARNING);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Action according to choosed sending method
|
||||
if ($conf->global->MAIN_MAIL_SENDMODE == 'mail')
|
||||
{
|
||||
@ -558,6 +562,7 @@ class CMailFile
|
||||
{
|
||||
$additionnalparam .= ($additionnalparam?' ':'').'-ba';
|
||||
}
|
||||
|
||||
if (! empty($conf->global->MAIN_MAIL_SENDMAIL_FORCE_ADDPARAM)) $additionnalparam .= ($additionnalparam?' ':'').'-U '.$additionnalparam; // Use -U to add additionnal params
|
||||
|
||||
dol_syslog("CMailFile::sendfile: mail start HOST=".ini_get('SMTP').", PORT=".ini_get('smtp_port').", additionnal_parameters=".$additionnalparam, LOG_DEBUG);
|
||||
@ -881,7 +886,7 @@ class CMailFile
|
||||
|
||||
// Receiver
|
||||
if (isset($this->addr_cc) && $this->addr_cc) $out.= "Cc: ".$this->getValidAddress($this->addr_cc,2).$this->eol2;
|
||||
if (isset($this->addr_bcc) && $this->addr_bcc) $out.= "Bcc: ".$this->getValidAddress($this->addr_bcc,2).$this->eol2; // Question: bcc must not be into header, only into SMTP command "RCPT TO". Does php mail support this ?
|
||||
if (isset($this->addr_bcc) && $this->addr_bcc) $out.= "Bcc: ".$this->getValidAddress($this->addr_bcc,2).$this->eol2; // TODO Question: bcc must not be into header, only into SMTP command "RCPT TO". Does php mail support this ?
|
||||
|
||||
// Delivery receipt
|
||||
if (isset($this->deliveryreceipt) && $this->deliveryreceipt == 1) $out.= "Disposition-Notification-To: ".$this->getValidAddress($this->addr_from,2).$this->eol2;
|
||||
|
||||
@ -5876,7 +5876,7 @@ class Form
|
||||
*/
|
||||
global $dolibarr_main_url_root;
|
||||
$ret.='<!-- Put link to gravatar -->';
|
||||
$ret.='<img class="photo'.$modulepart.($cssclass?' '.$cssclass:'').'" alt="Gravatar avatar" title="'.$email.' Gravatar avatar" border="0"'.($width?' width="'.$width.'"':'').($height?' height="'.$height.'"':'').' src="https://www.gravatar.com/avatar/'.dol_hash(strtolower(trim($email)),3).'?s='.$width.'&d='.urlencode(dol_buildpath($nophoto,2)).'">'; // gravatar need md5 hash
|
||||
$ret.='<img class="photo'.$modulepart.($cssclass?' '.$cssclass:'').'" alt="Gravatar avatar" title="'.$email.' Gravatar avatar" border="0"'.($width?' width="'.$width.'"':'').($height?' height="'.$height.'"':'').' src="https://www.gravatar.com/avatar/'.dol_hash(strtolower(trim($email)),3).'?s='.$width.'&d='.urlencode(dol_buildpath($nophoto,3)).'">'; // gravatar need md5 hash
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -89,7 +89,7 @@ $(document).ready(function () {
|
||||
|
||||
<div id="login_right">
|
||||
|
||||
<table class="left centpercent" title="Login pass">
|
||||
<table class="left centpercent" title="<?php echo $langs->trans("EnterLoginDetail"); ?>">
|
||||
<!-- Login -->
|
||||
<tr>
|
||||
<td class="nowrap center valignmiddle">
|
||||
|
||||
@ -460,6 +460,7 @@ DeletePicture=Picture delete
|
||||
ConfirmDeletePicture=Confirm picture deletion?
|
||||
Login=Login
|
||||
CurrentLogin=Current login
|
||||
EnterLoginDetail=Enter login details
|
||||
January=January
|
||||
February=February
|
||||
March=March
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
|
||||
use Luracast\Restler\RestException;
|
||||
|
||||
//require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
|
||||
|
||||
/**
|
||||
* API class for contact object
|
||||
|
||||
Loading…
Reference in New Issue
Block a user