noalyss Version-10
NOALYSS : serveur de comptabilité et ERP (2002)
Loading...
Searching...
No Matches
HtmlInput Class Reference

class widget This class is used to create all the HTML INPUT TYPE and some specials which works with javascript like js_search. More...

+ Inheritance diagram for HtmlInput:
+ Collaboration diagram for HtmlInput:

Public Member Functions

 __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.
 
 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 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

 $attribute
 
 $css_size
 
 $ctrl
 
 $disabled
 
 $extra
 
 $extra2
 
 $heigh
 
 $id
 
 $javascript
 
 $label
 
 $name
 
 $placeholder
 
 $readOnly
 
 $require
 
 $selected
 
 $size
 
 $style
 
 $tabindex
 
 $table
 
 $type
 
 $value
 
 $width
 

Detailed Description

class widget This class is used to create all the HTML INPUT TYPE and some specials which works with javascript like js_search.

special value js_search and js_search_only :you need to add a span widget the name of the js_* widget + '_label' , the member extra contains cred,deb to filter the search of cred of deb of a jrn or contains a string with a list of frd_id. Possible type $type

  • TEXT
  • HIDDEN
  • BUTTON in this->js you have the javascript code
  • SELECT the options are passed via this->value, this array is build thanks the make_array function, each array (of the array) aka row must contains a field value and a field label
  • PASSWORD
  • CHECKBOX
  • RADIO
  • TEXTAREA
  • RICHTEXT
  • FILE
  • SPAN

Definition at line 54 of file html_input.class.php.

Constructor & Destructor Documentation

◆ __construct()

HtmlInput::__construct ( $p_name = "",
$p_value = "",
$p_id = "" )

Reimplemented in IAncCard, IBan_Number, ICard, ICheckBox, IColor, IConcerned, IDate, IFile, InputCheckBox, InputSwitch, INum, IPEPPOL_ID, IPeriod, IPoste, ISelect, IText, ITextarea, ITva_Popup, and IVATNumber.

Definition at line 81 of file html_input.class.php.

82 {
83 $this->name=$p_name;
84 $this->readOnly=false;
85 $this->size=20;
86 $this->width=50;
87 $this->heigh=20;
88 $this->value=$p_value;
89 $this->selected="";
90 $this->table=0;
91 $this->disabled=false;
92 $this->javascript="";
93 $this->extra="";
94 $this->extra2="all";
95 $this->attribute=array();
96 $this->id=$p_id;
97 $this->require=false;
98 }
$select selected
$ret javascript
$name size
$from_poste name
$all table
$icard readOnly
$all disabled
$poste extra
$desc heigh
$desc width

References $p_id, disabled, extra, heigh, javascript, name, readOnly, selected, size, table, value, and width.

Member Function Documentation

◆ __toString()

HtmlInput::__toString ( )

Definition at line 219 of file html_input.class.php.

220 {
221 $r= "Type ".$this->type."<br>";
222 $r.= "name ".$this->name."<br>";
223 $r.= "value".$this->value."<br>";
224 $readonly=(isset($this->readOnly) && $this->readOnly==false)?"false":"true";
225 $r.= "read only".$readonly."<br>";
226 return $r;
227 }
catch(Exception $exc) if(! $g_user->can_write_action($ag_id)) $r

References $r, $readonly, and readOnly.

◆ anchor()

static HtmlInput::anchor ( $p_text,
$p_url = "",
$p_js = "",
$p_style = ' class="line" ',
$p_title = "click",
array $p_attribute = [] )
static

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.

You must give p_url OR p_js default CSS class=line

Parameters
string$p_texttext of the anchor
string$p_urlurl
string$p_jsjavascript
string$p_styleis the visuable effect (class, style...)
string$p_titleTitle
array$p_attributejavascript attribute to add to the anchor, CAUTION special chars will be translated(see htmlspecialchars function)
See also
h()

Definition at line 976 of file html_input.class.php.

978 {
979 if ($p_js!="")
980 {
981 $p_url='href="javascript:void(0)"';
982 } else {
983 $p_url=sprintf('href="%s"',$p_url);
984 }
985 $str_javascript_attr=build_javascript_attribute($p_attribute);
986 $str=sprintf('<a %s %s %s %s title="%s">%s</a>', $str_javascript_attr,$p_style, $p_url, $p_js, $p_title,$p_text);
987 return $str;
988 }
build_javascript_attribute($pa_attribute)
build a string with the attribute that javascript can use , that string must be included in a DOM ele...

References $p_url, $str, and build_javascript_attribute().

+ Here is the call graph for this function:

◆ anchor_action()

static HtmlInput::anchor_action ( $action,
$javascript,
$id = NULL,
$p_class = "button",
$p_symbole = "" )
static

Anchor Html with javascript.

Parameters
$actionaction action to perform (message) without onclick
$javascriptjavascript to execute
$idis the DOM element id
$p_classCSS class of the button
$p_symboleraw symbole to add to the action message

Definition at line 529 of file html_input.class.php.

531 {
532 if ($id==NULL)
533 {
534 $id=uniqid("xx");
535 }
536 $r="";
537 $r.='<a id="'.$id.'" href="javascript:void(0)" class="'.$p_class.'" onclick="'.$javascript.'">'.$p_symbole.h($action).'</a>';
538 return $r;
539 }

References $action, $id, $javascript, and $r.

◆ anchor_close()

static HtmlInput::anchor_close ( $div,
$p_js = "" )
static

Return a html string with an anchor which close the inside popup.

(top-right corner)

Parameters
nameof the DIV to close
Deprecated
See also
Icon_Action\close

Definition at line 516 of file html_input.class.php.

517 {
518 throw new Exception("DEPRECATED");
519 }

References $div.

◆ anchor_empty()

static HtmlInput::anchor_empty ( $p_text,
$p_id,
$p_title = "" )
static

let you create only a link and set an id on it.

After create a javascript for getting the event onclick = function() {...}

Parameters
type$p_textText to display
type$p_idid of the link
type$typetitle of the link
echo HtmlInput::anchor_empty('go','go_id');
<script>$("go_id").onclick=function (e) { ...}</script>
static anchor_empty($p_text, $p_id, $p_title="")
let you create only a link and set an id on it.

Definition at line 955 of file html_input.class.php.

956 {
957 $p_url="javascript:void(0)";
958 $str=sprintf('<a id="%s" href="javascript:void(0)" class="line" title="%s">%s</a>',
959 $p_id, $p_title, $p_text);
960 return $str;
961 }

References $p_id, $p_url, and $str.

◆ anchor_hide()

static HtmlInput::anchor_hide ( $action,
$javascript )
static

Return a html string with an anchor to hide a div, put it in the right corner.

