noalyss  Version-6.7.2
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:
IAction IAncCard IButton ICard ICheckBox IConcerned IDate IFile IHidden IPeriod IPopup IPoste IRadio IRelated_Action ISelect ISpan IText ITextarea ITva_Popup

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

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 53 of file class_html_input.php.


Constructor & Destructor Documentation

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.

    {
        $this->name=$p_name;
        $this->readOnly=false;
        $this->size=20;
        $this->width=50;
        $this->heigh=20;
        $this->value=$p_value;
        $this->selected="";
        $this->table=0;
        $this->disabled=false;
        $this->javascript="";
        $this->extra2="all";
        $this->attribute=array();
        $this->id=$p_id;

    }

Member Function Documentation

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

Parameters:
string$p_texttext of the anchor
string$p_urlurl
string$p_jsjavascript

Definition at line 703 of file class_html_input.php.

References $p_url, and $str.

Referenced by Follow_Up\tag_cell().

      {
          if ($p_js != "")
          {
              $p_url="javascript:void(0)";
          }


          $str=sprintf('<a class="line" href="%s" %s>%s</a>',
                  $p_url,$p_js,$p_text);
          return $str;
      }
static HtmlInput::anchor_close ( div) [static]

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

(top-right corner)

Parameters:
nameof the DIV to close

Definition at line 426 of file class_html_input.php.

References $r.

Referenced by title_box().

    {
        $r='';
        $r.='<div style="float:right;margin-right:2px;margin-top:5px;padding:0px;">';
        $r.= '<A id="close_div" class="input_text" HREF="javascript:void(0)" onclick="removeDiv(\''.$div.'\');">'._('Fermer').'</A>';
        $r.='</div>';
        return $r;
    }
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:
Acc_Ledger::display_search_form

Definition at line 456 of file class_html_input.php.

Referenced by Acc_Ledger\display_search_form(), and title_box().

    {
        $r='';
        $r.='<div style="float:right;margin:2px;">';
        $r.= '<span id="close_div" class="input_text"  onclick="'.$javascript.'">'.$action.'</span>';
        $r.='</div>';
        return $r;
    }
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 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

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

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="&amp;";
                  }
              }
          }
          $and="&amp;";
        }

      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

Parameters:
$actionaction action to perform (message) without onclick
$javascriptjavascript 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

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 210 of file class_html_input.php.

References $r.

Referenced by Acc_Ledger\display_search_form().

    {
        $r=sprintf('<span id="%s" > <A class="'.$p_class.'" style="display:inline;"  href="%s" %s >%s</A></span>',
                   $p_name,
                   $p_value,
                   $p_javascript,
                   $p_label);
        return $r;
    }
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 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

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

Definition at line 412 of file class_html_input.php.

References $a, and $html.

Referenced by select_ledger().

    {
      $a=new IButton('Fermer',_('Fermer'));
      $a->label=_("Fermer");
      $a->javascript="removeDiv('".$div_name."')";
      $html=$a->input();

      return $html;

    }
static HtmlInput::calendar_zoom ( obj) [static]

Zoom the calendar.

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

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.

References $histo, and $r.

Referenced by contact\Summary(), and Acc_Ledger\verify().

    {
      //if ($pname=='')$pname=$p_qcode;
      $r="";
      $histo=($p_nohistory==true)?' ,nohistory:1':"";
      $r.=sprintf('<a href="javascript:void(0)" %s onclick="fill_ipopcard({qcode:\'%s\' %s})">%s [%s]</a>',
                  $p_style,$p_qcode,$histo,$pname,$p_qcode);
      return $r;
    }

Definition at line 169 of file class_html_input.php.

References echo, and value.

    {
        echo "Type ".$this->type."<br>";
        echo "name ".$this->name."<br>";
        echo "value". $this->value."<br>";
        $readonly=($this->readonly==false)?"false":"true";
        echo "read only".$readonly."<br>";
    }
static HtmlInput::default_value ( ind,
default,
array 
) [static]

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

Parameters:
$indthe index to check
$defaultthe value to return
$arraythe array

Definition at line 636 of file class_html_input.php.

References $array, and $ind.

Referenced by Anc_Acc_Link\get_request(), and Stock\search_box().

    {
      if ( ! isset($array[$ind]))
        {
          return $default;
        }
      return $array[$ind];
    }
static HtmlInput::default_value_get ( ind,
default 
) [static]

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

Parameters:
$indname of the variable
type$default
Returns:
type

Definition at line 650 of file class_html_input.php.

References $_GET, and $ind.

        {
                if (!isset($_GET[$ind]))
                {
                        return $default;
                }
                return $_GET[$ind];
        }
static HtmlInput::default_value_post ( ind,
default 
) [static]

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

Parameters:
$indname of the variable
type$default
Returns:
type

Definition at line 664 of file class_html_input.php.

References $ind.

        {
                if (!isset($_POST[$ind]))
                {
                        return $default;
                }
                return $_POST[$ind];
        }
static HtmlInput::default_value_request ( ind,
default 
) [static]

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

Parameters:
$indname of the variable
type$default
Returns:
type

Definition at line 678 of file class_html_input.php.

References $_REQUEST, and $ind.

Referenced by Document\Replace().

        {
                if (!isset($_REQUEST[$ind]))
                {
                        return $default;
                }
                return $_REQUEST[$ind];
        }
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 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.

References $r, and id.

    {
      $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,

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

Definition at line 625 of file class_html_input.php.

References $r.

Referenced by IDate\input().

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

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

Returns:
return string with the javascript code

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

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

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

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

    {
        $r='<A HREF="#" tabindex="-1" style="display:inline;color:black;background-color:yellow;padding-left:4px;width:2em;padding-right:4px;text-decoration:none;" onmouseover="showBulle(\''.$p_comment.'\')"  onclick="showBulle(\''.$p_comment.'\')" onmouseout="hideBulle(0)">?</A>';
        return $r;
    }
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.

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

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

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

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

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

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

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

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

Note:
the selected value is stored in the array p_cat

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

Parameters:
$selectedis an array of checkbox
$divdiv suffix
Note:
the choosen ledger are stored in the array r_jrn (_GET)

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.

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

Parameters:
$p_namename of the parameter
$p_valuedefault 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]
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().

    {
        $r='<A HREF="#" tabindex="-1" style="display:inline;color:red;background-color:white;padding-left:4px;padding-right:4px;text-decoration:none;" onmouseover="showBulle(\''.$p_comment.'\')"  onclick="showBulle(\''.$p_comment.'\')" onmouseout="hideBulle(0)">&Delta;</A>';
        return $r;
    }

Field Documentation

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

The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations