diff --git a/app/models/dmsf_file.rb b/app/models/dmsf_file.rb index e9a8c788..daf7c39d 100644 --- a/app/models/dmsf_file.rb +++ b/app/models/dmsf_file.rb @@ -81,7 +81,7 @@ class DmsfFile < ActiveRecord::Base before_create :default_values def default_values - if (Setting.plugin_redmine_dmsf['dmsf_default_notifications'] == '1') && (!dmsf_folder || !dmsf_folder.system) + if Setting.plugin_redmine_dmsf['dmsf_default_notifications'].present? && (!dmsf_folder || !dmsf_folder.system) self.notification = true end end diff --git a/app/models/dmsf_folder.rb b/app/models/dmsf_folder.rb index 351ba636..7168616b 100644 --- a/app/models/dmsf_folder.rb +++ b/app/models/dmsf_folder.rb @@ -123,7 +123,7 @@ class DmsfFolder < ActiveRecord::Base end def default_values - if Setting.plugin_redmine_dmsf['dmsf_default_notifications'] == '1' && !system + if Setting.plugin_redmine_dmsf['dmsf_default_notifications'].present? && !system self.notification = true end end diff --git a/app/views/dmsf/_main.html.erb b/app/views/dmsf/_main.html.erb index ef26a2a4..ea84fd45 100644 --- a/app/views/dmsf/_main.html.erb +++ b/app/views/dmsf/_main.html.erb @@ -93,7 +93,7 @@ <% unless @folder && @folder.system %> <% other_formats_links do |f| %> <%= f.link_to 'CSV', url: { action: :show, id: @project, folder_id: @folder, encoding: Encoding::UTF_8 } if @project %> - <% if Setting.plugin_redmine_dmsf['dmsf_webdav'] == '1' %> + <% if Setting.plugin_redmine_dmsf['dmsf_webdav'].present? %> <%= link_to 'WebDAV', webdav_url(@project, @folder) %> diff --git a/app/views/dmsf_context_menus/_file.html.erb b/app/views/dmsf_context_menus/_file.html.erb index 263a910a..b2c288c2 100644 --- a/app/views/dmsf_context_menus/_file.html.erb +++ b/app/views/dmsf_context_menus/_file.html.erb @@ -67,7 +67,7 @@ ids: params[:ids], email_entries: true), method: :post, class: 'icon icon-email', disabled: !email_allowed %> -<% if Setting.plugin_redmine_dmsf['dmsf_webdav'] == '1' %> +<% if Setting.plugin_redmine_dmsf['dmsf_webdav'].present? %>
  • <% if dmsf_file.last_revision && dmsf_file.last_revision.protocol %> <% url = "#{dmsf_file.last_revision.protocol}:ofe|u|#{Setting.protocol.strip}://#{Setting.host_name.strip}/dmsf/webdav/#{Addressable::URI.escape(RedmineDmsf::Webdav::ProjectResource.create_project_name(dmsf_file.project))}/" %> diff --git a/lib/redmine_dmsf/patches/project_patch.rb b/lib/redmine_dmsf/patches/project_patch.rb index d2b34879..de2d4888 100644 --- a/lib/redmine_dmsf/patches/project_patch.rb +++ b/lib/redmine_dmsf/patches/project_patch.rb @@ -73,7 +73,7 @@ module RedmineDmsf def set_default_dmsf_notification if self.new_record? - if !self.dmsf_notification && (Setting.plugin_redmine_dmsf['dmsf_default_notifications'] == '1') + if !self.dmsf_notification && Setting.plugin_redmine_dmsf['dmsf_default_notifications'].present? self.dmsf_notification = true end end