From: Jean-Philippe Lang Date: Sat, 21 Feb 2009 19:29:33 +0000 (+0000) Subject: Merged r2262, r2341 and r2486 from trunk. X-Git-Tag: 0.8.2~9 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=57d10ed89396d7df1344dc1a9446cedf3c602933;p=redmine.git Merged r2262, r2341 and r2486 from trunk. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/0.8-stable@2513 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index c1acc5eb0..f82c01384 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -487,11 +487,11 @@ module ApplicationHelper full_messages = [] object.errors.each do |attr, msg| next if msg.nil? - msg = msg.first if msg.is_a? Array + msg = [msg] unless msg.is_a?(Array) if attr == "base" - full_messages << l(msg) + full_messages << l(*msg) else - full_messages << "« " + (l_has_string?("field_" + attr) ? l("field_" + attr) : object.class.human_attribute_name(attr)) + " » " + l(msg) unless attr == "custom_values" + full_messages << "« " + (l_has_string?("field_" + attr) ? l("field_" + attr) : object.class.human_attribute_name(attr)) + " » " + l(*msg) unless attr == "custom_values" end end # retrieve custom values error messages @@ -499,8 +499,8 @@ module ApplicationHelper object.custom_values.each do |v| v.errors.each do |attr, msg| next if msg.nil? - msg = msg.first if msg.is_a? Array - full_messages << "« " + v.custom_field.name + " » " + l(msg) + msg = [msg] unless msg.is_a?(Array) + full_messages << "« " + v.custom_field.name + " » " + l(*msg) end end end diff --git a/app/views/layouts/base.rhtml b/app/views/layouts/base.rhtml index 0de3b0e3d..2d0cc2cf5 100644 --- a/app/views/layouts/base.rhtml +++ b/app/views/layouts/base.rhtml @@ -58,7 +58,7 @@ <%= call_hook :view_layouts_base_body_bottom %> diff --git a/doc/CHANGELOG b/doc/CHANGELOG index 7b94aa9d3..0bd3b8a19 100644 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -9,6 +9,9 @@ http://www.redmine.org/ * Send an email to the user when an administrator activates a registered user * Strip keywords from received email body +* Footer updated to 2009 +* Fixed: exporting an issue with attachments to PDF raises an error +* Fixed: "too few arguments" error may occur on activerecord error translation == 2009-02-15 v0.8.1 diff --git a/lib/redmine/export/pdf.rb b/lib/redmine/export/pdf.rb index 5d75494ed..932f1a812 100644 --- a/lib/redmine/export/pdf.rb +++ b/lib/redmine/export/pdf.rb @@ -21,6 +21,8 @@ require 'rfpdf/chinese' module Redmine module Export module PDF + include ActionView::Helpers::NumberHelper + class IFPDF < FPDF include GLoc attr_accessor :footer_date diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb index d282d09e6..9228f7c02 100644 --- a/test/functional/issues_controller_test.rb +++ b/test/functional/issues_controller_test.rb @@ -253,7 +253,7 @@ class IssuesControllerTest < Test::Unit::TestCase end def test_show_export_to_pdf - get :show, :id => 1, :format => 'pdf' + get :show, :id => 3, :format => 'pdf' assert_response :success assert_equal 'application/pdf', @response.content_type assert @response.body.starts_with?('%PDF')