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