diff --git a/htdocs/contact/fiche.php b/htdocs/contact/fiche.php index 1fdd12b8e16..e119b90e31c 100644 --- a/htdocs/contact/fiche.php +++ b/htdocs/contact/fiche.php @@ -220,7 +220,7 @@ if ($_GET["action"] == 'create') print 'Portable'; - print ''.$langs->trans("Company").' / '.$langs->trans("Town").' '; + print ''.$langs->trans("Zip").' / '.$langs->trans("Town").' '; print ''.$langs->trans("Fax").''; print ''.$langs->trans("Email").''; @@ -232,7 +232,8 @@ if ($_GET["action"] == 'create') print 'Contact facturation'; print ''; - print ""; + print "
"; + print ""; } elseif ($_GET["action"] == 'edit') @@ -273,7 +274,7 @@ elseif ($_GET["action"] == 'edit') print 'Portable'; - print 'CP Ville '; + print ''.$langs->trans("Zip").' / '.$langs->trans("Town").' '; print ''.$langs->trans("Fax").''; print ''.$langs->trans("EMail").''; @@ -344,11 +345,6 @@ else */ } - - - /* - * - */ if ($contact->jabberid) print 'Jabber : '.$contact->jabberid ."
"; diff --git a/htdocs/contact/index.php b/htdocs/contact/index.php index 67cb05a6226..5f4166d5898 100644 --- a/htdocs/contact/index.php +++ b/htdocs/contact/index.php @@ -80,28 +80,35 @@ $titre = "Liste des contacts $text"; */ $sql = "SELECT s.idp, s.nom, p.idp as cidp, p.name, p.firstname, p.email, p.phone, p.phone_mobile, p.fax "; -$sql .= "FROM ".MAIN_DB_PREFIX."socpeople as p"; -$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON (s.idp = p.fk_soc)"; - +$sql .= "FROM ".MAIN_DB_PREFIX."socpeople as p "; +$sql .= "LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON (s.idp = p.fk_soc) "; +$sql .= "WHERE 1=1 "; if (strlen($_GET["userid"])) // statut commercial { - $sql .= " WHERE p.fk_user=".$_GET["userid"]; + $sql .= " AND p.fk_user=".$_GET["userid"]; } -if (strlen($_GET["search_nom"])) // filtre sur la premiere lettre du nom +if (strlen($_GET["search_nom"])) // filtre sur le nom { - $sql .= " WHERE upper(p.name) like '%".$_GET["search_nom"]."%'"; + $sql .= " AND upper(p.name) like '%".$_GET["search_nom"]."%'"; } - -if (strlen($_GET["search_prenom"])) // filtre sur la premiere lettre du nom +if (strlen($_GET["search_prenom"])) // filtre sur le prenom { - $sql .= " WHERE upper(p.firstname) like '%".$_GET["search_prenom"]."%'"; + $sql .= " AND upper(p.firstname) like '%".$_GET["search_prenom"]."%'"; +} +if (strlen($_GET["search_societe"])) // filtre sur la societe +{ + $sql .= " AND upper(s.nom) like '%".$_GET["search_societe"]."%'"; +} +if (strlen($_GET["search_email"])) // filtre sur l'email +{ + $sql .= " AND upper(p.email) like '%".$_GET["search_email"]."%'"; } if ($contactname) { - $sql .= " WHERE (p.name like '%".$contactname."%' OR p.firstname like '%".$contactname."%') "; + $sql .= " AND (p.name like '%".$contactname."%' OR p.firstname like '%".$contactname."%') "; } if ($socid) @@ -130,11 +137,11 @@ if ($result) print ''; + // Ligne des titres print ''; - print_liste_field_titre($langs->trans("Lastname"),"index.php","lower(p.name)", $begin); - print_liste_field_titre($langs->trans("Firstname"),"index.php","lower(p.firstname)", $begin); - print_liste_field_titre($langs->trans("Company"),"index.php","lower(s.nom)", $begin); - + print_liste_field_titre($langs->trans("Lastname"),"index.php","p.name", $begin, "", "", $sortfield); + print_liste_field_titre($langs->trans("Firstname"),"index.php","p.firstname", $begin, "", "", $sortfield); + print_liste_field_titre($langs->trans("Company"),"index.php","s.nom", $begin, "", "", $sortfield); print ''; if ($_GET["view"] == 'phone') @@ -144,23 +151,46 @@ if ($result) } else { - print ''; + print_liste_field_titre($langs->trans("EMail"),"index.php","p.email", $begin, "", "", $sortfield); } - + print ''; print "\n"; + // Ligne des champs de filtres print ''; print ''; - print ''; + print ''; + print ''; + print ''; - print ''; - - + if ($_GET["view"] == 'phone') + { + print ''; + print ''; + } + else + { + print ''; + } + print ''; + print ''; + print ''; $var=True; while ($i < min($num,$limit)) @@ -175,27 +205,19 @@ if ($result) print ''; print img_file(); print ' '.$obj->name.''; - print ""; - - print '\n"; - - + print ''; + print ''; print ''; if ($_GET["view"] == 'phone') { print ''; - print ''; + print ''; } else { - print '
'.$langs->trans("Phone").''.$langs->trans("EMail").' 
'; - print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ' '; print ''; - print ''; - print ' 
'; + print ' '; + print ''; + print ' '; + print ''; + print ''; + print '
$obj->firstname'; - if ($obj->nom) - { - print 'Filtre '; - } - print "idp\">$obj->nom'.$obj->firstname.''.$obj->nom.''.dolibarr_print_phone($obj->phone).' '.dolibarr_print_phone($obj->phone_mobile).' '.dolibarr_print_phone($obj->fax).' '.dolibarr_print_phone($obj->fax).' '; + print ''; if (! $obj->email) { print ' '; } @@ -224,10 +246,9 @@ else /* * PhProjekt * - * */ -if (2==1 && strlen($_GET["search_nom"]) OR strlen($_GET["search_prenom"])) +if (2==1 && (strlen($_GET["search_nom"]) OR strlen($_GET["search_prenom"]))) { @@ -319,12 +340,11 @@ else print $db->error(); print "
".$sql; } + } - - $db->close(); llxFooter("Dernière modification $Date$ révision $Revision$");