diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 02f52de7388..eeaa81a2d48 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -71,6 +71,7 @@ $offsetunit = GETPOST('offsetunittype_duration', 'aZ09'); $remindertype = GETPOST('selectremindertype', 'aZ09'); $modelmail = GETPOST('actioncommsendmodel_mail', 'int'); $complete = GETPOST('complete', 'alpha'); // 'na' must be allowed +$private = GETPOST('private', 'alphanohtml'); if ($complete == 'na' || $complete == -2) { $complete = -1; } @@ -534,7 +535,15 @@ 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->elementtype == 'ticket'){ + if($private){ + $object->type_code = 'TICKET_MSG_PRIVATE'; + } else { + $object->type_id = dol_getIdFromCode($db, 'AC_EMAIL', 'c_actioncomm'); + } + } 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 +1517,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 ''; } @@ -1520,7 +1529,7 @@ if ($id > 0) { print '
| '.$langs->trans("Type").' | '; print $object->getTypePicto(); print $langs->trans("Action".$object->type_code); print ' |
| '.$langs->trans("PrivateEventMessage").' | '.yn(($object->code == 'TICKET_MSG_PRIVATE') ? 1 : 0, 3).' |
| '.$langs->trans("EventOnFullDay").' | '.yn($object->fulldayevent ? 1 : 0, 3).' |