• R/O
  • SSH
  • HTTPS

rp-information: Commit


Commit MetaInfo

Revision56 (tree)
Time2014-10-15 19:46:19
Authortq_jappy

Log Message

Support Redmine 2.4.x (confirmed versions: 2.3.0 & 2.4.6)
Fix internal error at information settings page with Redmine 2.4.x

Change Summary

Incremental Difference

--- trunk/redmine_information/app/helpers/info_helper.rb (revision 55)
+++ trunk/redmine_information/app/helpers/info_helper.rb (revision 56)
@@ -43,5 +43,10 @@
4343 (1 < Redmine::VERSION::MAJOR ||
4444 (1 == Redmine::VERSION::MAJOR && 2 <= Redmine::VERSION::MINOR))
4545 end
46-
46+
47+ # Redmine (version 2.4.0 or later) supports different commit keywords for each tracker and
48+ # multiple issue update rules with different commit keywords.
49+ def commit_update_keywords_supported?
50+ 2 <= Redmine::VERSION::MAJOR && 4 <= Redmine::VERSION::MINOR
51+ end
4752 end
--- trunk/redmine_information/app/controllers/info_controller.rb (revision 55)
+++ trunk/redmine_information/app/controllers/info_controller.rb (revision 56)
@@ -60,14 +60,31 @@
6060 @deliveries = ActionMailer::Base.perform_deliveries
6161
6262 # Repository
63- @commit_fix_status = IssueStatus.find_by_id(Setting[:commit_fix_status_id])
64- unless (@commit_fix_status)
65- @commit_fix_status = l(:label_no_change_option)
63+ if commit_update_keywords_supported?
64+ @commit_update_keywords = Setting.commit_update_keywords_array
65+ @commit_update_keywords.each do |rule|
66+ if rule['keywords'].is_a?(Array)
67+ rule['keywords_string'] = rule['keywords'].join(",")
68+ end
69+ if rule.has_key?('if_tracker_id')
70+ tracker = Tracker.find_by_id(rule['if_tracker_id'])
71+ rule['if_tracker_name'] = tracker.name if (tracker)
72+ end
73+ if rule.has_key?('status_id')
74+ status = IssueStatus.find_by_id(rule['status_id'])
75+ rule['status_name'] = status.name if (status)
76+ end
77+ end
78+ else
79+ @commit_fix_status = IssueStatus.find_by_id(Setting[:commit_fix_status_id])
80+ unless (@commit_fix_status)
81+ @commit_fix_status = l(:label_no_change_option)
82+ end
83+ @commit_fix_done_ratio = Setting[:commit_fix_done_ratio]
84+ if (!@commit_fix_done_ratio or @commit_fix_done_ratio.empty?)
85+ @commit_fix_done_ratio = l(:label_no_change_option)
86+ end
6687 end
67- @commit_fix_done_ratio = Setting[:commit_fix_done_ratio]
68- if (!@commit_fix_done_ratio or @commit_fix_done_ratio.empty?)
69- @commit_fix_done_ratio = l(:label_no_change_option)
70- end
7188
7289 @commit_logtime_enabled = Setting[:commit_logtime_enabled]
7390 if (@commit_logtime_enabled)
Show on old repository browser