Commit ffd10633bc91000bd8656b62778c445b1d2a8ba1
1 parent
9cf3e36c
Exists in
master
Change order of report columns
Showing
1 changed file
with
2 additions
and
2 deletions
Show diff stats
lib/dialoga_plugin/report_job.rb
... | ... | @@ -33,7 +33,7 @@ class DialogaPlugin::ReportJob < Struct.new(:profile_id, :report_path) |
33 | 33 | CSV.open(filepath, 'w', {:col_sep => ';'} ) do |csv| |
34 | 34 | tasks = ProposalsDiscussionPlugin::ProposalTask.all |
35 | 35 | count = 0 |
36 | - csv << ['Tema', 'Origem', 'Status', 'Criada em', 'Moderado por', 'Data de Moderado', 'Validado por', 'Data de Validado', 'Autor', 'Proposta', 'Categorias'] | |
36 | + csv << ['Origem', 'Status', 'Criada em', 'Moderado por', 'Data de Moderado', 'Validado por', 'Data de Validado', 'Autor', 'Proposta', 'Categorias', 'Tema'] | |
37 | 37 | status_translation = { |
38 | 38 | 1 => 'Pendente de Moderacao', |
39 | 39 | 2 => 'Rejeitada', |
... | ... | @@ -45,7 +45,6 @@ class DialogaPlugin::ReportJob < Struct.new(:profile_id, :report_path) |
45 | 45 | count += 1 |
46 | 46 | puts "%s de %s: adicionando task: %s" % [count, tasks.count, task.id ] |
47 | 47 | info = [] |
48 | - info.push(task.article_parent.nil? ? '' : task.article_parent.categories.map(&:name).join(' ')) | |
49 | 48 | info.push(task.proposal_source) |
50 | 49 | info.push(status_translation[task.status]) |
51 | 50 | info.push(task.created_at.strftime("%d/%m/%y %H:%M")) |
... | ... | @@ -56,6 +55,7 @@ class DialogaPlugin::ReportJob < Struct.new(:profile_id, :report_path) |
56 | 55 | info.push(task.requestor.present? ? task.requestor.name : '') |
57 | 56 | info.push(task.abstract.present? ? task.abstract.gsub(/\s+/, ' ').strip : '') |
58 | 57 | info.push(task.categories.map {|c| c.name}.join(' ')) |
58 | + info.push(task.article_parent.nil? ? '' : task.article_parent.categories.map(&:name).join(' ')) | |
59 | 59 | csv << info |
60 | 60 | end |
61 | 61 | end | ... | ... |