present? instead of == '1' for settings
This commit is contained in:
parent
90015ef514
commit
0c07e1f749
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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? %>
|
||||
<span>
|
||||
<%= link_to 'WebDAV', webdav_url(@project, @folder) %>
|
||||
</span>
|
||||
|
||||
@ -67,7 +67,7 @@
|
||||
ids: params[:ids], email_entries: true), method: :post, class: 'icon icon-email',
|
||||
disabled: !email_allowed %>
|
||||
</li>
|
||||
<% if Setting.plugin_redmine_dmsf['dmsf_webdav'] == '1' %>
|
||||
<% if Setting.plugin_redmine_dmsf['dmsf_webdav'].present? %>
|
||||
<li>
|
||||
<% 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))}/" %>
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user