Skip to content

Commit

Permalink
Merge pull request #3190 from skateman/fix-report-menu
Browse files Browse the repository at this point in the history
Add both custom reports and custom report menu items to report menu
  • Loading branch information
h-kataria committed Jan 8, 2018
2 parents f5e4dfc + d18c53b commit e80fbe3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions app/controllers/application_controller.rb
Expand Up @@ -944,6 +944,8 @@ def get_reports_menu(group = current_group, tree_type = "reports", mode = "menu"
folders.push([title[1], reports]) unless folders.include?([title[1], reports])
end
end

rptmenu = rptmenu.concat(group.settings[:report_menus]) if group.settings && group.settings[:report_menus] && mode == "default"
else
# Building custom reports array for super_admin/admin roles, it doesnt show up on menu if their menu was set which didnt contain custom folder in it
temp = []
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/report_controller.rb
Expand Up @@ -132,7 +132,7 @@ def explorer
return
end

populate_reports_menu("reports", "menu")
populate_reports_menu("reports", "default")
build_accordions_and_trees

self.x_active_tree = x_last_active_tree if x_last_active_tree
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/report_controller/reports.rb
Expand Up @@ -237,7 +237,7 @@ def create_report_object

# Build the main reports tree
def build_reports_tree
populate_reports_menu("reports", "menu")
populate_reports_menu("reports", "default")
TreeBuilderReportReports.new('reports_tree', 'reports', @sb)
end
end

0 comments on commit e80fbe3

Please sign in to comment.