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="icon-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" />
119 <li><label for="frameworkcode">Framework code: </label><input type="text" id="frameworkcode" name="frameworkcode" size="4" maxlength="4" onblur="toUC(this)" required="required" class="required" /></li>
121 <li><label for="description">Description: </label>
122 <input type="text" name="frameworktext" id="description" size="40" maxlength="80" value="[% frameworktext |html %]" required="required" class="required" /></li></ol></fieldset>
123 <fieldset class="action"> <input type="submit" value="Submit" class="submit" /></fieldset>
127 [% IF ( delete_confirm ) %]
128 <div class="dialog alert">
129 <h3>Delete framework for [% frameworktext %] ([% frameworkcode %])?</h3>
131 <p><strong>This framework is used [% total %] times</strong>.</p>
133 <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!" />
135 <form class="inline" action="[% script_name %]" method="get"><input type="submit" class="deny" value="No, do not delete!" /></form>
140 <h1>MARC frameworks</h1>
141 <p>Framework name, then go to MARC biblio to set MARC editor parameters</p>
149 <th title="Export framework structure (fields, subfields) to a spreadsheet file (.csv, .xml, .ods)">Export</th>
150 <th title="Import framework structure (fields, subfields) from a spreadsheet file (.csv, .xml, .ods)">Import</th>
154 <td>Default framework</td>
155 <td><a href="marctagstructure.pl?frameworkcode=[% frameworkcode %]">MARC structure</a></td>
160 <!-- Button to trigger modal -->
161 <a href="#" data-toggle="modal" data-target="#exportModal_[% frameworkcode %]">Export</a>
163 <div class="modal hide" id="exportModal_[% frameworkcode %]" tabindex="-1" role="dialog" aria-labelledby="exportLabelexportModal_[% frameworkcode %]" aria-hidden="true">
164 <div class="modal-header">
165 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
166 <h3 id="exportLabelexportModal_[% frameworkcode %]">Export default framework</h3>
168 <form action="import_export_framework.pl" name="form_[% frameworkcode %]" method="get" target="_blank" class="form_export">
169 <div class="modal-body">
171 <input type="hidden" name="frameworkcode" value="[% frameworkcode %]" />
172 <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>
173 <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>
174 <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>
178 <div class="modal-footer">
179 <button type="submit" class="btn">Export</button>
180 <button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Cancel</button>
188 <!-- Button to trigger modal -->
189 <a href="#" data-toggle="modal" data-target="#importModal_[% frameworkcode %][% loop.count %]">Import</a>
191 <div class="modal hide" id="importModal_[% frameworkcode %][% loop.count %]" tabindex="-1" role="dialog" aria-labelledby="importLabelexportModal_[% frameworkcode %][% loop.count %]" aria-hidden="true">
192 <div class="modal-header">
193 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
194 <h3 id="importLabelexportModal_[% frameworkcode %][% loop.count %]">Import default framework structure (fields and subfields) from a spreadsheet file (.csv, .xml, .ods)</h3>
196 <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">
197 <div class="modal-body">
198 <input type="hidden" name="frameworkcode" value="[% frameworkcode %]" />
199 <input type="hidden" name="action" value="import" />
200 <p><label for="file_import_[% frameworkcode %]">Upload file:</label> <input type="file" name="file_import_[% frameworkcode %]" id="file_import_[% frameworkcode %]" class="input_import" /></p>
201 <div id="importing_[% frameworkcode %]" style="display:none" class="importing"><img src="[% interface %]/[% theme %]/img/loading-small.gif" alt="" /><span class="importing_msg"></span></div>
203 <div class="modal-footer">
204 <button type="submit" class="btn">Import</button>
205 <button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Close</button>
212 <!-- note highlight assignment appears backwards because we already have a normal row for Default -->
213 [% FOREACH loo IN loop %]
214 [% IF ( loop.odd ) %]<tr class="highlight">
217 <td>[% loo.frameworkcode %]</td>
218 <td>[% loo.frameworktext %]</td>
219 <td><a href="marctagstructure.pl?frameworkcode=[% loo.frameworkcode %]" >MARC structure</a></td>
220 <td><a href="[% loo.script_name %]?op=add_form&frameworkcode=[% loo.frameworkcode |html %]">Edit</a></td>
221 <td><a href="[% loo.script_name %]?op=delete_confirm&frameworkcode=[% loo.frameworkcode |html %]">Delete</a></td>
224 <!-- Button to trigger modal -->
225 <a href="#" data-toggle="modal" data-target="#exportModal_[% loo.frameworkcode %][% loop.count %]">Export</a>
227 <div class="modal hide" id="exportModal_[% loo.frameworkcode %][% loop.count %]" tabindex="-1" role="dialog" aria-labelledby="exportLabelexportModal_[% loo.frameworkcode %][% loop.count %]" aria-hidden="true">
228 <div class="modal-header">
229 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
230 <h3 id="exportLabelexportModal_[% loo.frameworkcode %][% loop.count %]">Export [% loo.frameworktext %] framework</h3>
232 <form action="import_export_framework.pl" name="form_[% loo.frameworkcode %]" method="get" target="_blank" class="form_export">
233 <div class="modal-body">
235 <input type="hidden" name="frameworkcode" value="[% loo.frameworkcode %]" />
236 <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>
237 <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>
238 <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>
242 <div class="modal-footer">
243 <button type="submit" class="btn">Export</button>
244 <button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Cancel</button>
251 <!-- Button to trigger modal -->
252 <a href="#" data-toggle="modal" data-target="#importModal_[% loo.frameworkcode %][% loop.count %]">Import</a>
254 <div class="modal hide" id="importModal_[% loo.frameworkcode %][% loop.count %]" tabindex="-1" role="dialog" aria-labelledby="importLabelexportModal_[% loo.frameworkcode %][% loop.count %]" aria-hidden="true">
255 <div class="modal-header">
256 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
257 <h3 id="importLabelexportModal_[% loo.frameworkcode %][% loop.count %]">Import [% loo.frameworkcode %] framework structure (fields and subfields) from a spreadsheet file (.csv, .xml, .ods)</h3>
259 <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">
260 <div class="modal-body">
261 <input type="hidden" name="frameworkcode" value="[% loo.frameworkcode %]" />
262 <input type="hidden" name="action" value="import" />
263 <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>
264 <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>
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>
276 [% IF ( previous ) %]<a href="[% previous %]"><< Previous</a>[% END %]
277 [% IF ( next ) %]<a href="[% next %]">Next >></a>[% END %]
283 [% INCLUDE 'admin-menu.inc' %]
286 [% INCLUDE 'intranet-bottom.inc' %]