noalyss Version-9
Public Member Functions | Static Public Member Functions | Data Fields
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. 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 anchor ($p_text, $p_url="", $p_js="", $p_style=' class="line" ', $p_title="click", array $p_attribute=[])
 Return a simple anchor with a url or a javascript if $p_js is not null then p_url will be javascript:void(0) we don't add the event onclick. More...
 
static anchor_action ($action, $javascript, $id=NULL, $p_class="button", $p_symbole="")
 Anchor Html with javascript. More...
 
static anchor_close ($div, $p_js="")
 Return a html string with an anchor which close the inside popup. More...
 
static anchor_empty ($p_text, $p_id, $p_title="")
 let you create only a link and set an id on it. More...
 
static anchor_hide ($action, $javascript)
 Return a html string with an anchor to hide a div, put it in the right corner. More...
 
static array_to_hidden ($array, $global_array)
 transform request data to hidden More...
 
static array_to_string ($array, $global_array, $start="?")
 transform request data to string More...
 
static button ($p_name, $p_value, $p_javascript="", $p_class="smallbutton")
 
static button_action ($action, $javascript, $id=NULL, $p_class="button", $p_symbole="")
 button Html with javascript More...
 
static button_action_add ()
 
static button_action_remove_operation ($p_operation)
 
static button_anchor ($p_label, $p_value, $p_name="", $p_javascript="", $p_class="smallbutton")
 create a button with a ref More...
 
static button_choice_ledger ($p_array)
 
static button_close ($div_name, $class='smallbutton')
 close button for the HTML popup More...
 
static button_hide ($div_name)
 Hide the HTML popup. More...
 
static button_image ($javascript, $id="xx", $p_class='class="button"', $p_image="")
 button Html image More...
 
static calendar_zoom ($obj)
 Zoom the calendar. More...
 
static card_detail ($p_qcode, $pname='', $p_style="", $p_nohistory=false, $nofollowup=false)
 show the detail of a card More...
 
static default_value ($ind, $default, $array)
 return default if the value if the value doesn't exist in the array More...
 
static default_value_get ($ind, $default)
 return default if the value if the value doesn't exist in $_GET use HttpInput instead More...
 
static default_value_post ($ind, $default)
 return default if the value if the value doesn't exist in $_POST use HttpInput instead More...
 
static default_value_request ($ind, $default)
 return default if the value if the value doesn't exist in $_REQUEST use HttpInput instead More...
 
static detail_action ($ag_id, $p_mesg, $p_modify=1)
 return an anchor to view the detail of an action More...
 
static detail_modele_document ($p_id, $p_mesg)
 return a string containing the html code for calling the modifyModeleDocument More...
 
static detail_op ($p_jr_id, $p_mesg)
 return a string containing the html code for calling the modifyOperation More...
 
static display_periode ($p_id)
 
static errorbulle ($p_comment)
 
static extension ()
 
static filter_list ($p_list_id)
 Display a field for searching an element in a list, the searchable text must be in an element with the className search-content. More...
 
static filter_table ($p_table_id, $p_col, $start_row)
 filter the rows in a table and keep the colored row in alternance More...
 
static filter_table_form ($p_table_id, $p_col, $start_row, $p_name, $p_old_value)
 
static followup_card_button ($f_id, $p_mesg)
 display a div with the history of the card More...
 
static generate_id ($p_prefix)
 generate an unique id for a widget, More...
 
static get_to_hidden ($array)
 transform $_GET data to hidden More...
 
static get_to_string ($array, $start="?")
 transform $_GET data to string More...
 
static hidden ($p_name, $p_value, $p_id="")
 
static history_account ($p_account, $p_mesg, $p_style="", $p_exercice="")
 display a div with the history of the account More...
 
static history_anc_account ($p_account, $p_mesg, $p_style="", $p_exercice="")
 display a div with the history of the analytic account More...
 
static history_card ($f_id, $p_mesg, $p_style="", $p_exercice="")
 display a div with the history of the card More...
 
static history_card_button ($f_id, $p_mesg, $p_exercice="")
 display a div with the history of the card More...
 
static image_click ($p_image, $p_js, $p_message, $p_class="")
 Image to click ,. More...
 
static json_to_hidden ($p_json)
 transform a json to hidden More...
 
static post_to_hidden ($array)
 transform $_POST data to hidden More...
 
static post_to_string ($array)
 transform $_POST data to string More...
 
static print_window ()
 Javascript to print the current window. More...
 
static remove_stock ($p_id, $p_mesg)
 return a string containing the html code for calling the removeStock More...
 
static request_to_hidden (array $array)
 transform $_REQUEST data to hidden More...
 
static request_to_string ($array, $start="?")
 transform $_REQUEST data to string More...
 
static reset ($p_value)
 
static select_cat ($array_cat)
 create a hidden plus button to select the cat of ledger More...
 
static select_stock ($p_cn, $p_name, $p_mode)
 Create an ISelect object containing the available repository for reading or writing. More...
 
