noalyss Version-10
NOALYSS : serveur de comptabilité et ERP (2002)
Loading...
Searching...
No Matches
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
 
 get_accvis ()
 $accvis account_visible =1 otherwise 0, default 1
 
 get_amount_from_type ()
 amount_from_type : accountancy , sell or purchase price
 
 get_autocomplete ()
 1 autocomplete enable ; 0 autocomplete disable
 
 get_autocomplete_file ()
 php file to call to complete info from the card
 
 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.
 
 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
 
 get_fct ()
 Function javascript by default it is update_value called BEFORE the querystring is send in ajax.
 
 get_indicator ()
 Id of the element to show that it is seaching.
 
 get_limit ()
 
 get_style ()
 CSS Style of the INPUT TEXT element.
 
 get_typecard ()
 
 getAfter_clean ()
 
 hide_accounting ()
 in the search box, the accounting will be hidden
 
 input ($p_name=null, $p_value=null)
 show the html input of the widget
 
 search ()
 return a string containing the button for displaying a search form.
 
 set_accvis ($accvis)
 $accvis account_visible =1 otherwise 0, default 1
 
 set_amount_from_type ($amount_from_type)
 amount_from_type : accountancy , sell or purchase price @parameter $amount_from_type ACH VEN or GL
 
 set_autocomplete ($autocomplete)
 1 autocomplet enable ; 0 autocomplete disable
 
 set_autocomplete_file ($autocomplete_file)
 php file to call to complete info from the card
 
 set_callback ($p_name)
 set the javascript callback function by default it is update_value called BEFORE the querystring is send
 
 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.
 
 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
 
 set_dblclick ($p_action)
 set the extra javascript property for a double click on INPUT field
 
 set_fct ($fct)
 Function javascript by default it is update_value called BEFORE the querystring is send in ajax.
 
 set_function ($p_name)
 set the javascript callback function by default it is update_value called AFTER an item has been selected
 
 set_indicator ($indicator)
 Id of the element to show that it is seaching.
 
 set_limit ($limit)
 
 set_style ($style)
 CSS Style of the INPUT TEXT element.
 
 set_typecard ($typecard)
 argument "e" passed to autocomplete_file ,
 
 setAfter_clean ($after_clean)
 
 show_accounting ()
 in the search box, the accounting will be shown it is the default
 
- Public Member Functions inherited from HtmlInput
 __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.
 
 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">
 
 get_placeholder ()
 
 get_value ()
 Return the value of input (IText, INum,...)
 
 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.
 
 set_attribute ($p_name, $p_value)
 add an HTML attribute for the INPUT field
 
 set_placeholder ($placeholder)
 set HTML placeholder attribut
 
 set_value ($p_string)
 Set the value of input (IText, INum,...)
 
 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
 
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 LINK 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.
 
static anchor_action ($action, $javascript, $id=NULL, $p_class="button", $p_symbole="")
 Anchor Html with javascript.
 
static anchor_close ($div, $p_js="")
 Return a html string with an anchor which close the inside popup.
 
static anchor_empty ($p_text, $p_id, $p_title="")
 let you create only a link and set an id on it.
 
static anchor_hide ($action, $javascript)
 Return a html string with an anchor to hide a div, put it in the right corner.
 
static array_to_hidden ($array, $global_array)
 transform request data to hidden
 
static array_to_string ($array, $global_array, $start="?")
 transform request data to string
 
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
 
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
 
static button_choice_ledger ($p_array)
 
static button_close ($div_name, $class='smallbutton')
 close button for the HTML popup
 
static button_hide ($div_name, $class='smallbutton')
 Hide the HTML popup.
 
static button_image ($javascript, $id="xx", $p_class='class="button"', $p_image="")
 button Html image
 
static calendar_zoom ($obj)
 Zoom the calendar.
 
static card_detail ($p_qcode, $pname='', $p_style="", $p_nohistory=false, $nofollowup=false)
 show the detail of a card
 
