diff --git a/htdocs/contact/index.php b/htdocs/contact/index.php index 032399361ce..8905cf56530 100644 --- a/htdocs/contact/index.php +++ b/htdocs/contact/index.php @@ -19,10 +19,8 @@ * * $Id$ * $Source$ - * */ - /** \file htdocs/contact/index.php \ingroup societe @@ -95,181 +93,180 @@ $sql .= "WHERE 1=1 "; if ($_GET["userid"]) // statut commercial { - $sql .= " AND p.fk_user=".$_GET["userid"]; + $sql .= " AND p.fk_user=".$_GET["userid"]; } if ($search_nom) // filtre sur le nom { - $sql .= " AND upper(p.name) like '%".$search_nom."%'"; + $sql .= " AND upper(p.name) like '%".$search_nom."%'"; } if ($search_prenom) // filtre sur le prenom { - $sql .= " AND upper(p.firstname) like '%".$search_prenom."%'"; + $sql .= " AND upper(p.firstname) like '%".$search_prenom."%'"; } if ($search_societe) // filtre sur la societe { - $sql .= " AND upper(s.nom) like '%".$search_societe."%'"; + $sql .= " AND upper(s.nom) like '%".$search_societe."%'"; } if ($search_email) // filtre sur l'email { - $sql .= " AND upper(p.email) like '%".$search_email."%'"; + $sql .= " AND upper(p.email) like '%".$search_email."%'"; } if ($type == "f") // filtre sur type { - $sql .= " AND fournisseur = 1"; + $sql .= " AND fournisseur = 1"; } if ($type == "c") // filtre sur type { - $sql .= " AND client = 1"; + $sql .= " AND client = 1"; } if ($contactname) { - $sql .= " AND (p.name like '%".$contactname."%' OR p.firstname like '%".$contactname."%') "; + $sql .= " AND (p.name like '%".$contactname."%' OR p.firstname like '%".$contactname."%') "; } -if ($socid) +if ($socid) { - $sql .= " AND s.idp = $socid"; + $sql .= " AND s.idp = $socid"; } if($_GET["view"] == "recent") { - $sql .= " ORDER BY p.datec DESC " . $db->plimit( $limit + 1, $offset); + $sql .= " ORDER BY p.datec DESC " . $db->plimit( $limit + 1, $offset); } else { - $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit( $limit + 1, $offset); + $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit( $limit + 1, $offset); } $result = $db->query($sql); -if ($result) +if ($result) { - $num = $db->num_rows(); - $i = 0; + $num = $db->num_rows(); + $i = 0; - print_barre_liste($titre ,$page, "index.php", '&begin='.$_GET["begin"].'&view='.$_GET["view"].'&userid='.$_GET["userid"], $sortfield, $sortorder,'',$num); + print_barre_liste($titre ,$page, "index.php", '&begin='.$_GET["begin"].'&view='.$_GET["view"].'&userid='.$_GET["userid"], $sortfield, $sortorder,'',$num); - print '
| '.$langs->trans("Phone").' | '; + // Ligne des titres + print '|||||||||
| '.$langs->trans("Phone").' | '; - if ($_GET["view"] == 'phone') + if ($_GET["view"] == 'phone') { - print ''.$langs->trans("Mobile").' | '; - print ''.$langs->trans("Fax").' | '; + print ''.$langs->trans("Mobile").' | '; + print ''.$langs->trans("Fax").' | '; } - else + else { - print_liste_field_titre($langs->trans("EMail"),"index.php","p.email", $begin, "&type=$type&view=$view&search_nom=$search_nom&search_prenom=$search_prenom&search_societe=$search_societe&search_email=$search_email", "", $sortfield); + print_liste_field_titre($langs->trans("EMail"),"index.php","p.email", $begin, "&type=$type&view=$view&search_nom=$search_nom&search_prenom=$search_prenom&search_societe=$search_societe&search_email=$search_email", "", $sortfield); } - print ''; - print " | '; + print "\n"; - // Ligne des champs de filtres - print ''; - $var=True; - while ($i < min($num,$limit)) + $var=True; + while ($i < min($num,$limit)) { - $obj = $db->fetch_object($result); - - $var=!$var; + $obj = $db->fetch_object($result); - print " | |||
| '; - print ''; - print img_object($langs->trans("ShowContact"),"contact"); - print ' '.$obj->name.' | '; - print ''.$obj->firstname.' | '; - print ''; - print img_object($langs->trans("ShowCompany"),"company"); - print ' '.$obj->nom.' | '; - print ''.dolibarr_print_phone($obj->phone).' | '; + print "||||||
| '.dolibarr_print_phone($obj->phone_mobile).' | '; - - print ''.dolibarr_print_phone($obj->fax).' | '; - } - else - { - print ''; - if (! $obj->email) { - print ' '; - } - elseif (! ValidEmail($obj->email)) + print ' | '; + print ''; + print img_object($langs->trans("ShowContact"),"contact"); + print ' '.$obj->name.' | '; + print ''.$obj->firstname.' | '; + print ''; + print img_object($langs->trans("ShowCompany"),"company").' '.dolibarr_trunc($obj->nom,44).' | '; + print ''.dolibarr_print_phone($obj->phone).' | '; + + if ($_GET["view"] == 'phone') { - print "Email Invalide !"; - } - else { - print ''.$obj->email.''; - } - print ''; - } + print ''.dolibarr_print_phone($obj->phone_mobile,$obj->fp_pays).' | '; - print "'.dolibarr_print_phone($obj->fax,$obj->fp_pays).' | '; + } + else + { + print ''; + if (! $obj->email) { + print ' '; + } + elseif (! ValidEmail($obj->email)) + { + print "Email Invalide !"; + } + else { + print ''.$obj->email.''; + } + print ' | '; + } + + print "\n"; + $i++; } - print "