Skip to content
Snippets Groups Projects
Commit d8608552 authored by Peter Rotich's avatar Peter Rotich
Browse files

Bug: Fix navigation

Fix cases where first item added via addSubMenu got deleted.
parent 181ac855
No related branches found
No related tags found
No related merge requests found
...@@ -102,6 +102,8 @@ class StaffNav { ...@@ -102,6 +102,8 @@ class StaffNav {
function addSubMenu($item,$active=false){ function addSubMenu($item,$active=false){
// Triger lazy loading if submenus haven't been initialized
isset($this->submenus[$this->getPanel().'.'.$this->activetab]);
$this->submenus[$this->getPanel().'.'.$this->activetab][]=$item; $this->submenus[$this->getPanel().'.'.$this->activetab][]=$item;
if($active) if($active)
$this->activeMenu=sizeof($this->submenus[$this->getPanel().'.'.$this->activetab]); $this->activeMenu=sizeof($this->submenus[$this->getPanel().'.'.$this->activetab]);
......
...@@ -344,7 +344,8 @@ if($cfg->showAnsweredTickets()) { ...@@ -344,7 +344,8 @@ if($cfg->showAnsweredTickets()) {
(!$_REQUEST['status'] || $_REQUEST['status']=='open')); (!$_REQUEST['status'] || $_REQUEST['status']=='open'));
} else { } else {
if($stats) { if ($stats) {
$nav->addSubMenu(array('desc'=>$open_name.' ('.number_format($stats['open']).')', $nav->addSubMenu(array('desc'=>$open_name.' ('.number_format($stats['open']).')',
'title'=>__('Open Tickets'), 'title'=>__('Open Tickets'),
'href'=>'tickets.php', 'href'=>'tickets.php',
...@@ -389,13 +390,13 @@ if($thisstaff->showAssignedOnly() && $stats['closed']) { ...@@ -389,13 +390,13 @@ if($thisstaff->showAssignedOnly() && $stats['closed']) {
($_REQUEST['status']=='closed')); ($_REQUEST['status']=='closed'));
} else { } else {
$nav->addSubMenu(array('desc'=>sprintf(__('Resolved (%s)'), number_format($stats['resolved'])), $nav->addSubMenu(array('desc' => __('Resolved').' ('.number_format($stats['resolved']).')',
'title'=>__('Resolved Tickets'), 'title'=>__('Resolved Tickets'),
'href'=>'tickets.php?status=resolved', 'href'=>'tickets.php?status=resolved',
'iconclass'=>'closedTickets'), 'iconclass'=>'closedTickets'),
($_REQUEST['status']=='resolved')); ($_REQUEST['status']=='resolved'));
$nav->addSubMenu(array('desc'=>sprintf(__('Closed Tickets (%s)'), number_format($stats['closed'])), $nav->addSubMenu(array('desc' => __('Closed').' ('.number_format($stats['closed']).')',
'title'=>__('Closed Tickets'), 'title'=>__('Closed Tickets'),
'href'=>'tickets.php?status=closed', 'href'=>'tickets.php?status=closed',
'iconclass'=>'closedTickets'), 'iconclass'=>'closedTickets'),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment