diff --git a/include/class.forms.php b/include/class.forms.php index 4a447cd14bcd0def2ed14a24892983b5023fc62c..4252be233d1a6ac056ed10992c3ed6f67888f766 100644 --- a/include/class.forms.php +++ b/include/class.forms.php @@ -3909,26 +3909,14 @@ class FileUploadWidget extends Widget { $config = $this->field->getConfiguration(); $name = $this->field->getFormName(); $id = substr(md5(spl_object_hash($this)), 10); - $attachments = $this->field->getAttachments(); $mimetypes = array_filter($config['__mimetypes'], function($t) { return strpos($t, '/') !== false; } ); $maxfilesize = ($config['size'] ?: 1048576) / 1048576; $files = array(); $new = array_fill_keys($this->field->getClean(), 1); - foreach ($attachments as $a) { - unset($new[$a->file_id]); - } - // Add in newly added files not yet saved (if redisplaying after an - // error) - if ($new) { - $attachments = array_merge($attachments, GenericAttachment::objects() - ->filter(array('file_id__in' => array_keys($new))) - ->all() - ); - } - - foreach ($attachments as $att) { + foreach ($this->field->getAttachments() as $att) { + unset($new[$att->file_id]); $files[] = array( 'id' => $att->file->getId(), 'name' => $att->getFilename(), @@ -3937,6 +3925,25 @@ class FileUploadWidget extends Widget { 'download_url' => $att->file->getDownloadUrl(), ); } + + // Add in newly added files not yet saved (if redisplaying after an + // error) + if ($new) { + $F = AttachmentFile::objects() + ->filter(array('id__in' => array_keys($new))) + ->all(); + foreach ($F as $f) { + $f->tmp_name = $new[$f->getId()]; + $files[] = array( + 'id' => $f->getId(), + 'name' => $f->getName(), + 'type' => $f->getType(), + 'size' => $f->getSize(), + 'download_url' => $f->getDownloadUrl(), + ); + } + } + ?><div id="<?php echo $id; ?>" class="filedrop"><div class="files"></div> <div class="dropzone"><i class="icon-upload"></i> diff --git a/include/staff/tasks.inc.php b/include/staff/tasks.inc.php index 712a795af5d7ea2da6093b89c5c79f17ecb9eddf..a83f1caced87997e9f5547185a2517afb73052e1 100644 --- a/include/staff/tasks.inc.php +++ b/include/staff/tasks.inc.php @@ -130,6 +130,11 @@ if ($filters) $visibility = Q::any( new Q(array('flags__hasbit' => TaskModel::ISOPEN, 'staff_id' => $thisstaff->getId())) ); +// -- Task for tickets assigned to me +$visibility->add(new Q( array( + 'ticket__staff_id' => $thisstaff->getId(), + 'ticket__status__state' => 'open')) + ); // -- Routed to a department of mine if (!$thisstaff->showAssignedOnly() && ($depts=$thisstaff->getDepts())) $visibility->add(new Q(array('dept_id__in' => $depts))); diff --git a/include/staff/templates/status-options.tmpl.php b/include/staff/templates/status-options.tmpl.php index 3b493f37927b9cbf608f0a698fa06a8ca5c6e469..9dadccafa9e078eb0709558872b2c31e4062fff6 100644 --- a/include/staff/templates/status-options.tmpl.php +++ b/include/staff/templates/status-options.tmpl.php @@ -37,6 +37,7 @@ if (!$nextStatuses) data-dropdown="#action-dropdown-statuses" data-placement="bottom" data-toggle="tooltip" title="<?php echo __('Change Status'); ?>"> <i class="icon-caret-down pull-right"></i> <a class="tickets-action" + aria-label="<?php echo __('Change Status'); ?>" href="#statuses"><i class="icon-flag"></i></a> </span> diff --git a/include/staff/templates/tickets-actions.tmpl.php b/include/staff/templates/tickets-actions.tmpl.php index 0535a5af2832a7da0354b6fa53dc88373ff6f6ca..55a695cd3accb2144bc5880ca468bf25da4d6dc2 100644 --- a/include/staff/templates/tickets-actions.tmpl.php +++ b/include/staff/templates/tickets-actions.tmpl.php @@ -14,6 +14,7 @@ if ($agent->hasPerm(Ticket::PERM_ASSIGN, false)) {?> echo __('Assign'); ?>"> <i class="icon-caret-down pull-right"></i> <a class="tickets-action" id="tickets-assign" + aria-label="<?php echo __('Assign'); ?>" href="#tickets/mass/assign"><i class="icon-user"></i></a> </span> <div id="action-dropdown-assign" class="action-dropdown anchor-right"> diff --git a/include/staff/ticket-view.inc.php b/include/staff/ticket-view.inc.php index 21d6cf62b6b0c5970d72188c10c133185d2e9126..cdf4afd20fb36ccf32b2cb7f88de85362a6bd2c4 100644 --- a/include/staff/ticket-view.inc.php +++ b/include/staff/ticket-view.inc.php @@ -74,7 +74,7 @@ if($ticket->isOverdue()) } ?> <span class="action-button pull-right" data-placement="bottom" data-dropdown="#action-dropdown-print" data-toggle="tooltip" title="<?php echo __('Print'); ?>"> <i class="icon-caret-down pull-right"></i> - <a id="ticket-print" href="tickets.php?id=<?php echo $ticket->getId(); ?>&a=print"><i class="icon-print"></i></a> + <a id="ticket-print" aria-label="<?php echo __('Print'); ?>" href="tickets.php?id=<?php echo $ticket->getId(); ?>&a=print"><i class="icon-print"></i></a> </span> <div id="action-dropdown-print" class="action-dropdown anchor-right"> <ul> diff --git a/js/osticket.js b/js/osticket.js index bd2f937e61af3b5f7cabd3b53e1d635cbb324486..c88c925b8d8453fe1f102e2b7e0d28e6bd6eb472 100644 --- a/js/osticket.js +++ b/js/osticket.js @@ -45,6 +45,9 @@ $(document).ready(function(){ $('form').submit(function() { $(window).unbind('beforeunload'); + // Disable client-side Post Reply/Create Ticket buttons to help + // prevent duplicate POST + $(':submit', $(this)).attr('disabled', true); $('#overlay, #loading').show(); return true; }); diff --git a/scp/forms.php b/scp/forms.php index da5663a817df06f5068a69e083ddaca6e172a653..46bd619315ad9e55dfc91b4a39f4bbcb6d8fd826 100644 --- a/scp/forms.php +++ b/scp/forms.php @@ -8,6 +8,7 @@ if($_REQUEST['id'] && !($form=DynamicForm::lookup($_REQUEST['id']))) if($_POST) { $_POST = Format::htmlchars($_POST, true); + $_POST['instructions'] = Format::htmldecode($_POST['instructions']); $fields = array('title', 'notes', 'instructions'); $required = array('title'); $max_sort = 0; diff --git a/scp/js/scp.js b/scp/js/scp.js index 27d8e6167f94b1fc666aa0bdc1e4d466a5be6cd4..c6e6f3c877756bc9e568a931e7ba353af114d8e9 100644 --- a/scp/js/scp.js +++ b/scp/js/scp.js @@ -163,6 +163,9 @@ var scp_prep = function() { $('form.save, form:has(table.list)').submit(function() { $(window).unbind('beforeunload'); + // Disable staff-side Post Reply/Open buttons to help prevent + // duplicate POST + $(':submit', $(this)).attr('disabled', true); $('#overlay, #loading').show(); return true; });