From 2141fcc3cac5bccee8dccb7c2102f1026af06805 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Mon, 28 Jul 2014 17:49:28 +0800
Subject: [PATCH] =?UTF-8?q?=E5=B0=86=E6=98=AF=E5=90=A6=E5=90=AF=E7=94=A8DT?=
=?UTF-8?q?S=E6=B5=8B=E8=AF=95=E7=A7=BB=E5=85=A5=E9=A1=B9=E7=9B=AE?=
=?UTF-8?q?=E6=A8=A1=E5=9D=97=E9=85=8D=E7=BD=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/projects_controller.rb | 2 +-
app/views/projects/_form.html.erb | 4 +++-
app/views/projects/_tools_expand.html.erb | 2 +-
config/locales/zh.yml | 1 +
config/settings.yml | 1 +
db/schema.rb | 20 ++++++++++----------
lib/redmine.rb | 3 +++
lib/redmine/access_control.rb | 1 +
8 files changed, 21 insertions(+), 13 deletions(-)
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index eedb29329..15a26fbae 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -747,7 +747,7 @@ class ProjectsController < ApplicationController
def update
@project.safe_attributes = params[:project]
- @project.dts_test = params[:project][:dts_test]
+ #@project.dts_test = params[:project][:dts_test]
if validate_parent_id && @project.save
@course = Course.find_by_extra(@project.identifier)
unless @course.nil?
diff --git a/app/views/projects/_form.html.erb b/app/views/projects/_form.html.erb
index f5781b26a..47a87f441 100644
--- a/app/views/projects/_form.html.erb
+++ b/app/views/projects/_form.html.erb
@@ -15,9 +15,11 @@
<%= f.check_box :is_public, :style => "margin-left:10px;" %>
<%= f.check_box :hidden_repo, :style => "margin-left:10px;" %>
+
<%= f.text_field :project_type, :value => 0 %>
<%= wikitoolbar_for 'project_description' %>
diff --git a/app/views/projects/_tools_expand.html.erb b/app/views/projects/_tools_expand.html.erb
index 5ee70fa9d..df6cd481b 100644
--- a/app/views/projects/_tools_expand.html.erb
+++ b/app/views/projects/_tools_expand.html.erb
@@ -16,7 +16,7 @@
<%= link_to l(:project_module_gantt) ,project_gantt_path(@project) %>
其他工具
- <% if @project.dts_test == 1 %>
+ <% if @project.enabled_modules.where(" name = 'dts'").count > 0 %>
- <%= link_to l(:label_module_share) ,share_show_path(@project) %>
<% end %>
- <%= link_to l(:project_module_documents), project_documents_path(@project) %>
diff --git a/config/locales/zh.yml b/config/locales/zh.yml
index 1efa72680..6ff930e28 100644
--- a/config/locales/zh.yml
+++ b/config/locales/zh.yml
@@ -505,6 +505,7 @@ zh:
project_module_calendar: 日历
project_module_gantt: 甘特图
project_module_course: 课程
+ project_module_dts: DTS测试工具
label_module_share: DTS测试工具
label_user: 用户
diff --git a/config/settings.yml b/config/settings.yml
index cffbaa5fa..20801e03e 100644
--- a/config/settings.yml
+++ b/config/settings.yml
@@ -177,6 +177,7 @@ default_projects_modules:
- calendar
- gantt
- course
+ - dts
default_projects_tracker_ids:
serialized: true
default:
diff --git a/db/schema.rb b/db/schema.rb
index 05886b190..3cbfefa76 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -846,18 +846,18 @@ ActiveRecord::Schema.define(:version => 20140728014933) do
create_table "relative_memos", :force => true do |t|
t.integer "osp_id"
t.integer "parent_id"
- t.string "subject", :null => false
- t.text "content", :null => false
+ t.string "subject", :null => false
+ t.text "content", :limit => 16777215, :null => false
t.integer "author_id"
- t.integer "replies_count", :default => 0
+ t.integer "replies_count", :default => 0
t.integer "last_reply_id"
- t.boolean "lock", :default => false
- t.boolean "sticky", :default => false
- t.boolean "is_quote", :default => false
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.integer "viewed_count_crawl", :default => 0
- t.integer "viewed_count_local", :default => 0
+ t.boolean "lock", :default => false
+ t.boolean "sticky", :default => false
+ t.boolean "is_quote", :default => false
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ t.integer "viewed_count_crawl", :default => 0
+ t.integer "viewed_count_local", :default => 0
t.string "url"
t.string "username"
t.string "userhomeurl"
diff --git a/lib/redmine.rb b/lib/redmine.rb
index 6215a04ba..4fa909325 100644
--- a/lib/redmine.rb
+++ b/lib/redmine.rb
@@ -244,6 +244,9 @@ Redmine::AccessControl.map do |map|
map.permission :view_gantt, {:gantts => [:show, :update]}, :read => true
end
+ map.project_module :dts do |map|
+ map.permission :do_dts, {:dts => :show}, :read => true
+ end
# map.project_module :journals do |map|
# map.permission :view_journals_for_messages, {:gantts => [:show, :update]}, :read => true
# end
diff --git a/lib/redmine/access_control.rb b/lib/redmine/access_control.rb
index e0a8e16c0..e71c0090a 100644
--- a/lib/redmine/access_control.rb
+++ b/lib/redmine/access_control.rb
@@ -67,6 +67,7 @@ module Redmine
def available_project_modules
@available_project_modules ||= @permissions.collect(&:project_module).uniq.compact
end
+
def available_contest_modules
@available_contest_modules ||= @permissions.collect(&:contest_module).uniq.compact
end