noalyss Version-9
Public Member Functions | Static Public Member Functions
IAncCard Class Reference

HtmlInput for card of analytic accountancy. More...

+ Inheritance diagram for IAncCard:
+ Collaboration diagram for IAncCard:

Public Member Functions

 __construct ($name="", $value="", $p_id="")
 
 display ()
 print in html the readonly value of the widget 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_callback ($p_name)
 set the javascript callback function by default it is update_value called BEFORE the querystring is send If you use the plan ctl must be set to filter_anc More...
 
 set_dblclick ($p_action)
 set the extra javascript property for a double click on INPUT field More...
 
 set_function ($p_name)
 set the javascript callback function by default it is update_value called AFTER an item has been selected 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 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)
 

Additional Inherited Members

- 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
 

Detailed Description

HtmlInput for card of analytic accountancy.

Definition at line 33 of file ianccard.class.php.

Constructor & Destructor Documentation

◆ __construct()

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

Reimplemented from HtmlInput.

Definition at line 35 of file ianccard.class.php.

36 {
37 parent::__construct($name,$value,$p_id);
38 $this->fct='update_value';
39 $this->dblclick='';
40 $this->callback='null';
41 $this->javascript='';
42 // the pa_id to filter
43 $this->plan=0;
44 // or the container of the Plan Analytic which contains the pa_id
45 $this->plan_ctl="";
46 }
$ret javascript

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

Member Function Documentation

◆ display()

IAncCard::display ( )

print in html the readonly value of the widget

Definition at line 139 of file ianccard.class.php.

140 {
141 $r=sprintf('
142 <INPUT TYPE="hidden" NAME="%s" VALUE="%s" SIZE="8">',
143 $this->name,
144 $this->value
145 );
146 $r.='<span>'.$this->value.'</span>';
147 return $r;
148
149 }
catch(Exception $exc) if(! $g_user->can_write_action($ag_id)) $r
$from_poste name

References $r, name, and value.

Referenced by input().

◆ input()

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

show the html input of the widget

Definition at line 76 of file ianccard.class.php.

77 {
78 if ( $p_name == null && $this->name == "")
79 throw (new Exception(_('Le nom d une icard doit ĂȘtre donnĂ©')));
80
81 $this->value=($p_value==null)?$this->value:$p_value;
82 if ( $this->readOnly==true) return $this->display();
83
84 $this->id=($this->id=="")?$this->name:$this->id;
85
86
87
88 $label='';
89 if ( $this->dblclick != '')
90 {
91 $e=sprintf(' ondblclick="%s" ',
92 $this->dblclick);
93 $this->dblclick=$e;
94 }
95 $input=sprintf('<INPUT TYPE="Text" class="input_text" '.
96 ' NAME="%s" ID="%s" VALUE="%s" SIZE="%d" %s %s>',
97 $this->name,
98 $this->name,
99 $this->value,
100 $this->size,
101 $this->dblclick,
102 $this->javascript
103 );
104
105
106 $div=sprintf('<div id="%s_choices" class="autocomplete"></div>',
107 $this->name);
108 $query="op=autoanc&".dossier::get();
109
110 // add parameter to search into a plan (pa_id) or get the value from
111 // a HtmlObject
112 if ($this->plan <> 0)
113 {
114 $query.="&pa_id=".$this->plan;
115 } elseif ( $this->plan_ctl <> '')
116 {
117 $this->set_attribute("plan_ctl", $this->plan_ctl);
118 }
119 $attr=$this->get_js_attr();
120 $javascript=sprintf('try { new Ajax.Autocompleter("%s","%s_choices","ajax_misc.php?%s",'.
121 '{paramName:"anccard",minChars:1,indicator:null, '.
122 'callback:%s, '.
123 ' afterUpdateElement:%s});} catch (e){alert(e.message);};',
124 $this->name,
125 $this->name,
126 $query,
127 $this->callback,
128 $this->fct);
129
130 $javascript=create_script($javascript.$this->dblclick);
131
132 $r=$label.$input.$attr.$div.$javascript;
133 if ( $this->table == 1 )
134 $r=td($r);
135 return $r;
136
137 }
td($p_string='', $p_extra='')
surround the string with td
Definition: ac_common.php:83
$input
$div
$name size
set_attribute($p_name, $p_value)
set the extra javascript property for the INPUT field
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
$all table
$icard readOnly
create_script($p_string)
create the HTML for adding the script tags around of the script
if( $delta< 0) elseif( $delta==0)

References $attr, $div, $e, $input, HtmlInput\$javascript, HtmlInput\$label, $query, $r, create_script(), display(), elseif, HtmlInput\get_js_attr(), javascript, name, readOnly, HtmlInput\set_attribute(), size, table, td(), and value.

+ Here is the call graph for this function:

◆ search()

IAncCard::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();
    Input HTML for the card show buttons, in the file, you have to add card.js How to use :
    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 177 of file ianccard.class.php.

178 {
179 if ( $this->readOnly==true) return '';
180
181 $button=new IButton($this->name.'_bt');
182 $a="";
183 foreach (array('typecard','jrn','label','price','tvaid') as $att)
184 {
185 if (isset($this->$att) )
186 $a.="this.".$att."='".$this->$att."';";
187 }
188 if (isset($this->name))
189 $a.="this.inp='".$this->name."';";
190 $a.="this.popup='ipop_card';";
191
192 $button->javascript=$a.' search_card(this)';
193 return $button->input();
194 }
Html Input.

References $a, name, and readOnly.

◆ set_callback()

IAncCard::set_callback (   $p_name)

set the javascript callback function by default it is update_value called BEFORE the querystring is send If you use the plan ctl must be set to filter_anc

Parameters
$p_namecallback function name

Definition at line 52 of file ianccard.class.php.

53 {
54 $this->callback=$p_name;
55 }

◆ set_dblclick()

IAncCard::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 71 of file ianccard.class.php.

72 {
73 $this->dblclick=$p_action;
74 }
if(! isset($_GET['submit_query'])) $p_action

References $p_action.

◆ set_function()

IAncCard::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 61 of file ianccard.class.php.

62 {
63 $this->fct=$p_name;
64 }

◆ test_me()

static IAncCard::test_me ( )
static

Definition at line 196 of file ianccard.class.php.

197 {
198
199 }

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