From 49ff27f14609473096788426fd17425642986a7f 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. --- C4/Koha.pm | 69 -------------------------------------------------------------- 1 file changed, 69 deletions(-) diff --git a/C4/Koha.pm b/C4/Koha.pm index 7171f16..3f2077c 100644 --- a/C4/Koha.pm +++ b/C4/Koha.pm @@ -50,7 +50,6 @@ BEGIN { &GetFrameworksLoop &getallthemes &getFacets - &displayServers &getnbpages &get_infos_of &get_notforloan_label_of @@ -1010,74 +1009,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 GetKohaImageurlFromAuthorisedValues $authhorised_value = GetKohaImageurlFromAuthorisedValues( $category, $authvalcode ); -- 2.1.0