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

Html Input : Input a date format dd.mm.yyyy The property title should be set to indicate what it is expected. More...

+ Inheritance diagram for IDate:
+ Collaboration diagram for IDate:

Public Member Functions

 __construct ($name='', $value='', $p_id="")
 
 display ()
 print in html the readonly value of the widget More...
 
 get_autofocus ()
 
 get_firstDate ()
 
 get_placeholder ()
 
 get_title ()
 
 input ($p_name=null, $p_value=null)
 show the html input of the widget More...
 
 set_autofocus ($autofocus)
 
 set_placeholder ($placeholder)
 
 set_title ($title)
 
- 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)
 

Static Public Member Functions

static set_firstDate ($firstDate)
 
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)
 

Data Fields

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

Static Public Attributes

static $firstDate =0
 

Detailed Description

Html Input : Input a date format dd.mm.yyyy The property title should be set to indicate what it is expected.

See also
calendar-setup.js
Examples
inplace_edit.test.php.

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

Constructor & Destructor Documentation

◆ __construct()

IDate::__construct (   $name = '',
  $value = '',
  $p_id = "" 
)

Reimplemented from HtmlInput.

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

42  {
43  parent::__construct($name, $value, $p_id);
44  $this->title="";
45  $this->placeholder="dd.mm.yyyy";
46  $this->extra="";
47  $this->style=' class="input_text" ';
48  $this->autofocus=false;
49  }

References HtmlInput\$name, $p_id, HtmlInput\$value, extra, placeholder, style, and title.

Member Function Documentation

◆ display()

IDate::display ( )

print in html the readonly value of the widget

Definition at line 173 of file idate.class.php.

174  {
175  $r="<span> ".$this->value;
176  $r.='<input type="hidden" name="'.$this->name.'"'.
177  'id="'.$this->id.'"'.
178  ' value = "'.$this->value.'"></span>';
179  return $r;
180  }

References $r.

Referenced by input().

◆ get_autofocus()

IDate::get_autofocus ( )
Returns
false

Definition at line 89 of file idate.class.php.

90  {
91  return $this->autofocus;
92  return $this;
93  }

References $autofocus.

◆ get_firstDate()

IDate::get_firstDate ( )
Returns
mixed

Definition at line 107 of file idate.class.php.

108  {
109  return self::$firstDate;
110  }

References $firstDate.

◆ get_placeholder()

IDate::get_placeholder ( )
Returns
string

Definition at line 53 of file idate.class.php.

54  {
55  return $this->placeholder;
56  return $this;
57  }

References $placeholder.

◆ get_title()

IDate::get_title ( )
Returns
string

Definition at line 71 of file idate.class.php.

72  {
73  return $this->title;
74  return $this;
75  }

References $title.

◆ input()

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

show the html input of the widget

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

127  {
128  $this->name=($p_name==null)?$this->name:$p_name;
129  $this->value=($p_value==null)?$this->value:$p_value;
130  if ($this->readOnly==true)
131  return $this->display();
132  if ($this->id=="") $this->id=self::generate_id($this->name);
133  $autofocus=($this->autofocus)?" autofocus ":"";
134  $onchange='onchange="format_date(this)"';
135  $r=sprintf('
136  <input type="text" name="%s" id="%s"
137  class="input_text"
138  size="10" style="width:6em"
139  value ="%s"
140  placeholder="%s"
141  title="%s"
142  pattern="[0-9]{1,2}\.[0-9]{1,2}\.[0-9]{4}"
143  %s
144  />
145  <span class="smallbutton icon"
146  id="%s_trigger"
147  />
148  &#xe811;
149  </span>
150  ',$this->name,$this->id,$this->value,$this->placeholder,$this->title,
151  $onchange,
152  $this->id
153  );
154  // @see calendar-setup.js
155  $r.=sprintf('<script type="text/javascript">
156  Calendar.setup({'.
157  'inputField : "%s",
158  ifFormat : "%%d.%%m.%%Y",
159  button : "%s_trigger",
160  align : "Bl",
161  singleClick : true,
162  firstDay:%s
163  });
164  </script>'
165  ,$this->id,
166  $this->id,
167  self::$firstDate);
168  return $r;
169  }

References $autofocus, $r, display(), HtmlInput\generate_id(), name, placeholder, readOnly, title, and value.

+ Here is the call graph for this function:

◆ set_autofocus()

IDate::set_autofocus (   $autofocus)
Parameters
false$autofocus

Definition at line 98 of file idate.class.php.

99  {
100  $this->autofocus = $autofocus;
101  return $this;
102  }

References $autofocus.

◆ set_firstDate()

static IDate::set_firstDate (   $firstDate)
static
Parameters
mixed$firstDate

Definition at line 115 of file idate.class.php.

116  {
117  if (isNumber($firstDate)==0){
118  throw new Exception("IDATE1: invalide data");
119  }
120  self::$firstDate= $firstDate;
121  }

References $firstDate, and isNumber().

+ Here is the call graph for this function:

◆ set_placeholder()

IDate::set_placeholder (   $placeholder)
Parameters
string$placeholder

Definition at line 62 of file idate.class.php.

63  {
64  $this->placeholder = $placeholder;
65  return $this;
66  }

References $placeholder, and placeholder.

◆ set_title()

IDate::set_title (   $title)
Parameters
string$title

Definition at line 80 of file idate.class.php.

81  {
82  $this->title = $title;
83  return $this;
84  }

References $title, and title.

◆ test_me()

static IDate::test_me ( )
static

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

183  {
184 
185  }

Field Documentation

◆ $autofocus

IDate::$autofocus

Definition at line 38 of file idate.class.php.

Referenced by get_autofocus(), input(), and set_autofocus().

◆ $firstDate

IDate::$firstDate =0
static

Definition at line 39 of file idate.class.php.

Referenced by get_firstDate(), and set_firstDate().

◆ $placeholder

IDate::$placeholder

Definition at line 36 of file idate.class.php.

Referenced by get_placeholder(), and set_placeholder().

◆ $title

IDate::$title

Definition at line 37 of file idate.class.php.

Referenced by get_title(), and set_title().


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
IDate\$title
$title
Definition: idate.class.php:37
IDate\$firstDate
static $firstDate
Definition: idate.class.php:39
title
$anc_filter title
Definition: company.inc.php:118
IDate\$autofocus
$autofocus
Definition: idate.class.php:38
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
isNumber
isNumber($p_int)
Definition: ac_common.php:218
IDate\$placeholder
$placeholder
Definition: idate.class.php:36
$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
IDate\display
display()
print in html the readonly value of the widget
Definition: idate.class.php:173
$p_id
$p_id
Definition: ajax_accounting.php:33
placeholder
$anc_filter placeholder
Definition: company.inc.php:117
value
$q value
Definition: ajax_add_concerned_card.php:59
HtmlInput\generate_id
static generate_id($p_prefix)
generate an unique id for a widget,
Definition: html_input.class.php:752