修改合并后首页出错的问题

This commit is contained in:
nwb 2014-06-26 10:01:44 +08:00
parent 88c3347f7c
commit f4aa817f42
6 changed files with 14 additions and 11 deletions

View File

@ -34,7 +34,7 @@ class Course < ActiveRecord::Base
:delete_permission => :manage_files
validates_presence_of :password, :term
validates_format_of :class_period, :message => "class period can only digital!", :with =>/^[1-9]\d*$/
validates_format_of :class_period, :message => l(:error_class_period_only_num), :with =>/^[1-9]\d*$/
after_save :create_board_sync
before_destroy :delete_all_members

View File

@ -66,7 +66,6 @@
<tr>
<!-- modified by zjc 课程名称添加超链接 -->
<td class="info-course"><%= link_to @course.name,course_path(@course) %></td>
<td class="info-course"><%= @course.name %></td>
</tr>
<tr>
<td align="center">

View File

@ -186,6 +186,7 @@ en:
notice_account_deleted: "Your account has been permanently deleted."
notice_user_successful_create: "User %{id} created."
error_class_period_only_num: "class period can only digital"
error_can_t_load_default_data: "Default configuration could not be loaded: %{value}"
error_scm_not_found: "The entry or revision was not found in the repository."
error_scm_command_failed: "An error occurred when trying to access the repository: %{value}"

View File

@ -196,6 +196,7 @@ zh:
error_complete_occupation: "请您填写工作单位,否则本系统的部分功能将无法正常使用。"
error_class_period_only_num: "课程学时只能为数字"
error_can_t_load_default_data: "无法载入默认设置:%{value}"
error_scm_not_found: "版本库中不存在该条目和(或)其修订版本。"
error_scm_command_failed: "访问版本库时发生错误:%{value}"

View File

@ -3,7 +3,7 @@ class MigrateCourseStudents < ActiveRecord::Migration
# 原课程的学生数据迁移成新模式
StudentsForCourse.all.each do |student|
project = Project.find_by_id(student.course_id)
if project
if project && project.course_extra
student.course_id = project.course_extra.id
student.save
end

View File

@ -105,6 +105,7 @@ module Redmine
if event_type.to_s != 'course_journals_for_messages'
cur_objs = provider.find_events1(event_type, @user, from, to, @options)
end
if cur_objs
cur_objs.each do |cur_obj|
if cur_obj.class == Issue
if cur_obj.project != nil && cur_obj.project.project_status != nil
@ -115,6 +116,7 @@ module Redmine
end
end
end
end
if e.count > options[:limit]
break
end