Project

General

Profile

Feature #12704 » project-select.patch

Greg T, 2016-10-26 15:46

View differences:

redmine-3.2.1/app/controllers/issues_controller.rb 2016-06-09 17:53:20.482524185 +0200
include SortHelper
helper :timelog
def find_optional_project
@project = Project.find(params[:project_id]) unless params[:project_id].blank?
allowed = User.current.allowed_to?({:controller => params[:controller], :action => params[:action]}, @project, :global => true)
if ! allowed and ! @project.nil?
@project.children.each do |subproject|
if User.current.allowed_to?({:controller => params[:controller], :action => params[:action]}, subproject, :global => true)
@project = subproject
return true;
end
end
@project = nil
allowed = User.current.allowed_to?({:controller => params[:controller], :action => params[:action]}, @project, :global => true)
end
allowed ? true : deny_access
rescue ActiveRecord::RecordNotFound
render_404
end
def index
retrieve_query
sort_init(@query.sort_criteria.empty? ? [['id', 'desc']] : @query.sort_criteria)
redmine-3.2.1/app/views/issues/_form.html.erb 2016-06-08 16:36:32.921088980 +0200
</p>
<% end %>
<% if @issue.safe_attribute?('project_id') && (!@issue.new_record? || @project.nil? || @issue.copy?) %>
<% if @issue.safe_attribute?('project_id') #&& (!@issue.new_record? || @project.nil? || @issue.copy?)
%>
<p><%= f.select :project_id, project_tree_options_for_select(@issue.allowed_target_projects, :selected => @issue.project), {:required => true},
:onchange => "updateIssueFrom('#{escape_javascript update_issue_form_path(@project, @issue)}', this)" %></p>
<% end %>
(2-2/6)