diff --git a/html/admin/sql/patch/upgrade98.sql b/html/admin/sql/patch/upgrade98.sql
index b392dce87..bdc9333c8 100644
--- a/html/admin/sql/patch/upgrade98.sql
+++ b/html/admin/sql/patch/upgrade98.sql
@@ -1,6 +1,9 @@
begin;
-update attr_def set ad_type='numeric' where ad_id=20;
+update attr_def set ad_type='poste' where ad_id=5;
+update attr_def set ad_type='numeric',ad_size=6 where ad_id in (20,31);
+update attr_def set ad_size=17 where ad_type='poste';
+
insert into tmp_pcmn (pcm_val,pcm_lib,pcm_val_parent,pcm_type) select split_part(tva_poste,',',1),tva_comment,substring(split_part(tva_poste,',',1),1,3),'PAS' from tva_rate where split_part(tva_poste,',',1) not in (select pcm_val from tmp_pcmn);
insert into tmp_pcmn (pcm_val,pcm_lib,pcm_val_parent,pcm_type) select split_part(tva_poste,',',2),tva_comment,substring(split_part(tva_poste,',',2),1,3),'ACT' from tva_rate where split_part(tva_poste,',',2) not in (select pcm_val from tmp_pcmn);
diff --git a/html/js/card.js b/html/js/card.js
index 36ab0dc58..66c0387f1 100644
--- a/html/js/card.js
+++ b/html/js/card.js
@@ -299,7 +299,7 @@ function fill_ipopcard(obj)
var content='card_'+card_layer;
var nTop=posY-40;
var nLeft=posX-20;
- var str_style="top:"+nTop+";left:"+nLeft+";width:40em;height:auto";
+ var str_style="top:"+nTop+";left:"+nLeft+";width:45em;height:auto";
var popup={'id': content,'cssclass':'inner_box','style':str_style,'html':loading(),'drag':true};
diff --git a/include/class_fiche.php b/include/class_fiche.php
index 22efd9ce2..c9b7b90f2 100644
--- a/include/class_fiche.php
+++ b/include/class_fiche.php
@@ -643,6 +643,7 @@ class Fiche
$w=new IPoste("av_text".$r->ad_id);
$w->set_attribute('ipopup','ipop_account');
$w->set_attribute('account',"av_text".$r->ad_id);
+ $w->width=$r->ad_size;
$w->table=0;
$bulle=HtmlInput::infobulle(14);
break;
@@ -651,6 +652,7 @@ class Fiche
// filter on frd_id
$sql=' select fd_id from fiche_def ';
$filter=$this->cn->make_list($sql);
+ $w->width=$r->ad_size;
$w->extra=$filter;
$w->extra2=0;
$label=new ISpan();
diff --git a/include/class_fiche_def.php b/include/class_fiche_def.php
index dcac1d46a..e327c8b7d 100644
--- a/include/class_fiche_def.php
+++ b/include/class_fiche_def.php
@@ -88,7 +88,7 @@ class Fiche_Def
$t->jnt_order=$row['jnt_order'];
$t->ad_size=$row['ad_size'];
$t->ad_type=$row['ad_type'];
- $this->attribut[$i]=$t;
+ $this->attribut[$i]=clone $t;
}
return $this->attribut;
}
diff --git a/include/class_iposte.php b/include/class_iposte.php
index 10e0d18bd..d2d3e580f 100644
--- a/include/class_iposte.php
+++ b/include/class_iposte.php
@@ -21,8 +21,8 @@
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
/*!\file
- * \brief Html Input
- *
+ * \brief Html Input
+ *
*/
require_once('class_html_input.php');
require_once('class_itext.php');
@@ -31,7 +31,7 @@ require_once('class_ipopup.php');
require_once('function_javascript.php');
/**
*@brief show a button, for selecting a account and a input text for manually inserting an account
- * the different value of table are
+ * the different value of table are
* - 0 no table, it means no TD tags
* - 1 the button and the text are separated by TD tags
* - 2 the button and the text are in the same column (TD)
@@ -63,11 +63,11 @@ require_once('function_javascript.php');
echo js_include('controls.js');
echo js_include('dragdrop.js');
echo js_include('accounting_item.js');
-
-
+
+
require_once('class_iposte.php');
echo IPoste::ipopup('ipop_account');
-
+
// In the FORM
$text=new IPoste();
$text->name('field');
@@ -76,8 +76,8 @@ $text->set_attribute('ipopup','ipop_account');
$text->set_attribute('gDossier',Dossier::id());
$text->set_attribute('jrn',0);
$text->set_attribute('account','field');
-
-
+
+
\endcode
*/
class IPoste extends HtmlInput
@@ -88,8 +88,6 @@ class IPoste extends HtmlInput
$this->name=$p_name;
$this->readOnly=false;
$this->size=10;
- $this->width=50;
- $this->heigh=20;
$this->value=$p_value;
$this->selected="";
$this->table=0;
@@ -152,7 +150,7 @@ class IPoste extends HtmlInput
/* create the text */
$itext=new IText($this->name,$this->value);
-
+ $itext->size=$this->size;
/* create the button */
$ibutton=$this->dsp_button();
if ( $this->table==3)
diff --git a/sql/upgrade.sql b/sql/upgrade.sql
index 424d2e4cb..5b51f1749 100644
--- a/sql/upgrade.sql
+++ b/sql/upgrade.sql
@@ -1,3 +1,6 @@
update attr_def set ad_type='numeric' where ad_id=20;
insert into tmp_pcmn (pcm_val,pcm_lib,pcm_val_parent,pcm_type) select split_part(tva_poste,',',1),tva_comment,substring(split_part(tva_poste,',',1),1,3),'PAS' from tva_rate where split_part(tva_poste,',',1) not in (select pcm_val from tmp_pcmn);
-insert into tmp_pcmn (pcm_val,pcm_lib,pcm_val_parent,pcm_type) select split_part(tva_poste,',',2),tva_comment,substring(split_part(tva_poste,',',2),1,3),'ACT' from tva_rate where split_part(tva_poste,',',2) not in (select pcm_val from tmp_pcmn);
\ No newline at end of file
+insert into tmp_pcmn (pcm_val,pcm_lib,pcm_val_parent,pcm_type) select split_part(tva_poste,',',2),tva_comment,substring(split_part(tva_poste,',',2),1,3),'ACT' from tva_rate where split_part(tva_poste,',',2) not in (select pcm_val from tmp_pcmn);
+update attr_def set ad_type='numeric',ad_size=6 where ad_id=20;
+update attr_def set ad_type='poste' where ad_id=5;
+update attr_def set ad_size=10 where ad_type='poste';