117 require_once NOALYSS_INCLUDE.
'/lib/class_html_input.php';
118 require_once NOALYSS_INCLUDE.
'/lib/function_javascript.php';
125 $this->fct=
'update_value';
127 $this->callback=
'null';
131 $this->indicator=null;
132 $this->choice_create=1;
133 $this->autocomplete=1;
134 $this->
style=
' style="vertical-align:50%"';
143 $this->callback=$p_name;
173 $ip_card=
new IPopup ($p_name);
175 $ip_card->set_width(
'45%');
176 $ip_card->title=
'Fiche ';
179 return $ip_card->input();
191 public function input($p_name=null,$p_value=null)
193 if ( $p_name == null && $this->
name ==
"")
194 throw (
new Exception(
'Le nom d une icard doit être donne'));
196 $this->
value=($p_value==null)?$this->
value:$p_value;
199 $this->
id=($this->
id==
"")?$this->
name:$this->
id;
200 $this->choice=($this->choice==null)?sprintf(
"%s_choices",$this->
id):
$this->choice;
201 $this->indicator=($this->indicator==null)?sprintf(
"%s_ind",$this->
id):$this->indicator;
205 if ( $this->dblclick !=
'')
207 $e=sprintf(
' ondblclick="%s" ',
211 $input=sprintf(
'<INPUT TYPE="Text" class="input_text" '.
212 ' NAME="%s" ID="%s" VALUE="%s" SIZE="%d" %s %s %s>',
221 if ( $this->autocomplete == 1)
223 $this->indicator=
"ind_".$this->id;
224 $ind=sprintf(
'<span id="%s" class="autocomplete" style="position:absolute;display:none">Un instant... <img src="image/loading.gif" alt="Chargement..."/>'.
227 $this->indicator=
"null";
228 $div=($this->choice_create == 1) ? sprintf(
'<div id="%s" class="autocomplete"></div>',$this->choice):
"";
230 $query=dossier::get().
'&e='.urlencode($this->typecard);
232 $javascript=sprintf(
'try { new Ajax.Autocompleter("%s","%s","fid_card.php?%s",'.
233 '{paramName:"FID",minChars:1,indicator:%s, '.
235 ' afterUpdateElement:%s});} catch (e){alert(e.message);};',
245 $r=
$label.$input.$attr.$ind.$div.$javascript;
251 if ( $this->
table == 1 )
259 $r=sprintf(
' <INPUT TYPE="hidden" NAME="%s" id="%s" VALUE="%s" SIZE="8">',
264 $r.=
'<span>'.$this->value.
'</span>';
297 if ( $this->
readOnly==
true)
return '';
300 foreach (array(
'typecard',
'jrn',
'label',
'price',
'tvaid') as $att)
302 if (isset($this->$att) )
303 $a.=
"this.".$att.
"='".$this->$att.
"';";
305 if (isset($this->
id) && $this->
id !=
"")
306 $a.=
"this.inp='".$this->id.
"';";
308 $a.=
"this.inp='".$this->name.
"';";
309 $a.=
"this.popup='ipop_card';";
318 require_once NOALYSS_INCLUDE.
'/lib/class_itext.php';
319 $_SESSION[
'isValid']=1;
322 $a->set_attribute(
'label',
'ctl_label');
323 $a->set_attribute(
'tvaid',
'ctl_tvaid');
324 $a->set_attribute(
'price',
'ctl_price');
325 $a->set_attribute(
'purchase',
'ctl_purchase');
326 $a->set_attribute(
'type',
'all');
328 <div
id=
"debug" style=
"border:solid 1px black;overflow:auto"></div>
329 <script
type=
"text/javascript" language=
"javascript" src=
"js/prototype.js">
331 <script type=
"text/javascript" language=
"javascript" src=
"js/scriptaculous.js">
333 <script type=
"text/javascript" language=
"javascript" src=
"js/effects.js">
335 <script type=
"text/javascript" language=
"javascript" src=
"js/controls.js">
337 <script type=
"text/javascript" language=
"javascript" src=
"js/ajax_fid.js">
339 <script type=
"text/javascript" language=
"javascript" >
340 function test_value(text,li)
342 alert(
"premier"+li.id);
374 $t=
new IText(
'ctl_tvaid');
378 echo
"Label ".$l->input().
'<br>';
379 echo
"Tva id ".$t->input().
'<br>';
380 echo
"Price ".$p->input().
'<br>';
381 echo
"Purchase ".$b->input().
'<br>';
385 $a->set_function(
'test_value');
386 $a->javascript=
' onchange="alert(\'onchange\');" onblur="alert(\'onblur\');" ';
388 echo dossier::hidden();
alert($p_msg, $buffer=false)
alert in javascript
set_function($p_name)
set the javascript callback function by default it is update_value called AFTER an item has been sele...
td($p_string='', $p_extra='')
surround the string with td
display()
print in html the readonly value of the widget
function ajaxFid(p_ctl)
this function fills the data from fid.php,
search()
return a string containing the button for displaying a search form.
for($e=0;$e< count($array);$e++) $desc readOnly
set_callback($p_name)
set the javascript callback function by default it is update_value called BEFORE the querystring is s...
static ipopup($p_name)
return the html string for creating the ipopup, this ipopup can be used for adding, modifying or display a card
set_dblclick($p_action)
set the extra javascript property for a double click on INPUT field
for($i=0;$i<=6;$i++) $ind
Input HTML for the card show buttons, in the file, you have to add card.js How to use : ...
input($p_name=null, $p_value=null)
show the html input of the widget
if(!isset($_GET['submit_query'])) $p_action
create_script($p_string)
create the HTML for adding the script tags around of the script
__construct($name="", $value="", $p_id="")