static default_value ($ind, $default, $array)
 return default if the value if the value doesn't exist in the array
 
static default_value_get ($ind, $default)
 return default if the value if the value doesn't exist in $_GET use HttpInput instead
 
static default_value_post ($ind, $default)
 return default if the value if the value doesn't exist in $_POST use HttpInput instead
 
static default_value_request ($ind, $default)
 return default if the value if the value doesn't exist in $_REQUEST use HttpInput instead
 
static detail_action ($ag_id, $p_mesg, $p_modify=1)
 return an anchor to view the detail of an action
 
static detail_modele_document_deprecated ($p_id, $p_mesg)
 return a string containing the html code for calling the modifyModeleDocument
 
static detail_op ($p_jr_id, $p_mesg)
 return a string containing the html code for calling the modifyOperation
 
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.
 
static filter_table ($p_table_id, $p_col, $start_row)
 filter the rows in a table and keep the colored row in alternance
 
static filter_table_DOM ($p_table_id, $p_col, $start_row, $p_name, $domid)
 filter the rows in a table and keep the colored row in alternance
 
static filter_table_form ($p_table_id, $p_col, $start_row, $p_name, $p_old_value)
 filter the rows in a table and keep the colored row in alternance
 
static followup_card_button ($f_id, $p_mesg)
 display a div with the history of the card
 
static generate_id ($p_prefix)
 generate an unique id for a widget,
 
static get_to_hidden ($array)
 transform $_GET data to hidden
 
static get_to_string ($array, $start="?")
 transform $_GET data to string
 
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
 
static history_anc_account ($p_account, $p_mesg, $p_style="", $p_exercice="")
 display a div with the history of the analytic account
 
static history_card ($f_id, $p_mesg, $p_style="", $p_exercice="")
 display a div with the history of the card
 
static history_card_button ($f_id, $p_mesg, $p_exercice="")
 display a div with the history of the card
 
static image_click ($p_image, $p_js, $p_message, $p_class="")
 Image to click ,.
 
static json_to_hidden ($p_json)
 transform a json to hidden
 
static post_to_hidden ($array)
 transform $_POST data to hidden
 
static post_to_string ($array)
 transform $_POST data to string
 
static print_window ()
 Javascript to print the current window.
 
static remove_stock ($p_id, $p_mesg)
 return a string containing the html code for calling the removeStock
 
static request_to_hidden (array $array)
 transform $_REQUEST data to hidden
 
static request_to_string ($array, $start="?")
 transform $_REQUEST data to string
 
static reset ($p_value, $p_class="smallbutton")
 
static select_cat ($array_cat)
 create a hidden plus button to select the cat of ledger
 
static select_stock ($p_cn, $p_name, $p_mode)
 Create an ISelect object containing the available repository for reading or writing.
 
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.
 
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;.
 
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', $raw="", $refresh='')
 Title for boxes, you can customize the symbol thanks symbol with the mode "custom".
 
static warnbulle ($p_comment)
 

Data Fields

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

