From 5caeffeb2e966719dcf62f9aa865079d4a973e52 Mon Sep 17 00:00:00 2001 From: tDidierjean Date: Tue, 17 Apr 2012 08:53:45 +0000 Subject: [PATCH] [-] BO : fix display bug when virtual file upload fails --- .../controllers/products/virtualproduct.tpl | 15 ++++++++++++--- admin-dev/uploadProductFile.php | 2 +- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/admin-dev/themes/default/template/controllers/products/virtualproduct.tpl b/admin-dev/themes/default/template/controllers/products/virtualproduct.tpl index 03f85757e..74447a6a5 100644 --- a/admin-dev/themes/default/template/controllers/products/virtualproduct.tpl +++ b/admin-dev/themes/default/template/controllers/products/virtualproduct.tpl @@ -47,16 +47,21 @@ var result = data.getAttribute("result"); var msg = data.getAttribute("msg"); var fileName = data.getAttribute("filename"); - $("#upload-confirmation").show(); if (result == "error") - $("#upload-confirmation td").html('
{l s='Error:'} ' + msg + '
'); + { + $("#upload-confirmation").hide(); + $("#upload-error td").html('
{l s='Error:'} ' + msg + '
'); + $("#upload-error").show(); + } else { - $('#upload_input').hide(); + $('#upload-error').hide(); $('#file_missing').hide(); $('#virtual_product_name').attr('value', fileName); + $("#upload-confirmation .error").remove(); $('#upload-confirmation div').prepend('{l s='The file'} "'+fileName+'" {l s='has successfully been uploaded'}' + ''); + $("#upload-confirmation").show(); } } } @@ -147,6 +152,9 @@

{l s='Your server\'s maximum upload file size is'}: {$upload_max_filesize} {l s='MB'}

+ + + {if $up_filename} @@ -226,4 +234,5 @@ +
\ No newline at end of file diff --git a/admin-dev/uploadProductFile.php b/admin-dev/uploadProductFile.php index 3e746af5a..18c71f46a 100644 --- a/admin-dev/uploadProductFile.php +++ b/admin-dev/uploadProductFile.php @@ -53,5 +53,5 @@ if (isset($_FILES['virtual_product_file']) AND is_uploaded_file($_FILES['virtual else { header('HTTP/1.1 500 Error'); - echo ''; + echo ''; } \ No newline at end of file