[% END %]
</title>
[% INCLUDE 'doc-head-close.inc' %]
-<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
+<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
[% INCLUDE 'datatables.inc' %]
<script type="text/javascript">
-/* Import/Export from/to spreadsheet */
-
- var importing = false;
-
- $(document).ready(function() {
- $("#table_biblio_frameworks").dataTable($.extend(true, {}, dataTablesDefaults, {
- "aoColumnDefs": [
- { "aTargets": [ -1, -2, -3, -4, -5 ], "bSortable": false, "bSearchable": false },
- { "aTargets": [ 0, 1 ], "sType": "natural" },
- ],
- "bSort": true,
- "sPaginationType": "four_button"
- }));
-
- $("body").css("cursor", "auto");
- $('.import_export_options').hide();
- $('a.import_export_fw').click(function() {
- if (!importing) {
- $('.import_export_options').hide();
- $(this).next().show('slide');
- }
- return false;
- });
- $('.import_export_close').click(function() {
- if (!importing) {
- $('.import_export_options').fadeOut('fast');
- $("body").css("cursor", "auto");
- return false;
- }
- });
- $('.input_import').val("");
-
- var matches = new RegExp("\\?error_import_export=(.+)$").exec(window.location.search);
- if (matches && matches.length > 1) {
- alert(_("Error importing the framework %s").format(decodeURIComponent(matches[1])));
- }
-
- $('input.input_import').change( function() {
- var filename = $(this).val();
- if ( ! /(?:\.csv|\.ods|\.xml)$/.test(filename)) {
- $(this).css("background-color","yellow");
- alert(_("Please select an ods or xml file"));
- $(this).val("");
- $(this).css("background-color","white");
- }
- });
- $('form.form_export').submit(function() {
- $('.modal').modal("hide");
- return true;
- });
- $('form.form_import').submit(function() {
- var id = $(this).attr('id');
- var obj = $('#' + id + ' input:file');
- if (/(?:\.csv|\.ods|\.xml)$/.test(obj.val())) {
- 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"))) {
- var frameworkcode = $('#' + id + ' input:hidden[name=frameworkcode]').val();
- $('#importing_' + frameworkcode).find("span").html(_("Importing to framework: %s. Importing from file: %s").format("<strong>" + frameworkcode + "</strong>", "<i>" + obj.val().replace(new RegExp("^.+[/\\\\]"),"") + "</i>"));
- if (navigator.userAgent.toLowerCase().indexOf('msie') != -1) {
- var timestamp = new Date().getTime();
- $('#importing_' + frameworkcode).find("img").attr('src', '[% interface %]/[% theme %]/img/loading-small.gif' + '?' +timestamp);
- }
- $('#importing_' + frameworkcode).css('display', 'block');
- if (navigator.userAgent.toLowerCase().indexOf('firefox') == -1) $("body").css("cursor", "progress");
- importing = true;
- $(".modal-footer,.closebtn").hide();
- return true;
- } else
- return false;
- }
- obj.css("background-color","yellow");
- alert(_("Please select an spreadsheet (csv, ods, xml) file"));
- obj.val("");
- obj.css("background-color","white");
- return false;
- });
- });
-
+ /* Set some variable needed in biblio_framework.js */
+ var MSG_IMPORT_ERROR = _("Error importing the framework");
+ var MSG_SELECT_FILE_FORMAT = _("Please select a CSV (.csv), ODS (.ods) or XML (.xml) spreadsheet file.");
+ var MSG_OVERWRITE_WARNING = _("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");
+ var MSG_IMPORTING_TO_FRAMEWORK = _("Importing to framework: %s. Importing from file: %s.");
+ var template_path = "[% interface %]/[% theme %]";
</script>
+<script type="text/javascript" src="[% interface %]/[% theme %]/js/biblio_framework.js"></script>
</head>
<body id="admin_biblio_framework" class="admin">
[% IF op == 'delete_confirm' %]
<div class="dialog alert">
- <h3>Delete framework for [% framework.frameworktext %] ([% framework.frameworkcode %])?</h3>
[% IF biblios_use_this_framework %]
- <p><strong>This framework is used [% biblios_use_this_framework %] times</strong>.</p>
+ <h3>This framework cannot be deleted</h3>
+ <p><strong><span class="ex">[% framework.frameworktext %] ([% framework.frameworkcode %])</span></strong></p>
+ <p>The framework is used [% biblios_use_this_framework %] times.</p>
+ <form action="/cgi-bin/koha/admin/biblio_framework.pl" method="get">
+ <button type="submit"><i class="fa fa-fw fa-arrow-left"></i> Return to frameworks</button>
+ </form>
+ [% ELSE %]
+ <h3>Delete framework for [% framework.frameworktext %] ([% framework.frameworkcode %])?</h3>
+ <form class="inline" action="/cgi-bin/koha/admin/biblio_framework.pl" method="post">
+ <input type="hidden" name="op" value="delete_confirmed" />
+ <input type="hidden" name="frameworkcode" value="[% framework.frameworkcode %]" />
+ <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete this framework</button>
+ </form>
+ <form class="inline" action="/cgi-bin/koha/admin/biblio_framework.pl" method="get">
+ <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
+ </form>
[% END %]
- <form class="inline" action="/cgi-bin/koha/admin/biblio_framework.pl" method="post">
- <input type="hidden" name="op" value="delete_confirmed" />
- <input type="hidden" name="frameworkcode" value="[% framework.frameworkcode %]" />
- <input type="submit" class="approve" value="Yes, delete this framework!" />
- </form>
- <form class="inline" action="/cgi-bin/koha/admin/biblio_framework.pl" method="get">
- <input type="submit" class="deny" value="No, do not delete!" />
- </form>
</div>
[% END %]
<th>Code</th>
<th>Description</th>
<th> </th>
- <th>Edit</th>
- <th>Delete</th>
- <th title="Export framework structure (fields, subfields) to a spreadsheet file (.csv, .xml, .ods)">Export</th>
- <th title="Import framework structure (fields, subfields) from a spreadsheet file (.csv, .xml, .ods)">Import</th>
</tr>
</thead>
<tbody>
<tr>
<td> </td>
<td>Default framework</td>
- <td><a href="marctagstructure.pl?frameworkcode=">MARC structure</a></td>
- <td> </td>
- <td> </td>
<td>
-
- <!-- Button to trigger modal -->
- <a href="#" data-toggle="modal" data-target="#exportModal_default">Export</a>
- <!-- Modal -->
+ <div class="dropdown">
+ <a class="btn btn-mini dropdown-toggle" id="frameworkactions[% loo.frameworkcode %]" role="button" data-toggle="dropdown" href="#">
+ Actions <b class="caret"></b>
+ </a>
+ <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="frameworkactions[% loo.frameworkcode %]">
+ <li><a href="marctagstructure.pl?frameworkcode="><i class="fa fa-eye"></i> MARC structure</a></li>
+ <!-- Trigger modal -->
+ <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>
+ <!-- Trigger modal -->
+ <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>
+ </ul>
+ <!-- Modal to export default framework -->
<div class="modal hide" id="exportModal_default" tabindex="-1" role="dialog" aria-labelledby="exportLabelexportModal_default" aria-hidden="true">
- <div class="modal-header">
- <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
- <h3 id="exportLabelexportModal_default">Export default framework</h3>
+ <div class="modal-header">
+ <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
+ <h3 id="exportLabelexportModal_default">Export default framework</h3>
+ </div>
+ <form action="import_export_framework.pl" name="form_defaul" method="get" target="_blank" class="form_export">
+ <div class="modal-body">
+ <fieldset>
+ <input type="hidden" name="frameworkcode" value="" />
+ <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>
+ <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>
+ <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>
+ </fieldset>
</div>
- <form action="import_export_framework.pl" name="form_defaul" method="get" target="_blank" class="form_export">
- <div class="modal-body">
- <fieldset>
- <input type="hidden" name="frameworkcode" value="" />
- <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>
- <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>
- <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>
-
- </fieldset>
- </div>
- <div class="modal-footer">
- <button type="submit" class="btn">Export</button>
- <button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Cancel</button>
- </div>
- </form>
+ <div class="modal-footer">
+ <button type="submit" class="btn">Export</button>
+ <button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Cancel</button>
+ </div>
+ </form>
</div>
- </td>
- <td>
-
- <!-- Button to trigger modal -->
- <a href="#" data-toggle="modal" data-target="#importModal_[% framework.frameworkcode %][% frameworks.count %]">Import</a>
- <!-- Modal -->
+ <!-- Modal to import default framework -->
<div class="modal hide" id="importModal_[% framework.frameworkcode %][% frameworks.count %]" tabindex="-1" role="dialog" aria-labelledby="importLabelexportModal_default[% frameworks.count %]" aria-hidden="true">
- <div class="modal-header">
- <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
- <h3 id="importLabelexportModal_[% framework.frameworkcode %][% frameworks.count %]">Import default framework structure (fields and subfields) from a spreadsheet file (.csv, .xml, .ods)</h3>
+ <div class="modal-header">
+ <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
+ <h3 id="importLabelexportModal_[% framework.frameworkcode %][% frameworks.count %]">Import default framework structure (fields and subfields) from a spreadsheet file (.csv, .xml, .ods)</h>
+ </div>
+ <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">
+ <div class="modal-body">
+ <input type="hidden" name="frameworkcode" value="default" />
+ <input type="hidden" name="action" value="import" />
+ <p><label for="file_import_default">Upload file:</label> <input type="file" name="file_import_default" id="file_import_default" class="input_import" /></p>
+ <div id="importing_default" style="display:none" class="importing"><img src="[% interface %]/[% theme %]/img/loading-small.gif" alt="" /><span class="importing_msg"></span></div>
</div>
- <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">
- <div class="modal-body">
- <input type="hidden" name="frameworkcode" value="default" />
- <input type="hidden" name="action" value="import" />
- <p><label for="file_import_default">Upload file:</label> <input type="file" name="file_import_default" id="file_import_default" class="input_import" /></p>
- <div id="importing_default" style="display:none" class="importing"><img src="[% interface %]/[% theme %]/img/loading-small.gif" alt="" /><span class="importing_msg"></span></div>
- </div>
- <div class="modal-footer">
- <button type="submit" class="btn">Import</button>
- <button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Close</button>
- </div>
- </form>
+ <div class="modal-footer">
+ <button type="submit" class="btn">Import</button>
+ <button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Close</button>
+ </div>
+ </form>
</div>
-
+ </div>
</td>
</tr>
- <!-- note highlight assignment appears backwards because we already have a normal row for Default -->
+
[% FOREACH loo IN frameworks %]
<tr>
<td>[% loo.frameworkcode %]</td>
<td>[% loo.frameworktext %]</td>
- <td><a href="marctagstructure.pl?frameworkcode=[% loo.frameworkcode %]" >MARC structure</a></td>
- <td><a href="/cgi-bin/koha/admin/biblio_framework.pl?op=add_form&frameworkcode=[% loo.frameworkcode |html %]">Edit</a></td>
- <td><a href="/cgi-bin/koha/admin/biblio_framework.pl?op=delete_confirm&frameworkcode=[% loo.frameworkcode |html %]">Delete</a></td>
<td>
-
- <!-- Button to trigger modal -->
- <a href="#" data-toggle="modal" data-target="#exportModal_[% loo.frameworkcode %][% loop.count %]">Export</a>
- <!-- Modal -->
+ <div class="dropdown">
+ <a class="btn btn-mini dropdown-toggle" id="frameworkactions[% loo.frameworkcode %]" role="button" data-toggle="dropdown" href="#">
+ Actions <b class="caret"></b>
+ </a>
+ <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="frameworkactions[% loo.frameworkcode %]">
+ <li><a href="marctagstructure.pl?frameworkcode=[% loo.frameworkcode %]"><i class="fa fa-eye"></i> MARC structure</a></li>
+ <li><a href="/cgi-bin/koha/admin/biblio_framework.pl?op=add_form&frameworkcode=[% loo.frameworkcode |html %]"><i class="fa fa-pencil"></i> Edit</a></li>
+ <li><a href="/cgi-bin/koha/admin/biblio_framework.pl?op=delete_confirm&frameworkcode=[% loo.frameworkcode |html %]"><i class="fa fa-trash"></i> Delete</a></li>
+ <!-- Trigger modal -->
+ <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>
+ <!-- Trigger modal -->
+ <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>
+ </ul>
+ <!-- Modal to export other framework -->
<div class="modal hide" id="exportModal_[% loo.frameworkcode %][% loop.count %]" tabindex="-1" role="dialog" aria-labelledby="exportLabelexportModal_[% loo.frameworkcode %][% loop.count %]" aria-hidden="true">
- <div class="modal-header">
- <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
- <h3 id="exportLabelexportModal_[% loo.frameworkcode %][% loop.count %]">Export [% loo.frameworktext %] framework</h3>
+ <div class="modal-header">
+ <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
+ <h3 id="exportLabelexportModal_[% loo.frameworkcode %][% loop.count %]">Export [% loo.frameworktext %] framework</h3>
+ </div>
+ <form action="import_export_framework.pl" name="form_[% loo.frameworkcode %]" method="get" target="_blank" class="form_export">
+ <div class="modal-body">
+ <fieldset>
+ <input type="hidden" name="frameworkcode" value="[% loo.frameworkcode %]" />
+ <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>
+ <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>
+ <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>
+ </fieldset>
</div>
- <form action="import_export_framework.pl" name="form_[% loo.frameworkcode %]" method="get" target="_blank" class="form_export">
- <div class="modal-body">
- <fieldset>
- <input type="hidden" name="frameworkcode" value="[% loo.frameworkcode %]" />
- <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>
- <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>
- <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>
-
- </fieldset>
- </div>
- <div class="modal-footer">
- <button type="submit" class="btn">Export</button>
- <button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Cancel</button>
- </div>
- </form>
+ <div class="modal-footer">
+ <button type="submit" class="btn">Export</button>
+ <button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Cancel</button>
+ </div>
+ </form>
</div>
- </td>
- <td>
- <!-- Button to trigger modal -->
- <a href="#" data-toggle="modal" data-target="#importModal_[% loo.frameworkcode %][% loop.count %]">Import</a>
- <!-- Modal -->
+ <!-- Modal to import other framework -->
<div class="modal hide" id="importModal_[% loo.frameworkcode %][% loop.count %]" tabindex="-1" role="dialog" aria-labelledby="importLabelexportModal_[% loo.frameworkcode %][% loop.count %]" aria-hidden="true">
- <div class="modal-header">
- <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
- <h3 id="importLabelexportModal_[% loo.frameworkcode %][% loop.count %]">Import [% loo.frameworkcode %] framework structure (fields and subfields) from a spreadsheet file (.csv, .xml, .ods)</h3>
+ <div class="modal-header">
+ <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
+ <h3 id="importLabelexportModal_[% loo.frameworkcode %][% loop.count %]">Import [% loo.frameworkcode %] framework structure (fields and subfields) from a spreadsheet file (.csv, .xml, .ods)</h3>
+ </div>
+ <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">
+ <div class="modal-body">
+ <input type="hidden" name="frameworkcode" value="[% loo.frameworkcode %]" />
+ <input type="hidden" name="action" value="import" />
+ <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>
+ <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>
</div>
- <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">
- <div class="modal-body">
- <input type="hidden" name="frameworkcode" value="[% loo.frameworkcode %]" />
- <input type="hidden" name="action" value="import" />
- <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>
- <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>
- </div>
- <div class="modal-footer">
- <button type="submit" class="btn">Import</button>
- <button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Close</button>
- </div>
- </form>
+ <div class="modal-footer">
+ <button type="submit" class="btn">Import</button>
+ <button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Close</button>
+ </div>
+ </form>
</div>
- </td>
+ </div>
+ </td>
</tr>
+
[% END %]
</table>