Code cleanup.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8724 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
f84688687b
commit
cd4a19241a
|
@ -203,26 +203,26 @@ module IssuesHelper
|
||||||
when 'attr'
|
when 'attr'
|
||||||
field = detail.prop_key.to_s.gsub(/\_id$/, "")
|
field = detail.prop_key.to_s.gsub(/\_id$/, "")
|
||||||
label = l(("field_" + field).to_sym)
|
label = l(("field_" + field).to_sym)
|
||||||
case
|
case detail.prop_key
|
||||||
when ['due_date', 'start_date'].include?(detail.prop_key)
|
when 'due_date', 'start_date'
|
||||||
value = format_date(detail.value.to_date) if detail.value
|
value = format_date(detail.value.to_date) if detail.value
|
||||||
old_value = format_date(detail.old_value.to_date) if detail.old_value
|
old_value = format_date(detail.old_value.to_date) if detail.old_value
|
||||||
|
|
||||||
when ['project_id', 'status_id', 'tracker_id', 'assigned_to_id',
|
when 'project_id', 'status_id', 'tracker_id', 'assigned_to_id',
|
||||||
'priority_id', 'category_id', 'fixed_version_id'].include?(detail.prop_key)
|
'priority_id', 'category_id', 'fixed_version_id'
|
||||||
value = find_name_by_reflection(field, detail.value)
|
value = find_name_by_reflection(field, detail.value)
|
||||||
old_value = find_name_by_reflection(field, detail.old_value)
|
old_value = find_name_by_reflection(field, detail.old_value)
|
||||||
|
|
||||||
when detail.prop_key == 'estimated_hours'
|
when 'estimated_hours'
|
||||||
value = "%0.02f" % detail.value.to_f unless detail.value.blank?
|
value = "%0.02f" % detail.value.to_f unless detail.value.blank?
|
||||||
old_value = "%0.02f" % detail.old_value.to_f unless detail.old_value.blank?
|
old_value = "%0.02f" % detail.old_value.to_f unless detail.old_value.blank?
|
||||||
|
|
||||||
when detail.prop_key == 'parent_id'
|
when 'parent_id'
|
||||||
label = l(:field_parent_issue)
|
label = l(:field_parent_issue)
|
||||||
value = "##{detail.value}" unless detail.value.blank?
|
value = "##{detail.value}" unless detail.value.blank?
|
||||||
old_value = "##{detail.old_value}" unless detail.old_value.blank?
|
old_value = "##{detail.old_value}" unless detail.old_value.blank?
|
||||||
|
|
||||||
when detail.prop_key == 'is_private'
|
when 'is_private'
|
||||||
value = l(detail.value == "0" ? :general_text_No : :general_text_Yes) unless detail.value.blank?
|
value = l(detail.value == "0" ? :general_text_No : :general_text_Yes) unless detail.value.blank?
|
||||||
old_value = l(detail.old_value == "0" ? :general_text_No : :general_text_Yes) unless detail.old_value.blank?
|
old_value = l(detail.old_value == "0" ? :general_text_No : :general_text_Yes) unless detail.old_value.blank?
|
||||||
end
|
end
|
||||||
|
@ -265,10 +265,10 @@ module IssuesHelper
|
||||||
s << " (#{ diff_link })"
|
s << " (#{ diff_link })"
|
||||||
end
|
end
|
||||||
s.html_safe
|
s.html_safe
|
||||||
elsif !detail.value.blank?
|
elsif detail.value.present?
|
||||||
case detail.property
|
case detail.property
|
||||||
when 'attr', 'cf'
|
when 'attr', 'cf'
|
||||||
if !detail.old_value.blank?
|
if detail.old_value.present?
|
||||||
l(:text_journal_changed, :label => label, :old => old_value, :new => value).html_safe
|
l(:text_journal_changed, :label => label, :old => old_value, :new => value).html_safe
|
||||||
elsif multiple
|
elsif multiple
|
||||||
l(:text_journal_added, :label => label, :value => value).html_safe
|
l(:text_journal_added, :label => label, :value => value).html_safe
|
||||||
|
|
Loading…
Reference in New Issue