Protected Attributes

 $after_clean
 javascript to call after cleaning the INPUT TEXT
 

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 :

  • label is the label in the button
  • extra contents the type (all, deb or cred, a list of FD_ID between parent. or a SQL clause
  • attribute are the attribute to set (via ajax). The ledger is either a attribute (jrn) or a hidden field in the document, if none are set, there is no filter on the ledger
    Note
    you must in a hidden field gDossier (dossier::hidden)
    See also
    ajaxFid
    card.js
    fid.php
    fid_card.php
    ajax_card.php
    Set the hidden field or input field to be set by javascript with the function set_attribute call the input method. After selecting a value the update_value function is called. If you need to modify the queryString before the request is sent, you'll use the set_callback; the first parameter is the INPUT field and the second the queryString, the function must returns a queryString
    // insert all the javascript files
    echo js_include('prototype.js');
    echo js_include('scriptaculous.js');
    echo js_include('effects.js');
    echo js_include('controls.js');
    //
    $W1=new ICard();
    $W1->label="Client ".Icon_Action::infobulle(0) ;
    $W1->name="e_client";
    $W1->tabindex=3;
    $W1->value=$e_client;
    $W1->table=0;
    // If double click call the javascript fill_ipopcard
    $W1->set_dblclick("fill_ipopcard(this);");
    // Type of card : deb, cred or all
    $W1->set_attribute('typecard','deb');
    $W1->extra='deb';
    O
    // Add the callback function to filter the card on the jrn
    $W1->set_callback('filter_card');
    // when value selected in the autcomplete
    $W1->set_function('fill_data');
    // when the data change
    $W1->javascript=sprintf(' onchange="fill_data_onchange(\'%s\');" ',
    $W1->name);
    // name of the field to update with the name of the card
    $W1->set_attribute('label','e_client_label');
    $client_label=new ISpan();
    $client_label->table=0;
    $f_client=$client_label->input("e_client_label",$e_client_label);
    $f_client_qcode=$W1->input();
    // Search button for card
    $f_client_bt=$W1->search();
    Input HTML for the card show buttons, in the file, you have to add card.js How to use :
    Html Input.
    js_include($p_string)
    create the HTML for including of a javascript file if a file is included twice, the second time it wi...
    For searching a card, you need a popup, the script card.js and set the values for card, popup filter_card callback
    $card=new ICard('acc');
    $card->name="acc";
    $card->extra="all";
    $card->set_attribute('typecard','all');
    $card->set_callback('filter_card');
    echo $card->input();
    echo $card->search();
    // example 2
    $w=new ICard("av_text".$attr->ad_id);
    // filter on frd_id
    $sql=' select fd_id from fiche_def where frd_id in ('.FICHE_TYPE_CLIENT.','.FICHE_TYPE_FOURNISSEUR.','.FICHE_TYPE_ADM_TAX.')';
    $filter=$this->cn->make_list($sql);
    $w->set_attribute('ipopup','ipopcard');
    $w->set_attribute('typecard',$filter);
    $w->set_attribute('inp',"av_text".$attr->ad_id);
    $w->set_attribute('label',"av_text".$attr->ad_id."_label");
    $w->extra=$filter;
    $w->extra2=0;
    $label=new ISpan();
    $label->name="av_text".$attr->ad_id."_label";
    $msg.=td($w->search().$label->input());
    td($p_string='', $p_extra='')
    surround the string with td
    Definition ac_common.php:83
    foreach($array as $idx=> $m) $w
    $input_from cn
    const FICHE_TYPE_ADM_TAX
    Definition constant.php:265
    const FICHE_TYPE_FOURNISSEUR
    Definition constant.php:261

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 162 of file icard.class.php.

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

539 {
540 $r=sprintf(' <INPUT TYPE="hidden" NAME="%s" id="%s" VALUE="%s" SIZE="8">',
541 $this->name, $this->name, $this->value
542 );
543 $r.='<span>'.$this->value.'</span>';
544 return $r;
545 }
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 ( )

$accvis account_visible =1 otherwise 0, default 1

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

252 {
253 return $this->accvis;
254 }
$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 264 of file icard.class.php.

265 {
267 }
$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 236 of file icard.class.php.

237 {
238 return $this->autocomplete;
239 }
$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 279 of file icard.class.php.

280 {
282 }
$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 207 of file icard.class.php.

208 {
209 if ( $this->choice==null) {
210 return sprintf("%s_choices", $this->id);
211 }
212 return $this->choice;
213 }
$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 228 of file icard.class.php.

229 {
231 }
$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 197 of file icard.class.php.

198 {
199 return $this->fct;
200 }
$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 218 of file icard.class.php.

219 {
220 return $this->indicator;
221 }
$indicator
$choice_create 1 , display a (+) button , default 1

References $indicator.

◆ get_limit()

ICard::get_limit ( )

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

257 {
258 return $this->limit;
259 }
$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 244 of file icard.class.php.

245 {
246 return $this->style;
247 }
$style
$accvis account_visible =1 otherwise 0, default 1

References $style.

◆ get_typecard()

ICard::get_typecard ( )

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

270 {
271 return $this->typecard;
272 }
$typecard
$autocomplete_file , ajax file used for autocompletion (see Ajax.Autocompleter)

References $typecard.

◆ getAfter_clean()

ICard::getAfter_clean ( )

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

183 {
184 return $this->after_clean;
185 }
$after_clean
javascript to call after cleaning the INPUT TEXT

References $after_clean.

◆ hide_accounting()

ICard::hide_accounting ( )

in the search box, the accounting will be hidden

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

401 {
402 $this->accvis=0;
403 }

◆ input()

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

show the html input of the widget

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

472 {
473 if ($p_name==null&&$this->name=="")
474 throw (new Exception(_('Le nom d une icard doit être donne')));
475 $this->value=($p_value==null)?$this->value:$p_value;
476 if ($this->readOnly==true)
477 return $this->display();
478
479 $this->id=($this->id=="")?$this->name:$this->id;
480 $this->choice=($this->choice==null)?sprintf("%s_choices", $this->id):$this->choice;
481 $this->indicator=($this->indicator==null)?sprintf("%s_ind", $this->id):$this->indicator;
482 $attr=$this->get_js_attr();
483
484 $label='';
485 if ($this->dblclick!='')
486 {
487 $e=sprintf(' ondblclick="%s" ', $this->dblclick);
488 $this->dblclick=$e;
489 }
490
491 $input='<div class="d-none d-lg-inline">'.
492 Icon_Action::clean_zone(uniqid("remove"),"clean_Fid('{$this->id}');{$this->after_clean}").
493 "</div>";
494
495 $input.=sprintf('
496 <INPUT TYPE="Text" class="input_text icard"
497 NAME="%s" ID="%s" VALUE="%s" %s %s %s>',
498 $this->name, $this->id, $this->value,
499 $this->dblclick, $this->javascript, $this->style
500 );
501 if ($this->autocomplete==1)
502 {
503 // --- indicator
504 $this->indicator="ind_".$this->id;
505 $ind=sprintf('<span id="%s" class="autocomplete" style="position:absolute;display:none;margin-left:-20px"><img src="image/ajax-loader.gif" alt="Chargement..."/></span>',
506 $this->indicator);
507 // $this->indicator="null";
508
509 $div=($this->choice_create==1)?sprintf('<div id="%s" class="autocomplete"></div>',
510 $this->choice):"";
511
512 $query=http_build_query([ 'gDossier'=>Dossier::id(),'e'=>$this->typecard,'limit'=>$this->limit]);
513
514 $javascript=sprintf('try { new Ajax.Autocompleter("%s","%s","%s?%s",'.
515 '{paramName:"FID",minChars:1,indicator:%s, '.
516 'callback:%s, '.
517 'limit:%s,'.
518 ' afterUpdateElement:%s});} catch (e){alert(e.message);};',
519 $this->id, $this->choice, $this->autocomplete_file,$query, $this->indicator,
520 $this->callback, $this->limit, $this->fct);
521
522 $javascript=create_script($javascript.$this->dblclick);
523
524 $r=$label.$input.$attr.$ind.$div.$javascript;
525 }
526 else
527 {
528 $r=$label.$input;
529 }
530 if ($this->table==1)
531 $r=td($r);
532 return $r;
533 }
$input_from id
_("actif, passif,charge,...")
for($i=0;$i<=6;$i++) $ind
Definition calendar.php:55
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, HtmlInput\$id, $ind, $indicator, $input, HtmlInput\$javascript, HtmlInput\$label, $query, $r, _, Icon_Action\clean_zone(), create_script(), display(), HtmlInput\get_js_attr(), 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 447 of file icard.class.php.

448 {
449 $ip_card=new IPopup($p_name);
450 $ip_card->drag=true;
451 $ip_card->set_width('45%');
452 $ip_card->title='Fiche ';
453 $ip_card->value='';
454
455 return $ip_card->input();
456 }

◆ 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();
    create a popup in html above the current layer the html inside the popup cannot contain any floating ...
    See also
    ajax_card.php
    Note
    the ipopup id is hard coded : ipop_card
    Returns
    HTML string with the button

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

575 {
576 if ($this->readOnly==true)
577 return '';
578 if (!isset($this->id))
579 $this->id=$this->name;
580 $a="";
581 foreach (array('typecard', 'jrn', 'label', 'price', 'tvaid', 'accvis','amount_from_type') as
582 $att)
583 {
584 if (isset($this->$att))
585 $a.="this.".$att."='".$this->$att."';";
586 }
587 if (isset($this->id)&&$this->id!="")
588 $a.="this.inp='".$this->id."';";
589 else
590 $a.="this.inp='".$this->name."';";
591 $a.="this.popup='ipop_card';";
592 $javascript=$a.' search_card(this);return false;';
593
594
596 return $button;
597 }
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)

