Merge branch 'develop' into dev_hjq
This commit is contained in:
commit
d4c3cb8777
|
@ -379,6 +379,16 @@ class Mailer < ActionMailer::Base
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# issue截止时间提醒
|
||||||
|
def issue_due_date(issue, recipients)
|
||||||
|
@author = issue.author
|
||||||
|
@issue_name = issue.subject
|
||||||
|
@issue_url = url_for(:controller => 'issues', :action => 'show', :id => issue.id)
|
||||||
|
@subject = "#{l(:mail_issue)}#{issue.subject} #{l(:mail_issue_due_date)} "
|
||||||
|
mail :to => recipients,
|
||||||
|
:subject => @subject
|
||||||
|
end
|
||||||
|
|
||||||
# Builds a Mail::Message object used to email recipients of the added issue.
|
# Builds a Mail::Message object used to email recipients of the added issue.
|
||||||
#
|
#
|
||||||
# Example:
|
# Example:
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
<div class="mail_box" style="border:1px solid #c8c8c8; width:570px; height: auto; padding:15px; margin-top:10px; margin-bottom:10px;">
|
||||||
|
<ul style="list-style-type:none; margin:0; padding:0;">
|
||||||
|
<li style="list-style-type:none; margin:0; padding:0;"><span style="float: left;"><strong><%= l(:mail_issue_content)%></strong></span>
|
||||||
|
<span style="float: left; width: 526px">
|
||||||
|
<p><%=link_to @author.login, user_url(@author) %> 发布的问题跟踪:<%=link_to @issue_name, @issue_url %> <span style="color: red">截止时间快到了,请您关注!</span></p>
|
||||||
|
</span>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<div class="cl" style="margin-top: 30px; clear:both; overflow:hidden;"></div>
|
||||||
|
</div>
|
|
@ -47,6 +47,9 @@
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= link_to l(:project_module_repository),({:controller => 'repositories', :action => 'show', :id => @project, :repository_id => gitlab_repository(@project).identifier}), :class => "f14 c_blue02" %>
|
<%= link_to l(:project_module_repository),({:controller => 'repositories', :action => 'show', :id => @project, :repository_id => gitlab_repository(@project).identifier}), :class => "f14 c_blue02" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<% unless @project.project_score.changeset_num == 0 %>
|
||||||
|
<%= link_to "(#{@project.project_score.changeset_num})", ({:controller => 'repositories', :action => 'show', :id => @project, :repository_id => gitlab_repository(@project).identifier}), :class => "subnav_num c_orange",:id=>'project_files_count_nav' %>
|
||||||
|
<% end %>
|
||||||
<!--<a class="subnav_num">(<%= @project.repositories.count %>)</a>-->
|
<!--<a class="subnav_num">(<%= @project.repositories.count %>)</a>-->
|
||||||
<% if (User.current.admin? || User.current.allowed_to?({:controller => 'projects', :action => 'settings'}, @project)) && rep_is_gitlab?(@project) %>
|
<% if (User.current.admin? || User.current.allowed_to?({:controller => 'projects', :action => 'settings'}, @project)) && rep_is_gitlab?(@project) %>
|
||||||
<%= link_to "+"+l(:project_gitlab_create_repository), url_for(:controller => 'projects', :action => 'settings', :id => @project.id, :tab=>'repositories') , :class => "subnav_green" %>
|
<%= link_to "+"+l(:project_gitlab_create_repository), url_for(:controller => 'projects', :action => 'settings', :id => @project.id, :tab=>'repositories') , :class => "subnav_green" %>
|
||||||
|
|
|
@ -28,4 +28,6 @@ zh:
|
||||||
mail_homework: "作业:"
|
mail_homework: "作业:"
|
||||||
mail_anonymous_comment_close: "作业匿评已经关闭,请您关注!"
|
mail_anonymous_comment_close: "作业匿评已经关闭,请您关注!"
|
||||||
mail_anonymous_comment_open: "作业匿评已经开启,请您关注!"
|
mail_anonymous_comment_open: "作业匿评已经开启,请您关注!"
|
||||||
mail_anonymous_comment_failed: "作业匿评开启失败,请您关注!"
|
mail_anonymous_comment_failed: "作业匿评开启失败,请您关注!"
|
||||||
|
mail_issue_due_date: "问题跟踪截止时间快到了,请您关注!"
|
||||||
|
mail_issue: "问题跟踪:"
|
|
@ -8,12 +8,14 @@ namespace :issue_due_date do
|
||||||
if ForgeMessage.where("forge_message_type =? and forge_message_id =? and status =?", "Issue", issue.id, 1).first.nil?
|
if ForgeMessage.where("forge_message_type =? and forge_message_id =? and status =?", "Issue", issue.id, 1).first.nil?
|
||||||
recipients = []
|
recipients = []
|
||||||
assigner = User.find(issue.assigned_to_id)
|
assigner = User.find(issue.assigned_to_id)
|
||||||
recipients << issue.author
|
unless assigner.id == issue.author.id
|
||||||
|
recipients << issue.author
|
||||||
|
end
|
||||||
recipients << assigner
|
recipients << assigner
|
||||||
recipients.each do |r|
|
recipients.each do |r|
|
||||||
issue.forge_messages << ForgeMessage.new(:user_id => r.id, :project_id => issue.project_id, :viewed => false, :status => 1)
|
issue.forge_messages << ForgeMessage.new(:user_id => r.id, :project_id => issue.project_id, :viewed => false, :status => 1)
|
||||||
# 发送邮件通知
|
# issue截止时间邮件提醒
|
||||||
# Mailer.homework_endtime__added(homework_common, s.student_id).deliver
|
Mailer.issue_due_date(issue, recipients).deliver
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -53,6 +53,19 @@ module Trustie
|
||||||
)
|
)
|
||||||
project.gpid = gproject.id
|
project.gpid = gproject.id
|
||||||
project.save!
|
project.save!
|
||||||
|
|
||||||
|
# 创建的时候一并同步成员及角色
|
||||||
|
project.members.each do |m|
|
||||||
|
begin
|
||||||
|
gid = m.user.gid
|
||||||
|
unless gid
|
||||||
|
gid = sync_user(m.user).id
|
||||||
|
end
|
||||||
|
self.g.add_team_member(gproject.id, gid, UserLevel::DEVELOPER)
|
||||||
|
rescue => e
|
||||||
|
puts e
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def sync_project(project, opt={})
|
def sync_project(project, opt={})
|
||||||
|
|
Loading…
Reference in New Issue