View | Details | Raw Unified | Return to bug 11630
Collapse All | Expand All

(-)a/C4/Circulation.pm (-14 / +12 lines)
Lines 981-1010 sub CanBookBeIssued { Link Here
981
    if (($markers)&&($bibvalues))
981
    if (($markers)&&($bibvalues))
982
    {
982
    {
983
        # Split $bibvalues to something like FSK 16 or PEGI 6
983
        # Split $bibvalues to something like FSK 16 or PEGI 6
984
        my @values = split ' ', $bibvalues;
984
        my @values = split ' ', uc($bibvalues);
985
985
986
        # Search first occurence of one of the markers
986
        # Search first occurence of one of the markers
987
        my @markers = split /\|/, $markers;
987
        my @markers = split /\|/, uc($markers);
988
        my $index = 0;
988
        my $index = 0;
989
        my $take = -1;
989
        my $restrictionyear = 0;
990
        for my $value (@values) {
990
        for my $value (@values) {
991
            $index ++;
991
            $index ++;
992
            for my $marker (@markers) {
992
            for my $marker (@markers) {
993
                $marker =~ s/^\s+//; #remove leading spaces
993
                $marker =~ s/^\s+//; #remove leading spaces
994
                $marker =~ s/\s+$//; #remove trailing spaces
994
                $marker =~ s/\s+$//; #remove trailing spaces
995
                if (uc($marker) eq uc($value)) {
995
                if ($marker eq $value) {
996
                    $take = $index;
996
                    if ($index <= $#values) {
997
                        $restrictionyear += $values[$index];
998
                    }
999
                    last;
1000
                } elsif ($value =~ /^\Q$marker\E(\d+)$/) {
1001
                    # Perhaps it is something like "K16" (as in Finland)
1002
                    $restrictionyear += $1;
997
                    last;
1003
                    last;
998
                }
1004
                }
999
            }
1005
            }
1000
            if ($take > -1) {
1006
            last if ($restrictionyear > 0);
1001
                last;
1002
            }
1003
        }
1004
        # Index points to the next value
1005
        my $restrictionyear = 0;
1006
        if (($take <= $#values) && ($take >= 0)){
1007
            $restrictionyear += $values[$take];
1008
        }
1007
        }
1009
1008
1010
        if ($restrictionyear > 0) {
1009
        if ($restrictionyear > 0) {
1011
- 

Return to bug 11630