Browse Source

1.添加文档

2.邮件中缺陷序号计算机制优化
2.项目、课程动态优化
GitlabVersion
nwb 8 years ago
parent
commit
eb15edd5ff
  1. 20
      app/models/issue.rb
  2. 5
      app/models/mailer.rb
  3. 2
      app/models/project.rb
  4. 2
      app/views/courses/show.html.erb
  5. 2
      app/views/mailer/_issue.html.erb
  6. 2
      app/views/mailer/_issue.text.erb
  7. 2
      app/views/mailer/issue_add.html.erb
  8. 2
      app/views/mailer/issue_add.text.erb
  9. 2
      app/views/projects/show.html.erb
  10. 3648
      doc/Redmine_代码评审插件管理员手册.pdf

20
app/models/issue.rb

@ -990,13 +990,9 @@ class Issue < ActiveRecord::Base
end
def to_s
"#{tracker} ##{id}: #{subject}"
"#{tracker} ##{project_index}: #{subject}"
end
# 缺陷在项目中的序号
def inProjectIndex
(self.project.issues.index(self).to_i + 1).to_s
end
# Returns a string of css classes that apply to the issue
def css_classes
@ -1160,9 +1156,19 @@ class Issue < ActiveRecord::Base
"" << self.project.name.to_s <<
"#" << project_index
end
def project_index
(self.project.issues.index(self).to_i + 1).to_s
if self.project.issues.include?(self)
(self.project.issues.index(self).to_i + 1).to_s
else
issue_index = 1
self.project.issues.each do |issue|
if self.id > issue.id
++issue_index
end
end
issue_index.to_s
end
end
private

5
app/models/mailer.rb

@ -96,8 +96,9 @@ class Mailer < ActionMailer::Base
# issue_add(issue) => Mail::Message object
# Mailer.issue_add(issue).deliver => sends an email to issue recipients
def issue_add(issue)
issue_id = issue.project_index
redmine_headers 'Project' => issue.project.identifier,
'Issue-Id' => (issue.project.issues.index(issue).to_i + 1).to_s,
'Issue-Id' => issue_id,
'Issue-Author' => issue.author.login
redmine_headers 'Issue-Assignee' => issue.assigned_to.login if issue.assigned_to
message_id issue
@ -108,7 +109,7 @@ class Mailer < ActionMailer::Base
cc = issue.watcher_recipients - recipients
mail :to => recipients,
:cc => cc,
:subject => "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] (#{issue.status.name}) #{issue.subject}"
:subject => "[#{issue.project.name} - #{issue.tracker.name} ##{issue_id}] (#{issue.status.name}) #{issue.subject}"
end
# Builds a Mail::Message object used to email recipients of the edited issue.

2
app/models/project.rb

@ -41,7 +41,7 @@ class Project < ActiveRecord::Base
has_many :principals, :through => :member_principals, :source => :principal
has_many :enabled_modules, :dependent => :delete_all
has_and_belongs_to_many :trackers, :order => "#{Tracker.table_name}.position"
has_many :issues, :dependent => :destroy, :include => [:status, :tracker]
has_many :issues, :dependent => :destroy, :include => [:status, :tracker] , :order => "id ASC"
has_many :issue_changes, :through => :issues, :source => :journals
has_many :versions, :dependent => :destroy, :order => "#{Version.table_name}.effective_date DESC, #{Version.table_name}.name DESC"
has_many :time_entries, :dependent => :delete_all

2
app/views/courses/show.html.erb

@ -84,7 +84,7 @@
<strong> !</strong></td>
</tr>
<tr>
<td class="font_lighter" style="float: right"><%= l :label_update_time %>
<td class="font_lighter" style="float: right"><%= l :label_create_time %>
: <%= format_time(@course.created_at) %>
</table>
</td>

2
app/views/mailer/_issue.html.erb

@ -1,4 +1,4 @@
<h1><%= link_to(h("#{issue.tracker.name} ##{issue.id}: #{issue.subject}"), issue_url) %></h1>
<h1><%= link_to(h("#{issue.tracker.name} ##{issue.project_index}: #{issue.subject}"), issue_url) %></h1>
<ul>
<li><%=l(:field_author)%>: <%=h issue.author %></li>

2
app/views/mailer/_issue.text.erb

@ -1,4 +1,4 @@
<%= "#{issue.tracker.name} ##{issue.id}: #{issue.subject}" %>
<%= "#{issue.tracker.name} ##{issue.project_index}: #{issue.subject}" %>
<%= issue_url %>
* <%=l(:field_author)%>: <%= issue.author %>

2
app/views/mailer/issue_add.html.erb

@ -1,3 +1,3 @@
<%= l(:text_issue_added, :id => "##{@issue.id}", :author => h(@issue.author)) %>
<%= l(:text_issue_added, :id => "##{@issue.project_index}", :author => h(@issue.author)) %>
<hr />
<%= render :partial => 'issue', :formats => [:html], :locals => { :issue => @issue, :issue_url => @issue_url } %>

2
app/views/mailer/issue_add.text.erb

@ -1,4 +1,4 @@
<%= l(:text_issue_added, :id => "##{@issue.id}", :author => @issue.author) %>
<%= l(:text_issue_added, :id => "##{@issue.project_index}", :author => @issue.author) %>
----------------------------------------
<%= render :partial => 'issue', :formats => [:text], :locals => { :issue => @issue, :issue_url => @issue_url } %>

2
app/views/projects/show.html.erb

@ -75,7 +75,7 @@
<%= l(:label_user_create_project) %> <%= link_to @project.name %><strong> !</strong></td>
</tr>
<tr>
<td class="font_lighter" style="float: right"><%= l :label_update_time %>: <%= format_time(@project.created_on) %>
<td class="font_lighter" style="float: right"><%= l :label_create_time %>: <%= format_time(@project.created_on) %>
</table></td>
</tr>
</table>

3648
doc/Redmine_代码评审插件管理员手册.pdf

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save