From 133e736801b9dbb0268634dd7214864a00fa2136 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 16 May 2018 20:52:45 +0200 Subject: [PATCH] Fix save code --- htdocs/comm/action/class/actioncomm.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 5234a05db43..261948ab190 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -281,6 +281,7 @@ class ActionComm extends CommonObject return -1; } } + $code = empty($this->code)?$this->type_code:$this->code; // Check parameters if (! $this->type_id) @@ -316,7 +317,7 @@ class ActionComm extends CommonObject $sql.= (strval($this->datef)!=''?"'".$this->db->idate($this->datef)."'":"null").", "; $sql.= ((isset($this->durationp) && $this->durationp >= 0 && $this->durationp != '')?"'".$this->db->escape($this->durationp)."'":"null").", "; // deprecated $sql.= (isset($this->type_id)?$this->type_id:"null").","; - $sql.= (isset($this->type_code)?" '".$this->db->escape($this->type_code)."'":"null").", "; + $sql.= ($code?("'".$code."'"):"null").", "; $sql.= ((isset($this->socid) && $this->socid > 0) ? $this->socid:"null").", "; $sql.= ((isset($this->fk_project) && $this->fk_project > 0) ? $this->fk_project:"null").", "; $sql.= " '".$this->db->escape($this->note)."', ";