diff --git a/include/adm.inc.php b/include/adm.inc.php
index 585b0dc71..1220f551b 100644
--- a/include/adm.inc.php
+++ b/include/adm.inc.php
@@ -97,6 +97,14 @@ if ( $low_action == "list" )
$a=(isset($_GET['query']))?$_GET['query']:"";
printf (_('Recherche').' ',
$a);
+ $sel_card=new ISelect('cat');
+ $sel_card->value=$cn->make_array('select fd_id, fd_label from fiche_def '.
+ ' where frd_id='.FICHE_TYPE_ADM_TAX.
+ ' order by fd_label ',1);
+ $sel_card->selected=(isset($_GET['cat']))?$_GET['cat']:-1;
+ $sel_card->javascript=' onchange="submit(this);"';
+ echo _('Catégorie :').$sel_card->input();
+
?>
@@ -105,9 +113,13 @@ if ( $low_action == "list" )
';
- echo $adm->Summary($search,'adm');
+ echo $adm->Summary($search,'adm',$sql);
echo '
';
diff --git a/include/class_fiche.php b/include/class_fiche.php
index f40e4af26..5eff5188b 100644
--- a/include/class_fiche.php
+++ b/include/class_fiche.php
@@ -1168,25 +1168,25 @@ function empty_attribute($p_attr) {
/*! Summary
* \brief show the default screen
*
- * \param p_search (filter)
- * \param p_action show the action column
- *
+ * \param $p_search (filter)
+ * \param $p_action show the action column
+ * \param $p_sql SQL to filter the number of card must start with AND
* \return: string to display
*/
- function Summary($p_search="",$p_action="")
+ function Summary($p_search="",$p_action="",$p_sql="")
{
$str_dossier=dossier::get();
$p_search=FormatString($p_search);
$script=$_SERVER['PHP_SELF'];
// Creation of the nav bar
// Get the max numberRow
- $all_tiers=$this->CountByDef($this->fiche_def_ref,$p_search);
+ $all_tiers=$this->CountByDef($this->fiche_def_ref,$p_search,$p_sql);
// Get offset and page variable
$offset=( isset ($_REQUEST['offset'] )) ?$_REQUEST['offset']:0;
$page=(isset($_REQUEST['page']))?$_REQUEST['page']:1;
$bar=jrn_navigation_bar($offset,$all_tiers,$_SESSION['g_pagesize'],$page);
// set a filter ?
- $search="";
+ $search=$p_sql;
$user=new User($this->cn);
$exercice=$user->get_exercice();
@@ -1196,7 +1196,7 @@ function empty_attribute($p_attr) {
if ( trim($p_search) != "" )
{
- $search=" and f_id in
+ $search.=" and f_id in
(select f_id from jnt_fic_att_value
join fiche using (f_id)
join attr_value using (jft_id)
diff --git a/include/client.inc.php b/include/client.inc.php
index 71568e7a4..177c66762 100644
--- a/include/client.inc.php
+++ b/include/client.inc.php
@@ -96,6 +96,14 @@ if ( $low_action == "list" )
$a=(isset($_GET['query']))?$_GET['query']:"";
printf (_('Recherche').' ',
$a);
+ $sel_card=new ISelect('cat');
+ $sel_card->value=$cn->make_array('select fd_id, fd_label from fiche_def '.
+ ' where frd_id='.FICHE_TYPE_CLIENT.
+ ' order by fd_label ',1);
+ $sel_card->selected=(isset($_GET['cat']))?$_GET['cat']:-1;
+ $sel_card->javascript=' onchange="submit(this);"';
+ echo _('Catégorie :').$sel_card->input();
+
?>
@@ -103,10 +111,14 @@ if ( $low_action == "list" )
';
- echo $client->Summary($search,'client');
+ echo $client->Summary($search,'client',$sql);
echo '
';
diff --git a/include/supplier.inc.php b/include/supplier.inc.php
index 993e00c7c..373fa1629 100644
--- a/include/supplier.inc.php
+++ b/include/supplier.inc.php
@@ -92,10 +92,18 @@ if ( $low_action == "list" )
';
- echo $supplier->Summary($search,'supplier');
+ echo $supplier->Summary($search,'supplier',$sql);
echo '
';