[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpcompta-dev] r5117 - phpcompta/tags/rel650/include
From: |
phpcompta-dev |
Subject: |
[Phpcompta-dev] r5117 - phpcompta/tags/rel650/include |
Date: |
Tue, 18 Sep 2012 23:47:27 +0200 (CEST) |
Author: danydb
Date: 2012-09-18 23:47:27 +0200 (Tue, 18 Sep 2012)
New Revision: 5117
Modified:
phpcompta/tags/rel650/include/class_html_input.php
phpcompta/tags/rel650/include/class_iaction.php
phpcompta/tags/rel650/include/class_ianccard.php
phpcompta/tags/rel650/include/class_ibutton.php
phpcompta/tags/rel650/include/class_icard.php
phpcompta/tags/rel650/include/class_icheckbox.php
phpcompta/tags/rel650/include/class_iconcerned.php
phpcompta/tags/rel650/include/class_idate.php
phpcompta/tags/rel650/include/class_ihidden.php
phpcompta/tags/rel650/include/class_inum.php
phpcompta/tags/rel650/include/class_iperiod.php
phpcompta/tags/rel650/include/class_iposte.php
phpcompta/tags/rel650/include/class_irelated_action.php
phpcompta/tags/rel650/include/class_iselect.php
phpcompta/tags/rel650/include/class_itext.php
phpcompta/tags/rel650/include/class_itextarea.php
phpcompta/tags/rel650/include/class_itva_popup.php
Log:
improve html widget with un ID
Modified: phpcompta/tags/rel650/include/class_html_input.php
===================================================================
--- phpcompta/tags/rel650/include/class_html_input.php 2012-09-18 21:46:37 UTC
(rev 5116)
+++ phpcompta/tags/rel650/include/class_html_input.php 2012-09-18 21:47:27 UTC
(rev 5117)
@@ -70,7 +70,7 @@
var $ctrl; /*!<$ctrl is the
control to update (see js_search_card_control) */
var $tabindex;
- function __construct($p_name="",$p_value="")
+ function __construct($p_name="",$p_value="",$p_id="")
{
$this->name=$p_name;
$this->readOnly=false;
@@ -84,6 +84,7 @@
$this->javascript="";
$this->extra2="all";
$this->attribute=array();
+ $this->id=$p_id;
}
function setReadOnly($p_read)
Modified: phpcompta/tags/rel650/include/class_iaction.php
===================================================================
--- phpcompta/tags/rel650/include/class_iaction.php 2012-09-18 21:46:37 UTC
(rev 5116)
+++ phpcompta/tags/rel650/include/class_iaction.php 2012-09-18 21:47:27 UTC
(rev 5117)
@@ -33,17 +33,18 @@
{
$this->name=($p_name=="")?$this->name:$p_name;
$this->value=($p_value=="")?$this->value:$p_value;
+ $this->id=($this->id=="")?$this->name:$this->id;
if ( $this->readOnly==true) return $this->display();
$this->javascript= (!isset ($this->javascript))?"":$this->javascript;
if ( $this->value !="")
$r=sprintf('<span id="%s" class="action"> <A class="action"
HREF="%s" %s>%s</A></span>',
- $this->name,
+ $this->id,
$this->value,
$this->javascript,
$this->label);
else
$r=sprintf('<span id="%s" class="action"> <A class="action"
href="javascript: %s">%s</A></span>',
- $this->name,
+ $this->id,
$this->javascript,
$this->label);
Modified: phpcompta/tags/rel650/include/class_ianccard.php
===================================================================
--- phpcompta/tags/rel650/include/class_ianccard.php 2012-09-18 21:46:37 UTC
(rev 5116)
+++ phpcompta/tags/rel650/include/class_ianccard.php 2012-09-18 21:47:27 UTC
(rev 5117)
@@ -26,16 +26,16 @@
*/
/*!
- * \brief
+ * \brief
*/
require_once('class_html_input.php');
require_once('function_javascript.php');
class IAncCard extends HtmlInput
{
- function __construct($name="",$value="")
+ function __construct($name="",$value="",$p_id="")
{
- parent::__construct($name,$value);
+ parent::__construct($name,$value,$p_id);
$this->fct='update_value';
$this->dblclick='';
$this->callback='null';
@@ -63,7 +63,7 @@
{
$this->fct=$p_name;
}
-
+
/*!\brief set the extra javascript property for a double click on
* INPUT field
*\param $p_action action when a double click happens
@@ -82,9 +82,10 @@
$this->value=($p_value==null)?$this->value:$p_value;
if ( $this->readOnly==true) return $this->display();
+ $this->id=($this->id=="")?$this->name:$this->id;
-
+
$label='';
if ( $this->dblclick != '')
{
@@ -106,7 +107,7 @@
$div=sprintf('<div id="%s_choices" class="autocomplete"></div>',
$this->name);
$query="op=autoanc&".dossier::get();
-
+
// add parameter to search into a plan (pa_id) or get the value from
// a HtmlObject
if ($this->plan <> 0)
@@ -138,7 +139,7 @@
/*!\brief print in html the readonly value of the widget*/
public function display()
{
- $r=sprintf('
+ $r=sprintf('
<INPUT TYPE="hidden" NAME="%s" VALUE="%s" SIZE="8">',
$this->name,
$this->value
@@ -195,6 +196,6 @@
static public function test_me()
{
-
+
}
}
Modified: phpcompta/tags/rel650/include/class_ibutton.php
===================================================================
--- phpcompta/tags/rel650/include/class_ibutton.php 2012-09-18 21:46:37 UTC
(rev 5116)
+++ phpcompta/tags/rel650/include/class_ibutton.php 2012-09-18 21:47:27 UTC
(rev 5117)
@@ -21,7 +21,7 @@
// Copyright Author Dany De Bontridder address@hidden
/*!\file
- * \brief Html Input
+ * \brief Html Input
*/
require_once('class_html_input.php');
class IButton extends HtmlInput
@@ -34,10 +34,10 @@
$this->value=($p_value==null)?$this->value:$p_value;
if ( $this->readOnly==true) return $this->display();
$extra= ( isset($this->extra))?$this->extra:"";
-
+ $this->id=($this->id=="")?$this->name:$this->id;
$r='<input type="BUTTON" name="'.$this->name.'"'.
' class="button" '.
- ' id="'.$this->name.'"'.
+ ' id="'.$this->id.'"'.
' value="'.$this->label.'"'.
' onClick="'.$this->javascript.'"'.$extra.'>';
$attr=$this->get_js_attr();
Modified: phpcompta/tags/rel650/include/class_icard.php
===================================================================
--- phpcompta/tags/rel650/include/class_icard.php 2012-09-18 21:46:37 UTC
(rev 5116)
+++ phpcompta/tags/rel650/include/class_icard.php 2012-09-18 21:47:27 UTC
(rev 5117)
@@ -120,7 +120,7 @@
class ICard extends HtmlInput
{
- function __construct($name="",$value="")
+ function __construct($name="",$value="",$p_id="")
{
parent::__construct($name,$value);
$this->fct='update_value';
@@ -128,6 +128,7 @@
$this->callback='null';
$this->javascript='';
$this->autocomplete=1;
+ $this->id=$p_id;
}
/*!\brief set the javascript callback function
* by default it is update_value called BEFORE the querystring is send
@@ -191,7 +192,7 @@
$this->value=($p_value==null)?$this->value:$p_value;
if ( $this->readOnly==true) return $this->display();
- if ( ! isset($this->id )) $this->id=$this->name;
+ $this->id=($this->id=="")?$this->name:$this->id;
$attr=$this->get_js_attr();
Modified: phpcompta/tags/rel650/include/class_icheckbox.php
===================================================================
--- phpcompta/tags/rel650/include/class_icheckbox.php 2012-09-18 21:46:37 UTC
(rev 5116)
+++ phpcompta/tags/rel650/include/class_icheckbox.php 2012-09-18 21:47:27 UTC
(rev 5117)
@@ -21,7 +21,7 @@
// Copyright Author Dany De Bontridder address@hidden
/*!\file
- * \brief Html Input
+ * \brief Html Input
*/
require_once('class_html_input.php');
class ICheckBox extends HtmlInput
@@ -32,9 +32,10 @@
$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();
+ $this->id=($this->id=="")?$this->name:$this->id;
$check=( $this->selected==true )?"checked":"unchecked";
- $r='<input type="CHECKBOX" id="'.$this->name.'"
name="'.$this->name.'"'.' value="'.$this->value.'"';
+ $r='<input type="CHECKBOX" id="'.$this->id.'"
name="'.$this->name.'"'.' value="'.$this->value.'"';
$r.=" $check";
$r.=' '.$this->disabled." ".$this->javascript.'>';
Modified: phpcompta/tags/rel650/include/class_iconcerned.php
===================================================================
--- phpcompta/tags/rel650/include/class_iconcerned.php 2012-09-18 21:46:37 UTC
(rev 5116)
+++ phpcompta/tags/rel650/include/class_iconcerned.php 2012-09-18 21:47:27 UTC
(rev 5117)
@@ -30,12 +30,13 @@
class IConcerned extends HtmlInput
{
- public function __construct($p_name='',$p_value='')
+ public function __construct($p_name='',$p_value='',$p_id="")
{
$this->name=$p_name;
$this->value=$p_value;
$this->amount_id=null;
$this->paid='';
+ $this->id=$p_id;
}
/*!\brief show the html input of the widget*/
public function input($p_name=null,$p_value=null)
@@ -44,6 +45,7 @@
$this->value=($p_value==null)?$this->value:$p_value;
if ( $this->readOnly==true) return $this->display();
+ $this->id=($this->id=="")?$this->name:$this->id;
$r=sprintf("
@@ -56,9 +58,9 @@
$this->amount_id,
$this->paid,
$this->name,
- $this->name,
+ $this->id,
$this->value,
- $this->name
+ $this->id
);
return $r;
}
Modified: phpcompta/tags/rel650/include/class_idate.php
===================================================================
--- phpcompta/tags/rel650/include/class_idate.php 2012-09-18 21:46:37 UTC
(rev 5116)
+++ phpcompta/tags/rel650/include/class_idate.php 2012-09-18 21:47:27 UTC
(rev 5117)
@@ -32,7 +32,7 @@
$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->id))
+ if( $this->id=="")
$this->id=self::generate_id($this->name);
$r='<input type="text" name="'.$this->name.'" id="'.$this->id.'"'.
'style="border:solid 1px blue;"'.
Modified: phpcompta/tags/rel650/include/class_ihidden.php
===================================================================
--- phpcompta/tags/rel650/include/class_ihidden.php 2012-09-18 21:46:37 UTC
(rev 5116)
+++ phpcompta/tags/rel650/include/class_ihidden.php 2012-09-18 21:47:27 UTC
(rev 5117)
@@ -31,7 +31,8 @@
{
$this->name=($p_name==null)?$this->name:$p_name;
$this->value=($p_value==null)?$this->value:$p_value;
- $this->id=(! isset($this->id))?$this->name:$this->id;
+ $this->id=($this->id=="")?$this->name:$this->id;
+
$r='<INPUT TYPE="HIDDEN" id="'.$this->id.'" name="'.$this->name.'"
value="'.$this->value.'">';
return $r;
Modified: phpcompta/tags/rel650/include/class_inum.php
===================================================================
--- phpcompta/tags/rel650/include/class_inum.php 2012-09-18 21:46:37 UTC
(rev 5116)
+++ phpcompta/tags/rel650/include/class_inum.php 2012-09-18 21:47:27 UTC
(rev 5117)
@@ -53,10 +53,12 @@
{
$readonly=" readonly ";
+ $this->id=($this->id=="")?$this->name:$this->id;
+
$style='style="border:solid 1px
blue;color:black;background:#EDEDED;text-align:right"';
$this->value=str_replace('"','',$this->value);
$r='<INPUT '.$style.' TYPE="TEXT" id="'.
- $this->name.'"'.
+ $this->id.'"'.
'NAME="'.$this->name.'" VALUE="'.$this->value.'" '.
'SIZE="'.$this->size.'" '.$this->javascript." $readonly
$this->extra >";
@@ -74,6 +76,8 @@
}
$this->name=($p_name==null)?$this->name:$p_name;
$this->value=($p_value==null)?$this->value:$p_value;
+ $this->id=($this->id=="")?$this->name:$this->id;
+
if ( $this->readOnly==true) return $this->display();
$t= ((isset($this->title)))?'title="'.$this->title.'" ':' ';
@@ -84,13 +88,13 @@
if ( ! isset ($this->css_size))
{
$r='<INPUT '.$this->style.' TYPE="TEXT" id="'.
- $this->name.'"'.$t.
+ $this->id.'"'.$t.
'NAME="'.$this->name.'" VALUE="'.$this->value.'" '.
'SIZE="'.$this->size.'" '.$this->javascript." $this->extra >";
/* add tag for column if inside a table */
} else {
$r='<INPUT '.$this->style.' TYPE="TEXT" id="'.
- $this->name.'"'.$t.
+ $this->id.'"'.$t.
'NAME="'.$this->name.'" VALUE="'.$this->value.'" '.
' style="width:'.$this->css_size.';" '.$this->javascript."
$this->extra >";
Modified: phpcompta/tags/rel650/include/class_iperiod.php
===================================================================
--- phpcompta/tags/rel650/include/class_iperiod.php 2012-09-18 21:46:37 UTC
(rev 5116)
+++ phpcompta/tags/rel650/include/class_iperiod.php 2012-09-18 21:47:27 UTC
(rev 5117)
@@ -21,11 +21,11 @@
// Copyright Author Dany De Bontridder address@hidden
/*!\file
- * \brief Html Input
+ * \brief Html Input
*/
/*! \brief Generate the form for the periode
* Data Members
- * - $cn connexion to the current folder
+ * - $cn connexion to the current folder
* - $type the type of the periode OPEN CLOSE NOTCENTRALIZED or ALL, IT MUST
BE SET
* - $filter_year make a filter on the default exercice by default true
* - $user if a filter_year is required then we need who is the user (object
User)
@@ -56,7 +56,7 @@
$this->extra2="all";
$this->show_start_date=true;
$this->show_end_date=true;
- $this->exercice=$p_exercice;
+ $this->exercice=$p_exercice;
}
/*!
* \brief show the input html for a periode
@@ -64,8 +64,8 @@
*\param $p_value is the default value
*\param $p_exercice is the exercice, if not set then the user preference
is used
* \return string containing html code for the HTML
- *
*
+ *
*/
public function input($p_name=null,$p_value=null)
{
Modified: phpcompta/tags/rel650/include/class_iposte.php
===================================================================
--- phpcompta/tags/rel650/include/class_iposte.php 2012-09-18 21:46:37 UTC
(rev 5116)
+++ phpcompta/tags/rel650/include/class_iposte.php 2012-09-18 21:47:27 UTC
(rev 5117)
@@ -80,7 +80,7 @@
class IPoste extends HtmlInput
{
- function __construct($p_name="",$p_value="")
+ function __construct($p_name="",$p_value="",$p_id="")
{
$this->name=$p_name;
$this->readOnly=false;
@@ -92,6 +92,7 @@
$this->javascript="";
$this->extra2="all";
$this->attribute=array();
+ $this->id=$p_id;
}
@@ -116,7 +117,7 @@
{
list($name,$value)=$this->attribute[$i];
$tmp1=sprintf("$('%s_bt').%s='%s';",
- $this->name,
+ $this->id,
$name,
$value);
$attr.=$tmp1;
@@ -127,7 +128,8 @@
public function dsp_button()
{
- $ib=new IButton($this->name.'_bt');
+ $this->id=($this->id=="")?$this->name:$this->id;
+ $ib=new IButton($this->id.'_bt');
$ib->javascript='search_poste(this)';
/* add the property */
@@ -144,9 +146,10 @@
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);
+ $itext=new IText($this->name,$this->value,$this->id);
if ( isset ($this->css_size))
$itext->css_size=$this->css_size;
Modified: phpcompta/tags/rel650/include/class_irelated_action.php
===================================================================
--- phpcompta/tags/rel650/include/class_irelated_action.php 2012-09-18
21:46:37 UTC (rev 5116)
+++ phpcompta/tags/rel650/include/class_irelated_action.php 2012-09-18
21:47:27 UTC (rev 5117)
@@ -41,6 +41,7 @@
$this->value=($p_value==null)?$this->value:$p_value;
if ( $this->readOnly==true) return $this->display();
+ $this->id=($this->id=="")?$this->name:$this->id;
$r=sprintf("
@@ -49,11 +50,11 @@
<INPUT TYPE=\"button\"
onClick=\"$('%s').value=''\" value=\"X\">
",
+ $this->id,
$this->name,
- $this->name,
- $this->name,
+ $this->id,
$this->value,
- $this->name
+ $this->id
);
return $r;
}
Modified: phpcompta/tags/rel650/include/class_iselect.php
===================================================================
--- phpcompta/tags/rel650/include/class_iselect.php 2012-09-18 21:46:37 UTC
(rev 5116)
+++ phpcompta/tags/rel650/include/class_iselect.php 2012-09-18 21:47:27 UTC
(rev 5117)
@@ -33,12 +33,13 @@
$this->value=($p_value==null)?$this->value:$p_value;
if ( $this->readOnly==true) return $this->display();
$style=(isset($this->style))?$this->style:"";
+ $this->id=($this->id=="")?$this->name:$this->id;
$disabled=($this->disabled==true)?"disabled":"";
$r="";
- $a="<SELECT id=\"$this->name\" NAME=\"$this->name\" $style
$this->javascript $disabled>";
+ $a="<SELECT id=\"$this->id\" NAME=\"$this->name\" $style
$this->javascript $disabled>";
if (empty($this->value)) return '';
for ( $i=0;$i<sizeof($this->value);$i++)
Modified: phpcompta/tags/rel650/include/class_itext.php
===================================================================
--- phpcompta/tags/rel650/include/class_itext.php 2012-09-18 21:46:37 UTC
(rev 5116)
+++ phpcompta/tags/rel650/include/class_itext.php 2012-09-18 21:47:27 UTC
(rev 5117)
@@ -26,9 +26,9 @@
require_once('class_html_input.php');
class IText extends HtmlInput
{
- function __construct($name='',$value='')
+ function __construct($name='',$value='',$p_id="")
{
- parent::__construct($name,$value);
+ parent::__construct($name,$value,$p_id);
$this->style=' class="input_text" ';
}
/*!\brief show the html input of the widget*/
@@ -37,6 +37,7 @@
$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();
+ $this->id=($this->id=="")?$this->name:$this->id;
$t= ((isset($this->title)))?'title="'.$this->title.'" ':' ';
@@ -46,13 +47,13 @@
if ( ! isset ($this->css_size))
{
$r='<INPUT '.$this->style.' TYPE="TEXT" id="'.
- $this->name.'"'.$t.
+ $this->id.'"'.$t.
'NAME="'.$this->name.'" VALUE="'.$this->value.'" '.
'SIZE="'.$this->size.'" '.$this->javascript." $this->extra >";
/* add tag for column if inside a table */
} else {
$r='<INPUT '.$this->style.' TYPE="TEXT" id="'.
- $this->name.'"'.$t.
+ $this->id.'"'.$t.
'NAME="'.$this->name.'" VALUE="'.$this->value.'" '.
' style="width:'.$this->css_size.';" '.$this->javascript."
$this->extra >";
@@ -76,12 +77,12 @@
if ( ! isset ($this->css_size))
{
$r='<INPUT '.$this->style.' TYPE="TEXT" id="'.
- $this->name.'"'.$t.
+ $this->id.'"'.$t.
'NAME="'.$this->name.'" VALUE="'.$this->value.'" '.
'SIZE="'.$this->size.'" '.$this->javascript." $readonly
$this->extra >";
} else {
$r='<INPUT '.$this->style.' TYPE="TEXT" id="'.
- $this->name.'"'.$t.
+ $this->id.'"'.$t.
'NAME="'.$this->name.'" VALUE="'.$this->value.'" '.
' style="width:'.$this->css_size.'" '.$this->javascript." $readonly
$this->extra >";
}
Modified: phpcompta/tags/rel650/include/class_itextarea.php
===================================================================
--- phpcompta/tags/rel650/include/class_itextarea.php 2012-09-18 21:46:37 UTC
(rev 5116)
+++ phpcompta/tags/rel650/include/class_itextarea.php 2012-09-18 21:47:27 UTC
(rev 5117)
@@ -32,10 +32,12 @@
$this->name=($p_name==null)?$this->name:$p_name;
$this->value=($p_value==null)?$this->value:$p_value;
if ( !isset ($this->style )) $this->style=' style="border:solid
blue 1px" ';
+ $this->id=($this->id=="")?$this->name:$this->id;
+
if ( $this->readOnly==true) return $this->display();
$r="";
- $r.='<TEXTAREA '.$this->style.' name="'.$this->name.'"
id="'.$this->name.'"';
+ $r.='<TEXTAREA '.$this->style.' name="'.$this->name.'"
id="'.$this->id.'"';
$r.=" rows=\"$this->heigh\" ";
$r.=" cols=\"$this->width\" ";
$r.='>';
Modified: phpcompta/tags/rel650/include/class_itva_popup.php
===================================================================
--- phpcompta/tags/rel650/include/class_itva_popup.php 2012-09-18 21:46:37 UTC
(rev 5116)
+++ phpcompta/tags/rel650/include/class_itva_popup.php 2012-09-18 21:47:27 UTC
(rev 5117)
@@ -55,11 +55,13 @@
* to have its own javascript for the button you can use
this->but_javascript)
* by default it is 'popup_select_tva(this)';
*/
- public function __construct($p_name=null)
+ public function __construct($p_name=null,$p_value="",$p_id="")
{
$this->name=$p_name;
$this->button=true;
$this->in_table=false;
+ $this->value=$p_value;
+ $this->id=$p_id;
}
function with_button($p)
{
@@ -74,10 +76,12 @@
$this->name=($p_name==null)?$this->name:$p_name;
$this->value=($p_value==null)?$this->value:$p_value;
$this->js=(isset($this->js))?$this->js:'onchange="format_number(this);"';
+ $this->id=($this->id=="")?$this->name:$this->id;
+
if ( $this->readOnly==true) return $this->display();
$str='<input type="TEXT" class="input_text" name="%s" value="%s"
id="%s" size="3" %s>';
- $r=sprintf($str,$this->name,$this->value,$this->name,$this->js);
+ $r=sprintf($str,$this->name,$this->value,$this->id,$this->js);
if ($this->in_table)
$table='<table>'.'<tr>'.td($r);
@@ -120,11 +124,13 @@
function dbutton()
{
if( trim($this->name)=='') throw new Exception (_('Le nom ne peut ĂȘtre
vide'));
+ $this->id=($this->id=="")?$this->name:$this->id;
+
// button
- $bt=new IButton('bt_'.$this->name);
+ $bt=new IButton('bt_'.$this->id);
$bt->label=_(' TVA ');
$bt->set_attribute('gDossier',dossier::id());
- $bt->set_attribute('ctl',$this->name);
+ $bt->set_attribute('ctl',$this->id);
$bt->set_attribute('popup','popup_tva');
if ( isset($this->code))
$bt->set_attribute('jcode',$this->code->name);
---
PhpCompta est un logiciel de comptabilité libre en ligne (full web)
Projet opensource http://www.phpcompta.eu
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpcompta-dev] r5117 - phpcompta/tags/rel650/include,
phpcompta-dev <=