diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index a27404eab8c..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,8 +535,12 @@ 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'); } - if($object->code = 'TICKET_MSG_PRIVATE') { - $object->type_code = 'TICKET_MSG_PRIVATE'; + 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'); } @@ -1524,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).' |