laura.c Posted March 31, 2015 Report Posted March 31, 2015 Hi guys, The users can track time on a project out of project period. Is there any way not to allowed that?For eg. disable the text box for time tracking in Timesheet? Thanks,Laura
Carl Claesson Posted March 31, 2015 Report Posted March 31, 2015 Hi Laura, This is not possible at the moment I'm afraid. But it sounds like a good idea. I'll add this as a feature request and we'll investigate it. Thank you for the feedback. Regards,Carl
laura.c Posted March 31, 2015 Author Report Posted March 31, 2015 Hi Carl, Thanks for your answer. I am thinking of another solution: I try to define an action on 'update' event, so, every time when the user tries to track time out of the project period, the input value will be switched to 0. But I can't find a way to update the 'hours' field in a timeReports object and refresh the web ui . Any suggestions? Thanks!Laura
Carl Claesson Posted April 2, 2015 Report Posted April 2, 2015 Hi Laura, Are you running version 2 of ftrack? You should be able to listen on the update event and set the value to 0 if out of the project dates. Refreshing the web interface from the API is currently not possible. Here is an quick example resetting time reports if the date is not within the project start and end.import ftrackftrack.setup()def validate_time_report(topic, **kw): '''Event callback to validate time reports.''' entities = kw.get('entities', []) for entity in entities: if entity['entityType'] == 'taskworkedhours': parent = ftrack.Task(entity['parents'][1]['entityId']) project = parent.getProject() reports = parent.getTimereports() for report in reports: if ( report.get('date') < project.get('startdate') or report.get('date') > project.get('enddate') ): report.set('hours', 0)# Subscribe to the update topic.ftrack.TOPICS.subscribe('update', validate_time_report)ftrack.TOPICS.wait()Note that in ftrack 3 the API interface for handling timereports has changed. Cheers,Carl
laura.c Posted April 7, 2015 Author Report Posted April 7, 2015 Hi Carl, Thanks for the code. Very helpful!!! Yes, we are using ftrack 2. Refreshing web interface from API would be very helpful since we would like to implement actions when tasks/shots/asset builds are created/renamed for validating the names. Is it possible in ftrack 3? Cheers,Laura
Carl Claesson Posted April 10, 2015 Report Posted April 10, 2015 Hi Laura, At the moment it is not possible to send messages from the API, but you could post a note on the entity the user tries to log time on and add the user as recipient. This way the user will get a notification in their inbox. Let me know what you think. Regards,Carl
laura.c Posted April 13, 2015 Author Report Posted April 13, 2015 Hi Carl, a very good idea, thanks! I'll try it and I let you know how it works. Cheers,Laura
Recommended Posts
Archived
This topic is now archived and is closed to further replies.