Skip to content
Snippets Groups Projects
Commit 971a5e08 authored by Jared Hancock's avatar Jared Hancock
Browse files

Merge pull request #2311 from protich/issue/v1.10-bugfixes+


tasks: Ticket tasks access

Reviewed-By: default avatarJared Hancock <jared@osticket.com>
parents 07c1d79f 0b4c259b
No related branches found
No related tags found
No related merge requests found
<?php <?php
$error=$msg=$warn=null; $error=$msg=$warn=null;
if($task->isOverdue()) if (!$task->checkStaffPerm($thisstaff))
$warn.= __('You do not have access to this task');
elseif ($task->isOverdue())
$warn.='&nbsp;<span class="Icon overdueTicket">'.__('Marked overdue!').'</span>'; $warn.='&nbsp;<span class="Icon overdueTicket">'.__('Marked overdue!').'</span>';
echo sprintf( echo sprintf(
......
...@@ -73,6 +73,7 @@ if ($count) { ?> ...@@ -73,6 +73,7 @@ if ($count) { ?>
<?php <?php
foreach($tasks as $task) { foreach($tasks as $task) {
$id = $task->getId(); $id = $task->getId();
$access = $task->checkStaffPerm($thisstaff);
$assigned=''; $assigned='';
if ($task->staff) if ($task->staff)
$assigned=sprintf('<span class="Icon staffAssigned">%s</span>', $assigned=sprintf('<span class="Icon staffAssigned">%s</span>',
...@@ -84,8 +85,10 @@ if ($count) { ?> ...@@ -84,8 +85,10 @@ if ($count) { ?>
$threadcount = $task->getThread() ? $threadcount = $task->getThread() ?
$task->getThread()->getNumEntries() : 0; $task->getThread()->getNumEntries() : 0;
$viewhref = sprintf('#tickets/%d/tasks/%d/view', if ($access)
$ticket->getId(), $id); $viewhref = sprintf('#tickets/%d/tasks/%d/view', $ticket->getId(), $id);
else
$viewhref = '#';
?> ?>
<tr id="<?php echo $id; ?>"> <tr id="<?php echo $id; ?>">
...@@ -102,11 +105,17 @@ if ($count) { ?> ...@@ -102,11 +105,17 @@ if ($count) { ?>
<td align="center" nowrap><?php echo <td align="center" nowrap><?php echo
Format::datetime($task->created); ?></td> Format::datetime($task->created); ?></td>
<td><?php echo $status; ?></td> <td><?php echo $status; ?></td>
<td><a <?php if ($flag) { ?> class="no-pjax" <td>
title="<?php echo ucfirst($flag); ?> Task" <?php } ?> <?php
href="<?php echo $viewhref; ?>"><?php if ($access) { ?>
echo $title; ?></a> <a <?php if ($flag) { ?> class="no-pjax"
title="<?php echo ucfirst($flag); ?> Task" <?php } ?>
href="<?php echo $viewhref; ?>"><?php
echo $title; ?></a>
<?php <?php
} else {
echo $title;
}
if ($threadcount>1) if ($threadcount>1)
echo "<small>($threadcount)</small>&nbsp;".'<i echo "<small>($threadcount)</small>&nbsp;".'<i
class="icon-fixed-width icon-comments-alt"></i>&nbsp;'; class="icon-fixed-width icon-comments-alt"></i>&nbsp;';
...@@ -138,16 +147,20 @@ $(function() { ...@@ -138,16 +147,20 @@ $(function() {
$(document).on('click.taskv', 'tbody.tasks a, a#reload-task', function(e) { $(document).on('click.taskv', 'tbody.tasks a, a#reload-task', function(e) {
e.preventDefault(); e.preventDefault();
e.stopImmediatePropagation(); e.stopImmediatePropagation();
var url = 'ajax.php/'+$(this).attr('href').substr(1); if ($(this).attr('href').length > 1) {
var $container = $('div#task_content'); var url = 'ajax.php/'+$(this).attr('href').substr(1);
var $stop = $('ul#ticket_tabs').offset().top; var $container = $('div#task_content');
$.pjax({url: url, container: $container, push: false, scrollTo: $stop}) var $stop = $('ul#ticket_tabs').offset().top;
.done( $.pjax({url: url, container: $container, push: false, scrollTo: $stop})
function() { .done(
$container.show(); function() {
$('.tip_box').remove(); $container.show();
$('div#tasks_content').hide(); $('.tip_box').remove();
}); $('div#tasks_content').hide();
});
} else {
$(this).trigger('mouseenter');
}
return false; return false;
}); });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment