Access to user's preferencies via properties

This commit is contained in:
Karel Pičman 2019-06-07 10:21:43 +02:00
parent d8e7413da3
commit 303d235324
3 changed files with 4 additions and 4 deletions

View File

@ -576,7 +576,7 @@ class DmsfController < ApplicationController
def tree_view
tag = params[:custom_field_id].present? && params[:custom_value].present?
@tree_view = (User.current.pref[:dmsf_tree_view] == '1') && (!%w(atom xml json).include?(params[:format])) && !tag
@tree_view = (User.current.pref.dmsf_tree_view == '1') && (!%w(atom xml json).include?(params[:format])) && !tag
end
def copy_folder(folder)

View File

@ -358,7 +358,7 @@ class DmsfFilesController < ApplicationController
def tree_view
tag = params[:custom_field_id].present? && params[:custom_value].present?
@tree_view = (User.current.pref[:dmsf_tree_view] == '1') && (!%w(atom xml json).include?(params[:format])) && !tag
@tree_view = (User.current.pref.dmsf_tree_view == '1') && (!%w(atom xml json).include?(params[:format])) && !tag
end
end

View File

@ -93,7 +93,7 @@ module RedmineDmsf
end
def view_issues_edit_notes_bottom_style(context={})
if (User.current.pref[:dmsf_attachments_upload_choice] == 'Attachments') ||
if (User.current.pref.dmsf_attachments_upload_choice == 'Attachments') ||
!allowed_to_attach_documents(context[:container])
''
else
@ -148,7 +148,7 @@ module RedmineDmsf
container = context[:container]
if allowed_to_attach_documents(container)
html = (description ? '<p' : '<div')
html << " style=\"#{(User.current.pref[:dmsf_attachments_upload_choice] == 'Attachments') ? 'display: none;' : ''}\">"
html << " style=\"#{(User.current.pref.dmsf_attachments_upload_choice == 'Attachments') ? 'display: none;' : ''}\">"
if label
html << "<label>#{l(:label_document_plural)}</label>"
html << "<span class=\"attachments-container dmsf_uploader\">"