forked from Wavyzz/dolibarr
Decode subject by emailcollector
This commit is contained in:
@@ -1122,11 +1122,17 @@ class EmailCollector extends CommonObject
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
|
||||
// GET Email meta datas
|
||||
$overview = imap_fetch_overview($connection, $imapemail, 0);
|
||||
|
||||
dol_syslog("** Process email - msgid=".$overview[0]->message_id." date=".dol_print_date($overview[0]->udate, 'dayrfc', 'gmt')." subject=".$overview[0]->subject);
|
||||
|
||||
// Decode $overview[0]->subject
|
||||
if (function_exists('mb_decode_mimeheader')) {
|
||||
$overview[0]->subject = mb_decode_mimeheader($overview[0]->subject);
|
||||
}
|
||||
|
||||
// Parse IMAP email structure
|
||||
global $htmlmsg, $plainmsg, $charset, $attachments;
|
||||
$this->getmsg($connection, $imapemail);
|
||||
|
||||
@@ -356,7 +356,7 @@ class Holiday extends CommonObject
|
||||
*
|
||||
* @param int $id Id object
|
||||
* @param string $ref Ref object
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* @return int <0 if KO, 0 if not found, >0 if OK
|
||||
*/
|
||||
public function fetch($id, $ref = '')
|
||||
{
|
||||
@@ -421,12 +421,17 @@ class Holiday extends CommonObject
|
||||
$this->fk_user_create = $obj->fk_user_create;
|
||||
$this->fk_type = $obj->fk_type;
|
||||
$this->entity = $obj->entity;
|
||||
|
||||
$this->fetch_optionals();
|
||||
|
||||
$result = 1;
|
||||
}
|
||||
else {
|
||||
$result = 0;
|
||||
}
|
||||
$this->db->free($resql);
|
||||
|
||||
$this->fetch_optionals();
|
||||
|
||||
return 1;
|
||||
return $result;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user