31require_once NOALYSS_INCLUDE.
'/lib/function_javascript.php';
38 $this->fct=
'update_value';
40 $this->callback=
'null';
54 $this->callback=$p_name;
76 public function input($p_name=
null,$p_value=
null)
78 if ( $p_name ==
null && $this->
name ==
"")
79 throw (
new Exception(_(
'Le nom d une icard doit ĂȘtre donnĂ©')));
81 $this->
value=($p_value==
null)?$this->
value:$p_value;
84 $this->
id=($this->
id==
"")?$this->
name:$this->
id;
89 if ( $this->dblclick !=
'')
91 $e=sprintf(
' ondblclick="%s" ',
95 $input=sprintf(
'<INPUT TYPE="Text" class="input_text" '.
96 ' NAME="%s" ID="%s" VALUE="%s" SIZE="%d" %s %s>',
106 $div=sprintf(
'<div id="%s_choices" class="autocomplete"></div>',
108 $query=
"op=autoanc&".dossier::get();
112 if ($this->plan <> 0)
114 $query.=
"&pa_id=".$this->plan;
115 }
elseif ( $this->plan_ctl <>
'')
120 $javascript=sprintf(
'try { new Ajax.Autocompleter("%s","%s_choices","ajax_misc.php?%s",'.
121 '{paramName:"anccard",minChars:1,indicator:null, '.
123 ' afterUpdateElement:%s});} catch (e){alert(e.message);};',
132 $r=
$label.$input.$attr.$div.$javascript;
133 if ( $this->
table == 1 )
142 <INPUT TYPE="hidden" NAME="%s" VALUE="%s" SIZE="8">',
146 $r.=
'<span>'.$this->value.
'</span>';
179 if ( $this->
readOnly==
true)
return '';
183 foreach (array(
'typecard',
'jrn',
'label',
'price',
'tvaid') as $att)
185 if (isset($this->$att) )
186 $a.=
"this.".$att.
"='".$this->$att.
"';";
188 if (isset($this->
name))
189 $a.=
"this.inp='".$this->name.
"';";
190 $a.=
"this.popup='ipop_card';";
192 $button->javascript=
$a.
' search_card(this)';
193 return $button->input();
td($p_string='', $p_extra='')
surround the string with td
catch(Exception $exc) if(! $g_user->can_write_action($ag_id)) $r
if(! isset($_GET['submit_query'])) $p_action
HtmlInput for card of analytic accountancy.
set_function($p_name)
set the javascript callback function by default it is update_value called AFTER an item has been sele...
__construct($name="", $value="", $p_id="")
set_callback($p_name)
set the javascript callback function by default it is update_value called BEFORE the querystring is s...
set_dblclick($p_action)
set the extra javascript property for a double click on INPUT field
input($p_name=null, $p_value=null)
show the html input of the widget
display()
print in html the readonly value of the widget
search()
return a string containing the button for displaying a search form.
create_script($p_string)
create the HTML for adding the script tags around of the script
if( $delta< 0) elseif( $delta==0)