Project

General

Profile

[patch] Export issues to CSV - change the list of column » экспорт_в_csv_QuestionPlugin.patch

patch - Export to CSV for Question Plugin - Alexander Kulemin, 2010-08-23 18:50

View differences:

plugins/question_plugin/lib/question_queries_helper_patch.rb (working copy)
base.class_eval do
alias_method :default_column_content, :column_content
alias_method :column_content, :question_column_content
alias_method_chain :txt_column_content, :question
end
end
......
end
module InstanceMethods
def txt_column_content_with_question(column, issue)
if column.name == :formatted_questions
html=''
issue.open_questions.each do |question|
html<< "****#{question.journal.user.lastname} #{question.journal.user.firstname}: #{question.journal.notes}"
end
return html
else
txt_column_content_without_question(column, issue)
end
end
def question_column_content(column, issue)
if column.name == :formatted_questions
return format_questions(issue.open_questions)
(2-2/2)