Lines 1510-1516
sub GetMarcSubjects {
Link Here
|
1510 |
my $value = $subject_subfield->[1]; |
1510 |
my $value = $subject_subfield->[1]; |
1511 |
my $linkvalue = $value; |
1511 |
my $linkvalue = $value; |
1512 |
$linkvalue =~ s/(\(|\))//g; |
1512 |
$linkvalue =~ s/(\(|\))//g; |
1513 |
my $operator = " and " unless $counter == 0; |
1513 |
my $operator; |
|
|
1514 |
if ( $counter != 0 ) { |
1515 |
$operator = ' and '; |
1516 |
} |
1514 |
if ( $code eq 9 ) { |
1517 |
if ( $code eq 9 ) { |
1515 |
$found9 = 1; |
1518 |
$found9 = 1; |
1516 |
@link_loop = ( { 'limit' => 'an', link => "$linkvalue" } ); |
1519 |
@link_loop = ( { 'limit' => 'an', link => "$linkvalue" } ); |
Lines 1518-1524
sub GetMarcSubjects {
Link Here
|
1518 |
if ( not $found9 ) { |
1521 |
if ( not $found9 ) { |
1519 |
push @link_loop, { 'limit' => $subject_limit, link => $linkvalue, operator => $operator }; |
1522 |
push @link_loop, { 'limit' => $subject_limit, link => $linkvalue, operator => $operator }; |
1520 |
} |
1523 |
} |
1521 |
my $separator = C4::Context->preference("authoritysep") unless $counter == 0; |
1524 |
my $separator; |
|
|
1525 |
if ( $counter != 0 ) { |
1526 |
$separator = C4::Context->preference('authoritysep'); |
1527 |
} |
1522 |
|
1528 |
|
1523 |
# ignore $9 |
1529 |
# ignore $9 |
1524 |
my @this_link_loop = @link_loop; |
1530 |
my @this_link_loop = @link_loop; |
Lines 1576-1582
sub GetMarcAuthors {
Link Here
|
1576 |
my $value = $authors_subfield->[1]; |
1582 |
my $value = $authors_subfield->[1]; |
1577 |
my $linkvalue = $value; |
1583 |
my $linkvalue = $value; |
1578 |
$linkvalue =~ s/(\(|\))//g; |
1584 |
$linkvalue =~ s/(\(|\))//g; |
1579 |
my $operator = " and " unless $count_auth == 0; |
1585 |
my $operator; |
|
|
1586 |
if ( $count_auth != 0 ) { |
1587 |
$operator = ' and '; |
1588 |
} |
1580 |
|
1589 |
|
1581 |
# if we have an authority link, use that as the link, otherwise use standard searching |
1590 |
# if we have an authority link, use that as the link, otherwise use standard searching |
1582 |
if ($subfield9) { |
1591 |
if ($subfield9) { |
Lines 1592-1599
sub GetMarcAuthors {
Link Here
|
1592 |
$value = GetAuthorisedValueDesc( $field->tag(), $authors_subfield->[0], $authors_subfield->[1], '', $tagslib ) |
1601 |
$value = GetAuthorisedValueDesc( $field->tag(), $authors_subfield->[0], $authors_subfield->[1], '', $tagslib ) |
1593 |
if ( $marcflavour eq 'UNIMARC' and ( $authors_subfield->[0] =~ /4/ ) ); |
1602 |
if ( $marcflavour eq 'UNIMARC' and ( $authors_subfield->[0] =~ /4/ ) ); |
1594 |
my @this_link_loop = @link_loop; |
1603 |
my @this_link_loop = @link_loop; |
1595 |
my $separator = C4::Context->preference("authoritysep") unless $count_auth == 0; |
1604 |
my $separator; |
1596 |
push @subfields_loop, { code => $subfieldcode, value => $value, link_loop => \@this_link_loop, separator => $separator } unless ( $authors_subfield->[0] eq '9' ); |
1605 |
if ( $count_auth != 0 ) { |
|
|
1606 |
$separator = C4::Context->preference('authoritysep'); |
1607 |
} |
1608 |
push @subfields_loop, |
1609 |
{ code => $subfieldcode, |
1610 |
value => $value, |
1611 |
link_loop => \@this_link_loop, |
1612 |
separator => $separator |
1613 |
} |
1614 |
unless ( $authors_subfield->[0] eq '9' ); |
1597 |
$count_auth++; |
1615 |
$count_auth++; |
1598 |
} |
1616 |
} |
1599 |
push @marcauthors, { MARCAUTHOR_SUBFIELDS_LOOP => \@subfields_loop }; |
1617 |
push @marcauthors, { MARCAUTHOR_SUBFIELDS_LOOP => \@subfields_loop }; |
Lines 1704-1716
sub GetMarcSeries {
Link Here
|
1704 |
my $value = $series_subfield->[1]; |
1722 |
my $value = $series_subfield->[1]; |
1705 |
my $linkvalue = $value; |
1723 |
my $linkvalue = $value; |
1706 |
$linkvalue =~ s/(\(|\))//g; |
1724 |
$linkvalue =~ s/(\(|\))//g; |
1707 |
my $operator = " and " unless $counter == 0; |
1725 |
if ( $counter != 0 ) { |
1708 |
push @link_loop, { link => $linkvalue, operator => $operator }; |
1726 |
push @link_loop, { link => $linkvalue, operator => ' and ', }; |
1709 |
my $separator = C4::Context->preference("authoritysep") unless $counter == 0; |
1727 |
} else { |
|
|
1728 |
push @link_loop, { link => $linkvalue, operator => undef, }; |
1729 |
} |
1730 |
my $separator; |
1731 |
if ( $counter != 0 ) { |
1732 |
$separator = C4::Context->preference('authoritysep'); |
1733 |
} |
1710 |
if ($volume_number) { |
1734 |
if ($volume_number) { |
1711 |
push @subfields_loop, { volumenum => $value }; |
1735 |
push @subfields_loop, { volumenum => $value }; |
1712 |
} else { |
1736 |
} else { |
1713 |
push @subfields_loop, { code => $code, value => $value, link_loop => \@link_loop, separator => $separator, volumenum => $volume_number } unless ( $series_subfield->[0] eq '9' ); |
1737 |
if ( $series_subfield->[0] ne '9' ) { |
|
|
1738 |
push @subfields_loop, { |
1739 |
code => $code, |
1740 |
value => $value, |
1741 |
link_loop => \@link_loop, |
1742 |
separator => $separator, |
1743 |
volumenum => $volume_number, |
1744 |
}; |
1745 |
} |
1714 |
} |
1746 |
} |
1715 |
$counter++; |
1747 |
$counter++; |
1716 |
} |
1748 |
} |
Lines 2326-2333
sub PrepareItemrecordDisplay {
Link Here
|
2326 |
my $tagslib = &GetMarcStructure( 1, $frameworkcode ); |
2358 |
my $tagslib = &GetMarcStructure( 1, $frameworkcode ); |
2327 |
|
2359 |
|
2328 |
# return nothing if we don't have found an existing framework. |
2360 |
# return nothing if we don't have found an existing framework. |
2329 |
return "" unless $tagslib; |
2361 |
return q{} unless $tagslib; |
2330 |
my $itemrecord = C4::Items::GetMarcItem( $bibnum, $itemnum ) if ($itemnum); |
2362 |
my $itemrecord; |
|
|
2363 |
if ($itemnum) { |
2364 |
$itemrecord = C4::Items::GetMarcItem( $bibnum, $itemnum ); |
2365 |
} |
2331 |
my @loop_data; |
2366 |
my @loop_data; |
2332 |
my $authorised_values_sth = $dbh->prepare( "SELECT authorised_value,lib FROM authorised_values WHERE category=? ORDER BY lib" ); |
2367 |
my $authorised_values_sth = $dbh->prepare( "SELECT authorised_value,lib FROM authorised_values WHERE category=? ORDER BY lib" ); |
2333 |
foreach my $tag ( sort keys %{$tagslib} ) { |
2368 |
foreach my $tag ( sort keys %{$tagslib} ) { |
Lines 2366-2380
sub PrepareItemrecordDisplay {
Link Here
|
2366 |
&& C4::Context->preference('itemcallnumber') ) { |
2401 |
&& C4::Context->preference('itemcallnumber') ) { |
2367 |
my $CNtag = substr( C4::Context->preference('itemcallnumber'), 0, 3 ); |
2402 |
my $CNtag = substr( C4::Context->preference('itemcallnumber'), 0, 3 ); |
2368 |
my $CNsubfield = substr( C4::Context->preference('itemcallnumber'), 3, 1 ); |
2403 |
my $CNsubfield = substr( C4::Context->preference('itemcallnumber'), 3, 1 ); |
2369 |
my $temp = $itemrecord->field($CNtag) if ($itemrecord); |
2404 |
if ($itemrecord) { |
2370 |
if ($temp) { |
2405 |
my $temp = $itemrecord->field($CNtag); |
2371 |
$defaultvalue = $temp->subfield($CNsubfield); |
2406 |
if ($temp) { |
|
|
2407 |
$defaultvalue = $temp->subfield($CNsubfield); |
2408 |
} |
2372 |
} |
2409 |
} |
2373 |
} |
2410 |
} |
2374 |
if ( $tagslib->{$tag}->{$subfield}->{kohafield} eq 'items.itemcallnumber' |
2411 |
if ( $tagslib->{$tag}->{$subfield}->{kohafield} eq 'items.itemcallnumber' |
2375 |
&& $defaultvalues |
2412 |
&& $defaultvalues |
2376 |
&& $defaultvalues->{'callnumber'} ) { |
2413 |
&& $defaultvalues->{'callnumber'} ) { |
2377 |
my $temp = $itemrecord->field($subfield) if ($itemrecord); |
2414 |
my $temp; |
|
|
2415 |
if ($itemrecord) { |
2416 |
$temp = $itemrecord->field($subfield); |
2417 |
} |
2378 |
unless ($temp) { |
2418 |
unless ($temp) { |
2379 |
$defaultvalue = $defaultvalues->{'callnumber'} if $defaultvalues; |
2419 |
$defaultvalue = $defaultvalues->{'callnumber'} if $defaultvalues; |
2380 |
} |
2420 |
} |
Lines 2382-2388
sub PrepareItemrecordDisplay {
Link Here
|
2382 |
if ( ( $tagslib->{$tag}->{$subfield}->{kohafield} eq 'items.holdingbranch' || $tagslib->{$tag}->{$subfield}->{kohafield} eq 'items.homebranch' ) |
2422 |
if ( ( $tagslib->{$tag}->{$subfield}->{kohafield} eq 'items.holdingbranch' || $tagslib->{$tag}->{$subfield}->{kohafield} eq 'items.homebranch' ) |
2383 |
&& $defaultvalues |
2423 |
&& $defaultvalues |
2384 |
&& $defaultvalues->{'branchcode'} ) { |
2424 |
&& $defaultvalues->{'branchcode'} ) { |
2385 |
my $temp = $itemrecord->field($subfield) if ($itemrecord); |
2425 |
my $temp; |
|
|
2426 |
if ($itemrecord) { |
2427 |
$temp = $itemrecord->field($subfield); |
2428 |
} |
2386 |
unless ($temp) { |
2429 |
unless ($temp) { |
2387 |
$defaultvalue = $defaultvalues->{branchcode} if $defaultvalues; |
2430 |
$defaultvalue = $defaultvalues->{branchcode} if $defaultvalues; |
2388 |
} |
2431 |
} |
Lines 2507-2514
sub PrepareItemrecordDisplay {
Link Here
|
2507 |
} |
2550 |
} |
2508 |
} |
2551 |
} |
2509 |
} |
2552 |
} |
2510 |
my $itemnumber = $itemrecord->subfield( $itemtagfield, $itemtagsubfield ) |
2553 |
my $itemnumber; |
2511 |
if ( $itemrecord && $itemrecord->field($itemtagfield) ); |
2554 |
if ( $itemrecord && $itemrecord->field($itemtagfield) ) { |
|
|
2555 |
$itemnumber = $itemrecord->subfield( $itemtagfield, $itemtagsubfield ); |
2556 |
} |
2512 |
return { |
2557 |
return { |
2513 |
'itemtagfield' => $itemtagfield, |
2558 |
'itemtagfield' => $itemtagfield, |
2514 |
'itemtagsubfield' => $itemtagsubfield, |
2559 |
'itemtagsubfield' => $itemtagsubfield, |