diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index af32f12c8e0..7de5c0e25ce 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -619,8 +619,7 @@ if (empty($reshook)) // prevent browser refresh from closing proposal several times if ($object->statut == Propal::STATUS_VALIDATED) { - $newprivatenote = dol_concatdesc($object->note_private, GETPOST('note_private','alpha')); - $result=$object->cloture($user, GETPOST('statut','int'), $newprivatenote); + $result=$object->cloture($user, GETPOST('statut','int'), GETPOST('note_private','none')); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); @@ -1688,8 +1687,8 @@ if ($action == 'create') //Form to close proposal (signed or not) $formquestion = array( array('type' => 'select','name' => 'statut','label' => $langs->trans("CloseAs"),'values' => array(2=>$object->labelstatut [2],3=>$object->labelstatut [3])), - //array('type' => 'other','name' => 'note_private', 'label' => $langs->trans("Note"),'value' => '')); - array('type' => 'text', 'name' => 'note_private', 'label' => $langs->trans("Note"),'value' => $object->note_private)); + array('type' => 'text', 'name' => 'note_private', 'label' => $langs->trans("Note"),'value' => '') // Field to complete private note (not replace) + ); if (! empty($conf->notification->enabled)) { require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php'; diff --git a/htdocs/comm/propal/class/api_proposals.class.php b/htdocs/comm/propal/class/api_proposals.class.php index e13b9b71b90..97632a8b4a3 100644 --- a/htdocs/comm/propal/class/api_proposals.class.php +++ b/htdocs/comm/propal/class/api_proposals.class.php @@ -512,7 +512,7 @@ class Proposals extends DolibarrApi * * @param int $id Commercial proposal ID * @param int $status Must be 2 (accepted) or 3 (refused) {@min 2}{@max 3} - * @param string $note_private Add this mention to the private note + * @param string $note_private Add this mention at end of private note * @param int $notrigger Disabled triggers * * @url POST {id}/close diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 61aa2a3ddb6..322deadfee3 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -2215,7 +2215,7 @@ class Propal extends CommonObject * * @param User $user Object user that close * @param int $statut Statut - * @param string $note Comment + * @param string $note Complete private note with this note * @param int $notrigger 1=Does not execute triggers, 0=Execute triggers * @return int <0 if KO, >0 if OK */ @@ -2228,8 +2228,10 @@ class Propal extends CommonObject $this->db->begin(); + $newprivatenote = dol_concatdesc($this->note_private, $note); + $sql = "UPDATE ".MAIN_DB_PREFIX."propal"; - $sql.= " SET fk_statut = ".$statut.", note_private = '".$this->db->escape($note)."', date_cloture='".$this->db->idate($now)."', fk_user_cloture=".$user->id; + $sql.= " SET fk_statut = ".$statut.", note_private = '".$this->db->escape($newprivatenote)."', date_cloture='".$this->db->idate($now)."', fk_user_cloture=".$user->id; $sql.= " WHERE rowid = ".$this->id; $resql=$this->db->query($sql);