phpcompta  Version-6
 All Data Structures Namespaces Files Functions Variables Pages
Public Member Functions | Static Public Member Functions
IPoste Class Reference

show a button, for selecting a account and a input text for manually inserting an account the different value of table are More...

Inheritance diagram for IPoste:
HtmlInput

Public Member Functions

 __construct ($p_name="", $p_value="", $p_id="")
 
 dbl_click_history ()
 *add a double click to poste to see his history
 
 display ()
 print in html the readonly value of the widget
 
 dsp_button ()
 
 get_js_attr ()
 create the javascript for adding the javascript properties onto the button
 
 input ($p_name=null, $p_value=null)
 show the html input of the widget
 
- Public Member Functions inherited from HtmlInput
 __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 ipopup ($p_name)
 
static test_me ()
 
- Static Public Member Functions inherited from HtmlInput
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="")
 
static button_action ($action, $javascript, $id="xx")
 button Html
 
static button_anchor ($p_label, $p_value, $p_name="", $p_javascript="")
 create a button with a ref
 
static button_close ($div_name)
 *close button for the HTML popup
 
static card_detail ($p_qcode, $pname='', $p_style="")
 *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 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_array, $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 submit ($p_name, $p_value, $p_javascript="")
 
static title_box ($name, $div, $mod="close")
 
static warnbulle ($p_comment)
 

Additional Inherited Members

- Data Fields inherited from HtmlInput
 $ctrl
 
 $disabled
 
 $extra
 
 $extra2
 
 $javascript
 
 $label
 
 $name
 
 $readOnly
 
 $selected
 
 $size
 
 $tabindex
 
 $table
 
 $type
 
 $value
 

Detailed Description

show a button, for selecting a account and a input text for manually inserting an account the different value of table are

echo js_include('prototype.js');

Definition at line 80 of file class_iposte.php.

Constructor & Destructor Documentation

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

Definition at line 83 of file class_iposte.php.

References disabled, javascript, name, readOnly, selected, size, table, and value.

{
$this->name=$p_name;
$this->readOnly=false;
$this->size=10;
$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

IPoste::dbl_click_history ( )

*add a double click to poste to see his history

Note
change $this->javascript

Definition at line 196 of file class_iposte.php.

References $r.

{
$r=' ondblclick="get_history_account(\''.$this->name.'\',\''.dossier::id().'\')"';
$this->javascript=$r;
}
IPoste::display ( )

print in html the readonly value of the widget

Definition at line 178 of file class_iposte.php.

References $r, name, and value.

Referenced by input().

{
$r=sprintf('<TD><input type="hidden" name="%s" value="%s">
%s
</TD>',
$this->name,
$this->value ,
$this->value
);
return $r;
}
IPoste::dsp_button ( )

Definition at line 129 of file class_iposte.php.

References get_js_attr(), and name.

Referenced by input().

{
$this->id=($this->id=="")?$this->name:$this->id;
$ib=new IButton($this->id.'_bt');
$ib->javascript='search_poste(this)';
/* add the property */
$sc=$this->get_js_attr();
return $ib->input().$sc;
}
IPoste::get_js_attr ( )

create the javascript for adding the javascript properties onto the button

Returns
a javascript surrounded by the tag <SCRIPT>

Definition at line 112 of file class_iposte.php.

References $i, HtmlInput\$name, HtmlInput\$value, and create_script().

Referenced by dsp_button().

{
$attr="";
/* Add properties at the widget */
for ($i=0;$i< count($this->attribute);$i++)
{
list($name,$value)=$this->attribute[$i];
$tmp1=sprintf("$('%s_bt').%s='%s';",
$this->id,
$attr.=$tmp1;
}
$attr=create_script($attr);
return $attr;
}
IPoste::input (   $p_name = null,
  $p_value = null 
)

show the html input of the widget

Definition at line 140 of file class_iposte.php.

References $itext, HtmlInput\$javascript, $r, HtmlInput\$size, css_size, display(), dsp_button(), javascript, name, readOnly, table, td(), and value.

{
$this->name=($p_name==null)?$this->name:$p_name;
$this->value=($p_value==null)?$this->value:$p_value;
if ( $this->readOnly==true) return $this->display();
//--
if ( ! isset($this->ctrl) ) $this->ctrl='none';
if ( ! isset($this->javascript)) $this->javascript="";
$this->id=($this->id=="")?$this->name:$this->id;
/* create the text */
$itext=new IText($this->name,$this->value,$this->id);
if ( isset ($this->css_size))
$itext->css_size=$this->css_size;
else
/* create the button */
$ibutton=$this->dsp_button();
if ( $this->table==3)
{
$r='<table>'.tr(td($itext->input()).td($ibutton));
$r.='</table>';
return $r;
}
$r=$itext->input().$ibutton;
if ( $this->table==1) $r=td($r);
return $r;
//--
}
static IPoste::ipopup (   $p_name)
static

Definition at line 99 of file class_iposte.php.

{
$ip=new IPopup($p_name);
$ip->title='Plan comptable';
$ip->value='';
$ip->set_height('80%');
$ip->set_zindex(20);
return $ip->input();
}
static IPoste::test_me ( )
static

Definition at line 201 of file class_iposte.php.

{
}

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