noalyss
Version-6.7.2
|
class widget This class is used to create all the HTML INPUT TYPE and some specials which works with javascript like js_search. More...
Public Member Functions | |
__construct ($p_name="", $p_value="", $p_id="") | |
debug () | |
get_js_attr () | |
you can add attribute to this in javascript this function is a wrapper and create a script (in js) to modify "this" (in javascript) with the value of obj->attribute from PHP | |
make_object ($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) | |
set the extra javascript property for the INPUT field | |
setReadOnly ($p_read) | |
Static Public Member Functions | |
static | anchor ($p_text, $p_url="", $p_js="") |
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. | |
static | anchor_close ($div) |
Return a html string with an anchor which close the inside popup. | |
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="xx", $p_class="button") |
button Html | |
static | button_anchor ($p_label, $p_value, $p_name="", $p_javascript="", $p_class="button") |
create a button with a ref | |
static | button_choice_ledger ($p_array) |
static | button_close ($div_name) |
close button for the HTML popup | |
static | calendar_zoom ($obj) |
Zoom the calendar. | |
static | card_detail ($p_qcode, $pname='', $p_style="", $p_nohistory=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 | |
static | default_value_post ($ind, $default) |
return default if the value if the value doesn't exist in $_POST | |
static | default_value_request ($ind, $default) |
return default if the value if the value doesn't exist in $_REQUEST | |
static | detail_action ($ag_id, $p_mesg, $p_modify=1) |
return an anchor to view the detail of an action | |
static | detail_modele_document ($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 | extension () |
static | filter_table ($p_table_id, $p_col, $start_row) |
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="") |
display a div with the history of the account | |
static | history_card ($f_id, $p_mesg, $p_style="") |
display a div with the history of the card | |
static | history_card_button ($f_id, $p_mesg) |
display a div with the history of the card | |
static | infobulle ($p_comment) |
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) |
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_ledger ($p_type, $p_selected, $div='') |
return the html code to create an hidden div and a button to show this DIV. | |
static | select_stock ($p_cn, $p_name, $p_mode) |
Create an ISelect object containing the available repository for reading or writing $g_user. | |
static | show_reconcile ($p_div, $let, $span="") |
static | submit ($p_name, $p_value, $p_javascript="", $p_class="smallbutton") |
static | title_box ($name, $div, $mod="close") |
static | warnbulle ($p_comment) |
Data Fields | |
$ctrl | |
$disabled | |
$extra | |
$extra2 | |
$javascript | |
$label | |
$name | |
$readOnly | |
$selected | |
$size | |
$tabindex | |
$table | |
$type | |
$value |
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 53 of file class_html_input.php.
HtmlInput::__construct | ( | $ | p_name = "" , |
$ | p_value = "" , |
||
$ | p_id = "" |
||
) |
Reimplemented in ICard, IPoste, ITva_Popup, IPeriod, IAncCard, IConcerned, and IText.
Definition at line 72 of file class_html_input.php.
References disabled, heigh, javascript, name, readOnly, selected, size, table, value, and width.
static HtmlInput::anchor | ( | $ | p_text, |
$ | p_url = "" , |
||
$ | p_js = "" |
||
) | [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
string | $p_text | text of the anchor |
string | $p_url | url |
string | $p_js | javascript |
Definition at line 703 of file class_html_input.php.
Referenced by Follow_Up\tag_cell().
static HtmlInput::anchor_close | ( | $ | div | ) | [static] |
Return a html string with an anchor which close the inside popup.
(top-right corner)
name | of the DIV to close |
Definition at line 426 of file class_html_input.php.
References $r.
Referenced by title_box().
static HtmlInput::anchor_hide | ( | $ | action, |
$ | javascript | ||
) | [static] |
Return a html string with an anchor to hide a div, put it in the right corner.
$action | action action to perform (message) |
$javascript | javascript |
Definition at line 456 of file class_html_input.php.
Referenced by Acc_Ledger\display_search_form(), and title_box().
static HtmlInput::array_to_hidden | ( | $ | array, |
$ | global_array | ||
) | [static] |
transform request data to hidden
$array | is an of indices |
$request | name of the superglobal $_POST $_GET $_REQUEST(default) |
Definition at line 492 of file class_html_input.php.
References $a, $array, $r, $value, and hidden().
Referenced by Periode\display_form_periode(), get_to_hidden(), post_to_hidden(), and request_to_hidden().
{ $r=""; if ( count($global_array )==0) return ''; foreach ($array as $a) { if (isset($global_array [$a])) if (is_array($global_array[$a]) == false ) { $r.=HtmlInput::hidden($a,$global_array [$a]); } else { if (count($global_array[$a]) > 0) { foreach ($global_array[$a] as $value) { $r.=HtmlInput::hidden($a."[]",$value); } } } } return $r; }
static HtmlInput::array_to_string | ( | $ | array, |
$ | global_array, | ||
$ | start = "?" |
||
) | [static] |
transform request data to string
$array | is an of indices |
$request | name of the superglobal $_POST $_GET $_REQUEST(default) |
Definition at line 558 of file class_html_input.php.
References $a, $array, $r, and $start.
Referenced by get_to_string(), post_to_string(), and request_to_string().
{ $r=$start; if ( count($global_array )==0) return ''; $and=""; foreach ($array as $a) { if (isset($global_array [$a])) { if (is_array($global_array[$a]) == false ) { $r.=$and."$a=".$global_array [$a]; } else { for ($i=0;$i<count($global_array[$a]);$i++) { $r.=$and."$a"."[]=".$global_array[$a][$i]; $and="&"; } } } $and="&"; } return $r; }
static HtmlInput::button | ( | $ | p_name, |
$ | p_value, | ||
$ | p_javascript = "" , |
||
$ | p_class = "smallbutton" |
||
) | [static] |
Definition at line 182 of file class_html_input.php.
Referenced by ITva_Popup\__construct(), Tag\add_clear_button(), Tag\button_search(), Pre_op_ven\display(), Pre_op_ach\display(), history_card_button(), ITva_Popup\input(), Acc_Ledger_Purchase\input(), Acc_Ledger_Sold\input(), Stock\search_box_button(), Follow_Up\tag_cell(), Acc_Ledger\test_me(), and ITva_Popup\with_button().
{ return '<INPUT TYPE="button" class="'.$p_class.'" NAME="'.$p_name.'" ID="'.$p_name.'" VALUE="'.$p_value.'" '.$p_javascript.'>'; }
static HtmlInput::button_action | ( | $ | action, |
$ | javascript, | ||
$ | id = "xx" , |
||
$ | p_class = "button" |
||
) | [static] |
button Html
$action | action action to perform (message) without onclick |
$javascript | javascript to execute |
Definition at line 439 of file class_html_input.php.
Referenced by Pre_operation_detail\form_get(), and html_page_start().
{ if ($id=="xx"){ $id=HtmlInput::generate_id("xx"); } $r=""; $r.='<input type="button" id="'.$id.'" class="'.$p_class.'" onclick="'.$javascript.'" value="'.h($action).'">'; return $r; }
static HtmlInput::button_anchor | ( | $ | p_label, |
$ | p_value, | ||
$ | p_name = "" , |
||
$ | p_javascript = "" , |
||
$ | p_class = "button" |
||
) | [static] |
create a button with a ref
$p_label | the text |
$p_value | the location of the window, |
$p_name | the id of the span |
$p_javascript | javascript for this button |
Definition at line 210 of file class_html_input.php.
References $r.
Referenced by Acc_Ledger\display_search_form().
static HtmlInput::button_choice_ledger | ( | $ | p_array | ) | [static] |
type | $p_array | indice
|
Definition at line 791 of file class_html_input.php.
{ extract ($p_array); $bledger_param = json_encode(array( 'dossier' => $_REQUEST['gDossier'], 'type' => $type, 'all_type' => $all_type, 'div' => $div, 'class'=>'inner_box' )); $bledger_param = str_replace('"', "'", $bledger_param); $bledger = new ISmallButton('l'); $bledger->label = _("choix des journaux"); $bledger->javascript = " show_ledger_choice($bledger_param)"; $f_ledger = $bledger->input(); $hid_jrn = ""; if (isset($_REQUEST[$div . 'nb_jrn'])) { for ($i = 0; $i < $_REQUEST[$div . 'nb_jrn']; $i++) { if (isset($_REQUEST[$div . "r_jrn"][$i])) $hid_jrn.=HtmlInput::hidden($div . 'r_jrn[' . $i . ']', $_REQUEST[$div . "r_jrn"][$i]); } $hid_jrn.=HtmlInput::hidden($div . 'nb_jrn', $_REQUEST[$div . 'nb_jrn']); } else { $hid_jrn = HtmlInput::hidden($div . 'nb_jrn', 0); } echo $f_ledger; echo '<span id="ledger_id' . $div . '">'; echo $hid_jrn; echo '</span>'; }
static HtmlInput::button_close | ( | $ | div_name | ) | [static] |
close button for the HTML popup
$div_name | is the name of the div to remove |
Definition at line 412 of file class_html_input.php.
Referenced by select_ledger().
static HtmlInput::calendar_zoom | ( | $ | obj | ) | [static] |
Zoom the calendar.
type | $obj | objet json for the javascript |
Definition at line 777 of file class_html_input.php.
{ $button=new ISmallButton("calendar", _("Calendrier")); $button->javascript="calendar_zoom($obj)"; return $button->input(); }
static HtmlInput::card_detail | ( | $ | p_qcode, |
$ | pname = '' , |
||
$ | p_style = "" , |
||
$ | p_nohistory = false |
||
) | [static] |
show the detail of a card
Definition at line 477 of file class_html_input.php.
Referenced by contact\Summary(), and Acc_Ledger\verify().
HtmlInput::debug | ( | ) |
static HtmlInput::default_value | ( | $ | ind, |
$ | default, | ||
$ | array | ||
) | [static] |
return default if the value if the value doesn't exist in the array
$ind | the index to check |
$default | the value to return |
$array | the array |
Definition at line 636 of file class_html_input.php.
Referenced by Anc_Acc_Link\get_request(), and Stock\search_box().
static HtmlInput::default_value_get | ( | $ | ind, |
$ | default | ||
) | [static] |
static HtmlInput::default_value_post | ( | $ | ind, |
$ | default | ||
) | [static] |
return default if the value if the value doesn't exist in $_POST
$ind | name of the variable | |
type | $default |
Definition at line 664 of file class_html_input.php.
References $ind.
static HtmlInput::default_value_request | ( | $ | ind, |
$ | default | ||
) | [static] |
return default if the value if the value doesn't exist in $_REQUEST
$ind | name of the variable | |
type | $default |
Definition at line 678 of file class_html_input.php.
References $_REQUEST, and $ind.
Referenced by Document\Replace().
static HtmlInput::detail_action | ( | $ | ag_id, |
$ | p_mesg, | ||
$ | p_modify = 1 |
||
) | [static] |
return an anchor to view the detail of an action
$ag_id | |
$p_mesg | |
$p_modify | let you modify an operation |
Definition at line 244 of file class_html_input.php.
{ return sprintf('<A class="detail" style="text-decoration:underline;display:inline" HREF="javascript:view_action(%d,%d,%d)">%s</A>', $ag_id,dossier::id(),$p_modify,$p_mesg); }
static HtmlInput::detail_modele_document | ( | $ | p_id, |
$ | p_mesg | ||
) | [static] |
return a string containing the html code for calling the modifyModeleDocument
Definition at line 252 of file class_html_input.php.
Referenced by Document_modele\myList().
{ return sprintf('<A class="detail" style="text-decoration:underline" HREF="javascript:modifyModeleDocument(%d,%d)">%s</A>', $p_id,dossier::id(),$p_mesg); }
static HtmlInput::detail_op | ( | $ | p_jr_id, |
$ | p_mesg | ||
) | [static] |
return a string containing the html code for calling the modifyOperation
Definition at line 232 of file class_html_input.php.
Referenced by Anc_Listing\display_html(), Anc_GrandLivre\display_html(), and Acc_Ledger_Fin\insert().
{ return sprintf('<A class="detail" style="text-decoration:underline;display:inline" HREF="javascript:modifyOperation(%d,%d)">%s</A>', $p_jr_id,dossier::id(),$p_mesg); }
static HtmlInput::display_periode | ( | $ | p_id | ) | [static] |
Definition at line 400 of file class_html_input.php.
{ $r=sprintf('<a href="javascript:void(0)" onclick="display_periode(%d,%d)">Modifier</a>', dossier::id(), $p_id); return $r; }
static HtmlInput::extension | ( | ) | [static] |
Definition at line 198 of file class_html_input.php.
References $_REQUEST, and hidden().
{ return self::hidden('plugin_code',$_REQUEST['plugin_code']); }
static HtmlInput::filter_table | ( | $ | p_table_id, |
$ | p_col, | ||
$ | start_row | ||
) | [static] |
Definition at line 756 of file class_html_input.php.
References $r.
{ $r= " <span> <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\"> <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\"> </span> "; return $r; }
static HtmlInput::generate_id | ( | $ | p_prefix | ) | [static] |
generate an unique id for a widget,
$p_prefix | prefix |
Definition at line 625 of file class_html_input.php.
References $r.
Referenced by IDate\input().
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
Reimplemented in IPoste.
Definition at line 108 of file class_html_input.php.
References $name, $value, create_script(), and name.
Referenced by ITva_Popup\input(), IAncCard\input(), and ICard\input().
{ require_once('function_javascript.php'); $attr=""; if ( count($this->attribute) == 0) return ""; /* Add properties at the widget */ for ($i=0;$i< count($this->attribute);$i++) { list($name,$value)=$this->attribute[$i]; $tmp1=sprintf("$('%s').%s='%s';", $this->name, $name, $value); $attr.=$tmp1; } $attr=create_script($attr); return $attr; }
static HtmlInput::get_to_hidden | ( | $ | array | ) | [static] |
transform $_GET data to hidden
$array | is an of indices |
Definition at line 522 of file class_html_input.php.
References $_GET, $array, $r, and array_to_hidden().
Referenced by Stock\export_stock_histo_form(), and Stock\export_stock_summary_list_form().
{ $r=self::array_to_hidden($array,$_GET ); return $r; }
static HtmlInput::get_to_string | ( | $ | array, |
$ | start = "?" |
||
) | [static] |
transform $_GET data to string
$array | is an of indices |
Definition at line 589 of file class_html_input.php.
References $_GET, $array, $r, $start, and array_to_string().
Referenced by Fiche_Def\Display(), Stock\history(), Follow_Up\myList(), and Html_Table\test_me().
static HtmlInput::hidden | ( | $ | p_name, |
$ | p_value, | ||
$ | p_id = "" |
||
) | [static] |
Definition at line 192 of file class_html_input.php.
Referenced by array_to_hidden(), Acc_Ledger_Fin\confirm(), Acc_Ledger_Sold\confirm(), Acc_Ledger_Purchase\confirm(), Acc_Ledger\confirm(), Follow_Up\Display(), Pre_op_ven\display(), Pre_Op_Advanced\display(), Pre_op_ach\display(), Acc_Ledger\display_ledger(), Follow_Up\display_search(), Acc_Ledger\display_search_form(), Stock\export_stock_histo_form(), Stock\export_stock_summary_list_form(), extension(), Anc_Group_Operation\form(), Acc_Report\form(), Anc_Account\form(), Anticipation\form_cat_mod(), Anticipation\form_item(), Acc_Account_Ledger\HtmlTableHeader(), Fiche\HtmlTableHeader(), Acc_Ledger_Fin\input(), Acc_Ledger_Purchase\input(), Acc_Ledger_Sold\input(), Acc_Ledger\input(), Fiche_Def\input_detail(), Fiche_Def\input_new(), Acc_Ledger\input_new(), Fiche_Def\myList(), Acc_Ledger\search_form(), Acc_Payment\select(), select_ledger(), Anc_Listing\show_button(), Anc_Acc_List\show_button(), Anc_Group\show_button(), Anc_GrandLivre\show_button(), Anc_Balance_Simple\show_button(), Anc_Balance_Double\show_button(), Acc_Ledger_Fin\show_ledger(), Lettering\show_letter(), ICard\test_me(), Acc_Report\test_me(), Acc_Bilan\test_me(), Anc_Operation\test_me(), and Fiche\test_me().
{ if ($p_id=="") $p_id=$p_name; return '<INPUT TYPE="hidden" id="'.$p_id.'" NAME="'.$p_name.'" VALUE="'.$p_value.'">'; }
static HtmlInput::history_account | ( | $ | p_account, |
$ | p_mesg, | ||
$ | p_style = "" |
||
) | [static] |
display a div with the history of the account
Definition at line 292 of file class_html_input.php.
References id.
Referenced by Anc_Listing\display_html(), and Anc_GrandLivre\display_html().
{ $view_history= sprintf('<A class="detail" style="text-decoration:underline;%s" HREF="javascript:view_history_account(\'%s\',\'%s\')" >%s</A>', $p_style,$p_account, dossier::id(), $p_mesg); return $view_history; }
static HtmlInput::history_card | ( | $ | f_id, |
$ | p_mesg, | ||
$ | p_style = "" |
||
) | [static] |
display a div with the history of the card
Definition at line 270 of file class_html_input.php.
Referenced by Anc_Listing\display_html(), and Anc_GrandLivre\display_html().
{ $view_history= sprintf('<A class="detail" style="text-decoration:underline;%s" HREF="javascript:view_history_card(\'%s\',\'%s\')" >%s</A>', $p_style,$f_id, dossier::id(), $p_mesg); return $view_history; }
static HtmlInput::history_card_button | ( | $ | f_id, |
$ | p_mesg | ||
) | [static] |
display a div with the history of the card
Definition at line 279 of file class_html_input.php.
References $e, $f_id, $js, button(), and id.
{ static $e=0; $e++; $js= sprintf('onclick="view_history_card(\'%s\',\'%s\')"', $f_id, dossier::id()); $view_history=HtmlInput::button("hcb"+$e,$p_mesg,$js); return $view_history; }
static HtmlInput::infobulle | ( | $ | p_comment | ) | [static] |
Definition at line 219 of file class_html_input.php.
References $r, hideBulle(), and showBulle().
Referenced by Fiche\blank(), Acc_Ledger_Sold\confirm(), Acc_Ledger_Purchase\confirm(), Pre_Op_Advanced\display(), Fiche\Display(), Acc_Ledger_Fin\input(), Acc_Ledger_Purchase\input(), Acc_Ledger_Sold\input(), Acc_Ledger\input(), and Acc_Ledger\search_form().
HtmlInput::make_object | ( | $ | 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.
$p_name | : name of the object, can be null. If the name is not null, return $p_name={} otherwise only the object {} |
$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'};
Definition at line 146 of file class_html_input.php.
References $name, $ret, $value, for, and if.
{ $name=($p_name != null)?$p_name.'=':''; if ( count($this->attribute) == 0) return $name."{}"; $ret=$name."{"; $and=''; for ($i=0;$i< count($this->attribute);$i++) { list($name,$value)=$this->attribute[$i]; $tmp1=sprintf($and."'%s':'%s'", $name, $value); $ret.=$tmp1; $and=','; } $ret.='}'; return $ret; }
static HtmlInput::post_to_hidden | ( | $ | array | ) | [static] |
transform $_POST data to hidden
$array | is an of indices |
Definition at line 534 of file class_html_input.php.
References $array, $r, and array_to_hidden().
{ $r=self::array_to_hidden($array,$_POST ); return $r; }
static HtmlInput::post_to_string | ( | $ | array | ) | [static] |
transform $_POST data to string
$array | is an of indices |
Definition at line 601 of file class_html_input.php.
References $array, $r, and array_to_string().
{ $r=self::array_to_string($array,$_POST ); return $r; }
static HtmlInput::print_window | ( | ) | [static] |
Javascript to print the current window.
Definition at line 468 of file class_html_input.php.
Referenced by Stock\history(), Acc_Account_Ledger\HtmlTableHeader(), Fiche\HtmlTableHeader(), and Stock\summary().
{ $r=''; $r.=HtmlInput::button('print','Imprimer','onclick="window.print();"'); return $r; }
static HtmlInput::remove_stock | ( | $ | p_id, |
$ | p_mesg | ||
) | [static] |
return a string containing the html code for calling the removeStock
Definition at line 261 of file class_html_input.php.
{ return sprintf('<A class="detail" style="text-decoration:underline" HREF="javascript:removeStock(%d,%d)">%s</A>', $p_id,dossier::id(),$p_mesg); }
static HtmlInput::request_to_hidden | ( | $ | array | ) | [static] |
transform $_REQUEST data to hidden
$array | is an of indices |
Definition at line 546 of file class_html_input.php.
References $_REQUEST, $array, $r, and array_to_hidden().
Referenced by Follow_Up\Display(), Anc_Table\display_form(), Anc_Acc_List\display_form(), Anc_Print\display_form(), Anc_Balance_Double\display_form(), and Follow_Up\show_action_list().
{ $r=self::array_to_hidden($array,$_REQUEST ); return $r; }
static HtmlInput::request_to_string | ( | $ | array, |
$ | start = "?" |
||
) | [static] |
transform $_REQUEST data to string
$array | is an of indices |
Definition at line 613 of file class_html_input.php.
References $_REQUEST, $array, $r, $start, and array_to_string().
static HtmlInput::reset | ( | $ | p_value | ) | [static] |
Definition at line 188 of file class_html_input.php.
{ return '<INPUT TYPE="RESET" class="smallbutton" VALUE="'.$p_value.'">'; }
static HtmlInput::select_cat | ( | $ | array_cat | ) | [static] |
create a hidden plus button to select the cat of ledger
Definition at line 363 of file class_html_input.php.
References $_GET, $array_cat, $e, $ledger, $r, $row, $selected, and echo.
{ ob_start(); $ledger=new ISmallButton('l'); $ledger->label=_("Catégorie"); $ledger->javascript=" show_cat_choice()"; echo $ledger->input(); /* create a hidden div for the ledger */ echo '<div id="div_cat">'; echo '<h2 class="info">'._('Choix des categories').'</h2>'; $selected=(isset($_GET['r_cat']))?$_GET['r_cat']:null; echo '<ul>'; for ($e=0;$e<count($array_cat);$e++) { $row=$array_cat[$e]; $re=new ICheckBox('r_cat['.$e.']',$row['cat']); if ( $selected != null && isset($selected[$e])) { $re->selected=true; } echo '<li style="list-style-type: none;">'.$re->input().$row['name'].'('.$row['cat'].')</li>'; } echo '</ul>'; $hide=new IButton('l'); $hide->label=_("Valider"); $hide->javascript=" hide_cat_choice() "; echo $hide->input(); echo '</div>'; $r=ob_get_contents(); ob_end_clean(); return $r; }
static HtmlInput::select_ledger | ( | $ | p_type, |
$ | p_selected, | ||
$ | div = '' |
||
) | [static] |
return the html code to create an hidden div and a button to show this DIV.
This contains all the available ledgers for the user in READ or RW
$selected | is an array of checkbox |
$div | div suffix |
Definition at line 307 of file class_html_input.php.
References $class, $div, $e, $g_user, $idx, $p_array, $r, $ret, $row, button_close(), echo, hidden(), submit(), th(), and title_box().
{ global $g_user; $r = ''; /* security : filter ledger on user */ $p_array = $g_user->get_ledger($p_type, 3); ob_start(); /* create a hidden div for the ledger */ echo '<div id="div_jrn'.$div.'" >'; echo HtmlInput::title_box(_("Journaux"), $div."jrn_search"); echo '<div style="padding:5px">'; echo '<form method="GET" id="'.$div.'search_frm" onsubmit="return hide_ledger_choice(\''.$div.'search_frm\')">'; echo HtmlInput::hidden('nb_jrn', count($p_array)); echo _('Filtre ').HtmlInput::filter_table($div.'tb_jrn', '0,1,2', 1); echo '<table class="result" id="'.$div.'tb_jrn">'; echo '<tr>'; echo th(_('Nom')); echo th(_('Description')); echo th(_('Type')); echo '</tr>'; for ($e=0;$e<count($p_array);$e++) { $row=$p_array[$e]; $r=new ICheckBox($div.'r_jrn'.$e,$row['jrn_def_id']); $idx=$row['jrn_def_id']; if ( $p_selected != null && in_array($row['jrn_def_id'],$p_selected)) { $r->selected=true; } $class=($e%2==0)?' class="even" ':' class="odd" '; echo '<tr '.$class.'>'; echo '<td style="white-space: nowrap">'.$r->input().$row['jrn_def_name'].'</td>'; echo '<td >'.$row['jrn_def_description'].'</td>'; echo '<td >'.$row['jrn_def_type'].'</td>'; echo '</tr>'; } echo '</table>'; echo HtmlInput::hidden('div',$div); echo HtmlInput::submit('save',_('Valider')); echo HtmlInput::button_close($div."jrn_search"); echo '</form>'; echo '</div>'; echo '</div>'; $ret=ob_get_contents(); ob_end_clean(); return $ret; }
static HtmlInput::select_stock | ( | $ | p_cn, |
$ | p_name, | ||
$ | p_mode | ||
) | [static] |
Create an ISelect object containing the available repository for reading or writing $g_user.
$p_cn | db object |
$p_name | name of the select |
$p_mode | is 'R' for reading, 'W' for writinh |
Exception | if p_mode is wrong |
Definition at line 725 of file class_html_input.php.
References $g_user, $profile, $sel, and sql_string().
Referenced by Acc_Ledger_Sold\confirm(), Stock_Goods\input(), and Stock\search_box().
{ global $g_user; if ( ! in_array($p_mode,array('R','W') ) ) { throw new Exception (__FILE__.":".__LINE__." $p_mode invalide"); } $profile=$g_user->get_profile(); $sel=new ISelect($p_name); if ($p_mode == 'W') { $sel->value=$p_cn->make_array(" select r_id,r_name from stock_repository join profile_sec_repository using (r_id) where ur_right='W' and p_id=".sql_string($profile). " order by 2" ); return $sel; } if ($p_mode == 'R') { $sel->value=$p_cn->make_array(" select r_id,r_name from stock_repository join profile_sec_repository using (r_id) where p_id=".sql_string($profile). " order by 2" ); return $sel; } }
HtmlInput::set_attribute | ( | $ | p_name, |
$ | p_value | ||
) |
set the extra javascript property for the INPUT field
$p_name | name of the parameter |
$p_value | default value of this parameter |
Reimplemented in IPopup.
Definition at line 97 of file class_html_input.php.
Referenced by ITva_Popup\input(), and IAncCard\input().
{ $this->attribute[]=array($p_name,$p_value); $this->$p_name=$p_value; }
HtmlInput::setReadOnly | ( | $ | p_read | ) |
Definition at line 89 of file class_html_input.php.
References readOnly.
Referenced by Acc_Ledger_Fin\input().
{ $this->readOnly=$p_read; }
static HtmlInput::show_reconcile | ( | $ | p_div, |
$ | let, | ||
$ | span = "" |
||
) | [static] |
Definition at line 767 of file class_html_input.php.
References $r.
{ $r = '<A style="color:red;text-decoration:underline" href="javascript:void(0)" onclick="show_reconcile(\'' . $p_div . '\',\'' . $let . '\')">' . $let.$span . '</A>'; return $r; }
static HtmlInput::submit | ( | $ | p_name, |
$ | p_value, | ||
$ | p_javascript = "" , |
||
$ | p_class = "smallbutton" |
||
) | [static] |
Definition at line 177 of file class_html_input.php.
Referenced by Follow_Up\Display(), Anc_Listing\display_form(), Anc_Balance_Simple\display_form(), Anc_Balance_Double\display_form(), Periode\display_form_periode(), Acc_Ledger\display_search_form(), Stock\export_stock_histo_form(), Stock\export_stock_summary_list_form(), Document_modele\form(), Acc_Account_Ledger\HtmlTableHeader(), Fiche\HtmlTableHeader(), Fiche_Def\input_detail(), Fiche_Def\input_new(), Document_modele\myList(), Fiche_Def\myList(), select_ledger(), Anc_Listing\show_button(), Anc_Acc_List\show_button(), Anc_Group\show_button(), Anc_GrandLivre\show_button(), Anc_Balance_Simple\show_button(), Anc_Balance_Double\show_button(), Acc_Ledger_Fin\show_ledger(), Acc_Ledger_Sold\show_unpaid(), Acc_Ledger_Purchase\show_unpaid(), ICard\test_me(), Acc_Report\test_me(), Acc_Bilan\test_me(), Fiche\test_me(), and Acc_Ledger\test_me().
{ return '<INPUT TYPE="SUBMIT" class="'.$p_class.'" NAME="'.$p_name.'" ID="'.$p_name.'_submit_id" VALUE="'.$p_value.'" '.$p_javascript.'>'; }
static HtmlInput::title_box | ( | $ | name, |
$ | div, | ||
$ | mod = "close" |
||
) | [static] |
Definition at line 686 of file class_html_input.php.
References $div, $name, $r, anchor_close(), anchor_hide(), and h2().
Referenced by Periode\display_form_periode(), Pre_operation_detail\form_get(), html_page_start(), and select_ledger().
{ if ($mod=='close') $r=HtmlInput::anchor_close($div); if ($mod=='hide') $r=HtmlInput::anchor_hide(_('Fermer'),"$('$div').hide()"); if ( $mod == 'none') $r=""; $r.=h2($name,' class="title" '); return $r; }
static HtmlInput::warnbulle | ( | $ | p_comment | ) | [static] |
Definition at line 224 of file class_html_input.php.
Referenced by Fiche\Display().
HtmlInput::$ctrl |
$ctrl is the control to update (see js_search_card_control)
Definition at line 69 of file class_html_input.php.
HtmlInput::$disabled |
$disabled poss. value == true or nothing, to disable INPUT
Definition at line 64 of file class_html_input.php.
Referenced by ISelect\input().
HtmlInput::$extra |
$extra different usage, it depends of the $type
Definition at line 65 of file class_html_input.php.
Referenced by IText\display(), IButton\input(), IText\input(), INum\input(), and ISmallButton\input().
HtmlInput::$extra2 |
$extra2 different usage, it depends of the $type
Definition at line 66 of file class_html_input.php.
HtmlInput::$javascript |
$javascript is the javascript to add to the widget
Definition at line 68 of file class_html_input.php.
Referenced by IAncCard\input(), IPopup\input(), and ICard\input().
HtmlInput::$label |
$label the question before the input
Reimplemented in ISmallButton, and IButton.
Definition at line 63 of file class_html_input.php.
Referenced by IAncCard\input(), and ICard\input().
HtmlInput::$name |
$name field NAME of the INPUT
Reimplemented in IPopup.
Definition at line 57 of file class_html_input.php.
Referenced by IText\__construct(), IAncCard\__construct(), INum\__construct(), ICard\__construct(), get_js_attr(), IPoste\get_js_attr(), make_object(), and title_box().
HtmlInput::$readOnly |
$readonly true : we cannot change value
Definition at line 59 of file class_html_input.php.
HtmlInput::$selected |
$selected for SELECT RADIO and CHECKBOX the selected value
Definition at line 61 of file class_html_input.php.
Referenced by select_cat().
HtmlInput::$size |
$size size of the input
Definition at line 60 of file class_html_input.php.
HtmlInput::$tabindex |
Definition at line 71 of file class_html_input.php.
HtmlInput::$table |
$table =1 add the table tag
Definition at line 62 of file class_html_input.php.
Referenced by ITva_Popup\input().
HtmlInput::$type |
$type type of the widget
Reimplemented in IPeriod.
Definition at line 56 of file class_html_input.php.
HtmlInput::$value |
$value what the INPUT contains
Definition at line 58 of file class_html_input.php.
Referenced by IText\__construct(), IAncCard\__construct(), INum\__construct(), ICard\__construct(), array_to_hidden(), get_js_attr(), IPoste\get_js_attr(), IPopup\input(), and make_object().