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

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

Return to bug 11630