FIX Look and feel v10

This commit is contained in:
Laurent Destailleur 2019-05-21 21:47:25 +02:00
parent c3b9c08219
commit a93cbd4320

View File

@ -130,13 +130,12 @@ if ($action == 'delete')
$resql=$db->query($sql); $resql=$db->query($sql);
if ($resql) if ($resql)
{ {
if (!empty($id)) if (! empty($id))
{ {
$obj = new MailingTargets($db); $obj = new MailingTargets($db);
$obj->update_nb($id); $obj->update_nb($id);
header("Location: ".$_SERVER['PHP_SELF']."?id=".$id); setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs');
exit;
} }
else else
{ {
@ -532,6 +531,15 @@ if ($object->fetch($id) >= 0)
if ($num) if ($num)
{ {
include_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
include_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
$objectstaticmember=new Adherent($db);
$objectstaticuser=new User($db);
$objectstaticcompany=new Societe($db);
$objectstaticcontact=new Contact($db);
while ($i < min($num, $limit)) while ($i < min($num, $limit))
{ {
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
@ -550,32 +558,23 @@ if ($object->fetch($id) >= 0)
{ {
if ($obj->source_type == 'member') if ($obj->source_type == 'member')
{ {
include_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; $objectstaticmember->fetch($obj->source_id);
$objectstatic=new Adherent($db); print $objectstaticmember->getNomUrl(1);
$objectstatic->fetch($obj->source_id);
print $objectstatic->getNomUrl(1);
} }
elseif ($obj->source_type == 'user') elseif ($obj->source_type == 'user')
{ {
include_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; $objectstaticuser->fetch($obj->source_id);
$objectstatic=new User($db); print $objectstaticuser->getNomUrl(1);
$objectstatic->fetch($obj->source_id);
$objectstatic->id=$obj->source_id;
print $objectstatic->getNomUrl(1);
} }
elseif ($obj->source_type == 'thirdparty') elseif ($obj->source_type == 'thirdparty')
{ {
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; $objectstaticcompany->fetch($obj->source_id);
$objectstatic=new Societe($db); print $objectstaticcompany->getNomUrl(1);
$objectstatic->fetch($obj->source_id);
print $objectstatic->getNomUrl(1);
} }
elseif ($obj->source_type == 'contact') elseif ($obj->source_type == 'contact')
{ {
include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; $objectstaticcontact->fetch($obj->source_id);
$objectstatic=new Contact($db); print $objectstaticcontact->getNomUrl(1);
$objectstatic->fetch($obj->source_id);
print $objectstatic->getNomUrl(1);
} }
else else
{ {
@ -604,7 +603,7 @@ if ($object->fetch($id) >= 0)
if ($obj->statut == 0) // Not sent yet if ($obj->statut == 0) // Not sent yet
{ {
if ($user->rights->mailing->creer && $allowaddtarget) { if ($user->rights->mailing->creer && $allowaddtarget) {
print '<a href="'.$_SERVER['PHP_SELF'].'?action=delete&rowid='.$obj->rowid.$param.'">'.img_delete($langs->trans("RemoveRecipient")).'</a>'; print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=delete&rowid='.$obj->rowid.$param.'">'.img_delete($langs->trans("RemoveRecipient")).'</a>';
} }
} }
/*if ($obj->statut == -1) // Sent with error /*if ($obj->statut == -1) // Sent with error