Debian/squeeze
В репозитории redmine 0.9.0~svn2907-1, поддержка mysql отдельным пакетом redmine-mysql.
Перед конфигурированием redmine необходимо в /etc/mysql/my.cnf добавить:
[client]
default-character-set=utf8
[mysqld]
init_connect='SET collation_connection = utf8_general_ci'
init_connect='SET NAMES utf8'
default-character-set=utf8
character-set-server = utf8
collation-server = utf8_general_ci
[mysql]
default-character-set=utf8
иначе таблицы будут созданы с кодировкой latin1.
Из коробки экспорт в pdf выводит плящущие сикарашки. Патча от разработчиков не ожидается, но есть
"народное" решение для версии 0.8.
Для версии 0.9 требуются небольшие исправления, но в целом лечится аналогично.
1.
Отсюда берем модифицированный пакет RFPDF и заменяем содержимое каталога redmine/vendor/plugins/rfpdf на содержимое архива.
2. Патчим redmine:
diff -urN redmine_orig/lib/redmine/export/pdf.rb redmine_works/lib/redmine/export/pdf.rb
--- redmine_orig/lib/redmine/export/pdf.rb 2009-10-27 15:17:35.000000000 +0600
+++ redmine_works/lib/redmine/export/pdf.rb 2009-10-27 15:22:46.000000000 +0600
@@ -17,7 +17,6 @@
require 'iconv'
require 'rfpdf/fpdf'
-require 'rfpdf/chinese'
module Redmine
module Export
@@ -25,7 +24,7 @@
include ActionView::Helpers::TextHelper
include ActionView::Helpers::NumberHelper
- class IFPDF < FPDF
+ class IFPDF < TCPDF
include Redmine::I18n
attr_accessor :footer_date
@@ -49,8 +48,8 @@
@font_for_content = 'Big5'
@font_for_footer = 'Big5'
else
- @font_for_content = 'Arial'
- @font_for_footer = 'Helvetica'
+ @font_for_content = 'FreeSans'
+ @font_for_footer = 'FreeSans'
end
SetCreator(Redmine::Info.app_name)
SetFont(@font_for_content)
@@ -113,7 +112,7 @@
title = query.new_record? ? l(:label_issue_plural) : query.name
title = "#{project} - #{title}" if project
pdf.SetTitle(title)
- pdf.AliasNbPages
+ pdf.alias_nb_pages
pdf.footer_date = format_date(Date.today)
pdf.AddPage("L")
@@ -180,7 +179,7 @@
def issue_to_pdf(issue)
pdf = IFPDF.new(current_language)
pdf.SetTitle("#{issue.project} - ##{issue.tracker} #{issue.id}")
- pdf.AliasNbPages
+ pdf.alias_nb_pages
pdf.footer_date = format_date(Date.today)
pdf.AddPage
@@ -307,7 +306,7 @@
def gantt_to_pdf(gantt, project)
pdf = IFPDF.new(current_language)
pdf.SetTitle("#{l(:label_gantt)} #{project}")
- pdf.AliasNbPages
+ pdf.alias_nb_pages
pdf.footer_date = format_date(Date.today)
pdf.AddPage("L")
pdf.SetFontStyle('B',12)
diff -urN redmine_orig/vendor/plugins/rfpdf/environment.rb redmine_works/vendor/plugins/rfpdf/environment.rb
--- redmine_orig/vendor/plugins/rfpdf/environment.rb 2009-10-27 15:17:35.000000000 +0600
+++ redmine_works/vendor/plugins/rfpdf/environment.rb 2009-10-27 15:23:18.000000000 +0600
@@ -8,14 +8,6 @@
require "#{File.dirname __FILE__}/lib/core/view"
require "#{File.dirname __FILE__}/lib/core/rfpdf"
-begin
- require 'RMagick'
- require "#{File.dirname __FILE__}/lib/core/rmagick"
-rescue LoadError
- require 'image_science'
- require "#{File.dirname __FILE__}/lib/core/image_science"
-end
-
require "#{File.dirname __FILE__}/lib/math"
require "#{File.dirname __FILE__}/lib/tcpdf"
diff -urN redmine_orig/vendor/plugins/rfpdf/lib/tcpdf.rb redmine_works/vendor/plugins/rfpdf/lib/tcpdf.rb
--- redmine_orig/vendor/plugins/rfpdf/lib/tcpdf.rb 2009-10-27 15:17:35.000000000 +0600
+++ redmine_works/vendor/plugins/rfpdf/lib/tcpdf.rb 2009-10-27 15:24:07.000000000 +0600
@@ -3077,7 +3077,7 @@
out('/Filter /FlateDecode');
end
out('>>');
- open(ctgfile) do |f|
+ open(ctgfile, 'rb') do |f|
putstream(f.read())
end
out('endobj');