$accvis account_visible =1 otherwise 0, default 1

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

344 {
345 $this->accvis=$accvis;
346 return $this;
347 }

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 359 of file icard.class.php.

360 {
361 if ( ! in_array($amount_from_type,array("ACH","VEN","GL"))) {
362 throw new Exception('icard.305 '.sprintf("[%s]",$amount_from_type));
363 }
365 return $this;
366 }

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 326 of file icard.class.php.

327 {
328 $this->autocomplete=$autocomplete;
329 return $this;
330 }

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 384 of file icard.class.php.

385 {
386 $this->autocomplete_file=$autocomplete_file;
387 return $this;
388 }

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 413 of file icard.class.php.

414 {
415 $this->callback=$p_name;
416 }

◆ 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 298 of file icard.class.php.

299 {
300 $this->choice=$choice;
301 return $this;
302 }

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 317 of file icard.class.php.

318 {
319 $this->choice_create=$choice_create;
320 return $this;
321 }

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 464 of file icard.class.php.

465 {
466 $this->dblclick=$p_action;
467 }
if(! isset($_GET['submit_query'])) $p_action

References $p_action.

◆ set_fct()

ICard::set_fct ( $fct)

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

See also
afterUpdateElement

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

288 {
289 $this->fct=$fct;
290 return $this;
291 }

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 423 of file icard.class.php.