static show_receipt_document ($p_jr_id, $p_name="")
 Returns HTML code for displaying a icon with a link to a receipt document from the ledger. More...
 
static show_reconcile ($p_div, $let, $span="")
 
static simple_array_to_hidden ($array)
 Transform a double array as a HTML string with hidden html value array has the formarray ["name"]="x",array['value']="y") the key name will be the hidden input name;. More...
 
static submit ($p_name, $p_value, $p_javascript="", $p_class="smallbutton")
 
static title_box ($p_name, $p_div, $p_mod="close", $p_js="", $p_draggable="n", $p_enlarge='n')
 Title for boxes, you can customize the symbol thanks symbol with the mode "custom". More...
 
static warnbulle ($p_comment)
 

Data Fields

 $attribute
 
 $css_size
 
 $ctrl
 
 $disabled
 
 $extra
 
 $extra2
 
 $heigh
 
 $id
 
 $javascript
 
 $label
 
 $name
 
 $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

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, ICard, INum, IDate, InputCheckBox, InputSwitch, IText, IPeriod, ICheckBox, IColor, IFile, IPoste, ISelect, ITextarea, IConcerned, and ITva_Popup.

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

81 {
82 $this->name=$p_name;
83 $this->readOnly=false;
84 $this->size=20;
85 $this->width=50;
86 $this->heigh=20;
87 $this->value=$p_value;
88 $this->selected="";
89 $this->table=0;
90 $this->disabled=false;
91 $this->javascript="";
92 $this->extra="";
93 $this->extra2="all";
94 $this->attribute=array();
95 $this->id=$p_id;
96 $this->require=false;
97 }
$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 201 of file html_input.class.php.

202 {
203 $r= "Type ".$this->type."<br>";
204 $r.= "name ".$this->name."<br>";
205 $r.= "value".$this->value."<br>";
206 $readonly=(isset($this->readOnly) && $this->readOnly==false)?"false":"true";
207 $r.= "read only".$readonly."<br>";
208 return $r;
209 }
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 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.

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 953 of file html_input.class.php.

955 {
956 if ($p_js!="")
957 {
958 $p_url='href="javascript:void(0)"';
959 } else {
960 $p_url=sprintf('href="%s"',$p_url);
961 }
962 $str_javascript_attr=build_javascript_attribute($p_attribute);
963 $str=sprintf('<a %s %s %s %s title="%s">%s</a>', $str_javascript_attr,$p_style, $p_url, $p_js, $p_title,$p_text);
964 return $str;
965 }
$str
Definition: fiche.inc.php:91
build_javascript_attribute($pa_attribute)
build a string with the attribute that javascript can use , that string must be included in a DOM ele...
$p_url

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

Referenced by Acc_Bilan\display_form(), Follow_Up_Other_Concerned\display_row(), Acc_Plan_MTable\display_row(), Noalyss\Mobile\execute_menu(), and Tva_Rate_MTable\input().

+ 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 509 of file html_input.class.php.

511 {
512 if ($id==NULL)
513 {
514 $id=uniqid("xx");
515 }
516 $r="";
517 $r.='<a id="'.$id.'" href="javascript:void(0)" class="'.$p_class.'" onclick="'.$javascript.'">'.$p_symbole.h($action).'</a>';
518 return $r;
519 }
$action

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

Referenced by Follow_Up_Other_Concerned\display_linked_count(), and Acc_Ledger_Search\select_ledger().

◆ 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 496 of file html_input.class.php.

497 {
498 throw new Exception("DEPRECATED");
499 }

◆ 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 932 of file html_input.class.php.

933 {
934 $p_url="javascript:void(0)";
935 $str=sprintf('<a id="%s" href="javascript:void(0)" class="line" title="%s">%s</a>',
936 $p_id, $p_title, $p_text);
937 return $str;
938 }

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 582 of file html_input.class.php.

583 {
584 throw new Exception("DEPRECATED");
585 }

◆ 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 618 of file html_input.class.php.

619 {
620
621 $r="";
622
623 if (count($global_array)==0)
624 return '';
625 foreach ($array as $a)
626 {
627 if (isset($global_array [$a]))
628 if (is_array($global_array[$a])==false)
629 {
630 $r.=HtmlInput::hidden($a, $global_array [$a]);
631 }
632 else
633 {
634 if (count($global_array[$a])>0)
635 {
636 foreach ($global_array[$a] as $value)
637 {
639 }
640 }
641 }
642 }
643
644 return $r;
645 }
static hidden($p_name, $p_value, $p_id="")

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

Referenced by Follow_Up\display_search(), get_to_hidden(), Fiche\HtmlTableHeader(), post_to_hidden(), and request_to_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 715 of file html_input.class.php.