Parameters
$actionaction action to perform (message)
$javascriptjavascript
Note
not protected against html
See also
Icon_Action\hide
Deprecated

Definition at line 602 of file html_input.class.php.

603 {
604 throw new Exception("DEPRECATED");
605 }

References $action, and $javascript.

◆ array_to_hidden()

static HtmlInput::array_to_hidden ( $array,
$global_array )
static

transform request data to hidden

Parameters
$arrayis an of indices
$requestname of the superglobal $_POST $_GET $_REQUEST(default)
Returns
html string with the hidden data

Definition at line 638 of file html_input.class.php.

639 {
640
641 $r="";
642
643 if (count($global_array)==0)
644 return '';
645 foreach ($array as $a)
646 {
647 if (isset($global_array [$a]))
648 if (is_array($global_array[$a])==false)
649 {
650 $r.=HtmlInput::hidden($a, $global_array [$a]);
651 }
652 else
653 {
654 if (count($global_array[$a])>0)
655 {
656 foreach ($global_array[$a] as $value)
657 {
658 $r.=HtmlInput::hidden($a."[]", $value);
659 }
660 }
661 }
662 }
663
664 return $r;
665 }

References $a, $array, $r, $value, and hidden().

+ Here is the call graph for this function:

◆ array_to_string()

static HtmlInput::array_to_string ( $array,
$global_array,
$start = "?" )
static

transform request data to string

Parameters
$arrayis an of indices
$requestname of the superglobal $_POST $_GET $_REQUEST(default)
Returns
html string with the string data

Definition at line 735 of file html_input.class.php.

736 {
737
738 $r="";
739
740 if (count($global_array)==0)
741 return '';
742 $and="";
743 foreach ($array as $a)
744 {
745 if (isset($global_array [$a]))
746 {
747 if (is_array($global_array[$a])==false)
748 {
749 $r.=$and."$a=".$global_array [$a];
750 }
751 else
752 {
753 for ($i=0; $i<count($global_array[$a]); $i++)
754 {
755 $r.=$and."$a"."[]=".$global_array[$a][$i];
756 $and="&amp;";
757 }
758 }
759 }
760 $and="&amp;";
761 }
762 if (trim ($r) != "") $r=$start.$r;
763 return $r;
764 }

References $a, $array, $i, $r, and $start.

◆ button()

static HtmlInput::button ( $p_name,
$p_value,
$p_javascript = "",
$p_class = "smallbutton" )
static

Definition at line 236 of file html_input.class.php.

238 {
239
240 return '<INPUT TYPE="button" class="'.$p_class.'" NAME="'.$p_name.'" ID="'.$p_name.'" VALUE="'.$p_value.'" '.$p_javascript.'>';
241 }

Referenced by ITva_Popup\__construct(), followup_card_button(), history_card_button(), ITva_Popup\input(), Html_Input_Noalyss\ledger_add_item(), print_window(), and ITva_Popup\with_button().

◆ button_action()

static HtmlInput::button_action ( $action,
$javascript,
$id = NULL,
$p_class = "button",
$p_symbole = "" )
static

button Html with javascript

Parameters
$actionaction action to perform (message) without onclick
$javascriptjavascript to execute
$idis the DOM element id
$p_classCSS class of the button
$p_symboleraw symbole to add to the action message

Definition at line 549 of file html_input.class.php.

551 {
552 if ($id==NULL)
553 {
554 $id=uniqid("xx");
555 }
556 $r="";
557 $r.='<input type="button" id="'.$id.'" class="'.$p_class.'" onclick="'.$javascript.'" value="'.$p_symbole.h($action).'">';
558 return $r;
559 }

References $action, $id, $javascript, and $r.

◆ button_action_add()

static HtmlInput::button_action_add ( )
static

Definition at line 1238 of file html_input.class.php.

1239 {
1240 $dossier=Dossier::id();
1241 $js=HtmlInput::button_action(_('Nouvel événement'),
1242 'action_add('.$dossier.')', 'xx', 'smallbutton');
1243 return $js;
1244 }
_("actif, passif,charge,...")

◆ button_action_remove_operation()

static HtmlInput::button_action_remove_operation ( $p_operation)
static
Parameters
type$p_operation_jr_idaction_gestion_operation.ago_id

Definition at line 1228 of file html_input.class.php.

1229 {
1230 $rmOperation=sprintf("confirm_box(null,'"._('Voulez-vous effacer cette relation ')."',function () {remove_operation('%s','%s');});",
1231 dossier::id(), $p_operation);
1232 $js=Icon_Action::trash("acop".$p_operation, $rmOperation);
1233 return $js;
1234 }
static trash($p_id, $p_javascript)
Display the icon of a trashbin.

◆ button_anchor()

static HtmlInput::button_anchor ( $p_label,
$p_value,
$p_name = "",
$p_javascript = "",
$p_class = "smallbutton" )
static

create a button with a ref

