View | Details | Raw Unified | Return to bug 10853
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/csv-profiles.tt (-7 / +7 lines)
Lines 118-124 function reloadPage(p) { Link Here
118
						    </select>
118
						    </select>
119
                            </li>
119
                            </li>
120
120
121
						    <li class="marc_specific"><label for="new_subfield_separator">Subfield separator: </label>
121
                            <li class="marc_specific"><label for="new_subfield_separator">Subfield separator: </label>
122
						    <select name="subfield_separator" id="new_subfield_separator">
122
						    <select name="subfield_separator" id="new_subfield_separator">
123
							<option value=":">Colon (:)</option>
123
							<option value=":">Colon (:)</option>
124
							<option value=",">Comma (,)</option>
124
							<option value=",">Comma (,)</option>
Lines 131-137 function reloadPage(p) { Link Here
131
						    </select>
131
						    </select>
132
                            </li>
132
                            </li>
133
					
133
					
134
						    <li class="marc_specific"><label for="new_encoding">Encoding: </label>
134
                            <li class="marc_specific"><label for="new_encoding">Encoding: </label>
135
						    <select name="encoding" id="new_encoding">
135
						    <select name="encoding" id="new_encoding">
136
							[% FOREACH encoding IN encodings %]
136
							[% FOREACH encoding IN encodings %]
137
                                [% IF ( encoding.encoding == 'utf8' ) %]
137
                                [% IF ( encoding.encoding == 'utf8' ) %]
Lines 144-150 function reloadPage(p) { Link Here
144
144
145
145
146
                            <li class="marc_specific"><label for="new_profile_marc_content">Profile MARC fields: </label>
146
                            <li class="marc_specific"><label for="new_profile_marc_content">Profile MARC fields: </label>
147
						    <textarea cols="50" rows="2" name="profile_marc_content" id="new_profile_marc_content"></textarea>
147
                            <textarea cols="50" rows="2" name="profile_marc_content" id="new_profile_marc_content"></textarea>
148
						    <p>You have to define which fields or subfields you want to export, separated by pipes.</p>
148
						    <p>You have to define which fields or subfields you want to export, separated by pipes.</p>
149
                            <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>
149
                            <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>
150
						    <p>Example: Personal name=200|Entry element=210$a|300|009</p>
150
						    <p>Example: Personal name=200|Entry element=210$a|300|009</p>
Lines 238-244 function reloadPage(p) { Link Here
238
								[% END %]
238
								[% END %]
239
                            </select></li>
239
                            </select></li>
240
240
241
						    <li class="marc_specific"><label for="field_separator">Field separator: </label>
241
                            <li class="marc_specific"><label for="field_separator">Field separator: </label>
242
						    <select name="field_separator" id="field_separator">
242
						    <select name="field_separator" id="field_separator">
243
                                <option value=":">Colon (:)</option>
243
                                <option value=":">Colon (:)</option>
244
244
Lines 285-291 function reloadPage(p) { Link Here
285
						    </select></li>
285
						    </select></li>
286
286
287
287
288
						    <li class="marc_specific"><label for="subfield_separator">Subfield separator: </label>
288
                            <li class="marc_specific"><label for="subfield_separator">Subfield separator: </label>
289
						    <select name="subfield_separator" id="subfield_separator">
289
						    <select name="subfield_separator" id="subfield_separator">
290
                                <option value=":">Colon (:)</option>
290
                                <option value=":">Colon (:)</option>
291
291
Lines 332-338 function reloadPage(p) { Link Here
332
	
332
	
333
						    </select></li>
333
						    </select></li>
334
334
335
						    <li class="marc_specific"><label for="encoding">Encoding: </label>
335
                            <li class="marc_specific"><label for="encoding">Encoding: </label>
336
						    <select name="encoding" id="encoding">
336
						    <select name="encoding" id="encoding">
337
							[% FOREACH encoding IN encodings %]
337
							[% FOREACH encoding IN encodings %]
338
                                [% IF ( selected_encoding == encoding.encoding ) %]
338
                                [% IF ( selected_encoding == encoding.encoding ) %]
Lines 344-350 function reloadPage(p) { Link Here
344
						    </select></li>
344
						    </select></li>
345
345
346
                            <li class="marc_specific"><label for="modify_profile_marc_content">Profile MARC fields: </label>
346
                            <li class="marc_specific"><label for="modify_profile_marc_content">Profile MARC fields: </label>
347
						    <textarea cols="50" rows="2" name="profile_marc_content" id="modify_profile_marc_content">[% selected_profile_content %]</textarea></li>
347
                            <textarea cols="50" rows="2" name="profile_marc_content" id="modify_profile_marc_content">[% selected_profile_content %]</textarea></li>
348
348
349
                            <li class="sql_specific">
349
                            <li class="sql_specific">
350
                              <label for="modify_profile_sql_content">Profile SQL fields: </label>
350
                              <label for="modify_profile_sql_content">Profile SQL fields: </label>
(-)a/tools/csv-profiles.pl (-7 / +6 lines)
Lines 85-100 if ($profile_name && $profile_content && $action) { Link Here
85
    my $rows;
85
    my $rows;
86
86
87
    if ($action eq "create") {
87
    if ($action eq "create") {
88
	my $query = "INSERT INTO export_format(export_format_id, profile, description, content, csv_separator, field_separator, subfield_separator, encoding, type) VALUES (NULL, ?, ?, ?, ?, ?, ?, ?, ?)";
88
    my $query = "INSERT INTO export_format(export_format_id, profile, description, content, csv_separator, field_separator, subfield_separator, encoding, type) VALUES (NULL, ?, ?, ?, ?, ?, ?, ?, ?)";
89
	my $sth   = $dbh->prepare($query);
89
	my $sth   = $dbh->prepare($query);
90
	$rows  = $sth->execute($profile_name, $profile_description, $profile_content, $csv_separator, $field_separator, $subfield_separator, $encoding, $type);
90
    $rows  = $sth->execute($profile_name, $profile_description, $profile_content, $csv_separator, $field_separator, $subfield_separator, $encoding, $type);
91
    
91
    
92
    }
92
    }
93
93
94
    if ($action eq "edit") {
94
    if ($action eq "edit") {
95
	my $query = "UPDATE export_format SET description=?, content=?, csv_separator=?, field_separator=?, subfield_separator=?, encoding=?, type=? WHERE export_format_id=? LIMIT 1";
95
    my $query = "UPDATE export_format SET description=?, content=?, csv_separator=?, field_separator=?, subfield_separator=?, encoding=?, type=? WHERE export_format_id=? LIMIT 1";
96
	my $sth   = $dbh->prepare($query);
96
	my $sth   = $dbh->prepare($query);
97
	$rows  = $sth->execute($profile_description, $profile_content, $csv_separator, $field_separator, $subfield_separator, $encoding, $type, $profile_name);
97
    $rows  = $sth->execute($profile_description, $profile_content, $csv_separator, $field_separator, $subfield_separator, $encoding, $type, $profile_name);
98
    }
98
    }
99
99
100
    if ($action eq "delete") {
100
    if ($action eq "delete") {
Lines 112-118 if ($profile_name && $profile_content && $action) { Link Here
112
112
113
    # If a profile has been selected for modification
113
    # If a profile has been selected for modification
114
    if ($id) {
114
    if ($id) {
115
	my $query = "SELECT export_format_id, profile, description, content, csv_separator, field_separator, subfield_separator, encoding, type FROM export_format WHERE export_format_id = ?";
115
    my $query = "SELECT export_format_id, profile, description, content, csv_separator, field_separator, subfield_separator, encoding, type FROM export_format WHERE export_format_id = ?";
116
	my $sth;
116
	my $sth;
117
	$sth = $dbh->prepare($query);
117
	$sth = $dbh->prepare($query);
118
118
Lines 122-128 if ($profile_name && $profile_content && $action) { Link Here
122
	    selected_profile_id          => $selected_profile->[0],
122
	    selected_profile_id          => $selected_profile->[0],
123
	    selected_profile_name        => $selected_profile->[1],
123
	    selected_profile_name        => $selected_profile->[1],
124
	    selected_profile_description => $selected_profile->[2],
124
	    selected_profile_description => $selected_profile->[2],
125
	    selected_profile_content     => $selected_profile->[3],
125
        selected_profile_content     => $selected_profile->[3],
126
	    selected_csv_separator       => $selected_profile->[4],
126
	    selected_csv_separator       => $selected_profile->[4],
127
	    selected_field_separator     => $selected_profile->[5],
127
	    selected_field_separator     => $selected_profile->[5],
128
	    selected_subfield_separator  => $selected_profile->[6],
128
	    selected_subfield_separator  => $selected_profile->[6],
129
- 

Return to bug 10853