From f59595d92f29cc56fb9b18c290e189f5a8ab0609 Mon Sep 17 00:00:00 2001 From: Joe Atzberger Date: Mon, 7 Jan 2008 13:52:45 -0600 Subject: [PATCH] C4 - BEGIN blocks and 1; __END__ for modules Signed-off-by: Chris Cormack Signed-off-by: Joshua Ferraro --- C4/Amazon.pm | 25 ++++++++-------- C4/AuthoritiesMarc.pm | 70 +++++++++++++++++++++++++++---------------- C4/BackgroundJob.pm | 9 ++++-- C4/Branch.pm | 49 +++++++++++++++--------------- C4/Breeding.pm | 18 +++++------ C4/Letters.pm | 21 +++++++------ C4/UploadedFile.pm | 9 ++++-- C4/XISBN.pm | 28 ++++++++++------- 8 files changed, 132 insertions(+), 97 deletions(-) diff --git a/C4/Amazon.pm b/C4/Amazon.pm index ae7573fe9e..19a92f6ce0 100644 --- a/C4/Amazon.pm +++ b/C4/Amazon.pm @@ -19,16 +19,22 @@ package C4::Amazon; use XML::Simple; use LWP::Simple; - use LWP::UserAgent; use HTTP::Request::Common; use strict; -require Exporter; use vars qw($VERSION @ISA @EXPORT); -$VERSION = 0.02; +BEGIN { + require Exporter; + $VERSION = 0.03; + @ISA = qw(Exporter); + @EXPORT = qw( + &get_amazon_details + &check_search_inside + ); +} =head1 NAME @@ -38,15 +44,6 @@ C4::Amazon - Functions for retrieving Amazon.com content in Koha This module provides facilities for retrieving Amazon.com content in Koha -=cut - -@ISA = qw(Exporter); - -@EXPORT = qw( - &get_amazon_details - &check_search_inside -); - =head1 get_amazon_details($isbn); =head2 $isbn is a isbn string @@ -99,6 +96,9 @@ sub check_search_inside { return $available; } +1; +__END__ + =head1 NOTES =head1 AUTHOR @@ -106,4 +106,3 @@ sub check_search_inside { Joshua Ferraro =cut -1; diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm index 5abc39c802..40a943ed10 100644 --- a/C4/AuthoritiesMarc.pm +++ b/C4/AuthoritiesMarc.pm @@ -17,7 +17,6 @@ package C4::AuthoritiesMarc; # Suite 330, Boston, MA 02111-1307 USA use strict; -require Exporter; use C4::Context; use C4::Koha; use MARC::Record; @@ -28,34 +27,37 @@ use C4::AuthoritiesMarc::UNIMARC; use vars qw($VERSION @ISA @EXPORT); -# set the version for version checking -$VERSION = 3.00; - -@ISA = qw(Exporter); -@EXPORT = qw( - &GetTagsLabels - &GetAuthType - &GetAuthTypeCode - &GetAuthMARCFromKohaField - &AUTHhtml2marc - - &AddAuthority - &ModAuthority - &DelAuthority - &GetAuthority - &GetAuthorityXML +BEGIN { + # set the version for version checking + $VERSION = 3.01; + + require Exporter; + @ISA = qw(Exporter); + @EXPORT = qw( + &GetTagsLabels + &GetAuthType + &GetAuthTypeCode + &GetAuthMARCFromKohaField + &AUTHhtml2marc + + &AddAuthority + &ModAuthority + &DelAuthority + &GetAuthority + &GetAuthorityXML - &CountUsage - &CountUsageChildren - &SearchAuthorities + &CountUsage + &CountUsageChildren + &SearchAuthorities - &BuildSummary - &BuildUnimarcHierarchies - &BuildUnimarcHierarchy + &BuildSummary + &BuildUnimarcHierarchies + &BuildUnimarcHierarchy - &merge - &FindDuplicateAuthority - ); + &merge + &FindDuplicateAuthority + ); +} =head2 GetAuthMARCFromKohaField @@ -95,6 +97,7 @@ returns ref to array result and count of results returned =back =cut + sub SearchAuthorities { my ($tags, $and_or, $excluding, $operator, $value, $offset,$length,$authtypecode,$sortby) = @_; # warn "CALL : $tags, $and_or, $excluding, $operator, $value, $offset,$length,$authtypecode,$sortby"; @@ -372,6 +375,7 @@ counts Usage of narrower terms of Authid in bibliorecords. =back =cut + sub CountUsageChildren { my ($authid) = @_; } @@ -386,6 +390,7 @@ returns authtypecode of an authid =back =cut + sub GetAuthTypeCode { #AUTHfind_authtypecode my ($authid) = @_; @@ -422,6 +427,7 @@ where attribute takes values in : =back =cut + sub GetTagsLabels { my ($forlibrarian,$authtypecode)= @_; my $dbh=C4::Context->dbh; @@ -504,6 +510,7 @@ Either Create Or Modify existing authority. =back =cut + sub AddAuthority { # pass the MARC::Record to this function, and it will create the records in the authority table my ($record,$authid,$authtypecode) = @_; @@ -627,6 +634,7 @@ returns xml form of record $authid =back =cut + sub GetAuthorityXML { # Returns MARC::XML of the authority passed in parameter. my ( $authid ) = @_; @@ -660,6 +668,7 @@ Returns MARC::Record of the authority passed in parameter. =back =cut + sub GetAuthority { my ($authid)=@_; my $dbh=C4::Context->dbh; @@ -688,6 +697,7 @@ else =back =cut + sub GetAuthType { my ($authtypecode) = @_; my $dbh=C4::Context->dbh; @@ -983,6 +993,7 @@ Example of text: =back =cut + sub BuildUnimarcHierarchies{ my $authid = shift @_; # warn "authid : $authid"; @@ -1046,6 +1057,7 @@ Those two latest ones should disappear soon. =back =cut + sub BuildUnimarcHierarchy{ my $record = shift @_; my $class = shift @_; @@ -1085,6 +1097,7 @@ return a hashref in order auth_header table data =back =cut + sub GetHeaderAuthority{ my $authid = shift @_; my $sql= "SELECT * from auth_header WHERE authid = ?"; @@ -1128,6 +1141,7 @@ Then we should add some new parameter : bibliotargettag, authtargettag =back =cut + sub merge { my ($mergefrom,$MARCfrom,$mergeto,$MARCto) = @_; my $dbh=C4::Context->dbh; @@ -1290,6 +1304,9 @@ sub get_auth_type_location { END { } # module clean-up code here (global destructor) +1; +__END__ + =head1 AUTHOR Koha Developement team @@ -1297,3 +1314,4 @@ Koha Developement team Paul POULAIN paul.poulain@free.fr =cut + diff --git a/C4/BackgroundJob.pm b/C4/BackgroundJob.pm index 22baaae104..3e1759ea3e 100644 --- a/C4/BackgroundJob.pm +++ b/C4/BackgroundJob.pm @@ -25,8 +25,10 @@ use Digest::MD5; use vars qw($VERSION); -# set the version for version checking -$VERSION = 3.00; +BEGIN { + # set the version for version checking + $VERSION = 3.00; +} =head1 NAME @@ -305,6 +307,9 @@ sub fetch { return $self; } +1; +__END__ + =head1 AUTHOR Koha Development Team diff --git a/C4/Branch.pm b/C4/Branch.pm index 833c7727ea..47cfd6c59e 100644 --- a/C4/Branch.pm +++ b/C4/Branch.pm @@ -23,8 +23,28 @@ use C4::Koha; use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); -# set the version for version checking -$VERSION = 3.00; +BEGIN { + # set the version for version checking + $VERSION = 3.01; + @ISA = qw(Exporter); + @EXPORT = qw( + &GetBranchCategory + &GetBranchName + &GetBranch + &GetBranches + &GetBranchDetail + &get_branchinfos_of + &ModBranch + &CheckBranchCategorycode + &GetBranchInfo + &GetCategoryTypes + &GetBranchCategories + &GetBranchesInCategory + &ModBranchCategoryInfo + &DelBranch + &DelBranchCategory + ); +} =head1 NAME @@ -40,27 +60,6 @@ The functions in this module deal with branches. =head1 FUNCTIONS -=cut - -@ISA = qw(Exporter); -@EXPORT = qw( - &GetBranchCategory - &GetBranchName - &GetBranch - &GetBranches - &GetBranchDetail - &get_branchinfos_of - &ModBranch - &CheckBranchCategorycode - &GetBranchInfo - &GetCategoryTypes - &GetBranchCategories - &GetBranchesInCategory - &ModBranchCategoryInfo - &DelBranch - &DelBranchCategory -); - =head2 GetBranches $branches = &GetBranches(); @@ -84,7 +83,6 @@ foreach my $thisbranch (keys %$branches) { push @branchloop, \%row; } - =head3 in TEMPLATE