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;
46 $(document).ready(function() {
47 new YAHOO.widget.Button("newframework");
51 <script type="text/javascript">
52 /* Import/Export from/to spreadsheet */
54 var importing = false;
56 $(document).ready(function() {
57 $("body").css("cursor", "auto");
58 $('.import_export_options').hide();
59 $('a.import_export_fw').click(function() {
61 $('.import_export_options').hide();
62 $(this).next().show('slide');
66 $('.import_export_close').click(function() {
68 $('.import_export_options').fadeOut('fast');
69 $("body").css("cursor", "auto");
72 $('.input_import').val("");
74 var matches = new RegExp("\\?error_import_export=(.+)$").exec(window.location.search);
75 if (matches && matches.length > 1) {
76 alert(_("Error importing the framework ") + decodeURIComponent(matches[1]));
81 $('input.input_import').change( function() {
82 var filename = $(this).val();
83 if ( ! /(?:\.csv|\.sql|\.ods|\.xml)$/.test(filename)) {
84 $(this).css("background-color","yellow");
85 alert(_('Please select an ods or xml file'));
87 $(this).css("background-color","white");
90 $('form.form_export').submit(function() {
91 $('.import_export_options').hide();
94 $('form.form_import').submit(function() {
95 var id = $(this).attr('id');
96 var obj = $('#' + id + ' input:file');
97 if (/(?:\.csv|\.sql|\.ods|\.xml)$/.test(obj.val())) {
98 if (confirm('Do you really want to import the framework fields/subfields (will overwrite current configuration, for safety reasons please make before an export to have a backup file)?')) {
99 var frameworkcode = $('#' + id + ' input:hidden[name=frameworkcode]').val();
100 $('#importing_' + frameworkcode).find("span").html("Importing <strong>" + frameworkcode + "</strong> from <i>" + obj.val().replace(new RegExp("^.+[/\\\\]"),"") + "</i>");
101 if (navigator.userAgent.toLowerCase().indexOf('msie') != -1) {
102 var timestamp = new Date().getTime();
103 $('#importing_' + frameworkcode).find("img").attr('src', '/intranet-tmpl/prog/img/loading.gif' + '?' +timestamp);
105 $('#importing_' + frameworkcode).css('display', 'block');
106 if (navigator.userAgent.toLowerCase().indexOf('firefox') == -1) $("body").css("cursor", "progress");
112 obj.css("background-color","yellow");
113 alert(_('Please select an spreadsheet (csv, ods, xml) or sql file'));
115 obj.css("background-color","white");
126 [% INCLUDE 'header.inc' %]
127 [% INCLUDE 'cat-search.inc' %]
129 <div id="breadcrumbs">
130 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
131 › <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
132 › <a href="/cgi-bin/koha/admin/biblio_framework.pl">MARC Frameworks</a>
133 [% IF ( add_form ) %]
134 › [% IF ( frameworkcode ) %]Modify framework text[% ELSE %]Add framework[% END %]
135 [% ELSIF ( delete_confirm ) %]
136 › Delete Framework for [% frameworktext %] ([% frameworkcode %])?
140 <div id="doc3" class="yui-t2">
145 [% IF ( else ) %]<div id="toolbar">
147 <li><a id="newframework" href="/cgi-bin/koha/admin/biblio_framework.pl?op=add_form">New Framework</a></li>
150 [% IF ( add_form ) %]
151 <h1>[% IF ( frameworkcode ) %]Modify framework text[% ELSE %]Add framework[% END %]</h1>
152 <form action="[% script_name %]" name="Aform" method="post" onsubmit="return Check(this);">
153 <input type="hidden" name="op" value="add_validate" />
154 <fieldset class="rows">
156 [% IF ( frameworkcode ) %]
157 <li><span class="label">Framework Code</span><input type="hidden" id="frameworkcode" name="frameworkcode" value="[% frameworkcode %]" />[% frameworkcode %]
158 <input type="hidden" name="modif" value="1" />
161 <li><label for="frameworkcode">Framework Code</label><input type="text" id="frameworkcode" name="frameworkcode" size="4" maxlength="4" onblur="toUC(this)" /></li>
163 <li><label for="description">Description</label>
164 <input type="text" name="frameworktext" id="description" size="40" maxlength="80" value="[% frameworktext |html %]" /></li></ol></fieldset>
165 <fieldset class="action"> <input type="submit" value="Submit" class="submit" /></fieldset>
169 [% IF ( delete_confirm ) %]
170 <div class="dialog alert">
171 <h3>Delete framework for [% frameworktext %] ([% frameworkcode %])?</h3>
173 <p><strong>This framework is used [% total %] times</strong>.</p>
175 <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!" />
177 <form class="inline" action="[% script_name %]" method="get"><input type="submit" class="deny" value="No, Do not Delete!" /></form>
182 <h1>MARC Frameworks</h1>
183 <p>Framework name, then go to MARC biblio to set MARC editor parameters</p>
191 <th title="Export framework structure (fields, subfields) to a spreadsheet file (.csv, .xml, .ods) or SQL file">Export</th>
192 <th title="Import framework structure (fields, subfields) from a spreadsheet file (.csv, .xml, .ods) or SQL file">Import</th>
196 <td>Default framework</td>
197 <td><a href="marctagstructure.pl?frameworkcode=[% frameworkcode %]">MARC structure</a></td>
200 <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>
201 <div class="import_export_options">
202 <form action="import_export_framework.pl" name="form_[% frameworkcode %]" method="get" target="_blank" class="form_export">
203 <input type="hidden" name="frameworkcode" value="[% frameworkcode %]" />
205 <li class="li_close_import_export"><span class="import_export_close" title="Close popup">Close</span></li>
206 <li><input type="radio" name="type_export_[% frameworkcode %]" value="csv" id="type_export_[% frameworkcode %]" checked="checked" /><label for="type_export_[% frameworkcode %]" title="Export to CSV Spreadsheet">Export to CSV Spreadsheet</label></li>
207 <li><input type="radio" name="type_export_[% frameworkcode %]" value="excel" id="type_export_[% frameworkcode %]" /><label for="type_export_[% frameworkcode %]" title="Export to Excel as xml format, compatible with OpenOffice/LibreOffice as well">Export to Excel with xml format</label></li>
208 <li><input type="radio" name="type_export_[% frameworkcode %]" value="ods" id="type_export_[% frameworkcode %]" /><label for="type_export_[% frameworkcode %]">Export to OpenDocument Spreadsheet format</label></li>
209 <li><input type="radio" name="type_export_[% frameworkcode %]" value="sql" id="type_export_[% frameworkcode %]" /><label for="type_export_[% frameworkcode %]" title="Export to SQL">Export to SQL</label></li>
210 <li><input type="submit" class="export_ok" href="#" value="Export" title="Export to a spreadsheet" /></li>
216 <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>
217 <div class="import_export_options">
218 <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">
219 <input type="hidden" name="frameworkcode" value="[% frameworkcode %]" />
220 <input type="hidden" name="action" value="import" />
222 <li class="li_close_import_export"><span class="import_export_close" title="Close popup">Close</span></li>
223 <li><label for="file_import_[% frameworkcode %]" title="Import from a spreadsheet, formats available: ods, xml (formatted from excel)">Spreadsheet file</label><input type="file" name="file_import_[% frameworkcode %]" id="file_import_[% frameworkcode %]" class="input_import" value="" autocomplete="off" /></li>
224 <li><input type="submit" class="import_ok" value="Import" title="Import from a spreadsheet" /><div id="importing_[% frameworkcode %]" style="display:none" class="importing"><img src="/intranet-tmpl/prog/img/loading.gif" /><span class="importing_msg"></span></div></li>
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, 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 <input type="hidden" name="frameworkcode" value="[% loo.frameworkcode %]" />
247 <li class="li_close_import_export"><span class="import_export_close" title="Close popup">Close</span></li>
248 <li><input type="radio" name="type_export_[% loo.frameworkcode %]" value="csv" id="type_export_[% loo.frameworkcode %]" checked="checked" /><label for="type_export_[% loo.frameworkcode %]" title="Export to CSV Spreadsheet">Export to CSV Spreadsheet</label></li>
249 <li><input type="radio" name="type_export_[% loo.frameworkcode %]" value="excel" id="type_export_[% loo.frameworkcode %]" /><label for="type_export_[% loo.frameworkcode %]" title="Export to Excel as xml format, compatible with OpenOffice/LibreOffice as well">Export to Excel as xml format</label></li>
250 <li><input type="radio" name="type_export_[% loo.frameworkcode %]" value="ods" id="type_export_[% loo.frameworkcode %]" /><label for="type_export_[% loo.frameworkcode %]">Export to OpenDocument Spreadsheet format</label></li>
251 <li><input type="radio" name="type_export_[% loo.frameworkcode %]" value="sql" id="type_export_[% loo.frameworkcode %]" /><label for="type_export_[% loo.frameworkcode %]" title="Export to SQL">Export to SQL</label></li>
252 <li><input type="submit" class="export_ok" href="#" value="Export" title="Export to a spreadsheet" /></li>
258 <td><div class="import_export"><a class="import_export_fw" href="#" title="Import [% loo.frameworkcode %] framework structure (fields, subfields) from a spreadsheet file (.csv, .xml, .ods) or SQL file">Import</a>
259 <div class="import_export_options">
260 <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">
261 <input type="hidden" name="frameworkcode" value="[% loo.frameworkcode %]" />
262 <input type="hidden" name="action" value="import" />
264 <li class="li_close_import_export"><span class="import_export_close" title="Close popup">Close</span></li>
265 <li><label for="file_import_[% loo.frameworkcode %]" title="Import from a spreadsheet, formats available: ods, xml (formatted from excel)">Spreadsheet file</label><input type="file" name="file_import_[% loo.frameworkcode %]" id="file_import_[% loo.frameworkcode %]" class="input_import" value="" autocomplete="off" /></li>
266 <li><input type="submit" class="import_ok" value="Import" title="Import from a spreadsheet" /><div id="importing_[% loo.frameworkcode %]" style="display:none" class="importing"><img src="/intranet-tmpl/prog/img/loading.gif" /><span class="importing_msg"></span></div></li>
275 [% IF ( previous ) %]<a href="[% previous %]"><< Previous</a>[% END %]
276 [% IF ( next ) %]<a href="[% next %]">Next >></a>[% END %]
282 [% INCLUDE 'admin-menu.inc' %]
285 [% INCLUDE 'intranet-bottom.inc' %]