--- trunk/lib/WebPAC/Normalize.pm 2007/10/30 20:27:20 915 +++ trunk/lib/WebPAC/Normalize.pm 2007/10/31 00:26:43 923 @@ -7,7 +7,7 @@ _debug _pack_subfields_hash - search_display search display + search_display search display sorted marc marc_indicators marc_repeatable_subfield marc_compose marc_leader marc_fixed @@ -41,13 +41,9 @@ WebPAC::Normalize - describe normalisaton rules using sets -=head1 VERSION - -Version 0.30 - =cut -our $VERSION = '0.30'; +our $VERSION = '0.31'; =head1 SYNOPSIS @@ -478,13 +474,16 @@ =cut -sub display { - my $name = shift or die "display needs name as first argument"; +sub _field { + my $type = shift or confess "need type -- BUG?"; + my $name = shift or confess "needs name as first argument"; my @o = grep { defined($_) && $_ ne '' } @_; return unless (@o); - $out->{$name}->{display} = \@o; + $out->{$name}->{$type} = \@o; } +sub display { _field( 'display', @_ ) } + =head2 search Prepare values just for I @@ -493,12 +492,18 @@ =cut -sub search { - my $name = shift or die "search needs name as first argument"; - my @o = grep { defined($_) && $_ ne '' } @_; - return unless (@o); - $out->{$name}->{search} = \@o; -} +sub search { _field( 'search', @_ ) } + +=head2 sorted + +Insert into lists which will be automatically sorted + + sorted('Title', rec('200','a') ); + +=cut + +sub sorted { _field( 'sorted', @_ ) } + =head2 marc_leader