[Koha-patches] [PATCH 12/17] MT2116 : Addons to the CSV Export
Henri-Damien LAURENT
henridamien.laurent at biblibre.com
Fri Feb 5 14:01:53 CET 2010
From: Matthias Meusburger <matthias.meusburger at biblibre.com>
Add encoding selection
Add authorised values handling
---
C4/Record.pm | 11 ++++++++++-
.../prog/en/modules/tools/csv-profiles.tmpl | 18 ++++++++++++++++++
tools/csv-profiles.pl | 1 -
3 files changed, 28 insertions(+), 2 deletions(-)
diff --git a/C4/Record.pm b/C4/Record.pm
index d225fea..8ac81f0 100644
--- a/C4/Record.pm
+++ b/C4/Record.pm
@@ -355,9 +355,18 @@ sub marc2csv {
my ($biblio, $id, $header) = @_;
my $output;
- # Get the information about the csv profile
+ # Getting the record
+ my $record = GetMarcBiblio($biblio);
+
+ # Getting the framework
+ my $frameworkcode = GetFrameworkCode($biblio);
+
+ # Getting information about the csv profile
my $profile = GetCsvProfile($id);
+ # Getting output encoding
+ my $encoding = $profile->{encoding} || 'utf8';
+
# Getting separators
my $csvseparator = $profile->{csv_separator} || ',';
my $fieldseparator = $profile->{field_separator} || '#';
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/csv-profiles.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/csv-profiles.tmpl
index 54c68d7..0d0214a 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/csv-profiles.tmpl
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/csv-profiles.tmpl
@@ -211,6 +211,15 @@ function reloadPage(p) {
<option value="\t">Tabulation (\t)</option>
</select>
<br /><br />
+
+ <label for="encoding">Encoding :</label>
+ <select name="encoding">
+ <!-- TMPL_LOOP NAME="encodings" -->
+ <option<!-- TMPL_IF EXPR="encoding eq 'utf8'" --> selected="selected" <!-- /TMPL_IF -->><!-- TMPL_VAR NAME="encoding" --></option>
+ <!-- /TMPL_LOOP -->
+ </select>
+ <br /><br />
+
<label for="profile_content">Profile marcfields :</label>
<textarea cols="50" rows="2" name="profile_content" id="profile_content"></textarea>
@@ -400,6 +409,15 @@ function reloadPage(p) {
</select>
<br /><br />
+ <label for="encoding">Encoding :</label>
+ <select name="encoding">
+ <!-- TMPL_LOOP NAME="encodings" -->
+ <option<!-- TMPL_IF EXPR="selected_encoding eq encoding" --> selected="selected" <!-- /TMPL_IF -->><!-- TMPL_VAR NAME="encoding" --></option>
+ <!-- /TMPL_LOOP -->
+ </select>
+ <br /><br />
+
+
<label for="modify_profile_content">Profile marcfields :</label>
<textarea cols="50" rows="2" name="profile_content" id="modify_profile_content"><!-- TMPL_VAR NAME="selected_profile_marcfields" --></textarea></li>
diff --git a/tools/csv-profiles.pl b/tools/csv-profiles.pl
index ad48cee..15b90de 100755
--- a/tools/csv-profiles.pl
+++ b/tools/csv-profiles.pl
@@ -114,7 +114,6 @@ if ($profile_name && $profile_content && $action) {
$sth->execute($id);
my $selected_profile = $sth->fetchrow_arrayref();
- warn "value : " . $selected_profile->[4];
$template->param(
selected_profile_id => $selected_profile->[0],
selected_profile_name => $selected_profile->[1],
--
1.6.3.3
More information about the Koha-patches
mailing list