Permalink
Browse files

Fix: search on ref

  • Loading branch information...
1 parent 233af62 commit 440a3305f5b8334b60beb65214bc6015cdf3c804 @eldy eldy committed Apr 2, 2012
Showing with 15 additions and 6 deletions.
  1. +15 −6 htdocs/adherents/liste.php
View
@@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
- * Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
+ * Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -107,6 +107,11 @@
{
$sql.=" AND d.statut in (".$statut.")"; // Peut valoir un nombre ou liste de nombre separes par virgules
}
+if ($search_ref)
+{
+ if (is_numeric($search_ref)) $sql.= " AND (d.rowid = ".$search_ref.")";
+ else $sql.=" AND 1 = 2"; // Always wrong
+}
if ($search_nom)
{
$sql.= " AND (d.prenom LIKE '%".$search_nom."%' OR d.nom LIKE '%".$search_nom."%')";
@@ -257,23 +262,27 @@
$objp = $db->fetch_object($resql);
$datefin=$db->jdate($objp->datefin);
+ $memberstatic->id=$objp->rowid;
+ $memberstatic->ref=$objp->rowid;
+ $memberstatic->lastname=$objp->lastname;
+ $memberstatic->firstname=$objp->firstname;
$var=!$var;
print "<tr ".$bc[$var].">";
// Ref
- print "<td>".$objp->rowid."</td>\n";
+ print "<td>";
+ print $memberstatic->getNomUrl(1);
+ print "</td>\n";
// Lastname
- $memberstatic->lastname=$objp->lastname;
- $memberstatic->firstname=$objp->firstname;
if ($objp->societe != '')
{
- print "<td><a href=\"fiche.php?rowid=$objp->rowid\">".img_object($langs->trans("ShowMember"),"user").' '.dol_trunc($memberstatic->getFullName($langs))." / ".dol_trunc($objp->societe,12)."</a></td>\n";
+ print "<td><a href=\"fiche.php?rowid=$objp->rowid\">".dol_trunc($memberstatic->getFullName($langs))." / ".dol_trunc($objp->societe,12)."</a></td>\n";
}
else
{
- print "<td><a href=\"fiche.php?rowid=$objp->rowid\">".img_object($langs->trans("ShowMember"),"user").' '.dol_trunc($memberstatic->getFullName($langs))."</a></td>\n";
+ print "<td><a href=\"fiche.php?rowid=$objp->rowid\">".dol_trunc($memberstatic->getFullName($langs))."</a></td>\n";
}
// Login

0 comments on commit 440a330

Please sign in to comment.