Skip to content
Snippets Groups Projects
Commit 40e061a1 authored by Peter Rotich's avatar Peter Rotich
Browse files

Maintain user input on error

Make the error message clear
parent bf4416af
No related branches found
No related tags found
No related merge requests found
......@@ -901,9 +901,9 @@ class TicketsAjaxAPI extends AjaxController {
}
}
$count = count($_REQUEST['tids']);
if (!$errors) {
$i = 0;
$count = count($_REQUEST['tids']);
$comments = $_REQUEST['comments'];
foreach ($_REQUEST['tids'] as $tid) {
if (($ticket=Ticket::lookup($tid))
......@@ -914,8 +914,8 @@ class TicketsAjaxAPI extends AjaxController {
}
if (!$i)
$errors['err'] = sprintf(__('Unable to set status for %s'),
_N('selected ticket', 'selected tickets', $count));
$errors['err'] = sprintf(__('Unable to change status for %s'),
_N('the selected ticket', 'any of the selected tickets', $count));
else {
// Assume success
if ($i==$count) {
......@@ -936,6 +936,17 @@ class TicketsAjaxAPI extends AjaxController {
}
}
$info['title'] = sprintf('%s %s',
TicketStateField::getVerb($state),
__('Tickets'));
if ($count)
$info['title'] .= sprintf(' — %d %s',
$count, __('selected'));
$info['status_id'] = $_REQUEST['status_id'];
$info['comments'] = Format::htmlchars($_REQUEST['comments']);
$info['errors'] = $errors;
return self::_setStatus($state, $info);
}
......
......@@ -86,7 +86,7 @@ $action = $info['action'] ?: ('#tickets/status/'. $state);
cols="50" rows="3" wrap="soft" style="width:100%"
class="richtext ifhtml no-bar"
placeholder="<?php echo $placeholder; ?>"><?php
echo $info['notes']; ?></textarea>
echo $info['comments']; ?></textarea>
</td>
</tr>
</tbody>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment