subfield 'y' (regularity pattern) is repeatable. Need to keep all
authordjfiander <djfiander@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 20 Jan 2009 01:42:41 +0000 (01:42 +0000)
committerdjfiander <djfiander@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 20 Jan 2009 01:42:41 +0000 (01:42 +0000)
of them.

git-svn-id: svn://svn.open-ils.org/ILS/trunk@11881 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Utils/MFHD/Caption.pm

index 5b4561d..b2f52bc 100755 (executable)
@@ -47,9 +47,13 @@ sub new
            carp '$v specified for top-level enumeration'
              unless defined($last_enum);
            $self->{ENUMS}->{$last_enum}->{RESTART} = ($val eq 'r');
-       } elsif ($key =~ /[npw-z]/) {
+       } elsif ($key =~ /[npwxz]/) {
            # Publication Pattern ('o' == type of unit, 'q'..'t' undefined)
            $self->{PATTERN}->{$key} = $val;
+       } elsif ($key eq 'y') {
+           # Publication pattern: 'y' is repeatable
+           $self->{PATTERN}->{y} = [] if (!defined $self->{PATTERN}->{y});
+           push @{$self->{PATTERN}->{y}}, $val;
        } elsif ($key eq 'o') {
            # Type of unit
            $self->{UNIT} = $val;
@@ -82,9 +86,19 @@ sub new
     }
 
     bless ($self, $class);
+
+    if (exists $self->{PATTERN}->{y}) {
+       $self->decode_pattern;
+    }
+
     return $self;
 }
 
+sub decode_pattern {
+    my $self = shift;
+    my $pattern = $self->{PATTERN}->{y};
+}
+
 sub compressible {
     my $self = shift;