diff --git a/include/class.staff.php b/include/class.staff.php index 2a7bca5f666b9001a376678cfe05e2924653b3f7..a3b2145934123c2f18847fcd3984bf132be314af 100644 --- a/include/class.staff.php +++ b/include/class.staff.php @@ -615,7 +615,9 @@ implements AuthenticatedUser, EmailContact, TemplateVariable { $this->signature = Format::sanitize($vars['signature']); $this->timezone = $vars['timezone']; $this->locale = $vars['locale']; - $this->show_assigned_tickets = isset($vars['hide_assigned_tickets'])?0:1; + if (!$cfg->showAssignedTickets()) + // Allow local unsetting if unset globally + $this->show_assigned_tickets = isset($vars['show_assigned_tickets']) ? 1 : 0; $this->max_page_size = $vars['max_page_size']; $this->auto_refresh_rate = $vars['auto_refresh_rate']; $this->default_signature_type = $vars['default_signature_type']; diff --git a/include/class.ticket.php b/include/class.ticket.php index 80eafde8eae6cbfb94764a89784a70e360b53b78..fa4024056d6eb33dc160063773ff4843e6ff8ae2 100644 --- a/include/class.ticket.php +++ b/include/class.ticket.php @@ -2762,7 +2762,7 @@ implements RestrictedAccess, Threadable { if(!$staff->showAssignedOnly() && ($depts=$staff->getDepts())) //Staff with limited access just see Assigned tickets. $where[] = 'ticket.dept_id IN('.implode(',', db_input($depts)).') '; - if(!$cfg || !($cfg->showAssignedTickets() || $staff->showAssignedTickets())) + if (($cfg && !$cfg->showAssignedTickets()) && !$staff->showAssignedTickets()) $where2 =' AND (ticket.staff_id=0 OR ticket.team_id=0)'; $where = implode(' OR ', $where); if ($where) $where = 'AND ( '.$where.' ) '; diff --git a/include/i18n/en_US/help/tips/dashboard.my_profile.yaml b/include/i18n/en_US/help/tips/dashboard.my_profile.yaml index 821fc0bbee69fe5e56bcc5a1d886042a44e35162..b8c40b07c5699ed1b068cf08176b336879f4a6fe 100644 --- a/include/i18n/en_US/help/tips/dashboard.my_profile.yaml +++ b/include/i18n/en_US/help/tips/dashboard.my_profile.yaml @@ -54,10 +54,15 @@ default_paper_size: show_assigned_tickets: title: Show Assigned Tickets content: > - Enable this to hide your name from the <span class="doc-desc-title">Open - Tickets</span> queue for those tickets which you have been assigned. Upon - hiding, the <span class="doc-desc-title">Department</span> name to which - you belong will replace where your name would normally be displayed. + <p> + Enabling this option will override the global setting to hide + assigned tickets from the open queues. + </p> + <p class="info-banner"> + <i class="icon-info-sign"></i> + This setting is only available when assigned tickets are excluded + globally. + </p> password: title: Password diff --git a/include/staff/profile.inc.php b/include/staff/profile.inc.php index d55e0c0e9cf9f112e12d306c9a7cf59964e65d79..6fc6a2c75bfec9247f09599b1ee89f79681a2a60 100644 --- a/include/staff/profile.inc.php +++ b/include/staff/profile.inc.php @@ -133,9 +133,10 @@ if ($avatar->isChangeable()) { ?> <tr> <td colspan="2"> <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.'); ?> + <input type="checkbox" name="show_assigned_tickets" + <?php echo $cfg->showAssignedTickets() ? 'disabled="disabled" ' : ''; ?> + <?php echo $staff->show_assigned_tickets ? 'checked="checked"' : ''; ?> /> + <?php echo __('Show assigned tickets on open queue.'); ?> <i class="help-tip icon-question-sign" href="#show_assigned_tickets"></i> </label> <label class="checkbox"> diff --git a/include/staff/tickets.inc.php b/include/staff/tickets.inc.php index 936dd1901ac3d39471277e859ba283a924854e26..595a5205a784948dd0e60b012cdb40b6254e44c9 100644 --- a/include/staff/tickets.inc.php +++ b/include/staff/tickets.inc.php @@ -159,11 +159,11 @@ case 'open': // Open queues _except_ assigned should respect showAssignedTickets() // settings -if ($status == 'open' && $queue_name != 'assigned') { - $hideassigned = ($cfg && !$cfg->showAssignedTickets()) || !$thisstaff->showAssignedTickets(); +if ($status != 'closed' && $queue_name != 'assigned') { + $hideassigned = ($cfg && !$cfg->showAssignedTickets()) && !$thisstaff->showAssignedTickets(); $showassigned = !$hideassigned; - if ($hideassigned) - $tickets->filter(Q::any(array('staff_id'=>0, 'team_id'=>0))); + if ($status == 'open' && $hideassigned) + $tickets->filter(array('staff_id'=>0, 'team_id'=>0)); else $tickets->values('staff__firstname', 'staff__lastname', 'team__name'); }