Go to the documentation of this file.00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 require_once('class_html_input.php');
00027 require_once('class_itext.php');
00028 require_once('class_ibutton.php');
00029 require_once('class_ipopup.php');
00030 require_once('function_javascript.php');
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079 class IPoste extends HtmlInput
00080 {
00081
00082 function __construct($p_name="",$p_value="",$p_id="")
00083 {
00084 $this->name=$p_name;
00085 $this->readOnly=false;
00086 $this->size=10;
00087 $this->value=$p_value;
00088 $this->selected="";
00089 $this->table=0;
00090 $this->disabled=false;
00091 $this->javascript="";
00092 $this->extra2="all";
00093 $this->attribute=array();
00094 $this->id=$p_id;
00095
00096
00097 }
00098
00099 static function ipopup($p_name)
00100 {
00101 $ip=new IPopup($p_name);
00102 $ip->title='Plan comptable';
00103 $ip->value='';
00104 $ip->set_height('80%');
00105 $ip->set_zindex(20);
00106 return $ip->input();
00107 }
00108
00109
00110
00111
00112 public function get_js_attr()
00113 {
00114 $attr="";
00115
00116 for ($i=0;$i< count($this->attribute);$i++)
00117 {
00118 list($name,$value)=$this->attribute[$i];
00119 $tmp1=sprintf("$('%s_bt').%s='%s';",
00120 $this->id,
00121 $name,
00122 $value);
00123 $attr.=$tmp1;
00124 }
00125 $attr=create_script($attr);
00126 return $attr;
00127 }
00128
00129 public function dsp_button()
00130 {
00131 $this->id=($this->id=="")?$this->name:$this->id;
00132 $ib=new ISmallButton($this->id.'_bt');
00133 $ib->label=_('Recherche');
00134
00135 $ib->javascript='search_poste(this)';
00136
00137
00138 $sc=$this->get_js_attr();
00139 return $ib->input().$sc;
00140 }
00141
00142 public function input($p_name=null,$p_value=null)
00143 {
00144 $this->name=($p_name==null)?$this->name:$p_name;
00145 $this->value=($p_value==null)?$this->value:$p_value;
00146 if ( $this->readOnly==true) return $this->display();
00147
00148 if ( ! isset($this->ctrl) ) $this->ctrl='none';
00149
00150 if ( ! isset($this->javascript)) $this->javascript="";
00151 $this->id=($this->id=="")?$this->name:$this->id;
00152
00153
00154 $itext=new IText($this->name,$this->value,$this->id);
00155
00156 if ( isset ($this->css_size))
00157 $itext->css_size=$this->css_size;
00158 else
00159 $itext->size=$this->size;
00160
00161 $itext->javascript=$this->javascript;
00162
00163 $ibutton=$this->dsp_button();
00164 if ( $this->table==3)
00165 {
00166 $r='<table>'.tr(td($itext->input()).td($ibutton));
00167 $r.='</table>';
00168 return $r;
00169 }
00170 $r=$itext->input().$ibutton;
00171 if ( $this->table==1) $r=td($r);
00172
00173 return $r;
00174
00175
00176
00177
00178 }
00179
00180 public function display()
00181 {
00182 $r=sprintf('<TD><input type="hidden" name="%s" value="%s">
00183 %s
00184
00185 </TD>',
00186 $this->name,
00187 $this->value ,
00188 $this->value
00189 );
00190
00191 return $r;
00192
00193 }
00194
00195
00196
00197
00198 public function dbl_click_history()
00199 {
00200 $r=' ondblclick="get_history_account(\''.$this->name.'\',\''.dossier::id().'\')"';
00201 $this->javascript=$r;
00202 }
00203 static public function test_me()
00204 {
00205 }
00206 }