[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 15/27: Button_image for search card
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 15/27: Button_image for search card |
Date: |
Sun, 02 Nov 2014 11:08:49 +0000 |
sparkyx pushed a commit to branch master
in repository noalyss.
commit fa8c94c2622530cbf6ff8f0512d45e7444aae0fe
Author: Dany De Bontridder <address@hidden>
Date: Mon Oct 13 19:16:00 2014 +0200
Button_image for search card
---
include/class_icard.php | 39 +++++++++++++++++++++++----------------
1 files changed, 23 insertions(+), 16 deletions(-)
diff --git a/include/class_icard.php b/include/class_icard.php
index f863da7..7acb959 100644
--- a/include/class_icard.php
+++ b/include/class_icard.php
@@ -126,8 +126,12 @@ class ICard extends HtmlInput
$this->dblclick='';
$this->callback='null';
$this->javascript='';
- $this->autocomplete=1;
- $this->id=($p_id != "")?$p_id:$name;
+ $this->id=($p_id != "")?$p_id:$name;
+ $this->choice=null;
+ $this->indicator=null;
+ $this->choice_create=1;
+ $this->autocomplete=1;
+ $this->style=' style="vertical-align:50%"';
}
/*!\brief set the javascript callback function
* by default it is update_value called BEFORE the querystring is send
@@ -171,6 +175,7 @@ class ICard extends HtmlInput
$ip_card->set_width('45%');
$ip_card->title='Fiche ';
$ip_card->value='';
+
return $ip_card->input();
}
/*!\brief set the extra javascript property for a double click on
@@ -192,7 +197,8 @@ class ICard extends HtmlInput
if ( $this->readOnly==true) return $this->display();
$this->id=($this->id=="")?$this->name:$this->id;
-
+
$this->choice=($this->choice==null)?sprintf("%s_choices",$this->id):$this->choice;
+
$this->indicator=($this->indicator==null)?sprintf("%s_ind",$this->id):$this->indicator;
$attr=$this->get_js_attr();
$label='';
@@ -203,30 +209,32 @@ class ICard extends HtmlInput
$this->dblclick=$e;
}
$input=sprintf('<INPUT TYPE="Text" class="input_text" '.
- ' NAME="%s" ID="%s" VALUE="%s" SIZE="%d" %s %s>',
+ ' NAME="%s" ID="%s" VALUE="%s" SIZE="%d" %s %s %s>',
$this->name,
$this->id,
$this->value,
$this->size,
$this->dblclick,
- $this->javascript
+ $this->javascript,
+ $this->style
);
if ( $this->autocomplete == 1)
{
- $ind=sprintf('<span id="%s_ind" class="autocomplete"
style="display:none">Un instant... <img src="image/loading.gif"
alt="Chargement..."/>'.
+ $ind=sprintf('<span id="%s" class="autocomplete"
style="display:none">Un instant... <img src="image/loading.gif"
alt="Chargement..."/>'.
'</span>',
- $this->id);
+ $this->indicator);
- $div=sprintf('<div id="%s_choices"
class="autocomplete"></div>',
- $this->id);
+ $div=($this->choice_create == 1) ? sprintf('<div
id="%s" class="autocomplete"></div>',$this->choice):"";
$query=dossier::get().'&e='.urlencode($this->typecard);
- $javascript=sprintf('try { new
Ajax.Autocompleter("%s","%s_choices","fid_card.php?%s",'.
+ $javascript=sprintf('try { new
Ajax.Autocompleter("%s","%s","fid_card.php?%s",'.
'{paramName:"FID",minChars:1,indicator:null, '.
'callback:%s, '.
'
afterUpdateElement:%s});} catch (e){alert(e.message);};',
-
$this->id,$this->id,$query,
+ $this->id,
+ $this->choice,
+ $query,
$this->callback,
$this->fct);
@@ -286,8 +294,6 @@ class ICard extends HtmlInput
{
if ( $this->readOnly==true) return '';
if ( ! isset($this->id )) $this->id=$this->name;
- $button=new ISmallButton($this->name.'_bt',"","","smallbutton");
- $button->label=_('Recherche');
$a="";
foreach (array('typecard','jrn','label','price','tvaid') as $att)
{
@@ -299,9 +305,10 @@ class ICard extends HtmlInput
else
$a.="this.inp='".$this->name."';";
$a.="this.popup='ipop_card';";
- $button->tabindex=-1;
- $button->javascript=$a.' search_card(this)';
- return $button->input();
+ $javascript=$a.' search_card(this);return false;';
+
+ $button=HtmlInput::button_image($javascript,$this->name."_bt",
'alt="'._('Recherche').'"
style="cursor:pointer;width:24px;height:24px;border:1px solid
transparent;"',"image/search.png");
+ return $button;
}
static public function test_me()
- [Noalyss-commit] [noalyss] 10/27: Correct mes Task #1038 - Recherche de fiche par poste comptable, (continued)
- [Noalyss-commit] [noalyss] 10/27: Correct mes Task #1038 - Recherche de fiche par poste comptable, Dany De Bontridder, 2014/11/02
- [Noalyss-commit] [noalyss] 17/27: Traduction, Dany De Bontridder, 2014/11/02
- [Noalyss-commit] [noalyss] 19/27: Last version of prototype + patch, Dany De Bontridder, 2014/11/02
- [Noalyss-commit] [noalyss] 23/27: Documentation, Dany De Bontridder, 2014/11/02
- [Noalyss-commit] [noalyss] 18/27: Documentation, Dany De Bontridder, 2014/11/02
- [Noalyss-commit] [noalyss] 22/27: Documentation, Dany De Bontridder, 2014/11/02
- [Noalyss-commit] [noalyss] 24/27: Code rewriting, Dany De Bontridder, 2014/11/02
- [Noalyss-commit] [noalyss] 16/27: Search by accounting Task #1038 - Recherche de fiche par poste comptable, Dany De Bontridder, 2014/11/02
- [Noalyss-commit] [noalyss] 25/27: Code rewriting : accept table with a text PK, Dany De Bontridder, 2014/11/02
- [Noalyss-commit] [noalyss] 26/27: Code rewriting : change due to change of menu_ref_sql, Dany De Bontridder, 2014/11/02
- [Noalyss-commit] [noalyss] 15/27: Button_image for search card,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 21/27: New functionnal test, Dany De Bontridder, 2014/11/02
- [Noalyss-commit] [noalyss] 27/27: Test unitaire avec PHPUNIT, Dany De Bontridder, 2014/11/02
- [Noalyss-commit] [noalyss] 20/27: Translation progress, Dany De Bontridder, 2014/11/02
- [Noalyss-commit] [noalyss] 05/27: Mise a jour traduction, Dany De Bontridder, 2014/11/02