Redmine 4.1.1
This commit is contained in:
parent
33e7b881a5
commit
3d976f1b3b
1593 changed files with 36180 additions and 19489 deletions
|
@ -1,5 +1,7 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Redmine - project management software
|
||||
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||||
# Copyright (C) 2006-2019 Jean-Philippe Lang
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
|
@ -104,6 +106,10 @@ class QueriesController < ApplicationController
|
|||
render_404
|
||||
end
|
||||
|
||||
def current_menu_item
|
||||
@query ? @query.queried_class.to_s.underscore.pluralize.to_sym : nil
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def find_query
|
||||
|
@ -114,18 +120,11 @@ class QueriesController < ApplicationController
|
|||
render_404
|
||||
end
|
||||
|
||||
def find_optional_project
|
||||
@project = Project.find(params[:project_id]) if params[:project_id]
|
||||
render_403 unless User.current.allowed_to?(:save_queries, @project, :global => true)
|
||||
rescue ActiveRecord::RecordNotFound
|
||||
render_404
|
||||
end
|
||||
|
||||
def update_query_from_params
|
||||
@query.project = params[:query_is_for_all] ? nil : @project
|
||||
@query.build_from_params(params)
|
||||
@query.column_names = nil if params[:default_columns]
|
||||
@query.sort_criteria = params[:query] && params[:query][:sort_criteria]
|
||||
@query.sort_criteria = (params[:query] && params[:query][:sort_criteria]) || @query.sort_criteria
|
||||
@query.name = params[:query] && params[:query][:name]
|
||||
if User.current.allowed_to?(:manage_public_queries, @query.project) || User.current.admin?
|
||||
@query.visibility = (params[:query] && params[:query][:visibility]) || Query::VISIBILITY_PRIVATE
|
||||
|
@ -157,6 +156,10 @@ class QueriesController < ApplicationController
|
|||
redirect_to _time_entries_path(@project, nil, options)
|
||||
end
|
||||
|
||||
def redirect_to_project_query(options)
|
||||
redirect_to projects_path(options)
|
||||
end
|
||||
|
||||
# Returns the Query subclass, IssueQuery by default
|
||||
# for compatibility with previous behaviour
|
||||
def query_class
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue