From 3c61e66fe3d24f183628a7396a3fcd720a95abeb Mon Sep 17 00:00:00 2001 From: Frédéric Buclin Date: Thu, 8 Jul 2010 18:58:33 +0200 Subject: 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 --- template/en/default/global/code-error.html.tmpl | 6 +----- template/en/default/global/user-error.html.tmpl | 20 ++++++-------------- 2 files changed, 7 insertions(+), 19 deletions(-) (limited to 'template/en/default/global') 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.
+ 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.
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 %] -- cgit v1.2.3-24-g4f1b