Lines 108-113
This module contains an API for manipulating item
Link Here
|
108 |
records in Koha, and is used by cataloguing, circulation, |
108 |
records in Koha, and is used by cataloguing, circulation, |
109 |
acquisitions, and serials management. |
109 |
acquisitions, and serials management. |
110 |
|
110 |
|
|
|
111 |
# FIXME This POD is not up-to-date |
111 |
A Koha item record is stored in two places: the |
112 |
A Koha item record is stored in two places: the |
112 |
items table and embedded in a MARC tag in the XML |
113 |
items table and embedded in a MARC tag in the XML |
113 |
version of the associated bib record in C<biblioitems.marcxml>. |
114 |
version of the associated bib record in C<biblioitems.marcxml>. |
Lines 1308-1314
If this is set, it is set to C<One Order>.
Link Here
|
1308 |
sub GetItemsInfo { |
1309 |
sub GetItemsInfo { |
1309 |
my ( $biblionumber ) = @_; |
1310 |
my ( $biblionumber ) = @_; |
1310 |
my $dbh = C4::Context->dbh; |
1311 |
my $dbh = C4::Context->dbh; |
1311 |
# note biblioitems.* must be avoided to prevent large marc and marcxml fields from killing performance. |
|
|
1312 |
require C4::Languages; |
1312 |
require C4::Languages; |
1313 |
my $language = C4::Languages::getlanguage(); |
1313 |
my $language = C4::Languages::getlanguage(); |
1314 |
my $query = " |
1314 |
my $query = " |
Lines 2622-2628
sub _SearchItems_build_where_fragment {
Link Here
|
2622 |
$sqlfield = 'more_subfields_xml'; |
2622 |
$sqlfield = 'more_subfields_xml'; |
2623 |
$xpath = '//record/datafield/subfield[@code="' . $marcsubfield . '"]'; |
2623 |
$xpath = '//record/datafield/subfield[@code="' . $marcsubfield . '"]'; |
2624 |
} else { |
2624 |
} else { |
2625 |
$sqlfield = 'marcxml'; |
2625 |
$sqlfield = 'metadata'; # From biblio_metadata |
2626 |
if ($marcfield < 10) { |
2626 |
if ($marcfield < 10) { |
2627 |
$xpath = "//record/controlfield[\@tag=\"$marcfield\"]"; |
2627 |
$xpath = "//record/controlfield[\@tag=\"$marcfield\"]"; |
2628 |
} else { |
2628 |
} else { |
Lines 2731-2741
sub SearchItems {
Link Here
|
2731 |
FROM items |
2731 |
FROM items |
2732 |
LEFT JOIN biblio ON biblio.biblionumber = items.biblionumber |
2732 |
LEFT JOIN biblio ON biblio.biblionumber = items.biblionumber |
2733 |
LEFT JOIN biblioitems ON biblioitems.biblioitemnumber = items.biblioitemnumber |
2733 |
LEFT JOIN biblioitems ON biblioitems.biblioitemnumber = items.biblioitemnumber |
|
|
2734 |
LEFT JOIN biblio_metadata ON biblio_metadata.biblionumber = biblio.biblionumber |
2735 |
WHERE 1 |
2734 |
}; |
2736 |
}; |
2735 |
if (defined $where_str and $where_str ne '') { |
2737 |
if (defined $where_str and $where_str ne '') { |
2736 |
$query .= qq{ WHERE $where_str }; |
2738 |
$query .= qq{ AND $where_str }; |
2737 |
} |
2739 |
} |
2738 |
|
2740 |
|
|
|
2741 |
$query .= q{ AND biblio_metadata.format = 'marcxml' AND biblio_metadata.marcflavour = ? }; |
2742 |
push @where_args, C4::Context->preference('marcflavour'); |
2743 |
|
2739 |
my @columns = Koha::Database->new()->schema()->resultset('Item')->result_source->columns; |
2744 |
my @columns = Koha::Database->new()->schema()->resultset('Item')->result_source->columns; |
2740 |
push @columns, Koha::Database->new()->schema()->resultset('Biblio')->result_source->columns; |
2745 |
push @columns, Koha::Database->new()->schema()->resultset('Biblio')->result_source->columns; |
2741 |
push @columns, Koha::Database->new()->schema()->resultset('Biblioitem')->result_source->columns; |
2746 |
push @columns, Koha::Database->new()->schema()->resultset('Biblioitem')->result_source->columns; |
2742 |
- |
|
|