|
@@ -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;
|
|
|
}
|
|
@@ -541,7 +542,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;
|
|
@@ -1513,7 +1522,7 @@ if ($id > 0) {
|
|
|
if ($backtopage) {
|
|
|
print '<input type="hidden" name="backtopage" value="'.($backtopage != '1' ? $backtopage : dol_htmlentities($_SERVER["HTTP_REFERER"])).'">';
|
|
|
}
|
|
|
- if (empty($conf->global->AGENDA_USE_EVENT_TYPE)) {
|
|
|
+ if (empty($conf->global->AGENDA_USE_EVENT_TYPE) && $object->code != "TICKET_MSG_PRIVATE") {
|
|
|
print '<input type="hidden" name="actioncode" value="'.$object->type_code.'">';
|
|
|
}
|
|
|
|
|
@@ -1525,7 +1534,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 img_picto($langs->trans("ActionType"), 'square', 'class="fawidth30 inline-block" style="color: #ddd;"');
|
|
@@ -1538,6 +1547,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'.(empty($conf->global->AGENDA_USE_EVENT_TYPE) ? ' class="fieldrequired titlefieldcreate"' : '').'>'.$langs->trans("Title").'</td><td colspan="3"><input type="text" name="label" class="soixantepercent" value="'.$object->label.'"></td></tr>';
|
|
|
|
|
@@ -1994,13 +2006,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>';
|
|
|
|