noalyss Version-9
Public Member Functions | Static Public Member Functions | Data Fields | Private Attributes
ICard Class Reference

Input HTML for the card show buttons, in the file, you have to add card.js How to use : More...

+ Inheritance diagram for ICard:
+ Collaboration diagram for ICard:

Public Member Functions

 __construct ($name="", $value="", $p_id="")
 
 display ()
 print in html the readonly value of the widget More...
 
 get_accvis ()
 
 get_amount_from_type ()
 amount_from_type : accountancy , sell or purchase price More...
 
 get_autocomplete ()
 1 autocomplete enable ; 0 autocomplete disable More...
 
 get_autocomplete_file ()
 php file to call to complete info from the card More...
 
 get_choice ()
 id_of_div_to_populate with the output of the autocomplete_file, it is the autocomplete div presenting a list of possible choices. More...
 
 get_choice_create ()
 1 if you want to create automatically the autocomplete DIV to fill with the the output of "autocomplete_file" or 0 if this DIV is created explicitly More...
 
 get_fct ()
 Function javascript by default it is update_value called BEFORE the querystring is send in ajax. More...
 
 get_indicator ()
 Id of the element to show that it is seaching. More...
 
 get_limit ()
 
 get_style ()
 CSS Style of the INPUT TEXT element. More...
 
 get_typecard ()
 
 hide_accounting ()
 in the search box, the accounting will be hidden More...
 
 input ($p_name=null, $p_value=null)
 show the html input of the widget More...
 
 search ()
 return a string containing the button for displaying a search form. More...
 
 set_accvis ($accvis)
 
 set_amount_from_type ($amount_from_type)
 amount_from_type : accountancy , sell or purchase price @parameter $amount_from_type ACH VEN or GL More...
 
 set_autocomplete ($autocomplete)
 1 autocomplet enable ; 0 autocomplete disable More...
 
 set_autocomplete_file ($autocomplete_file)
 php file to call to complete info from the card More...
 
 set_callback ($p_name)
 set the javascript callback function by default it is update_value called BEFORE the querystring is send More...
 
 set_choice ($choice)
 id_of_div_to_populate with the output of the autocomplete_file, it is the autocomplete div presenting a list of possible choices. More...
 
 set_choice_create ($choice_create)
 1 if you want to create automatically the autocomplete DIV to fill with the the output of "autocomplete_file" or 0 if this DIV is created explicitly More...
 
 set_dblclick ($p_action)
 set the extra javascript property for a double click on INPUT field More...
 
 set_fct ($fct)
 
 set_function ($p_name)
 set the javascript callback function by default it is update_value called AFTER an item has been selected More...
 
 set_indicator ($indicator)
 Id of the element to show that it is seaching. More...
 
 set_limit ($limit)
 
 set_style ($style)
 CSS Style of the INPUT TEXT element. More...
 
 set_typecard ($typecard)
 argument "e" passed to autocomplete_file , More...
 
 show_accounting ()
 in the search box, the accounting will be shown it is the default More...
 
- Public Member Functions inherited from HtmlInput
 __construct ($p_name="", $p_value="", $p_id="")
 
 __toString ()
 
 get_js_attr ()
 you can add attribute to this in javascript this function is a wrapper and create a script (in js) to modify "this" (in javascript) with the value of obj->attribute from PHP. More...
 
 get_node_attribute ()
 Insert attribute inside a INPUT TYPE, these attribute can be retrieved in javascript with element.getAttribute or changed with element.setAttribute example insert my_attribute into a checkbox <input type="checkbox" "my_attribute"="XX"> More...
 
 get_value ()
 Return the value of input (IText, INum,...) More...
 
 make_object_deprecated ($p_name=null)
 Make a JSON object, this method create a javascript object with the attribute set, it returns a javascript string with the object. More...
 
 set_attribute ($p_name, $p_value)
 set the extra javascript property for the INPUT field More...
 
 set_value ($p_string)
 Set the value of input (IText, INum,...) More...
 
 setReadOnly ($p_read)
 

Static Public Member Functions

static ipopup ($p_name)
 return the html string for creating the ipopup, this ipopup can be used for adding, modifying or display a card More...
 
static test_me ()
 
- Static Public Member Functions inherited from HtmlInput
static anchor ($p_text, $p_url="", $p_js="", $p_style=' class="line" ', $p_title="click", array $p_attribute=[])
 Return a simple anchor with a url or a javascript if $p_js is not null then p_url will be javascript:void(0) we don't add the event onclick. More...
 
static anchor_action ($action, $javascript, $id=NULL, $p_class="button", $p_symbole="")
 Anchor Html with javascript. More...
 
static anchor_close ($div, $p_js="")
 Return a html string with an anchor which close the inside popup. More...
 
static anchor_empty ($p_text, $p_id, $p_title="")
 let you create only a link and set an id on it. More...
 
static anchor_hide ($action, $javascript)
 Return a html string with an anchor to hide a div, put it in the right corner. More...
 
static array_to_hidden ($array, $global_array)
 transform request data to hidden More...
 
static array_to_string ($array, $global_array, $start="?")
 transform request data to string More...
 
static button ($p_name, $p_value, $p_javascript="", $p_class="smallbutton")
 
static button_action ($action, $javascript, $id=NULL, $p_class="button", $p_symbole="")
 button Html with javascript More...
 
static button_action_add ()
 
static button_action_remove_operation ($p_operation)
 
static button_anchor ($p_label, $p_value, $p_name="", $p_javascript="", $p_class="smallbutton")
 create a button with a ref More...
 
static button_choice_ledger ($p_array)
 
static button_close ($div_name, $class='smallbutton')
 close button for the HTML popup More...
 
static button_hide ($div_name)
 Hide the HTML popup. More...
 
static button_image ($javascript, $id="xx", $p_class='class="button"', $p_image="")
 button Html image More...
 
static calendar_zoom ($obj)
 Zoom the calendar. More...
 
static card_detail ($p_qcode, $pname='', $p_style="", $p_nohistory=false, $nofollowup=false)
 show the detail of a card More...
 
static default_value ($ind, $default, $array)
 return default if the value if the value doesn't exist in the array More...
 
static default_value_get ($ind, $default)
 return default if the value if the value doesn't exist in $_GET use HttpInput instead More...
 
static default_value_post ($ind, $default)
 return default if the value if the value doesn't exist in $_POST use HttpInput instead More...
 
static default_value_request ($ind, $default)
 return default if the value if the value doesn't exist in $_REQUEST use HttpInput instead More...
 
static detail_action ($ag_id, $p_mesg, $p_modify=1)
 return an anchor to view the detail of an action More...
 
static detail_modele_document ($p_id, $p_mesg)
 return a string containing the html code for calling the modifyModeleDocument More...
 
static detail_op ($p_jr_id, $p_mesg)
 return a string containing the html code for calling the modifyOperation More...
 
static display_periode ($p_id)
 
static errorbulle ($p_comment)
 
static extension ()
 
static filter_list ($p_list_id)
 Display a field for searching an element in a list, the searchable text must be in an element with the className search-content. More...
 
static filter_table ($p_table_id, $p_col, $start_row)
 filter the rows in a table and keep the colored row in alternance More...
 
static filter_table_form ($p_table_id, $p_col, $start_row, $p_name, $p_old_value)
 
static followup_card_button ($f_id, $p_mesg)
 display a div with the history of the card More...
 
static generate_id ($p_prefix)
 generate an unique id for a widget, More...
 
static get_to_hidden ($array)
 transform $_GET data to hidden More...
 
static get_to_string ($array, $start="?")
 transform $_GET data to string More...
 
static hidden ($p_name, $p_value, $p_id="")
 
static history_account ($p_account, $p_mesg, $p_style="", $p_exercice="")
 display a div with the history of the account More...
 
static history_anc_account ($p_account, $p_mesg, $p_style="", $p_exercice="")
 display a div with the history of the analytic account More...
 
static history_card ($f_id, $p_mesg, $p_style="", $p_exercice="")
 display a div with the history of the card More...
 
static history_card_button ($f_id, $p_mesg, $p_exercice="")
 display a div with the history of the card More...
 
static image_click ($p_image, $p_js, $p_message, $p_class="")
 Image to click ,. More...
 
static json_to_hidden ($p_json)
 transform a json to hidden More...
 
static post_to_hidden ($array)
 transform $_POST data to hidden More...
 
static post_to_string ($array)
 transform $_POST data to string More...
 
static print_window ()
 Javascript to print the current window. More...
 
static remove_stock ($p_id, $p_mesg)
 return a string containing the html code for calling the removeStock More...
 
static request_to_hidden (array $array)
 transform $_REQUEST data to hidden More...
 
static request_to_string ($array, $start="?")
 transform $_REQUEST data to string More...
 
static reset ($p_value)
 
static select_cat ($array_cat)
 create a hidden plus button to select the cat of ledger More...
 
static select_stock ($p_cn, $p_name, $p_mode)
 Create an ISelect object containing the available repository for reading or writing. More...
 
static show_receipt_document ($p_jr_id, $p_name="")
 Returns HTML code for displaying a icon with a link to a receipt document from the ledger. More...
 
static show_reconcile ($p_div, $let, $span="")
 
static simple_array_to_hidden ($array)
 Transform a double array as a HTML string with hidden html value array has the formarray ["name"]="x",array['value']="y") the key name will be the hidden input name;. More...
 
static submit ($p_name, $p_value, $p_javascript="", $p_class="smallbutton")
 
static title_box ($p_name, $p_div, $p_mod="close", $p_js="", $p_draggable="n", $p_enlarge='n')
 Title for boxes, you can customize the symbol thanks symbol with the mode "custom". More...
 
static warnbulle ($p_comment)
 

Data Fields

 $accvis
 $limit Max of row show More...
 
 $amount_from_type
 $typecard : type of card More...
 
 $autocomplete
 $style supplemental CSS More...
 
 $callback
 $choice More...
 
 $choice
 $indicator, text displaid when searching More...
 
 $choice_create
 $autocomplete : 1 enable - 0 disable More...
 
 $dblclick
 $callback , More...
 
 $fct
 < $fct ,by default it is update_value called BEFORE the querystring is send More...
 
 $indicator
 $choice_create 1 , display a (+) button , default 1 More...
 
 $limit
 $amount_from_type : accountancy , sell or purchase price More...
 
 $style =' '
 $accvis account_visible =1 otherwise 0, default 1 More...
 
 $typecard
 $autocomplete_file , ajax file used for autocompletion (see Ajax.Autocompleter) More...
 
- Data Fields inherited from HtmlInput
 $attribute
 
 $css_size
 
 $ctrl
 
 $disabled
 
 $extra
 
 $extra2
 
 $heigh
 
 $id
 
 $javascript
 
 $label
 
 $name
 
 $readOnly
 
 $require
 
 $selected
 
 $size
 
 $style
 
 $tabindex
 
 $table
 
 $type
 
 $value
 
 $width
 

Private Attributes

 $autocomplete_file
 

Detailed Description

Input HTML for the card show buttons, in the file, you have to add card.js How to use :

Definition at line 120 of file icard.class.php.

Constructor & Destructor Documentation

◆ __construct()

ICard::__construct (   $name = "",
  $value = "",
  $p_id = "" 
)

< account_visible =1 otherwise 0

< Max of row show

< in the follow up ,when a card is selected you take Prix Vente or Prix Achat

Reimplemented from HtmlInput.

Definition at line 161 of file icard.class.php.

162 {
163 parent::__construct($name, $value);
164 $this->fct='update_value';
165 $this->dblclick='';
166 $this->callback='null';
167 $this->javascript='';
168 $this->id=($p_id!="")?$p_id:$name;
169 $this->choice=null;
170 $this->indicator=null;
171 $this->choice_create=1;
172 $this->autocomplete=1;
173 $this->style=' ';
174 $this->accvis=1; //!< account_visible =1 otherwise 0
175 $this->limit=12; //!< Max of row show
176 $this->amount_from_type=''; //!< in the follow up ,when a card is selected you take Prix Vente or Prix Achat
177 $this->typecard='all';
178 $this->autocomplete_file="fid_card.php";
179 }
$ret javascript
$opd_description style
$icard amount_from_type

