Add try catch

This commit is contained in:
Laurent Destailleur 2014-08-25 19:32:36 +02:00
parent 7cb283d0ea
commit a5deeebfdc

View File

@ -98,11 +98,10 @@ if ($action == 'add')
$result=$obj->add_to_target($id,$filtersarray); $result=$obj->add_to_target($id,$filtersarray);
} }
} }
if ($result > 0) if ($result > 0)
{ {
setEventMessage($langs->trans("XTargetsAdded",$result),'mesgs'); setEventMessage($langs->trans("XTargetsAdded",$result),'mesgs');
header("Location: ".$_SERVER['PHP_SELF']."?id=".$id); header("Location: ".$_SERVER['PHP_SELF']."?id=".$id);
exit; exit;
} }
@ -167,7 +166,6 @@ if ($_POST["button_removefilter"])
/* /*
* View * View
*/ */
llxHeader('',$langs->trans("Mailing"),'EN:Module_EMailing|FR:Module_Mailing|ES:Módulo_Mailing'); llxHeader('',$langs->trans("Mailing"),'EN:Module_EMailing|FR:Module_Mailing|ES:Módulo_Mailing');
$form = new Form($db); $form = new Form($db);
@ -306,12 +304,14 @@ if ($object->fetch($id) >= 0)
print img_object($langs->trans("Module").': '.get_class($obj),$obj->picto).' '.$obj->getDesc(); print img_object($langs->trans("Module").': '.get_class($obj),$obj->picto).' '.$obj->getDesc();
print '</td>'; print '</td>';
/* try {
print '<td width=\"100\">'; $nbofrecipient=$obj->getNbOfRecipients('');
print $modulename; }
print "</td>"; catch(Exception $e)
*/ {
$nbofrecipient=$obj->getNbOfRecipients(''); dol_syslog($e->getMessage(), LOG_ERR);
}
print '<td align="center">'; print '<td align="center">';
if ($nbofrecipient >= 0) if ($nbofrecipient >= 0)
{ {
@ -324,7 +324,13 @@ if ($object->fetch($id) >= 0)
print '</td>'; print '</td>';
print '<td align="left">'; print '<td align="left">';
$filter=$obj->formFilter(); try {
$filter=$obj->formFilter();
}
catch(Exception $e)
{
dol_syslog($e->getMessage(), LOG_ERR);
}
if ($filter) print $filter; if ($filter) print $filter;
else print $langs->trans("None"); else print $langs->trans("None");
print '</td>'; print '</td>';
@ -421,7 +427,7 @@ if ($object->fetch($id) >= 0)
print '<td class="liste_titre">'; print '<td class="liste_titre">';
print '&nbsp'; print '&nbsp';
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
// Ligne des champs de filtres // Ligne des champs de filtres
@ -446,7 +452,7 @@ if ($object->fetch($id) >= 0)
print '<td class="liste_titre">'; print '<td class="liste_titre">';
print '&nbsp'; print '&nbsp';
print '</td>'; print '</td>';
// Date sending // Date sending
print '<td class="liste_titre">'; print '<td class="liste_titre">';
print '&nbsp'; print '&nbsp';
@ -530,7 +536,7 @@ if ($object->fetch($id) >= 0)
print $object::libStatutDest($obj->statut,2); print $object::libStatutDest($obj->statut,2);
print '</td>'; print '</td>';
} }
//Sreach Icon //Sreach Icon
print '<td></td>'; print '<td></td>';
print '</tr>'; print '</tr>';