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' %]
15 <body id="admin_biblio_framework" class="admin">
16 [% INCLUDE 'header.inc' %]
17 [% INCLUDE 'prefs-admin-search.inc' %]
19 <div id="breadcrumbs">
20 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
21 › <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
22 › <a href="/cgi-bin/koha/admin/biblio_framework.pl">MARC frameworks</a>
23 [% IF op == 'add_form' %]
24 › [% IF framework %]Modify framework text[% ELSE %]Add framework[% END %]
25 [% ELSIF op == 'delete_confirm' %]
26 › Delete framework for [% framework.frameworktext | html %] ([% framework.frameworkcode | html %])?
30 <div class="main container-fluid">
32 <div class="col-sm-10 col-sm-push-2">
35 [% FOR m IN messages %]
36 <div class="dialog [% m.type | html %]">
38 [% CASE 'error_on_update' %]
39 An error occurred when updating this framework. Perhaps it already exists.
40 [% CASE 'error_on_insert' %]
41 An error occurred when adding this framework. The framework might already exist.
42 [% CASE 'error_on_delete' %]
43 An error occurred when deleting this framework. Check the logs.
44 [% CASE 'success_on_update' %]
45 Framework updated successfully.
46 [% CASE 'success_on_insert' %]
47 Framework added successfully.
48 [% CASE 'success_on_delete' %]
49 Framework deleted successfully.
50 [% CASE 'already_exists' %]
51 This framework code already exists.
61 <div id="toolbar" class="btn-toolbar">
62 <a class="btn btn-default" id="newframework" href="/cgi-bin/koha/admin/biblio_framework.pl?op=add_form"><i class="fa fa-plus"></i> New framework</a>
66 [% IF op == 'add_form' %]
67 <h1>[% IF framework %]Modify framework text[% ELSE %]Add framework[% END %]</h1>
68 <form action="/cgi-bin/koha/admin/biblio_framework.pl" name="Aform" method="post" class="validated">
69 <input type="hidden" name="op" value="add_validate" />
70 <fieldset class="rows">
74 <span class="label">Framework code: </span>
75 <input type="hidden" id="frameworkcode" name="frameworkcode" value="[% framework.frameworkcode | html %]" />[% framework.frameworkcode | html %]
76 <input type="hidden" name="is_a_modif" value="1" />
80 <label for="frameworkcode" class="required">Framework code: </label>
81 <input type="text" id="frameworkcode" name="frameworkcode" size="4" maxlength="4" required="required" class="required" />
82 <span class="required">Required</span>
86 <label for="description" class="required">Description: </label>
87 <input type="text" name="frameworktext" id="description" size="40" maxlength="80" value="[% framework.frameworktext | html %]" required="required" class="required" />
88 <span class="required">Required</span>
92 <fieldset class="action">
93 <input type="submit" value="Submit" class="submit" />
98 [% IF op == 'delete_confirm' %]
99 <div class="dialog alert">
100 [% IF biblios_use_this_framework %]
101 <h3>This framework cannot be deleted</h3>
102 <p><strong><span class="ex">[% framework.frameworktext | html %] ([% framework.frameworkcode | html %])</span></strong></p>
103 <p>The framework is used [% biblios_use_this_framework | html %] times.</p>
104 <form action="/cgi-bin/koha/admin/biblio_framework.pl" method="get">
105 <button type="submit"><i class="fa fa-fw fa-arrow-left"></i> Return to frameworks</button>
108 <h3>Delete framework for [% framework.frameworktext | html %] ([% framework.frameworkcode | html %])?</h3>
109 <form class="inline" action="/cgi-bin/koha/admin/biblio_framework.pl" method="post">
110 <input type="hidden" name="op" value="delete_confirmed" />
111 <input type="hidden" name="frameworkcode" value="[% framework.frameworkcode | html %]" />
112 <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete this framework</button>
114 <form class="inline" action="/cgi-bin/koha/admin/biblio_framework.pl" method="get">
115 <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
121 [% IF op == 'list' %]
122 <h1>MARC frameworks</h1>
124 <table id="table_biblio_frameworks">
135 <td>Default framework</td>
137 <div class="dropdown">
138 <a class="btn btn-default btn-xs dropdown-toggle" id="frameworkactions[% loo.frameworkcode | html %]" role="button" data-toggle="dropdown" href="#">
139 Actions <b class="caret"></b>
141 <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="frameworkactions[% loo.frameworkcode | html %]">
142 <li><a href="marctagstructure.pl?frameworkcode="><i class="fa fa-eye"></i> MARC structure</a></li>
143 <!-- Trigger modal -->
144 <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>
145 <!-- Trigger modal -->
146 <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>
148 <!-- Modal to export default framework -->
149 <div class="modal" id="exportModal_default" tabindex="-1" role="dialog" aria-labelledby="exportLabelexportModal_default" aria-hidden="true">
150 <div class="modal-dialog">
151 <div class="modal-content">
152 <div class="modal-header">
153 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
154 <h3 id="exportLabelexportModal_default">Export default framework</h3>
156 <form action="import_export_framework.pl" name="form_defaul" method="get" target="_blank" class="form_export">
157 <div class="modal-body">
159 <input type="hidden" name="frameworkcode" value="" />
160 <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>
161 <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>
162 <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>
165 <div class="modal-footer">
166 <button type="submit" class="btn btn-default">Export</button>
167 <button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Cancel</button>
174 <!-- Modal to import default framework -->
175 <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">
176 <div class="modal-dialog">
177 <div class="modal-content">
178 <div class="modal-header">
179 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
180 <h3 id="importLabelexportModal_[% framework.frameworkcode | html %][% frameworks.count | html %]">Import default framework structure (fields and subfields) from a spreadsheet file (.csv, .xml, .ods)</h>
182 <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">
183 <div class="modal-body">
184 <input type="hidden" name="frameworkcode" value="default" />
185 <input type="hidden" name="action" value="import" />
186 <p><label for="file_import_default">Upload file:</label> <input type="file" name="file_import_default" id="file_import_default" class="input_import" /></p>
187 <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>
189 <div class="modal-footer">
190 <button type="submit" class="btn btn-default">Import</button>
191 <button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Close</button>
201 [% FOREACH loo IN frameworks %]
203 <td>[% loo.frameworkcode | html %]</td>
204 <td>[% loo.frameworktext | html %]</td>
206 <div class="dropdown">
207 <a class="btn btn-default btn-xs dropdown-toggle" id="frameworkactions[% loo.frameworkcode | html %]" role="button" data-toggle="dropdown" href="#">
208 Actions <b class="caret"></b>
210 <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="frameworkactions[% loo.frameworkcode | html %]">
211 <li><a href="marctagstructure.pl?frameworkcode=[% loo.frameworkcode | uri %]"><i class="fa fa-eye"></i> MARC structure</a></li>
212 <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>
213 <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>
214 <!-- Trigger modal -->
215 <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>
216 <!-- Trigger modal -->
217 <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>
219 <!-- Modal to export other framework -->
220 <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">
221 <div class="modal-dialog">
222 <div class="modal-content">
223 <div class="modal-header">
224 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
225 <h3 id="exportLabelexportModal_[% loo.frameworkcode | html %][% loop.count | html %]">Export [% loo.frameworktext | html %] framework</h3>
227 <form action="import_export_framework.pl" name="form_[% loo.frameworkcode | html %]" method="get" target="_blank" class="form_export">
228 <div class="modal-body">
230 <input type="hidden" name="frameworkcode" value="[% loo.frameworkcode | html %]" />
231 <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>
232 <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>
233 <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>
236 <div class="modal-footer">
237 <button type="submit" class="btn btn-default">Export</button>
238 <button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Cancel</button>
245 <!-- Modal to import other framework -->
246 <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">
247 <div class="modal-dialog">
248 <div class="modal-content">
249 <div class="modal-header">
250 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
251 <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>
253 <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">
254 <div class="modal-body">
255 <input type="hidden" name="frameworkcode" value="[% loo.frameworkcode | html %]" />
256 <input type="hidden" name="action" value="import" />
257 <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>
258 <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>
260 <div class="modal-footer">
261 <button type="submit" class="btn btn-default" title="[% loo.frameworkcode | html %]">Import</button>
262 <button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Close</button>
278 </div> <!-- /.col-sm-10.col-sm-push-2 -->
280 <div class="col-sm-2 col-sm-pull-10">
282 [% INCLUDE 'admin-menu.inc' %]
284 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
285 </div> <!-- /.row -->
287 [% MACRO jsinclude BLOCK %]
288 [% INCLUDE 'datatables.inc' %]
289 [% Asset.js("js/admin-menu.js") | $raw %]
291 /* Set some variable needed in biblio_framework.js */
292 var MSG_IMPORT_ERROR = _("Error importing the framework");
293 var MSG_SELECT_FILE_FORMAT = _("Please select a CSV (.csv), ODS (.ods) or XML (.xml) spreadsheet file.");
294 var MSG_IMPORTING_TO_FRAMEWORK = _("Importing to framework: %s. Importing from file: %s.");
295 var template_path = "[% interface | html %]/[% theme | html %]";
297 [% Asset.js("js/biblio_framework.js") | $raw %]
299 [% INCLUDE 'intranet-bottom.inc' %]