Bug 10038: fix doubled 'default' entry when creating a new authority type
Test plan:
- Create a new authority type
- Click MARC structure
- Verify the pull down has only 1 entry for Default
- Go on the authority type home (admin/authtypes.pl)
- Click on the "MARC structure" link for the default type
- Verify the pull down has only 1 entry for Default
This patch adds a sort (on the authtypecode) for these 2 lists.
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Comment: Works as described. No koha-qa errors.
When creating a new framework it would be better to have Default
on top, but one is way better than two :)
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Agreed, one is better than two :)
All tests and QA script pass.
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit b04118df82)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This commit is contained in:
parent
82eb608a95
commit
609dd4ba45
|
|
@ -57,7 +57,7 @@ my ($template, $loggedinuser, $cookie)
|
|||
# get authtype list
|
||||
my $authtypes = getauthtypes;
|
||||
my @authtypesloop = ();
|
||||
foreach my $thisauthtype ( keys %{$authtypes} ) {
|
||||
foreach my $thisauthtype ( sort keys %{$authtypes} ) {
|
||||
push @authtypesloop,
|
||||
{ value => $thisauthtype,
|
||||
selected => $thisauthtype eq $authtypecode,
|
||||
|
|
@ -209,6 +209,7 @@ if ($op eq 'add_form') {
|
|||
push @existingauthtypeloop,\%line;
|
||||
}
|
||||
}
|
||||
@existingauthtypeloop = sort { lc($a->{authtypetext}) cmp lc($b->{authtypetext}) }@existingauthtypeloop;
|
||||
$template->param(existingauthtypeloop => \@existingauthtypeloop,
|
||||
authtypecode => $authtypecode,
|
||||
);
|
||||
|
|
|
|||
|
|
@ -192,9 +192,12 @@ return false;
|
|||
<input type="hidden" name="authtypecode" value="[% authtypecode %]" />
|
||||
Create authority framework for [% authtypecode %] using
|
||||
<select name="existingauthtypecode">
|
||||
<option value="">Default</option>
|
||||
[% FOREACH existingauthtypeloo IN existingauthtypeloop %]
|
||||
<option value="[% existingauthtypeloo.value %]">[% existingauthtypeloo.authtypetext %]</option>
|
||||
[% IF existingauthtypeloo.value == "" %]
|
||||
<option value="" selected="selected">[% existingauthtypeloo.authtypetext %]</option>
|
||||
[% ELSE %]
|
||||
<option value="[% existingauthtypeloo.value %]">[% existingauthtypeloo.authtypetext %]</option>
|
||||
[% END %]
|
||||
[% END %]
|
||||
</select>
|
||||
<input type="submit" value="OK" class="submit" />
|
||||
|
|
@ -211,7 +214,6 @@ return false;
|
|||
<h2>Select an authority framework</h2>
|
||||
<form action="[% script_name %]" method="post">
|
||||
<select name="authtypecode">
|
||||
<option value="">Default</option>
|
||||
[% FOREACH authtypeloo IN authtypeloop %]
|
||||
[% IF ( authtypeloo.selected ) %]
|
||||
<option value="[% authtypeloo.value %]" selected="selected">[% authtypeloo.authtypetext %]</option>
|
||||
|
|
|
|||
Loading…
Reference in New Issue