diff --git a/include/action.inc.php b/include/action.inc.php
index c60406e80..b7edc4277 100644
--- a/include/action.inc.php
+++ b/include/action.inc.php
@@ -245,11 +245,59 @@ if ( $sub_action=='detail' )
echo $upload->Submit("save","Sauve");
echo $upload->Submit("add_action_here","Ajoute une action à celle-ci");
echo '';
+ echo '
';
+ echo '
';
+ $act=new action($cn);
+ $act->ag_id=$_REQUEST['ag_id'];
+ echo $act->get();
+ $act->ag_comment=Decode($act->ag_comment);
+
+ echo JS_SEARCH_CARD;
+ echo $act->display('READ',false);
+ // display the form
+ echo '
';
+
+
+
+ echo '
';
+
+ }
+ else
+ {
+ // confirmed
+ $act=new action($cn);
+ $act->ag_id=$_REQUEST['ag_id'];
+ $act->remove();
+ $sub_action="list";
+ }
+}
+
//--------------------------------------------------------------------------------
// Show a list of the action
if ( $sub_action == "list" )
@@ -372,3 +420,4 @@ if ( $sub_action == "save_action_st3" )
//---------------------------------------------------------------------
echo "";
+?>
\ No newline at end of file
diff --git a/include/class_action.php b/include/class_action.php
index 5bd3f5055..a2511951d 100644
--- a/include/class_action.php
+++ b/include/class_action.php
@@ -59,6 +59,7 @@ class action
* \enum $f_id_dest fiche id (From field )
* \enum $f_id_exp fiche id (to field)
* \enum $ag_ref_ag_id concern previous action
+ * \enum $ag_id pk of the table action_gestion
* \todo replace attribut from class document document by an object document
*/
@@ -174,9 +175,12 @@ class action
$state->selected=$this->d_state;
$str_state=$state->IOValue();
} else {
- $str_state=getDbValue($this->db,"select s_value from document_state where s_id=".$this->d_state);
- $g=new widget("hidden");
- $str_state.=$g->IOValue('d_state',$this->d_state);
+ $str_state="";
+ if ( strlen($this->d_state) != 0 )
+ { $str_state=getDbValue($this->db,"select s_value from document_state where s_id=".$this->d_state);
+ $g=new widget("hidden");
+ $str_state.=$g->IOValue('d_state',$this->d_state);
+ }
}
// Retrieve the value if there is an attached doc
$doc_ref="";
@@ -190,10 +194,14 @@ class action
{
$h2->readonly=($p_view=='NEW')?false:true;
$doc=new Document($this->db,$this->d_id);
- $d_id=new widget("hidden");
- $doc_ref="