[Koha-patches] [PATCH] Autoselect marcflavour in marc import
Nahuel ANGELINETTI
nahuel.angelinetti at biblibre.com
Tue Jan 20 15:59:23 CET 2009
This patch is writted by Paul Poulain.
It auto-select the marcflavour from syspref in the stage marc import.
---
.../prog/en/modules/tools/stage-marc-import.tmpl | 6 +++++-
tools/stage-marc-import.pl | 3 +++
2 files changed, 8 insertions(+), 1 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 e040b5a..e47a12e 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
@@ -86,7 +86,11 @@ function CheckForm(f) {
</li>
<li>
<label for="syntax">Character encoding: </label>
- <select name="syntax" id="syntax"><option value="MARC21">MARC21</option><option value="UNIMARC">UNIMARC</option></select>
+ <!-- TMPL_IF name="UNIMARC" -->
+ <select name="syntax" id="syntax"><option value="MARC21">MARC21</option><option value="UNIMARC" selected="1">UNIMARC</option></select>
+ <!-- TMPL_ELSE -->
+ <select name="syntax" id="syntax"><option value="MARC21" selected="1">MARC21</option><option value="UNIMARC">UNIMARC</option></select>
+ <!-- /TMPL_IF -->
</li>
</ol></fieldset>
diff --git a/tools/stage-marc-import.pl b/tools/stage-marc-import.pl
index 9c09d8c..ea2e825 100755
--- a/tools/stage-marc-import.pl
+++ b/tools/stage-marc-import.pl
@@ -183,6 +183,9 @@ if ($completedJobID) {
} else {
# initial form
+ if (C4::Context->preference("marcflavour") eq "UNIMARC") {
+ $template->param("UNIMARC" => 1);
+ }
my @matchers = C4::Matcher::GetMatcherList();
$template->param(available_matchers => \@matchers);
}
--
1.5.6.3
More information about the Koha-patches
mailing list