diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb index 150071b4..c35edfa1 100644 --- a/app/controllers/messages_controller.rb +++ b/app/controllers/messages_controller.rb @@ -49,7 +49,7 @@ class MessagesController < ApplicationController all @reply = Message.new(:subject => "RE: #{@message.subject}") - if @message.board.project.project_type ==1 + if @course render :action => "show", :layout => "base_courses"#by young else render :action => "show", :layout => "base_projects"#by young @@ -138,8 +138,14 @@ private end def find_board - @board = Board.find(params[:board_id], :include => :project) - @project = @board.project + #modify by nwb + @board = Board.find(params[:board_id]) + if @board.project_id != -1 && @board.project_id != nil + @project = @board.project + elsif @board.course_id + @course = @board.course + end + rescue ActiveRecord::RecordNotFound render_404 nil diff --git a/app/views/messages/show.html.erb b/app/views/messages/show.html.erb index 4f22fd14..de8bf900 100644 --- a/app/views/messages/show.html.erb +++ b/app/views/messages/show.html.erb @@ -92,7 +92,11 @@
- <%= label_tag l(:field_subject) %>: <%= link_to @topic.subject, project_boards_path(@topic.project) %> + <% if @project %> + <%= label_tag l(:field_subject) %>: <%= link_to @topic.subject, project_boards_path(@topic.project) %> + <% elsif @course %> + <%= label_tag l(:field_subject) %>: <%= link_to @topic.subject, course_boards_path(@topic.course) %> + <% end %>
<%= textilizable(@topic, :content) %> diff --git a/lib/redmine.rb b/lib/redmine.rb index b65a1b68..4550dd49 100644 --- a/lib/redmine.rb +++ b/lib/redmine.rb @@ -118,10 +118,20 @@ Redmine::AccessControl.map do |map| map.permission :comment_news, {:comments => :create} end #作业模块权限 - map.project_module :bids do |map| + map.course_module :bids do |map| map.permission :view_homework_attaches, {:bids => [:show, :show_project, :revision]}, :read => true end + map.course_module :boards do |map| + map.permission :manage_boards, {:boards => [:new, :create, :edit, :update, :destroy]}, :require => :member + map.permission :view_messages, {:boards => [:index, :show], :messages => [:show]}, :public => true, :read => true + map.permission :add_messages, {:messages => [:new, :reply, :quote]} + map.permission :edit_messages, {:messages => :edit}, :require => :member + map.permission :edit_own_messages, {:messages => :edit}, :require => :loggedin + map.permission :delete_messages, {:messages => :destroy}, :require => :member + map.permission :delete_own_messages, {:messages => :destroy}, :require => :loggedin + end + #end map.project_module :issue_tracking do |map|