[Koha-patches] [PATCH] Bug 5997 : Use marcflavour in Stage MARC Records For Import
Chris Cormack
chrisc at catalyst.net.nz
Tue Mar 29 23:36:43 CEST 2011
From: Frederic Demians <f.demians at tamil.fr>
In Stage MARC Record For Import, after uploading the file
to stage, a Character encoding (MARC21/UNIMARC) must be
selected for the file. By default, this is MARC21.
This patch defaults to marcflavour system preference.
Signed-off-by: Henri-Damien LAURENT <henridamien.laurent at biblibre.com>
---
.../prog/en/modules/tools/stage-marc-import.tmpl | 19 +++++++++++++------
tools/stage-marc-import.pl | 8 +++++---
2 files changed, 18 insertions(+), 9 deletions(-)
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stage-marc-import.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stage-marc-import.tmpl
index 8660db0..ce296e5 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stage-marc-import.tmpl
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stage-marc-import.tmpl
@@ -96,12 +96,19 @@ function CheckForm(f) {
</li>
<li>
- <label for="syntax">Character encoding: </label>
- <!-- TMPL_IF name="UNIMARC" -->
- <select name="syntax" id="syntax"><option value="MARC21">MARC21</option><option value="UNIMARC" selected="selected">UNIMARC</option></select>
- <!-- TMPL_ELSE -->
- <select name="syntax" id="syntax"><option value="MARC21" selected="selected">MARC21</option><option value="UNIMARC">UNIMARC</option></select>
- <!-- /TMPL_IF -->
+ <label for="syntax">Marc Flavour: </label>
+ <select name="syntax" id="syntax">
+ <!--TMPL_IF name="syntax_marc21" -->
+ <option selected="selected" value="MARC21">MARC21</option>
+ <!--TMPL_ELSE -->
+ <option value="MARC21">MARC21</option>
+ <!--/TMPL_IF-->
+ <!--TMPL_IF name="syntax_unimarc" -->
+ <option selected="selected" value="UNIMARC">UNIMARC</option>
+ <!--TMPL_ELSE -->
+ <option value="UNIMARC">UNIMARC</option>
+ <!--/TMPL_IF-->
+ </select>
</li>
</ol></fieldset>
diff --git a/tools/stage-marc-import.pl b/tools/stage-marc-import.pl
index b113332..915e9a2 100755
--- a/tools/stage-marc-import.pl
+++ b/tools/stage-marc-import.pl
@@ -65,9 +65,11 @@ my ($template, $loggedinuser, $cookie)
debug => 1,
});
-$template->param(SCRIPT_NAME => $ENV{'SCRIPT_NAME'},
- uploadmarc => $fileID);
-
+$template->param(
+ SCRIPT_NAME => $ENV{'SCRIPT_NAME'},
+ uploadmarc => $fileID,
+ "syntax_" . lc C4::Context->preference('marcflavour') => 1,
+ );
my %cookies = parse CGI::Cookie($cookie);
my $sessionID = $cookies{'CGISESSID'}->value;
if ($completedJobID) {
--
1.7.1
More information about the Koha-patches
mailing list