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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/biblio_framework.tt (-99 / +98 lines)
Lines 17-23 Link Here
17
    $(document).ready(function() {
17
    $(document).ready(function() {
18
        $("#table_biblio_frameworks").dataTable($.extend(true, {}, dataTablesDefaults, {
18
        $("#table_biblio_frameworks").dataTable($.extend(true, {}, dataTablesDefaults, {
19
            "aoColumnDefs": [
19
            "aoColumnDefs": [
20
                { "aTargets": [ -1, -2, -3, -4, -5 ], "bSortable": false, "bSearchable": false },
20
                { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
21
                { "aTargets": [ 0, 1 ], "sType": "natural" },
21
                { "aTargets": [ 0, 1 ], "sType": "natural" },
22
            ],
22
            ],
23
            "bSort": true,
23
            "bSort": true,
Lines 63-68 Link Here
63
        $('form.form_import').submit(function() {
63
        $('form.form_import').submit(function() {
64
            var id = $(this).attr('id');
64
            var id = $(this).attr('id');
65
            var obj = $('#' + id + ' input:file');
65
            var obj = $('#' + id + ' input:file');
66
            alert(obj.val());
66
            if (/(?:\.csv|\.ods|\.xml)$/.test(obj.val())) {
67
            if (/(?:\.csv|\.ods|\.xml)$/.test(obj.val())) {
67
                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"))) {
68
                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"))) {
68
                    var frameworkcode = $('#' + id + ' input:hidden[name=frameworkcode]').val();
69
                    var frameworkcode = $('#' + id + ' input:hidden[name=frameworkcode]').val();
Lines 205-275 Link Here
205
        <th>Code</th>
206
        <th>Code</th>
206
        <th>Description</th>
207
        <th>Description</th>
207
        <th>&nbsp;</th>
208
        <th>&nbsp;</th>
208
        <th>Edit</th>
209
        <th>Delete</th>
210
        <th title="Export framework structure (fields, subfields) to a spreadsheet file (.csv, .xml, .ods)">Export</th>
211
        <th title="Import framework structure (fields, subfields) from a spreadsheet file (.csv, .xml, .ods)">Import</th>
212
    </tr>
209
    </tr>
213
    </thead>
210
    </thead>
214
    <tbody>
211
    <tbody>
215
    <tr>
212
    <tr>
216
        <td>&nbsp;</td>
213
        <td>&nbsp;</td>
217
        <td>Default framework</td>
214
        <td>Default framework</td>
218
        <td><a href="marctagstructure.pl?frameworkcode=">MARC structure</a></td>
219
        <td>&nbsp;</td>
220
        <td>&nbsp;</td>
221
        <td>
215
        <td>
222
216
          <div class="dropdown">
223
            <!-- Button to trigger modal -->
217
            <a class="btn btn-mini dropdown-toggle" id="frameworkactions[% loo.frameworkcode %]" role="button" data-toggle="dropdown" href="#">
224
            <a href="#" data-toggle="modal" data-target="#exportModal_default">Export</a>
218
              Actions <b class="caret"></b>
225
            <!-- Modal -->
219
            </a>
220
            <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="frameworkactions[% loo.frameworkcode %]">
221
              <li><a href="marctagstructure.pl?frameworkcode="><i class="fa fa-eye"></i> MARC structure</a></li>
222
              <!-- Trigger modal -->
223
              <li><a href="#" data-toggle="modal" data-target="#exportModal_default" title="Export framework structure (fields, subfields) to a spreadsheet file (.csv, .xml, .ods)"><i class="fa fa-upload"></i> Export</a></li>
224
              <!-- Trigger modal -->
225
              <li><a href="#" data-toggle="modal" data-target="#importModal_[% framework.frameworkcode %][% frameworks.count %]" title="Import framework structure (fields, subfields) from a spreadsheet file (.csv, .xml, .ods)"><i class="fa fa-download"></i> Import</a></li>
226
            </ul>
227
            <!-- Modal to export default framework -->
226
            <div class="modal hide" id="exportModal_default" tabindex="-1" role="dialog" aria-labelledby="exportLabelexportModal_default" aria-hidden="true">
228
            <div class="modal hide" id="exportModal_default" tabindex="-1" role="dialog" aria-labelledby="exportLabelexportModal_default" aria-hidden="true">
227
                <div class="modal-header">
229
              <div class="modal-header">
228
                    <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
230
                <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
229
                    <h3 id="exportLabelexportModal_default">Export default framework</h3>
231
                <h3 id="exportLabelexportModal_default">Export default framework</h3>
232
              </div>
233
              <form action="import_export_framework.pl" name="form_defaul" method="get" target="_blank"  class="form_export">
234
                <div class="modal-body">
235
                  <fieldset>
236
                    <input type="hidden" name="frameworkcode" value="" />
237
                    <p><label for="csv_type_export_default"><input type="radio" name="type_export_default" value="csv" id="csv_type_export_default" checked="checked" /> Export to CSV spreadsheet</label></p>
238
                    <p><label for="xml_type_export_default"><input type="radio" name="type_export_default" value="excel" id="xml_type_export_default" /> Export to Excel with XML format, compatible with OpenOffice/LibreOffice as well</label></p>
239
                    <p><label for="ods_type_export_default"><input type="radio" name="type_export_default" value="ods" id="ods_type_export_default" /> Export to OpenDocument spreadsheet format</label></p>
240
                  </fieldset>
230
                </div>
241
                </div>
231
                <form action="import_export_framework.pl" name="form_defaul" method="get" target="_blank"  class="form_export">
242
                <div class="modal-footer">
232
                    <div class="modal-body">
243
                  <button type="submit" class="btn">Export</button>
233
                        <fieldset>
244
                  <button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Cancel</button>
234
                            <input type="hidden" name="frameworkcode" value="" />
245
                </div>
235
                            <p><label for="csv_type_export_default"><input type="radio" name="type_export_defaul" value="csv" id="csv_type_export_default" checked="checked" /> Export to CSV spreadsheet</label></p>
246
              </form>
236
                            <p><label for="xml_type_export_default"><input type="radio" name="type_export_default" value="excel" id="xml_type_export_default" /> Export to Excel with XML format, compatible with OpenOffice/LibreOffice as well</label></p>
237
                            <p><label for="ods_type_export_default"><input type="radio" name="type_export_default" value="ods" id="ods_type_export_default" /> Export to OpenDocument spreadsheet format</label></p>
238
239
                        </fieldset>
240
                    </div>
241
                    <div class="modal-footer">
242
                        <button type="submit" class="btn">Export</button>
243
                        <button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Cancel</button>
244
                    </div>
245
                </form>
246
            </div>
247
            </div>
247
248
248
        </td>
249
            <!-- Modal to import default framework -->
249
        <td>
250
251
            <!-- Button to trigger modal -->
252
            <a href="#" data-toggle="modal" data-target="#importModal_[% framework.frameworkcode %][% frameworks.count %]">Import</a>
253
            <!-- Modal -->
254
            <div class="modal hide" id="importModal_[% framework.frameworkcode %][% frameworks.count %]" tabindex="-1" role="dialog" aria-labelledby="importLabelexportModal_default[% frameworks.count %]" aria-hidden="true">
250
            <div class="modal hide" id="importModal_[% framework.frameworkcode %][% frameworks.count %]" tabindex="-1" role="dialog" aria-labelledby="importLabelexportModal_default[% frameworks.count %]" aria-hidden="true">
255
                <div class="modal-header">
251
              <div class="modal-header">
256
                    <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
252
                <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
257
                    <h3 id="importLabelexportModal_[% framework.frameworkcode %][% frameworks.count %]">Import default framework structure (fields and subfields) from a spreadsheet file (.csv, .xml, .ods)</h3>
253
                <h3 id="importLabelexportModal_[% framework.frameworkcode %][% frameworks.count %]">Import default framework structure (fields and subfields) from a spreadsheet file (.csv, .xml, .ods)</h>
254
              </div>
255
              <form action="/cgi-bin/koha/admin/import_export_framework.pl" name="form_i_default" id="form_i_default" method="post" enctype="multipart/form-data" class="form_import">
256
                <div class="modal-body">
257
                  <input type="hidden" name="frameworkcode" value="default" />
258
                  <input type="hidden" name="action" value="import" />
259
                  <p><label for="file_import_default">Upload file:</label> <input type="file" name="file_import_default" id="file_import_default" class="input_import" /></p>
260
                    <div id="importing_default" style="display:none" class="importing"><img src="[% interface %]/[% theme %]/img/loading-small.gif" alt="" /><span class="importing_msg"></span></div>
258
                </div>
261
                </div>
259
                <form action="/cgi-bin/koha/admin/import_export_framework.pl" name="form_i_default" id="form_i_default" method="post" enctype="multipart/form-data" class="form_import">
262
                <div class="modal-footer">
260
                    <div class="modal-body">
263
                  <button type="submit" class="btn">Import</button>
261
                            <input type="hidden" name="frameworkcode" value="default" />
264
                  <button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Close</button>
262
                            <input type="hidden" name="action" value="import" />
265
                </div>
263
                            <p><label for="file_import_default">Upload file:</label> <input type="file" name="file_import_default" id="file_import_default" class="input_import" /></p>
266
              </form>
264
                            <div id="importing_default" style="display:none" class="importing"><img src="[% interface %]/[% theme %]/img/loading-small.gif" alt="" /><span class="importing_msg"></span></div>
265
                    </div>
266
                    <div class="modal-footer">
267
                        <button type="submit" class="btn">Import</button>
268
                        <button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Close</button>
269
                    </div>
270
                </form>
271
            </div>
267
            </div>
272
268
          </div>
273
        </td>
269
        </td>
274
    </tr>
270
    </tr>
275
271
Lines 277-337 Link Here
277
        <tr>
273
        <tr>
278
            <td>[% loo.frameworkcode %]</td>
274
            <td>[% loo.frameworkcode %]</td>
279
            <td>[% loo.frameworktext %]</td>
275
            <td>[% loo.frameworktext %]</td>
280
            <td><a href="marctagstructure.pl?frameworkcode=[% loo.frameworkcode %]" >MARC structure</a></td>
281
            <td><a href="/cgi-bin/koha/admin/biblio_framework.pl?op=add_form&amp;frameworkcode=[% loo.frameworkcode |html %]">Edit</a></td>
282
            <td><a href="/cgi-bin/koha/admin/biblio_framework.pl?op=delete_confirm&amp;frameworkcode=[% loo.frameworkcode |html %]">Delete</a></td>
283
            <td>
276
            <td>
284
277
              <div class="dropdown">
285
                <!-- Button to trigger modal -->
278
                <a class="btn btn-mini dropdown-toggle" id="frameworkactions[% loo.frameworkcode %]" role="button" data-toggle="dropdown" href="#">
286
                <a href="#" data-toggle="modal" data-target="#exportModal_[% loo.frameworkcode %][% loop.count %]">Export</a>
279
                  Actions <b class="caret"></b>
287
                <!-- Modal -->
280
                </a>
281
                <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="frameworkactions[% loo.frameworkcode %]">
282
                  <li><a href="marctagstructure.pl?frameworkcode=[% loo.frameworkcode %]"><i class="fa fa-eye"></i> MARC structure</a></li>
283
                  <li><a href="/cgi-bin/koha/admin/biblio_framework.pl?op=add_form&amp;frameworkcode=[% loo.frameworkcode |html %]"><i class="fa fa-pencil"></i> Edit</a></li>
284
                  <li><a href="/cgi-bin/koha/admin/biblio_framework.pl?op=delete_confirm&amp;frameworkcode=[% loo.frameworkcode |html %]"><i class="fa fa-trash"></i> Delete</a></li>
285
                  <!-- Trigger modal -->
286
                  <li><a href="#" data-toggle="modal" data-target="#exportModal_[% loo.frameworkcode %][% loop.count %]" title="Export framework structure (fields, subfields) to a spreadsheet file (.csv, .xml, .ods)"><i class="fa fa-upload"></i> Export</a></li>
287
                  <!-- Trigger modal -->
288
                  <li><a href="#" data-toggle="modal" data-target="#importModal_[% loo.frameworkcode %][% loop.count %]" title="Import framework structure (fields, subfields) from a spreadsheet file (.csv, .xml, .ods)"><i class="fa fa-download"></i> Import</a></li>
289
                </ul>
290
                <!-- Modal to export other framework -->
288
                <div class="modal hide" id="exportModal_[% loo.frameworkcode %][% loop.count %]" tabindex="-1" role="dialog" aria-labelledby="exportLabelexportModal_[% loo.frameworkcode %][% loop.count %]" aria-hidden="true">
291
                <div class="modal hide" id="exportModal_[% loo.frameworkcode %][% loop.count %]" tabindex="-1" role="dialog" aria-labelledby="exportLabelexportModal_[% loo.frameworkcode %][% loop.count %]" aria-hidden="true">
289
                    <div class="modal-header">
292
                  <div class="modal-header">
290
                        <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
293
                    <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
291
                        <h3 id="exportLabelexportModal_[% loo.frameworkcode %][% loop.count %]">Export [% loo.frameworktext %] framework</h3>
294
                    <h3 id="exportLabelexportModal_[% loo.frameworkcode %][% loop.count %]">Export [% loo.frameworktext %] framework</h3>
295
                  </div>
296
                  <form action="import_export_framework.pl" name="form_[% loo.frameworkcode %]" method="get" target="_blank"  class="form_export">
297
                    <div class="modal-body">
298
                      <fieldset>
299
                        <input type="hidden" name="frameworkcode" value="[% loo.frameworkcode %]" />
300
                        <p><label for="csv_type_export_[% loo.frameworkcode %][% loop.count %]"><input type="radio" name="type_export_[% loo.frameworkcode %]" value="csv" id="csv_type_export_[% loo.frameworkcode %][% loop.count %]" checked="checked" /> Export to CSV spreadsheet</label></p>
301
                        <p><label for="xml_type_export_[% loo.frameworkcode %][% loop.count %]"><input type="radio" name="type_export_[% loo.frameworkcode %]" value="excel" id="xml_type_export_[% loo.frameworkcode %][% loop.count %]" /> Export to Excel with XML format, compatible with OpenOffice/LibreOffice as well</label></p>
302
                        <p><label for="ods_type_export_[% loo.frameworkcode %][% loop.count %]"><input type="radio" name="type_export_[% loo.frameworkcode %]" value="ods" id="ods_type_export_[% loo.frameworkcode %][% loop.count %]" /> Export to OpenDocument spreadsheet format</label></p>
303
                      </fieldset>
292
                    </div>
304
                    </div>
293
                    <form action="import_export_framework.pl" name="form_[% loo.frameworkcode %]" method="get" target="_blank"  class="form_export">
305
                    <div class="modal-footer">
294
                        <div class="modal-body">
306
                      <button type="submit" class="btn">Export</button>
295
                            <fieldset>
307
                      <button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Cancel</button>
296
                                <input type="hidden" name="frameworkcode" value="[% loo.frameworkcode %]" />
308
                    </div>
297
                                <p><label for="csv_type_export_[% loo.frameworkcode %][% loop.count %]"><input type="radio" name="type_export_[% loo.frameworkcode %]" value="csv" id="csv_type_export_[% loo.frameworkcode %][% loop.count %]" checked="checked" /> Export to CSV spreadsheet</label></p>
309
                  </form>
298
                                <p><label for="xml_type_export_[% loo.frameworkcode %][% loop.count %]"><input type="radio" name="type_export_[% loo.frameworkcode %]" value="excel" id="xml_type_export_[% loo.frameworkcode %][% loop.count %]" /> Export to Excel with XML format, compatible with OpenOffice/LibreOffice as well</label></p>
299
                                <p><label for="ods_type_export_[% loo.frameworkcode %][% loop.count %]"><input type="radio" name="type_export_[% loo.frameworkcode %]" value="ods" id="ods_type_export_[% loo.frameworkcode %][% loop.count %]" /> Export to OpenDocument spreadsheet format</label></p>
300
301
                            </fieldset>
302
                        </div>
303
                        <div class="modal-footer">
304
                            <button type="submit" class="btn">Export</button>
305
                            <button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Cancel</button>
306
                        </div>
307
                    </form>
308
                </div>
310
                </div>
309
            </td>
310
            <td>
311
311
312
                <!-- Button to trigger modal -->
312
                <!-- Modal to import other framework -->
313
                <a href="#" data-toggle="modal" data-target="#importModal_[% loo.frameworkcode %][% loop.count %]">Import</a>
314
                <!-- Modal -->
315
                <div class="modal hide" id="importModal_[% loo.frameworkcode %][% loop.count %]" tabindex="-1" role="dialog" aria-labelledby="importLabelexportModal_[% loo.frameworkcode %][% loop.count %]" aria-hidden="true">
313
                <div class="modal hide" id="importModal_[% loo.frameworkcode %][% loop.count %]" tabindex="-1" role="dialog" aria-labelledby="importLabelexportModal_[% loo.frameworkcode %][% loop.count %]" aria-hidden="true">
316
                    <div class="modal-header">
314
                  <div class="modal-header">
317
                        <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
315
                    <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
318
                        <h3 id="importLabelexportModal_[% loo.frameworkcode %][% loop.count %]">Import [% loo.frameworkcode %] framework structure (fields and subfields) from a spreadsheet file (.csv, .xml, .ods)</h3>
316
                    <h3 id="importLabelexportModal_[% loo.frameworkcode %][% loop.count %]">Import [% loo.frameworkcode %] framework structure (fields and subfields) from a spreadsheet file (.csv, .xml, .ods)</h3>
317
                  </div>
318
                  <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">
319
                    <div class="modal-body">
320
                      <input type="hidden" name="frameworkcode" value="[% loo.frameworkcode %]" />
321
                      <input type="hidden" name="action" value="import" />
322
                      <p><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" /></p>
323
                      <div id="importing_[% loo.frameworkcode %]" style="display:none" class="importing"><img src="[% interface %]/[% theme %]/img/loading-small.gif" alt="" /><span class="importing_msg"></span></div>
324
                    </div>
325
                    <div class="modal-footer">
326
                      <button type="submit" class="btn">Import</button>
327
                      <button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Close</button>
319
                    </div>
328
                    </div>
320
                    <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">
329
                  </form>
321
                        <div class="modal-body">
322
                                <input type="hidden" name="frameworkcode" value="[% loo.frameworkcode %]" />
323
                                <input type="hidden" name="action" value="import" />
324
                                <p><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" /></p>
325
                                <div id="importing_[% loo.frameworkcode %]" style="display:none" class="importing"><img src="[% interface %]/[% theme %]/img/loading-small.gif" alt="" /><span class="importing_msg"></span></div>
326
                        </div>
327
                        <div class="modal-footer">
328
                            <button type="submit" class="btn">Import</button>
329
                            <button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Close</button>
330
                        </div>
331
                    </form>
332
                </div>
330
                </div>
333
        </td>
331
              </div>
332
            </td>
334
        </tr>
333
        </tr>
334
335
    [% END %]
335
    [% END %]
336
</table>
336
</table>
337
337
338
- 

Return to bug 15966