Permalink
Browse files

Resolved conflict in lib/xls_export.rb.

  • Loading branch information...
2 parents be975a7 + 447170a commit 1b099212d90b8ab658a8c6115b2d5933a73f9c36 @two-pack committed Sep 7, 2011
@@ -1,5 +1,5 @@
-<% fields_all = [['relations','watchers','description', 'time','attachments' ], ['query_columns_only','group','generate_name'] ] %>
+<% fields_all = [['relations','watchers','description', 'history', 'time','attachments' ], ['query_columns_only','group','generate_name'] ] %>
<% fields_all.each do |c|%>
<div class="box tabular">
<p><% c.each do |fnm| -%>
View
@@ -2,6 +2,7 @@ bg:
label_plugin_xlse_relations: "Експорт на връзките"
label_plugin_xlse_watchers: "Експорт на наблюдателите"
label_plugin_xlse_description: "Експорт на описанията"
+ label_plugin_xlse_history: "износ история"
label_plugin_xlse_time: "Експорт на употребеното време"
label_plugin_xlse_attachments: "Списък на прикачените файлове"
label_plugin_xlse_query_columns_only: "Експорт само на избраните колони"
@@ -22,3 +23,5 @@ bg:
label_plugin_xlse_export_format_quick_tooltip: "Експортиране с опции по подразбиране"
label_plugin_xlse_export_format_detailed: "Подробно"
label_plugin_xlse_export_format_detailed_tooltip: "Избор на опции преди експортиране"
+
+ field_history: "история"
View
@@ -2,6 +2,7 @@ cs:
label_plugin_xlse_relations: "Exportovat vazby"
label_plugin_xlse_watchers: "Exportovat sledování"
label_plugin_xlse_description: "Exportovat popis"
+ label_plugin_xlse_history: "Exportovat historii"
label_plugin_xlse_time: "Exportovat strávený čas"
label_plugin_xlse_attachments: "Vypsat přílohy"
label_plugin_xlse_query_columns_only: "Exportovat pouze zvolené sloupce"
@@ -17,3 +18,5 @@ cs:
label_plugin_xlse_field_attachment: "Přílohy"
+ field_history: "Historie"
+
View
@@ -2,6 +2,7 @@ de:
label_plugin_xlse_relations: "Ticket-Beziehnungen exportieren"
label_plugin_xlse_watchers: "Beobachter exportieren"
label_plugin_xlse_description: "Beschreibungen exportieren"
+ label_plugin_xlse_history: "Historie exportieren"
label_plugin_xlse_time: "Aufgewendete Zeit exportieren"
label_plugin_xlse_attachments: "Anhänge auflisten"
label_plugin_xlse_query_columns_only: "Nur ausgewählte Spalten exportieren"
@@ -22,3 +23,5 @@ de:
label_plugin_xlse_export_format_quick_tooltip: "Exportiere mit Standard Einstellungen"
label_plugin_xlse_export_format_detailed: "Detailierter Export"
label_plugin_xlse_export_format_detailed_tooltip: "Wähle Export Optionen"
+
+ field_history: "Historie"
View
@@ -2,6 +2,7 @@ en:
label_plugin_xlse_relations: "Export relations"
label_plugin_xlse_watchers: "Export watchers"
label_plugin_xlse_description: "Export description"
+ label_plugin_xlse_history: "Export history"
label_plugin_xlse_time: "Export spent time"
label_plugin_xlse_attachments: "List attachments"
label_plugin_xlse_query_columns_only: "Export selected columns only"
@@ -22,4 +23,6 @@ en:
label_plugin_xlse_export_format_quick_tooltip: "Export using default settings"
label_plugin_xlse_export_format_detailed: "Detailed"
label_plugin_xlse_export_format_detailed_tooltip: "Choose options before export"
+
+ field_history: "History"
View
@@ -2,6 +2,7 @@ ja:
label_plugin_xlse_relations: "関連を出力"
label_plugin_xlse_watchers: "ウォッチャーを出力"
label_plugin_xlse_description: "説明を出力"
+ label_plugin_xlse_history: "履歴を出力"
label_plugin_xlse_time: "作業時間を出力"
label_plugin_xlse_attachments: "添付ファイルのリストを出力"
label_plugin_xlse_query_columns_only: "選択した列だけを出力"
@@ -22,4 +23,6 @@ ja:
label_plugin_xlse_export_format_quick_tooltip: "標準の設定で出力する"
label_plugin_xlse_export_format_detailed: "オプション"
label_plugin_xlse_export_format_detailed_tooltip: "オプションを指定して出力する"
+
+ field_history: "履歴"
View
@@ -4,6 +4,7 @@ pl:
label_plugin_xlse_relations: "Eksportuj powiązania"
label_plugin_xlse_watchers: "Eksportuj obserwatorów"
label_plugin_xlse_description: "Eksportuj opis"
+ label_plugin_xlse_history: "Eksportuj Historia"
label_plugin_xlse_time: "Eksportuj dziennik"
label_plugin_xlse_attachments: "Ekportuj listę załączników"
label_plugin_xlse_query_columns_only: "Eksportuj tylko zaznaczone kolumny"
@@ -25,3 +26,4 @@ pl:
label_plugin_xlse_export_format_detailed: "Szczegółowy"
label_plugin_xlse_export_format_detailed_tooltip: "Ustaw opcje przed eksportem"
+ field_history: "Historia"
View
@@ -2,6 +2,7 @@ pt-BR:
label_plugin_xlse_relations: "Exportar tarefas relacionadas"
label_plugin_xlse_watchers: "Exportar observadores"
label_plugin_xlse_description: "Exportar descrição"
+ label_plugin_xlse_history: "Exportar história"
label_plugin_xlse_time: "Exportar tempo de trabalho"
label_plugin_xlse_attachments: "Listar anexos"
label_plugin_xlse_query_columns_only: "Exportar apenas as colunas selecionadas"
@@ -22,3 +23,5 @@ pt-BR:
label_plugin_xlse_export_format_quick_tooltip: "Exportar usando as configurações padrão"
label_plugin_xlse_export_format_detailed: "Detalhado"
label_plugin_xlse_export_format_detailed_tooltip: "Escolher as opções antes da exportação"
+
+ field_history: "história"
View
@@ -2,6 +2,7 @@ ru:
label_plugin_xlse_relations: "Экспортировать отношения"
label_plugin_xlse_watchers: "Экспортировать наблюдатeлей"
label_plugin_xlse_description: "Экспортировать описания"
+ label_plugin_xlse_history: "Экспортировать История"
label_plugin_xlse_time: "Экспортировать затраченное время"
label_plugin_xlse_attachments: "Список вложений"
label_plugin_xlse_query_columns_only: "Экспортировать только выделенные поля"
@@ -22,3 +23,5 @@ ru:
label_plugin_xlse_export_format_quick_tooltip: "Сохранить в XLSб используя значения по умолчанию"
label_plugin_xlse_export_format_detailed: "Подробный"
label_plugin_xlse_export_format_detailed_tooltip: "Выбрать опции перед сохранением в XLS"
+
+ field_history: "История"
View
@@ -2,6 +2,7 @@ zh-TW:
label_plugin_xlse_relations: "導出關係"
label_plugin_xlse_watchers: "導出跟蹤者"
label_plugin_xlse_description: "導出描述"
+ label_plugin_xlse_history: "導出歷史"
label_plugin_xlse_time: "導出耗時"
label_plugin_xlse_attachments: "列出附件"
label_plugin_xlse_query_columns_only: "僅導出選中"
@@ -21,3 +22,5 @@ zh-TW:
label_plugin_xlse_export_format_quick_tooltip: "使用預設設置導出"
label_plugin_xlse_export_format_detailed: "詳情"
label_plugin_xlse_export_format_detailed_tooltip: "導出之前選擇配置"
+
+ field_history: "歷史"
View
@@ -2,6 +2,7 @@ zh:
label_plugin_xlse_relations: "导出关系"
label_plugin_xlse_watchers: "导出跟踪者"
label_plugin_xlse_description: "导出描述"
+ label_plugin_xlse_history: "导出历史记录"
label_plugin_xlse_time: "导出耗时"
label_plugin_xlse_attachments: "列出附件"
label_plugin_xlse_query_columns_only: "仅导出选中"
@@ -21,3 +22,5 @@ zh:
label_plugin_xlse_export_format_quick_tooltip: "使用默认设置导出"
label_plugin_xlse_export_format_detailed: "详情"
label_plugin_xlse_export_format_detailed_tooltip: "导出之前选择配置"
+
+ field_history: "历史记录"
View
@@ -28,6 +28,7 @@
'relations' => '1',
'watchers' => '1',
'description' => '1',
+ 'history' => '0',
'time' => '0',
'attachments' => '0',
'query_columns_only' => '0',
View
@@ -34,23 +34,24 @@ module Redmine
module Export
module XLS
unloadable
-
- def issue_list(issues, &block)
- ancestors = []
- issues.each do |issue|
- while (ancestors.any? && !issue.is_descendant_of?(ancestors.last))
- ancestors.pop
- end
- yield issue, ancestors.size
- ancestors << issue unless issue.leaf?
- end
- end
+
+ def issue_list(issues, &block)
+ ancestors = []
+ issues.each do |issue|
+ while (ancestors.any? && !issue.is_descendant_of?(ancestors.last))
+ ancestors.pop
+ end
+ yield issue, ancestors.size
+ ancestors << issue unless issue.leaf?
+ end
+ end
# options are
# :relations - export relations
# :watchers - export watchers
# :time - export time spent
# :description - export descriptions
+# :history - export history
# :attachments - export attachments info
# :query_columns_only - export only columns from actual query
# :group - group by query grouping
@@ -63,6 +64,7 @@ def issues_to_xls2(issues, project, query, options = {})
show_watchers = options[:watchers]
show_time = options[:time]
show_descr = options[:description]
+ show_hist = options[:history]
query_columns_only = options[:query_columns_only]
show_attachment = options[:attachments]
group_by_query = query.grouped? ? options[:group] : false
@@ -92,7 +94,11 @@ def issues_to_xls2(issues, project, query, options = {})
if show_descr == '1'
issue_columns << QueryColumn.new(:description)
- end
+ end
+
+ if show_hist == '1'
+ issue_columns << QueryColumn.new(:history)
+ end
sheet1 = nil
group = false
@@ -119,41 +125,41 @@ def issues_to_xls2(issues, project, query, options = {})
row = sheet1.row(idx+1)
- row.replace [issue.id]
-
+ row.replace [issue.id]
+
lf_pos = get_value_width(issue.id)
columns_width[0] = lf_pos unless columns_width[0] >= lf_pos
- last_prj = project
-
- if level > 0
- s = s.to_s.rjust(level*3)
- issue.subject = s + issue.subject
+ last_prj = project
+
+ if level > 0
+ s = s.to_s.rjust(level*3)
+ issue.subject = s + issue.subject
end
-
- boldfmt = Spreadsheet::Format.new :weight => :bold
- row.set_format(0, boldfmt) if issue.children?
- issue_columns.each_with_index do |c, j|
+
+ boldfmt = Spreadsheet::Format.new :weight => :bold
+ row.set_format(0, boldfmt) if issue.children?
+ issue_columns.each_with_index do |c, j|
fmt = Spreadsheet::Format.new :weight => :bold
v = if c.is_a?(QueryCustomFieldColumn)
case c.custom_field.field_format
when "int"
- begin
+ begin
fmt.number_format = "0"
Integer(issue.custom_value_for(c.custom_field).to_s)
rescue
show_value(issue.custom_value_for(c.custom_field))
end
when "float"
- begin
+ begin
fmt.number_format = "0.00"
Float(issue.custom_value_for(c.custom_field).to_s)
rescue
show_value(issue.custom_value_for(c.custom_field))
end
when "date"
- begin
+ begin
fmt.number_format = "dd.mm.yyyy"
Date.parse(issue.custom_value_for(c.custom_field).to_s)
rescue
@@ -164,7 +170,7 @@ def issues_to_xls2(issues, project, query, options = {})
end
else
case c.name
- when :done_ratio
+ when :done_ratio
fmt.number_format = "0%"
(Float(issue.send(c.name)))/100
when :description
@@ -175,6 +181,25 @@ def issues_to_xls2(issues, project, query, options = {})
end
end
descr_str
+ when :history
+ hist_str = ''
+ issue_updates = issue.journals.find(
+ :all, :include => [:user, :details],
+ :order => "#{Journal.table_name}.created_on ASC")
+ for journal in issue_updates
+ hist_str << format_time(journal.created_on) + " - " + journal.user.name
+ hist_str << "\n"
+ for detail in journal.details
+ hist_str << " - " + show_detail(detail, true)
+ hist_str << "\n" unless detail == journal.details.last
+ end
+ if journal.notes?
+ hist_str << "\n" unless journal.details.empty?
+ hist_str << journal.notes.to_s
+ end
+ hist_str << "\n" unless journal == issue_updates.last
+ end
+ hist_str
when :formatted_relations
rel_str = ''
relations = issue.relations.select {|r| r.other_issue(issue).visible?}
@@ -194,7 +219,7 @@ def issues_to_xls2(issues, project, query, options = {})
end
end
rel_str
- when :spent_time
+ when :spent_time
if User.current.allowed_to?(:view_time_entries, last_prj)
c.value(issue)
else
@@ -204,19 +229,17 @@ def issues_to_xls2(issues, project, query, options = {})
c.value(issue)
when :project
last_prj = issue.send(c.name)
- last_prj
- when :start_date, :due_date
- fmt.number_format = "dd.mm.yyyy"
+ last_prj
+ when :start_date, :due_date
+ fmt.number_format = "dd.mm.yyyy"
c.value(issue)
- else
+ else
issue.respond_to?(c.name) ? issue.send(c.name) : c.value(issue)
end
end
- value = ['Time', 'Date', 'Fixnum', 'Float', 'Integer', 'String'].include?(v.class.name) ? v : v.to_s
-
- row.set_format(j+1, fmt) if issue.children?
-
+ value = ['Time', 'Date', 'Fixnum', 'Float', 'Integer', 'String', 'String'].include?(v.class.name) ? v : v.to_s
+ row.set_format(j+1, fmt) if issue.children?
lf_pos = get_value_width(value)
columns_width[j+1] = lf_pos unless columns_width[j+1] >= lf_pos
row << value

0 comments on commit 1b09921

Please sign in to comment.