From a1bd7af5fbb6ad2553617b1b6acb8a5dc77498e7 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 10 Feb 2016 17:37:11 +0000 Subject: [PATCH] Bug 15798: Remove C4::Koha::displayServers This subroutine is no longer is use and can be removed. Test plan: git grep displayServers should not return any results. Signed-off-by: Mark Tompsett Signed-off-by: Marcel de Rooy Signed-off-by: Kyle M Hall --- C4/Koha.pm | 68 ------------------------------------------------------ 1 file changed, 68 deletions(-) diff --git a/C4/Koha.pm b/C4/Koha.pm index 6e8ba35702..84f5e8c0b2 100644 --- a/C4/Koha.pm +++ b/C4/Koha.pm @@ -48,7 +48,6 @@ BEGIN { &GetFrameworksLoop &getallthemes &getFacets - &displayServers &getnbpages &get_infos_of &get_notforloan_label_of @@ -973,73 +972,6 @@ SELECT lib, return \%notforloan_label_of; } -=head2 displayServers - - my $servers = displayServers(); - my $servers = displayServers( $position ); - my $servers = displayServers( $position, $type ); - -displayServers returns a listref of hashrefs, each containing -information about available z3950 servers. Each hashref has a format -like: - - { - 'checked' => 'checked', - 'encoding' => 'utf8', - 'icon' => undef, - 'id' => 'LIBRARY OF CONGRESS', - 'label' => '', - 'name' => 'server', - 'opensearch' => '', - 'value' => 'lx2.loc.gov:210/', - 'zed' => 1, - }, - -=cut - -sub displayServers { - my ( $position, $type ) = @_; - my $dbh = C4::Context->dbh; - - my $strsth = 'SELECT * FROM z3950servers'; - my @where_clauses; - my @bind_params; - - if ($position) { - push @bind_params, $position; - push @where_clauses, ' position = ? '; - } - - if ($type) { - push @bind_params, $type; - push @where_clauses, ' type = ? '; - } - - # reassemble where clause from where clause pieces - if (@where_clauses) { - $strsth .= ' WHERE ' . join( ' AND ', @where_clauses ); - } - - my $rq = $dbh->prepare($strsth); - $rq->execute(@bind_params); - my @primaryserverloop; - - while ( my $data = $rq->fetchrow_hashref ) { - push @primaryserverloop, - { label => $data->{description}, - id => $data->{name}, - name => "server", - value => $data->{host} . ":" . $data->{port} . "/" . $data->{database}, - encoding => ( $data->{encoding} ? $data->{encoding} : "iso-5426" ), - checked => "checked", - icon => $data->{icon}, - zed => $data->{type} eq 'zed', - opensearch => $data->{type} eq 'opensearch' - }; - } - return \@primaryserverloop; -} - =head2 GetAuthValCode $authvalcode = GetAuthValCode($kohafield,$frameworkcode); -- 2.39.5