Bug 8215: FIX ergonomic issue : 'Unchanged()'
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / tools / quotes-upload.tt
index 2f0bf1a..2dc4af9 100644 (file)
@@ -1,14 +1,14 @@
     [% INCLUDE 'doc-head-open.inc' %]
     <title>Koha &rsaquo; Tools &rsaquo; Quote uploader</title>
     [% INCLUDE 'doc-head-close.inc' %]
-    <link rel="stylesheet" type="text/css" href="/intranet-tmpl/prog/en/css/uploader.css" />
-    <link rel="stylesheet" type="text/css" href="/intranet-tmpl/prog/en/css/datatables.css" />
-    <link rel="stylesheet" type="text/css" href="/intranet-tmpl/prog/en/css/quotes.css" />
-    <script type="text/javascript" src="/intranet-tmpl/prog/en/lib/jquery/plugins/jquery.dataTables.min.js"></script>
+    <link rel="stylesheet" type="text/css" href="[% themelang %]/css/uploader.css" />
+    <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
+    <link rel="stylesheet" type="text/css" href="[% themelang %]/css/quotes.css" />
+    <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script>
     [% INCLUDE 'datatables-strings.inc' %]
     </script>
-    <script type="text/javascript" src="/intranet-tmpl/prog/en/js/datatables.js"></script>
-    <script type="text/javascript" src="/intranet-tmpl/prog/en/js/jquery.jeditable.mini.js"></script>
+    <script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
+    <script type="text/javascript" src="[% themelang %]/js/jquery.jeditable.mini.js"></script>
     <script type="text/javascript">
     //<![CDATA[
     var oTable; //DataTable object
     var progress = document.querySelector('.percent');
     $("#server_response").hide();
 
+    function yuiGetData() {
+        fnGetData(document.getElementById('quotes_editor'));
+    }
+
     function fnAbortRead() {
         reader.abort();
     }
         $('#file_uploader').css("position","absolute");
         $('#file_uploader').css("top","-150px");
         $('#quotes_editor').css("visibility","visible");
-        oSaveButton.on("click", yuiGetData);
-        oDeleteButton.on("click", fnClickDeleteRow);
+        $("#save_quotes").on("click", yuiGetData);
+        $("#delete_quote").on("click", fnClickDeleteRow);
 
 
 
         var fileSizeInK = Math.round(evt.target.files[0].size/1024);
 
         if (!fileType.match(/comma-separated-values|csv|excel/i)) {
-            alert(_('Uploads limited to csv. Incorrect filetype: ')+fileType);
+            alert(_("Uploads limited to csv. Incorrect filetype: ")+fileType);
             parent.location='quotes-upload.pl';
             return;
         }
         if (fileSizeInK > 512) {
-            if (!confirm(evt.target.files[0].name+' '+fileSizeInK+_(' KB Do you really want to upload this file?'))) {
+            if (!confirm(evt.target.files[0].name+' '+fileSizeInK+_(" KB Do you really want to upload this file?"))) {
                 parent.location='quotes-upload.pl';
                 return;
             }
             success     : function(){
                             var response = JSON.parse(jqXHR.responseText);
                             if (response.success) {
-                                $("#server_response").text(response.records+_(' quotes saved.'));
+                                alert(response.records+_(" quotes saved."));
+                                window.location.reload(true);   // is this the best route?
                             }
                             else {
-                                $("#server_response").text(+response.records+_(' quotes saved, but an error has occurred. Please ask your administrator to check the server log for more details.'));
+                                alert(response.records+_(" quotes saved, but an error has occurred. Please ask your administrator to check the server log for more details."));
+                                window.location.reload(true);   // is this the best route?
                             }
-                            $("#server_response").fadeIn(200);
                           },
         });
     }
               return this.id;
         }).get().join(', ');
         if (!idsToDelete) {
-            alert(_('Please select a quote(s) by clicking the quote id(s) you desire to delete.'));
+            alert(_("Please select a quote(s) by clicking the quote id(s) you desire to delete."));
         }
-        else if (confirm(_('Are you sure you wish to delete quote(s) ')+idsToDelete+'?')) {
+        else if (confirm(_("Are you sure you wish to delete quote(s) ")+idsToDelete+"?")) {
             oTable.$('.selected').each(function(){
                 oTable.fnDeleteRow(this);
             });
         }
     }
 
-    function fnResetUpload() {
-        $('#server_response').fadeOut(200);
-        window.location.reload(true);   // is this the best route?
-    }
-
     //]]>
     </script>
 </head>
                         <div id="progress_bar"><div class="percent">0%</div></div>
                     </div>
                 </fieldset>
-                <div id="server_response" onclick='fnResetUpload()'>Server Response</div>
-                <table id="quotes_editor">
+                <table id="quotes_editor" style="visibility: hidden;">
                 <thead>
                     <tr>
                         <th>Source</th>
                     </tr>
                 </tbody>
                 </table>
-                <fieldset id="footer" class="action">
+                <fieldset id="footer" class="action" style="visibility: hidden;">
                 </fieldset>
             </div>
         </div>