projects
/
koha_fer
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Bug 9811: Cardnumber could be alphanumeric
[koha_fer]
/
C4
/
ClassSortRoutine
/
Dewey.pm
diff --git
a/C4/ClassSortRoutine/Dewey.pm
b/C4/ClassSortRoutine/Dewey.pm
index
62a68b9
..
25480ec
100644
(file)
--- a/
C4/ClassSortRoutine/Dewey.pm
+++ b/
C4/ClassSortRoutine/Dewey.pm
@@
-23,7
+23,7
@@
use warnings;
use vars qw($VERSION);
# set the version for version checking
use vars qw($VERSION);
# set the version for version checking
-$VERSION = 3.0
0
;
+$VERSION = 3.0
7.00.049
;
=head1 NAME
=head1 NAME
@@
-67,9
+67,13
@@
sub get_class_sort_key {
$init =~ s/^([\p{IsAlpha}]+)/$1 /;
my @tokens = split /\.|\s+/, $init;
my $digit_group_count = 0;
$init =~ s/^([\p{IsAlpha}]+)/$1 /;
my @tokens = split /\.|\s+/, $init;
my $digit_group_count = 0;
+ my $first_digit_group_idx;
for (my $i = 0; $i <= $#tokens; $i++) {
if ($tokens[$i] =~ /^\d+$/) {
$digit_group_count++;
for (my $i = 0; $i <= $#tokens; $i++) {
if ($tokens[$i] =~ /^\d+$/) {
$digit_group_count++;
+ if (1 == $digit_group_count) {
+ $first_digit_group_idx = $i;
+ }
if (2 == $digit_group_count) {
$tokens[$i] = sprintf("%-15.15s", $tokens[$i]);
$tokens[$i] =~ tr/ /0/;
if (2 == $digit_group_count) {
$tokens[$i] = sprintf("%-15.15s", $tokens[$i]);
$tokens[$i] =~ tr/ /0/;
@@
-78,7
+82,7
@@
sub get_class_sort_key {
}
# Pad the first digit_group if there was only one
if (1 == $digit_group_count) {
}
# Pad the first digit_group if there was only one
if (1 == $digit_group_count) {
- $tokens[
0
] .= '_000000000000000'
+ $tokens[
$first_digit_group_idx
] .= '_000000000000000'
}
my $key = join("_", @tokens);
$key =~ s/[^\p{IsAlnum}_]//g;
}
my $key = join("_", @tokens);
$key =~ s/[^\p{IsAlnum}_]//g;