プロジェクト

全般

プロフィール

Vote #80122

完了

CSV export of time entries report does not honor project filter

Admin Redmine さんが3年以上前に追加. 3年以上前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
Time tracking_13
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
13
version_id:
151
issue_org_id:
31511
author_id:
403109
assigned_to_id:
332
comments:
8
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
146
ステータス-->[Closed]

説明

When exporting a report of time entries in a projet (from an URL like @/project/foo/time_entries/report@) the URL used (when the export options dialog is closed) is not the project specific URL (i.e. @/time_entries/report.csv@ and not @/project/foo/time_entries/report.csv@).

It seems the @report.csv@ is generated source:/trunk/app/views/timelog/report.html.erb@18146#L91 with


<%= report_time_entries_path(:format => 'csv') %>

and the original @form_tag@ source:/trunk/app/views/timelog/report.html.erb@18146#L91 uses


<%= form_tag(_report_time_entries_path(@project, nil), :method => :get, :id => 'query_form') do %>

journals

Thank you for sharing the probrem.
I have confirmed that the following changes solve the problem.

<pre><code class="diff">
diff --git a/app/views/timelog/report.html.erb b/app/views/timelog/report.html.erb
index ae64a891e1..24425a55d0 100644
--- a/app/views/timelog/report.html.erb
+++ b/app/views/timelog/report.html.erb
@@ -88,8 +88,8 @@
$(document).ready(function(){
$('input#csv-export-button').click(function(){
$('form input#encoding').val($('select#encoding option:selected').val());
- $('form#query_form').attr('action', '<%= report_time_entries_path(:format => 'csv') %>').submit();
- $('form#query_form').attr('action', '<%= report_time_entries_path %>');
+ $('form#query_form').attr('action', '<%= _report_time_entries_path(@project, nil, :format => 'csv') %>').submit();
+ $('form#query_form').attr('action', '<%= _report_time_entries_path(@project, nil) %>');
hideModal(this);
});
});

</code></pre>

--------------------------------------------------------------------------------
Here is a patch for this issue (its tracker may be changed).

Tests done :
* Export from "/time_entries/report"
→ uses "/time_entries/report.csv"
* Export from "/project/foo/time_entries/report"
→ uses "/project/foo/time_entries/report.csv"

--------------------------------------------------------------------------------
Setting the target version to 4.0.4.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Committed the fix. Thank you for reporting and fixing this issue.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------


related_issues

relates,Closed,26279,Allow switching the encoding to UTF-8 when exporting to CSV
duplicates,Closed,30809,Spent time report > CSV not obeying filters

Admin Redmine さんが3年以上前に更新

  • カテゴリTime tracking_13 にセット
  • 対象バージョン4.0.4_151 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0