mirror of
https://github.com/opf/openproject.git
synced 2026-06-14 03:30:14 +00:00
Merge pull request #17859 from opf/bug/61308-log-time-triggered-from-my-spent-time-widget-allows-logging-time-for-other-users
do not show the user input when logging from the my page
This commit is contained in:
@@ -429,7 +429,7 @@ export class TimeEntryCalendarComponent implements AfterViewInit, OnDestroy {
|
||||
|
||||
private editEvent(entry:TimeEntryResource):void {
|
||||
void this.turboRequests.request(
|
||||
`${this.pathHelper.timeEntryEditDialog(entry.id as string)}`,
|
||||
`${this.pathHelper.timeEntryEditDialog(entry.id as string)}?onlyMe=true`,
|
||||
{ method: 'GET' },
|
||||
);
|
||||
}
|
||||
@@ -465,7 +465,7 @@ export class TimeEntryCalendarComponent implements AfterViewInit, OnDestroy {
|
||||
}
|
||||
|
||||
void this.turboRequests.request(
|
||||
`${this.pathHelper.timeEntryDialog()}?date=${date.format('YYYY-MM-DD')}`,
|
||||
`${this.pathHelper.timeEntryDialog()}?date=${date.format('YYYY-MM-DD')}&onlyMe=true`,
|
||||
{ method: 'GET' },
|
||||
);
|
||||
}
|
||||
|
||||
@@ -46,11 +46,7 @@ class TimeEntriesController < ApplicationController
|
||||
|
||||
def dialog
|
||||
@show_work_package = params[:work_package_id].blank?
|
||||
@show_user = if @project
|
||||
User.current.allowed_in_project?(:log_time, @project)
|
||||
else
|
||||
User.current.allowed_in_any_project?(:log_time)
|
||||
end
|
||||
@show_user = show_user_input_in_dialog
|
||||
|
||||
@time_entry.spent_on ||= params[:date].presence || Time.zone.today
|
||||
end
|
||||
@@ -132,6 +128,16 @@ class TimeEntriesController < ApplicationController
|
||||
|
||||
private
|
||||
|
||||
def show_user_input_in_dialog
|
||||
return false if params[:onlyMe] == "true"
|
||||
|
||||
if @project
|
||||
User.current.allowed_in_project?(:log_time, @project)
|
||||
else
|
||||
User.current.allowed_in_any_project?(:log_time)
|
||||
end
|
||||
end
|
||||
|
||||
def form_config_options
|
||||
{
|
||||
show_user: params[:time_entry][:show_user] == "true",
|
||||
|
||||
Reference in New Issue
Block a user