From 6b7b625bafaffdb620c6df5c2e627f293aaa507f Mon Sep 17 00:00:00 2001
From: Julian Maurice <julian.maurice@biblibre.com>
Date: Thu, 16 Aug 2012 11:15:00 +0200
Subject: [PATCH] [PASSED QA] Bug 6874: Allow to reupload a file immediately
 after deletion

This patch adds a button "Upload a new file" after the "sucessful
deletion" message to avoid user to close and reopen the window.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
---
 .../value_builder/upload_delete_file.tt            |   15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/upload_delete_file.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/upload_delete_file.tt
index 2da616e..7817bbe 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/upload_delete_file.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/upload_delete_file.tt
@@ -6,6 +6,15 @@
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     <script type="text/javascript" src="[% themelang %]/lib/jquery/jquery.js"></script>
     <link rel="stylesheet" type="text/css" href="[% themelang %]/css/staff-global.css" />
+    <script type="text/javascript">
+        //<![CDATA[
+        function goToUploadPage() {
+            var url = "/cgi-bin/koha/cataloguing/plugin_launcher.pl?"
+                + "plugin_name=upload.pl&index=[% index %]";
+            window.location.href = url;
+        }
+        //]]>
+    </script>
 
 </head>
 <body>
@@ -22,8 +31,10 @@
         });
     </script>
 
-    The file has been successfully deleted.
-    <p><input type="button" value="close" onclick="window.close();" /></p>
+    <p>The file has been successfully deleted.</p>
+
+    <input type="button" value="Upload a new file" onclick="goToUploadPage();" />
+    <input type="button" value="Close" onclick="window.close();" />
 
 [% ELSE %]
 
-- 
1.7.9.5