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">
13 function isNotNull(f,noalert) {
14 if (f.value.length ==0) {
19 /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
24 if (f.frameworkcode.value.length==0) {
25 _alertString += "\n- " + _("Framework code missing");
27 if (!(isNotNull(window.document.Aform.frameworktext))) {
28 _alertString += "\n- " + _("Description missing");
30 if (_alertString.length==0) {
31 document.Aform.submit();
33 alertString2 = _("Form not submitted because of the following problem(s)");
34 alertString2 += "\n------------------------------------------------------------------------------------\n";
35 alertString2 += _alertString;
44 <script type="text/javascript">
45 /* Import/Export from/to spreadsheet */
47 var importing = false;
49 $(document).ready(function() {
50 $("body").css("cursor", "auto");
51 $('.import_export_options').hide();
52 $('a.import_export_fw').click(function() {
54 $('.import_export_options').hide();
55 $(this).next().show('slide');
59 $('.import_export_close').click(function() {
61 $('.import_export_options').fadeOut('fast');
62 $("body").css("cursor", "auto");
66 $('.input_import').val("");
68 var matches = new RegExp("\\?error_import_export=(.+)$").exec(window.location.search);
69 if (matches && matches.length > 1) {
70 alert(_("Error importing the framework ") + decodeURIComponent(matches[1]));
73 $('input.input_import').change( function() {
74 var filename = $(this).val();
75 if ( ! /(?:\.csv|\.ods|\.xml)$/.test(filename)) {
76 $(this).css("background-color","yellow");
77 alert(_("Please select an ods or xml file"));
79 $(this).css("background-color","white");
82 $('form.form_export').submit(function() {
83 $('.modal').modal("hide");
86 $('form.form_import').submit(function() {
87 var id = $(this).attr('id');
88 var obj = $('#' + id + ' input:file');
89 if (/(?:\.csv|\.ods|\.xml)$/.test(obj.val())) {
90 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"))) {
91 var frameworkcode = $('#' + id + ' input:hidden[name=frameworkcode]').val();
92 $('#importing_' + frameworkcode).find("span").html(_("Importing to framework:")+"<strong>" + frameworkcode + "</strong>. " +_("Importing from file:")+"<i>" + obj.val().replace(new RegExp("^.+[/\\\\]"),"") + "</i>");
93 if (navigator.userAgent.toLowerCase().indexOf('msie') != -1) {
94 var timestamp = new Date().getTime();
95 $('#importing_' + frameworkcode).find("img").attr('src', '[% interface %]/[% theme %]/img/loading-small.gif' + '?' +timestamp);
97 $('#importing_' + frameworkcode).css('display', 'block');
98 if (navigator.userAgent.toLowerCase().indexOf('firefox') == -1) $("body").css("cursor", "progress");
100 $(".modal-footer,.closebtn").hide();
105 obj.css("background-color","yellow");
106 alert(_("Please select an spreadsheet (csv, ods, xml) file"));
108 obj.css("background-color","white");
116 <body id="admin_biblio_framework" class="admin">
117 [% INCLUDE 'header.inc' %]
118 [% INCLUDE 'cat-search.inc' %]
120 <div id="breadcrumbs">
121 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
122 › <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
123 › <a href="/cgi-bin/koha/admin/biblio_framework.pl">MARC frameworks</a>
124 [% IF ( add_form ) %]
125 › [% IF ( frameworkcode ) %]Modify framework text[% ELSE %]Add framework[% END %]
126 [% ELSIF ( delete_confirm ) %]
127 › Delete framework for [% frameworktext %] ([% frameworkcode %])?
131 <div id="doc3" class="yui-t2">
137 <div id="toolbar" class="btn-toolbar">
138 <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>
142 [% IF ( add_form ) %]
143 <h1>[% IF ( frameworkcode ) %]Modify framework text[% ELSE %]Add framework[% END %]</h1>
144 <form action="[% script_name %]" name="Aform" method="post" onsubmit="return Check(this);">
145 <input type="hidden" name="op" value="add_validate" />
146 <fieldset class="rows">
148 [% IF ( frameworkcode ) %]
149 <li><span class="label">Framework code: </span><input type="hidden" id="frameworkcode" name="frameworkcode" value="[% frameworkcode %]" />[% frameworkcode %]
150 <input type="hidden" name="modif" value="1" />
153 <li><label for="frameworkcode">Framework code: </label><input type="text" id="frameworkcode" name="frameworkcode" size="4" maxlength="4" onblur="toUC(this)" /></li>
155 <li><label for="description">Description: </label>
156 <input type="text" name="frameworktext" id="description" size="40" maxlength="80" value="[% frameworktext |html %]" /></li></ol></fieldset>
157 <fieldset class="action"> <input type="submit" value="Submit" class="submit" /></fieldset>
161 [% IF ( delete_confirm ) %]
162 <div class="dialog alert">
163 <h3>Delete framework for [% frameworktext %] ([% frameworkcode %])?</h3>
165 <p><strong>This framework is used [% total %] times</strong>.</p>
167 <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!" />
169 <form class="inline" action="[% script_name %]" method="get"><input type="submit" class="deny" value="No, do not delete!" /></form>
174 <h1>MARC frameworks</h1>
175 <p>Framework name, then go to MARC biblio to set MARC editor parameters</p>
183 <th title="Export framework structure (fields, subfields) to a spreadsheet file (.csv, .xml, .ods)">Export</th>
184 <th title="Import framework structure (fields, subfields) from a spreadsheet file (.csv, .xml, .ods)">Import</th>
188 <td>Default framework</td>
189 <td><a href="marctagstructure.pl?frameworkcode=[% frameworkcode %]">MARC structure</a></td>
194 <!-- Button to trigger modal -->
195 <a href="#" data-toggle="modal" data-target="#exportModal_[% frameworkcode %]">Export</a>
197 <div class="modal hide" id="exportModal_[% frameworkcode %]" tabindex="-1" role="dialog" aria-labelledby="exportLabelexportModal_[% frameworkcode %]" aria-hidden="true">
198 <div class="modal-header">
199 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
200 <h3 id="exportLabelexportModal_[% frameworkcode %]">Export default framework</h3>
202 <form action="import_export_framework.pl" name="form_[% frameworkcode %]" method="get" target="_blank" class="form_export">
203 <div class="modal-body">
205 <input type="hidden" name="frameworkcode" value="[% frameworkcode %]" />
206 <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>
207 <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>
208 <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>
212 <div class="modal-footer">
213 <button type="submit" class="btn">Export</button>
214 <button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Cancel</button>
222 <!-- Button to trigger modal -->
223 <a href="#" data-toggle="modal" data-target="#importModal_[% frameworkcode %][% loop.count %]">Import</a>
225 <div class="modal hide" id="importModal_[% frameworkcode %][% loop.count %]" tabindex="-1" role="dialog" aria-labelledby="importLabelexportModal_[% frameworkcode %][% loop.count %]" aria-hidden="true">
226 <div class="modal-header">
227 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
228 <h3 id="importLabelexportModal_[% frameworkcode %][% loop.count %]">Import default framework structure (fields and subfields) from a spreadsheet file (.csv, .xml, .ods)</h3>
230 <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">
231 <div class="modal-body">
232 <input type="hidden" name="frameworkcode" value="[% frameworkcode %]" />
233 <input type="hidden" name="action" value="import" />
234 <p><label for="file_import_[% frameworkcode %]">Upload file:</label> <input type="file" name="file_import_[% frameworkcode %]" id="file_import_[% frameworkcode %]" class="input_import" /></p>
235 <div id="importing_[% frameworkcode %]" style="display:none" class="importing"><img src="[% interface %]/[% theme %]/img/loading-small.gif" alt="" /><span class="importing_msg"></span></div>
237 <div class="modal-footer">
238 <button type="submit" class="btn">Import</button>
239 <button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Close</button>
246 <!-- note highlight assignment appears backwards because we already have a normal row for Default -->
247 [% FOREACH loo IN loop %]
248 [% IF ( loop.odd ) %]<tr class="highlight">
251 <td>[% loo.frameworkcode %]</td>
252 <td>[% loo.frameworktext %]</td>
253 <td><a href="marctagstructure.pl?frameworkcode=[% loo.frameworkcode %]" >MARC structure</a></td>
254 <td><a href="[% loo.script_name %]?op=add_form&frameworkcode=[% loo.frameworkcode |html %]">Edit</a></td>
255 <td><a href="[% loo.script_name %]?op=delete_confirm&frameworkcode=[% loo.frameworkcode |html %]">Delete</a></td>
258 <!-- Button to trigger modal -->
259 <a href="#" data-toggle="modal" data-target="#exportModal_[% loo.frameworkcode %][% loop.count %]">Export</a>
261 <div class="modal hide" id="exportModal_[% loo.frameworkcode %][% loop.count %]" tabindex="-1" role="dialog" aria-labelledby="exportLabelexportModal_[% 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="exportLabelexportModal_[% loo.frameworkcode %][% loop.count %]">Export [% loo.frameworktext %] framework</h3>
266 <form action="import_export_framework.pl" name="form_[% loo.frameworkcode %]" method="get" target="_blank" class="form_export">
267 <div class="modal-body">
269 <input type="hidden" name="frameworkcode" value="[% loo.frameworkcode %]" />
270 <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>
271 <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>
272 <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>
276 <div class="modal-footer">
277 <button type="submit" class="btn">Export</button>
278 <button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Cancel</button>
285 <!-- Button to trigger modal -->
286 <a href="#" data-toggle="modal" data-target="#importModal_[% loo.frameworkcode %][% loop.count %]">Import</a>
288 <div class="modal hide" id="importModal_[% loo.frameworkcode %][% loop.count %]" tabindex="-1" role="dialog" aria-labelledby="importLabelexportModal_[% loo.frameworkcode %][% loop.count %]" aria-hidden="true">
289 <div class="modal-header">
290 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
291 <h3 id="importLabelexportModal_[% loo.frameworkcode %][% loop.count %]">Import [% loo.frameworkcode %] framework structure (fields and subfields) from a spreadsheet file (.csv, .xml, .ods)</h3>
293 <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">
294 <div class="modal-body">
295 <input type="hidden" name="frameworkcode" value="[% loo.frameworkcode %]" />
296 <input type="hidden" name="action" value="import" />
297 <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>
298 <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>
300 <div class="modal-footer">
301 <button type="submit" class="btn">Import</button>
302 <button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Close</button>
310 [% IF ( previous ) %]<a href="[% previous %]"><< Previous</a>[% END %]
311 [% IF ( next ) %]<a href="[% next %]">Next >></a>[% END %]
317 [% INCLUDE 'admin-menu.inc' %]
320 [% INCLUDE 'intranet-bottom.inc' %]