1、历史数据导致项目动态中部分数据连接到课程相关页面
2、项目缺陷列表显示为整个系统的缺陷 3、用户得分的还原 4、样式调整
This commit is contained in:
parent
cc9c84b333
commit
fe91ec1a85
|
@ -101,27 +101,27 @@ class MessagesController < ApplicationController
|
||||||
ids = params[:asset_id].split(',')
|
ids = params[:asset_id].split(',')
|
||||||
update_kindeditor_assets_owner ids,@message.id,OwnerTypeHelper::MESSAGE
|
update_kindeditor_assets_owner ids,@message.id,OwnerTypeHelper::MESSAGE
|
||||||
end
|
end
|
||||||
# 与我相关动态的记录add start
|
# # 与我相关动态的记录add start
|
||||||
if(@board && @board.course) #项目的先不管
|
# if(@board && @board.course) #项目的先不管
|
||||||
teachers = searchTeacherAndAssistant(@board.course)
|
# teachers = searchTeacherAndAssistant(@board.course)
|
||||||
for teacher in teachers
|
# for teacher in teachers
|
||||||
if(teacher.user_id != User.current.id)
|
# if(teacher.user_id != User.current.id)
|
||||||
notify = ActivityNotify.new()
|
# notify = ActivityNotify.new()
|
||||||
if(@board.course)
|
# if(@board.course)
|
||||||
notify.activity_container_id = @board.course_id
|
# notify.activity_container_id = @board.course_id
|
||||||
notify.activity_container_type = 'Course'
|
# notify.activity_container_type = 'Course'
|
||||||
else
|
# else
|
||||||
notify.activity_container_id = @board.project_id
|
# notify.activity_container_id = @board.project_id
|
||||||
notify.activity_container_type = 'Project'
|
# notify.activity_container_type = 'Project'
|
||||||
end
|
# end
|
||||||
notify.activity_id = @message.id
|
# notify.activity_id = @message.id
|
||||||
notify.activity_type = 'Message'
|
# notify.activity_type = 'Message'
|
||||||
notify.notify_to = teacher.user_id
|
# notify.notify_to = teacher.user_id
|
||||||
notify.is_read = 0
|
# notify.is_read = 0
|
||||||
notify.save()
|
# notify.save()
|
||||||
end
|
# end
|
||||||
end
|
# end
|
||||||
end
|
# end
|
||||||
# 与我相关动态的记录add end
|
# 与我相关动态的记录add end
|
||||||
|
|
||||||
call_hook(:controller_messages_new_after_save, { :params => params, :message => @message})
|
call_hook(:controller_messages_new_after_save, { :params => params, :message => @message})
|
||||||
|
|
|
@ -433,7 +433,7 @@ module UserScoreHelper
|
||||||
|
|
||||||
#协同得分
|
#协同得分
|
||||||
def collaboration(option_number)
|
def collaboration(option_number)
|
||||||
option_number.messages_for_issues + option_number.issues_status + option_number.replay_for_message + option_number.replay_for_memo
|
option_number.memo * 2 + option_number.messages_for_issues + option_number.issues_status + option_number.replay_for_message + option_number.replay_for_memo
|
||||||
end
|
end
|
||||||
#影响力得分
|
#影响力得分
|
||||||
def influence(option_number)
|
def influence(option_number)
|
||||||
|
@ -445,7 +445,7 @@ module UserScoreHelper
|
||||||
end
|
end
|
||||||
#项目贡献得分
|
#项目贡献得分
|
||||||
def active(option_number)
|
def active(option_number)
|
||||||
option_number.changeset * 4 + option_number.document * 4 + option_number.attachment * 4 + option_number.issue_done_ratio * 2 + option_number.post_issue * 4 + option_number.memo * 2
|
option_number.changeset * 4 + option_number.document * 4 + option_number.attachment * 4 + option_number.issue_done_ratio * 2 + option_number.post_issue * 4
|
||||||
end
|
end
|
||||||
|
|
||||||
#更新发帖数
|
#更新发帖数
|
||||||
|
|
|
@ -121,7 +121,7 @@ class News < ActiveRecord::Base
|
||||||
# Description 公用表中也要记录
|
# Description 公用表中也要记录
|
||||||
def act_as_forge_activity
|
def act_as_forge_activity
|
||||||
# 如果是project为空,那么是课程相关的,不需要保存
|
# 如果是project为空,那么是课程相关的,不需要保存
|
||||||
if !self.project.nil?
|
if self.project
|
||||||
self.forge_acts << ForgeActivity.new(:user_id => self.author_id,
|
self.forge_acts << ForgeActivity.new(:user_id => self.author_id,
|
||||||
:project_id => self.project.id)
|
:project_id => self.project.id)
|
||||||
end
|
end
|
||||||
|
|
|
@ -492,8 +492,8 @@ class Query < ActiveRecord::Base
|
||||||
|
|
||||||
def project_statement
|
def project_statement
|
||||||
project_clauses = []
|
project_clauses = []
|
||||||
unless project.descendants.blank?
|
# unless project.descendants.blank?
|
||||||
if project && !project.descendants.active.empty?
|
if project && project.descendants && project.descendants.active && !project.descendants.active.empty?
|
||||||
ids = [project.id]
|
ids = [project.id]
|
||||||
if has_filter?("subproject_id")
|
if has_filter?("subproject_id")
|
||||||
case operator_for("subproject_id")
|
case operator_for("subproject_id")
|
||||||
|
@ -513,7 +513,7 @@ class Query < ActiveRecord::Base
|
||||||
elsif project
|
elsif project
|
||||||
project_clauses << "#{Project.table_name}.id = %d" % project.id
|
project_clauses << "#{Project.table_name}.id = %d" % project.id
|
||||||
end
|
end
|
||||||
end
|
# end
|
||||||
project_clauses.any? ? project_clauses.join(' AND ') : nil
|
project_clauses.any? ? project_clauses.join(' AND ') : nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
class ForgeActivituesDate < ActiveRecord::Migration
|
||||||
|
def up
|
||||||
|
forge_count = ForgeActivity.all.count / 30 + 2
|
||||||
|
transaction do
|
||||||
|
for i in 1 ... forge_count do i
|
||||||
|
ForgeActivity.page(i).per(30).each do |activity|
|
||||||
|
unless activity.forge_act_type == "ProjectCreateInfo"
|
||||||
|
if activity.forge_act
|
||||||
|
unless activity.forge_act.project
|
||||||
|
# puts activity.id
|
||||||
|
activity.destroy
|
||||||
|
end
|
||||||
|
else
|
||||||
|
# puts activity.id.to_s + "----"
|
||||||
|
activity.destroy
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def down
|
||||||
|
end
|
||||||
|
end
|
|
@ -11,7 +11,7 @@
|
||||||
#
|
#
|
||||||
# It's strongly recommended to check this file into your version control system.
|
# It's strongly recommended to check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema.define(:version => 20150901004910) do
|
ActiveRecord::Schema.define(:version => 20150906025009) do
|
||||||
|
|
||||||
create_table "activities", :force => true do |t|
|
create_table "activities", :force => true do |t|
|
||||||
t.integer "act_id", :null => false
|
t.integer "act_id", :null => false
|
||||||
|
|
|
@ -210,7 +210,7 @@ span[id^=valid_user] {
|
||||||
p.jRatingInfos {
|
p.jRatingInfos {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: 9999;
|
z-index: 9999;
|
||||||
background: transparent url('bg_jRatingInfos.png') no-repeat;
|
/*background: transparent url('bg_jRatingInfos.png') no-repeat;*/
|
||||||
color: #CACACA;
|
color: #CACACA;
|
||||||
display: none;
|
display: none;
|
||||||
width: 91px;
|
width: 91px;
|
||||||
|
|
Loading…
Reference in New Issue