プロジェクト

全般

プロフィール

Vote #73414

未完了

Restrict log time for old days

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

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

0%

予定工数:
category_id:
13
version_id:
0
issue_org_id:
13244
author_id:
49110
assigned_to_id:
0
comments:
39
status_id:
8
tracker_id:
2
plus1:
2
affected_version:
closed_on:
affected_version_id:
ステータス-->[Reopend]

説明

For example any user have to log his spent time today or tomorrow.
If he try to log time for period more than yesterday - it should be not possible.
There are kind of users that sometimes log their time for period weeks ago and this is bad.
Is there any suggestion how to prevent such things.


journals

We need it the other way round and have to be able to log time for weeks ago...
It would need to be configurable.
--------------------------------------------------------------------------------
+1 Good idea restricting log time. But I would restrict only for closed issues: #13596
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
someone has been successful in this?
--------------------------------------------------------------------------------

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

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

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

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

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

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

--------------------------------------------------------------------------------
Closing as a duplicate of #3322.
--------------------------------------------------------------------------------

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

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

--------------------------------------------------------------------------------
Last line in diff gives ability to restrict log time for specified number of days and exclude specific users from this restriction.
--------------------------------------------------------------------------------
Pavel Potcheptsov wrote:
> Last line in diff gives ability to restrict log time for specified number of days and exclude specific users from this restriction.

I have noted at #3322#note-11 because this issue is closed as duplicate.
--------------------------------------------------------------------------------
Why is this considered a duplicate ? This is a totally legitimate and self-standing use case: for some projects, I want to have a strict discipline in regards with spent time logging. So I want to be sure that the users on this project are allowed to log time ONLY for today AND X working days before (where X most probably equals to 1)

Does anyone know of a plugin that would allow for such functionality? Or might it be included in Redmine itself ?
--------------------------------------------------------------------------------
Kirill Marchuk wrote:
> Why is this considered a duplicate?
Agree.
> Does anyone know of a plugin that would allow for such functionality? Or might it be included in Redmine itself ?
At least current patch allow this for all projects.
There might be some general system wide setting for this and dedicated per each project setting.

--------------------------------------------------------------------------------
any chances this will be merged into redmine [soon] ?
--------------------------------------------------------------------------------
hello, anyone ? does Redmine have a community ?
--------------------------------------------------------------------------------
@Pavel, may be you can change "resolution" for this issue ?
--------------------------------------------------------------------------------
No I can't.
--------------------------------------------------------------------------------
is there anyone alive here ? why are patches ignored ? Man spent his time and effort into it, he deserves at least a reaction !!!
--------------------------------------------------------------------------------
well, I've seen the patch finally ))

this is NOT something that's possible to merge into upstream. just a couple of hard-coded validation checks.

Proper implementation would require a per-project setting of:
* is time logging restricted for this project at all
* how many days in the past are allowed to log time on (0 is minimum, which means you can only log time on today)

if this sounds bad, please leave your comments
--------------------------------------------------------------------------------

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

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

--------------------------------------------------------------------------------
If anyone is interested a coworker made this plugin: https://github.com/cerxal/estatisticas
It does a lot of things, but it includes a field called _Numero máximo de dias sin incurrir horas_ = _Maximum number of days to log spent time_ so users can only log time X days ago, if you try to log X+1 days ago it will raise an error.
We are using it in 3.4.4 (also in 3.3.1). Don't know if it will work in other versions.
Maybe you can use part of the source code to do your own dedicate plugin.
--------------------------------------------------------------------------------
Thanks you for information.
Do you know if there an option to exclude certain users from that restriction?
--------------------------------------------------------------------------------
Pavel Potcheptsov wrote:
> Do you know if there an option to exclude certain users from that restriction?

No, it applies to all users on all projects.
--------------------------------------------------------------------------------
We would like to have this functionality as well. IO agree with Kirill and Pavel. Important feature.

We have the same problem In our use case. Users should log their time max 1-3 days back butthey do it just to fiil the time. I'd like to restrict it. If they do not log the time properly, they should have a problem which can solve only someone with higher privilegy.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
+1 see my comments from #31984
--------------------------------------------------------------------------------
I have created a patch based on the master git branch for this feature. This patch allows

1. Global configuration in the "Time Tracking" tab in the settings that allows setting how many days in the past time logs can be added. Default is 999 days
2. Once the configuration is set, the date of the time log cannot be older than x days in the past. x is the value configured in the above setting.

Patch attached.
--------------------------------------------------------------------------------
Corrected spelling for "time logs"
--------------------------------------------------------------------------------
Ashwin Date wrote:
> Corrected spelling for "time logs"

Hi Aswin, please tell me how to use this patch in Redmine.

--------------------------------------------------------------------------------
Ashwin Date wrote:
> I have created a patch based on the master git branch for this feature.

Hi there.
Your path works great however I didn't make any changes in app/controllers/issues_controller.rb. Can you describe what is the purpose of that changes?

Do you know how to implement changes so that to add setting to choose users who is excluded from past time log restriction?

For now I have to use this line with hardcoded users IDs:
<pre><code class="ruby">
errors.add :spent_on, :invalid if \
(days_diff.to_i > Setting.timelog_max_days_before.to_i) && \
([10,20,30,110].exclude? User.current.id)
</pre>
--------------------------------------------------------------------------------
i use

<pre>
errors.add :spent_on, "is too early" if (spent_on < Date.today - 5.day)
end
</pre>

successfully, but like to restrict time logs to the current month, u should not be able to log time in any other month except the current month. so u can only log the time in march, as soon as its 1st of march. im no ruby or redmine coder, can someone help me with this?
--------------------------------------------------------------------------------


related_issues

relates,Closed,3322,Setting to restrict spent times on future dates
relates,New,28308,validation at date of spent time
duplicates,Closed,31984,Permission to add timelogs in past

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

  • カテゴリTime tracking_13 にセット

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

いいね!0
いいね!0