Bug 28386: Sort authors by lastname || firstname

If several authors have the same lastname, they are swapped in the list between the different runs.

This is reusing the code from the release_tools, see issue #24

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 3e8b14aa8e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit adb61b53d3)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
(cherry picked from commit 00710babca)
Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
(cherry picked from commit 00710babca)
This commit is contained in:
Jonathan Druart 2021-05-27 14:38:44 +02:00 committed by Wainui Witika-Park
parent 69e0ab2107
commit f998d79461
1 changed files with 9 additions and 4 deletions

View File

@ -687,10 +687,15 @@ for my $version ( sort { $a <=> $b } keys %{$teams->{team}} ) {
my @people = map {
{ name => $_, ( $contributors->{$_} ? %{ $contributors->{$_} } : () ) }
} sort {
my ($alast) = ( split( /\s/, $a ) )[-1];
my ($blast) = ( split( /\s/, $b ) )[-1];
lc($alast) cmp lc($blast)
} keys %{$contributors};
my ($alast) = $a =~ /(\S+)$/;
my ($blast) = $b =~ /(\S+)$/;
my $cmp = lc($alast||"") cmp lc($blast||"");
return $cmp if $cmp;
my ($a2last) = $a =~ /(\S+)\s\S+$/;
my ($b2last) = $b =~ /(\S+)\s\S+$/;
lc($a2last||"") cmp lc($b2last||"");
} keys %$contributors;
$template->param( contributors => \@people );
$template->param( maintenance_team => $teams->{team}->{$dev_team} );