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

(-)a/koha-tmpl/intranet-tmpl/prog/en/css/datatables.css (+9 lines)
Lines 191-196 div.dataTables_paginate.paging_four_button { Link Here
191
    width: 250px;
191
    width: 250px;
192
}
192
}
193
193
194
.delete, .save, .cancel {
195
    border-radius: 5px;
196
    margin: 1px;
197
}
198
199
input {
200
    border-radius: 5px;
201
}
202
194
/*
203
/*
195
table.display {
204
table.display {
196
    width: 100%;
205
    width: 100%;
(-)a/koha-tmpl/intranet-tmpl/prog/en/css/uploader.css (-4 / +15 lines)
Lines 10-21 Link Here
10
  -webkit-transition: opacity 1s linear;
10
  -webkit-transition: opacity 1s linear;
11
}
11
}
12
#progress_bar.loading {
12
#progress_bar.loading {
13
  opacity: 1.0;
13
    opacity: 1.0;
14
}
14
}
15
#progress_bar .percent {
15
#progress_bar .percent {
16
  background-color: #99ccff;
16
    color: #E6F0F2;
17
  height: auto;
17
    background-color: #004D99;
18
  width: 0;
18
    height: auto;
19
    width: 0;
19
}
20
}
20
#server_response {
21
#server_response {
21
    background-color: white;
22
    background-color: white;
Lines 36-38 Link Here
36
    top: 50%;
37
    top: 50%;
37
    width: 250px;
38
    width: 250px;
38
}
39
}
40
41
#file_uploader {
42
    position: relative;
43
    top: -24px;
44
}
45
46
#file_upload {
47
    position: relative;
48
    top: -1px;
49
}
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/quotes-upload.tt (-14 / +19 lines)
Lines 134-147 Link Here
134
        for(var i=0; i<aaData.length; i++) {
134
        for(var i=0; i<aaData.length; i++) {
135
            aaData[i].push('Delete'); //this is hackish FIXME
135
            aaData[i].push('Delete'); //this is hackish FIXME
136
        }
136
        }
137
        document.getElementById('quotes_editor').style.visibility="visible";
137
        document.getElementById('save_quotes').style.visibility="visible";
138
        document.getElementById('file_uploader').style.visibility="hidden";
138
        document.getElementById('file_uploader').style.visibility="hidden";
139
        document.getElementById('quotes_editor').style.visibility="visible";
139
        oTable = $('#quotes_editor').dataTable( {
140
        oTable = $('#quotes_editor').dataTable( {
140
            "bAutoWidth"        : false,
141
            "bAutoWidth"        : false,
141
            "bPaginate"         : true,
142
            "bPaginate"         : true,
142
            "bSort"             : false,
143
            "bSort"             : false,
143
            "sPaginationType"   : "full_numbers",
144
            "sPaginationType"   : "full_numbers",
144
            "sDom"              : '<"save_quotes">frtip',
145
            "aaData"            : aaData,
145
            "aaData"            : aaData,
146
            "aoColumns"         : [
146
            "aoColumns"         : [
147
                {
147
                {
Lines 162-168 Link Here
162
            },
162
            },
163
            "fnRowCallback": function( nRow, aData, iDisplayIndex ) {
163
            "fnRowCallback": function( nRow, aData, iDisplayIndex ) {
164
                noEditFields = [2]; /* action */
164
                noEditFields = [2]; /* action */
165
                /* console.log('Quote ID: '+quoteID); */
166
                /* do foo on various cells in the current row */
165
                /* do foo on various cells in the current row */
167
                $('td:eq(2)', nRow).html('<input type="button" class="delete" value="Delete" onclick="fnClickDeleteRow(this.parentNode);" />');
166
                $('td:eq(2)', nRow).html('<input type="button" class="delete" value="Delete" onclick="fnClickDeleteRow(this.parentNode);" />');
168
                /* apply no_edit id to noEditFields */
167
                /* apply no_edit id to noEditFields */
Lines 184-192 Link Here
184
                                      },
183
                                      },
185
                    "height"        : "14px",
184
                    "height"        : "14px",
186
                });
185
                });
187
                $("div.save_quotes").html('<input type="button" class="add_quote_button" value="Save Quotes" style="float: right;" onclick="fnGetData(document.getElementById(\'quotes_editor\'));"/>');
188
           },
186
           },
189
        });
187
        });
188
        document.getElementById('footer').style.visibility="visible";
190
    }
189
    }
191
190
192
    function fnHandleFileSelect(evt) {
191
    function fnHandleFileSelect(evt) {
Lines 201-213 Link Here
201
            alert('File read cancelled');
200
            alert('File read cancelled');
202
        };
201
        };
203
        reader.onloadstart = function(e) {
202
        reader.onloadstart = function(e) {
203
            document.getElementById('cancel_upload').style.visibility="visible";
204
            document.getElementById('progress_bar').className = 'loading';
204
            document.getElementById('progress_bar').className = 'loading';
205
        };
205
        };
206
        reader.onload = function(e) {
206
        reader.onload = function(e) {
207
            // Ensure that the progress bar displays 100% at the end.
207
            // Ensure that the progress bar displays 100% at the end.
208
            progress.style.width = '100%';
208
            progress.style.width = '100%';
209
            progress.textContent = '100%';
209
            progress.textContent = '100%';
210
            setTimeout("document.getElementById('progress_bar').className='';", 2000);
210
            document.getElementById('cancel_upload').style.visibility="hidden";
211
            quotes = fnCSVToArray(e.target.result, ',');
211
            quotes = fnCSVToArray(e.target.result, ',');
212
            fnDataTable(quotes);
212
            fnDataTable(quotes);
213
        }
213
        }
