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

(-)a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css (-11 / +6 lines)
Lines 1923-1937 fieldset.rows+h3 {clear:both;padding-top:.5em;} Link Here
1923
    z-index: 1;
1923
    z-index: 1;
1924
    width: 300px;
1924
    width: 300px;
1925
}
1925
}
1926
.import_export_options li{
1926
.import_export_options fieldset.rows li label {
1927
    display: block;
1927
    width : 16em;
1928
    list-style: none;
1929
    padding-top: 10px;
1930
}
1928
}
1931
.import_export_options .import_export_close {
1929
.form_import fieldset.rows li label {
1932
    cursor: pointer;
1930
    width : auto;
1933
    text-decoration: underline;
1934
}
1931
}
1932
1935
.import_export_options .export_ok {
1933
.import_export_options .export_ok {
1936
    padding: 10;
1934
    padding: 10;
1937
    background: #E3E3E3 none;
1935
    background: #E3E3E3 none;
Lines 1939-1945 fieldset.rows+h3 {clear:both;padding-top:.5em;} Link Here
1939
    margin-left: 20px;
1937
    margin-left: 20px;
1940
    border: none;
1938
    border: none;
1941
}
1939
}
1942
.import_export_options .import_ok {
1940
.import_export_options {
1943
    padding: 10;
1941
    padding: 10;
1944
    background: #E3E3E3 none;
1942
    background: #E3E3E3 none;
1945
    cursor: pointer;
1943
    cursor: pointer;
Lines 1953-1961 fieldset.rows+h3 {clear:both;padding-top:.5em;} Link Here
1953
    padding: inherit;
1951
    padding: inherit;
1954
    background: none;
1952
    background: none;
1955
}
1953
}
1956
.li_close_import_export {
1957
    text-align: right;
1958
}
1959
1954
1960
.importing {
1955
.importing {
1961
    position: relative;
1956
    position: relative;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/biblio_framework.tt (-40 / +45 lines)
Lines 67-72 $(document).ready(function() { Link Here
67
            if (!importing) {
67
            if (!importing) {
68
                $('.import_export_options').fadeOut('fast');
68
                $('.import_export_options').fadeOut('fast');
69
                $("body").css("cursor", "auto");
69
                $("body").css("cursor", "auto");
70
                return false;
70
            }
71
            }
71
        });
72
        });
72
        $('.input_import').val("");
73
        $('.input_import').val("");
Lines 75-83 $(document).ready(function() { Link Here
75
        if (matches && matches.length > 1) {
76
        if (matches && matches.length > 1) {
76
            alert(_("Error importing the framework ") + decodeURIComponent(matches[1]));
77
            alert(_("Error importing the framework ") + decodeURIComponent(matches[1]));
77
        }
78
        }
78
    });
79
79
    
