プロジェクト

全般

プロフィール

Vote #71419

未完了

Make the only enabled activity in a project the default one for time entry

Admin Redmine さんがほぼ4年前に追加. ほぼ4年前に更新.

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

0%

予定工数:
category_id:
13
version_id:
0
issue_org_id:
10314
author_id:
50520
assigned_to_id:
0
comments:
2
status_id:
1
tracker_id:
2
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[New]

説明

Example: In administration, if we have 4 activities (A, B, C, D) and A by default,
If activity C is the only one we can set in a project, so when submitting time entry we have to choose C as activity although it is the only choice in the combobox.

The field is compulsory so it is disturbing to set C as activity wherever we input time.


journals

I agree. Maybe the best solution would be to allow setting a default activity per project?

Here's a simple patch which removes blank field if only one activity is present:
<pre>
diff --git a/app/helpers/timelog_helper.rb b/app/helpers/timelog_helper.rb
index 6be6c58..04ac1bc 100644
--- a/app/helpers/timelog_helper.rb
+++ b/app/helpers/timelog_helper.rb
@@ -49,7 +49,8 @@ module TimelogHelper
if time_entry && time_entry.activity && !time_entry.activity.active?
collection << [ "--- #{l(:actionview_instancetag_blank_option)} ---", '' ]
else
- collection << [ "--- #{l(:actionview_instancetag_blank_option)} ---", '' ] unless activities.detect(&:is_default)
+ collection << [ "--- #{l(:actionview_instancetag_blank_option)} ---", '' ] unless activities.detect(&:is_default) ||
+ activities.count == 1
end
activities.each { |a| collection << [a.name, a.id] }
collection

</pre>
--------------------------------------------------------------------------------

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

Admin Redmine さんがほぼ4年前に更新

  • カテゴリTime tracking_13 にセット

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

いいね!0
いいね!0