716 {
717
718 $r="";
719
720 if (count($global_array)==0)
721 return '';
722 $and="";
723 foreach ($array as $a)
724 {
725 if (isset($global_array [$a]))
726 {
727 if (is_array($global_array[$a])==false)
728 {
729 $r.=$and."$a=".$global_array [$a];
730 }
731 else
732 {
733 for ($i=0; $i<count($global_array[$a]); $i++)
734 {
735 $r.=$and."$a"."[]=".$global_array[$a][$i];
736 $and="&amp;";
737 }
738 }
739 }
740 $and="&amp;";
741 }
742 if (trim ($r) != "") $r=$start.$r;
743 return $r;
744 }

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

Referenced by get_to_string(), post_to_string(), and request_to_string().

◆ button()

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

◆ 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 529 of file html_input.class.php.

531 {
532 if ($id==NULL)
533 {
534 $id=uniqid("xx");
535 }
536 $r="";
537 $r.='<input type="button" id="'.$id.'" class="'.$p_class.'" onclick="'.$javascript.'" value="'.$p_symbole.h($action).'">';
538 return $r;
539 }

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

Referenced by Manage_Table_SQL\ajax_input(), Follow_Up_Other_Concerned\button_action_add_concerned_card(), Acc_Ledger_Search\button_propose_filter(), Manage_Table_SQL\display_table(), Pre_operation\form_get(), html_page_start(), Acc_Plan_MTable\input(), Acc_Report_MTable\input_custom(), and Noalyss\Mobile\page_start().

◆ button_action_add()

static HtmlInput::button_action_add ( )
static

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

1193 {
1195 $js=HtmlInput::button_action(_('Nouvel événement'),
1196 'action_add('.$dossier.')', 'xx', 'smallbutton');
1197 return $js;
1198 }
$dossier
static id()
return the 'gDossier' value after a check
static button_action($action, $javascript, $id=NULL, $p_class="button", $p_symbole="")
button Html with javascript

◆ 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 1182 of file html_input.class.php.

1183 {
1184 $rmOperation=sprintf("confirm_box(null,'"._('Voulez-vous effacer cette relation ')."',function () {remove_operation('%s','%s');});",
1185 dossier::id(), $p_operation);
1186 $js=Icon_Action::trash("acop".$p_operation, $rmOperation);
1187 return $js;
1188 }
$input_from id
Definition: balance.inc.php:63
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
$p_javascriptjavascript for this button
Returns
string with htmlcode

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

258 {
259 $href="";
260 if ($p_value!="")
261 $href=sprintf(' href ="%s" ', $p_value);
262 $r=sprintf('<span id="%s" > <A class="'.$p_class.'" style="display:inline-block;" %s %s >%s</A></span>',
263 $p_name, $href, $p_javascript, $p_label);
264 return $r;
265 }
$href
Definition: adm.inc.php:31

References $href, and $r.

Referenced by Acc_Ledger\button_new_operation(), and Anticipation\input_form().

◆ 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 1105 of file html_input.class.php.

1106 {
1107 extract($p_array, EXTR_SKIP);
1108 $bledger_param=json_encode(array(
1109 'dossier'=>$_REQUEST['gDossier'],
1110 'type'=>$type,
1111 'all_type'=>$all_type,
1112 'div'=>$div,
1113 'class'=>'inner_box'
1114 ));
1115
1116 $bledger_param=noalyss_str_replace('"', "'", $bledger_param);
1117 $bledger=new ISmallButton('l');
1118 $bledger->label=_("choix des journaux");
1119 $bledger->javascript=" show_ledger_choice($bledger_param)";
1120 $f_ledger=$bledger->input();
1121 $hid_jrn="";
1122 if (isset($_REQUEST[$div.'nb_jrn']))
1123 {
1124 for ($i=0; $i<$_REQUEST[$div.'nb_jrn']; $i++)
1125 {
1126 if (isset($_REQUEST[$div."r_jrn"][$i]))
1127 $hid_jrn.=HtmlInput::hidden($div.'r_jrn['.$i.']',
1128 $_REQUEST[$div."r_jrn"][$i]);
1129 }
1130 $hid_jrn.=HtmlInput::hidden($div.'nb_jrn',
1131 $_REQUEST[$div.'nb_jrn']);
1132 } else
1133 {
1134 $hid_jrn=HtmlInput::hidden($div.'nb_jrn', 0);
1135 }
1136 echo $f_ledger;
1137 echo '<span id="ledger_id'.$div.'">';
1138 echo $hid_jrn;
1139 echo '</span>';
1140 }
noalyss_str_replace($search, $replace, $string)
Definition: ac_common.php:1553
$div
$_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 464 of file html_input.class.php.

465 {
466 $a=new IButton('Fermer');
467 $a->label=_("Fermer");
468 $a->class=$class;
469 $a->javascript="removeDiv('".$div_name."')";
470 $html=$a->input();
471
472 return $html;
473 }
if(headers_sent() &&DEBUGNOALYSS > 0) $html
$class
Html Input.

References $a, $class, and $html.

Referenced by Acc_Operation\form_clone_operation(), and Acc_Ledger_Search\select_ledger().

◆ button_hide()

static HtmlInput::button_hide (   $div_name)
static

Hide the HTML popup.

Parameters
type$div_name
Returns
type

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

