Patch #1511 ยป redmine-attachment.patch
| /var/www/html/redmine/app/models/attachment.rb 2008-05-15 09:46:15.000000000 -0400 | ||
|---|---|---|
| 28 | 28 |
acts_as_event :title => :filename, |
| 29 | 29 |
:url => Proc.new {|o| {:controller => 'attachments', :action => 'download', :id => o.id}}
|
| 30 | 30 | |
| 31 |
cattr_accessor :storage_path |
|
| 32 |
@@storage_path = "#{RAILS_ROOT}/files"
|
|
| 31 |
# cattr_accessor :storage_path |
|
| 32 |
# @@storage_path = "#{RAILS_ROOT}/files"
|
|
| 33 | ||
| 34 |
def storage_path |
|
| 35 |
Setting.attachment_storage_path || "#{RAILS_ROOT}/files"
|
|
| 36 |
end |
|
| 33 | 37 |
|
| 34 | 38 |
def validate |
| 35 | 39 |
errors.add_to_base :too_long if self.filesize > Setting.attachment_max_size.to_i.kilobytes |
| ... | ... | |
| 75 | 79 | |
| 76 | 80 |
# Returns file's location on disk |
| 77 | 81 |
def diskfile |
| 78 |
"#{@@storage_path}/#{self.disk_filename}"
|
|
| 82 |
# "#{@@storage_path}/#{self.disk_filename}"
|
|
| 83 |
"#{self.storage_path}/#{self.disk_filename}"
|
|
| 79 | 84 |
end |
| 80 | 85 |
|
| 81 | 86 |
def increment_download |
| /var/www/html/redmine/app/views/settings/_general.rhtml 2008-05-15 09:48:04.000000000 -0400 | ||
|---|---|---|
| 26 | 26 |
<p><label><%= l(:setting_attachment_max_size) %></label> |
| 27 | 27 |
<%= text_field_tag 'settings[attachment_max_size]', Setting.attachment_max_size, :size => 6 %> KB</p> |
| 28 | 28 | |
| 29 |
<p><label><%= l(:setting_attachment_storage_path) %></label> |
|
| 30 |
<%= text_field_tag 'settings[attachment_storage_path]', Setting.attachment_storage_path, :size => 60 %></p> |
|
| 31 | ||
| 29 | 32 |
<p><label><%= l(:setting_per_page_options) %></label> |
| 30 | 33 |
<%= text_field_tag 'settings[per_page_options]', Setting.per_page_options_array.join(', '), :size => 20 %><br /><em><%= l(:text_comma_separated) %></em></p>
|
| 31 | 34 | |
| /var/www/html/redmine/config/settings.yml 2008-05-15 09:44:25.000000000 -0400 | ||
|---|---|---|
| 34 | 34 |
attachment_max_size: |
| 35 | 35 |
format: int |
| 36 | 36 |
default: 5120 |
| 37 |
attachment_storage_path: |
|
| 38 |
default: |
|
| 37 | 39 |
issues_export_limit: |
| 38 | 40 |
format: int |
| 39 | 41 |
default: 500 |
| /var/www/html/redmine/lang/en.yml 2008-05-15 09:44:25.000000000 -0400 | ||
|---|---|---|
| 187 | 188 |
setting_login_required: Authentication required |
| 188 | 189 |
setting_self_registration: Self-registration |
| 189 | 190 |
setting_attachment_max_size: Attachment max. size |
| 191 |
setting_attachment_storage_path: Attachment storage path |
|
| 190 | 192 |
setting_issues_export_limit: Issues export limit |
| 191 | 193 |
setting_mail_from: Emission email address |
| 192 | 194 |
setting_bcc_recipients: Blind carbon copy recipients (bcc) |