项目-配置-模块中去掉实训任务

This commit is contained in:
daiao 2017-08-07 15:07:06 +08:00
parent 73706d18a2
commit c355bf6201
4 changed files with 9 additions and 3 deletions

View File

@ -46,7 +46,7 @@
</li>
<% end %>
<!--实训任务-->
<% if !@project.enabled_modules.where("name = 'training_tasks'").empty? %>
<% if !@project.enabled_modules.where("name = 'training_tasks'").empty? && hidden_unproject_infos %>
<% if User.current.admin? || is_project_manager?(User.current.id, @project.id) || is_project_manager?(User.current, @project.try(:forked_from_project_id)) %>
<li id="project_menu_011">
<%= link_to training_tasks_count > 0 ? "#{l(:project_module_training_tasks)}<span class='issues_nav_tag ml5'>#{switch_integer_into_k training_tasks_count}</span>".html_safe : "#{l(:project_module_training_tasks)}", project_training_tasks_url(@project), :class => "pro_new_proname", :title => "#{training_tasks_count}" %>

View File

@ -19,7 +19,7 @@
<% if User.current.allowed_to?(:manage_repository, @project) %>
<li><a href="javascript:void(0)" id="pro_st_tb_6" class="<%= show_memu == 'manage_repository' ? 'active' : ''%>" onclick="project_setting(6);">版本库</a></li>
<% end %>
<% if !@project.enabled_modules.where("name = 'training_tasks'").empty? %>
<% if !@project.enabled_modules.where("name = 'training_tasks'").empty? && hidden_unproject_infos %>
<li><a href="javascript:void(0)" id="pro_st_tb_7" class="<%= show_memu == 'trainig_task' ? 'active' : ''%>" onclick="project_setting(7);">实训任务</a></li>
<% end %>
<!--<li id="pro_st_tb_7" class="pro_st_normaltab" onclick="project_setting(7);">活动(时间跟踪)</li>-->

View File

@ -1,4 +1,6 @@
<% if hidden_unproject_infos %>
<div class="pro_new_prompt ml15 mr15 mb10"><p>问题跟踪模块与实训模块不能同时选择</p><p>一旦选定并保存后,将不能修改</p></div>
<% end %>
<ul class="pro_newsetting_con ml30 mb15">
<h2 class="pro_newsetting_title">请选择此项目可以使用的模块:</h2>
<%= form_for @project,:url => { :action => 'modules', :id => @project },:html => {:id => 'modules-form',:method => :post} do |f| %>

View File

@ -193,10 +193,12 @@ Redmine::AccessControl.map do |map|
map.permission :delete_issue_watchers, {:watchers => :destroy}
end
=begin
map.project_module :training_tasks do |map|
map.permission :manage_training_tasks, {:training_tasks => [:new, :create]}, :require => :loggedin
map.permission :view_training_tasks, {:training_tasks => :index, :versions => :download}, :read => true
end
=end
# map.project_module :time_tracking do |map|
# map.permission :log_time, {:timelog => [:new, :create]}, :require => :loggedin
@ -418,7 +420,9 @@ Redmine::MenuManager.map :project_menu do |menu|
#menu.push :roadmap, { :controller => 'versions', :action => 'index' }, :param => :project_id
# :if => Proc.new { |p| p.shared_versions.any? }
menu.push :issues, { :controller => 'issues', :action => 'index' },:if => Proc.new {|p| p.enabled_module_names.include?('issue_tracking') } ,:param => :project_id, :caption => :label_issue_plural
=begin
menu.push :training_tasks, { :controller => 'training_tasks', :action => 'index' },:if => Proc.new {|p| p.enabled_module_names.include?('training_tasks') } ,:param => :project_id, :caption => :label_training_task
=end
# menu.push :new_issue, { :controller => 'issues', :action => 'new', :copy_from => nil }, :param => :project_id, :caption => :label_issue_new,
# :html => { :accesskey => Redmine::AccessKeys.key_for(:new_issue) }
# menu.push :gantt, { :controller => 'gantts', :action => 'show' }, :param => :project_id, :caption => :label_gantt