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
00027 require_once('class_html_input.php');
00028 require_once('class_itext.php');
00029 require_once('class_ibutton.php');
00030 require_once('class_ipopup.php');
00031 require_once('function_javascript.php');
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
00080 class IPoste extends HtmlInput
00081 {
00082
00083 function __construct($p_name="",$p_value="")
00084 {
00085 $this->name=$p_name;
00086 $this->readOnly=false;
00087 $this->size=10;
00088 $this->value=$p_value;
00089 $this->selected="";
00090 $this->table=0;
00091 $this->disabled=false;
00092 $this->javascript="";
00093 $this->extra2="all";
00094 $this->attribute=array();
00095
00096 }
00097
00098 static function ipopup($p_name)
00099 {
00100 $ip=new IPopup($p_name);
00101 $ip->title='Plan comptable';
00102 $ip->value='';
00103 $ip->set_height('80%');
00104 $ip->set_zindex(20);
00105 return $ip->input();
00106 }
00107
00108
00109
00110
00111 public function get_js_attr()
00112 {
00113 $attr="";
00114
00115 for ($i=0;$i< count($this->attribute);$i++)
00116 {
00117 list($name,$value)=$this->attribute[$i];
00118 $tmp1=sprintf("$('%s_bt').%s='%s';",
00119 $this->name,
00120 $name,
00121 $value);
00122 $attr.=$tmp1;
00123 }
00124 $attr=create_script($attr);
00125 return $attr;
00126 }
00127
00128 public function dsp_button()
00129 {
00130 $ib=new IButton($this->name.'_bt');
00131 $ib->javascript='search_poste(this)';
00132
00133
00134 $sc=$this->get_js_attr();
00135 return $ib->input().$sc;
00136 }
00137
00138 public function input($p_name=null,$p_value=null)
00139 {
00140 $this->name=($p_name==null)?$this->name:$p_name;
00141 $this->value=($p_value==null)?$this->value:$p_value;
00142 if ( $this->readOnly==true) return $this->display();
00143
00144 if ( ! isset($this->ctrl) ) $this->ctrl='none';
00145
00146 if ( ! isset($this->javascript)) $this->javascript="";
00147
00148
00149 $itext=new IText($this->name,$this->value);
00150
00151 if ( isset ($this->css_size))
00152 $itext->css_size=$this->css_size;
00153 else
00154 $itext->size=$this->size;
00155
00156 $itext->javascript=$this->javascript;
00157
00158 $ibutton=$this->dsp_button();
00159 if ( $this->table==3)
00160 {
00161 $r='<table>'.tr(td($itext->input()).td($ibutton));
00162 $r.='</table>';
00163 return $r;
00164 }
00165 $r=$itext->input().$ibutton;
00166 if ( $this->table==1) $r=td($r);
00167
00168 return $r;
00169
00170
00171
00172
00173 }
00174
00175 public function display()
00176 {
00177 $r=sprintf('<TD><input type="hidden" name="%s" value="%s">
00178 %s
00179
00180 </TD>',
00181 $this->name,
00182 $this->value ,
00183 $this->value
00184 );
00185
00186 return $r;
00187
00188 }
00189
00190
00191
00192
00193 public function dbl_click_history()
00194 {
00195 $r=' ondblclick="get_history_account(\''.$this->name.'\',\''.dossier::id().'\')"';
00196 $this->javascript=$r;
00197 }
00198 static public function test_me()
00199 {
00200 }
00201 }