noalyss  Version-9
Public Member Functions | Data Fields
INum Class Reference

This class handles only the numeric input, the input will call a javascript to change comma to period and will round it (2 decimal), the precision is given by the attribute prec attribute extra = extra code (free) size = size of the field prec = precision default = 2 name = name of the html object javascript = javascript to execute (default = onchange="format_number(this,2);) value = value of the widget. More...

+ Inheritance diagram for INum:
+ Collaboration diagram for INum:

Public Member Functions

 __construct ($name='', $value='', $id="")
 
 change ($p_js_update="")
 like inplace_edit but without the ajax call, the INPUT text will be changed but not submitted @parameter $p_js_update optionnal script to execute if we update the fied More...
 
 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...
 
- Public Member Functions inherited from IText
 set_require ($p_boolean)
 
- Public Member Functions inherited from HtmlInput
 debug ()
 
 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)
 

Data Fields

 $prec
 decimal More...
 
- Data Fields inherited from IText
 $autofocus
 
 $placeholder
 
 $title
 
- Data Fields inherited from HtmlInput
 $ctrl
 
 $disabled
 
 $extra
 
 $extra2
 
 $javascript
 
 $label
 
 $name
 
 $readOnly
 
 $selected
 
 $size
 
 $tabindex
 
 $table
 
 $type
 
 $value
 

Additional Inherited Members

- Static Public Member Functions inherited from IText
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")
 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)
 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)
 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. 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 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)
 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)
 

Detailed Description

