1 [% INCLUDE 'doc-head-open.inc' %]<title>Koha › Tools › CSV export profiles</title>[% INCLUDE 'doc-head-close.inc' %]
2 <script type="text/javascript">
4 function reloadPage(p) {
6 if (id != 0) { document.location = "/cgi-bin/koha/tools/csv-profiles.pl?op=add_form&export_format_id=" + id; }
8 $(document).ready(function() {
9 $("#type").change(function(){
10 if ( $(this).find("option:selected").val() == "marc" ) {
11 $("li.marc_specific").show();
12 $("#marc_content").attr("required", "required");
13 $("li.sql_specific").hide();
14 $("#sql_content").removeAttr("required");
16 $("li.marc_specific").hide();
17 $("#marc_content").removeAttr("required");
18 $("li.sql_specific").show();
19 $("#sql_content").attr("required", "required");
28 <body id="tools_csv-profiles" class="tools">
29 [% INCLUDE 'header.inc' %]
30 [% INCLUDE 'cat-search.inc' %]
32 <div id="breadcrumbs">
33 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
34 › <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a>
35 › CSV export profiles
38 <div id="doc3" class="yui-t2">
43 [% FOR m IN messages %]
44 <div class="dialog [% m.type %]">
46 [% CASE 'error_on_update' %]
47 An error occurred when updating this CSV profile. Perhaps it already exists.
48 [% CASE 'error_on_insert' %]
49 An error occurred when adding this CSV profile.
50 [% CASE 'error_on_delete' %]
51 An error occurred when deleting this CSV profile. Check the logs.
52 [% CASE 'success_on_update' %]
53 CSV profile updated successfully.
54 [% CASE 'success_on_insert' %]
55 CSV profile added successfully.
56 [% CASE 'success_on_delete' %]
57 CSV profile deleted successfully.
58 [% CASE 'already_exists' %]
59 This CSV profile already exists.
66 [% BLOCK list_separator_options %]
67 [% IF selected_separator == ',' %]
68 <option value="," selected="selected">Comma (,)</option>
70 <option value=",">Comma (,)</option>
72 [% IF selected_separator == '|' %]
73 <option value="|" selected="selected">Pipe (|)</option>
75 <option value="|">Pipe (|)</option>
77 [% IF selected_separator == ';' %]
78 <option value=";" selected="selected">Semi-colon (;)</option>
80 <option value=";">Semi-colon (;)</option>
82 [% IF selected_separator == '#' %]
83 <option value="#" selected="selected">Sharp (#)</option>
85 <option value="#">Sharp (#)</option>
87 [% IF selected_separator == ' ' %]
88 <option value=" " selected="selected">Space ( )</option>
90 <option value=" ">Space ( )</option>
92 [% IF selected_separator == '\t' %]
93 <option value="\t" selected="selected">Tabulation (\t)</option>
95 <option value="\t">Tabulation (\t)</option>
97 [% IF selected_separator == '\n' %]
98 <option value="\n" selected="selected">New line (\n)</option>
100 <option value="\n">New line (\n)</option>
104 [% BLOCK type_description %]
105 [% IF type_code == 'marc' %] MARC
106 [% ELSIF type_code == 'sql' %] SQL
107 [% ELSE %] Unknown type
111 [% BLOCK used_for_description %]
112 [% IF used_for_code == 'export_records' %] Export records
113 [% ELSIF used_for_code == 'late_issues' %] Late serial issues claims
114 [% ELSIF used_for_code == 'export_basket' %] Basket export in acquisition
115 [% ELSE %] Unknown usage
119 [% IF op == 'add_form' %]
121 <h1>Modify a CSV profile</h1>
123 <h1>New CSV profile</h1>
126 <form action="/cgi-bin/koha/tools/csv-profiles.pl" class="validated" method="post">
127 <input type="hidden" name="op" value="add_validate" />
128 <input type="hidden" name="export_format_id" value="[% csv_profile.export_format_id %]" />
129 <fieldset class="rows">
132 <li><span class="label">Profile ID: </span>[% csv_profile.export_format_id %]</li>
135 <label for="profile" class="required">Profile name: </label>
136 <input type="text" name="profile" id="profile" value="[% csv_profile.profile %]" class="required">
137 <span class="required">Required</span>
140 <label for="type" class="required">Profile type: </label>
141 <select id="type" name="type">
142 [% FOREACH type IN [ 'marc' 'sql'] %]
143 [% IF csv_profile.type == type %]
144 <option value="[% type %]" selected="selected">[% PROCESS type_description type_code = type %]</option>
146 <option value="[% type %]">[% PROCESS type_description type_code = type %]</option>
150 <span class="required">Required</span>
152 <li class="sql_specific">
153 <label for="used_for_sql">Usage: </label>
154 <select id="used_for_sql" name="used_for_sql">
155 [% FOREACH used_for IN [ 'late_issues' 'export_basket' ] %]
156 [% IF csv_profile.used_for == used_for %]
157 <option value="[% used_for %]" selected="selected">[% PROCESS used_for_description used_for_code = used_for %]</option>
159 <option value="[% used_for %]">[% PROCESS used_for_description used_for_code = used_for %]</option>
164 <li class="marc_specific">
165 <label for="used_for_marc">Usage: </label>
166 <select id="used_for_marc" name="used_for_marc">
167 [% FOREACH used_for IN [ 'export_records' ] %]
168 [% IF csv_profile.used_for == used_for %]
169 <option value="[% used_for %]" selected="selected">[% PROCESS used_for_description used_for_code = used_for %]</option>
171 <option value="[% used_for %]">[% PROCESS used_for_description used_for_code = used_for %]</option>
177 <label for="description">Profile description: </label>
178 <textarea cols="50" rows="2" name="description" id="description">[% csv_profile.description %]</textarea>
181 <label for="csv_separator">CSV separator: </label>
182 <select name="csv_separator" id="csv_separator">
183 [% PROCESS list_separator_options selected_separator=csv_profile.csv_separator || ',' %]
187 <li class="marc_specific">
188 <label for="field_separator">Field separator: </label>
189 <select name="field_separator" id="field_separator">
190 [% PROCESS list_separator_options selected_separator=csv_profile.field_separator || '#' %]
194 <li class="marc_specific"><label for="subfield_separator">Subfield separator: </label>
195 <select name="subfield_separator" id="subfield_separator">
196 [% PROCESS list_separator_options selected_separator=csv_profile.subfield_separator || '|'%]
200 <li class="marc_specific"><label for="encoding">Encoding: </label>
201 <select name="encoding" id="encoding">
202 [% FOREACH encoding IN encodings %]
203 [% IF csv_profile.encoding == encoding
204 OR NOT csv_profile AND encoding == 'utf8' %]
205 <option selected="selected">[% encoding %]</option>
207 <option>[% encoding %]</option>
213 <li class="marc_specific">
214 <label for="marc_content" class="required">Profile MARC fields: </label>
215 <textarea cols="50" rows="2" name="marc_content" id="marc_content">[% csv_profile.content %]</textarea>
216 <span class="required">Required</span>
217 <p>You have to define which fields or subfields you want to export, separated by pipes.</p>
218 <p>You can also use your own headers (instead of the ones from Koha) by prefixing the field number with an header, followed by the equal sign.</p>
219 <p>Example: Personal name=200|Entry element=210$a|300|009</p>
220 <p>You can use Template Toolkit tags too. See the help page for more information.</p>
223 <li class="sql_specific">
224 <label for="late_issues_content" class="required">Profile SQL fields: </label>
225 <textarea cols="50" rows="2" name="sql_content" id="sql_content">[% csv_profile.content %]</textarea>
226 <p>You have to define which fields you want to export, separated by pipes.</p>
227 <p>You can also use your own headers (instead of the ones from Koha) by prefixing the field name with an header, followed by the equal sign.</p>
228 <p>Example: Name=subscription.name|Title=subscription.title|Issue number=serial.serialseq</p>
229 <p>For late issues claims you can use data from following tables: serial, subscription, biblio, biblioitems and aqbookseller.</p>
230 <p>For basket exports you can use data from following tables: biblio, biblioitems, aqorders, aqbudgets and aqbasket.</p>
234 <fieldset class="action">
235 <input type="submit" value="Submit" />
236 <a class="cancel" href="/cgi-bin/koha/tools/csv-profiles.pl">Cancel</a>
241 [% IF op == 'delete_confirm' %]
242 <div class="dialog alert">
244 <h3>Delete CSV Profile "[% csv_profile.profile %]?"</h3>
245 <form action="/cgi-bin/koha/tools/csv-profiles.pl" method="post">
246 <input type="hidden" name="op" value="delete_confirmed" />
247 <input type="hidden" name="export_format_id" value="[% csv_profile.export_format_id %]" />
248 <input type="submit" class="approve" value="Yes, delete" />
250 <form action="/cgi-bin/koha/tools/csv-profiles.pl" method="get">
251 <input type="submit" class="deny" value="No, do not Delete" />
254 This CSV Profile does not exist.
259 [% IF op == 'list' %]
261 <div id="toolbar" class="btn-toolbar">
262 <a class="btn btn-default btn-sm" id="newcsvprofile" href="/cgi-bin/koha/tools/csv-profiles.pl?op=add_form"><i class="fa fa-plus"></i> New CSV profile</a>
265 <h2>CSV profiles</h2>
267 [% IF csv_profiles %]
268 <table id="table_csv_profiles">
270 <th>CSV profile ID</th>
274 <th>CSV separator</th>
281 [% FOREACH csv_profile IN csv_profiles %]
283 <td>[% csv_profile.export_format_id %]</td>
284 <td>[% csv_profile.profile %]</td>
285 <td>[% csv_profile.description %]</td>
286 <td>[% csv_profile.content %]</td>
287 <td>[% csv_profile.csv_separator %]</td>
288 <td>[% PROCESS type_description type_code = csv_profile.type %]</td>
289 <td>[% PROCESS used_for_description used_for_code = csv_profile.used_for %]</td>
290 <td><a href="/cgi-bin/koha/tools/csv-profiles.pl?op=add_form&export_format_id=[% csv_profile.export_format_id %]">Edit</a></td>
291 <td><a href="/cgi-bin/koha/tools/csv-profiles.pl?op=delete_confirm&export_format_id=[% csv_profile.export_format_id %]">Delete</a></td>
297 There is no CSV profile defined. <a href="/cgi-bin/koha/tools/csv-profiles.pl?op=add_form">Create a new CSV profile</a>.
303 <div class="yui-b noprint">
304 [% INCLUDE 'tools-menu.inc' %]
307 [% INCLUDE 'intranet-bottom.inc' %]