From 5dde5e1a203c9fc6699b403b117d97bcfff7141d Mon Sep 17 00:00:00 2001 From: atm-lena Date: Fri, 14 Oct 2022 09:54:47 +0200 Subject: [PATCH] Input "Private Mssage" --- htdocs/comm/action/card.php | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) 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("Ref").''.$object->id.''; // Type of event - if (!empty($conf->global->AGENDA_USE_EVENT_TYPE)) { + if (!empty($conf->global->AGENDA_USE_EVENT_TYPE) && $object->elementtype != "ticket") { print ''.$langs->trans("Type").''; if ($object->type_code != 'AC_OTH_AUTO') { print $formactions->select_type_actions(GETPOST("actioncode", 'aZ09') ? GETPOST("actioncode", 'aZ09') : $object->type_code, "actioncode", "systemauto", 0, 0, 0, 1); @@ -1536,6 +1541,9 @@ if ($id > 0) { print ''; } + // Private + if($object->elementtype == 'ticket') print ''.$langs->trans("PrivateEventMessage").'code == 'TICKET_MSG_PRIVATE') ? ' checked' : '').'>'; + // Title print ''.$langs->trans("Title").''; @@ -1983,13 +1991,16 @@ if ($id > 0) { print ''; // Type - if (!empty($conf->global->AGENDA_USE_EVENT_TYPE)) { + if (!empty($conf->global->AGENDA_USE_EVENT_TYPE) && $object->elementtype != 'ticket') { print ''; } + // Private + if($object->elementtype == 'ticket') print ''; + // Full day event 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).'