481 {
482 $a=new IButton('Fermer');
483 $a->label=_("Fermer");
484 $a->javascript="$('".$div_name."').hide()";
485 $html=$a->input();
486
487 return $html;
488 }

References $a, and $html.

Referenced by Noalyss\Dbg\display_global(), Noalyss\Dbg\display_request(), Acc_Ledger_Search\display_search_form(), Document_modele\form(), Pre_operation\form_get(), and Noalyss\Dbg\hidden_info().

◆ 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 561 of file html_input.class.php.

563 {
564 if ($id=="xx")
565 {
566 $id=uniqid("xx");
567 }
568 $r="";
569 $r.='<image id="'.$id.'" '.$p_class.' onclick="'.$javascript.'" src="'.$p_image.'" />';
570 return $r;
571 }

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 1090 of file html_input.class.php.

1091 {
1092 $button=new ISmallButton("calendar", _("Calendrier"));
1093 $button->javascript="calendar_zoom($obj)";
1094 return $button->input();
1095 }

◆ 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 600 of file html_input.class.php.

602 {
603 if ($pname !=='') {$pname='<span class="v-large">('.$pname.')</span>';}
604 $r="";
605 $histo=($p_nohistory==true)?' ,nohistory:1':"";
606 $followup=($nofollowup==true)?' ,nofollowup:1':"";
607 $r.=sprintf('<a href="javascript:void(0)" %s class="detail" onclick="fill_ipopcard({qcode:\'%s\' %s %s})">%s %s</a>',
608 $p_style, $p_qcode, $histo,$followup,$p_qcode,$pname);
609 return $r;
610 }

References $histo, and $r.

Referenced by Acc_Plan_MTable\display_row(), Acc_Account_Ledger\HtmlTable(), and Acc_Ledger_Search\list_operation().

◆ 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 800 of file html_input.class.php.

801 {
802 if (!isset($array[$ind]))
803 {
804 return $default;
805 }
806 return $array[$ind];
807 }
for($i=0;$i<=6;$i++) $ind
Definition: calendar.php:34

References $array, and $ind.

Referenced by Stock\search_box(), and Stock_Goods\take_last_inventory().

◆ 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 818 of file html_input.class.php.

819 {
820 if (!isset($_GET[$ind]))
821 {
822 return $default;
823 }
824 return $_GET[$ind];
825 }
$_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 836 of file html_input.class.php.

837 {
838 if (!isset($_POST[$ind]))
839 {
840 return $default;
841 }
842 return $_POST[$ind];
843 }
$_POST['ac']
Definition: do.php:310

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 854 of file html_input.class.php.

855 {
856 if (!isset($_REQUEST[$ind]))
857 {
858 return $default;
859 }
860 return $_REQUEST[$ind];
861 }

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 302 of file html_input.class.php.

303 {
304 return sprintf('<A class="detail" style="text-decoration:underline;display:inline" HREF="javascript:view_action(%d,%d,%d)">%s</A>',
305 $ag_id, dossier::id(), $p_modify, $p_mesg);
306 }
$ag_id
Definition: action.inc.php:54
$p_mesg
Definition: opening.inc.php:34

References $ag_id, $p_mesg, and id.

◆ detail_modele_document()

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

return a string containing the html code for calling the modifyModeleDocument

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

312 {
313 return sprintf('<A class="detail" style="text-decoration:underline" HREF="javascript:modifyModeleDocument(%d,%d)">%s</A>',
315 }

References $p_id, $p_mesg, and id.

Referenced by Document_modele\myList().

◆ 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 289 of file html_input.class.php.

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

References $p_mesg, and id.

Referenced by Acc_Ledger_Purchase\confirm(), Anc_GrandLivre\display_html(), Anc_Listing\display_html(), Print_Operation_Currency\export_html(), and Acc_Ledger_Fin\insert().

◆ display_periode()

static HtmlInput::display_periode (   $p_id)
static

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

453 {
454 $r=sprintf('<a href="javascript:void(0)" onclick="display_periode(%d,%d)">Modifier</a>',
455 dossier::id(), $p_id);
456 return $r;
457 }

References $p_id, $r, and id.

◆ errorbulle()

static HtmlInput::errorbulle (   $p_comment)
static

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

278 {
279 global $g_failed;
280 if ( $p_comment == "") return "";
281 $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>',
282 $p_comment, $p_comment, $g_failed);
283 return $r;
284 }
global $g_failed

References $g_failed, and $r.

Referenced by Template_Card_Category\input(), Tva_Rate_MTable\input(), Manage_Table_SQL\input(), and Manage_Table_SQL\show_error().

◆ extension()

static HtmlInput::extension ( )
static

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

244 {
245 return self::hidden('plugin_code', $_REQUEST['plugin_code']);
246 }

References $_REQUEST, and hidden().

+ Here is the call graph for this function:

◆ 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 1067 of file html_input.class.php.

1068 {
1069 $r="<span>";
1070 $r.='<span class=" icon">&#xf50d;</span>';
1071 $r.=sprintf('<input id="search_%s" type="TEXT" class="input_text" name="filter_list%s" placeholder="%s" onkeyup="filter_list(this,\'%s\')">',
1072 $p_list_id,$p_list_id,_("Recherche"),$p_list_id);
1073
1074 $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);
1075 $r.='</span>';
1076 return $r;
1077 }

References $r.

Referenced by Select_Box\input(), and Select_Dialog\input().

◆ 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 1039 of file html_input.class.php.

1040 {
1041 $r="
1042 <span>
1043 <span class=\"icon\" >&#xf50d;</span>
1044
1045 <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=\""._("Recherche")."\">
1046 <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\">
1047 </span>
1048 ";
1049 $r.=' <span class="notice" id="info_'.$p_table_id.'"></span>';
1050 return $r;
1051 }

References $r.

Referenced by Pre_operation\display_list_operation(), Manage_Table_SQL\display_table(), Print_Operation_Currency\export_html(), Acc_Account_Ledger\filter_history(), Fiche\filter_history(), Anc_Operation\html_table(), Acc_Ledger\listing(), Follow_Up\myList(), and Document_modele\myList().

◆ 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 1019 of file html_input.class.php.

1021 {
1022 $r="
1023 <span>
1024 <span class=\"icon\" >&#xf50d;</span>
1025 <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=\""._("Recherche")."\">
1026 <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\">
1027 </span>
1028 ";
1029 $r.=' <span class="notice" id="info_'.$p_table_id.'"></span>';
1030 return $r;
1031 }

References $r.

◆ 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 365 of file html_input.class.php.

366 {
367 global $g_user;
368 $js=sprintf('onclick="view_followup_card(\'%s\',\'%s\')"', $f_id,
369 dossier::id());
370 $view_followup=HtmlInput::button(uniqid("fu"), $p_mesg, $js);
371 return $view_followup;
372 }
global $g_user
if no group available , then stop
static button($p_name, $p_value, $p_javascript="", $p_class="smallbutton")

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

+ 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 788 of file html_input.class.php.

789 {
790 $r=sprintf('%s_%d', $p_prefix, mt_rand(0, 999999));
791 return $r;
792 }

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 140 of file html_input.class.php.

141 {
142 require_once NOALYSS_INCLUDE.'/lib/function_javascript.php';
143 $attr="";
144 if (count($this->attribute)==0)
145 return "";
146
147 /* Add properties at the widget */
148 for ($i=0; $i<count($this->attribute); $i++)
149 {
150 list($name, $value)=$this->attribute[$i];
151 $tmp1=sprintf("$('%s').%s='%s';", $this->id, $name, $value);
152 $attr.=$tmp1;
153 }
155 return $attr;
156 }
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(), 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 1207 of file html_input.class.php.

1208 {
1209 $r="";
1210 $nb_attribute=count($this->attribute);
1211 for ($i=0; $i<$nb_attribute; $i++)
1212 {
1213 $r.=sprintf(' %s="%s" ', $this->attribute[$i][0],
1214 $this->attribute[$i][1]);
1215 }
1216 return $r;
1217 }

Referenced by INum\input(), IText\input(), ITva_Popup\input(), and ICheckBox\input().

◆ 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 679 of file html_input.class.php.

680 {
682 return $r;
683 }
static array_to_hidden($array, $global_array)
transform request data to hidden

References $_GET, $array, $r, and array_to_hidden().

Referenced by Stock\export_stock_histo_form(), Stock\export_stock_summary_list_form(), and Template_Card_Category\input().

+ Here is the call graph for this function:

◆ 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 752 of file html_input.class.php.

753 {
755 return $r;
756 }
static array_to_string($array, $global_array, $start="?")
transform request data to string

References $_GET, $array, $r, $start, and array_to_string().

Referenced by Fiche_Def\display(), Stock\history(), Follow_Up\myList(), and Html_Table\test_me().

+ Here is the call graph for this function:

◆ get_value()

HtmlInput::get_value ( )

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

Reimplemented in ISelect.

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

129 {
130 return $this->value;
131 }

References $value.

◆ hidden()

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

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

231 {
232 if ($p_id=="")
233 $p_id=$p_name;
234 if ( DEBUGNOALYSS > 2) {
235 return '<span style="font-size:80%;color:blue;background-color:lightgoldenrodyellow">'.
236 $p_id .
237 '= <INPUT TYPE="text" id="'.strip_tags($p_id).'" NAME="'.$p_name.'" VALUE="'.strip_tags($p_value??"").'" style="color:blue;font-size:80%">'.
238 '</span>';
239 }else
240 return '<INPUT TYPE="hidden" id="'.strip_tags($p_id).'" NAME="'.$p_name.'" VALUE="'.strip_tags($p_value??"").'">';
241 }

References $p_id.

Referenced by Manage_Table_SQL\ajax_input(), array_to_hidden(), Acc_Ledger\button_copy_operation(), Anc_GrandLivre\button_export_csv(), Anc_GrandLivre\button_export_pdf(), Acc_Ledger_Fin\confirm(), Acc_Ledger\confirm(), Acc_Ledger_Purchase\confirm(), Acc_Ledger_Sale\confirm(), confirm_with_string(), Pre_op_ach\display(), Pre_Op_Advanced\display(), Pre_op_ven\display(), Acc_Ledger\display_ledger(), Follow_Up\display_search(), Acc_Ledger_Search\display_search_form(), Stock\export_stock_histo_form(), Stock\export_stock_summary_list_form(), extension(), Anc_Group_Operation\form(), Document_modele\form(), Acc_Operation\form_clone_operation(), Tax_Summary\form_export_csv(), Tax_Summary\form_export_pdf(), Periode\form_periode_add(), Anc_Plan\hidden(), Single_Record\hidden(), Acc_Account_Ledger\HtmlTableHeader(), Fiche\HtmlTableHeader(), Acc_Ledger_Fin\input(), Acc_Ledger\input(), Acc_Ledger_Purchase\input(), Acc_Ledger_Sale\input(), InputCheckBox\input(), InputSwitch\input(), Template_Card_Category\input(), Tva_Rate_MTable\input(), Manage_Table_SQL\input(), Acc_Report_MTable\input_custom(), Fiche_Def\input_detail(), Anticipation\input_form(), Acc_Ledger\input_new(), Fiche_Def\input_new(), json_to_hidden(), Html_Input_Noalyss\ledger_add_item(), Acc_Ledger_Search\list_operation_to_reconcile(), Fiche_Def\myList(), Acc_Ledger_Search\search_form(), Acc_Payment\select(), Acc_Ledger_Search\select_ledger(), Anc_Table\show_button(), Anc_Acc_List\show_button(), Anc_Group\show_button(), Anc_Balance_Double\show_button(), Anc_Balance_Simple\show_button(), Anc_Listing\show_button(), Lettering\show_letter(), simple_array_to_hidden(), Acc_Bilan\test_me(), Anc_Operation\test_me(), Fiche\test_me(), 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 383 of file html_input.class.php.

384 {
385 global $g_user;
386 if ( $p_exercice=="") {
387 $p_exercice=$g_user->get_exercice();
388 }
389 $view_history=sprintf('<A class="detail" style="text-decoration:underline;%s" HREF="javascript:view_history_account(\'%s\',\'%s\',\'%s\')" >%s</A>',
390 $p_style, $p_account, dossier::id(),$p_exercice, $p_mesg);
391 return $view_history;
392 }
$p_exercice

References $g_user, $p_exercice, $p_mesg, and id.

Referenced by Anc_GrandLivre\display_html(), Anc_Listing\display_html(), Anc_Table\display_html(), and Acc_Plan_MTable\display_row().

◆ 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 400 of file html_input.class.php.

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

References $g_user, $p_exercice, $p_mesg, and id.

◆ 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 329 of file html_input.class.php.

330 {
331 global $g_user;
332 if ( $p_exercice=="") {
333 $p_exercice=$g_user->get_exercice();
334 }
335 $view_history=sprintf('<A class="detail" style="text-decoration:underline;%s" HREF="javascript:view_history_card(\'%s\',\'%s\',\'%s\')" >%s</A>',
336 $p_style, $f_id, dossier::id(),$p_exercice, $p_mesg);
337 return $view_history;
338 }

References $f_id, $g_user, $p_exercice, $p_mesg, and id.

Referenced by Anc_GrandLivre\display_html(), Anc_Listing\display_html(), and Anc_Table\display_html().

◆ 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 346 of file html_input.class.php.

347 {
348 static $e=0;
349 $e++;
350 global $g_user;
351 if ( $p_exercice=="") {
352 $p_exercice=$g_user->get_exercice();
353 }
354 $js=sprintf('onclick="view_history_card(\'%s\',\'%s\',\'%s\')"', $f_id,
356 $view_history=HtmlInput::button("hcb".$e, $p_mesg, $js);
357 return $view_history;
358 }

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

+ 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 547 of file html_input.class.php.

548 {
549 $ret=sprintf('<a class="nav %s" style="display:inline" title="%s"><img src="image/%s" onclick="%s"></a>',
550 $p_class, $p_message, $p_image, $p_js);
551 return $ret;
552 }

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 664 of file html_input.class.php.

665 {
666 $aJson=json_decode($p_json);
667 foreach ($aJson as $key=> $value)
668 {
669 echo HtmlInput::hidden($key, $value);
670 }
671 }

References $value, and hidden().

Referenced by Manage_Table_SQL\ajax_input().

+ 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)
set the extra javascript property for the INPUT field

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

179 {
180 $name=($p_name!=null)?$p_name.'=':'';
181 if (count($this->attribute)==0)
182 return $name."{}";
183 $ret=$name."{";
184 $and='';
185
186 for ($i=0; $i<count($this->attribute); $i++)
187 {
188 list($name, $value)=$this->attribute[$i];
189 $tmp1=sprintf($and."'%s':'%s'", $name, $value);
190 $ret.=$tmp1;
191 $and=',';
192 }
193
194 $ret.='}';
195 return $ret;
196 }
for( $i=0; $i< $nb_row; $i++)
if(!headers_sent())
– pour utiliser unoconv démarrer un server libreoffice commande libreoffice –headless –accept="socket...

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

◆ 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 691 of file html_input.class.php.

692 {
694 return $r;
695 }

References $_POST, $array, $r, and array_to_hidden().

Referenced by Acc_Ledger\button_copy_operation(), Acc_Ledger_Purchase\confirm(), and Acc_Ledger_Sale\confirm().

+ Here is the call graph for this function:

◆ 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 764 of file html_input.class.php.

765 {
767 return $r;
768 }

References $_POST, $array, $r, and array_to_string().

+ Here is the call graph for this function:

◆ print_window()

static HtmlInput::print_window ( )
static

Javascript to print the current window.

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

591 {
592 $r='';
593 $r.=HtmlInput::button('print', _('Imprimer'), 'onclick="window.print();"');
594 return $r;
595 }

References $r, and button().

Referenced by Stock\history(), Fiche\HtmlTableHeader(), and Stock\summary().

+ 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 320 of file html_input.class.php.

