1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha › Administration › MARC frameworks
4 › [% IF ( frameworkcode ) %]Modify framework text[% ELSE %]Add framework[% END %]
5 [% ELSIF ( delete_confirm ) %]
6 › Delete framework for [% frameworktext %] ([% frameworkcode %])?
9 [% INCLUDE 'doc-head-close.inc' %]
10 <script type="text/javascript">
11 /* Import/Export from/to spreadsheet */
13 var importing = false;
15 $(document).ready(function() {
16 $("body").css("cursor", "auto");
17 $('.import_export_options').hide();
18 $('a.import_export_fw').click(function() {
20 $('.import_export_options').hide();
21 $(this).next().show('slide');
25 $('.import_export_close').click(function() {
27 $('.import_export_options').fadeOut('fast');
28 $("body").css("cursor", "auto");
32 $('.input_import').val("");
34 var matches = new RegExp("\\?error_import_export=(.+)$").exec(window.location.search);
35 if (matches && matches.length > 1) {
36 alert(_("Error importing the framework %s").format(decodeURIComponent(matches[1])));
39 $('input.input_import').change( function() {
40 var filename = $(this).val();
41 if ( ! /(?:\.csv|\.ods|\.xml)$/.test(filename)) {
42 $(this).css("background-color","yellow");
43 alert(_("Please select an ods or xml file"));
45 $(this).css("background-color","white");
48 $('form.form_export').submit(function() {
49 $('.modal').modal("hide");
52 $('form.form_import').submit(function() {
53 var id = $(this).attr('id');
54 var obj = $('#' + id + ' input:file');
55 if (/(?:\.csv|\.ods|\.xml)$/.test(obj.val())) {
56 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"))) {
57 var frameworkcode = $('#' + id + ' input:hidden[name=frameworkcode]').val();
58 $('#importing_' + frameworkcode).find("span").html(_("Importing to framework: %s. Importing from file: %s").format("<strong>" + frameworkcode + "</strong>", "<i>" + obj.val().replace(new RegExp("^.+[/\\\\]"),"") + "</i>"));
59 if (navigator.userAgent.toLowerCase().indexOf('msie') != -1) {
60 var timestamp = new Date().getTime();
61 $('#importing_' + frameworkcode).find("img").attr('src', '[% interface %]/[% theme %]/img/loading-small.gif' + '?' +timestamp);
63 $('#importing_' + frameworkcode).css('display', 'block');
64 if (navigator.userAgent.toLowerCase().indexOf('firefox') == -1) $("body").css("cursor", "progress");
66 $(".modal-footer,.closebtn").hide();
71 obj.css("background-color","yellow");
72 alert(_("Please select an spreadsheet (csv, ods, xml) file"));
74 obj.css("background-color","white");
82 <body id="admin_biblio_framework" class="admin">
83 [% INCLUDE 'header.inc' %]
84 [% INCLUDE 'cat-search.inc' %]
86 <div id="breadcrumbs">
87 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
88 › <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
89 › <a href="/cgi-bin/koha/admin/biblio_framework.pl">MARC frameworks</a>
91 › [% IF ( frameworkcode ) %]Modify framework text[% ELSE %]Add framework[% END %]
92 [% ELSIF ( delete_confirm ) %]
93 › Delete framework for [% frameworktext %] ([% frameworkcode %])?
97 <div id="doc3" class="yui-t2">
103 <div id="toolbar" class="btn-toolbar">
104 <a class="btn btn-small" id="newframework" href="/cgi-bin/koha/admin/biblio_framework.pl?op=add_form"><i class="fa fa-plus"></i> New framework</a>
108 [% IF ( add_form ) %]
109 <h1>[% IF ( frameworkcode ) %]Modify framework text[% ELSE %]Add framework[% END %]</h1>
110 <form action="[% script_name %]" name="Aform" method="post" class="validated">
111 <input type="hidden" name="op" value="add_validate" />
112 <fieldset class="rows">
114 [% IF ( frameworkcode ) %]
115 <li><span class="label">Framework code: </span><input type="hidden" id="frameworkcode" name="frameworkcode" value="[% frameworkcode %]" />[% frameworkcode %]
116 <input type="hidden" name="modif" value="1" />
120 <label for="frameworkcode" class="required">Framework code: </label>
121 <input type="text" id="frameworkcode" name="frameworkcode" size="4" maxlength="4" onblur="toUC(this)" required="required" class="required" />
122 <span class="required">Required</span>
126 <label for="description" class="required">Description: </label>
127 <input type="text" name="frameworktext" id="description" size="40" maxlength="80" value="[% frameworktext |html %]" required="required" class="required" />
128 <span class="required">Required</span>
132 <fieldset class="action"><input type="submit" value="Submit" class="submit" /></fieldset>
136 [% IF ( delete_confirm ) %]
137 <div class="dialog alert">
138 <h3>Delete framework for [% frameworktext %] ([% frameworkcode %])?</h3>
140 <p><strong>This framework is used [% total %] times</strong>.</p>
142 <form class="inline" action="[% script_name %]" method="post"><input type="hidden" name="op" value="delete_confirmed" /><input type="hidden" name="frameworkcode" value="[% frameworkcode %]" /><input type="submit" class="approve" value="Yes, delete this framework!" />
144 <form class="inline" action="[% script_name %]" method="get"><input type="submit" class="deny" value="No, do not delete!" /></form>
149 <h1>MARC frameworks</h1>
150 <p>Framework name, then go to MARC biblio to set MARC editor parameters</p>
158 <th title="Export framework structure (fields, subfields) to a spreadsheet file (.csv, .xml, .ods)">Export</th>
159 <th title="Import framework structure (fields, subfields) from a spreadsheet file (.csv, .xml, .ods)">Import</th>
163 <td>Default framework</td>
164 <td><a href="marctagstructure.pl?frameworkcode=[% frameworkcode %]">MARC structure</a></td>
169 <!-- Button to trigger modal -->
170 <a href="#" data-toggle="modal" data-target="#exportModal_[% frameworkcode %]">Export</a>
172 <div class="modal hide" id="exportModal_[% frameworkcode %]" tabindex="-1" role="dialog" aria-labelledby="exportLabelexportModal_[% frameworkcode %]" aria-hidden="true">
173 <div class="modal-header">
174 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
175 <h3 id="exportLabelexportModal_[% frameworkcode %]">Export default framework</h3>
177 <form action="import_export_framework.pl" name="form_[% frameworkcode %]" method="get" target="_blank" class="form_export">
178 <div class="modal-body">
180 <input type="hidden" name="frameworkcode" value="[% frameworkcode %]" />
181 <p><label for="csv_type_export_[% frameworkcode %]"><input type="radio" name="type_export_[% frameworkcode %]" value="csv" id="csv_type_export_[% frameworkcode %]" checked="checked" /> Export to CSV spreadsheet</label></p>
182 <p><label for="xml_type_export_[% frameworkcode %]"><input type="radio" name="type_export_[% frameworkcode %]" value="excel" id="xml_type_export_[% frameworkcode %]" /> Export to Excel with XML format, compatible with OpenOffice/LibreOffice as well</label></p>
183 <p><label for="ods_type_export_[% frameworkcode %]"><input type="radio" name="type_export_[% frameworkcode %]" value="ods" id="ods_type_export_[% frameworkcode %]" /> Export to OpenDocument spreadsheet format</label></p>
187 <div class="modal-footer">
188 <button type="submit" class="btn">Export</button>
189 <button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Cancel</button>
197 <!-- Button to trigger modal -->
198 <a href="#" data-toggle="modal" data-target="#importModal_[% frameworkcode %][% loop.count %]">Import</a>
200 <div class="modal hide" id="importModal_[% frameworkcode %][% loop.count %]" tabindex="-1" role="dialog" aria-labelledby="importLabelexportModal_[% frameworkcode %][% loop.count %]" aria-hidden="true">
201 <div class="modal-header">
202 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
203 <h3 id="importLabelexportModal_[% frameworkcode %][% loop.count %]">Import default framework structure (fields and subfields) from a spreadsheet file (.csv, .xml, .ods)</h3>
205 <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">
206 <div class="modal-body">
207 <input type="hidden" name="frameworkcode" value="[% frameworkcode %]" />
208 <input type="hidden" name="action" value="import" />
209 <p><label for="file_import_[% frameworkcode %]">Upload file:</label> <input type="file" name="file_import_[% frameworkcode %]" id="file_import_[% frameworkcode %]" class="input_import" /></p>
210 <div id="importing_[% frameworkcode %]" style="display:none" class="importing"><img src="[% interface %]/[% theme %]/img/loading-small.gif" alt="" /><span class="importing_msg"></span></div>
212 <div class="modal-footer">
213 <button type="submit" class="btn">Import</button>
214 <button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Close</button>
221 <!-- note highlight assignment appears backwards because we already have a normal row for Default -->
222 [% FOREACH loo IN loop %]
224 <td>[% loo.frameworkcode %]</td>
225 <td>[% loo.frameworktext %]</td>
226 <td><a href="marctagstructure.pl?frameworkcode=[% loo.frameworkcode %]" >MARC structure</a></td>
227 <td><a href="[% loo.script_name %]?op=add_form&frameworkcode=[% loo.frameworkcode |html %]">Edit</a></td>
228 <td><a href="[% loo.script_name %]?op=delete_confirm&frameworkcode=[% loo.frameworkcode |html %]">Delete</a></td>
231 <!-- Button to trigger modal -->
232 <a href="#" data-toggle="modal" data-target="#exportModal_[% loo.frameworkcode %][% loop.count %]">Export</a>
234 <div class="modal hide" id="exportModal_[% loo.frameworkcode %][% loop.count %]" tabindex="-1" role="dialog" aria-labelledby="exportLabelexportModal_[% loo.frameworkcode %][% loop.count %]" aria-hidden="true">
235 <div class="modal-header">
236 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
237 <h3 id="exportLabelexportModal_[% loo.frameworkcode %][% loop.count %]">Export [% loo.frameworktext %] framework</h3>
239 <form action="import_export_framework.pl" name="form_[% loo.frameworkcode %]" method="get" target="_blank" class="form_export">
240 <div class="modal-body">
242 <input type="hidden" name="frameworkcode" value="[% loo.frameworkcode %]" />
243 <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>
244 <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>
245 <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>
249 <div class="modal-footer">
250 <button type="submit" class="btn">Export</button>
251 <button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Cancel</button>
258 <!-- Button to trigger modal -->
259 <a href="#" data-toggle="modal" data-target="#importModal_[% loo.frameworkcode %][% loop.count %]">Import</a>
261 <div class="modal hide" id="importModal_[% loo.frameworkcode %][% loop.count %]" tabindex="-1" role="dialog" aria-labelledby="importLabelexportModal_[% loo.frameworkcode %][% loop.count %]" aria-hidden="true">
262 <div class="modal-header">
263 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
264 <h3 id="importLabelexportModal_[% loo.frameworkcode %][% loop.count %]">Import [% loo.frameworkcode %] framework structure (fields and subfields) from a spreadsheet file (.csv, .xml, .ods)</h3>
266 <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">
267 <div class="modal-body">
268 <input type="hidden" name="frameworkcode" value="[% loo.frameworkcode %]" />
269 <input type="hidden" name="action" value="import" />
270 <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>
271 <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>
273 <div class="modal-footer">
274 <button type="submit" class="btn">Import</button>
275 <button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Close</button>
283 [% IF ( previous ) %]<a href="[% previous %]"><< Previous</a>[% END %]
284 [% IF ( next ) %]<a href="[% next %]">Next >></a>[% END %]
290 [% INCLUDE 'admin-menu.inc' %]
293 [% INCLUDE 'intranet-bottom.inc' %]