noalyss-commit
[Top][All Lists]
Advanced

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

[Noalyss-commit] [noalyss] 37/107: Card : allow to specify the max displ


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 37/107: Card : allow to specify the max displaid rows
Date: Mon, 26 Aug 2019 10:31:53 -0400 (EDT)

sparkyx pushed a commit to branch master
in repository noalyss.

commit aa9fe14bf06e361b8bcc5b2461e051bd23ae3aa6
Author: Dany De Bontridder <address@hidden>
Date:   Mon Jul 22 21:37:16 2019 +0200

    Card : allow to specify the max displaid rows
---
 html/fid_card.php             | 4 +++-
 include/class/fiche.class.php | 3 ++-
 include/lib/icard.class.php   | 8 +++++---
 3 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/html/fid_card.php b/html/fid_card.php
index 657e143..c5525df 100644
--- a/html/fid_card.php
+++ b/html/fid_card.php
@@ -45,6 +45,8 @@ require_once NOALYSS_INCLUDE.'/class/dossier.class.php';
 $http=new HttpInput();
 
 $jrn= $http->request("j","number",-1); 
+$limit=$http->request("limit","number",12);
+
 $filter_card="";
 $cn=Dossier::connect();
 $d=$http->request('e');
@@ -122,7 +124,7 @@ $sql_str="select distinct f_id
          join fiche_detail using (f_id) 
          where 
          ad_id in (9,1,23) 
-         and ad_value ilike '%'||$1||'%' ".$filter_card.' limit 12';
+         and ad_value ilike '%'||$1||'%' ".$filter_card.' limit '.$limit;
 
 
 $fid=$http->request("FID");
diff --git a/include/class/fiche.class.php b/include/class/fiche.class.php
index 3d59b9e..e3ad8ef 100644
--- a/include/class/fiche.class.php
+++ b/include/class/fiche.class.php
@@ -653,6 +653,7 @@ class Fiche
                             $w->width=$r->ad_size;
                             $w->extra=$filter;
                             $w->extra2=0;
+                            $w->limit=6;
                             $label=new ISpan();
                             $label->name="av_text".$r->ad_id.$uniq."_label";
                             $fiche=new Fiche($this->cn);
@@ -672,7 +673,7 @@ class Fiche
                             $w->set_attribute('typecard', $filter);
                             $w->set_attribute('inp', $w->id);
                             $w->set_attribute('label', $label->name);
-                            $w->autocomplete=0;
+                            $w->autocomplete=1;
                             $w->dblclick="fill_ipopcard(this);";
                             $msg=$w->search();
                             $msg.=$label->input();
diff --git a/include/lib/icard.class.php b/include/lib/icard.class.php
index af91ed1..d0bfa41 100644
--- a/include/lib/icard.class.php
+++ b/include/lib/icard.class.php
@@ -135,6 +135,7 @@ class ICard extends HtmlInput
         $this->autocomplete=1;
         $this->style='  ';
         $this->accvis=1; //!< account_visible =1 otherwise 0
+        $this->limit=12; //!< Max of row show
     }
    
     /**
@@ -252,14 +253,15 @@ class ICard extends HtmlInput
             $div=($this->choice_create==1)?sprintf('<div id="%s"  
class="autocomplete"></div>',
                             $this->choice):"";
 
-            $query=dossier::get().'&e='.urlencode($this->typecard);
-
+            $query=http_build_query([ 
'gDossier'=>Dossier::id(),'e'=>$this->typecard,'limit'=>$this->limit]);
+            
             $javascript=sprintf('try { new 
Ajax.Autocompleter("%s","%s","fid_card.php?%s",'.
                     '{paramName:"FID",minChars:1,indicator:%s, '.
                     'callback:%s, '.
+                    'limit:%s,'.
                     ' afterUpdateElement:%s});} catch (e){alert(e.message);};',
                     $this->id, $this->choice, $query, $this->indicator,
-                    $this->callback, $this->fct);
+                    $this->callback, $this->limit, $this->fct);
 
             $javascript=create_script($javascript.$this->dblclick);
 



reply via email to

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