321 {
322 return sprintf('<A class="detail" style="text-decoration:underline" HREF="javascript:removeStock(%d,%d)">%s</A>',
324 }

References $p_id, $p_mesg, and 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 703 of file html_input.class.php.

704 {
706 return $r;
707 }

References $_REQUEST, $array, $r, and array_to_hidden().

Referenced by Follow_Up\display(), Anc_Print\display_form(), Anc_Acc_List\display_form(), Anc_Table\display_form(), Anc_Balance_Double\display_form(), and Follow_Up\show_action_list().

+ Here is the call graph for this function:

◆ 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 776 of file html_input.class.php.

777 {
779 return $r;
780 }

References $_REQUEST, $array, $r, $start, and array_to_string().

Referenced by Follow_Up\display_children(), and Follow_Up\display_parent().

+ Here is the call graph for this function:

◆ reset()

static HtmlInput::reset (   $p_value)
static

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

226 {
227 return '<INPUT TYPE="RESET" class="smallbutton" VALUE="'.$p_value.'">';
228 }

◆ 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 415 of file html_input.class.php.

416 {
417 ob_start();
418 $ledger=new ISmallButton('l');
419 $ledger->label=_("Catégorie");
420 $ledger->javascript=" show_cat_choice()";
421 echo $ledger->input();
422
423 /* create a hidden div for the ledger */
424 echo '<div id="div_cat">';
425 echo '<h2 class="info">'._('Choix des categories').'</h2>';
426 $selected=(isset($_GET['r_cat']))?$_GET['r_cat']:null;
427
428 echo '<ul>';
429 for ($e=0; $e<count($array_cat); $e++)
430 {
432 $re=new ICheckBox('r_cat['.$e.']', $row['cat']);
433
434 if ($selected!=null&&isset($selected[$e]))
435 {
436 $re->selected=true;
437 }
438 echo '<li style="list-style-type: none;">'.$re->input().$row['name'].'('.$row['cat'].')</li>';
439 }
440 echo '</ul>';
441 $hide=new IButton('l2');
442 $hide->label=_("Valider");
443 $hide->javascript=" hide_cat_choice() ";
444 echo $hide->input();
445
446 echo '</div>';
447 $r=ob_get_contents();
448 ob_end_clean();
449 return $r;
450 }
$array_cat
Html Input.

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

◆ 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 978 of file html_input.class.php.

979 {
980 global $g_user;
981 if (!in_array($p_mode, array('R', 'W')))
982 {
983 throw new Exception(__FILE__.":".__LINE__." $p_mode invalide");
984 }
985 $profile=$g_user->get_profile();
986 $sel=new ISelect($p_name);
987
988 if ($p_mode=='W')
989 {
990 $sel->value=$p_cn->make_array("
991 select r_id,r_name
992 from stock_repository join profile_sec_repository using (r_id)
993 where
994 ur_right='W' and p_id=".sql_string($profile).
995 " order by 2");
996 return $sel;
997 }
998 if ($p_mode=='R')
999 {
1000 $sel->value=$p_cn->make_array("
1001 select r_id,r_name
1002 from stock_repository join profile_sec_repository using (r_id)
1003 where
1004 p_id=".sql_string($profile).
1005 " order by 2");
1006 return $sel;
1007 }
1008 }
sql_string($p_string)
Fix the problem with the quote char for the database.
Definition: ac_common.php:511
Html Input , create a tag <SELECT> ... </SELECT> if readonly == true then display the label correspon...

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

Referenced by Stock_Goods\input(), Stock\search_box(), and Acc_Ledger\select_depot().

+ Here is the call graph for this function:

◆ set_attribute()

HtmlInput::set_attribute (   $p_name,
  $p_value 
)

set the extra javascript property for the INPUT field

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

Reimplemented in IPopup.

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

111 {
112 $this->attribute[]=array($p_name, $p_value);
113 $this->$p_name=$p_value;
114 }

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

◆ set_value()

HtmlInput::set_value (   $p_string)

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

Parameters
string$p_string

Reimplemented in ISelect.

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

121 {
122 $this->value=$p_string;
123 }

References value.

◆ setReadOnly()

HtmlInput::setReadOnly (   $p_read)

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

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

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 1149 of file html_input.class.php.

1150 {
1151 global $cn;
1152 $image=$p_name;
1153
1154 // Check the jr_id has a receipt document
1155 $array=$cn->get_array('select jr_def_id,jr_pj_name,jr_grpt_id from jrn where jr_id=$1',
1156 array($p_jr_id));
1157 if (count($array)==0)
1158 return "";
1159 if ($array[0]['jr_pj_name']=="")
1160 return "";
1162
1163 // Name is empty then use an image
1164 if ($p_name=="")
1165 {
1166 $image='<IMG style="width:24px;height:24px;border:0px" SRC="image/documents.png" title="'.h($array[0]['jr_pj_name']).'" >';
1167 }
1168
1169 // Build the url
1170 $href=http_build_query(array('gDossier'=>Dossier::id(), 'jr_id'=>$p_jr_id,
1171 'act'=>'RAW:receipt'));
1172
1173 $r=sprintf('<A class="mtitle line" HREF="export.php?%s">%s</A>', $href,
1174 $image);
1175 return $r;
1176 }
$str_dossier
Definition: anc_od.inc.php:33
static get()
return a string to put to gDossier into a GET

Referenced by Anc_GrandLivre\display_html(), Acc_Ledger_Purchase\insert(), and Acc_Ledger_Sale\insert().

◆ show_reconcile()

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

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

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

References $r.

Referenced by Acc_Account_Ledger\HtmlTable(), and Fiche\HtmlTable().

◆ 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 651 of file html_input.class.php.

652 {
653 if (empty ($array)) return "";
654 $r="";
655 foreach ( $array as $key=>$value) {
657 }
658 return $r;
659 }

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

Referenced by Acc_Operation\form_clone_operation().

+ Here is the call graph for this function:

◆ submit()

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

◆ title_box()

static HtmlInput::title_box (   $p_name,
  $p_div,
  $p_mod = "close",
  $p_js = "",
  $p_draggable = "n",
  $p_enlarge = 'n' 
)
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 874 of file html_input.class.php.

876 {
877 $p_div=strip_tags($p_div);
878 $r='<div class="bxbutton">';
879
880 // If draggable : display a icon to unpin and move the dialog box
881 if ($p_draggable=="y")
882 {
883 $r.=Icon_Action::draggable($p_div);
884 }
885 if ( $p_enlarge=='y') {
886 $r.=Icon_Action::full_size($p_div);
887 }
888 if ($p_mod=='close')
889 {
890 $r.=Icon_Action::close($p_div, $p_js);
891 }
892 elseif ($p_mod=='zoom')
893 {
894 $r.=Icon_Action::zoom($p_div,$p_js);
895 }
896 elseif ($p_mod=='hide')
897 {
898 $r.=Icon_Action::hide("&#xe816;", "$('$p_div').hide();$p_js");
899 }
900 elseif ($p_mod=='custom')
901 {
902 $r.='<span id="span_'.$p_div.'" style="float:right;margin-right:5px">'.$p_js."</span>";
903 }
904 elseif ($p_mod=='none')
905 {
906 $r.="";
907 }
908 else
909 {
910 throw new Exception(__FILE__.":".__LINE__._("Paramètre invalide p_mod = '$p_mod'"));
911 }
912
913
914 $r.='</div>';
915 $r.=h2($p_name, ' class="title" ');
916
917 return $r;
918 }
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 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, Icon_Action\close(), Icon_Action\draggable(), elseif, Icon_Action\full_size(), h2(), Icon_Action\hide(), and Icon_Action\zoom().

Referenced by Manage_Table_SQL\ajax_input(), Noalyss\Dbg\display_global(), Noalyss\Dbg\display_request(), Acc_Ledger_Search\display_search_form(), Pre_operation\form_get(), Periode\form_periode_add(), Noalyss\Dbg\hidden_info(), html_page_start(), Select_Dialog\input(), Noalyss\Mobile\page_start(), and Acc_Ledger_Search\select_ledger().

+ 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 272 of file html_input.class.php.

273 {
274 throw new Exception("DEPRECATED");
275 }

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(), INum\input(), IPoste\input(), IButton\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

HtmlInput::$id

◆ $javascript

HtmlInput::$javascript

$javascript is the javascript to add to the widget

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

Referenced by anchor_action(), button_action(), button_image(), IPoste\dsp_button(), IAncCard\input(), ICard\input(), IConcerned\input(), IPoste\input(), IPopup\input(), and ICard\search().

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

HtmlInput::$name

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

Referenced by IText\input().

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

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