From 6ba25556b70e02aa9f18c05aad9c98b2cf3d0594 Mon Sep 17 00:00:00 2001 From: yanxd Date: Tue, 25 Mar 2014 09:09:46 +0800 Subject: [PATCH] issues id new world --- app/helpers/issues_helper.rb | 3 ++- app/models/issue.rb | 8 +++++++- app/views/issues/_list.html.erb | 3 ++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index f5847abbc..8da5d7c35 100644 --- a/app/helpers/issues_helper.rb +++ b/app/helpers/issues_helper.rb @@ -58,7 +58,8 @@ module IssuesHelper end def issue_heading(issue) - h("#{issue.tracker} ##{issue.id}") + #h("#{issue.tracker} ##{issue.id}") + h("#{issue.tracker} #{issue.source_from}") end def render_issue_subject_with_tree(issue) diff --git a/app/models/issue.rb b/app/models/issue.rb index c69343c6b..1ea358a37 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -217,7 +217,7 @@ class Issue < ActiveRecord::Base end def to_param - @to_param ||= "#{id}_#{self.project.name}(#{self.project.issues.index(self)+1}-#{self.project.issues.count})"#.parameterize + @to_param ||= "#{id}_#{self.project.name}(#{self.project.issues.index(self).to_i+1}-#{self.project.issues.count})"#.parameterize end # Overrides Redmine::Acts::Customizable::InstanceMethods#available_custom_fields @@ -1144,6 +1144,12 @@ class Issue < ActiveRecord::Base Project.all(:conditions => Project.allowed_to_condition(user, :move_issues)) end + # back string obj which is belong to project. + def source_from + "" << self.project.name.to_s << + "#" << (self.project.issues.index(self).to_i + 1).to_s + end + private def after_project_change diff --git a/app/views/issues/_list.html.erb b/app/views/issues/_list.html.erb index ed4407fa9..2b17b4fb1 100644 --- a/app/views/issues/_list.html.erb +++ b/app/views/issues/_list.html.erb @@ -30,7 +30,8 @@ <% end -%>