Merge pull request #10641 from OPEN-DSI/fix-show-action-done-emailing

Fix url for emailing type event (link to emailing card)
This commit is contained in:
Laurent Destailleur 2019-02-24 20:48:57 +01:00 committed by GitHub
commit e349fe780e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1266,27 +1266,31 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
elseif (is_object($filterobj) && get_class($filterobj) == 'Ticket') $sql.= ", ".MAIN_DB_PREFIX."ticket as o"; elseif (is_object($filterobj) && get_class($filterobj) == 'Ticket') $sql.= ", ".MAIN_DB_PREFIX."ticket as o";
$sql.= " WHERE a.entity IN (".getEntity('agenda').")"; $sql.= " WHERE a.entity IN (".getEntity('agenda').")";
if (is_object($filterobj) && in_array(get_class($filterobj), array('Societe', 'Client', 'Fournisseur')) && $filterobj->id) $sql.= " AND a.fk_soc = ".$filterobj->id; if (is_object($objcon) && $objcon->id) {
elseif (is_object($filterobj) && get_class($filterobj) == 'Project' && $filterobj->id) $sql.= " AND a.fk_project = ".$filterobj->id; $sql.= " AND a.fk_contact = ".$objcon->id;
elseif (is_object($filterobj) && get_class($filterobj) == 'Adherent') } else {
{ if (is_object($filterobj) && in_array(get_class($filterobj), array('Societe', 'Client', 'Fournisseur')) && $filterobj->id) $sql.= " AND a.fk_soc = ".$filterobj->id;
$sql.= " AND a.fk_element = m.rowid AND a.elementtype = 'member'"; elseif (is_object($filterobj) && get_class($filterobj) == 'Project' && $filterobj->id) $sql.= " AND a.fk_project = ".$filterobj->id;
if ($filterobj->id) $sql.= " AND a.fk_element = ".$filterobj->id; elseif (is_object($filterobj) && get_class($filterobj) == 'Adherent')
} {
elseif (is_object($filterobj) && get_class($filterobj) == 'CommandeFournisseur') $sql.= " AND a.fk_element = m.rowid AND a.elementtype = 'member'";
{ if ($filterobj->id) $sql.= " AND a.fk_element = ".$filterobj->id;
$sql.= " AND a.fk_element = o.rowid AND a.elementtype = 'order_supplier'"; }
if ($filterobj->id) $sql.= " AND a.fk_element = ".$filterobj->id; elseif (is_object($filterobj) && get_class($filterobj) == 'CommandeFournisseur')
} {
elseif (is_object($filterobj) && get_class($filterobj) == 'Product') $sql.= " AND a.fk_element = o.rowid AND a.elementtype = 'order_supplier'";
{ if ($filterobj->id) $sql.= " AND a.fk_element = ".$filterobj->id;
$sql.= " AND a.fk_element = o.rowid AND a.elementtype = 'product'"; }
if ($filterobj->id) $sql.= " AND a.fk_element = ".$filterobj->id; elseif (is_object($filterobj) && get_class($filterobj) == 'Product')
} {
elseif (is_object($filterobj) && get_class($filterobj) == 'Ticket') $sql.= " AND a.fk_element = o.rowid AND a.elementtype = 'product'";
{ if ($filterobj->id) $sql.= " AND a.fk_element = ".$filterobj->id;
$sql.= " AND a.fk_element = o.rowid AND a.elementtype = 'ticket'"; }
if ($filterobj->id) $sql.= " AND a.fk_element = ".$filterobj->id; elseif (is_object($filterobj) && get_class($filterobj) == 'Ticket')
{
$sql.= " AND a.fk_element = o.rowid AND a.elementtype = 'ticket'";
if ($filterobj->id) $sql.= " AND a.fk_element = ".$filterobj->id;
}
} }
// Condition on actioncode // Condition on actioncode
@ -1378,7 +1382,8 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
} }
// Add also event from emailings. TODO This should be replaced by an automatic event ? May be it's too much for very large emailing. // Add also event from emailings. TODO This should be replaced by an automatic event ? May be it's too much for very large emailing.
if (! empty($conf->mailing->enabled) && ! empty($objcon->email)) if (! empty($conf->mailing->enabled) && ! empty($objcon->email)
&& (empty($actioncode) || $actioncode == 'AC_OTH_AUTO' || $actioncode == 'AC_EMAILING'))
{ {
$langs->load("mails"); $langs->load("mails");
@ -1528,7 +1533,13 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
// Ref // Ref
$out.='<td class="nowrap">'; $out.='<td class="nowrap">';
$out.=$actionstatic->getNomUrl(1, -1); if (isset($histo[$key]['type']) && $histo[$key]['type']=='mailing') {
$out.='<a href="'.DOL_URL_ROOT.'/comm/mailing/card.php?id='.$histo[$key]['id'].'">'.img_object($langs->trans("ShowEMailing"), "email").' ';
$out.=$histo[$key]['id'];
$out.='</a>';
} else {
$out.=$actionstatic->getNomUrl(1, -1);
}
$out.='</td>'; $out.='</td>';
// Author of event // Author of event