Files
redmine/app/controllers/hourglass_projects_controller.rb
Roman Vaníček bbe840cd8b Squashed 'plugins/redmine_hourglass/' content from commit ec937a4
git-subtree-dir: plugins/redmine_hourglass
git-subtree-split: ec937a4ed4717e358207dd3857fac248b9e625e9
2023-03-23 12:49:36 +01:00

25 lines
788 B
Ruby

class HourglassProjectsController < ApplicationController
helper :application
def settings
find_project
deny_access unless User.current.allowed_to? :select_project_modules, @project
@settings = Hourglass::ProjectSettings.load(@project)
if request.post?
if @settings.update(hourglass_settings_params)
flash[:notice] = l(:notice_successful_update)
render js: "window.location='#{settings_project_path @project, tab: Hourglass::PLUGIN_NAME}'"
return
end
end
end
private
def hourglass_settings_params
params.require(:hourglass_project_settings).permit(:round_sums_only, :round_minimum, :round_limit,
:round_default, :round_carry_over_due, :clamp_limit)
end
end