Lines 112-117
This module contains an API for manipulating item
Link Here
|
112 |
records in Koha, and is used by cataloguing, circulation, |
112 |
records in Koha, and is used by cataloguing, circulation, |
113 |
acquisitions, and serials management. |
113 |
acquisitions, and serials management. |
114 |
|
114 |
|
|
|
115 |
# FIXME This POD is not up-to-date |
115 |
A Koha item record is stored in two places: the |
116 |
A Koha item record is stored in two places: the |
116 |
items table and embedded in a MARC tag in the XML |
117 |
items table and embedded in a MARC tag in the XML |
117 |
version of the associated bib record in C<biblioitems.marcxml>. |
118 |
version of the associated bib record in C<biblioitems.marcxml>. |
Lines 1304-1310
If this is set, it is set to C<One Order>.
Link Here
|
1304 |
sub GetItemsInfo { |
1305 |
sub GetItemsInfo { |
1305 |
my ( $biblionumber ) = @_; |
1306 |
my ( $biblionumber ) = @_; |
1306 |
my $dbh = C4::Context->dbh; |
1307 |
my $dbh = C4::Context->dbh; |
1307 |
# note biblioitems.* must be avoided to prevent large marc and marcxml fields from killing performance. |
|
|
1308 |
require C4::Languages; |
1308 |
require C4::Languages; |
1309 |
my $language = C4::Languages::getlanguage(); |
1309 |
my $language = C4::Languages::getlanguage(); |
1310 |
my $query = " |
1310 |
my $query = " |
Lines 2659-2665
sub _SearchItems_build_where_fragment {
Link Here
|
2659 |
$sqlfield = 'more_subfields_xml'; |
2659 |
$sqlfield = 'more_subfields_xml'; |
2660 |
$xpath = '//record/datafield/subfield[@code="' . $marcsubfield . '"]'; |
2660 |
$xpath = '//record/datafield/subfield[@code="' . $marcsubfield . '"]'; |
2661 |
} else { |
2661 |
} else { |
2662 |
$sqlfield = 'marcxml'; |
2662 |
$sqlfield = 'metadata'; # From biblio_metadata |
2663 |
if ($marcfield < 10) { |
2663 |
if ($marcfield < 10) { |
2664 |
$xpath = "//record/controlfield[\@tag=\"$marcfield\"]"; |
2664 |
$xpath = "//record/controlfield[\@tag=\"$marcfield\"]"; |
2665 |
} else { |
2665 |
} else { |
Lines 2768-2778
sub SearchItems {
Link Here
|
2768 |
FROM items |
2768 |
FROM items |
2769 |
LEFT JOIN biblio ON biblio.biblionumber = items.biblionumber |
2769 |
LEFT JOIN biblio ON biblio.biblionumber = items.biblionumber |
2770 |
LEFT JOIN biblioitems ON biblioitems.biblioitemnumber = items.biblioitemnumber |
2770 |
LEFT JOIN biblioitems ON biblioitems.biblioitemnumber = items.biblioitemnumber |
|
|
2771 |
LEFT JOIN biblio_metadata ON biblio_metadata.biblionumber = biblio.biblionumber |
2772 |
WHERE 1 |
2771 |
}; |
2773 |
}; |
2772 |
if (defined $where_str and $where_str ne '') { |
2774 |
if (defined $where_str and $where_str ne '') { |
2773 |
$query .= qq{ WHERE $where_str }; |
2775 |
$query .= qq{ AND $where_str }; |
2774 |
} |
2776 |
} |
2775 |
|
2777 |
|
|
|
2778 |
$query .= q{ AND biblio_metadata.format = 'marcxml' AND biblio_metadata.marcflavour = ? }; |
2779 |
push @where_args, C4::Context->preference('marcflavour'); |
2780 |
|
2776 |
my @columns = Koha::Database->new()->schema()->resultset('Item')->result_source->columns; |
2781 |
my @columns = Koha::Database->new()->schema()->resultset('Item')->result_source->columns; |
2777 |
push @columns, Koha::Database->new()->schema()->resultset('Biblio')->result_source->columns; |
2782 |
push @columns, Koha::Database->new()->schema()->resultset('Biblio')->result_source->columns; |
2778 |
push @columns, Koha::Database->new()->schema()->resultset('Biblioitem')->result_source->columns; |
2783 |
push @columns, Koha::Database->new()->schema()->resultset('Biblioitem')->result_source->columns; |
2779 |
- |
|
|