parent
a53e66d4b0
commit
5594295c9e
|
@ -402,6 +402,14 @@ module UsersHelper
|
|||
return str.html_safe
|
||||
end
|
||||
|
||||
def get_issue_des_update(journal)
|
||||
arr = details_to_strings(journal.details,true)
|
||||
arr << journal.notes
|
||||
str = ''
|
||||
arr.each { |item| str = str+item }
|
||||
return str
|
||||
end
|
||||
|
||||
def get_activity_act_showname(activity)
|
||||
case activity.act_type
|
||||
when "HomeworkCommon"
|
||||
|
|
|
@ -83,7 +83,7 @@ class Issue < ActiveRecord::Base
|
|||
|
||||
# fq
|
||||
after_create :act_as_activity,:be_user_score_new_issue,:act_as_forge_activity, :act_as_forge_message
|
||||
after_update :be_user_score
|
||||
after_update :be_user_score, :act_as_forge_message_update
|
||||
after_destroy :down_user_score
|
||||
# after_create :be_user_score
|
||||
# end
|
||||
|
@ -151,6 +151,15 @@ class Issue < ActiveRecord::Base
|
|||
end
|
||||
end
|
||||
|
||||
# 更新缺陷
|
||||
def act_as_forge_message_update
|
||||
unless self.author_id == self.assigned_to_id
|
||||
self.forge_messages << ForgeMessage.new(:user_id => self.assigned_to_id,
|
||||
:project_id => self.project_id,
|
||||
:viewed => false)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
# Returns a SQL conditions string used to find all issues visible by the specified user
|
||||
def self.visible_condition(user, options={})
|
||||
|
|
|
@ -171,10 +171,12 @@ class Journal < ActiveRecord::Base
|
|||
|
||||
# 缺陷状态更改,消息提醒
|
||||
def act_as_forge_message
|
||||
if self.user_id != self.issue.author_id
|
||||
self.forge_messages << ForgeMessage.new(:user_id => self.issue.author_id,
|
||||
:project_id => self.issue.project_id,
|
||||
:viewed => false)
|
||||
end
|
||||
end
|
||||
|
||||
# 更新用户分数 -by zjc
|
||||
def be_user_score
|
||||
|
|
|
@ -153,11 +153,11 @@
|
|||
<a href="javascript:void(0);" class="<%= ufm.viewed == 0 ? "newsBlack" : "newsBlue" %>"><%= ufm.forge_message.user %></a>
|
||||
</li>
|
||||
<li class="<%= ufm.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">
|
||||
<%= ufm.forge_message.notes.empty? ? "更新了问题状态" : "在问题中留言了" %></li>
|
||||
更新了问题
|
||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<%= link_to ("#{ufm.forge_message.notes.empty? ? ufm.forge_message.issue.subject.html_safe : ufm.forge_message.notes.html_safe }"),
|
||||
<%= link_to get_issue_des_update(ufm.forge_message),
|
||||
issue_path(:id => ufm.forge_message.journalized_id), :class => "#{ufm.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
||||
:title => "#{ufm.forge_message.notes.empty? ? ufm.forge_message.issue.subject.html_safe : ufm.forge_message.notes.html_safe }" %></a>
|
||||
:title => "#{get_issue_des_update(ufm.forge_message)}" %></a>
|
||||
</li>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ufm.forge_message.created_on).html_safe %> </li>
|
||||
</ul>
|
||||
|
@ -216,7 +216,7 @@
|
|||
<li class="homepageNewsPublisher fl">
|
||||
<a href="javascript:void(0);" class="newsBlue"><%= urm.memo.author %></a>
|
||||
</li>
|
||||
<li class="homepageNewsType fl" >回复了贴吧帖子</li>
|
||||
<li class="homepageNewsType fl" >新建贴吧帖子</li>
|
||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<%= link_to urm.memo.content.html_safe, forum_memo_path(urm.memo.forum_id, urm.memo.parent_id ? urm.memo.parent_id: urm.memo.id),:class => "newsGrey" , :title => "#{urm.memo.content.html_safe}" %></a>
|
||||
</li>
|
||||
|
|
Loading…
Reference in New Issue