Fix: Error management when adding notification
This commit is contained in:
parent
17da383c3b
commit
a2eda5558a
@ -52,6 +52,8 @@ $pagenext = $page + 1;
|
|||||||
if (! $sortorder) $sortorder="ASC";
|
if (! $sortorder) $sortorder="ASC";
|
||||||
if (! $sortfield) $sortfield="c.name";
|
if (! $sortfield) $sortfield="c.name";
|
||||||
|
|
||||||
|
$now=dol_now();
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
@ -60,33 +62,61 @@ if (! $sortfield) $sortfield="c.name";
|
|||||||
// Add a notification
|
// Add a notification
|
||||||
if ($action == 'add')
|
if ($action == 'add')
|
||||||
{
|
{
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."notify_def";
|
$error=0;
|
||||||
$sql .= " WHERE fk_soc=".$socid." AND fk_contact=".$_POST["contactid"]." AND fk_action=".$_POST["actionid"];
|
|
||||||
if ($db->query($sql))
|
|
||||||
{
|
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."notify_def (datec,fk_soc, fk_contact, fk_action)";
|
|
||||||
$sql .= " VALUES (".$db->idate(mktime()).",".$socid.",".$_POST["contactid"].",".$_POST["actionid"].")";
|
|
||||||
|
|
||||||
if ($db->query($sql))
|
if (empty($contactid))
|
||||||
{
|
{
|
||||||
|
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Contact")).'</div>';
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
if ($actionid <= 0)
|
||||||
|
{
|
||||||
|
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Action")).'</div>';
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
if (! $error)
|
||||||
else
|
{
|
||||||
{
|
$db->begin();
|
||||||
dol_print_error($db);
|
|
||||||
}
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."notify_def";
|
||||||
}
|
$sql .= " WHERE fk_soc=".$socid." AND fk_contact=".$contactid." AND fk_action=".$actionid;
|
||||||
else
|
if ($db->query($sql))
|
||||||
{
|
{
|
||||||
dol_print_error($db);
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."notify_def (datec,fk_soc, fk_contact, fk_action)";
|
||||||
}
|
$sql .= " VALUES ('".$db->idate($now)."',".$socid.",".$contactid.",".$actionid.")";
|
||||||
|
|
||||||
|
if ($db->query($sql))
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$error++;
|
||||||
|
dol_print_error($db);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dol_print_error($db);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! $error)
|
||||||
|
{
|
||||||
|
$db->commit();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$db->rollback();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove a notification
|
// Remove a notification
|
||||||
if ($action == 'delete')
|
if ($action == 'delete')
|
||||||
{
|
{
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."notify_def where rowid=".$_GET["actid"].";";
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."notify_def where rowid=".$_GET["actid"].";";
|
||||||
$db->query($sql);
|
$db->query($sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -104,75 +134,100 @@ $result=$soc->fetch($socid);
|
|||||||
|
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
$html = new Form($db);
|
$html = new Form($db);
|
||||||
$langs->load("other");
|
$langs->load("other");
|
||||||
|
|
||||||
|
|
||||||
$head = societe_prepare_head($soc);
|
$head = societe_prepare_head($soc);
|
||||||
|
|
||||||
dol_fiche_head($head, 'notify', $langs->trans("ThirdParty"),0,'company');
|
dol_fiche_head($head, 'notify', $langs->trans("ThirdParty"),0,'company');
|
||||||
|
|
||||||
|
|
||||||
print '<table class="border"width="100%">';
|
print '<table class="border"width="100%">';
|
||||||
|
|
||||||
print '<tr><td width="20%">'.$langs->trans("ThirdPartyName").'</td><td colspan="3">';
|
print '<tr><td width="20%">'.$langs->trans("ThirdPartyName").'</td><td colspan="3">';
|
||||||
print $form->showrefnav($soc,'socid','',($user->societe_id?0:1),'rowid','nom');
|
print $form->showrefnav($soc,'socid','',($user->societe_id?0:1),'rowid','nom');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '<tr><td width="30%">'.$langs->trans("NbOfActiveNotifications").'</td>';
|
// Prefix
|
||||||
print '<td colspan="3">';
|
if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
|
||||||
$sql = "SELECT COUNT(n.rowid) as nb";
|
{
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."notify_def as n";
|
print '<tr><td>'.$langs->trans('Prefix').'</td><td colspan="3">'.$object->prefix_comm.'</td></tr>';
|
||||||
$sql.= " WHERE fk_soc = ".$soc->id;
|
}
|
||||||
$resql=$db->query($sql);
|
|
||||||
if ($resql)
|
|
||||||
{
|
|
||||||
$num = $db->num_rows($resql);
|
|
||||||
$i = 0;
|
|
||||||
while ($i < $num)
|
|
||||||
{
|
|
||||||
$obj = $db->fetch_object($resql);
|
|
||||||
$nb=$obj->nb;
|
|
||||||
$i++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
dol_print_error($db);
|
|
||||||
}
|
|
||||||
print $nb;
|
|
||||||
print '</td></tr>';
|
|
||||||
print '</table>';
|
|
||||||
|
|
||||||
print '</div>';
|
if ($object->client)
|
||||||
|
{
|
||||||
|
print '<tr><td>';
|
||||||
|
print $langs->trans('CustomerCode').'</td><td colspan="3">';
|
||||||
|
print $object->code_client;
|
||||||
|
if ($object->check_codeclient() <> 0) print ' <font class="error">('.$langs->trans("WrongCustomerCode").')</font>';
|
||||||
|
print '</td></tr>';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($object->fournisseur)
|
||||||
|
{
|
||||||
|
print '<tr><td>';
|
||||||
|
print $langs->trans('SupplierCode').'</td><td colspan="3">';
|
||||||
|
print $object->code_fournisseur;
|
||||||
|
if ($object->check_codefournisseur() <> 0) print ' <font class="error">('.$langs->trans("WrongSupplierCode").')</font>';
|
||||||
|
print '</td></tr>';
|
||||||
|
}
|
||||||
|
|
||||||
|
print '<tr><td width="30%">'.$langs->trans("NbOfActiveNotifications").'</td>';
|
||||||
|
print '<td colspan="3">';
|
||||||
|
$sql = "SELECT COUNT(n.rowid) as nb";
|
||||||
|
$sql.= " FROM ".MAIN_DB_PREFIX."notify_def as n";
|
||||||
|
$sql.= " WHERE fk_soc = ".$soc->id;
|
||||||
|
$resql=$db->query($sql);
|
||||||
|
if ($resql)
|
||||||
|
{
|
||||||
|
$num = $db->num_rows($resql);
|
||||||
|
$i = 0;
|
||||||
|
while ($i < $num)
|
||||||
|
{
|
||||||
|
$obj = $db->fetch_object($resql);
|
||||||
|
$nb=$obj->nb;
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
dol_print_error($db);
|
||||||
|
}
|
||||||
|
print $nb;
|
||||||
|
print '</td></tr>';
|
||||||
|
print '</table>';
|
||||||
|
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
|
|
||||||
// Help
|
// Help
|
||||||
print $langs->trans("NotificationsDesc").'<br><br>';
|
print $langs->trans("NotificationsDesc").'<br><br>';
|
||||||
|
|
||||||
|
|
||||||
print "\n";
|
print "\n";
|
||||||
|
|
||||||
// Add notification form
|
// Add notification form
|
||||||
print_fiche_titre($langs->trans("AddNewNotification"),'','');
|
print_fiche_titre($langs->trans("AddNewNotification"),'','');
|
||||||
|
|
||||||
print '<form action="fiche.php?socid='.$socid.'" method="post">';
|
print '<form action="fiche.php?socid='.$socid.'" method="post">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
|
print '<input type="hidden" name="action" value="add">';
|
||||||
|
|
||||||
// Line with titles
|
// Line with titles
|
||||||
print '<table width="100%" class="noborder">';
|
print '<table width="100%" class="noborder">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
$param="&socid=".$socid;
|
$param="&socid=".$socid;
|
||||||
print_liste_field_titre($langs->trans("Contact"),"fiche.php","c.name",'',$param,'"width="45%"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Contact"),"fiche.php","c.name",'',$param,'"width="45%"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("Action"),"fiche.php","a.titre",'',$param,'"width="35%"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Action"),"fiche.php","a.titre",'',$param,'"width="35%"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("Type"),"fiche.php","",'',$param,'"width="10%"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Type"),"fiche.php","",'',$param,'"width="10%"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre('');
|
print_liste_field_titre('');
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
$var=false;
|
$var=false;
|
||||||
$listofemails=$soc->thirdparty_and_contact_email_array();
|
$listofemails=$soc->thirdparty_and_contact_email_array();
|
||||||
if (count($listofemails) > 0)
|
if (count($listofemails) > 0)
|
||||||
{
|
{
|
||||||
$actions=array();
|
$actions=array();
|
||||||
|
|
||||||
// Load array of available notifications
|
// Load array of available notifications
|
||||||
$notificationtrigger=new InterfaceNotification($db);
|
$notificationtrigger=new InterfaceNotification($db);
|
||||||
@ -183,172 +238,172 @@ if ($result > 0)
|
|||||||
$label=$langs->trans("Notify_".$notifiedevent['code'])!=$langs->trans("Notify_".$notifiedevent['code'])?$langs->trans("Notify_".$notifiedevent['code']):$notifiedevent['label'];
|
$label=$langs->trans("Notify_".$notifiedevent['code'])!=$langs->trans("Notify_".$notifiedevent['code'])?$langs->trans("Notify_".$notifiedevent['code']):$notifiedevent['label'];
|
||||||
$actions[$notifiedevent['rowid']]=$label;
|
$actions[$notifiedevent['rowid']]=$label;
|
||||||
}
|
}
|
||||||
print '<input type="hidden" name="action" value="add">';
|
print '<tr '.$bc[$var].'><td>';
|
||||||
print '<tr '.$bc[$var].'><td>';
|
print $html->selectarray("contactid",$listofemails);
|
||||||
print $html->selectarray("contactid",$listofemails);
|
print '</td>';
|
||||||
print '</td>';
|
print '<td>';
|
||||||
print '<td>';
|
print $html->selectarray("actionid",$actions,'',1);
|
||||||
print $html->selectarray("actionid",$actions,'',1);
|
print '</td>';
|
||||||
print '</td>';
|
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$type=array('email'=>$langs->trans("EMail"));
|
$type=array('email'=>$langs->trans("EMail"));
|
||||||
print $html->selectarray("typeid",$type);
|
print $html->selectarray("typeid",$type);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td align="right"><input type="submit" class="button" value="'.$langs->trans("Add").'"></td>';
|
print '<td align="right"><input type="submit" class="button" value="'.$langs->trans("Add").'"></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<tr '.$bc[$var].'><td colspan="4">';
|
print '<tr '.$bc[$var].'><td colspan="4">';
|
||||||
print $langs->trans("YouMustCreateContactFirst");
|
print $langs->trans("YouMustCreateContactFirst");
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
|
dol_htmloutput_mesg($mesg);
|
||||||
|
|
||||||
// List of active notifications
|
// List of active notifications
|
||||||
print_fiche_titre($langs->trans("ListOfActiveNotifications"),'','');
|
print_fiche_titre($langs->trans("ListOfActiveNotifications"),'','');
|
||||||
$var=true;
|
$var=true;
|
||||||
|
|
||||||
// Line with titles
|
// Line with titles
|
||||||
print '<table width="100%" class="noborder">';
|
print '<table width="100%" class="noborder">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print_liste_field_titre($langs->trans("Contact"),"fiche.php","c.name",'',$param,'"width="45%"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Contact"),"fiche.php","c.name",'',$param,'"width="45%"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("Action"),"fiche.php","a.titre",'',$param,'"width="35%"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Action"),"fiche.php","a.titre",'',$param,'"width="35%"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("Type"),"fiche.php","",'',$param,'"width="10%"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Type"),"fiche.php","",'',$param,'"width="10%"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre('','','');
|
print_liste_field_titre('','','');
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// List of notifications for contacts
|
// List of notifications for contacts
|
||||||
$sql = "SELECT n.rowid, n.type,";
|
$sql = "SELECT n.rowid, n.type,";
|
||||||
$sql.= " a.code, a.label,";
|
$sql.= " a.code, a.label,";
|
||||||
$sql.= " c.rowid as contactid, c.name, c.firstname, c.email";
|
$sql.= " c.rowid as contactid, c.name, c.firstname, c.email";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_action_trigger as a,";
|
$sql.= " FROM ".MAIN_DB_PREFIX."c_action_trigger as a,";
|
||||||
$sql.= " ".MAIN_DB_PREFIX."notify_def as n,";
|
$sql.= " ".MAIN_DB_PREFIX."notify_def as n,";
|
||||||
$sql.= " ".MAIN_DB_PREFIX."socpeople c";
|
$sql.= " ".MAIN_DB_PREFIX."socpeople c";
|
||||||
$sql.= " WHERE a.rowid = n.fk_action";
|
$sql.= " WHERE a.rowid = n.fk_action";
|
||||||
$sql.= " AND c.rowid = n.fk_contact";
|
$sql.= " AND c.rowid = n.fk_contact";
|
||||||
$sql.= " AND c.fk_soc = ".$soc->id;
|
$sql.= " AND c.fk_soc = ".$soc->id;
|
||||||
|
|
||||||
$resql=$db->query($sql);
|
$resql=$db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
$contactstatic=new Contact($db);
|
$contactstatic=new Contact($db);
|
||||||
|
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$var = !$var;
|
$var = !$var;
|
||||||
|
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
|
|
||||||
$contactstatic->id=$obj->contactid;
|
$contactstatic->id=$obj->contactid;
|
||||||
$contactstatic->name=$obj->name;
|
$contactstatic->name=$obj->name;
|
||||||
$contactstatic->firstname=$obj->firstname;
|
$contactstatic->firstname=$obj->firstname;
|
||||||
print '<tr '.$bc[$var].'><td>'.$contactstatic->getNomUrl(1);
|
print '<tr '.$bc[$var].'><td>'.$contactstatic->getNomUrl(1);
|
||||||
if ($obj->type == 'email')
|
if ($obj->type == 'email')
|
||||||
{
|
{
|
||||||
if (isValidEmail($obj->email))
|
if (isValidEmail($obj->email))
|
||||||
{
|
{
|
||||||
print ' <'.$obj->email.'>';
|
print ' <'.$obj->email.'>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
print ' '.img_warning().' '.$langs->trans("ErrorBadEMail",$obj->email);
|
print ' '.img_warning().' '.$langs->trans("ErrorBadEMail",$obj->email);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$label=($langs->trans("Notify_".$obj->code)!="Notify_".$obj->code?$langs->trans("Notify_".$obj->code):$obj->label);
|
$label=($langs->trans("Notify_".$obj->code)!="Notify_".$obj->code?$langs->trans("Notify_".$obj->code):$obj->label);
|
||||||
print $label;
|
print $label;
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
if ($obj->type == 'email') print $langs->trans("Email");
|
if ($obj->type == 'email') print $langs->trans("Email");
|
||||||
if ($obj->type == 'sms') print $langs->trans("SMS");
|
if ($obj->type == 'sms') print $langs->trans("SMS");
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td align="right"><a href="fiche.php?socid='.$socid.'&action=delete&actid='.$obj->rowid.'">'.img_delete().'</a></td>';
|
print '<td align="right"><a href="fiche.php?socid='.$socid.'&action=delete&actid='.$obj->rowid.'">'.img_delete().'</a></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
$db->free($resql);
|
$db->free($resql);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
|
|
||||||
// List of notifications done
|
// List of notifications done
|
||||||
print_fiche_titre($langs->trans("ListOfNotificationsDone"),'','');
|
print_fiche_titre($langs->trans("ListOfNotificationsDone"),'','');
|
||||||
$var=true;
|
$var=true;
|
||||||
|
|
||||||
// Line with titles
|
// Line with titles
|
||||||
print '<table width="100%" class="noborder">';
|
print '<table width="100%" class="noborder">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print_liste_field_titre($langs->trans("Contact"),"fiche.php","c.name",'',"&socid=$socid",'',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Contact"),"fiche.php","c.name",'',"&socid=$socid",'',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("Action"),"fiche.php","a.titre",'',"&socid=$socid",'',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Action"),"fiche.php","a.titre",'',"&socid=$socid",'',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("Date"),"fiche.php","a.titre",'',"&socid=$socid",'align="right"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Date"),"fiche.php","a.titre",'',"&socid=$socid",'align="right"',$sortfield,$sortorder);
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// List
|
// List
|
||||||
$sql = "SELECT n.rowid, n.daten, n.email, n.objet_type, n.objet_id,";
|
$sql = "SELECT n.rowid, n.daten, n.email, n.objet_type, n.objet_id,";
|
||||||
$sql.= " c.rowid as id, c.name, c.firstname, c.email,";
|
$sql.= " c.rowid as id, c.name, c.firstname, c.email,";
|
||||||
$sql.= " a.code, a.label";
|
$sql.= " a.code, a.label";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_action_trigger as a,";
|
$sql.= " FROM ".MAIN_DB_PREFIX."c_action_trigger as a,";
|
||||||
$sql.= " ".MAIN_DB_PREFIX."notify as n, ";
|
$sql.= " ".MAIN_DB_PREFIX."notify as n, ";
|
||||||
$sql.= " ".MAIN_DB_PREFIX."socpeople as c";
|
$sql.= " ".MAIN_DB_PREFIX."socpeople as c";
|
||||||
$sql.= " WHERE a.rowid = n.fk_action";
|
$sql.= " WHERE a.rowid = n.fk_action";
|
||||||
$sql.= " AND c.rowid = n.fk_contact";
|
$sql.= " AND c.rowid = n.fk_contact";
|
||||||
$sql.= " AND c.fk_soc = ".$soc->id;
|
$sql.= " AND c.fk_soc = ".$soc->id;
|
||||||
|
|
||||||
$resql=$db->query($sql);
|
$resql=$db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
$contactstatic=new Contact($db);
|
$contactstatic=new Contact($db);
|
||||||
|
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$var = !$var;
|
$var = !$var;
|
||||||
|
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
|
|
||||||
$contactstatic->id=$obj->id;
|
$contactstatic->id=$obj->id;
|
||||||
$contactstatic->name=$obj->name;
|
$contactstatic->name=$obj->name;
|
||||||
$contactstatic->firstname=$obj->firstname;
|
$contactstatic->firstname=$obj->firstname;
|
||||||
print '<tr '.$bc[$var].'><td>'.$contactstatic->getNomUrl(1);
|
print '<tr '.$bc[$var].'><td>'.$contactstatic->getNomUrl(1);
|
||||||
print $obj->email?' <'.$obj->email.'>':$langs->trans("NoMail");
|
print $obj->email?' <'.$obj->email.'>':$langs->trans("NoMail");
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$label=($langs->trans("Notify_".$obj->code)!="Notify_".$obj->code?$langs->trans("Notify_".$obj->code):$obj->label);
|
$label=($langs->trans("Notify_".$obj->code)!="Notify_".$obj->code?$langs->trans("Notify_".$obj->code):$obj->label);
|
||||||
print $label;
|
print $label;
|
||||||
print '</td>';
|
print '</td>';
|
||||||
// TODO Add link to object here
|
// TODO Add link to object here
|
||||||
// print
|
// print
|
||||||
print'<td align="right">'.dol_print_date($db->jdate($obj->daten), 'dayhour').'</td>';
|
print'<td align="right">'.dol_print_date($db->jdate($obj->daten), 'dayhour').'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
$db->free($resql);
|
$db->free($resql);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
}
|
}
|
||||||
else dol_print_error('','RecordNotFound');
|
else dol_print_error('','RecordNotFound');
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user