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(',')
|
||||
update_kindeditor_assets_owner ids,@message.id,OwnerTypeHelper::MESSAGE
|
||||
end
|
||||
# 与我相关动态的记录add start
|
||||
if(@board && @board.course) #项目的先不管
|
||||
teachers = searchTeacherAndAssistant(@board.course)
|
||||
for teacher in teachers
|
||||
if(teacher.user_id != User.current.id)
|
||||
notify = ActivityNotify.new()
|
||||
if(@board.course)
|
||||
notify.activity_container_id = @board.course_id
|
||||
notify.activity_container_type = 'Course'
|
||||
else
|
||||
notify.activity_container_id = @board.project_id
|
||||
notify.activity_container_type = 'Project'
|
||||
end
|
||||
notify.activity_id = @message.id
|
||||
notify.activity_type = 'Message'
|
||||
notify.notify_to = teacher.user_id
|
||||
notify.is_read = 0
|
||||
notify.save()
|
||||
end
|
||||
end
|
||||
end
|
||||
# # 与我相关动态的记录add start
|
||||
# if(@board && @board.course) #项目的先不管
|
||||
# teachers = searchTeacherAndAssistant(@board.course)
|
||||
# for teacher in teachers
|
||||
# if(teacher.user_id != User.current.id)
|
||||
# notify = ActivityNotify.new()
|
||||
# if(@board.course)
|
||||
# notify.activity_container_id = @board.course_id
|
||||
# notify.activity_container_type = 'Course'
|
||||
# else
|
||||
# notify.activity_container_id = @board.project_id
|
||||
# notify.activity_container_type = 'Project'
|
||||
# end
|
||||
# notify.activity_id = @message.id
|
||||
# notify.activity_type = 'Message'
|
||||
# notify.notify_to = teacher.user_id
|
||||
# notify.is_read = 0
|
||||
# notify.save()
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
# 与我相关动态的记录add end
|
||||
|
||||
call_hook(:controller_messages_new_after_save, { :params => params, :message => @message})
|
||||
|
|
|
@ -433,7 +433,7 @@ module UserScoreHelper
|
|||
|
||||
#协同得分
|
||||
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
|
||||
#影响力得分
|
||||
def influence(option_number)
|
||||
|
@ -445,7 +445,7 @@ module UserScoreHelper
|
|||
end
|
||||
#项目贡献得分
|
||||
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
|
||||
|
||||
#更新发帖数
|
||||
|
|
|
@ -121,7 +121,7 @@ class News < ActiveRecord::Base
|
|||
# Description 公用表中也要记录
|
||||
def act_as_forge_activity
|
||||
# 如果是project为空,那么是课程相关的,不需要保存
|
||||
if !self.project.nil?
|
||||
if self.project
|
||||
self.forge_acts << ForgeActivity.new(:user_id => self.author_id,
|
||||
:project_id => self.project.id)
|
||||
end
|
||||
|
|
|
@ -492,8 +492,8 @@ class Query < ActiveRecord::Base
|
|||
|
||||
def project_statement
|
||||
project_clauses = []
|
||||
unless project.descendants.blank?
|
||||
if project && !project.descendants.active.empty?
|
||||
# unless project.descendants.blank?
|
||||
if project && project.descendants && project.descendants.active && !project.descendants.active.empty?
|
||||
ids = [project.id]
|
||||
if has_filter?("subproject_id")
|
||||
case operator_for("subproject_id")
|
||||
|
@ -513,7 +513,7 @@ class Query < ActiveRecord::Base
|
|||
elsif project
|
||||
project_clauses << "#{Project.table_name}.id = %d" % project.id
|
||||
end
|
||||
end
|
||||
# end
|
||||
project_clauses.any? ? project_clauses.join(' AND ') : nil
|
||||
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.
|
||||
|
||||
ActiveRecord::Schema.define(:version => 20150901004910) do
|
||||
ActiveRecord::Schema.define(:version => 20150906025009) do
|
||||
|
||||
create_table "activities", :force => true do |t|
|
||||
t.integer "act_id", :null => false
|
||||
|
|
|
@ -210,7 +210,7 @@ span[id^=valid_user] {
|
|||
p.jRatingInfos {
|
||||
position: absolute;
|
||||
z-index: 9999;
|
||||
background: transparent url('bg_jRatingInfos.png') no-repeat;
|
||||
/*background: transparent url('bg_jRatingInfos.png') no-repeat;*/
|
||||
color: #CACACA;
|
||||
display: none;
|
||||
width: 91px;
|
||||
|
|
Loading…
Reference in New Issue