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

tickets: Fix 'show_assigned_tickets' preference and setting

parent 62c7584e
No related branches found
No related tags found
No related merge requests found
......@@ -615,7 +615,7 @@ implements AuthenticatedUser, EmailContact, TemplateVariable {
$this->signature = Format::sanitize($vars['signature']);
$this->timezone = $vars['timezone'];
$this->locale = $vars['locale'];
$this->show_assigned_tickets = isset($vars['show_assigned_tickets'])?1:0;
$this->show_assigned_tickets = isset($vars['hide_assigned_tickets'])?0:1;
$this->max_page_size = $vars['max_page_size'];
$this->auto_refresh_rate = $vars['auto_refresh_rate'];
$this->default_signature_type = $vars['default_signature_type'];
......
......@@ -132,14 +132,13 @@ if ($avatar->isChangeable()) { ?>
</tr>
<tr>
<td colspan="2">
<label>
<input type="checkbox" name="show_assigned_tickets"
<?php echo ($staff->show_assigned_tickets) ? 'checked="checked"' : ''; ?> />
<?php echo __('Show assigned tickets on open queue.'); ?>
</label>
<label class="checkbox">
<input type="checkbox" name="hide_assigned_tickets"
<?php echo (!$staff->show_assigned_tickets) ? 'checked="checked"' : ''; ?> />
<?php echo __('Exclude assigned tickets on open queue.'); ?>
<i class="help-tip icon-question-sign" href="#show_assigned_tickets"></i>
<br/>
<label>
</label>
<label class="checkbox">
<input type="checkbox" name="onvacation"
<?php echo ($staff->onvacation) ? 'checked="checked"' : ''; ?> />
<?php echo __('Vacation Mode'); ?>
......
......@@ -40,7 +40,7 @@ case 'closed':
$status='closed';
$results_type=__('Closed Tickets');
$showassigned=true; //closed by.
$tickets->values('staff__firstname', 'staff__lastname', 'team__name', 'team_id');
$tickets->values('staff__firstname', 'staff__lastname', 'team__name');
$queue_sort_options = array('closed', 'priority,due', 'due',
'priority,updated', 'priority,created', 'answered', 'number', 'hot');
break;
......@@ -146,19 +146,25 @@ case 'search':
case 'open':
$status='open';
$results_type=__('Open Tickets');
$showassigned = ($cfg && $cfg->showAssignedTickets()) || $thisstaff->showAssignedTickets();
if (!$cfg->showAnsweredTickets())
$tickets->filter(array('isanswered'=>0));
if (!$showassigned)
$tickets->filter(Q::any(array('staff_id'=>0, 'team_id'=>0)));
else
$tickets->values('staff__firstname', 'staff__lastname', 'team__name');
$queue_sort_options = array('priority,updated', 'updated',
'priority,due', 'due', 'priority,created', 'answered', 'number',
'hot');
break;
}
// Open queues _except_ assigned should respect showAssignedTickets()
// settings
if ($status == 'open' && $queue_name != 'assigned') {
$hideassigned = ($cfg && !$cfg->showAssignedTickets()) || !$thisstaff->showAssignedTickets();
$showassigned = !$hideassigned;
if ($hideassigned)
$tickets->filter(Q::any(array('staff_id'=>0, 'team_id'=>0)));
else
$tickets->values('staff__firstname', 'staff__lastname', 'team__name');
}
// Apply primary ticket status
if ($status)
$tickets->filter(array('status__state'=>$status));
......
......@@ -1412,6 +1412,7 @@ i.help-tip {
vertical-align: inherit;
color: #aaa;
opacity: 0.8;
text-indent: initial;
}
i.help-tip:hover {
color: orange !important;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment