|
Lines 52-59
FIXME - this should be moved to a configuration file.
Link Here
|
| 52 |
my %subdivisions = ( |
52 |
my %subdivisions = ( |
| 53 |
'j' => 'formsubdiv', |
53 |
'j' => 'formsubdiv', |
| 54 |
'x' => 'generalsubdiv', |
54 |
'x' => 'generalsubdiv', |
| 55 |
'y' => 'chronologicalsubdiv', |
55 |
'y' => 'geographicsubdiv', |
| 56 |
'z' => 'geographicsubdiv', |
56 |
'z' => 'chronologicalsubdiv', |
| 57 |
); |
57 |
); |
| 58 |
|
58 |
|
| 59 |
my $bib_heading_fields; |
59 |
my $bib_heading_fields; |
|
Lines 160-173
sub _get_search_heading {
Link Here
|
| 160 |
my $code = $subfields[$i]->[0]; |
160 |
my $code = $subfields[$i]->[0]; |
| 161 |
my $code_re = quotemeta $code; |
161 |
my $code_re = quotemeta $code; |
| 162 |
my $value = $subfields[$i]->[1]; |
162 |
my $value = $subfields[$i]->[1]; |
| 163 |
$value =~ s/[-,.:=;!%\/]*$//; |
163 |
$value =~ s/[\s]*[-,.:=;!%\/][\s]*$//; |
| 164 |
next unless $subfields =~ qr/$code_re/; |
164 |
next unless $subfields =~ qr/$code_re/; |
| 165 |
if ($first) { |
165 |
if ($first) { |
| 166 |
$first = 0; |
166 |
$first = 0; |
| 167 |
$heading = $value; |
167 |
$heading = $value; |
| 168 |
} |
168 |
} |
| 169 |
else { |
169 |
else { |
| 170 |
$heading .= " $value"; |
170 |
if ( exists $subdivisions{$code} ) { |
|
|
171 |
$heading .= " $subdivisions{$code} $value"; |
| 172 |
} |
| 173 |
else { |
| 174 |
$heading .= " $value"; |
| 175 |
} |
| 171 |
} |
176 |
} |
| 172 |
} |
177 |
} |
| 173 |
|
178 |
|