From e541763d3379c59162b395416e5335a375569e7a Mon Sep 17 00:00:00 2001 From: Josef Moravec Date: Fri, 14 Oct 2016 17:44:05 +0200 Subject: [PATCH] Bug 18606: Get rid off GetCollections --- C4/RotatingCollections.pm | 31 ----------------------------- rotating_collections/rotatingCollections.pl | 5 +++-- 2 files changed, 3 insertions(+), 33 deletions(-) diff --git a/C4/RotatingCollections.pm b/C4/RotatingCollections.pm index 484c044..c1bd2e9 100644 --- a/C4/RotatingCollections.pm +++ b/C4/RotatingCollections.pm @@ -53,8 +53,6 @@ BEGIN { GetItemsInCollection - GetCollections - AddItemToCollection RemoveItemFromCollection TransferCollection @@ -161,35 +159,6 @@ sub UpdateCollection { } -=head2 GetCollections - - $collections = GetCollections(); - Returns data about all collections - - Output: - On Success: - $results: Reference to an array of associated arrays - On Failure: - $errorCode: Code for reason of failure, good for translating errors in templates - $errorMessage: English description of error - -=cut - -sub GetCollections { - - my $dbh = C4::Context->dbh; - - my $sth = $dbh->prepare("SELECT * FROM collections"); - $sth->execute() or return ( 1, $sth->errstr() ); - - my @results; - while ( my $row = $sth->fetchrow_hashref ) { - push( @results, $row ); - } - - return \@results; -} - =head2 GetItemsInCollection ( $results, $success, $errorcode, $errormessage ) = GetItemsInCollection( $colId ); diff --git a/rotating_collections/rotatingCollections.pl b/rotating_collections/rotatingCollections.pl index acf4586..0092349 100755 --- a/rotating_collections/rotatingCollections.pl +++ b/rotating_collections/rotatingCollections.pl @@ -23,7 +23,8 @@ use CGI qw ( -utf8 ); use C4::Output; use C4::Auth; use C4::Context; -use C4::RotatingCollections; + +use Koha::RotatingCollections; my $query = new CGI; @@ -40,7 +41,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( my $branchcode = $query->cookie('branch'); -my $collections = GetCollections(); +my $collections = Koha::RotatingCollections->search; $template->param( collectionsLoop => $collections, -- 2.1.4