diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php
index eb723013f81..6d9bb13e2c1 100644
--- a/htdocs/comm/action/card.php
+++ b/htdocs/comm/action/card.php
@@ -1782,7 +1782,7 @@ if ($id > 0)
}
// Description
- print '
| '.$langs->trans("Description").' | ';
+ print ' |
| '.$langs->trans("Description").' | ';
print dol_string_onlythesehtmltags(dol_htmlentitiesbr($object->note_private));
print ' |
';
diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php
index 1e860217d03..2d371f80be5 100644
--- a/htdocs/comm/action/class/actioncomm.class.php
+++ b/htdocs/comm/action/class/actioncomm.class.php
@@ -666,12 +666,13 @@ class ActionComm extends CommonObject
/**
* Load object from database
*
- * @param int $id Id of action to get
- * @param string $ref Ref of action to get
- * @param string $ref_ext Ref ext to get
- * @return int <0 if KO, >0 if OK
+ * @param int $id Id of action to get
+ * @param string $ref Ref of action to get
+ * @param string $ref_ext Ref ext to get
+ * @param string $email_msgid Email msgid
+ * @return int <0 if KO, >0 if OK
*/
- public function fetch($id, $ref = '', $ref_ext = '')
+ public function fetch($id, $ref = '', $ref_ext = '', $email_msgid = '')
{
global $langs;
@@ -692,6 +693,7 @@ class ActionComm extends CommonObject
$sql .= " a.fk_contact, a.percent as percentage,";
$sql .= " a.fk_element as elementid, a.elementtype,";
$sql .= " a.priority, a.fulldayevent, a.location, a.transparency,";
+ $sql .= " a.email_msgid, a.email_subject, a.email_from, a.email_to, a.email_tocc, a.email_tobcc, a.errors_to,";
$sql .= " c.id as type_id, c.code as type_code, c.libelle as type_label, c.color as type_color, c.picto as type_picto,";
$sql .= " s.nom as socname,";
$sql .= " u.firstname, u.lastname as lastname";
@@ -700,9 +702,10 @@ class ActionComm extends CommonObject
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on u.rowid = a.fk_user_author";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on s.rowid = a.fk_soc";
$sql .= " WHERE ";
- if ($ref) $sql .= " a.id=".$ref; // No field ref, we use id
- elseif ($ref_ext) $sql .= " a.ref_ext='".$this->db->escape($ref_ext)."'";
- else $sql .= " a.id=".$id;
+ if ($ref) $sql .= " a.id = ".((int) $ref); // No field ref, we use id
+ elseif ($ref_ext) $sql .= " a.ref_ext = '".$this->db->escape($ref_ext)."'";
+ elseif ($email_msgid) $sql .= " a.email_msgid = '".$this->db->escape($email_msgid)."'";
+ else $sql .= " a.id = ".((int) $id);
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
$resql = $this->db->query($sql);
diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php
index 8c8e0daeb26..a62b58c1c2b 100644
--- a/htdocs/emailcollector/class/emailcollector.class.php
+++ b/htdocs/emailcollector/class/emailcollector.class.php
@@ -1643,10 +1643,10 @@ class EmailCollector extends CommonObject
// Create event
elseif ($operation['type'] == 'recordevent')
{
- $alreadycreated = 0;
- // TODO Check if $msgid already in database for $conf->entity
+ $actioncomm = new ActionComm($this->db);
- if (!$alreadycreated)
+ $alreadycreated = $actioncomm->fetch(0, '', '', $msgid);
+ if ($alreadycreated == 0)
{
if ($projectstatic->id > 0)
{
@@ -1672,7 +1672,6 @@ class EmailCollector extends CommonObject
$descriptionfull = dol_concatdesc($descriptionfull, $header);
// Insert record of emails sent
- $actioncomm = new ActionComm($this->db);
$actioncomm->type_code = 'AC_OTH_AUTO'; // Type of event ('AC_OTH', 'AC_OTH_AUTO', 'AC_XXX'...)
$actioncomm->code = 'AC_'.$actioncode;
$actioncomm->label = $langs->trans("ActionAC_".$actioncode).' - '.$langs->trans("MailFrom").' '.$from;
@@ -1736,7 +1735,7 @@ class EmailCollector extends CommonObject
{
$projecttocreate = new Project($this->db);
- $alreadycreated = $projecttocreate->fetch(0, '', $msgid);
+ $alreadycreated = $projecttocreate->fetch(0, '', '', $msgid);
if ($alreadycreated == 0)
{
if ($thirdpartystatic->id > 0)
diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php
index 9069899af47..2c5f0a1ddb8 100644
--- a/htdocs/projet/class/project.class.php
+++ b/htdocs/projet/class/project.class.php
@@ -471,10 +471,11 @@ class Project extends CommonObject
*
* @param int $id Id of object to load
* @param string $ref Ref of project
+ * @param string $ref_ext Ref ext of project
* @param string $email_msgid Email msgid
* @return int >0 if OK, 0 if not found, <0 if KO
*/
- public function fetch($id, $ref = '', $email_msgid = '')
+ public function fetch($id, $ref = '', $ref_ext = '', $email_msgid = '')
{
global $conf;
@@ -491,6 +492,8 @@ class Project extends CommonObject
$sql .= " WHERE entity IN (".getEntity('project').")";
if (! empty($ref)) {
$sql .= " AND ref = '".$this->db->escape($ref)."'";
+ } elseif (! empty($ref_ext)) {
+ $sql .= " AND ref_ext = '".$this->db->escape($ref_ext)."'";
} else {
$sql .= " AND email_msgid = '".$this->db->escape($email_msgid)."'";
}
diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php
index 01e2194e992..f0340291ee8 100644
--- a/htdocs/theme/eldy/global.inc.php
+++ b/htdocs/theme/eldy/global.inc.php
@@ -3321,7 +3321,9 @@ table.hidepaginationprevious .paginationprevious {
table.hidepaginationnext .paginationnext {
display: none;
}
-
+.tabBar .arearef .pagination.paginationref {
+ max-width: calc(30%);
+}
/* Set the color for hover lines */