Autoselect marcflavour in marc import
authorNahuel ANGELINETTI <nahuel.angelinetti@biblibre.com>
Tue, 20 Jan 2009 14:59:23 +0000 (15:59 +0100)
committerHenri-Damien LAURENT <henridamien@koha-fr.org>
Tue, 27 Jan 2009 11:19:47 +0000 (12:19 +0100)
This patch is writted by Paul Poulain.
It auto-select the marcflavour from syspref in the stage marc import.

Signed-off-by: Henri-Damien LAURENT <henridamien@koha-fr.org>
koha-tmpl/intranet-tmpl/prog/en/modules/tools/stage-marc-import.tmpl
tools/stage-marc-import.pl

index e040b5a..e47a12e 100644 (file)
@@ -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>
index 9c09d8c..ea2e825 100755 (executable)
@@ -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);
 }