/[phpcompta]/phpcompta/include/class_widget.php
ViewVC logotype

Diff of /phpcompta/include/class_widget.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by sparkyx, Sun Mar 6 18:30:12 2005 UTC revision 1.4 by sparkyx, Mon Jul 4 20:14:28 2005 UTC
# Line 36  class widget { Line 36  class widget {
36    var $table;    var $table;
37    var $label;    var $label;
38    var $disabled;    var $disabled;
39      var $extra;
40      var $extra2;
41    function widget($p_type="") {    function widget($p_type="") {
42      $this->type=$p_type;      $this->type=$p_type;
43      $this->readonly=false;      $this->readonly=false;
# Line 59  class widget { Line 61  class widget {
61                $p_label is the label of the INPUT                $p_label is the label of the INPUT
62    return : string containing the tag    return : string containing the tag
63    +++*/    +++*/
64    function IOValue($p_name,$p_value=null,$p_label="") {    function IOValue($p_name=null,$p_value=null,$p_label="") {
65      //    echo __FILE__."p_value $p_value";      //    echo __FILE__."p_value $p_value";
66      $this->name=$p_name;      if ( $p_name != null)
67          $this->name=$p_name;
68      $this->value=($p_value===null)?"":$p_value;      $this->value=($p_value===null)?"":$p_value;
69      $this->label=($p_label == "")?$this->label:$p_label;      $this->label=($p_label == "")?$this->label:$p_label;
70      //echo "this->value =".$this->value;      //echo "this->value =".$this->value;
# Line 194  class widget { Line 197  class widget {
197        if ( $this->table==1) $r="<TD>$this->label</TD><TD>$r</TD>";        if ( $this->table==1) $r="<TD>$this->label</TD><TD>$r</TD>";
198        return $r;        return $r;
199      }      }
200      // input type == js_search_poste => button search for the account
201        if ( strtolower($this->type)=="js_search_poste") {
202        
203          $l_sessid=$_REQUEST['PHPSESSID'];
204          // Do we need to filter ??
205          if ( $this->extra2 == null ) {
206          $r=sprintf('<TD>
207             <INPUT TYPE="button" onClick=SearchPoste(\'%s\',\'%s\',\'%s\') value="Search">
208                %s</TD><TD>
209    
210                 <INPUT TYPE="Text" NAME="%s" VALUE="%s" SIZE="8">
211                     </TD>',
212                     $l_sessid,
213                     $this->name,
214                     $this->extra,
215                     $this->label,
216                     $this->name,
217                     $this->value
218                     );
219    
220        } else { // $p_list is not null, so we have a filter
221          $r=sprintf('<TD>
222             <INPUT TYPE="button" onClick=SearchPosteFilter(\'%s\',\'%s\',\'%s\',\'%s\') value="Search">
223                %s</TD><TD>
224    
225                 <INPUT TYPE="Text" NAME="%s" VALUE="%s" SIZE="8">
226                     </TD>',
227                     $l_sessid,
228                     $this->name,
229                     $this->extra2,
230                     $this->extra,
231                     $this->label,
232                     $this->name,
233                     $this->value
234                     );
235    
236          } //else
237          return $r;
238        } // end js_search_poste
239    
240      // input type == js_search => button search for card
241      if ( strtolower($this->type)=="js_search") {
242        $l_sessid=$_REQUEST['PHPSESSID'];
243        $r=sprintf('<TD>
244             <INPUT TYPE="button" onClick=NewCard(\'%s\',\'%s\',\'%s\',\'%s\') value="New">
245             <INPUT TYPE="button" onClick=SearchCard(\'%s\',\'%s\',\'%s\',\'%s\') value="Search">
246                %s</TD><TD>
247    
248                 <INPUT TYPE="Text" NAME="%s" VALUE="%s" SIZE="8">
249                     </TD>',
250                   $l_sessid,
251                   $this->extra, // deb or cred
252                   $this->name,
253                   $this->extra2, //jrn
254                   $l_sessid,
255                   $this->extra,
256                   $this->name,
257                   $this->extra2,
258                   $this->label,
259                   $this->name,
260                   $this->value
261                   );
262        return $r;
263      }
264    
265    } //end function    } //end function
266    function debug() {    function debug() {

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26