OSDN Git Service

add support redmine-3.0
authorAkira Saito <akrstjp@users.sourceforge.jp>
Mon, 30 Mar 2015 15:25:16 +0000 (00:25 +0900)
committerAkira Saito <akrstjp@users.sourceforge.jp>
Mon, 30 Mar 2015 15:25:16 +0000 (00:25 +0900)
app/controllers/quick_view_issues_controller.rb
app/helpers/application_helper.rb
app/views/quick_view_issues/quick_view_issue_dialog.html.erb

index 56543ee..0d28b35 100644 (file)
@@ -3,6 +3,7 @@ class QuickViewIssuesController < ApplicationController
 
   def show
     @relations = @issue.relations.select {|r| r.other_issue(@issue) && r.other_issue(@issue).visible? }
+    @relation = IssueRelation.new
 
     respond_to do |format|
       format.html {
index 2a3186a..ef4cc3a 100644 (file)
@@ -1,5 +1,8 @@
 #coding: utf-8
 
 module ApplicationHelper
+  def redmine_version
+    Redmine::VERSION::MAJOR * 10 + Redmine::VERSION::MINOR
+  end
 end
 
index ae09f33..95906fb 100644 (file)
   project = @issue.project
   changesets = issue.changesets.visible.all
   journals = issue.journals.includes(:user, :details).reorder("#{Journal.table_name}.id ASC").all
+  if redmine_version() >= 30
+    journals = journals.to_a
+  else
+    journals = journals.all
+  end
   journals.each_with_index {|j,i| j.indice = i+1}
   journals.reject!(&:private_notes?) unless User.current.allowed_to?(:view_private_notes, project)
   journals.reverse! if User.current.wants_comments_in_reverse_order?
@@ -65,8 +70,7 @@
             end
           end
           if User.current.allowed_to?(:view_time_entries, project)
-            redmine_version = Redmine::VERSION::MAJOR * 10 + Redmine::VERSION::MINOR
-            if redmine_version < 26
+            if redmine_version() < 26
               rows.right l(:label_spent_time), (issue.total_spent_hours > 0 ? link_to(l_hours(issue.total_spent_hours), project_issue_time_entries_path(project, issue)) : "-"), :class => 'spent-time'
             else
               rows.right l(:label_spent_time), (issue.total_spent_hours > 0 ? link_to(l_hours(issue.total_spent_hours), issue_time_entries_path(issue)) : "-"), :class => 'spent-time'