noalyss-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Noalyss-commit] [noalyss] 06/19: Limit search thanks user's preferences


From: dwm
Subject: [Noalyss-commit] [noalyss] 06/19: Limit search thanks user's preferences
Date: Sat, 31 Aug 2024 17:46:27 -0400 (EDT)

sparkyx pushed a commit to branch pre-stable
in repository noalyss.

commit 631063b9a50fb9608ceb1794683417bf8d7df0f7
Author: sparkyx <danydb@noalyss.eu>
AuthorDate: Sat Aug 24 11:58:26 2024 +0200

    Limit search thanks user's preferences
---
 include/ajax/ajax_boxcard_search.php | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/include/ajax/ajax_boxcard_search.php 
b/include/ajax/ajax_boxcard_search.php
index e8668f945..efa50424d 100644
--- a/include/ajax/ajax_boxcard_search.php
+++ b/include/ajax/ajax_boxcard_search.php
@@ -26,6 +26,7 @@
  *
  */
 if ( ! defined ('ALLOWED') ) die('Appel direct ne sont pas permis');
+global $g_user;
 $sql="
        select distinct 
vw.f_id,vw_name,vw_first_name,vw_description,fd_label,quick_code,tva_num,(select
 ad_value from fiche_Detail where f_id=pc.f_id and ad_id=5) as poste
        from vw_fiche_attr as vw
@@ -35,12 +36,13 @@ $sql="
        ad_value ~* $1
        order by 2
 ";
+$preference=$g_user->get_preference();
 $array=$cn->get_array($sql,array($_GET['card']));
 echo HtmlInput::title_box(_("Résultat recherche"), "boxsearch_card_div");
-$max=(count($array)>MAX_CARD_SEARCH)?MAX_CARD_SEARCH:count($array);
+$max=(count($array)> $preference['PAGESIZE'])? 
$preference['PAGESIZE']:count($array);
 ?>
-<?php if (count($array)>MAX_CARD_SEARCH ): ?>
-<h2 class="notice"><?php printf (_("Résultat limité à %d , %d nombre de fiches 
trouvées"), MAX_CARD_SEARCH,count($array))?> </h2>
+<?php if (count($array)>$preference['PAGESIZE'] ): ?>
+<h2 class="notice"><?php printf (_("Résultat limité à %d dans vos préférences, 
%d fiches trouvées"), $preference['PAGESIZE'],count($array))?> </h2>
 
 <?php endif?>
 <?php echo _('Cherche')?> <?php echo Icon_Action::infobulle(26);echo 
HtmlInput::filter_table("tb_fiche", "0,1,2,3,4,5", 1); ?> :



reply via email to

[Prev in Thread] Current Thread [Next in Thread]