This class handles only the numeric input, the input will call a javascript to change comma to period and will round it (2 decimal), the precision is given by the attribute prec attribute extra = extra code (free) size = size of the field prec = precision default = 2 name = name of the html object javascript = javascript to execute (default = onchange="format_number(this,2);) value = value of the widget.

Definition at line 41 of file inum.class.php.

Constructor & Destructor Documentation

◆ __construct()

INum::__construct (   $name = '',
  $value = '',
  $id = "" 
)

Reimplemented from IText.

Definition at line 44 of file inum.class.php.

45  {
46  parent::__construct($name, $value, $id);
47 
48  $this->size=9;
49  $this->style='class="inum"';
50  $this->javascript='onchange="format_number(this,2);"';
51  }

References $id, HtmlInput\$name, HtmlInput\$value, javascript, size, and style.

Member Function Documentation

◆ change()

INum::change (   $p_js_update = "")

like inplace_edit but without the ajax call, the INPUT text will be changed but not submitted @parameter $p_js_update optionnal script to execute if we update the fied

Returns
string

Definition at line 121 of file inum.class.php.

122  {
123  if ( $this->id=="") {
124  $this->id=uniqid();
125  }
126  $id_read=sprintf("x1_span_%s",$this->id);
127  $id_input=sprintf("x2_span_%s",$this->id);
128 
129  $p_javascript_read=sprintf("$('%s').hide();$('%s').show();",
130  $id_read,$id_input);
131 
132  $p_javascript_input=sprintf("$('%s').hide();$('%s').show();",
133  $id_input,$id_read);
134 
135  $p_javascript_update=sprintf("$('update_%s').innerHTML=$('%s').value;$('%s').hide();$('%s').show();$p_js_update",
136  $this->id,
137  $this->id,
138  $id_input,$id_read);
139 
140  $r=sprintf('<span id="%s">',$id_read);
141  $r.=sprintf('<span id="update_%s">',$this->id).$this->value.'</span>';
142  $r.=Icon_Action::modify(uniqid(), $p_javascript_read);
143  $r.='</span>';
144 
145  $r.=sprintf('<span id="%s" style="display:none">',$id_input);
146  $r.=$this->input();
147  $r.=Icon_Action::validate(uniqid(), $p_javascript_update);
148  $r.=Icon_Action::cancel(uniqid(), $p_javascript_input);
149  $r.='</span>';
150  return $r;
151 
152  }

References $r, Icon_Action\cancel(), input(), Icon_Action\modify(), and Icon_Action\validate().

+ Here is the call graph for this function:

◆ display()

INum::display ( )

print in html the readonly value of the widget

Reimplemented from IText.

Definition at line 55 of file inum.class.php.

56  {
57 
58  $readonly=" readonly ";
59  $this->id=($this->id=="")?$this->name:$this->id;
60 
61  $style=' class="inum input_text_ro"';
62  $this->value=str_replace('"', '', $this->value);
63  $r='<INPUT '.$style.' TYPE="TEXT" id="'.
64  $this->id.'"'.
65  'NAME="'.$this->name.'" VALUE="'.$this->value.'" '.
66  'SIZE="'.$this->size.'" '.$this->javascript." $readonly $this->extra >";
67 
68  /* add tag for column if inside a table */
69  if ($this->table==1)
70  $r='<td>'.$r.'</td>';
71 
72  return $r;
73  }

References $r, $readonly, $style, javascript, name, table, and value.

Referenced by input().

◆ input()

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

show the html input of the widget

Reimplemented from IText.

Definition at line 77 of file inum.class.php.

78  {
79  if (isset($this->prec))
80  {
81  $this->javascript='onchange="format_number(this,'.$this->prec.');"';
82  }
83  $this->name=($p_name==null)?$this->name:$p_name;
84  $this->value=($p_value===null)?$this->value:$p_value;
85  $this->id=($this->id=="")?$this->name:$this->id;
86 
87  if ($this->readOnly==true)
88  return $this->display();
89 
90  $t=((isset($this->title)))?'title="'.$this->title.'" ':' ';
91 
92  $extra=(isset($this->extra))?$this->extra:"";
93 
94  $this->value=str_replace('"', '', $this->value);
95  if (!isset($this->css_size))
96  {
97  $r='<INPUT '.$this->style.' TYPE="TEXT" id="'.
98  $this->id.'"'.$t.
99  'NAME="'.$this->name.'" VALUE="'.$this->value.'" '.
100  'SIZE="'.$this->size.'" '.$this->javascript." $this->extra >";
101  /* add tag for column if inside a table */
102  }
103  else
104  {
105  $r='<INPUT '.$this->style.' TYPE="TEXT" id="'.
106  $this->id.'"'.$t.
107  'NAME="'.$this->name.'" VALUE="'.$this->value.'" '.
108  ' style="width:'.$this->css_size.';" '.$this->javascript." $this->extra >";
109  }
110 
111  if ($this->table==1)
112  $r='<td>'.$r.'</td>';
113 
114  return $r;
115  }

References HtmlInput\$extra, $r, css_size, display(), extra, javascript, name, readOnly, table, title, and value.

Referenced by change().

+ Here is the call graph for this function:

Field Documentation

◆ $prec

INum::$prec

decimal

Definition at line 43 of file inum.class.php.


The documentation for this class was generated from the following file:
style
$opd_description style
Definition: ajax_mod_predf_op.php:52
HtmlInput\$name
$name
Definition: html_input.class.php:57
Icon_Action\cancel
static cancel($p_id, $p_javascript)
Display the icon to modify a idem.
Definition: icon_action.class.php:296
$id
$id
Definition: ajax_fiche_def_detail.php:33
HtmlInput\$extra
$extra
Definition: html_input.class.php:65
Icon_Action\validate
static validate($p_id, $p_javascript)
Display the icon to modify a idem.
Definition: icon_action.class.php:284
javascript
$ret javascript
Definition: ajax_display_letter.php:53
$readonly
$readonly
Definition: follow_up_detail_display.php:34
title
$anc_filter title
Definition: company.inc.php:118
INum\display
display()
print in html the readonly value of the widget
Definition: inum.class.php:55
size
$name size
Definition: ajax_mod_predf_op.php:49
name
$from_poste name
Definition: balance.inc.php:159
HtmlInput\$value
$value
Definition: html_input.class.php:58
extra
$poste extra
Definition: lettering.card.inc.php:40
INum\input
input($p_name=null, $p_value=null)
show the html input of the widget
Definition: inum.class.php:77
Icon_Action\modify
static modify($p_id, $p_javascript)
Display the icon to modify a idem.
Definition: icon_action.class.php:272
$r
catch(Exception $exc) if(! $g_user->can_write_action($ag_id)) $r
Definition: ajax_add_concerned_card.php:53
readOnly
$icard readOnly
Definition: follow_up_detail_display.php:69
table
$all table
Definition: company.inc.php:138
$style
$style
Definition: ajax_preference.php:51
value
$q value
Definition: ajax_add_concerned_card.php:59
css_size
$description css_size
Definition: anc_key_input.php:44