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

(-)a/C4/AuthoritiesMarc.pm (-37 / +44 lines)
Lines 224-268 sub SearchAuthorities { Link Here
224
        for(my $i = 0 ; $i <= $#{$value} ; $i++)
224
        for(my $i = 0 ; $i <= $#{$value} ; $i++)
225
        {
225
        {
226
            if (@$value[$i]){
226
            if (@$value[$i]){
227
                if ( @$tags[$i] eq "mainmainentry" ) {
227
                if ( @$tags[$i] ) {
228
                    $attr = " \@attr 1=Heading-Main ";
228
                    if ( @$tags[$i] eq "mainmainentry" ) {
229
                }
229
                        $attr = " \@attr 1=Heading-Main ";
230
                elsif ( @$tags[$i] eq "mainentry" ) {
230
                    }
231
                    $attr = " \@attr 1=Heading ";
231
                    elsif ( @$tags[$i] eq "mainentry" ) {
232
                }
232
                        $attr = " \@attr 1=Heading ";
233
                elsif ( @$tags[$i] eq "any" ) {
233
                    }
234
                    $attr = " \@attr 1=Any ";
234
                    elsif ( @$tags[$i] eq "any" ) {
235
                }
235
                        $attr = " \@attr 1=Any ";
236
                elsif ( @$tags[$i] eq "match" ) {
236
                    }
237
                    $attr = " \@attr 1=Match ";
237
                    elsif ( @$tags[$i] eq "match" ) {
238
                }
238
                        $attr = " \@attr 1=Match ";
239
                elsif ( @$tags[$i] eq "match-heading" ) {
239
                    }
240
                    $attr = " \@attr 1=Match-heading ";
240
                    elsif ( @$tags[$i] eq "match-heading" ) {
241
                }
241
                        $attr = " \@attr 1=Match-heading ";
242
                elsif ( @$tags[$i] eq "see-from" ) {
242
                    }
243
                    $attr = " \@attr 1=Match-heading-see-from ";
243
                    elsif ( @$tags[$i] eq "see-from" ) {
244
                }
244
                        $attr = " \@attr 1=Match-heading-see-from ";
245
                elsif ( @$tags[$i] eq "thesaurus" ) {
245
                    }
246
                    $attr = " \@attr 1=Subject-heading-thesaurus ";
246
                    elsif ( @$tags[$i] eq "thesaurus" ) {
247
                }
247
                        $attr = " \@attr 1=Subject-heading-thesaurus ";
248
                if ( @$operator[$i] eq 'is' ) {
248
                    }
249
                    $attr .= " \@attr 4=1  \@attr 5=100 "
250
                      ; ##Phrase, No truncation,all of subfield field must match
251
                }
252
                elsif ( @$operator[$i] eq "=" ) {
253
                    $attr .= " \@attr 4=107 ";    #Number Exact match
254
                }
255
                elsif ( @$operator[$i] eq "start" ) {
256
                    $attr .= " \@attr 3=2 \@attr 4=1 \@attr 5=1 "
257
                      ;    #Firstinfield Phrase, Right truncated
258
                }
249
                }
259
                elsif ( @$operator[$i] eq "exact" ) {
250
                if ( @$operator[$i] ) {
260
                    $attr .= " \@attr 4=1  \@attr 5=100 \@attr 6=3 "
251
                    if ( @$operator[$i] eq 'is' ) {
261
                      ; ##Phrase, No truncation,all of subfield field must match
252
                        $attr .= " \@attr 4=1  \@attr 5=100 "
253
                          ; ##Phrase, No truncation,all of subfield field must match
254
                    }
255
                    elsif ( @$operator[$i] eq "=" ) {
256
                        $attr .= " \@attr 4=107 ";
257
                        #Number Exact match
258
                    }
259
                    elsif ( @$operator[$i] eq "start" ) {
260
                        $attr .= " \@attr 3=2 \@attr 4=1 \@attr 5=1 ";
261
                        #Firstinfield Phrase, Right truncated
262
                    }
263
                    elsif ( @$operator[$i] eq "exact" ) {
264
                        $attr .= " \@attr 4=1  \@attr 5=100 \@attr 6=3 ";
265
                        #Phrase, No truncation,all of subfield field must match
266
                    }
267
                    else {
268
                        $attr .= " \@attr 5=1 \@attr 4=6 ";
269
                        # Word list, right truncated, anywhere
270
                    }
262
                }
271
                }
263
                else {
272
                else {
264
                    $attr .= " \@attr 5=1 \@attr 4=6 "
273
                    $attr .= " \@attr 5=1 \@attr 4=6 ";
265
                      ;    ## Word list, right truncated, anywhere
266
                }
274
                }
267
                @$value[$i] =~ s/"/\\"/g; # Escape the double-quotes in the search value
275
                @$value[$i] =~ s/"/\\"/g; # Escape the double-quotes in the search value
268
                $attr =$attr."\"".@$value[$i]."\"";
276
                $attr =$attr."\"".@$value[$i]."\"";
269
- 

Return to bug 7937