&GetBiblioItemByBiblioNumber
&GetBiblioFromItemNumber
- &GetMarcItem
&GetItem
&GetItemInfosOf
&GetItemStatus
}
}
-=head2 GetMarcItem
-
-=over 4
-
-Returns MARC::Record of the item passed in parameter.
-
-=back
-
-=cut
-
-sub GetMarcItem {
- my ( $biblionumber, $itemnumber ) = @_;
-
- # GetMarcItem has been revised so that it does the following:
- # 1. Gets the item information from the items table.
- # 2. Converts it to a MARC field for storage in the bib record.
- #
- # The previous behavior was:
- # 1. Get the bib record.
- # 2. Return the MARC tag corresponding to the item record.
- #
- # The difference is that one treats the items row as authoritative,
- # while the other treats the MARC representation as authoritative
- # under certain circumstances.
- #
- # FIXME - a big one
- #
- # As of 2007-11-27, this change hopefully does not introduce
- # any bugs. However, it does mean that for code that uses
- # ModItemInMarconefield to update one subfield (corresponding to
- # an items column) is now less efficient.
- #
- # The API needs to be shifted to the following:
- # 1. User updates items record.
- # 2. Linked bib is sent for indexing.
- #
- # The missing step 1.5 is updating the item tag in the bib MARC record
- # so that the indexes are updated. Depending on performance considerations,
- # this may ultimately mean of of the following:
- # a. MARC field for item is updated right away.
- # b. MARC field for item is updated only as part of indexing.
- # c. MARC field for item is never actually stored in bib record; instead
- # it is generated only when needed for indexing, item export, and
- # (maybe) OPAC display.
- #
-
- my $itemrecord = GetItem($itemnumber);
-
- # Tack on 'items.' prefix to column names so that TransformKohaToMarc will work.
- # Also, don't emit a subfield if the underlying field is blank.
- my $mungeditem = { map { $itemrecord->{$_} ne '' ? ("items.$_" => $itemrecord->{$_}) : () } keys %{ $itemrecord } };
-
- my $itemmarc = TransformKohaToMarc($mungeditem);
- return $itemmarc;
-
-}
-
-
-
=head2 GetMarcNotes
=over 4
ModItem({ itemlost => 0, datelastseen => $today->output("iso") }, undef, $itemnumber);
}
+=head1 LIMITED USE FUNCTIONS
+
+The following functions, while part of the public API,
+are not exported. This is generally because they are
+meant to be used by only one script for a specific
+purpose, and should not be used in any other context
+without careful thought.
+
+=cut
+
+=head2 GetMarcItem
+
+=over 4
+
+Returns MARC::Record of the item passed in parameter.
+This function is meant for use only in C<cataloguing/additem.pl>,
+where it is needed to support that script's MARC-like
+editor.
+
+=back
+
+=cut
+
+sub GetMarcItem {
+ my ( $biblionumber, $itemnumber ) = @_;
+
+ # GetMarcItem has been revised so that it does the following:
+ # 1. Gets the item information from the items table.
+ # 2. Converts it to a MARC field for storage in the bib record.
+ #
+ # The previous behavior was:
+ # 1. Get the bib record.
+ # 2. Return the MARC tag corresponding to the item record.
+ #
+ # The difference is that one treats the items row as authoritative,
+ # while the other treats the MARC representation as authoritative
+ # under certain circumstances.
+
+ my $itemrecord = GetItem($itemnumber);
+
+ # Tack on 'items.' prefix to column names so that TransformKohaToMarc will work.
+ # Also, don't emit a subfield if the underlying field is blank.
+ my $mungeditem = { map { $itemrecord->{$_} ne '' ? ("items.$_" => $itemrecord->{$_}) : () } keys %{ $itemrecord } };
+
+ my $itemmarc = TransformKohaToMarc($mungeditem);
+ return $itemmarc;
+
+}
+
=head1 PRIVATE FUNCTIONS AND VARIABLES
The following functions are not meant to be called
} elsif ($op eq "edititem") {
#-------------------------------------------------------------------------------
# retrieve item if exist => then, it's a modif
- $itemrecord = GetMarcItem($biblionumber,$itemnumber);
+ $itemrecord = C4::Items::GetMarcItem($biblionumber,$itemnumber);
$nextop="saveitem";
#-------------------------------------------------------------------------------
} elsif ($op eq "delitem") {