diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 02f52de7388..a27404eab8c 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -534,7 +534,11 @@ if (empty($reshook) && $action == 'update') { $datef = dol_mktime($fulldayevent ? '23' : GETPOST("p2hour", 'int'), $fulldayevent ? '59' : GETPOST("p2min", 'int'), $fulldayevent ? '59' : GETPOST("apsec", 'int'), GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'), 'tzuser'); } - $object->type_id = dol_getIdFromCode($db, GETPOST("actioncode", 'aZ09'), 'c_actioncomm'); + if($object->code = 'TICKET_MSG_PRIVATE') { + $object->type_code = 'TICKET_MSG_PRIVATE'; + } else { + $object->type_id = dol_getIdFromCode($db, GETPOST("actioncode", 'aZ09'), 'c_actioncomm'); + } $object->label = GETPOST("label", "alphanohtml"); $object->datep = $datep; $object->datef = $datef; @@ -1508,7 +1512,7 @@ if ($id > 0) { if ($backtopage) { print ''; } - if (empty($conf->global->AGENDA_USE_EVENT_TYPE)) { + if (empty($conf->global->AGENDA_USE_EVENT_TYPE) && $object->code != "TICKET_MSG_PRIVATE") { print ''; }