diff --git a/html/js/anc_script.js b/html/js/anc_script.js
index eb2ec293c..72dee8bb8 100644
--- a/html/js/anc_script.js
+++ b/html/js/anc_script.js
@@ -114,7 +114,7 @@ function caod_checkTotal() {
}// Ajouter getElementById par document.all[str]
var total_deb=0.0;
var total_cred=0.0;
- var nb_item=10;
+ var nb_item=g('nbrow').value;
for (var i=0;i
';
+
//----------------------------------------------------------------------
// the pa_id is set
//
diff --git a/include/class_anc_group_operation.php b/include/class_anc_group_operation.php
index 4f5ce1814..6a512f866 100644
--- a/include/class_anc_group_operation.php
+++ b/include/class_anc_group_operation.php
@@ -107,7 +107,8 @@ class Anc_Group_Operation
$wDescription->input()."";
$Plan=new Anc_Plan($this->db);
$aPlan=$Plan->get_list();
- $ret.='';
+ $max=(count($this->a_operation)<$this->nMaxRow)?$this->nMaxRow:count($this->a_operation);
+ $ret.='
';
/* show 10 rows */
$ret.="";
foreach ($aPlan as $d)
@@ -127,7 +128,7 @@ class Anc_Group_Operation
"| Débit | ".
"
";
- for ($i = 0;$i < $this->nMaxRow;$i++)
+ for ($i = 0;$i < $max;$i++)
{
$ret.="";
@@ -170,6 +171,14 @@ class Anc_Group_Operation
$ret.="
";
}
$ret.="
";
+ if ( $p_readonly==false) {
+ $add_row=new IButton('Ajouter');
+ $add_row->label=_('Ajouter une ligne');
+ $add_row->javascript='anc_add_row(\'ago\');';
+ $ret.=HtmlInput::hidden('nbrow',$max);
+
+ $ret.=$add_row->input();
+ }
return $ret;
}
/*!\brief fill row from $_POST data
@@ -180,7 +189,7 @@ class Anc_Group_Operation
$aPlan=$Plan->get_list();
- for ( $i = 0;$i <$this->nMaxRow;$i++) {
+ for ( $i = 0;$i <$p_array['nbrow'];$i++) {
foreach ($aPlan as $d)
{
$idx=$d['id'];
diff --git a/include/class_anc_operation.php b/include/class_anc_operation.php
index a1285224e..19f9c5e15 100644
--- a/include/class_anc_operation.php
+++ b/include/class_anc_operation.php
@@ -245,7 +245,7 @@ class Anc_Operation
$efface=new IButton();
- $efface->javascript="op_remove('"."$gDossier,".$oldgroup.")";
+ $efface->javascript="op_remove("."$gDossier,".$oldgroup.")";
$efface->name="Efface";
$efface->label="Efface";
$ret.="".$efface->input()." | ";
@@ -254,7 +254,7 @@ class Anc_Operation
$jr_id=$this->get_jrid();
if ( $jr_id != 0 ){
$detail=new IButton();
- $detail->javascript="viewOperation($jr_id,'"."$gDossier)";
+ $detail->javascript="modifyOperation($jr_id,'"."$gDossier)";
$detail->name="Detail";
$detail->label="Detail";
$ret.="".$detail->input()." | ";