[Koha-bugs] [Bug 9497] Make it easier to add to the the list of possible encodings for Z39.50 servers and add ISO 8859-1

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Sun Jan 27 13:58:21 CET 2013


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9497

--- Comment #3 from Magnus Enger <magnus at enger.priv.no> ---
Problems:

This code in admin/z3950servers.pl was creating separate variables for each
encoding:

$template->param( $_ . $data->{$_} => 1)
        for ( qw( syntax encoding ) );

And the corresponding code in the template had to check each of these variables
to decide which one should be selected:

[% IF ( encodingutf8 ) %]
<option value="utf8" selected="selected">UTF-8</option>
[% ELSE %]
<option value="utf8">UTF-8</option>
[% END %]
[% IF ( encodingEUC_KR ) %]
<option value="EUC-KR" selected="selected">EUC-KR</option>
[% ELSE %]
<option value="EUC-KR">EUC-KR</option>
[% END %]
etc. 

This has a couple of problems:

- Encodings with a hyphen ("-") in them create invalid variable names in TT, as
seen in Bug 8081
- Adding a new encoding means adding 5 lines to the template

My proposed solution creates just one variable for the encoding and sets it to
the name of the encoding, thus avoiding the hyphen problem. It also generates
the options from a list of encodings (defined in the template), which means
that future encodings can just be added to the list.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list