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 $('.import_export_options').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><br />" +_("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', '/intranet-tmpl/prog/img/loading-small.gif' + '?' +timestamp);
101 $('#importing_' + frameworkcode).css('display', 'block');
102 if (navigator.userAgent.toLowerCase().indexOf('firefox') == -1) $("body").css("cursor", "progress");
108 obj.css("background-color","yellow");
109 alert(_("Please select an spreadsheet (csv, ods, xml) or sql file"));
111 obj.css("background-color","white");
119 <body id="admin_biblio_framework" class="admin">
120 [% INCLUDE 'header.inc' %]
121 [% INCLUDE 'cat-search.inc' %]
123 <div id="breadcrumbs">
124 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
125 › <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
126 › <a href="/cgi-bin/koha/admin/biblio_framework.pl">MARC frameworks</a>
127 [% IF ( add_form ) %]
128 › [% IF ( frameworkcode ) %]Modify framework text[% ELSE %]Add framework[% END %]
129 [% ELSIF ( delete_confirm ) %]
130 › Delete framework for [% frameworktext %] ([% frameworkcode %])?
134 <div id="doc3" class="yui-t2">
140 <div id="toolbar" class="btn-toolbar">
141 <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>
145 [% IF ( add_form ) %]
146 <h1>[% IF ( frameworkcode ) %]Modify framework text[% ELSE %]Add framework[% END %]</h1>
147 <form action="[% script_name %]" name="Aform" method="post" onsubmit="return Check(this);">
148 <input type="hidden" name="op" value="add_validate" />
149 <fieldset class="rows">
151 [% IF ( frameworkcode ) %]
152 <li><span class="label">Framework code</span><input type="hidden" id="frameworkcode" name="frameworkcode" value="[% frameworkcode %]" />[% frameworkcode %]
153 <input type="hidden" name="modif" value="1" />
156 <li><label for="frameworkcode">Framework code</label><input type="text" id="frameworkcode" name="frameworkcode" size="4" maxlength="4" onblur="toUC(this)" /></li>
158 <li><label for="description">Description</label>
159 <input type="text" name="frameworktext" id="description" size="40" maxlength="80" value="[% frameworktext |html %]" /></li></ol></fieldset>
160 <fieldset class="action"> <input type="submit" value="Submit" class="submit" /></fieldset>
164 [% IF ( delete_confirm ) %]
165 <div class="dialog alert">
166 <h3>Delete framework for [% frameworktext %] ([% frameworkcode %])?</h3>
168 <p><strong>This framework is used [% total %] times</strong>.</p>
170 <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!" />
172 <form class="inline" action="[% script_name %]" method="get"><input type="submit" class="deny" value="No, do not delete!" /></form>
177 <h1>MARC frameworks</h1>
178 <p>Framework name, then go to MARC biblio to set MARC editor parameters</p>
186 <th title="Export framework structure (fields, subfields) to a spreadsheet file (.csv, .xml, .ods) or SQL file">Export</th>
187 <th title="Import framework structure (fields, subfields) from a spreadsheet file (.csv, .xml, .ods) or SQL file">Import</th>
191 <td>Default framework</td>
192 <td><a href="marctagstructure.pl?frameworkcode=[% frameworkcode %]">MARC structure</a></td>
195 <td><div class="import_export"><a class="import_export_fw" href="#" title="Export [% frameworkcode %] framework structure (fields, subfields) to a spreadsheet file (.csv, .xml, .ods) or SQL file">Export</a>
196 <div class="import_export_options">
197 <form action="import_export_framework.pl" name="form_[% frameworkcode %]" method="get" target="_blank" class="form_export">
198 <fieldset class="rows">
199 <legend>Export framework</legend>
200 <input type="hidden" name="frameworkcode" value="[% frameworkcode %]" />
202 <li><label for="csv_type_export_[% frameworkcode %]">Export to CSV spreadsheet</label><input type="radio" name="type_export_[% frameworkcode %]" value="csv" id="csv_type_export_[% frameworkcode %]" checked="checked" /></li>
203 <li><label for="xml_type_export_[% frameworkcode %]">Export to Excel with XML format, compatible with OpenOffice/LibreOffice as well</label><input type="radio" name="type_export_[% frameworkcode %]" value="excel" id="xml_type_export_[% frameworkcode %]" /></li>
204 <li><label for="ods_type_export_[% frameworkcode %]">Export to OpenDocument spreadsheet format</label><input type="radio" name="type_export_[% frameworkcode %]" value="ods" id="ods_type_export_[% frameworkcode %]" /></li>
205 <li><label for="sql_type_export_[% frameworkcode %]">Export to SQL</label><input type="radio" name="type_export_[% frameworkcode %]" value="sql" id="sql_type_export_[% frameworkcode %]" /></li>
208 <fieldset class="action"><input type="submit" href="#" value="Export" title="Export to a spreadsheet" /> <a href="#" class="import_export_close cancel">Cancel</a> </fieldset>
213 <td><div class="import_export"><a href="#" class="import_export_fw" title="Import [% frameworkcode %] framework structure (fields, subfields) from a spreadsheet file (.csv, .xml, .ods) or SQL file">Import</a>
214 <div class="import_export_options">
215 <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">
216 <fieldset class="rows">
217 <legend>Import [% frameworkcode %] framework structure (fields and subfields) from a spreadsheet file (.csv, .xml, .ods) or SQL file</legend>
218 <input type="hidden" name="frameworkcode" value="[% frameworkcode %]" />
219 <input type="hidden" name="action" value="import" />
221 <li><label for="d_file_import_[% frameworkcode %]">Upload file:</label><input type="file" name="file_import_[% frameworkcode %]" id="d_file_import_[% frameworkcode %]" class="input_import" value="" autocomplete="off" /></li>
222 <li><div id="importing_[% frameworkcode %]" style="display:none" class="importing"><img src="/intranet-tmpl/prog/img/loading-small.gif" /><span class="importing_msg"></span></div></li>
225 <fieldset class="action"><input type="submit" value="Import" /> <a href="#" class="import_export_close cancel">Cancel</a> </fieldset>
231 <!-- note highlight assignment appears backwards because we already have a normal row for Default -->
232 [% FOREACH loo IN loop %]
233 [% IF ( loop.odd ) %]<tr class="highlight">
236 <td>[% loo.frameworkcode %]</td>
237 <td>[% loo.frameworktext %]</td>
238 <td><a href="marctagstructure.pl?frameworkcode=[% loo.frameworkcode %]" >MARC structure</a></td>
239 <td><a href="[% loo.script_name %]?op=add_form&frameworkcode=[% loo.frameworkcode |html %]">Edit</a></td>
240 <td><a href="[% loo.script_name %]?op=delete_confirm&frameworkcode=[% loo.frameworkcode |html %]">Delete</a></td>
242 <div class="import_export"><a class="import_export_fw" href="#" title="Export [% loo.frameworkcode %] framework structure (fields and subfields) to a spreadsheet file (.csv, .xml, .ods) or SQL file">Export</a>
243 <div class="import_export_options">
244 <form action="import_export_framework.pl" name="form_[% loo.frameworkcode %]" method="get" target="_blank" class="form_export">
245 <fieldset class="rows">
246 <legend>Export framework</legend>
247 <input type="hidden" name="frameworkcode" value="[% loo.frameworkcode %]" />
249 <li><label for="csv_type_export_[% loo.frameworkcode %][% loop.count %]">Export to CSV spreadsheet</label><input type="radio" name="type_export_[% loo.frameworkcode %]" value="csv" id="csv_type_export_[% loo.frameworkcode %][% loop.count %]" checked="checked" /></li>
250 <li><label for="xml_type_export_[% loo.frameworkcode %][% loop.count %]">Export to Excel as XML format, compatible with OpenOffice/LibreOffice as well</label><input type="radio" name="type_export_[% loo.frameworkcode %]" value="excel" id="xml_type_export_[% loo.frameworkcode %][% loop.count %]" /></li>
251 <li><label for="ods_type_export_[% loo.frameworkcode %][% loop.count %]">Export to OpenDocument spreadsheet format</label><input type="radio" name="type_export_[% loo.frameworkcode %]" value="ods" id="ods_type_export_[% loo.frameworkcode %][% loop.count %]" /></li>
252 <li><label for="sql_type_export_[% loo.frameworkcode %][% loop.count %]">Export to SQL</label><input type="radio" name="type_export_[% loo.frameworkcode %]" value="sql" id="sql_type_export_[% loo.frameworkcode %][% loop.count %]" /></li>
255 <fieldset class="action"><input type="submit" href="#" value="Export" title="Export to a spreadsheet" /> <a href="#" class="cancel import_export_close">Cancel</a> </fieldset>
260 <td><div class="import_export"><a class="import_export_fw" href="#" title="Import [% loo.frameworkcode %] framework structure (fields and subfields) from a spreadsheet file (.csv, .xml, .ods) or SQL file">Import</a>
261 <div class="import_export_options">
262 <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">
263 <fieldset class="rows">
264 <legend>Import [% frameworkcode %] framework structure (fields and subfields) from a spreadsheet file (.csv, .xml, .ods) or SQL file</legend>
265 <input type="hidden" name="frameworkcode" value="[% loo.frameworkcode %]" />
266 <input type="hidden" name="action" value="import" />
268 <li><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" value="" autocomplete="off" /></li>
271 <fieldset class="action"><input type="submit" value="Import" /><div id="importing_[% loo.frameworkcode %]" style="display:none" class="importing"><img src="/intranet-tmpl/prog/img/loading-small.gif" /><span class="importing_msg"></span></div> <a href="#" class="cancel import_export_close">Cancel</a> </fieldset>
279 [% IF ( previous ) %]<a href="[% previous %]"><< Previous</a>[% END %]
280 [% IF ( next ) %]<a href="[% next %]">Next >></a>[% END %]
286 [% INCLUDE 'admin-menu.inc' %]
289 [% INCLUDE 'intranet-bottom.inc' %]