80
    $(function() {
81
        $('input.input_import').change( function() {
80
        $('input.input_import').change( function() {
82
            var filename = $(this).val();
81
            var filename = $(this).val();
83
            if ( ! /(?:\.csv|\.sql|\.ods|\.xml)$/.test(filename)) {
82
            if ( ! /(?:\.csv|\.sql|\.ods|\.xml)$/.test(filename)) {
Lines 95-106 $(document).ready(function() { Link Here
95
            var id = $(this).attr('id');
94
            var id = $(this).attr('id');
96
            var obj = $('#' + id + ' input:file');
95
            var obj = $('#' + id + ' input:file');
97
            if (/(?:\.csv|\.sql|\.ods|\.xml)$/.test(obj.val())) {
96
            if (/(?:\.csv|\.sql|\.ods|\.xml)$/.test(obj.val())) {
98
                if (confirm('Do you really want to import the framework fields/subfields (will overwrite current configuration, for safety reasons please make before an export to have a backup file)?')) {
97
                if (confirm(_("Do you really want to import the framework fields and subfields? This will overwrite the current configuration. For safety reasons please use the export option to make a backup"))) {
99
                    var frameworkcode = $('#' + id + ' input:hidden[name=frameworkcode]').val();
98
                    var frameworkcode = $('#' + id + ' input:hidden[name=frameworkcode]').val();
100
                    $('#importing_' + frameworkcode).find("span").html("Importing <strong>" + frameworkcode + "</strong> from <i>" + obj.val().replace(new RegExp("^.+[/\\\\]"),"") + "</i>");
99
                    $('#importing_' + frameworkcode).find("span").html(_("Importing to framework:")+"<strong>" + frameworkcode + "</strong><br />" +_("Importing from file:")+"<i>" + obj.val().replace(new RegExp("^.+[/\\\\]"),"") + "</i>");
101
                    if (navigator.userAgent.toLowerCase().indexOf('msie') != -1) {
100
                    if (navigator.userAgent.toLowerCase().indexOf('msie') != -1) {
102
                        var timestamp = new Date().getTime();
101
                        var timestamp = new Date().getTime();
103
                        $('#importing_' + frameworkcode).find("img").attr('src', '/intranet-tmpl/prog/img/loading.gif' + '?' +timestamp);
102
                        $('#importing_' + frameworkcode).find("img").attr('src', '/intranet-tmpl/prog/img/loading-small.gif' + '?' +timestamp);
104
                    }
103
                    }
105
                    $('#importing_' + frameworkcode).css('display', 'block');
104
                    $('#importing_' + frameworkcode).css('display', 'block');
106
                    if (navigator.userAgent.toLowerCase().indexOf('firefox') == -1) $("body").css("cursor", "progress");
105
                    if (navigator.userAgent.toLowerCase().indexOf('firefox') == -1) $("body").css("cursor", "progress");
Lines 116-123 $(document).ready(function() { Link Here
116
            return false;
115
            return false;
117
        });
116
        });
118
    });
117
    });
119
    
120
    
121
118
122
</script>
119
</script>
123
120
Lines 200-214 $(document).ready(function() { Link Here
200
        <td><div class="import_export"><a class="import_export_fw" href="#" title="Export [% frameworkcode %] framework structure (fields, subfields) to a spreadsheet file (.csv, .xml, .ods) or SQL file">Export</a>
197
        <td><div class="import_export"><a class="import_export_fw" href="#" title="Export [% frameworkcode %] framework structure (fields, subfields) to a spreadsheet file (.csv, .xml, .ods) or SQL file">Export</a>
201
            <div class="import_export_options">
198
            <div class="import_export_options">
202
                <form action="import_export_framework.pl" name="form_[% frameworkcode %]" method="get" target="_blank"  class="form_export">
199
                <form action="import_export_framework.pl" name="form_[% frameworkcode %]" method="get" target="_blank"  class="form_export">
200
                    <fieldset class="rows">
201
                    <legend>Export framework</legend>
203
                    <input type="hidden" name="frameworkcode" value="[% frameworkcode %]" />
202
                    <input type="hidden" name="frameworkcode" value="[% frameworkcode %]" />
204
                    <ul>
203
                    <ol>
205
                        <li class="li_close_import_export"><span class="import_export_close" title="Close popup">Close</span></li>
204
                        <li><label for="csv_type_export_[% frameworkcode %]">Export to CSV spreadsheet</label><input type="radio" name="type_export_[% frameworkcode %]" value="csv" id="csv_type_export_[% frameworkcode %]" checked="checked" /></li>
206
                        <li><input type="radio" name="type_export_[% frameworkcode %]" value="csv" id="type_export_[% frameworkcode %]" checked="checked" /><label for="type_export_[% frameworkcode %]" title="Export to CSV spreadsheet">Export to CSV spreadsheet</label></li>
205
                        <li><label for="xml_type_export_[% frameworkcode %]">Export to Excel with XML format, compatible with OpenOffice/LibreOffice as well</label><input type="radio" name="type_export_[% frameworkcode %]" value="excel" id="xml_type_export_[% frameworkcode %]" /></li>
207
                        <li><input type="radio" name="type_export_[% frameworkcode %]" value="excel" id="type_export_[% frameworkcode %]" /><label for="type_export_[% frameworkcode %]" title="Export to Excel as XML format, compatible with OpenOffice/LibreOffice as well">Export to Excel with XML format</label></li>
206
                        <li><label for="ods_type_export_[% frameworkcode %]">Export to OpenDocument spreadsheet format</label><input type="radio" name="type_export_[% frameworkcode %]" value="ods" id="ods_type_export_[% frameworkcode %]" /></li>
208
                        <li><input type="radio" name="type_export_[% frameworkcode %]" value="ods" id="type_export_[% frameworkcode %]" /><label for="type_export_[% frameworkcode %]">Export to OpenDocument spreadsheet format</label></li>
207
                        <li><label for="sql_type_export_[% frameworkcode %]">Export to SQL</label><input type="radio" name="type_export_[% frameworkcode %]" value="sql" id="sql_type_export_[% frameworkcode %]" /></li>
209
                        <li><input type="radio" name="type_export_[% frameworkcode %]" value="sql" id="type_export_[% frameworkcode %]" /><label for="type_export_[% frameworkcode %]" title="Export to SQL">Export to SQL</label></li>
208
                    </ol>
210
                        <li><input type="submit" class="export_ok" href="#" value="Export" title="Export to a spreadsheet" /></li>
209
                    </fieldset>
211
                    </ul>
210
                    <fieldset class="action"><input type="button" href="#" value="Export" title="Export to a spreadsheet" /> <a href="#" class="import_export_close cancel">Cancel</a> </fieldset>
212
                </form>
211
                </form>
213
            </div>
212
            </div>
214
            </div>
213
            </div>
Lines 216-228 $(document).ready(function() { Link Here
216
        <td><div class="import_export"><a href="#" class="import_export_fw" title="Import [% frameworkcode %] framework structure (fields, subfields) from a spreadsheet file (.csv, .xml, .ods) or SQL file">Import</a>
215
        <td><div class="import_export"><a href="#" class="import_export_fw" title="Import [% frameworkcode %] framework structure (fields, subfields) from a spreadsheet file (.csv, .xml, .ods) or SQL file">Import</a>
217
            <div class="import_export_options">
216
            <div class="import_export_options">
218
                <form action="/cgi-bin/koha/admin/import_export_framework.pl" name="form_i_[% frameworkcode %]" id="form_i_[% frameworkcode %]" method="post" enctype="multipart/form-data" class="form_import">
217
                <form action="/cgi-bin/koha/admin/import_export_framework.pl" name="form_i_[% frameworkcode %]" id="form_i_[% frameworkcode %]" method="post" enctype="multipart/form-data" class="form_import">
218
                    <fieldset class="rows">
219
                    <legend>Import [% frameworkcode %] framework structure (fields and subfields) from a spreadsheet file (.csv, .xml, .ods) or SQL file</legend>
219
                    <input type="hidden" name="frameworkcode" value="[% frameworkcode %]" />
220
                    <input type="hidden" name="frameworkcode" value="[% frameworkcode %]" />
220
                    <input type="hidden" name="action" value="import" />
221
                    <input type="hidden" name="action" value="import" />
221
                    <ul>
222
                    <ol>
222
                        <li class="li_close_import_export"><span class="import_export_close" title="Close popup">Close</span></li>
223
                        <li><label for="d_file_import_[% frameworkcode %]">Upload file:</label><input type="file" name="file_import_[% frameworkcode %]" id="d_file_import_[% frameworkcode %]" class="input_import" value="" autocomplete="off" /></li>
223
                        <li><label for="file_import_[% frameworkcode %]" title="Import from a spreadsheet, formats available: ods, xml (formatted from excel)">Spreadsheet file</label><input type="file" name="file_import_[% frameworkcode %]" id="file_import_[% frameworkcode %]" class="input_import" value="" autocomplete="off" /></li>
224
                        <li><div id="importing_[% frameworkcode %]" style="display:none" class="importing"><img src="/intranet-tmpl/prog/img/loading-small.gif" /><span class="importing_msg"></span></div></li>
224
                        <li><input type="submit" class="import_ok" value="Import" title="Import from a spreadsheet" /><div id="importing_[% frameworkcode %]" style="display:none" class="importing"><img src="/intranet-tmpl/prog/img/loading.gif" /><span class="importing_msg"></span></div></li>
225
                    </ol>
225
                    </ul>
226
                    </fieldset>
227
                    <fieldset class="action"><input type="submit" value="Import" /> <a href="#" class="import_export_close cancel">Cancel</a> </fieldset>
226
                </form>
228
                </form>
227
            </div>
229
            </div>
228
            </div>
230
            </div>
Lines 230-270 $(document).ready(function() { Link Here
230
    </tr>
232
    </tr>
231
    <!-- note highlight assignment appears backwards because we already have a normal row for Default -->
233
    <!-- note highlight assignment appears backwards because we already have a normal row for Default -->
232
    [% FOREACH loo IN loop %]
234
    [% FOREACH loo IN loop %]
233
    [% IF ( loop.odd ) %]<tr class="highlight">
235
        [% IF ( loop.odd ) %]<tr class="highlight">
234
    [% ELSE %]<tr>
236
        [% ELSE %]<tr>
235
    [% END %]
237
        [% END %]
236
            <td>[% loo.frameworkcode %]</td>
238
            <td>[% loo.frameworkcode %]</td>
237
            <td>[% loo.frameworktext %]</td>
239
            <td>[% loo.frameworktext %]</td>
238
            <td><a href="marctagstructure.pl?frameworkcode=[% loo.frameworkcode %]" >MARC structure</a></td>
240
            <td><a href="marctagstructure.pl?frameworkcode=[% loo.frameworkcode %]" >MARC structure</a></td>
239
            <td><a href="[% loo.script_name %]?op=add_form&amp;frameworkcode=[% loo.frameworkcode |html %]">Edit</a></td>
241
            <td><a href="[% loo.script_name %]?op=add_form&amp;frameworkcode=[% loo.frameworkcode |html %]">Edit</a></td>
240
            <td><a href="[% loo.script_name %]?op=delete_confirm&amp;frameworkcode=[% loo.frameworkcode |html %]">Delete</a></td>
242
            <td><a href="[% loo.script_name %]?op=delete_confirm&amp;frameworkcode=[% loo.frameworkcode |html %]">Delete</a></td>
241
            <td>
243
            <td>
242
            <div class="import_export"><a class="import_export_fw" href="#" title="Export [% loo.frameworkcode %] framework structure (fields, subfields) to a spreadsheet file (.csv, .xml, .ods) or SQL file">Export</a>
244
            <div class="import_export"><a class="import_export_fw" href="#" title="Export [% loo.frameworkcode %] framework structure (fields and subfields) to a spreadsheet file (.csv, .xml, .ods) or SQL file">Export</a>
243
                <div class="import_export_options">
245
                <div class="import_export_options">
244
                    <form action="import_export_framework.pl" name="form_[% loo.frameworkcode %]" method="get" target="_blank" class="form_export">
246
                    <form action="import_export_framework.pl" name="form_[% loo.frameworkcode %]" method="get" target="_blank" class="form_export">
247
                        <fieldset class="rows">
248
                        <legend>Export framework</legend>
245
                        <input type="hidden" name="frameworkcode" value="[% loo.frameworkcode %]" />
249
                        <input type="hidden" name="frameworkcode" value="[% loo.frameworkcode %]" />
246
                        <ul>
250
                        <ol>
247
                            <li class="li_close_import_export"><span class="import_export_close" title="Close popup">Close</span></li>
251
                            <li><label for="csv_type_export_[% loo.frameworkcode %][% loop.count %]">Export to CSV spreadsheet</label><input type="radio" name="type_export_[% loo.frameworkcode %]" value="csv" id="csv_type_export_[% loo.frameworkcode %][% loop.count %]" checked="checked" /></li>
248
                            <li><input type="radio" name="type_export_[% loo.frameworkcode %]" value="csv" id="type_export_[% loo.frameworkcode %]" checked="checked" /><label for="type_export_[% loo.frameworkcode %]" title="Export to CSV spreadsheet">Export to CSV spreadsheet</label></li>
252
                            <li><label for="xml_type_export_[% loo.frameworkcode %][% loop.count %]">Export to Excel as XML format, compatible with OpenOffice/LibreOffice as well</label><input type="radio" name="type_export_[% loo.frameworkcode %]" value="excel" id="xml_type_export_[% loo.frameworkcode %][% loop.count %]" /></li>
249
                            <li><input type="radio" name="type_export_[% loo.frameworkcode %]" value="excel" id="type_export_[% loo.frameworkcode %]" /><label for="type_export_[% loo.frameworkcode %]" title="Export to Excel as XML format, compatible with OpenOffice/LibreOffice as well">Export to Excel as XML format</label></li>
253
                            <li><label for="ods_type_export_[% loo.frameworkcode %][% loop.count %]">Export to OpenDocument spreadsheet format</label><input type="radio" name="type_export_[% loo.frameworkcode %]" value="ods" id="ods_type_export_[% loo.frameworkcode %][% loop.count %]" /></li>
250
                            <li><input type="radio" name="type_export_[% loo.frameworkcode %]" value="ods" id="type_export_[% loo.frameworkcode %]" /><label for="type_export_[% loo.frameworkcode %]">Export to OpenDocument spreadsheet format</label></li>
254
                            <li><label for="sql_type_export_[% loo.frameworkcode %][% loop.count %]">Export to SQL</label><input type="radio" name="type_export_[% loo.frameworkcode %]" value="sql" id="sql_type_export_[% loo.frameworkcode %][% loop.count %]" /></li>
251
                            <li><input type="radio" name="type_export_[% loo.frameworkcode %]" value="sql" id="type_export_[% loo.frameworkcode %]" /><label for="type_export_[% loo.frameworkcode %]" title="Export to SQL">Export to SQL</label></li>
255
                        </ol>
252
                            <li><input type="submit" class="export_ok" href="#" value="Export" title="Export to a spreadsheet" /></li>
256
                        </fieldset>
253
                        </ul>
257
                        <fieldset class="action"><input type="submit" href="#" value="Export" title="Export to a spreadsheet" /> <a href="#" class="cancel import_export_close">Cancel</a> </fieldset>
254
                    </form>
258
                    </form>
255
                </div>
259
                </div>
256
                </div>
260
                </div>
257
            </td>
261
            </td>
258
            <td><div class="import_export"><a class="import_export_fw" href="#" title="Import [% loo.frameworkcode %] framework structure (fields, subfields) from a spreadsheet file (.csv, .xml, .ods) or SQL file">Import</a>
262
            <td><div class="import_export"><a class="import_export_fw" href="#" title="Import [% loo.frameworkcode %] framework structure (fields and subfields) from a spreadsheet file (.csv, .xml, .ods) or SQL file">Import</a>
259
            <div class="import_export_options">
263
            <div class="import_export_options">
260
                <form action="/cgi-bin/koha/admin/import_export_framework.pl" name="form_i_[% loo.frameworkcode %]" id="form_i_[% loo.frameworkcode %]" method="post" enctype="multipart/form-data" class="form_import">
264
                <form action="/cgi-bin/koha/admin/import_export_framework.pl" name="form_i_[% loo.frameworkcode %]" id="form_i_[% loo.frameworkcode %]" method="post" enctype="multipart/form-data" class="form_import">
265
                    <fieldset class="rows">
266
                    <legend>Import [% frameworkcode %] framework structure (fields and subfields) from a spreadsheet file (.csv, .xml, .ods) or SQL file</legend>
261
                    <input type="hidden" name="frameworkcode" value="[% loo.frameworkcode %]" />
267
                    <input type="hidden" name="frameworkcode" value="[% loo.frameworkcode %]" />
262
                    <input type="hidden" name="action" value="import" />
268
                    <input type="hidden" name="action" value="import" />
263
                    <ul>
269
                    <ol>
264
                        <li class="li_close_import_export"><span class="import_export_close" title="Close popup">Close</span></li>
270
                        <li><label for="file_import_[% loo.frameworkcode %]">Upload file:</label><input type="file" name="file_import_[% loo.frameworkcode %]" id="file_import_[% loo.frameworkcode %]" class="input_import" value="" autocomplete="off" /></li>
265
                        <li><label for="file_import_[% loo.frameworkcode %]" title="Import from a spreadsheet, formats available: ods, xml (formatted from excel)">Spreadsheet file</label><input type="file" name="file_import_[% loo.frameworkcode %]" id="file_import_[% loo.frameworkcode %]" class="input_import" value="" autocomplete="off" /></li>
271
                    </ol>
266
                        <li><input type="submit" class="import_ok" value="Import" title="Import from a spreadsheet" /><div id="importing_[% loo.frameworkcode %]" style="display:none" class="importing"><img src="/intranet-tmpl/prog/img/loading.gif" /><span class="importing_msg"></span></div></li>
272
                    </fieldset>
267
                    </ul>
273
                    <fieldset class="action"><input type="submit" value="Import" /><div id="importing_[% loo.frameworkcode %]" style="display:none" class="importing"><img src="/intranet-tmpl/prog/img/loading-small.gif" /><span class="importing_msg"></span></div> <a href="#" class="cancel import_export_close">Cancel</a> </fieldset>
268
                </form>
274
                </form>
269
            </div>
275
            </div>
270
            </div>
276
            </div>
271
- 

Return to bug 9545