Input "Private Mssage"

This commit is contained in:
atm-lena 2022-10-14 09:54:47 +02:00
parent 1cec84c21a
commit 5dde5e1a20

View File

@ -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 '<tr><td class="titlefieldcreate">'.$langs->trans("Ref").'</td><td colspan="3">'.$object->id.'</td></tr>';
// Type of event
if (!empty($conf->global->AGENDA_USE_EVENT_TYPE)) {
if (!empty($conf->global->AGENDA_USE_EVENT_TYPE) && $object->elementtype != "ticket") {
print '<tr><td class="fieldrequired">'.$langs->trans("Type").'</td><td colspan="3">';
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 '</td></tr>';
}
// Private
if($object->elementtype == 'ticket') print '<tr><td>'.$langs->trans("PrivateEventMessage").'</td><td colspan="3"><input type="checkbox" id="private" name="private" '.(($object->code == 'TICKET_MSG_PRIVATE') ? ' checked' : '').'></td></tr>';
// Title
print '<tr><td class="fieldrequired">'.$langs->trans("Title").'</td><td colspan="3"><input type="text" name="label" class="soixantepercent" value="'.$object->label.'"></td></tr>';
@ -1983,13 +1991,16 @@ if ($id > 0) {
print '<table class="border tableforfield" width="100%">';
// Type
if (!empty($conf->global->AGENDA_USE_EVENT_TYPE)) {
if (!empty($conf->global->AGENDA_USE_EVENT_TYPE) && $object->elementtype != 'ticket') {
print '<tr><td class="titlefield">'.$langs->trans("Type").'</td><td>';
print $object->getTypePicto();
print $langs->trans("Action".$object->type_code);
print '</td></tr>';
}
// Private
if($object->elementtype == 'ticket') print '<tr><td class="titlefield">'.$langs->trans("PrivateEventMessage").'</td><td>'.yn(($object->code == 'TICKET_MSG_PRIVATE') ? 1 : 0, 3).'</td></tr>';
// Full day event
print '<tr><td class="titlefield">'.$langs->trans("EventOnFullDay").'</td><td>'.yn($object->fulldayevent ? 1 : 0, 3).'</td></tr>';