References HtmlInput\$name, $p_id, HtmlInput\$value, amount_from_type, javascript, and style.

Member Function Documentation

◆ display()

ICard::display ( )

print in html the readonly value of the widget

Definition at line 525 of file icard.class.php.

526 {
527 $r=sprintf(' <INPUT TYPE="hidden" NAME="%s" id="%s" VALUE="%s" SIZE="8">',
528 $this->name, $this->name, $this->value
529 );
530 $r.='<span>'.$this->value.'</span>';
531 return $r;
532 }
catch(Exception $exc) if(! $g_user->can_write_action($ag_id)) $r
$from_poste name

References $r, name, and value.

Referenced by input().

◆ get_accvis()

ICard::get_accvis ( )

Definition at line 238 of file icard.class.php.

239 {
240 return $this->accvis;
241 }
$accvis
$limit Max of row show

References $accvis.

◆ get_amount_from_type()

ICard::get_amount_from_type ( )

amount_from_type : accountancy , sell or purchase price

Definition at line 251 of file icard.class.php.

252 {
254 }
$amount_from_type
$typecard : type of card

References $amount_from_type.

◆ get_autocomplete()

ICard::get_autocomplete ( )

1 autocomplete enable ; 0 autocomplete disable

Returns
type

Definition at line 223 of file icard.class.php.

224 {
225 return $this->autocomplete;
226 }
$autocomplete
$style supplemental CSS

References $autocomplete.

◆ get_autocomplete_file()

ICard::get_autocomplete_file ( )

php file to call to complete info from the card

Parameters
string$autocomplete_file
See also
fid_card.php
Returns
$this

Definition at line 266 of file icard.class.php.

267 {
269 }
$autocomplete_file

References $autocomplete_file.

◆ get_choice()

ICard::get_choice ( )

id_of_div_to_populate with the output of the autocomplete_file, it is the autocomplete div presenting a list of possible choices.

Default {this->id}_choices