Parameters
$p_labelthe text
$p_valuethe location of the window,
$p_namethe id of the span (button will be "btn".$p_name
$p_javascriptjavascript for this button, needed to add the event : onclick,...
Returns
string with htmlcode

Definition at line 274 of file html_input.class.php.

276 {
277 $href="";
278 if ($p_value!="")
279 $href=sprintf(' href ="%s" ', $p_value);
280 $r=sprintf('<span id="%s" > <A class="'.$p_class.'" id="btn%s" style="display:inline-block;" %s %s >%s</A></span>',
281 $p_name, $p_name,$href, $p_javascript, $p_label);
282 return $r;
283 }
$href
Definition adm.inc.php:31

References $href, and $r.

◆ button_choice_ledger()

static HtmlInput::button_choice_ledger ( $p_array)
static
Parameters
type$p_arrayindice
  • div div name
  • type ALL, VEN, ACH or ODS
  • all_type 1 yes 0 no

Definition at line 1151 of file html_input.class.php.

1152 {
1153 extract($p_array, EXTR_SKIP);
1154 $bledger_param=json_encode(array(
1155 'dossier'=>$_REQUEST['gDossier'],
1156 'type'=>$type,
1157 'all_type'=>$all_type,
1158 'div'=>$div,
1159 'class'=>'inner_box'
1160 ));
1161
1162 $bledger_param=noalyss_str_replace('"', "'", $bledger_param);
1163 $bledger=new ISmallButton('l');
1164 $bledger->label=_("choix des journaux");
1165 $bledger->javascript=" show_ledger_choice($bledger_param)";
1166 $f_ledger=$bledger->input();
1167 $hid_jrn="";
1168 if (isset($_REQUEST[$div.'nb_jrn']))
1169 {
1170 for ($i=0; $i<$_REQUEST[$div.'nb_jrn']; $i++)
1171 {
1172 if (isset($_REQUEST[$div."r_jrn"][$i]))
1173 $hid_jrn.=HtmlInput::hidden($div.'r_jrn['.$i.']',
1174 $_REQUEST[$div."r_jrn"][$i]);
1175 }
1176 $hid_jrn.=HtmlInput::hidden($div.'nb_jrn',
1177 $_REQUEST[$div.'nb_jrn']);
1178 } else
1179 {
1180 $hid_jrn=HtmlInput::hidden($div.'nb_jrn', 0);
1181 }
1182 echo $f_ledger;
1183 echo '<span id="ledger_id'.$div.'">';
1184 echo $hid_jrn;
1185 echo '</span>';
1186 }
noalyss_str_replace($search, $replace, $string)
$_REQUEST['ac']

◆ button_close()

static HtmlInput::button_close ( $div_name,
$class = 'smallbutton' )
static

close button for the HTML popup

See also
add_div modify_operation
Parameters
$div_nameis the name of the div to remove

Definition at line 483 of file html_input.class.php.

484 {
485 $a=new IButton('Fermer');
486 $a->label=_("Fermer");
487 $a->class=$class;
488 $a->javascript="removeDiv('".$div_name."')";
489 $html=$a->input();
490
491 return $html;
492 }
if(headers_sent() &&DEBUGNOALYSS > 0) $html
$class
Display the Plugin and for each profile were it is installed or not.
Html Input.

References $a, $class, $html, and _.

◆ button_hide()

static HtmlInput::button_hide ( $div_name,
$class = 'smallbutton' )
static

Hide the HTML popup.

Parameters
type$div_name
Returns
type

Definition at line 499 of file html_input.class.php.

500 {
501 $a=new IButton('Fermer');
502 $a->label=_("Fermer");
503 $a->class=$class;
504 $a->javascript="$('".$div_name."').hide()";
505 $html=$a->input();
506
507 return $html;
508 }

References $a, $class, $html, and _.

◆ button_image()

static HtmlInput::button_image ( $javascript,
$id = "xx",
$p_class = 'class="button"',
$p_image = "" )
static

button Html image

Parameters
$javascriptjavascript to execute
$idid of the button
$classclass of the button
$p_imageimage

Definition at line 581 of file html_input.class.php.

583 {
584 if ($id=="xx")
585 {
586 $id=uniqid("xx");
587 }
588 $r="";
589 $r.='<image id="'.$id.'" '.$p_class.' onclick="'.$javascript.'" src="'.$p_image.'" />';
590 return $r;
591 }

References $id, $javascript, and $r.

◆ calendar_zoom()

static HtmlInput::calendar_zoom ( $obj)
static

Zoom the calendar.

Parameters
type$objobjet json for the javascript
See also
calendar_zoom in noalyss_script.js

Definition at line 1136 of file html_input.class.php.

1137 {
1138 $button=new ISmallButton("calendar", _("Calendrier"));
1139 $button->javascript="calendar_zoom($obj)";
1140 return $button->input();
1141 }

References $obj, and calendar_zoom().

Referenced by calendar_zoom().

+ Here is the call graph for this function:

◆ card_detail()

static HtmlInput::card_detail ( $p_qcode,
$pname = '',
$p_style = "",
$p_nohistory = false,
$nofollowup = false )
static

show the detail of a card

Definition at line 620 of file html_input.class.php.

622 {
623 if ($pname !=='') {$pname='<span class="v-large">('.$pname.')</span>';}
624 $r="";
625 $histo=($p_nohistory==true)?' ,nohistory:1':"";
626 $followup=($nofollowup==true)?' ,nofollowup:1':"";
627 $r.=sprintf('<a href="javascript:void(0)" %s class="detail" onclick="fill_ipopcard({qcode:\'%s\' %s %s})">%s %s</a>',
628 $p_style, $p_qcode, $histo,$followup,$p_qcode,$pname);
629 return $r;
630 }

References $histo, and $r.

◆ default_value()

static HtmlInput::default_value ( $ind,
$default,
$array )
static

return default if the value if the value doesn't exist in the array

Parameters
$indstring the index to check
$defaultstring the value to return
$arrayarray the array

Definition at line 820 of file html_input.class.php.

821 {
822 if (!isset($array[$ind]))
823 {
824 return $default;
825 }
826 return $array[$ind];
827 }
for($i=0;$i<=6;$i++) $ind
Definition calendar.php:55

References $array, and $ind.

◆ default_value_get()

static HtmlInput::default_value_get ( $ind,
$default )
static

return default if the value if the value doesn't exist in $_GET use HttpInput instead

See also
HttpInput
Deprecated
Parameters
$indname of the variable
type$default
Returns
type

Definition at line 838 of file html_input.class.php.

839 {
840 if (!isset($_GET[$ind]))
841 {
842 return $default;
843 }
844 return $_GET[$ind];
845 }
$_GET['qcode']

References $_GET, and $ind.

◆ default_value_post()

static HtmlInput::default_value_post ( $ind,
$default )
static

return default if the value if the value doesn't exist in $_POST use HttpInput instead

See also
HttpInput
Deprecated
Parameters
$indname of the variable
type$default
Returns
type

Definition at line 856 of file html_input.class.php.

857 {
858 if (!isset($_POST[$ind]))
859 {
860 return $default;
861 }
862 return $_POST[$ind];
863 }
$_POST['ac']
Definition do.php:323

References $_POST, and $ind.

◆ default_value_request()

static HtmlInput::default_value_request ( $ind,
$default )
static

return default if the value if the value doesn't exist in $_REQUEST use HttpInput instead

See also
HttpInput
Deprecated
Parameters
$indname of the variable
type$default
Returns
type

Definition at line 874 of file html_input.class.php.

875 {
876 if (!isset($_REQUEST[$ind]))
877 {
878 return $default;
879 }
880 return $_REQUEST[$ind];
881 }

References $_REQUEST, and $ind.

◆ detail_action()

static HtmlInput::detail_action ( $ag_id,
$p_mesg,
$p_modify = 1 )
static

return an anchor to view the detail of an action

Parameters
$ag_id
$p_mesg
$p_modifylet you modify an operation

Definition at line 320 of file html_input.class.php.

321 {
322 return sprintf('<A class="detail" style="text-decoration:underline;display:inline" HREF="javascript:view_action(%d,%d,%d)">%s</A>',
323 $ag_id, dossier::id(), $p_modify, $p_mesg);
324 }
$ag_id

References $ag_id.

◆ detail_modele_document_deprecated()

static HtmlInput::detail_modele_document_deprecated ( $p_id,
$p_mesg )
static

return a string containing the html code for calling the modifyModeleDocument

Deprecated
since 9.3.0.6

Definition at line 330 of file html_input.class.php.

331 {
332 return sprintf('<A class="detail" style="text-decoration:underline" HREF="javascript:modifyModeleDocument(%d,%d)">%s</A>',
333 $p_id, dossier::id(), $p_mesg);
334 }

References $p_id.

◆ detail_op()

static HtmlInput::detail_op ( $p_jr_id,
$p_mesg )
static

return a string containing the html code for calling the modifyOperation

Definition at line 307 of file html_input.class.php.

308 {
309 return sprintf('<A class="detail" style="text-decoration:underline;display:inline" HREF="javascript:modifyOperation(%d,%d)">%s</A>',
310 $p_jr_id, dossier::id(), $p_mesg);
311 }

◆ display_periode()

static HtmlInput::display_periode ( $p_id)
static

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

472 {
473 $r=sprintf('<a href="javascript:void(0)" onclick="display_periode(%d,%d)">Modifier</a>',
474 dossier::id(), $p_id);
475 return $r;
476 }

References $p_id, and $r.

◆ errorbulle()

static HtmlInput::errorbulle ( $p_comment)
static

Definition at line 295 of file html_input.class.php.

296 {
297 global $g_failed;
298 if ( $p_comment == "") return "";
299 $r=sprintf('<A HREF="#" tabindex="-1" style="display:inline;color:red;background-color:transparent;padding-left:4px;padding-right:4px;text-decoration:none;" onmouseover="displayBulle(\'%s\')" onclick="displayBulle(\'%s\')" onmouseout="hideBulle(0)"> %s </A>',
300 $p_comment, $p_comment, $g_failed);
301 return $r;
302 }
global $g_failed

References $g_failed, and $r.

◆ extension()

static HtmlInput::extension ( )
static

Definition at line 261 of file html_input.class.php.

262 {
263 return self::hidden('plugin_code', $_REQUEST['plugin_code']);
264 }

References $_REQUEST.

◆ filter_list()

static HtmlInput::filter_list ( $p_list_id)
static

Display a field for searching an element in a list, the searchable text must be in an element with the className search-content.

Parameters
string$p_list_idDOM ID of the list (ul or ol)
<ul id="xx">
<li><span class="search-content"> Content used for searching</span> Content not used for search </li>
<li><span class="search-content"> Content used for searching</span> <a href="">Content not used for search</a> </li>
<li><span class="search-content"> Content used for searching</span> Content not used for search </li>
<li><a href=""><span class="search-content"> Content used for searching</span> </a></li>
<ul>
span($p_string, $p_extra='')
Definition ac_common.php:43
Returns
string

Definition at line 1113 of file html_input.class.php.

1114 {
1115 $r="<span>";
1116 $r.='<span class=" icon">&#xf50d;</span>';
1117 $r.=sprintf('<input id="search_%s" type="TEXT" class="input_text" name="filter_list%s" placeholder="%s" onkeyup="filter_list(this,\'%s\')">',
1118 $p_list_id,$p_list_id,_("Recherche"),$p_list_id);
1119
1120 $r.=sprintf('<input type="button" class="smallbutton" onclick="$(\'search_%s\').value=\'\';filter_list(\'search_%s\',\'%s\')" value="x">',$p_list_id,$p_list_id,$p_list_id);
1121 $r.='</span>';
1122 return $r;
1123 }

References $r, and _.

◆ filter_table()

static HtmlInput::filter_table ( $p_table_id,
$p_col,
$start_row )
static

filter the rows in a table and keep the colored row in alternance

Parameters
dom_id$p_table_idtable
string$p_col,columnto search example 0,1,2
int$start_rowrow to always keep (header)
Returns
string HTML

Definition at line 1085 of file html_input.class.php.

1086 {
1087 $r="
1088 <span>
1089 <span class=\"icon\" >&#xf50d;</span>
1090
1091 <input id=\"lk_".$p_table_id."\" autocomplete=\"off\" class=\"input_text\" name=\"filter\" onkeyup=\"filter_table(this, '$p_table_id','$p_col',$start_row )\" type=\"text\" placeholder=\""._("Filtre rapide")."\">
1092 <input type=\"button\" class=\"smallbutton\" onclick=\"$('lk_".$p_table_id."').value='';filter_table($('lk_".$p_table_id."'), '$p_table_id','$p_col',$start_row );\" value=\"X\">
1093 </span>
1094 ";
1095 $r.=' <span class="notice" style="display:none" id="info_'.$p_table_id.'"></span>';
1096 return $r;
1097 }

References $p_col, $r, and _.

◆ filter_table_DOM()

static HtmlInput::filter_table_DOM ( $p_table_id,
$p_col,
$start_row,
$p_name,
$domid )
static

filter the rows in a table and keep the colored row in alternance

Parameters
dom_id$p_table_idtable
string$p_col,columnto search example 0,1,2
int$start_rowrow to always keep (header)
string$p_namename of the input field
string$domiddomid containing the second filter, it could be an HIDDEN, TEXT, SELECT field
Returns
string HTML

Definition at line 1041 of file html_input.class.php.

1043 {
1044
1045 $r="
1046 <span>
1047 <span class=\"icon\" >&#xf50d;</span>
1048 <input id=\"lk_".$p_table_id."\" name=\"$p_name\" autocomplete=\"off\" class=\"input_text\" name=\"filter\" onkeyup=\"filter_table(this, '$p_table_id','$p_col',$start_row ,'$domid')\" type=\"text\" placeholder=\""._("Filtre rapide")."\">
1049 <input type=\"button\" class=\"smallbutton\" onclick=\"$('lk_".$p_table_id."').value='';filter_table($('lk_".$p_table_id."'), '$p_table_id','$p_col',$start_row,'$domid' );\" value=\"X\">
1050 </span>
1051 ";
1052 $r.=' <span class="notice" style="display:none" id="info_'.$p_table_id.'"></span>';
1053 return $r;
1054 }

References $p_col, $r, and _.

◆ filter_table_form()

static HtmlInput::filter_table_form ( $p_table_id,
$p_col,
$start_row,
$p_name,
$p_old_value )
static

filter the rows in a table and keep the colored row in alternance

Parameters
dom_id$p_table_idtable
string$p_col,columnto search example 0,1,2
int$start_rowrow to always keep (header)
string$p_namename of the input field
string$p_old_valuesearch value sent by $_GET (or $_REQUEST)
Returns
string HTML

Definition at line 1065 of file html_input.class.php.

1067 {
1068 $r="
1069 <span>
1070 <span class=\"icon\" >&#xf50d;</span>
1071 <input id=\"lk_".$p_table_id."\" name=\"$p_name\" value=\"$p_old_value\"autocomplete=\"off\" class=\"input_text\" name=\"filter\" onkeyup=\"filter_table(this, '$p_table_id','$p_col',$start_row )\" type=\"text\" placeholder=\""._("Filtre rapide")."\">
1072 <input type=\"button\" class=\"smallbutton\" onclick=\"$('lk_".$p_table_id."').value='';filter_table($('lk_".$p_table_id."'), '$p_table_id','$p_col',$start_row );\" value=\"X\">
1073 </span>
1074 ";
1075 $r.=' <span class="notice" style="display:none" id="info_'.$p_table_id.'"></span>';
1076 return $r;
1077 }

References $p_col, $r, and _.

◆ followup_card_button()

static HtmlInput::followup_card_button ( $f_id,
$p_mesg )
static

display a div with the history of the card

Parameters
int$f_idfiche.f_id
string$p_mesgstring to display
int$p_exerciceexercice of the history

Definition at line 384 of file html_input.class.php.

385 {
386 global $g_user;
387 $js=sprintf('onclick="view_followup_card(\'%s\',\'%s\')"', $f_id,
388 dossier::id());
389 $view_followup=HtmlInput::button(uniqid("fu"), $p_mesg, $js);
390 return $view_followup;
391 }
global $g_user
if no group available , then stop

References $f_id, $g_user, $js, and button().

+ Here is the call graph for this function:

◆ generate_id()

static HtmlInput::generate_id ( $p_prefix)
static

generate an unique id for a widget,

Parameters
$p_prefixprefix
See also
HtmlInput\IDate
Returns
string with a unique id

Definition at line 808 of file html_input.class.php.

809 {
810 $r=sprintf('%s_%d', $p_prefix, mt_rand(0, 999999));
811 return $r;
812 }

References $r.

Referenced by IDate\input().

◆ get_js_attr()

HtmlInput::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.

See also
build_javascript_attribute() include the string in the DOM Element instead of in a piece of code
Returns
string : return string with the javascript code

Reimplemented in IPoste.

Definition at line 158 of file html_input.class.php.

159 {
160 require_once NOALYSS_INCLUDE.'/lib/function_javascript.php';
161 $attr="";
162 if (count($this->attribute)==0)
163 return "";
164
165 /* Add properties at the widget */
166 for ($i=0; $i<count($this->attribute); $i++)
167 {
168 list($name, $value)=$this->attribute[$i];
169 $tmp1=sprintf("$('%s').%s='%s';", $this->id, $name, $value);
170 $attr.=$tmp1;
171 }
173 return $attr;
174 }
create_script($p_string)
create the HTML for adding the script tags around of the script

References $attr, $i, $name, $value, and create_script().

Referenced by IAncCard\input(), IButton\input(), and ICard\input().

+ Here is the call graph for this function:

◆ get_node_attribute()

HtmlInput::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">

Returns
string to insert into the HTML node

Definition at line 1253 of file html_input.class.php.

1254 {
1255 $r="";
1256 $nb_attribute=count($this->attribute);
1257 for ($i=0; $i<$nb_attribute; $i++)
1258 {
1259 $r.=sprintf(' %s="%s" ', $this->attribute[$i][0],
1260 htmlentities($this->attribute[$i][1]));
1261 }
1262 return $r;
1263 }

Referenced by IText\display(), ICheckBox\input(), IDate\input(), IHidden\input(), INum\input(), ISmallButton\input(), IText\input(), and ITva_Popup\input().

◆ get_placeholder()

HtmlInput::get_placeholder ( )
Returns
string HTML placeholder attribut

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

108 {
109 return $this->placeholder;
110 }

◆ get_to_hidden()

static HtmlInput::get_to_hidden ( $array)
static

transform $_GET data to hidden

Parameters
$arrayis an of indices
See also
HtmlInput::request_to_hidden
Returns
html string with the hidden data

Definition at line 699 of file html_input.class.php.

700 {
701 $r=self::array_to_hidden($array, $_GET);
702 return $r;
703 }

References $_GET, $array, and $r.

◆ get_to_string()

static HtmlInput::get_to_string ( $array,
$start = "?" )
static

transform $_GET data to string

Parameters
$arrayis an of indices
See also
HtmlInput::request_to_string
Returns
html string with the string data

Definition at line 772 of file html_input.class.php.

773 {
774 $r=self::array_to_string($array, $_GET, $start);
775 return $r;
776 }

References $_GET, $array, $r, and $start.

◆ get_value()

HtmlInput::get_value ( )

Return the value of input (IText, INum,...)

Reimplemented in ISelect.

Definition at line 146 of file html_input.class.php.

147 {
148 return $this->value;
149 }

References $value.

◆ hidden()

static HtmlInput::hidden ( $p_name,
$p_value,
$p_id = "" )
static

Definition at line 248 of file html_input.class.php.

249 {
250 if ($p_id=="")
251 $p_id=$p_name;
252 if ( DEBUGNOALYSS > 2) {
253 return '<span style="font-size:80%;color:blue;background-color:lightgoldenrodyellow">'.
254 $p_id .
255 '= <INPUT TYPE="text" id="'.strip_tags($p_id).'" NAME="'.$p_name.'" VALUE="'.strip_tags($p_value??"").'" style="color:blue;font-size:80%">'.
256 '</span>';
257 }else
258 return '<INPUT TYPE="hidden" id="'.strip_tags($p_id).'" NAME="'.$p_name.'" VALUE="'.strip_tags($p_value??"").'">';
259 }

References $p_id.

Referenced by array_to_hidden(), InputCheckBox\input(), InputSwitch\input(), json_to_hidden(), Html_Input_Noalyss\ledger_add_item(), simple_array_to_hidden(), and ICard\test_me().

◆ history_account()

static HtmlInput::history_account ( $p_account,
$p_mesg,
$p_style = "",
$p_exercice = "" )
static

display a div with the history of the account

Parameters
string$p_accountaccounting
string$p_mesgstring to display
string$p_styleextra code for HTML
int$p_exerciceexercice of the history

Definition at line 402 of file html_input.class.php.

403 {
404 global $g_user;
405 if ( $p_exercice=="") {
406 $p_exercice=$g_user->get_exercice();
407 }
408 $view_history=sprintf('<A class="detail" style="text-decoration:underline;%s" HREF="javascript:view_history_account(\'%s\',\'%s\',\'%s\')" >%s</A>',
409 $p_style, $p_account, dossier::id(),$p_exercice, $p_mesg);
410 return $view_history;
411 }
$p_exercice

References $g_user, and $p_exercice.

◆ history_anc_account()

static HtmlInput::history_anc_account ( $p_account,
$p_mesg,
$p_style = "",
$p_exercice = "" )
static

display a div with the history of the analytic account

Parameters
int$p_accountpo_id
string$p_mesgstring to display
string$p_styleextra code for HTML
int$p_exerciceexercice of the history

Definition at line 419 of file html_input.class.php.

420 {
421 global $g_user;
422 if ( $p_exercice=="") {
423 $p_exercice=$g_user->get_exercice();
424 }
425 $view_history=sprintf('<A class="detail" style="text-decoration:underline;%s" HREF="javascript:view_history_anc_account(\'%s\',\'%s\',\'%s\')" >%s</A>',
426 $p_style, $p_account, dossier::id(),$p_exercice, $p_mesg);
427 return $view_history;
428 }

References $g_user, and $p_exercice.

◆ history_card()

static HtmlInput::history_card ( $f_id,
$p_mesg,
$p_style = "",
$p_exercice = "" )
static

display a div with the history of the card

Definition at line 348 of file html_input.class.php.

349 {
350 global $g_user;
351 if ( $p_exercice=="") {
352 $p_exercice=$g_user->get_exercice();
353 }
354 $view_history=sprintf('<A class="detail" style="text-decoration:underline;%s" HREF="javascript:view_history_card(\'%s\',\'%s\',\'%s\')" >%s</A>',
355 $p_style, $f_id, dossier::id(),$p_exercice, $p_mesg);
356 return $view_history;
357 }

References $f_id, $g_user, and $p_exercice.

◆ history_card_button()

static HtmlInput::history_card_button ( $f_id,
$p_mesg,
$p_exercice = "" )
static

display a div with the history of the card

Parameters
int$f_idfiche.f_id
string$p_mesgstring to display
int$p_exerciceexercice of the history

Definition at line 365 of file html_input.class.php.

366 {
367 static $e=0;
368 $e++;
369 global $g_user;
370 if ( $p_exercice=="") {
371 $p_exercice=$g_user->get_exercice();
372 }
373 $js=sprintf('onclick="view_history_card(\'%s\',\'%s\',\'%s\')"', $f_id,
374 dossier::id(),$p_exercice);
375 $view_history=HtmlInput::button("hcb".$e, $p_mesg, $js);
376 return $view_history;
377 }

References $e, $f_id, $g_user, $js, $p_exercice, and button().

+ Here is the call graph for this function:

◆ image_click()

static HtmlInput::image_click ( $p_image,
$p_js,
$p_message,
$p_class = "" )
static

Image to click ,.

Parameters
string$p_imagefilename of the image under image/
string$p_jsjavascript when the image is clicked
string$p_messageMessage

Definition at line 567 of file html_input.class.php.

568 {
569 $ret=sprintf('<a class="nav %s" style="display:inline" title="%s"><img src="image/%s" onclick="%s"></a>',
570 $p_class, $p_message, $p_image, $p_js);
571 return $ret;
572 }

References $ret.

◆ json_to_hidden()

static HtmlInput::json_to_hidden ( $p_json)
static

transform a json to hidden

Parameters
json$p_json

Definition at line 684 of file html_input.class.php.

685 {
686 $aJson=json_decode($p_json);
687 foreach ($aJson as $key=> $value)
688 {
689 echo HtmlInput::hidden($key, $value);
690 }
691 }

References $value, and hidden().

+ Here is the call graph for this function:

◆ make_object_deprecated()

HtmlInput::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.

Parameters
$p_name: name of the object, can be null. If the name is not null, return $p_name={} otherwise only the object {}
Returns
javascript string with the object
Note
: there is not check on the key->value, so you could need to escape special char as quote, single-quote...
Deprecated
$a=new IButton()
$a->set_attribute('prop','1');
$a->set_attribute('prop','2');
$a->set_attribute('prop','3');
$string = $a->make_object('property');
echo $string => property={'prop':'1','prop2':'2','prop3':'3'};
$string = $a->make_object(null);
echo $string => {'prop':'1','prop2':'2','prop3':'3'};
set_attribute($p_name, $p_value)
add an HTML attribute for the INPUT field

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

197 {
198 $name=($p_name!=null)?$p_name.'=':'';
199 if (count($this->attribute)==0)
200 return $name."{}";
201 $ret=$name."{";
202 $and='';
203
204 for ($i=0; $i<count($this->attribute); $i++)
205 {
206 list($name, $value)=$this->attribute[$i];
207 $tmp1=sprintf($and."'%s':'%s'", $name, $value);
208 $ret.=$tmp1;
209 $and=',';
210 }
211
212 $ret.='}';
213 return $ret;
214 }

References $i, $name, $ret, and $value.

◆ post_to_hidden()

static HtmlInput::post_to_hidden ( $array)
static

transform $_POST data to hidden

Parameters
$arrayis an of indices
See also
HtmlInput::request_to_hidden
Returns
html string with the hidden data

Definition at line 711 of file html_input.class.php.

712 {
713 $r=self::array_to_hidden($array, $_POST);
714 return $r;
715 }

References $_POST, $array, and $r.

◆ post_to_string()

static HtmlInput::post_to_string ( $array)
static

transform $_POST data to string

Parameters
$arrayis an of indices
See also
HtmlInput::request_to_string
Returns
html string with the string data

Definition at line 784 of file html_input.class.php.

785 {
786 $r=self::array_to_string($array, $_POST);
787 return $r;
788 }

References $_POST, $array, and $r.

◆ print_window()

static HtmlInput::print_window ( )
static

Javascript to print the current window.

Definition at line 610 of file html_input.class.php.

611 {
612 $r='';
613 $r.=HtmlInput::button('print', _('Imprimer'), 'onclick="window.print();"');
614 return $r;
615 }

References $r, _, and button().

+ Here is the call graph for this function:

◆ remove_stock()

static HtmlInput::remove_stock ( $p_id,
$p_mesg )
static

return a string containing the html code for calling the removeStock

Definition at line 339 of file html_input.class.php.

340 {
341 return sprintf('<A class="detail" style="text-decoration:underline" HREF="javascript:removeStock(%d,%d)">%s</A>',
342 $p_id, dossier::id(), $p_mesg);
343 }

References $p_id.

◆ request_to_hidden()

static HtmlInput::request_to_hidden ( array $array)
static

transform $_REQUEST data to hidden

Parameters
$arrayis an of indices
See also
HtmlInput::request_to_hidden
Returns
html string with the hidden data

Definition at line 723 of file html_input.class.php.

724 {
725 $r=self::array_to_hidden($array, $_REQUEST);
726 return $r;
727 }

References $_REQUEST, $array, and $r.

◆ request_to_string()

static HtmlInput::request_to_string ( $array,
$start = "?" )
static

transform $_REQUEST data to string

Parameters
$arrayis an of indices
See also
HtmlInput::request_to_string
Returns
html string with the string data

Definition at line 796 of file html_input.class.php.

797 {
798 $r=self::array_to_string($array, $_REQUEST, $start);
799 return $r;
800 }

References $_REQUEST, $array, $r, and $start.

◆ reset()

static HtmlInput::reset ( $p_value,
$p_class = "smallbutton" )
static

Definition at line 243 of file html_input.class.php.

244 {
245 return '<INPUT TYPE="RESET" class="'.$p_class.'" VALUE="'.$p_value.'">';
246 }

◆ select_cat()

static HtmlInput::select_cat ( $array_cat)
static

create a hidden plus button to select the cat of ledger

Note
the selected value is stored in the array p_cat

Definition at line 434 of file html_input.class.php.

435 {
436 ob_start();
437 $ledger=new ISmallButton('l');
438 $ledger->label=_("Catégorie");
439 $ledger->javascript=" show_cat_choice()";
440 echo $ledger->input();
441
442 /* create a hidden div for the ledger */
443 echo '<div id="div_cat">';
444 echo '<h2 class="info">'._('Choix des categories').'</h2>';
445 $selected=(isset($_GET['r_cat']))?$_GET['r_cat']:null;
446
447 echo '<ul>';
448 for ($e=0; $e<count($array_cat); $e++)
449 {
451 $re=new ICheckBox('r_cat['.$e.']', $row['cat']);
452
453 if ($selected!=null&&isset($selected[$e]))
454 {
455 $re->selected=true;
456 }
457 echo '<li style="list-style-type: none;">'.$re->input().$row['name'].'('.$row['cat'].')</li>';
458 }
459 echo '</ul>';
460 $hide=new IButton('l2');
461 $hide->label=_("Valider");
462 $hide->javascript=" hide_cat_choice() ";
463 echo $hide->input();
464
465 echo '</div>';
466 $r=ob_get_contents();
467 ob_end_clean();
468 return $r;
469 }
$array_cat
Html Input.

References $_GET, $array_cat, $e, $ledger, $r, $row, $selected, and _.

◆ select_stock()

static HtmlInput::select_stock ( $p_cn,
$p_name,
$p_mode )
static

Create an ISelect object containing the available repository for reading or writing.

Remarks
$g_user global.
Parameters
$p_cndb object
$p_namename of the select
$p_modeis 'R' for reading, 'W' for writinh
Returns
ISelect
Exceptions
Exceptionif p_mode is wrong

Definition at line 1001 of file html_input.class.php.

1002 {
1003 global $g_user;
1004 if (!in_array($p_mode, array('R', 'W')))
1005 {
1006 throw new Exception(__FILE__.":".__LINE__." $p_mode invalide");
1007 }
1008 $profile=$g_user->get_profile();
1009 $sel=new ISelect($p_name);
1010
1011 if ($p_mode=='W')
1012 {
1013 $sel->value=$p_cn->make_array("
1014 select r_id,r_name
1015 from stock_repository join profile_sec_repository using (r_id)
1016 where
1017 ur_right='W' and p_id=".sql_string($profile).
1018 " order by 2");
1019 return $sel;
1020 }
1021 if ($p_mode=='R')
1022 {
1023 $sel->value=$p_cn->make_array("
1024 select r_id,r_name
1025 from stock_repository join profile_sec_repository using (r_id)
1026 where
1027 p_id=".sql_string($profile).
1028 " order by 2");
1029 return $sel;
1030 }
1031 }
sql_string($p_string)
Fix the problem with the quote char for the database.
Html Input , create a tag <SELECT> ... </SELECT> if readonly == true then display the label correspon...

References $g_user, $profile, $sel, and sql_string().

+ Here is the call graph for this function:

◆ set_attribute()

HtmlInput::set_attribute ( $p_name,
$p_value )

add an HTML attribute for the INPUT field

Parameters
$p_namename of the parameter
$p_valuedefault value of this parameter

Reimplemented in IPopup.

Definition at line 128 of file html_input.class.php.

129 {
130 $this->attribute[]=array($p_name, $p_value);
131 $this->$p_name=$p_value;
132 }

Referenced by IAncCard\input(), and ITva_Popup\input().

◆ set_placeholder()

HtmlInput::set_placeholder ( $placeholder)

set HTML placeholder attribut

Parameters
string$placeholder

Definition at line 116 of file html_input.class.php.

117 {
118 $this->placeholder = $placeholder;
119 return $this;
120 }
$anc_filter placeholder

References $placeholder, and placeholder.

◆ set_value()

HtmlInput::set_value ( $p_string)

Set the value of input (IText, INum,...)

Parameters
string$p_string

Reimplemented in ISelect.

Definition at line 138 of file html_input.class.php.

139 {
140 $this->value=$p_string;
141 }

References value.

◆ setReadOnly()

HtmlInput::setReadOnly ( $p_read)

Definition at line 100 of file html_input.class.php.

101 {
102 $this->readOnly=$p_read;
103 }

References readOnly.

Referenced by Acc_Ledger_Fin\input().

◆ show_receipt_document()

static HtmlInput::show_receipt_document ( $p_jr_id,
$p_name = "" )
static

Returns HTML code for displaying a icon with a link to a receipt document from the ledger.

Parameters
$p_jr_idjrn.jr_id
$p_namename in the link , if the name is empty then we show the icon
Returns
nothing or HTML Code for a link to the document

Definition at line 1195 of file html_input.class.php.

1196 {
1197 $cn=\Dossier::connect();
1198 $image=$p_name;
1199
1200 // Check the jr_id has a receipt document
1201 $array=$cn->get_array('select jr_def_id,jr_pj_name,jr_grpt_id from jrn where jr_id=$1',
1202 array($p_jr_id));
1203 if (count($array)==0)
1204 return "";
1205 if ($array[0]['jr_pj_name']=="")
1206 return "";
1207 $str_dossier=Dossier::get();
1208
1209 // Name is empty then use an image
1210 if ($p_name=="")
1211 {
1212 $image='<IMG style="width:24px;height:24px;border:0px" SRC="image/documents.png" title="'.h($array[0]['jr_pj_name']).'" >';
1213 }
1214
1215 // Build the url
1216 $href=http_build_query(array('gDossier'=>Dossier::id(), 'jr_id'=>$p_jr_id,
1217 'act'=>'RAW:receipt'));
1218
1219 $r=sprintf('<A class="mtitle line" HREF="export.php?%s">%s</A>', $href,
1220 $image);
1221 return $r;
1222 }
$str_dossier

References width.

◆ show_reconcile()

static HtmlInput::show_reconcile ( $p_div,
$let,
$span = "" )
static

Definition at line 1125 of file html_input.class.php.

1126 {
1127 $r='<A style="color:red;text-decoration:underline" href="javascript:void(0)" onclick="show_reconcile(\''.$p_div.'\',\''.$let.'\')">'.$let.$span.'</A>';
1128 return $r;
1129 }

References $let, $r, and $span.

◆ simple_array_to_hidden()

static HtmlInput::simple_array_to_hidden ( $array)
static

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;.

Parameters
double$array

Definition at line 671 of file html_input.class.php.

672 {
673 if (empty ($array)) return "";
674 $r="";
675 foreach ( $array as $key=>$value) {
676 $r.=HtmlInput::hidden($key, $value);
677 }
678 return $r;
679 }

References $array, $r, $value, and hidden().

+ Here is the call graph for this function:

◆ submit()

static HtmlInput::submit ( $p_name,
$p_value,
$p_javascript = "",
$p_class = "smallbutton" )
static

Definition at line 229 of file html_input.class.php.

231 {
232
233 return '<INPUT TYPE="SUBMIT" class="'.$p_class.'" NAME="'.$p_name.'" ID="'.$p_name.'_submit_id" VALUE="'.$p_value.'" '.$p_javascript.'>';
234 }

Referenced by ICard\test_me().

◆ title_box()

static HtmlInput::title_box ( $p_name,
$p_div,
$p_mod = "close",
$p_js = "",
$p_draggable = "n",
$p_enlarge = 'n',
$raw = "",
$refresh = '' )
static

Title for boxes, you can customize the symbol thanks symbol with the mode "custom".

Parameters
string$p_nameTitle
string$divelement id, except for mode none or custom
string$p_modhide , close , zoom , custom or none, with custom , the $name contains all the code
string$p_jscontains the javascript if mod = "custom" or "zoom" contains button + code
char$p_draggable,y= yes n = no ,if set to yes the box will be draggable
Returns
type

Definition at line 894 of file html_input.class.php.

896 {
897 $p_div=strip_tags($p_div);
898 $r='<div class="bxbutton">';
899
900 // If draggable : display a icon to unpin and move the dialog box
901 if ($p_draggable=="y")
902 {
903 $r.=Icon_Action::draggable($p_div);
904 }
905 if ( $p_enlarge=='y') {
906 $r.=Icon_Action::full_size($p_div);
907 }
908 if ( $refresh != '') {
909 $r.=Icon_Action::refresh(uniqid(), $refresh);
910 }
911 if ($p_mod=='close')
912 {
913 $r.=Icon_Action::close($p_div, $p_js);
914 }
915 elseif ($p_mod=='zoom')
916 {
917 $r.=Icon_Action::zoom($p_div,$p_js);
918 }
919 elseif ($p_mod=='hide')
920 {
921 $r.=Icon_Action::hide("&#xe816;", "$('$p_div').hide();$p_js");
922 }
923 elseif ($p_mod=='custom')
924 {
925 $r.='<span id="span_'.$p_div.'" style="float:right;margin-right:5px">'.$p_js."</span>";
926 }
927 elseif ($p_mod=='none')
928 {
929 $r.="";
930 }
931 else
932 {
933 throw new Exception(__FILE__.":".__LINE__._("Paramètre invalide p_mod = '$p_mod'"));
934 }
935
936
937 $r.='</div>';
938 $r.=h2($p_name, ' class="title" ',$raw);
939
940 return $r;
941 }
h2($p_string, $p_class="", $raw="")
Definition ac_common.php:68
static close($p_div)
Return a html string with an anchor which close the inside popup.
static draggable($p_div)
Display a icon for fix or move a div.
static refresh($p_id, $javascript)
static zoom($p_div, $p_javascript)
Display a icon for zooming.
static hide($action, $javascript)
Return a html string with an anchor to hide a div, put it in the right corner.
static full_size($p_div)
if( $delta< 0) elseif( $delta==0)

References $r, $refresh, Icon_Action\close(), Icon_Action\draggable(), elseif, Icon_Action\full_size(), h2(), Icon_Action\hide(), Icon_Action\refresh(), and Icon_Action\zoom().

+ Here is the call graph for this function:

◆ warnbulle()

static HtmlInput::warnbulle ( $p_comment)
static
Deprecated
since version 7.0
See also
Icon_Action\warnbulle
Parameters
type$p_comment
Returns
string

Definition at line 290 of file html_input.class.php.

291 {
292 throw new Exception("DEPRECATED");
293 }

Field Documentation

◆ $attribute

HtmlInput::$attribute

Definition at line 75 of file html_input.class.php.

◆ $css_size

HtmlInput::$css_size

Definition at line 78 of file html_input.class.php.

Referenced by IPoste\input().

◆ $ctrl

HtmlInput::$ctrl

$ctrl is the control to update (see js_search_card_control)

Definition at line 70 of file html_input.class.php.

◆ $disabled

HtmlInput::$disabled

$disabled poss. value == true or nothing, to disable INPUT

Definition at line 65 of file html_input.class.php.

Referenced by ISelect\input().

◆ $extra

HtmlInput::$extra

$extra different usage, it depends of the $type

Definition at line 66 of file html_input.class.php.

Referenced by IText\display(), IButton\input(), INum\input(), IPoste\input(), and ISmallButton\input().

◆ $extra2

HtmlInput::$extra2

$extra2 different usage, it depends of the $type

Definition at line 67 of file html_input.class.php.

◆ $heigh

HtmlInput::$heigh

Definition at line 74 of file html_input.class.php.

◆ $id

◆ $javascript

HtmlInput::$javascript

◆ $label

HtmlInput::$label

$label the question before the input

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

Referenced by IAncCard\input(), and ICard\input().

◆ $name

◆ $placeholder

HtmlInput::$placeholder

Definition at line 79 of file html_input.class.php.

Referenced by set_placeholder().

◆ $readOnly

HtmlInput::$readOnly

$readonly true : we cannot change value

Definition at line 60 of file html_input.class.php.

◆ $require

HtmlInput::$require

Definition at line 72 of file html_input.class.php.

◆ $selected

HtmlInput::$selected

$selected for SELECT RADIO and CHECKBOX the selected value

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

Referenced by select_cat().

◆ $size

HtmlInput::$size

$size size of the input

Definition at line 61 of file html_input.class.php.

Referenced by IPoste\input().

◆ $style

HtmlInput::$style

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

Referenced by INum\display(), and ISelect\input().

◆ $tabindex

HtmlInput::$tabindex

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

◆ $table

HtmlInput::$table

$table =1 add the table tag

Definition at line 63 of file html_input.class.php.

Referenced by ITva_Popup\input().

◆ $type

HtmlInput::$type

$type type of the widget

Definition at line 57 of file html_input.class.php.

◆ $value

◆ $width

HtmlInput::$width

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


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