Project

General

Profile

Patch #1511 ยป redmine-attachment.patch

Carl Nygard, 2008-06-20 20:55

View differences:

/var/www/html/redmine/app/models/attachment.rb 2008-05-15 09:46:15.000000000 -0400
acts_as_event :title => :filename,
:url => Proc.new {|o| {:controller => 'attachments', :action => 'download', :id => o.id}}
cattr_accessor :storage_path
@@storage_path = "#{RAILS_ROOT}/files"
# cattr_accessor :storage_path
# @@storage_path = "#{RAILS_ROOT}/files"
def storage_path
Setting.attachment_storage_path || "#{RAILS_ROOT}/files"
end
def validate
errors.add_to_base :too_long if self.filesize > Setting.attachment_max_size.to_i.kilobytes
......
# Returns file's location on disk
def diskfile
"#{@@storage_path}/#{self.disk_filename}"
# "#{@@storage_path}/#{self.disk_filename}"
"#{self.storage_path}/#{self.disk_filename}"
end
def increment_download
/var/www/html/redmine/app/views/settings/_general.rhtml 2008-05-15 09:48:04.000000000 -0400
<p><label><%= l(:setting_attachment_max_size) %></label>
<%= text_field_tag 'settings[attachment_max_size]', Setting.attachment_max_size, :size => 6 %> KB</p>
<p><label><%= l(:setting_attachment_storage_path) %></label>
<%= text_field_tag 'settings[attachment_storage_path]', Setting.attachment_storage_path, :size => 60 %></p>
<p><label><%= l(:setting_per_page_options) %></label>
<%= text_field_tag 'settings[per_page_options]', Setting.per_page_options_array.join(', '), :size => 20 %><br /><em><%= l(:text_comma_separated) %></em></p>
/var/www/html/redmine/config/settings.yml 2008-05-15 09:44:25.000000000 -0400
attachment_max_size:
format: int
default: 5120
attachment_storage_path:
default:
issues_export_limit:
format: int
default: 500
/var/www/html/redmine/lang/en.yml 2008-05-15 09:44:25.000000000 -0400
setting_login_required: Authentication required
setting_self_registration: Self-registration
setting_attachment_max_size: Attachment max. size
setting_attachment_storage_path: Attachment storage path
setting_issues_export_limit: Issues export limit
setting_mail_from: Emission email address
setting_bcc_recipients: Blind carbon copy recipients (bcc)
    (1-1/1)