Lines 215-221 Link Here
215
        reader.readAsText(evt.target.files[0]);
215
        reader.readAsText(evt.target.files[0]);
216
    }
216
    }
217
217
218
    document.getElementById('files').addEventListener('change', fnHandleFileSelect, false);
218
    //document.getElementById('file_upload').addEventListener('change', fnHandleFileSelect, false);
219
    $('#file_upload').one('change', fnHandleFileSelect);
219
220
220
    });
221
    });
221
222
Lines 264-274 Link Here
264
    <div id="bd">
265
    <div id="bd">
265
        <div id="yui-main">
266
        <div id="yui-main">
266
            <div class="yui-b">
267
            <div class="yui-b">
267
268
                <div id="toolbar" style="height:61px;">
268
                <div id="file_uploader" style="float: left; width: 100%; visibility:visible;">
269
                    <div id="save_quotes" style="visibility:hidden;">
269
                    <input type="file" id="files" name="file" />
270
                        <input type="button" class="add_quote_button" value="Save Quotes" style="border-radius: 5px;" onclick="fnGetData(document.getElementById(\'quotes_editor\'));"/>
270
                    <button onclick="fnAbortRead();">Cancel Upload</button>
271
                        <span class="hint">Click on any field to edit contents</span>
271
                    <div id="progress_bar"><div class="percent">0%</div></div>
272
                    </div>
273
                    <div id="file_uploader" class="file_uploader" style="visibility:visible;">
274
                        <input id="file_upload" type="file" name="file" />
275
                        <button id="cancel_upload" style="visibility:hidden;" onclick="fnAbortRead();">Cancel Upload</button>
276
                        <div id="progress_bar"><div class="percent">0%</div></div>
277
                    </div>
272
                </div>
278
                </div>
273
                <div id="server_response" onclick='fnResetUpload()'>Server Response</div>
279
                <div id="server_response" onclick='fnResetUpload()'>Server Response</div>
274
                <table id="quotes_editor" style="float: left; width: 100%; visibility:hidden;">
280
                <table id="quotes_editor" style="float: left; width: 100%; visibility:hidden;">
Lines 288-296 Link Here
288
                    </tr>
294
                    </tr>
289
                </tbody>
295
                </tbody>
290
                </table>
296
                </table>
291
297
                <fieldset id="footer" class="action" style="visibility:hidden; height:25px">
292
298
                </fieldset>
293
294
            </div>
299
            </div>
295
        </div>
300
        </div>
296
    <div class="yui-b noprint">
301
    <div class="yui-b noprint">
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/quotes.tt (-6 / +14 lines)
Lines 21-32 Link Here
21
                    "sAjaxSource"       : "/cgi-bin/koha/tools/quotes/quotes_ajax.pl",
21
                    "sAjaxSource"       : "/cgi-bin/koha/tools/quotes/quotes_ajax.pl",
22
                    "aoColumns"         : [
22
                    "aoColumns"         : [
23
                                            { "sWidth": "3%"  },
23
                                            { "sWidth": "3%"  },
24
                                            { "sWidth": "12%" },
24
                                            { "sWidth": "11%" },
25
                                            { "sWidth": "65%" },
25
                                            { "sWidth": "65%" },
26
                                            { "sWidth": "10%" },
26
                                            { "sWidth": "10%" },
27
                                            { "sWidth": "10%" },
27
                                            { "sWidth": "11%" },
28
                                          ],
28
                                          ],
29
                   "sDom"               : '<"add_quote">frtip',
30
                   "oLanguage"          : {
29
                   "oLanguage"          : {
31
                                            "sEmptyTable": sEmptyTable,
30
                                            "sEmptyTable": sEmptyTable,
32
                                          },
31
                                          },
Lines 64-70 Link Here
64
                        });
63
                        });
65
                   },
64
                   },
66
        });
65
        });
67
        $("div.add_quote").html('<input type="button" class="add_quote_button" value="Add Quote" style="float: right;" onclick="fnClickAddRow();"/><input type="button" class="import_quote_button" value="Import Quotes" style="float: right;" onclick="parent.location=\'quotes-upload.pl\'"/>');
68
    });
66
    });
69
67
70
        function fnClickAddQuote() {
68
        function fnClickAddQuote() {
Lines 155-161 Link Here
155
    <div id="bd">
153
    <div id="bd">
156
        <div id="yui-main">
154
        <div id="yui-main">
157
            <div class="yui-b">
155
            <div class="yui-b">
158
                <table id="quotes_editor" style="float: left; width: 100%">
156
                <div id="toolbar">
157
                <ul class="toolbar">
158
                <li>
159
                    <input type="button" class="add_quote_button" value="Add Quote" style="border-radius: 5px;" onclick="fnClickAddRow();"/>
160
                    <input type="button" class="import_quote_button" value="Import Quotes" style="border-radius: 5px;" onclick="parent.location='quotes-upload.pl'"/>
161
                    <span class="hint" style="">Click Source or Text field to edit contents</span>
162
                </li>
163
                </ul>
164
                </div>
165
                <table id="quotes_editor" style="float: left; width: 100%;">
159
                <thead>
166
                <thead>
160
                    <tr>
167
                    <tr>
161
                        <th>ID</th>
168
                        <th>ID</th>
Lines 176-181 Link Here
176
                    </tr>
183
                    </tr>
177
                </tbody>
184
                </tbody>
178
                </table>
185
                </table>
186
                <fieldset id="footer" class="action" style="height:25px;">
187
                </fieldset>
179
            </div>
188
            </div>
180
        </div>
189
        </div>
181
    <div class="yui-b noprint">
190
    <div class="yui-b noprint">
182
- 

Return to bug 7977