Returns
html string (

Definition at line 194 of file icard.class.php.

195 {
196 if ( $this->choice==null) {
197 return sprintf("%s_choices", $this->id);
198 }
199 return $this->choice;
200 }
$choice
$indicator, text displaid when searching

References $choice.

◆ get_choice_create()

ICard::get_choice_create ( )

1 if you want to create automatically the autocomplete DIV to fill with the the output of "autocomplete_file" or 0 if this DIV is created explicitly

Returns
this

Definition at line 215 of file icard.class.php.

216 {
218 }
$choice_create
$autocomplete : 1 enable - 0 disable

References $choice_create.

◆ get_fct()

ICard::get_fct ( )

Function javascript by default it is update_value called BEFORE the querystring is send in ajax.

Returns
type

Definition at line 184 of file icard.class.php.

185 {
186 return $this->fct;
187 }
$fct
< $fct ,by default it is update_value called BEFORE the querystring is send

References $fct.

◆ get_indicator()

ICard::get_indicator ( )

Id of the element to show that it is seaching.

Returns
type

Definition at line 205 of file icard.class.php.

206 {
207 return $this->indicator;
208 }
$indicator
$choice_create 1 , display a (+) button , default 1

References $indicator.

◆ get_limit()

ICard::get_limit ( )

Definition at line 243 of file icard.class.php.

244 {
245 return $this->limit;
246 }
$limit
$amount_from_type : accountancy , sell or purchase price

References $limit.

◆ get_style()

ICard::get_style ( )

CSS Style of the INPUT TEXT element.

Returns
type

Definition at line 231 of file icard.class.php.

232 {
233 return $this->style;
234 }
$style
$accvis account_visible =1 otherwise 0, default 1

References $style.

◆ get_typecard()

ICard::get_typecard ( )

Definition at line 256 of file icard.class.php.

257 {
258 return $this->typecard;
259 }
$typecard
$autocomplete_file , ajax file used for autocompletion (see Ajax.Autocompleter)

References $typecard.

◆ hide_accounting()

ICard::hide_accounting ( )

in the search box, the accounting will be hidden

Definition at line 387 of file icard.class.php.

388 {
389 $this->accvis=0;
390 }

◆ input()

ICard::input (   $p_name = null,
  $p_value = null 
)

show the html input of the widget

Definition at line 458 of file icard.class.php.

459 {
460 if ($p_name==null&&$this->name=="")
461 throw (new Exception(_('Le nom d une icard doit être donne')));
462 $this->value=($p_value==null)?$this->value:$p_value;
463 if ($this->readOnly==true)
464 return $this->display();
465
466 $this->id=($this->id=="")?$this->name:$this->id;
467 $this->choice=($this->choice==null)?sprintf("%s_choices", $this->id):$this->choice;
468 $this->indicator=($this->indicator==null)?sprintf("%s_ind", $this->id):$this->indicator;
469 $attr=$this->get_js_attr();
470
471 $label='';
472 if ($this->dblclick!='')
473 {
474 $e=sprintf(' ondblclick="%s" ', $this->dblclick);
475 $this->dblclick=$e;
476 }
477
478 $input='<div class="d-none d-lg-inline">'.
479 Icon_Action::clean_zone(uniqid("remove"),"$('{$this->id}').value=''").
480 "</div>";
481
482 $input.=sprintf('
483 <INPUT TYPE="Text" class="input_text icard"
484 NAME="%s" ID="%s" VALUE="%s" %s %s %s>',
485 $this->name, $this->id, $this->value,
486 $this->dblclick, $this->javascript, $this->style
487 );
488 if ($this->autocomplete==1)
489 {
490 // --- indicator
491 $this->indicator="ind_".$this->id;
492 $ind=sprintf('<span id="%s" class="autocomplete" style="position:absolute;display:none;margin-left:-20px"><img src="image/ajax-loader.gif" alt="Chargement..."/></span>',
493 $this->indicator);
494 // $this->indicator="null";
495
496 $div=($this->choice_create==1)?sprintf('<div id="%s" class="autocomplete"></div>',
497 $this->choice):"";
498
499 $query=http_build_query([ 'gDossier'=>Dossier::id(),'e'=>$this->typecard,'limit'=>$this->limit]);
500
501 $javascript=sprintf('try { new Ajax.Autocompleter("%s","%s","%s?%s",'.
502 '{paramName:"FID",minChars:1,indicator:%s, '.
503 'callback:%s, '.
504 'limit:%s,'.
505 ' afterUpdateElement:%s});} catch (e){alert(e.message);};',
506 $this->id, $this->choice, $this->autocomplete_file,$query, $this->indicator,
507 $this->callback, $this->limit, $this->fct);
508
509 $javascript=create_script($javascript.$this->dblclick);
510
511 $r=$label.$input.$attr.$ind.$div.$javascript;
512 }
513 else
514 {
515 $r=$label.$input;
516 }
517 if ($this->table==1)
518 $r=td($r);
519 return $r;
520 }
$input
$div
for($i=0;$i<=6;$i++) $ind
Definition: calendar.php:34
static id()
return the 'gDossier' value after a check
get_js_attr()
you can add attribute to this in javascript this function is a wrapper and create a script (in js) to...
display()
print in html the readonly value of the widget
static clean_zone($id, $p_javascript, $p_style="")
$all table
$icard readOnly
create_script($p_string)
create the HTML for adding the script tags around of the script

References $attr, $choice, $div, $e, $ind, $indicator, $input, HtmlInput\$javascript, HtmlInput\$label, $query, $r, Icon_Action\clean_zone(), create_script(), display(), HtmlInput\get_js_attr(), Dossier\id(), javascript, name, readOnly, style, table, td(), and value.

+ Here is the call graph for this function:

◆ ipopup()

static ICard::ipopup (   $p_name)
static

return the html string for creating the ipopup, this ipopup can be used for adding, modifying or display a card

Note
ipopup is obsolete, the popin is created by javascript
Parameters
$p_namename of the ipopup, must be set after with set_attribute
$f_add_button=new IButton('add_card');
$f_add_button->label='Créer une nouvelle fiche';
$f_add_button->set_attribute('ipopup','ipop_newcard');
$f_add_button->set_attribute('filter',$this->get_all_fiche_def ());
$f_add_button->javascript=" select_card_type(this);";
$str_add_button=$f_add_button->input();
Html Input.
Returns
html string
Note
must be one of first instruction on a new page, to avoid problem of position with IE

Definition at line 434 of file icard.class.php.

435 {
436 $ip_card=new IPopup($p_name);
437 $ip_card->drag=true;
438 $ip_card->set_width('45%');
439 $ip_card->title='Fiche ';
440 $ip_card->value='';
441
442 return $ip_card->input();
443 }
create a popup in html above the current layer the html inside the popup cannot contain any floating ...

◆ search()

ICard::search ( )

return a string containing the button for displaying a search form.

When clicking on the result, update the input text file the common used attribute as

  • jrn the ledger
  • label the field to update
  • name name of the input text
  • price amount
  • tvaid
  • typecard (deb, cred, filter or list of value) will be set if ICard is in readOnly, the button disappears, so the return string is empty
    // search ipopup
    $search_card=new IPopup('ipop_card');
    $search_card->title=_('Recherche de fiche');
    $search_card->value='';
    echo $search_card->input();
    $a=new ICard('test');
    $a->search();
    See also
    ajax_card.php
    Note
    the ipopup id is hard coded : ipop_card
    Returns
    HTML string with the button

Definition at line 561 of file icard.class.php.

562 {
563 if ($this->readOnly==true)
564 return '';
565 if (!isset($this->id))
566 $this->id=$this->name;
567 $a="";
568 foreach (array('typecard', 'jrn', 'label', 'price', 'tvaid', 'accvis','amount_from_type') as
569 $att)
570 {
571 if (isset($this->$att))
572 $a.="this.".$att."='".$this->$att."';";
573 }
574 if (isset($this->id)&&$this->id!="")
575 $a.="this.inp='".$this->id."';";
576 else
577 $a.="this.inp='".$this->name."';";
578 $a.="this.popup='ipop_card';";
579 $javascript=$a.' search_card(this);return false;';
580
581
583 return $button;
584 }
static button_magnifier($id, $p_javascript, $p_style="")
Display a icon with a magnify glass.

References $a, HtmlInput\$javascript, HtmlInput\$name, Icon_Action\button_magnifier(), and readOnly.

+ Here is the call graph for this function:

◆ set_accvis()

ICard::set_accvis (   $accvis)

Definition at line 330 of file icard.class.php.

331 {
332 $this->accvis=$accvis;
333 return $this;
334 }

References $accvis.

◆ set_amount_from_type()

ICard::set_amount_from_type (   $amount_from_type)

amount_from_type : accountancy , sell or purchase price @parameter $amount_from_type ACH VEN or GL

Definition at line 346 of file icard.class.php.

347 {
348 if ( ! in_array($amount_from_type,array("ACH","VEN","GL"))) {
349 throw new Exception('icard.305 '.sprintf("[%s]",$amount_from_type));
350 }
352 return $this;
353 }

References $amount_from_type, and amount_from_type.

◆ set_autocomplete()

ICard::set_autocomplete (   $autocomplete)

1 autocomplet enable ; 0 autocomplete disable

Returns
type

Definition at line 313 of file icard.class.php.

314 {
315 $this->autocomplete=$autocomplete;
316 return $this;
317 }

References $autocomplete.

◆ set_autocomplete_file()

ICard::set_autocomplete_file (   $autocomplete_file)

php file to call to complete info from the card

Parameters
string$autocomplete_file
See also
fid_card.php
Returns
$this

Definition at line 371 of file icard.class.php.

372 {
373 $this->autocomplete_file=$autocomplete_file;
374 return $this;
375 }

References $autocomplete_file.

◆ set_callback()

ICard::set_callback (   $p_name)

set the javascript callback function by default it is update_value called BEFORE the querystring is send

Parameters
$p_namecallback function name

Definition at line 400 of file icard.class.php.

401 {
402 $this->callback=$p_name;
403 }

◆ set_choice()

ICard::set_choice (   $choice)

id_of_div_to_populate with the output of the autocomplete_file, it is the autocomplete div presenting a list of possible choices.

Default {this->id}_choices

Returns
html string (

Definition at line 285 of file icard.class.php.

286 {
287 $this->choice=$choice;
288 return $this;
289 }

References $choice.

◆ set_choice_create()

ICard::set_choice_create (   $choice_create)

1 if you want to create automatically the autocomplete DIV to fill with the the output of "autocomplete_file" or 0 if this DIV is created explicitly

Returns
this

Definition at line 304 of file icard.class.php.

305 {
306 $this->choice_create=$choice_create;
307 return $this;
308 }

References $choice_create.

◆ set_dblclick()

ICard::set_dblclick (   $p_action)

set the extra javascript property for a double click on INPUT field

Parameters
$p_actionaction when a double click happens
Note
the $p_action cannot contain a double quote

Definition at line 451 of file icard.class.php.

452 {
453 $this->dblclick=$p_action;
454 }
if(! isset($_GET['submit_query'])) $p_action

References $p_action.

◆ set_fct()

ICard::set_fct (   $fct)

Definition at line 274 of file icard.class.php.

275 {
276 $this->fct=$fct;
277 return $this;
278 }

References $fct.

◆ set_function()

ICard::set_function (   $p_name)

set the javascript callback function by default it is update_value called AFTER an item has been selected

Parameters
$p_namecallback function name

Definition at line 410 of file icard.class.php.

411 {
412 $this->fct=$p_name;
413 }

◆ set_indicator()

ICard::set_indicator (   $indicator)

Id of the element to show that it is seaching.

Definition at line 293 of file icard.class.php.

294 {
295 $this->indicator=$indicator;
296 return $this;
297 }

References $indicator.

◆ set_limit()

ICard::set_limit (   $limit)

Definition at line 336 of file icard.class.php.

337 {
338 $this->limit=$limit;
339 return $this;
340 }

References $limit.

◆ set_style()

ICard::set_style (   $style)

CSS Style of the INPUT TEXT element.

Returns
type

Definition at line 322 of file icard.class.php.

323 {
324 $this->style=$style;
325 return $this;
326 }

References $style, and style.

◆ set_typecard()

ICard::set_typecard (   $typecard)

argument "e" passed to autocomplete_file ,

See also
fid_card.php
Parameters
type$typecard
Returns
$this

Definition at line 360 of file icard.class.php.

361 {
362 $this->typecard=$typecard;
363 return $this;
364 }

References $typecard.

◆ show_accounting()

ICard::show_accounting ( )

in the search box, the accounting will be shown it is the default

Definition at line 380 of file icard.class.php.

380 {
381 $this->accvis=1;
382 }

◆ test_me()

static ICard::test_me ( )
static

Definition at line 586 of file icard.class.php.

587 {
588 $_SESSION[SESSION_KEY.'isValid']=1;
589 $a=new ICard('testme');
590 $a->extra="all";
591 $a->set_attribute('label', 'ctl_label');
592 $a->set_attribute('tvaid', 'ctl_tvaid');
593 $a->set_attribute('price', 'ctl_price');
594 $a->set_attribute('purchase', 'ctl_purchase');
595 $a->set_attribute('type', 'all');
596 echo <<<EOF
597 <div id="debug" style="border:solid 1px black;overflow:auto"></div>
598 <script type="text/javascript" language="javascript" src="js/prototype.js">
599 </script>
600 <script type="text/javascript" language="javascript" src="js/scriptaculous.js">
601 </script>
602 <script type="text/javascript" language="javascript" src="js/effects.js">
603 </script>
604 <script type="text/javascript" language="javascript" src="js/controls.js">
605 </script>
606 <script type="text/javascript" language="javascript" src="js/ajax_fid.js">
607 </script>
608 <script type="text/javascript" language="javascript" >
609 function test_value(text,li)
610 {
611 alert("premier"+li.id);
612
613 str="";
614 str=text.id+'<hr>';
615 if ( text.js_attr1)
616 {
617 str+=text.js_attr1;
618 str+='<hr>';
619 }
620 if ( text.js_attr2)
621 {
622 str+=text.js_attr2;
623 str+='<hr>';
624 }
625 if ( text.js_attr3)
626 {
627 str+=text.js_attr3;
628 str+='<hr>';
629 }
630 for (var i in text)
631 {
632 str+=i+'<br>';
633 }
634
635 // $('debug').innerHTML=str;
636 ajaxFid(text);
637 }
638 </script>
639
640EOF;
641 echo "<form>";
642 $l=new IText('ctl_label');
643 $t=new IText('ctl_tvaid');
644 $p=new IText('ctl_price');
645 $b=new IText('ctl_purchase');
646
647 echo "Label ".$l->input().'<br>';
648 echo "Tva id ".$t->input().'<br>';
649 echo "Price ".$p->input().'<br>';
650 echo "Purchase ".$b->input().'<br>';
651
652 if (isset($_REQUEST['test_select']))
653 echo HtmlInput::hidden('test_select', $_REQUEST['test_select']);
654 $a->set_function('test_value');
655 $a->javascript=' onchange="alert(\'onchange\');" onblur="alert(\'onblur\');" ';
656 echo $a->input();
657 echo dossier::hidden();
658 echo HtmlInput::submit('Entree', 'entree');
659 echo '</form>';
660 echo <<<EOF
661EOF;
662 }
alert($p_msg, $buffer=false)
alert in javascript
Definition: ac_common.php:738
$_REQUEST['ac']
$p
Definition: array.php:34
$input_from type
Definition: balance.inc.php:65
static hidden($p_name, $p_value, $p_id="")
static submit($p_name, $p_value, $p_javascript="", $p_class="smallbutton")
Html Input.
Definition: itext.class.php:30

References $_REQUEST, $a, $b, $l, $p, alert(), HtmlInput\hidden(), style, HtmlInput\submit(), and type.

+ Here is the call graph for this function:

Field Documentation

◆ $accvis

ICard::$accvis

$limit Max of row show

Definition at line 147 of file icard.class.php.

Referenced by get_accvis(), and set_accvis().

◆ $amount_from_type

ICard::$amount_from_type

$typecard : type of card

Definition at line 153 of file icard.class.php.

Referenced by get_amount_from_type(), and set_amount_from_type().

◆ $autocomplete

ICard::$autocomplete

$style supplemental CSS

Definition at line 141 of file icard.class.php.

Referenced by get_autocomplete(), and set_autocomplete().

◆ $autocomplete_file

ICard::$autocomplete_file
private

Definition at line 159 of file icard.class.php.

Referenced by get_autocomplete_file(), and set_autocomplete_file().

◆ $callback

ICard::$callback

$choice

Definition at line 129 of file icard.class.php.

◆ $choice

ICard::$choice

$indicator, text displaid when searching

Definition at line 132 of file icard.class.php.

Referenced by get_choice(), input(), and set_choice().

◆ $choice_create

ICard::$choice_create

$autocomplete : 1 enable - 0 disable

Definition at line 138 of file icard.class.php.

Referenced by get_choice_create(), and set_choice_create().

◆ $dblclick

ICard::$dblclick

$callback ,

Definition at line 126 of file icard.class.php.

◆ $fct

ICard::$fct

< $fct ,by default it is update_value called BEFORE the querystring is send

$dblclick action if double click

Definition at line 123 of file icard.class.php.

Referenced by get_fct(), and set_fct().

◆ $indicator

ICard::$indicator

$choice_create 1 , display a (+) button , default 1

Definition at line 135 of file icard.class.php.

Referenced by get_indicator(), input(), and set_indicator().

◆ $limit

ICard::$limit

$amount_from_type : accountancy , sell or purchase price

Definition at line 150 of file icard.class.php.

Referenced by get_limit(), and set_limit().

◆ $style

ICard::$style =' '

$accvis account_visible =1 otherwise 0, default 1

Definition at line 144 of file icard.class.php.

Referenced by get_style(), and set_style().

◆ $typecard

ICard::$typecard

$autocomplete_file , ajax file used for autocompletion (see Ajax.Autocompleter)

Definition at line 156 of file icard.class.php.

Referenced by get_typecard(), and set_typecard().


The documentation for this class was generated from the following file: