noalyss Version-9
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)
 Hide the HTML popup.
 
static button_image ($javascript, $id="xx", $p_class='class="button"', $p_image="")
 button Html image
 
static calendar_zoom ($obj)
 Zoom the calendar.
 
static card_detail ($p_qcode, $pname='', $p_style="", $p_nohistory=false, $nofollowup=false)
 show the detail of a card
 
static default_value ($ind, $default, $array)
 return default if the value if the value doesn't exist in the array
 
static default_value_get ($ind, $default)
 return default if the value if the value doesn't exist in $_GET use HttpInput instead
 
static default_value_post ($ind, $default)
 return default if the value if the value doesn't exist in $_POST use HttpInput instead
 
static default_value_request ($ind, $default)
 return default if the value if the value doesn't exist in $_REQUEST use HttpInput instead
 
static detail_action ($ag_id, $p_mesg, $p_modify=1)
 return an anchor to view the detail of an action
 
static detail_modele_document_deprecated ($p_id, $p_mesg)
 return a string containing the html code for calling the modifyModeleDocument
 
static detail_op ($p_jr_id, $p_mesg)
 return a string containing the html code for calling the modifyOperation
 
static display_periode ($p_id)
 
static errorbulle ($p_comment)
 
static extension ()
 
static filter_list ($p_list_id)
 Display a field for searching an element in a list, the searchable text must be in an element with the className search-content.
 
static filter_table ($p_table_id, $p_col, $start_row)
 filter the rows in a table and keep the colored row in alternance
 
static filter_table_form ($p_table_id, $p_col, $start_row, $p_name, $p_old_value)
 filter the rows in a table and keep the colored row in alternance
 
static followup_card_button ($f_id, $p_mesg)
 display a div with the history of the card
 
static generate_id ($p_prefix)
 generate an unique id for a widget,
 
static get_to_hidden ($array)
 transform $_GET data to hidden
 
static get_to_string ($array, $start="?")
 transform $_GET data to string
 
static hidden ($p_name, $p_value, $p_id="")
 
static history_account ($p_account, $p_mesg, $p_style="", $p_exercice="")
 display a div with the history of the account
 
static history_anc_account ($p_account, $p_mesg, $p_style="", $p_exercice="")
 display a div with the history of the analytic account
 
static history_card ($f_id, $p_mesg, $p_style="", $p_exercice="")
 display a div with the history of the card
 
static history_card_button ($f_id, $p_mesg, $p_exercice="")
 display a div with the history of the card
 
static image_click ($p_image, $p_js, $p_message, $p_class="")
 Image to click ,.
 
static json_to_hidden ($p_json)
 transform a json to hidden
 
static post_to_hidden ($array)
 transform $_POST data to hidden
 
static post_to_string ($array)
 transform $_POST data to string
 
static print_window ()
 Javascript to print the current window.
 
static remove_stock ($p_id, $p_mesg)
 return a string containing the html code for calling the removeStock
 
static request_to_hidden (array $array)
 transform $_REQUEST data to hidden
 
static request_to_string ($array, $start="?")
 transform $_REQUEST data to string
 
static reset ($p_value)
 
static select_cat ($array_cat)
 create a hidden plus button to select the cat of ledger
 
static select_stock ($p_cn, $p_name, $p_mode)
 Create an ISelect object containing the available repository for reading or writing.
 
static show_receipt_document ($p_jr_id, $p_name="")
 Returns HTML code for displaying a icon with a link to a receipt document from the ledger.
 
static show_reconcile ($p_div, $let, $span="")
 
static simple_array_to_hidden ($array)
 Transform a double array as a HTML string with hidden html value array has the formarray ["name"]="x",array['value']="y") the key name will be the hidden input name;.
 
static submit ($p_name, $p_value, $p_javascript="", $p_class="smallbutton")
 
static title_box ($p_name, $p_div, $p_mod="close", $p_js="", $p_draggable="n", $p_enlarge='n', $raw="")
 Title for boxes, you can customize the symbol thanks symbol with the mode "custom".
 
static warnbulle ($p_comment)
 

Data Fields

 $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, ICard, ICheckBox, IColor, IConcerned, IDate, IFile, InputCheckBox, InputSwitch, INum, 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 972 of file html_input.class.php.

974 {
975 if ($p_js!="")
976 {
977 $p_url='href="javascript:void(0)"';
978 } else {
979 $p_url=sprintf('href="%s"',$p_url);
980 }
981 $str_javascript_attr=build_javascript_attribute($p_attribute);
982 $str=sprintf('<a %s %s %s %s title="%s">%s</a>', $str_javascript_attr,$p_style, $p_url, $p_js, $p_title,$p_text);
983 return $str;
984 }
$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...

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

◆ button_action_add()

static HtmlInput::button_action_add ( )
static

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

1211 {
1212 $dossier=Dossier::id();
1213 $js=HtmlInput::button_action(_('Nouvel événement'),
1214 'action_add('.$dossier.')', 'xx', 'smallbutton');
1215 return $js;
1216 }
_("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 1200 of file html_input.class.php.

1201 {
1202 $rmOperation=sprintf("confirm_box(null,'"._('Voulez-vous effacer cette relation ')."',function () {remove_operation('%s','%s');});",
1203 dossier::id(), $p_operation);
1204 $js=Icon_Action::trash("acop".$p_operation, $rmOperation);
1205 return $js;
1206 }
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 1123 of file html_input.class.php.

1124 {
1125 extract($p_array, EXTR_SKIP);
1126 $bledger_param=json_encode(array(
1127 'dossier'=>$_REQUEST['gDossier'],
1128 'type'=>$type,
1129 'all_type'=>$all_type,
1130 'div'=>$div,
1131 'class'=>'inner_box'
1132 ));
1133
1134 $bledger_param=noalyss_str_replace('"', "'", $bledger_param);
1135 $bledger=new ISmallButton('l');
1136 $bledger->label=_("choix des journaux");
1137 $bledger->javascript=" show_ledger_choice($bledger_param)";
1138 $f_ledger=$bledger->input();
1139 $hid_jrn="";
1140 if (isset($_REQUEST[$div.'nb_jrn']))
1141 {
1142 for ($i=0; $i<$_REQUEST[$div.'nb_jrn']; $i++)
1143 {
1144 if (isset($_REQUEST[$div."r_jrn"][$i]))
1145 $hid_jrn.=HtmlInput::hidden($div.'r_jrn['.$i.']',
1146 $_REQUEST[$div."r_jrn"][$i]);
1147 }
1148 $hid_jrn.=HtmlInput::hidden($div.'nb_jrn',
1149 $_REQUEST[$div.'nb_jrn']);
1150 } else
1151 {
1152 $hid_jrn=HtmlInput::hidden($div.'nb_jrn', 0);
1153 }
1154 echo $f_ledger;
1155 echo '<span id="ledger_id'.$div.'">';
1156 echo $hid_jrn;
1157 echo '</span>';
1158 }
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
Html Input.

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

◆ button_hide()

static HtmlInput::button_hide ( $div_name)
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->javascript="$('".$div_name."').hide()";
504 $html=$a->input();
505
506 return $html;
507 }

References $a, $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 580 of file html_input.class.php.

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

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

1109 {
1110 $button=new ISmallButton("calendar", _("Calendrier"));
1111 $button->javascript="calendar_zoom($obj)";
1112 return $button->input();
1113 }

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

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

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

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

838 {
839 if (!isset($_GET[$ind]))
840 {
841 return $default;
842 }
843 return $_GET[$ind];
844 }
$_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 855 of file html_input.class.php.

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

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

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

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

References $ag_id, and $p_mesg.

◆ 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, and $p_mesg.

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

References $p_mesg.

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

1086 {
1087 $r="<span>";
1088 $r.='<span class=" icon">&#xf50d;</span>';
1089 $r.=sprintf('<input id="search_%s" type="TEXT" class="input_text" name="filter_list%s" placeholder="%s" onkeyup="filter_list(this,\'%s\')">',
1090 $p_list_id,$p_list_id,_("Recherche"),$p_list_id);
1091
1092 $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);
1093 $r.='</span>';
1094 return $r;
1095 }

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

1058 {
1059 $r="
1060 <span>
1061 <span class=\"icon\" >&#xf50d;</span>
1062
1063 <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")."\">
1064 <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\">
1065 </span>
1066 ";
1067 $r.=' <span class="notice" id="info_'.$p_table_id.'"></span>';
1068 return $r;
1069 }

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

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

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, $p_mesg, 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 807 of file html_input.class.php.

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

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(), ICard\input(), and ISmallButton\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 1225 of file html_input.class.php.

1226 {
1227 $r="";
1228 $nb_attribute=count($this->attribute);
1229 for ($i=0; $i<$nb_attribute; $i++)
1230 {
1231 $r.=sprintf(' %s="%s" ', $this->attribute[$i][0],
1232 htmlentities($this->attribute[$i][1]));
1233 }
1234 return $r;
1235 }

