View | Details | Raw Unified | Return to bug 16513
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/quotes-upload-toolbar.inc (-1 / +2 lines)
Lines 1-4 Link Here
1
<div id="toolbar" class="btn-toolbar" style="visibility: hidden; position: absolute">
1
<div id="toolbar" class="btn-toolbar" style="visibility: hidden; position: absolute">
2
        <div class="btn-group"><a class="btn btn-small" id="save_quotes" href="#"><i class="fa fa-save"></i> Save quotes</a></div>
2
        <div class="btn-group"><a class="btn btn-small" id="save_quotes" href="#"><i class="fa fa-save"></i> Save quotes</a></div>
3
        <div class="btn-group"><a class="btn btn-small" id="delete_quote" href="#"><i class="fa fa-remove"></i> Delete quote(s)</a></div>
3
        <div class="btn-group"><a class="btn btn-small" id="delete_quote" href="#"><i class="fa fa-trash"></i> Delete quote(s)</a></div>
4
        <div class="btn-group"><a href="/cgi-bin/koha/tools/quotes-upload.pl" id="cancel_quotes" class="btn btn-small"><i class="fa fa-remove"></i> Cancel import</a></div>
4
</div>
5
</div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/quotes-upload.tt (-3 / +11 lines)
Lines 11-16 Link Here
11
    var oTable; //DataTable object
11
    var oTable; //DataTable object
12
    $(document).ready(function() {
12
    $(document).ready(function() {
13
13
14
        $("#cancel_upload").on("click",function(e){
15
            e.preventDefault();
16
            fnAbortRead();
17
        });
18
        $("#cancel_quotes").on("click",function(){
19
            return confirm( _("Are you sure you want to cancel this import?") );
20
        });
21
14
    // Credits:
22
    // Credits:
15
    // FileReader() code copied and hacked from:
23
    // FileReader() code copied and hacked from:
16
    // http://www.html5rocks.com/en/tutorials/file/dndfiles/
24
    // http://www.html5rocks.com/en/tutorials/file/dndfiles/
Lines 222-235 Link Here
222
            parent.location='quotes-upload.pl';
230
            parent.location='quotes-upload.pl';
223
        };
231
        };
224
        reader.onloadstart = function(e) {
232
        reader.onloadstart = function(e) {
225
            $('#cancel_upload').css("visibility","visible");
233
            $('#cancel_upload').show();
226
            $('#progress_bar').addClass("loading");
234
            $('#progress_bar').addClass("loading");
227
        };
235
        };
228
        reader.onload = function(e) {
236
        reader.onload = function(e) {
229
            // Ensure that the progress bar displays 100% at the end.
237
            // Ensure that the progress bar displays 100% at the end.
230
            progress.style.width = '100%';
238
            progress.style.width = '100%';
231
            progress.textContent = '100%';
239
            progress.textContent = '100%';
232
            $('#cancel_upload').css("visibility","hidden");
240
            $('#cancel_upload').hide();
233
            quotes = fnCSVToArray(e.target.result, ',');
241
            quotes = fnCSVToArray(e.target.result, ',');
234
            fnDataTable(quotes);
242
            fnDataTable(quotes);
235
        }
243
        }
Lines 333-339 Link Here
333
                    <legend>Upload quotes</legend>
341
                    <legend>Upload quotes</legend>
334
                    <div id="file_upload">
342
                    <div id="file_upload">
335
                        <input type="file" name="file" />
343
                        <input type="file" name="file" />
336
                        <button id="cancel_upload" style="visibility:hidden;" onclick="fnAbortRead();">Cancel Upload</button>
344
                        <button id="cancel_upload" style="display:none">Cancel upload</button>
337
                        <div id="progress_bar"><div class="percent">0%</div></div>
345
                        <div id="progress_bar"><div class="percent">0%</div></div>
338
                    </div>
346
                    </div>
339
                </fieldset>
347
                </fieldset>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/quotes.tt (-4 / +6 lines)
Lines 8-14 Link Here
8
    <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.jeditable.mini.js"></script>
8
    <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.jeditable.mini.js"></script>
9
    <script type="text/javascript">
9
    <script type="text/javascript">
10
    //<![CDATA[
10
    //<![CDATA[
11
    var MSG_ID_HELP = _("Click on the quote's id to select or deselect the quote. Multiple quotes may be selected.");
12
11
13
    var oTable; /* oTable needs to be global */
12
    var oTable; /* oTable needs to be global */
14
    var sEmptyTable = _("No quotes available. Please use the 'Add quote' button to add a quote."); /* override the default message in datatables.inc */
13
    var sEmptyTable = _("No quotes available. Please use the 'Add quote' button to add a quote."); /* override the default message in datatables.inc */
Lines 90-95 Link Here
90
            fnClickDeleteRow();
89
            fnClickDeleteRow();
91
            return false;
90
            return false;
92
        });
91
        });
92
        $("#id_help").on("click",function(e){
93
            e.stopPropagation();
94
            alert( _("Click on the quote's id to select or deselect the quote. Multiple quotes may be selected.") );
95
        });
93
    });
96
    });
94
97
95
        function fnClickAddQuote(e, node) {
98
        function fnClickAddQuote(e, node) {
Lines 190-196 Link Here
190
[% INCLUDE 'header.inc' %]
193
[% INCLUDE 'header.inc' %]
191
[% INCLUDE 'cat-search.inc' %]
194
[% INCLUDE 'cat-search.inc' %]
192
195
193
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo; Quote Editor</div>
196
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo; Quote editor</div>
194
197
195
<div id="doc3" class="yui-t2">
198
<div id="doc3" class="yui-t2">
196
    <div id="bd">
199
    <div id="bd">
Lines 215-221 Link Here
215
                <table id="quotes_editor">
218
                <table id="quotes_editor">
216
                <thead>
219
                <thead>
217
                    <tr>
220
                    <tr>
218
                        <th><span style="cursor: help" onclick="event.stopPropagation();alert(MSG_ID_HELP);">ID</span></th>
221
                        <th><span style="cursor: help" id="id_help">ID</span></th>
219
                        <th>Source</th>
222
                        <th>Source</th>
220
                        <th>Text</th>
223
                        <th>Text</th>
221
                        <th>Last displayed</th>
224
                        <th>Last displayed</th>
222
- 

Return to bug 16513