# along with Koha; if not, see <http://www.gnu.org/licenses>.
use Modern::Perl;
+
+use vars qw(@ISA @EXPORT);
+BEGIN {
+ require Exporter;
+ @ISA = qw(Exporter);
+
+ @EXPORT = qw(
+ AddBiblio
+ GetBiblioData
+ GetMarcBiblio
+ GetRecordValue
+ GetISBDView
+ GetMarcControlnumber
+ GetMarcNotes
+ GetMarcISBN
+ GetMarcISSN
+ GetMarcSubjects
+ GetMarcAuthors
+ GetMarcSeries
+ GetMarcHosts
+ GetMarcUrls
+ GetUsedMarcStructure
+ GetXmlBiblio
+ GetCOinSBiblio
+ GetMarcPrice
+ MungeMarcPrice
+ GetMarcQuantity
+ GetAuthorisedValueDesc
+ GetMarcStructure
+ IsMarcStructureInternal
+ GetMarcFromKohaField
+ GetMarcSubfieldStructureFromKohaField
+ GetFrameworkCode
+ TransformKohaToMarc
+ PrepHostMarcField
+ CountItemsIssued
+ CountBiblioInOrders
+ ModBiblio
+ ModZebra
+ UpdateTotalIssues
+ RemoveAllNsb
+ DelBiblio
+ BiblioAutoLink
+ LinkBibHeadingsToAuthorities
+ TransformMarcToKoha
+ TransformHtmlToMarc
+ TransformHtmlToXml
+ prepare_host_field
+ );
+
+ # Internal functions
+ # those functions are exported but should not be used
+ # they are useful in a few circumstances, so they are exported,
+ # but don't use them unless you are a core developer ;-)
+ push @EXPORT, qw(
+ ModBiblioMarc
+ );
+}
+
use Carp;
use Encode qw( decode is_utf8 );
use Koha::SearchEngine;
use Koha::Libraries;
-use vars qw(@ISA @EXPORT);
use vars qw($debug $cgi_debug);
-BEGIN {
-
- require Exporter;
- @ISA = qw( Exporter );
-
- # to add biblios
- # EXPORTED FUNCTIONS.
- push @EXPORT, qw(
- &AddBiblio
- );
-
- # to get something
- push @EXPORT, qw(
- GetBiblioData
- GetMarcBiblio
-
- &GetRecordValue
-
- &GetISBDView
-
- &GetMarcControlnumber
- &GetMarcNotes
- &GetMarcISBN
- &GetMarcISSN
- &GetMarcSubjects
- &GetMarcAuthors
- &GetMarcSeries
- &GetMarcHosts
- GetMarcUrls
- &GetUsedMarcStructure
- &GetXmlBiblio
- &GetCOinSBiblio
- &GetMarcPrice
- &MungeMarcPrice
- &GetMarcQuantity
-
- &GetAuthorisedValueDesc
- &GetMarcStructure
- &IsMarcStructureInternal
- &GetMarcFromKohaField
- &GetMarcSubfieldStructureFromKohaField
- &GetFrameworkCode
- &TransformKohaToMarc
- &PrepHostMarcField
-
- &CountItemsIssued
- &CountBiblioInOrders
- );
-
- # To modify something
- push @EXPORT, qw(
- &ModBiblio
- &ModZebra
- &UpdateTotalIssues
- &RemoveAllNsb
- );
-
- # To delete something
- push @EXPORT, qw(
- &DelBiblio
- );
-
- # To link headings in a bib record
- # to authority records.
- push @EXPORT, qw(
- &BiblioAutoLink
- &LinkBibHeadingsToAuthorities
- );
-
- # Internal functions
- # those functions are exported but should not be used
- # they are useful in a few circumstances, so they are exported,
- # but don't use them unless you are a core developer ;-)
- push @EXPORT, qw(
- &ModBiblioMarc
- );
-
- # Others functions
- push @EXPORT, qw(
- &TransformMarcToKoha
- &TransformHtmlToMarc
- &TransformHtmlToXml
- prepare_host_field
- );
-}
=head1 NAME
my $framework = $params->{framework};
my $itemtype = $framework;
my ( $holdingbrtagf, $holdingbrtagsubf ) = &GetMarcFromKohaField( "items.holdingbranch", $itemtype );
- my $tagslib = &GetMarcStructure( 1, $itemtype, { unsafe => 1 } );
+ my $tagslib = GetMarcStructure( 1, $itemtype, { unsafe => 1 } );
my $ISBD = C4::Context->preference($sysprefname);
my $bloc = $ISBD;
use strict;
#use warnings; FIXME - Bug 2505
-use Carp;
-use C4::Context;
-use C4::Koha;
-use C4::Biblio;
-use Koha::DateUtils;
-use MARC::Record;
-use C4::ClassSource;
-use C4::Log;
-use List::MoreUtils qw/any/;
-use YAML qw/Load/;
-use DateTime::Format::MySQL;
-use Data::Dumper; # used as part of logging item record changes, not just for
- # debugging; so please don't remove this
-
-use Koha::AuthorisedValues;
-use Koha::DateUtils qw/dt_from_string/;
-use Koha::Database;
-
-use Koha::Biblioitems;
-use Koha::Items;
-use Koha::ItemTypes;
-use Koha::SearchEngine;
-use Koha::SearchEngine::Search;
-use Koha::Libraries;
-
use vars qw(@ISA @EXPORT);
-
BEGIN {
+ require Exporter;
+ @ISA = qw(Exporter);
- require Exporter;
- @ISA = qw( Exporter );
-
- # function exports
@EXPORT = qw(
GetItem
AddItemFromMarc
AddItem
AddItemBatchFromMarc
ModItemFromMarc
- Item2Marc
+ Item2Marc
ModItem
ModDateLastSeen
ModItemTransfer
DelItem
-
CheckItemPreSave
-
GetItemsForInventory
GetItemsInfo
- GetItemsLocationInfo
- GetHostItemsInfo
- get_hostitemnumbers_of
+ GetItemsLocationInfo
+ GetHostItemsInfo
+ get_hostitemnumbers_of
GetHiddenItemnumbers
ItemSafeToDelete
DelItemCheck
- MoveItemFromBiblio
- GetLatestAcquisitions
-
+ MoveItemFromBiblio
+ GetLatestAcquisitions
CartToShelf
ShelfToCart
-
- GetAnalyticsCount
-
+ GetAnalyticsCount
SearchItemsByField
SearchItems
-
PrepareItemrecordDisplay
-
);
}
+use Carp;
+use C4::Context;
+use C4::Koha;
+use C4::Biblio;
+use Koha::DateUtils;
+use MARC::Record;
+use C4::ClassSource;
+use C4::Log;
+use List::MoreUtils qw(any);
+use YAML qw(Load);
+use DateTime::Format::MySQL;
+use Data::Dumper; # used as part of logging item record changes, not just for
+ # debugging; so please don't remove this
+
+use Koha::AuthorisedValues;
+use Koha::DateUtils qw(dt_from_string);
+use Koha::Database;
+
+use Koha::Biblioitems;
+use Koha::Items;
+use Koha::ItemTypes;
+use Koha::SearchEngine;
+use Koha::SearchEngine::Search;
+use Koha::Libraries;
+
=head1 NAME
C4::Items - item management functions
# parse item hash from MARC
my $frameworkcode = C4::Biblio::GetFrameworkCode( $biblionumber );
my ($itemtag,$itemsubfield)=C4::Biblio::GetMarcFromKohaField("items.itemnumber",$frameworkcode);
-
- my $localitemmarc=MARC::Record->new;
- $localitemmarc->append_fields($source_item_marc->field($itemtag));
- my $item = &TransformMarcToKoha( $localitemmarc, $frameworkcode ,'items');
+
+ my $localitemmarc=MARC::Record->new;
+ $localitemmarc->append_fields($source_item_marc->field($itemtag));
+ my $item = TransformMarcToKoha( $localitemmarc, $frameworkcode ,'items');
my $unlinked_item_subfields = _get_unlinked_item_subfields($localitemmarc, $frameworkcode);
return AddItem($item, $biblionumber, $dbh, $frameworkcode, $unlinked_item_subfields);
}
my $localitemmarc = MARC::Record->new;
$localitemmarc->append_fields( $item_marc->field($itemtag) );
- my $item = &TransformMarcToKoha( $localitemmarc, $frameworkcode, 'items' );
+ my $item = TransformMarcToKoha( $localitemmarc, $frameworkcode, 'items' );
my $default_values = _build_default_values_for_mod_marc();
foreach my $item_field ( keys %$default_values ) {
$item->{$item_field} = $default_values->{$item_field}
# Note: $tagslib obtained from GetMarcStructure() in 'unsafe' mode is
# a shared data structure. No plugin (including custom ones) should change
# its contents. See also GetMarcStructure.
- my $tagslib = &GetMarcStructure( 1, $frameworkcode, { unsafe => 1 } );
+ my $tagslib = GetMarcStructure( 1, $frameworkcode, { unsafe => 1 } );
# return nothing if we don't have found an existing framework.
return q{} unless $tagslib;