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