2
0
forked from Wavyzz/dolibarr

Decode subject by emailcollector

This commit is contained in:
Laurent Destailleur
2019-11-24 21:30:00 +01:00
parent 1bace80a9b
commit d34f487c65
2 changed files with 15 additions and 4 deletions

View File

@@ -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);

View File

@@ -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
{