Referenced by IText\display(), ICheckBox\input(), IDate\input(), IHidden\input(), INum\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 698 of file html_input.class.php.

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

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

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

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, $p_exercice, and $p_mesg.

◆ 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, $p_exercice, and $p_mesg.

◆ 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, $p_exercice, and $p_mesg.

◆ 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, $p_mesg, 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 566 of file html_input.class.php.

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

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

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

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

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

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

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

References $_POST, $array, and $r.

◆ print_window()

static HtmlInput::print_window ( )
static

Javascript to print the current window.

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

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

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, and $p_mesg.

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

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

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

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

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

◆ reset()

static HtmlInput::reset ( $p_value)
static

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

244 {
245 return '<INPUT TYPE="RESET" class="smallbutton" 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 997 of file html_input.class.php.

998 {
999 global $g_user;
1000 if (!in_array($p_mode, array('R', 'W')))
1001 {
1002 throw new Exception(__FILE__.":".__LINE__." $p_mode invalide");
1003 }
1004 $profile=$g_user->get_profile();
1005 $sel=new ISelect($p_name);
1006
1007 if ($p_mode=='W')
1008 {
1009 $sel->value=$p_cn->make_array("
1010 select r_id,r_name
1011 from stock_repository join profile_sec_repository using (r_id)
1012 where
1013 ur_right='W' and p_id=".sql_string($profile).
1014 " order by 2");
1015 return $sel;
1016 }
1017 if ($p_mode=='R')
1018 {
1019 $sel->value=$p_cn->make_array("
1020 select r_id,r_name
1021 from stock_repository join profile_sec_repository using (r_id)
1022 where
1023 p_id=".sql_string($profile).
1024 " order by 2");
1025 return $sel;
1026 }
1027 }
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 1167 of file html_input.class.php.

1168 {
1169 global $cn;
1170 $image=$p_name;
1171
1172 // Check the jr_id has a receipt document
1173 $array=$cn->get_array('select jr_def_id,jr_pj_name,jr_grpt_id from jrn where jr_id=$1',
1174 array($p_jr_id));
1175 if (count($array)==0)
1176 return "";
1177 if ($array[0]['jr_pj_name']=="")
1178 return "";
1179 $str_dossier=Dossier::get();
1180
1181 // Name is empty then use an image
1182 if ($p_name=="")
1183 {
1184 $image='<IMG style="width:24px;height:24px;border:0px" SRC="image/documents.png" title="'.h($array[0]['jr_pj_name']).'" >';
1185 }
1186
1187 // Build the url
1188 $href=http_build_query(array('gDossier'=>Dossier::id(), 'jr_id'=>$p_jr_id,
1189 'act'=>'RAW:receipt'));
1190
1191 $r=sprintf('<A class="mtitle line" HREF="export.php?%s">%s</A>', $href,
1192 $image);
1193 return $r;
1194 }
$str_dossier

References width.

◆ show_reconcile()

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

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

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

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

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

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 = "" )
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 893 of file html_input.class.php.

895 {
896 $p_div=strip_tags($p_div);
897 $r='<div class="bxbutton">';
898
899 // If draggable : display a icon to unpin and move the dialog box
900 if ($p_draggable=="y")
901 {
902 $r.=Icon_Action::draggable($p_div);
903 }
904 if ( $p_enlarge=='y') {
905 $r.=Icon_Action::full_size($p_div);
906 }
907 if ($p_mod=='close')
908 {
909 $r.=Icon_Action::close($p_div, $p_js);
910 }
911 elseif ($p_mod=='zoom')
912 {
913 $r.=Icon_Action::zoom($p_div,$p_js);
914 }
915 elseif ($p_mod=='hide')
916 {
917 $r.=Icon_Action::hide("&#xe816;", "$('$p_div').hide();$p_js");
918 }
919 elseif ($p_mod=='custom')
920 {
921 $r.='<span id="span_'.$p_div.'" style="float:right;margin-right:5px">'.$p_js."</span>";
922 }
923 elseif ($p_mod=='none')
924 {
925 $r.="";
926 }
927 else
928 {
929 throw new Exception(__FILE__.":".__LINE__._("Paramètre invalide p_mod = '$p_mod'"));
930 }
931
932
933 $r.='</div>';
934 $r.=h2($p_name, ' class="title" ',$raw);
935
936 return $r;
937 }
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().

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

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

◆ $width

HtmlInput::$width

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


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