anteo / redmine_custom_workflows

Allows to create custom workflows for Redmine
http://www.redmine.org/plugins/custom-workflows
GNU General Public License v2.0
182 stars 72 forks source link

How to control issue's log time entries #270

Closed msm4311 closed 2 years ago

msm4311 commented 2 years ago

I need to block log time entries for issues older than a certain date but I can't see a "time entries" observable object on this plugin. ¿Anyone can suggest how to do it?

Thanks

picman commented 2 years ago

Time entry as an observable object has been there since v0.1.6. image

AirTibu commented 2 years ago

Hi,

Use this code in BEFORE SAVE section at Time Entry object:


errors.add(:base,"Time entry registration is not allowed for such an old date!") if spent_on.present? &&  self.spent_on < (Time.now - 2.days)

Do not forget to change the number of days. In the example code I used 2 days --> (Time.now - 2.days)

I hope it helps!

msm4311 commented 2 years ago

Great @AirTibu Many Thanks