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) {
20 f.value = f.value.toUpperCase();
23 /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
28 if (f.frameworkcode.value.length==0) {
29 _alertString += "\n- " + _("Framework code missing");
31 if (!(isNotNull(window.document.Aform.frameworktext))) {
32 _alertString += "\n- " + _("Description missing");
34 if (_alertString.length==0) {
35 document.Aform.submit();
37 alertString2 = _("Form not submitted because of the following problem(s)");
38 alertString2 += "\n------------------------------------------------------------------------------------\n";
39 alertString2 += _alertString;
48 <script type="text/javascript">
49 /* Import/Export from/to spreadsheet */
51 var importing = false;
53 $(document).ready(function() {
54 $("body").css("cursor", "auto");
55 $('.import_export_options').hide();
56 $('a.import_export_fw').click(function() {
58 $('.import_export_options').hide();
59 $(this).next().show('slide');
63 $('.import_export_close').click(function() {
65 $('.import_export_options').fadeOut('fast');
66 $("body").css("cursor", "auto");
70 $('.input_import').val("");
72 var matches = new RegExp("\\?error_import_export=(.+)$").exec(window.location.search);
73 if (matches && matches.length > 1) {
74 alert(_("Error importing the framework ") + decodeURIComponent(matches[1]));
77 $('input.input_import').change( function() {
78 var filename = $(this).val();
79 if ( ! /(?:\.csv|\.sql|\.ods|\.xml)$/.test(filename)) {
80 $(this).css("background-color","yellow");
81 alert(_("Please select an ods or xml file"));
83 $(this).css("background-color","white");
86 $('form.form_export').submit(function() {
87 $('.modal').modal("hide");
90 $('form.form_import').submit(function() {
91 var id = $(this).attr('id');
92 var obj = $('#' + id + ' input:file');
93 if (/(?:\.csv|\.sql|\.ods|\.xml)$/.test(obj.val())) {
94 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"))) {
95 var frameworkcode = $('#' + id + ' input:hidden[name=frameworkcode]').val();
96 $('#importing_' + frameworkcode).find("span").html(_("Importing to framework:")+"<strong>" + frameworkcode + "</strong>. " +_("Importing from file:")+"<i>" + obj.val().replace(new RegExp("^.+[/\\\\]"),"") + "</i>");
97 if (navigator.userAgent.toLowerCase().indexOf('msie') != -1) {
98 var timestamp = new Date().getTime();
99 $('#importing_' + frameworkcode).find("img").attr('src', '[% interface %]/[% theme %]/img/loading-small.gif' + '?' +timestamp);
101 $('#importing_' + frameworkcode).css('display', 'block');
102 if (navigator.userAgent.toLowerCase().indexOf('firefox') == -1) $("body").css("cursor", "progress");
104 $(".modal-footer,.closebtn").hide();
109 obj.css("background-color","yellow");
110 alert(_("Please select an spreadsheet (csv, ods, xml) or sql file"));
112 obj.css("background-color","white");
120 <body id="admin_biblio_framework" class="admin">
121 [% INCLUDE 'header.inc' %]
122 [% INCLUDE 'cat-search.inc' %]
124 <div id="breadcrumbs">
125 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
126 › <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
127 › <a href="/cgi-bin/koha/admin/biblio_framework.pl">MARC frameworks</a>
128 [% IF ( add_form ) %]
129 › [% IF ( frameworkcode ) %]Modify framework text[% ELSE %]Add framework[% END %]
130 [% ELSIF ( delete_confirm ) %]
131 › Delete framework for [% frameworktext %] ([% frameworkcode %])?
135 <div id="doc3" class="yui-t2">
141 <div id="toolbar" class="btn-toolbar">
142 <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>
146 [% IF ( add_form ) %]
147 <h1>[% IF ( frameworkcode ) %]Modify framework text[% ELSE %]Add framework[% END %]</h1>
148 <form action="[% script_name %]" name="Aform" method="post" onsubmit="return Check(this);">
149 <input type="hidden" name="op" value="add_validate" />
150 <fieldset class="rows">
152 [% IF ( frameworkcode ) %]
153 <li><span class="label">Framework code: </span><input type="hidden" id="frameworkcode" name="frameworkcode" value="[% frameworkcode %]" />[% frameworkcode %]
154 <input type="hidden" name="modif" value="1" />
157 <li><label for="frameworkcode">Framework code: </label><input type="text" id="frameworkcode" name="frameworkcode" size="4" maxlength="4" onblur="toUC(this)" /></li>
159 <li><label for="description">Description: </label>
160 <input type="text" name="frameworktext" id="description" size="40" maxlength="80" value="[% frameworktext |html %]" /></li></ol></fieldset>
161 <fieldset class="action"> <input type="submit" value="Submit" class="submit" /></fieldset>
165 [% IF ( delete_confirm ) %]
166 <div class="dialog alert">
167 <h3>Delete framework for [% frameworktext %] ([% frameworkcode %])?</h3>
169 <p><strong>This framework is used [% total %] times</strong>.</p>
171 <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!" />
173 <form class="inline" action="[% script_name %]" method="get"><input type="submit" class="deny" value="No, do not delete!" /></form>
178 <h1>MARC frameworks</h1>
179 <p>Framework name, then go to MARC biblio to set MARC editor parameters</p>
187 <th title="Export framework structure (fields, subfields) to a spreadsheet file (.csv, .xml, .ods) or SQL file">Export</th>
188 <th title="Import framework structure (fields, subfields) from a spreadsheet file (.csv, .xml, .ods) or SQL file">Import</th>
192 <td>Default framework</td>
193 <td><a href="marctagstructure.pl?frameworkcode=[% frameworkcode %]">MARC structure</a></td>
198 <!-- Button to trigger modal -->
199 <a href="#" data-toggle="modal" data-target="#exportModal_[% frameworkcode %]">Export</a>
201 <div class="modal hide" id="exportModal_[% frameworkcode %]" tabindex="-1" role="dialog" aria-labelledby="exportLabelexportModal_[% frameworkcode %]" aria-hidden="true">
202 <div class="modal-header">
203 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
204 <h3 id="exportLabelexportModal_[% frameworkcode %]">Export default framework</h3>
206 <form action="import_export_framework.pl" name="form_[% frameworkcode %]" method="get" target="_blank" class="form_export">
207 <div class="modal-body">
209 <input type="hidden" name="frameworkcode" value="[% frameworkcode %]" />
210 <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>
211 <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>
212 <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>
213 <p><label for="sql_type_export_[% frameworkcode %]"><input type="radio" name="type_export_[% frameworkcode %]" value="sql" id="sql_type_export_[% frameworkcode %]" /> Export to SQL</label></p>
217 <div class="modal-footer">
218 <button type="submit" class="btn">Export</button>
219 <button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Cancel</button>
227 <!-- Button to trigger modal -->
228 <a href="#" data-toggle="modal" data-target="#importModal_[% frameworkcode %][% loop.count %]">Import</a>
230 <div class="modal hide" id="importModal_[% frameworkcode %][% loop.count %]" tabindex="-1" role="dialog" aria-labelledby="importLabelexportModal_[% frameworkcode %][% loop.count %]" aria-hidden="true">
231 <div class="modal-header">
232 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
233 <h3 id="importLabelexportModal_[% frameworkcode %][% loop.count %]">Import default framework structure (fields and subfields) from a spreadsheet file (.csv, .xml, .ods) or SQL file</h3>
235 <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">
236 <div class="modal-body">
237 <input type="hidden" name="frameworkcode" value="[% frameworkcode %]" />
238 <input type="hidden" name="action" value="import" />
239 <p><label for="file_import_[% frameworkcode %]">Upload file:</label> <input type="file" name="file_import_[% frameworkcode %]" id="file_import_[% frameworkcode %]" class="input_import" /></p>
240 <div id="importing_[% frameworkcode %]" style="display:none" class="importing"><img src="[% interface %]/[% theme %]/img/loading-small.gif" alt="" /><span class="importing_msg"></span></div>
242 <div class="modal-footer">
243 <button type="submit" class="btn">Import</button>
244 <button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Close</button>
251 <!-- note highlight assignment appears backwards because we already have a normal row for Default -->
252 [% FOREACH loo IN loop %]
253 [% IF ( loop.odd ) %]<tr class="highlight">
256 <td>[% loo.frameworkcode %]</td>
257 <td>[% loo.frameworktext %]</td>
258 <td><a href="marctagstructure.pl?frameworkcode=[% loo.frameworkcode %]" >MARC structure</a></td>
259 <td><a href="[% loo.script_name %]?op=add_form&frameworkcode=[% loo.frameworkcode |html %]">Edit</a></td>
260 <td><a href="[% loo.script_name %]?op=delete_confirm&frameworkcode=[% loo.frameworkcode |html %]">Delete</a></td>
263 <!-- Button to trigger modal -->
264 <a href="#" data-toggle="modal" data-target="#exportModal_[% loo.frameworkcode %][% loop.count %]">Export</a>
266 <div class="modal hide" id="exportModal_[% loo.frameworkcode %][% loop.count %]" tabindex="-1" role="dialog" aria-labelledby="exportLabelexportModal_[% loo.frameworkcode %][% loop.count %]" aria-hidden="true">
267 <div class="modal-header">
268 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
269 <h3 id="exportLabelexportModal_[% loo.frameworkcode %][% loop.count %]">Export [% loo.frameworktext %] framework</h3>
271 <form action="import_export_framework.pl" name="form_[% loo.frameworkcode %]" method="get" target="_blank" class="form_export">
272 <div class="modal-body">
274 <input type="hidden" name="frameworkcode" value="[% loo.frameworkcode %]" />
275 <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>
276 <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>
277 <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>
278 <p><label for="sql_type_export_[% loo.frameworkcode %][% loop.count %]"><input type="radio" name="type_export_[% loo.frameworkcode %]" value="sql" id="sql_type_export_[% loo.frameworkcode %][% loop.count %]" /> Export to SQL</label></p>
282 <div class="modal-footer">
283 <button type="submit" class="btn">Export</button>
284 <button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Cancel</button>
291 <!-- Button to trigger modal -->
292 <a href="#" data-toggle="modal" data-target="#importModal_[% loo.frameworkcode %][% loop.count %]">Import</a>
294 <div class="modal hide" id="importModal_[% loo.frameworkcode %][% loop.count %]" tabindex="-1" role="dialog" aria-labelledby="importLabelexportModal_[% loo.frameworkcode %][% loop.count %]" aria-hidden="true">
295 <div class="modal-header">
296 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
297 <h3 id="importLabelexportModal_[% loo.frameworkcode %][% loop.count %]">Import [% loo.frameworkcode %] framework structure (fields and subfields) from a spreadsheet file (.csv, .xml, .ods) or SQL file</h3>
299 <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">
300 <div class="modal-body">
301 <input type="hidden" name="frameworkcode" value="[% loo.frameworkcode %]" />
302 <input type="hidden" name="action" value="import" />
303 <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>
304 <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>
306 <div class="modal-footer">
307 <button type="submit" class="btn">Import</button>
308 <button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Close</button>
316 [% IF ( previous ) %]<a href="[% previous %]"><< Previous</a>[% END %]
317 [% IF ( next ) %]<a href="[% next %]">Next >></a>[% END %]
323 [% INCLUDE 'admin-menu.inc' %]
326 [% INCLUDE 'intranet-bottom.inc' %]