diff --git a/include/class.forms.php b/include/class.forms.php index ca4cf44a7a38e31eea60365ffc23139e68603275..ca2f9b078e0613381b5c028a9406c5967eb1aeda 100644 --- a/include/class.forms.php +++ b/include/class.forms.php @@ -1146,7 +1146,7 @@ class ThreadEntryWidget extends Widget { ?><div style="margin-bottom:0.5em;margin-top:0.5em"><strong><?php echo Format::htmlchars($this->field->get('label')); ?></strong>:</div> - <textarea name="<?php echo $this->field->get('name'); ?>" + <textarea style="width:100%;" name="<?php echo $this->field->get('name'); ?>" placeholder="<?php echo Format::htmlchars($this->field->get('hint')); ?>" <?php if (!$client) { ?> data-draft-namespace="ticket.staff" @@ -1156,7 +1156,7 @@ class ThreadEntryWidget extends Widget { <?php } ?> class="richtext draft draft-delete ifhtml" cols="21" rows="8" style="width:80%;"><?php echo - $this->value; ?></textarea> + Format::htmlchars($this->value); ?></textarea> <?php } @@ -1167,6 +1167,7 @@ class ThreadEntryWidget extends Widget { && !$cfg->allowAttachmentsOnlogin()) || ($cfg->allowAttachmentsOnlogin() && ($thisclient && $thisclient->isValid()))) { ?> + <div class="clear"><div> <hr/> <div><strong style="padding-right:1em;vertical-align:top">Attachments: </strong> <div style="display:inline-block"> diff --git a/open.php b/open.php index a731e2132465e29d0014ae78341d18fd0614408d..f8675608a081e0e0fcc7bd8d0de7e5b3db4cce54 100644 --- a/open.php +++ b/open.php @@ -42,10 +42,12 @@ if($_POST): if (!$errors && $cfg->allowOnlineAttachments() && $_FILES['attachments']) $vars['files'] = AttachmentFile::format($_FILES['attachments'], true); + // Drop the draft.. If there are validation errors, the content + // submitted will be displayed back to the user + Draft::deleteForNamespace('ticket.client.'.substr(session_id(), -12)); //Ticket::create...checks for errors.. if(($ticket=Ticket::create($vars, $errors, SOURCE))){ $msg='Support ticket request created'; - Draft::deleteForNamespace('ticket.client.'.substr(session_id(), -12)); // Save the form data from the help-topic form, if any if ($form) { $form->setTicketId($ticket->getId());