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 $javascript='search_poste(this)';
00133 $button=HtmlInput::button_image($javascript,$this->name."_bt", 'alt="'._('Recherche').'" class="image_search"',"image/magnifier13.png");
00134
00135 $sc=$this->get_js_attr();
00136 return $button.$sc;
00137 }
00138
00139 public function input($p_name=null,$p_value=null)
00140 {
00141 $this->name=($p_name==null)?$this->name:$p_name;
00142 $this->value=($p_value==null)?$this->value:$p_value;
00143 if ( $this->readOnly==true) return $this->display();
00144
00145 if ( ! isset($this->ctrl) ) $this->ctrl='none';
00146
00147 if ( ! isset($this->javascript)) $this->javascript="";
00148 $this->id=($this->id=="")?$this->name:$this->id;
00149
00150
00151 $itext=new IText($this->name,$this->value,$this->id);
00152
00153 if ( isset ($this->css_size))
00154 $itext->css_size=$this->css_size;
00155 else
00156 $itext->size=$this->size;
00157
00158 $itext->javascript=$this->javascript;
00159
00160 $ibutton=$this->dsp_button();
00161 if ( $this->table==3)
00162 {
00163 $r='<table>'.tr(td($itext->input()).td($ibutton));
00164 $r.='</table>';
00165 return $r;
00166 }
00167 $r=$itext->input().$ibutton;
00168 if ( $this->table==1) $r=td($r);
00169
00170 return $r;
00171
00172
00173
00174
00175 }
00176
00177 public function display()
00178 {
00179 $r=sprintf('<TD><input type="hidden" name="%s" value="%s">
00180 %s
00181
00182 </TD>',
00183 $this->name,
00184 $this->value ,
00185 $this->value
00186 );
00187
00188 return $r;
00189
00190 }
00191
00192
00193
00194
00195 public function dbl_click_history()
00196 {
00197 $r=' ondblclick="get_history_account(\''.$this->name.'\',\''.dossier::id().'\')"';
00198 $this->javascript=$r;
00199 }
00200 static public function test_me()
00201 {
00202 }
00203 }