noalyss Version-9
NOALYSS : serveur de comptabilité et ERP (2002)
Loading...
Searching...
No Matches
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
 
 get_autofocus ()
 
 get_firstDate ()
 
 get_title ()
 
 input ($p_name=null, $p_value=null)
 show the html input of the widget
 
 set_autofocus ($autofocus)
 
 set_title ($title)
 
- 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 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", 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)
 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_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)
 
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="")
 Title for boxes, you can customize the symbol thanks symbol with the mode "custom".
 
static warnbulle ($p_comment)
 

Data Fields

 $autofocus
 
 $placeholder
 
 $title
 
- 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
 

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 $this->javascript='onchange="format_date(this)"';
50 }
$ret javascript
$opd_description style
$anc_filter placeholder
$anc_filter title
$poste extra

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

Member Function Documentation

◆ display()

IDate::display ( )

print in html the readonly value of the widget

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

162 {
163 $r="<span> ".$this->value;
164 $r.='<input type="hidden" name="'.$this->name.'"'.
165 'id="'.$this->id.'"'.
166 ' value = "'.$this->value.'"></span>';
167 return $r;
168 }
catch(Exception $exc) if(! $g_user->can_write_action($ag_id)) $r

References $r.

Referenced by input().

◆ get_autofocus()

IDate::get_autofocus ( )
Returns
false

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

74 {
75 return $this->autofocus;
76 return $this;
77 }

References $autofocus.

◆ get_firstDate()

IDate::get_firstDate ( )
Returns
mixed

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

92 {
93 return self::$firstDate;
94 }

◆ get_title()

IDate::get_title ( )
Returns
string

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

56 {
57 return $this->title;
58 return $this;
59 }

References $title.

◆ input()

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

show the html input of the widget

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

111 {
112 $this->name=($p_name==null)?$this->name:$p_name;
113 $this->value=($p_value==null)?$this->value:$p_value;
114 if ($this->readOnly==true)
115 return $this->display();
116 if ($this->id=="") $this->id=self::generate_id($this->name);
117 $autofocus=($this->autofocus)?" autofocus ":"";
118 $strAttribute=$this->get_node_attribute();
119
120 $r=sprintf('
121 <input type="text" name="%s" id="%s"
122 class="input_text"
123 size="10" style="width:6em"
124 value ="%s"
125 placeholder="%s"
126 title="%s"
127 pattern="[0-9]{1,2}\.[0-9]{1,2}\.[0-9]{4}"
128 %s
129 %s
130 />
131 <span class="smallbutton icon"
132 style="color:cornflowerblue"
133 id="%s_trigger"
134 />
135 &#xe811;
136 </span>
137 ',$this->name,$this->id,$this->value,$this->placeholder,$this->title,
138 $this->javascript,
139 $strAttribute,
140 $this->id
141 );
142 // @see calendar-setup.js
143 $r.=sprintf('<script type="text/javascript">
144 Calendar.setup({'.
145 'inputField : "%s",
146 ifFormat : "%%d.%%m.%%Y",
147 button : "%s_trigger",
148 align : "Bl",
149 singleClick : true,
150 firstDay:%s
151 });
152 </script>'
153 ,$this->id,
154 $this->id,
155 self::$firstDate);
156 return $r;
157 }
$from_poste name
static generate_id($p_prefix)
generate an unique id for a widget,
get_node_attribute()
Insert attribute inside a INPUT TYPE, these attribute can be retrieved in javascript with element....
display()
print in html the readonly value of the widget
$icard readOnly

References $autofocus, $r, display(), HtmlInput\generate_id(), HtmlInput\get_node_attribute(), javascript, 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 82 of file idate.class.php.

83 {
84 $this->autofocus = $autofocus;
85 return $this;
86 }

References $autofocus.

◆ set_firstDate()

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

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

100 {
101 if (isNumber($firstDate)==0){
102 throw new Exception("IDATE1: invalide data");
103 }
104 self::$firstDate= $firstDate;
105 }
isNumber($p_int)
static $firstDate

References $firstDate, and isNumber().

+ Here is the call graph for this function:

◆ set_title()

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

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

65 {
66 $this->title = $title;
67 return $this;
68 }

References $title, and title.

◆ test_me()

static IDate::test_me ( )
static

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

171 {
172
173 }

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 set_firstDate().

◆ $placeholder

IDate::$placeholder

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

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