4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>Koha › Administration › MARC frameworks
6 [% IF op == 'add_form' %]
7 › [% IF framework %]Modify framework text[% ELSE %]Add framework[% END %]
8 [% ELSIF op == 'delete_confirm' %]
9 › Delete framework for [% framework.frameworktext | html %] ([% framework.frameworkcode | html %])?
12 [% INCLUDE 'doc-head-close.inc' %]
13 [% Asset.css("css/datatables.css") | $raw %]
16 <body id="admin_biblio_framework" class="admin">
17 [% INCLUDE 'header.inc' %]
18 [% INCLUDE 'prefs-admin-search.inc' %]
20 <div id="breadcrumbs">
21 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
22 › <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
23 › <a href="/cgi-bin/koha/admin/biblio_framework.pl">MARC frameworks</a>
24 [% IF op == 'add_form' %]
25 › [% IF framework %]Modify framework text[% ELSE %]Add framework[% END %]
26 [% ELSIF op == 'delete_confirm' %]
27 › Delete framework for [% framework.frameworktext | html %] ([% framework.frameworkcode | html %])?
31 <div class="main container-fluid">
33 <div class="col-sm-10 col-sm-push-2">
36 [% FOR m IN messages %]
37 <div class="dialog [% m.type | html %]">
39 [% CASE 'error_on_update' %]
40 An error occurred when updating this framework. Perhaps it already exists.
41 [% CASE 'error_on_insert' %]
42 An error occurred when adding this framework. The framework might already exist.
43 [% CASE 'error_on_delete' %]
44 An error occurred when deleting this framework. Check the logs.
45 [% CASE 'success_on_update' %]
46 Framework updated successfully.
47 [% CASE 'success_on_insert' %]
48 Framework added successfully.
49 [% CASE 'success_on_delete' %]
50 Framework deleted successfully.
51 [% CASE 'already_exists' %]
52 This framework code already exists.
62 <div id="toolbar" class="btn-toolbar">
63 <a class="btn btn-default btn-sm" id="newframework" href="/cgi-bin/koha/admin/biblio_framework.pl?op=add_form"><i class="fa fa-plus"></i> New framework</a>
67 [% IF op == 'add_form' %]
68 <h1>[% IF framework %]Modify framework text[% ELSE %]Add framework[% END %]</h1>
69 <form action="/cgi-bin/koha/admin/biblio_framework.pl" name="Aform" method="post" class="validated">
70 <input type="hidden" name="op" value="add_validate" />
71 <fieldset class="rows">
75 <span class="label">Framework code: </span>
76 <input type="hidden" id="frameworkcode" name="frameworkcode" value="[% framework.frameworkcode | html %]" />[% framework.frameworkcode | html %]
77 <input type="hidden" name="is_a_modif" value="1" />
81 <label for="frameworkcode" class="required">Framework code: </label>
82 <input type="text" id="frameworkcode" name="frameworkcode" size="4" maxlength="4" required="required" class="required" />
83 <span class="required">Required</span>
87 <label for="description" class="required">Description: </label>
88 <input type="text" name="frameworktext" id="description" size="40" maxlength="80" value="[% framework.frameworktext | html %]" required="required" class="required" />
89 <span class="required">Required</span>
93 <fieldset class="action">
94 <input type="submit" value="Submit" class="submit" />
99 [% IF op == 'delete_confirm' %]
100 <div class="dialog alert">
101 [% IF biblios_use_this_framework %]
102 <h3>This framework cannot be deleted</h3>
103 <p><strong><span class="ex">[% framework.frameworktext | html %] ([% framework.frameworkcode | html %])</span></strong></p>
104 <p>The framework is used [% biblios_use_this_framework | html %] times.</p>
105 <form action="/cgi-bin/koha/admin/biblio_framework.pl" method="get">
106 <button type="submit"><i class="fa fa-fw fa-arrow-left"></i> Return to frameworks</button>
109 <h3>Delete framework for [% framework.frameworktext | html %] ([% framework.frameworkcode | html %])?</h3>
110 <form class="inline" action="/cgi-bin/koha/admin/biblio_framework.pl" method="post">
111 <input type="hidden" name="op" value="delete_confirmed" />
112 <input type="hidden" name="frameworkcode" value="[% framework.frameworkcode | html %]" />
113 <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete this framework</button>
115 <form class="inline" action="/cgi-bin/koha/admin/biblio_framework.pl" method="get">
116 <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
122 [% IF op == 'list' %]
123 <h1>MARC frameworks</h1>
125 <table id="table_biblio_frameworks">
136 <td>Default framework</td>
138 <div class="dropdown">
139 <a class="btn btn-default btn-xs dropdown-toggle" id="frameworkactions[% loo.frameworkcode | html %]" role="button" data-toggle="dropdown" href="#">
140 Actions <b class="caret"></b>
142 <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="frameworkactions[% loo.frameworkcode | html %]">
143 <li><a href="marctagstructure.pl?frameworkcode="><i class="fa fa-eye"></i> MARC structure</a></li>
144 <!-- Trigger modal -->
145 <li><a href="#" data-toggle="modal" data-target="#exportModal_default" title="Export framework structure (fields, subfields) to a spreadsheet file (.csv, .xml, .ods)"><i class="fa fa-upload"></i> Export</a></li>
146 <!-- Trigger modal -->
147 <li><a href="#" data-toggle="modal" data-target="#importModal_[% framework.frameworkcode | html %][% frameworks.count | html %]" title="Import framework structure (fields, subfields) from a spreadsheet file (.csv, .xml, .ods)"><i class="fa fa-download"></i> Import</a></li>
149 <!-- Modal to export default framework -->
150 <div class="modal" id="exportModal_default" tabindex="-1" role="dialog" aria-labelledby="exportLabelexportModal_default" aria-hidden="true">
151 <div class="modal-dialog">
152 <div class="modal-content">
153 <div class="modal-header">
154 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
155 <h3 id="exportLabelexportModal_default">Export default framework</h3>
157 <form action="import_export_framework.pl" name="form_defaul" method="get" target="_blank" class="form_export">
158 <div class="modal-body">
160 <input type="hidden" name="frameworkcode" value="" />
161 <p><label for="csv_type_export_default"><input type="radio" name="type_export_default" value="csv" id="csv_type_export_default" checked="checked" /> Export to CSV spreadsheet</label></p>
162 <p><label for="xml_type_export_default"><input type="radio" name="type_export_default" value="excel" id="xml_type_export_default" /> Export to Excel with XML format, compatible with OpenOffice/LibreOffice as well</label></p>
163 <p><label for="ods_type_export_default"><input type="radio" name="type_export_default" value="ods" id="ods_type_export_default" /> Export to OpenDocument spreadsheet format</label></p>
166 <div class="modal-footer">
167 <button type="submit" class="btn btn-default">Export</button>
168 <button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Cancel</button>
175 <!-- Modal to import default framework -->
176 <div class="modal" id="importModal_[% framework.frameworkcode | html %][% frameworks.count | html %]" tabindex="-1" role="dialog" aria-labelledby="importLabelexportModal_default[% frameworks.count | html %]" aria-hidden="true">
177 <div class="modal-dialog">
178 <div class="modal-content">
179 <div class="modal-header">
180 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
181 <h3 id="importLabelexportModal_[% framework.frameworkcode | html %][% frameworks.count | html %]">Import default framework structure (fields and subfields) from a spreadsheet file (.csv, .xml, .ods)</h>
183 <form action="/cgi-bin/koha/admin/import_export_framework.pl" name="form_i_default" id="form_i_default" method="post" enctype="multipart/form-data" class="form_import">
184 <div class="modal-body">
185 <input type="hidden" name="frameworkcode" value="default" />
186 <input type="hidden" name="action" value="import" />
187 <p><label for="file_import_default">Upload file:</label> <input type="file" name="file_import_default" id="file_import_default" class="input_import" /></p>
188 <div id="importing_default" style="display:none" class="importing"><img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif" alt="" /><span class="importing_msg"></span></div>
190 <div class="modal-footer">
191 <button type="submit" class="btn btn-default">Import</button>
192 <button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Close</button>
202 [% FOREACH loo IN frameworks %]
204 <td>[% loo.frameworkcode | html %]</td>
205 <td>[% loo.frameworktext | html %]</td>
207 <div class="dropdown">
208 <a class="btn btn-default btn-xs dropdown-toggle" id="frameworkactions[% loo.frameworkcode | html %]" role="button" data-toggle="dropdown" href="#">
209 Actions <b class="caret"></b>
211 <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="frameworkactions[% loo.frameworkcode | html %]">
212 <li><a href="marctagstructure.pl?frameworkcode=[% loo.frameworkcode | uri %]"><i class="fa fa-eye"></i> MARC structure</a></li>
213 <li><a href="/cgi-bin/koha/admin/biblio_framework.pl?op=add_form&frameworkcode=[% loo.frameworkcode | uri %]"><i class="fa fa-pencil"></i> Edit</a></li>
214 <li><a href="/cgi-bin/koha/admin/biblio_framework.pl?op=delete_confirm&frameworkcode=[% loo.frameworkcode | uri %]"><i class="fa fa-trash"></i> Delete</a></li>
215 <!-- Trigger modal -->
216 <li><a href="#" data-toggle="modal" data-target="#exportModal_[% loo.frameworkcode | html %][% loop.count | html %]" title="Export framework structure (fields, subfields) to a spreadsheet file (.csv, .xml, .ods)"><i class="fa fa-upload"></i> Export</a></li>
217 <!-- Trigger modal -->
218 <li><a href="#" data-toggle="modal" data-target="#importModal_[% loo.frameworkcode | html %][% loop.count | html %]" title="Import framework structure (fields, subfields) from a spreadsheet file (.csv, .xml, .ods)"><i class="fa fa-download"></i> Import</a></li>
220 <!-- Modal to export other framework -->
221 <div class="modal" id="exportModal_[% loo.frameworkcode | html %][% loop.count | html %]" tabindex="-1" role="dialog" aria-labelledby="exportLabelexportModal_[% loo.frameworkcode | html %][% loop.count | html %]" aria-hidden="true">
222 <div class="modal-dialog">
223 <div class="modal-content">
224 <div class="modal-header">
225 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
226 <h3 id="exportLabelexportModal_[% loo.frameworkcode | html %][% loop.count | html %]">Export [% loo.frameworktext | html %] framework</h3>
228 <form action="import_export_framework.pl" name="form_[% loo.frameworkcode | html %]" method="get" target="_blank" class="form_export">
229 <div class="modal-body">
231 <input type="hidden" name="frameworkcode" value="[% loo.frameworkcode | html %]" />
232 <p><label for="csv_type_export_[% loo.frameworkcode | html %][% loop.count | html %]"><input type="radio" name="type_export_[% loo.frameworkcode | html %]" value="csv" id="csv_type_export_[% loo.frameworkcode | html %][% loop.count | html %]" checked="checked" /> Export to CSV spreadsheet</label></p>
233 <p><label for="xml_type_export_[% loo.frameworkcode | html %][% loop.count | html %]"><input type="radio" name="type_export_[% loo.frameworkcode | html %]" value="excel" id="xml_type_export_[% loo.frameworkcode | html %][% loop.count | html %]" /> Export to Excel with XML format, compatible with OpenOffice/LibreOffice as well</label></p>
234 <p><label for="ods_type_export_[% loo.frameworkcode | html %][% loop.count | html %]"><input type="radio" name="type_export_[% loo.frameworkcode | html %]" value="ods" id="ods_type_export_[% loo.frameworkcode | html %][% loop.count | html %]" /> Export to OpenDocument spreadsheet format</label></p>
237 <div class="modal-footer">
238 <button type="submit" class="btn btn-default">Export</button>
239 <button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Cancel</button>
246 <!-- Modal to import other framework -->
247 <div class="modal" id="importModal_[% loo.frameworkcode | html %][% loop.count | html %]" tabindex="-1" role="dialog" aria-labelledby="importLabelexportModal_[% loo.frameworkcode | html %][% loop.count | html %]" aria-hidden="true">
248 <div class="modal-dialog">
249 <div class="modal-content">
250 <div class="modal-header">
251 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
252 <h3 id="importLabelexportModal_[% loo.frameworkcode | html %][% loop.count | html %]">Import [% loo.frameworkcode | html %] framework structure (fields and subfields) from a spreadsheet file (.csv, .xml, .ods)</h3>
254 <form action="/cgi-bin/koha/admin/import_export_framework.pl" name="form_i_[% loo.frameworkcode | html %]" id="form_i_[% loo.frameworkcode | html %]" method="post" enctype="multipart/form-data" class="form_import">
255 <div class="modal-body">
256 <input type="hidden" name="frameworkcode" value="[% loo.frameworkcode | html %]" />
257 <input type="hidden" name="action" value="import" />
258 <p><label for="file_import_[% loo.frameworkcode | html %]">Upload file:</label> <input type="file" name="file_import_[% loo.frameworkcode | html %]" id="file_import_[% loo.frameworkcode | html %]" class="input_import" /></p>
259 <div id="importing_[% loo.frameworkcode | html %]" style="display:none" class="importing"><img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif" alt="" /><span class="importing_msg"></span></div>
261 <div class="modal-footer">
262 <button type="submit" class="btn btn-default">Import</button>
263 <button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Close</button>
279 </div> <!-- /.col-sm-10.col-sm-push-2 -->
281 <div class="col-sm-2 col-sm-pull-10">
283 [% INCLUDE 'admin-menu.inc' %]
285 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
286 </div> <!-- /.row -->
288 [% MACRO jsinclude BLOCK %]
289 [% INCLUDE 'datatables.inc' %]
290 [% Asset.js("js/admin-menu.js") | $raw %]
292 /* Set some variable needed in biblio_framework.js */
293 var MSG_IMPORT_ERROR = _("Error importing the framework");
294 var MSG_SELECT_FILE_FORMAT = _("Please select a CSV (.csv), ODS (.ods) or XML (.xml) spreadsheet file.");
295 var MSG_OVERWRITE_WARNING = _("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");
296 var MSG_IMPORTING_TO_FRAMEWORK = _("Importing to framework: %s. Importing from file: %s.");
297 var template_path = "[% interface | html %]/[% theme | html %]";
299 [% Asset.js("js/biblio_framework.js") | $raw %]
301 [% INCLUDE 'intranet-bottom.inc' %]