diff options
author | Frédéric Buclin <LpSolit@gmail.com> | 2010-07-08 18:58:33 +0200 |
---|---|---|
committer | Frédéric Buclin <LpSolit@gmail.com> | 2010-07-08 18:58:33 +0200 |
commit | 3c61e66fe3d24f183628a7396a3fcd720a95abeb (patch) | |
tree | 8745d0af24240755abea97ea45469715d813c803 /template | |
parent | 3c64c526467444023b172c6c299aed34e9687ec0 (diff) | |
download | bugzilla-3c61e66fe3d24f183628a7396a3fcd720a95abeb.tar.gz bugzilla-3c61e66fe3d24f183628a7396a3fcd720a95abeb.tar.xz |
Bug 490930: Always store attachments locally if they are over X size (and below some threshold!), don't ever display "Big File" checkbox
r=mkanat a=LpSolit
Diffstat (limited to 'template')
4 files changed, 18 insertions, 39 deletions
diff --git a/template/en/default/admin/params/attachment.html.tmpl b/template/en/default/admin/params/attachment.html.tmpl index 12fd491fc..159588625 100644 --- a/template/en/default/admin/params/attachment.html.tmpl +++ b/template/en/default/admin/params/attachment.html.tmpl @@ -64,13 +64,16 @@ "specify a URL when creating an attachment and " _ "treat the URL itself as if it were an attachment.", - maxattachmentsize => "The maximum size (in kilobytes) of attachments. " _ - "$terms.Bugzilla will not accept attachments greater than this number " _ - "of kilobytes in size. Setting this parameter to 0 will prevent " _ - "attaching files to ${terms.bugs}.", + maxattachmentsize => "The maximum size (in kilobytes) of attachments to be stored " _ + "in the database. If a file larger than this size is attached " _ + "to ${terms.abug}, $terms.Bugzilla will look at the " _ + "<a href='#maxlocalattachment'><tt>maxlocalattachment</tt> parameter</a> " _ + "to determine if the file can be stored locally on the web server. " _ + "If the file size exceeds both limits, then the attachment is rejected. " _ + "Settings both parameters to 0 will prevent attaching files to ${terms.bugs}.", - maxlocalattachment => "The maximum size (in megabytes) of attachments identified by " _ - "the user as 'Big Files' to be stored locally on the webserver. " _ - "If set to zero, attachments will never be kept on the local " _ - "filesystem." } + maxlocalattachment => "The maximum size (in megabytes) of attachments to be stored " _ + "locally on the web server. If set to a value lower than the " _ + "<a href='#maxattachmentsize'><tt>maxattachmentsize</tt> parameter</a>, " _ + "attachments will never be kept on the local filesystem." } %] diff --git a/template/en/default/attachment/createformcontents.html.tmpl b/template/en/default/attachment/createformcontents.html.tmpl index 2cef632d1..ad3a25bc6 100644 --- a/template/en/default/attachment/createformcontents.html.tmpl +++ b/template/en/default/attachment/createformcontents.html.tmpl @@ -32,18 +32,6 @@ > </td> </tr> -[% IF Param("maxlocalattachment") %] -<tr class="expert_fields"> - <th>BigFile:</th> - <td> - <input type="checkbox" id="bigfile" - name="bigfile" value="bigfile"> - <label for="bigfile"> - Big File - Stored locally and may be purged - </label> - </td> -</tr> -[% END %] [% IF Param("allow_attach_url") %] <tr class="expert_fields"> <th><label for="attachurl">AttachURL</label>:</th> diff --git a/template/en/default/global/code-error.html.tmpl b/template/en/default/global/code-error.html.tmpl index 177d47621..43644f703 100644 --- a/template/en/default/global/code-error.html.tmpl +++ b/template/en/default/global/code-error.html.tmpl @@ -37,11 +37,7 @@ [% DEFAULT title = "Internal Error" %] [% error_message = BLOCK %] - [% IF error == "attachment_local_storage_disabled" %] - [% title = "Local Storage Disabled" %] - You cannot store attachments locally. This feature is disabled. - - [% ELSIF error == "attachment_url_disabled" %] + [% IF error == "attachment_url_disabled" %] [% title = "Attachment URL Disabled" %] You cannot attach a URL. This feature is currently disabled. diff --git a/template/en/default/global/user-error.html.tmpl b/template/en/default/global/user-error.html.tmpl index b57792fd2..490941807 100644 --- a/template/en/default/global/user-error.html.tmpl +++ b/template/en/default/global/user-error.html.tmpl @@ -574,9 +574,13 @@ [% ELSIF error == "file_too_large" %] [% title = "File Too Large" %] + [%# Convert maxlocalattachment from Mb to Kb %] + [% max_local = Param('maxlocalattachment') * 1024 %] + [% max_limit = [Param('maxattachmentsize'), max_local] %] The file you are trying to attach is [% filesize FILTER html %] - kilobytes (KB) in size. Non-patch attachments cannot be more than - [%+ Param('maxattachmentsize') %] KB. <br> + kilobytes (KB) in size. Attachments cannot be more than + [%# Hack to get the max value between both limits %] + [%+ max_limit.nsort.last FILTER html %] KB. <br> We recommend that you store your attachment elsewhere [% IF Param("allow_attach_url") %] and then specify the URL to this file on the attachment @@ -1023,11 +1027,6 @@ [% title = "Invalid Keyword Name" %] You may not use commas or whitespace in a keyword name. - [% ELSIF error == "local_file_too_large" %] - [% title = "Local File Too Large" %] - Local file uploads must not exceed - [% Param('maxlocalattachment') %] MB in size. - [% ELSIF error == "login_needed_for_password_change" %] [% title = "Login Name Required" %] You must enter a login name when requesting to change your password. @@ -1312,13 +1311,6 @@ The password must be at least [%+ constants.USER_PASSWORD_MIN_LENGTH FILTER html %] characters long. - [% ELSIF error == "patch_too_large" %] - [% title = "File Too Large" %] - The file you are trying to attach is [% filesize FILTER html %] - kilobytes (KB) in size. - Patches cannot be more than [% Param('maxattachmentsize') %] KB in size. - Try splitting your patch into several pieces. - [% ELSIF error == "product_access_denied" %] Either the product [%+ IF id.defined %] |