424 {
425 $this->fct=$p_name;
426 }

◆ set_indicator()

ICard::set_indicator ( $indicator)

Id of the element to show that it is seaching.

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

307 {
308 $this->indicator=$indicator;
309 return $this;
310 }

References $indicator.

◆ set_limit()

ICard::set_limit ( $limit)

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

350 {
351 $this->limit=$limit;
352 return $this;
353 }

References $limit.

◆ set_style()

ICard::set_style ( $style)

CSS Style of the INPUT TEXT element.

Returns
type

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

336 {
337 $this->style=$style;
338 return $this;
339 }

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 373 of file icard.class.php.

374 {
375 $this->typecard=$typecard;
376 return $this;
377 }

References $typecard.

◆ setAfter_clean()

ICard::setAfter_clean ( $after_clean)

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

188 {
189 $this->after_clean = $after_clean;
190 return $this;
191 }

References $after_clean.

◆ show_accounting()

ICard::show_accounting ( )

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

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

393 {
394 $this->accvis=1;
395 }

◆ test_me()

static ICard::test_me ( )
static

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

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

References $_REQUEST, $a, $b, $l, $p, $t, 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().

◆ $after_clean

ICard::$after_clean
protected

javascript to call after cleaning the INPUT TEXT

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

Referenced by getAfter_clean(), and setAfter_clean().

◆ $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: