diff --git a/include/staff/templates/task-view.tmpl.php b/include/staff/templates/task-view.tmpl.php index 5b03857f0a83d02b6e3ba4739cfd0778ee7d73d5..3decb024ccb9ea744454baf4f584b4edef44b775 100644 --- a/include/staff/templates/task-view.tmpl.php +++ b/include/staff/templates/task-view.tmpl.php @@ -146,7 +146,7 @@ if ($task->isOverdue()) <ul> <?php - if ($task->isOpen()) { ?> + if (!$task->isOpen()) { ?> <li> <a class="no-pjax task-action" href="#tasks/<?php echo $task->getId(); ?>/reopen"><i diff --git a/include/staff/templates/tasks-actions.tmpl.php b/include/staff/templates/tasks-actions.tmpl.php index dc59eae4fc5827a7231c39dbdbb4a7fc2f9c0d2e..e323e30602aee51bd9bd7efe14a3879610a163a5 100644 --- a/include/staff/templates/tasks-actions.tmpl.php +++ b/include/staff/templates/tasks-actions.tmpl.php @@ -7,57 +7,23 @@ if ($agent->hasPerm(Task::PERM_CLOSE, false)) { if (isset($options['status'])) { $status = $options['status']; - ?> - <span - class="action-button" - data-dropdown="#action-dropdown-tasks-status"> - <i class="icon-caret-down pull-right"></i> - <a class="tasks-status-action" - href="#statuses" - data-placement="bottom" - data-toggle="tooltip" - title="<?php echo __('Change Status'); ?>"><i - class="icon-flag"></i></a> - </span> - <div id="action-dropdown-tasks-status" - class="action-dropdown anchor-right"> - <ul> - <?php - if (!$status || !strcasecmp($status, 'closed')) { ?> - <li> - <a class="no-pjax tasks-action" - href="#tasks/mass/reopen"><i - class="icon-fixed-width icon-undo"></i> <?php - echo __('Reopen');?> </a> - </li> - <?php - } - if (!$status || !strcasecmp($status, 'open')) { - ?> - <li> - <a class="no-pjax tasks-action" - href="#tasks/mass/close"><i - class="icon-fixed-width icon-ok-circle"></i> <?php - echo __('Close');?> </a> - </li> - <?php - } ?> - </ul> - </div> -<?php - } else { - $actions += array( - 'reopen' => array( - 'icon' => 'icon-undo', - 'action' => __('Reopen') - )); + if (strpos($status, 'closed') !== false) { + $actions += array( + 'reopen' => array( + 'icon' => 'icon-undo', + 'action' => __('Reopen') + )); + } - $actions += array( - 'close' => array( - 'icon' => 'icon-ok-circle', - 'action' => __('Close') - )); + + if (strpos($status, 'open') !== false) { + $actions += array( + 'close' => array( + 'icon' => 'icon-ok-circle', + 'action' => __('Close') + )); + } } } @@ -95,7 +61,7 @@ if ($agent->hasPerm(Task::PERM_DELETE, false)) { 'action' => __('Delete') )); } -if ($actions && !isset($options['status'])) { +if ($actions && isset($options['status'])) { $more = $options['morelabel'] ?: __('More'); ?> <span diff --git a/include/staff/ticket-tasks.inc.php b/include/staff/ticket-tasks.inc.php index 01bc6e2847c9d6884a3aceb1e90f7537ecd60054..373844b462126364ed6de963f8ebc35e676f0b5b 100644 --- a/include/staff/ticket-tasks.inc.php +++ b/include/staff/ticket-tasks.inc.php @@ -40,12 +40,17 @@ $showing = $pageNav->showing().' '._N('task', 'tasks', $count); print __('Add New Task'); ?></a> <?php } + foreach ($tasks as $task) + $taskStatus .= $task->isOpen() ? 'open' : 'closed'; + if ($count) Task::getAgentActions($thisstaff, array( 'container' => '#tasks_content', 'callback_url' => sprintf('ajax.php/tickets/%d/tasks', $ticket->getId()), - 'morelabel' => __('Options'))); + 'morelabel' => __('Options'), + 'status' => $taskStatus ? $taskStatus : '') + ); ?> </div> <div class="clear"></div>