From ecdf5952085cc73313513d14dc426ce9de1b0b33 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Mon, 8 Jun 2009 15:11:42 -0500 Subject: [PATCH] bug 3314: remove disused scripts and API functions The distributedto column of the subscription table is no longer used, having been replaced by the serials routing list table. This patch removes two C4::Serials functions and a script and template, none of which were reachable by current code: C4::Serials::GetDistributedTo() C4::Serials::SetDistributedTo() koha-tmpl/intranet-tmpl/prog/en/modules/serials/distributedto.tmpl serials/distributedto.pl Signed-off-by: Galen Charlton --- C4/Serials.pm | 45 -------- .../en/modules/serials/distributedto.tmpl | 106 ------------------ serials/distributedto.pl | 102 ----------------- t/lib/KohaTest/Serials.pm | 2 - 4 files changed, 255 deletions(-) delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/serials/distributedto.tmpl delete mode 100755 serials/distributedto.pl diff --git a/C4/Serials.pm b/C4/Serials.pm index 96908bf3f3..7d81586c66 100644 --- a/C4/Serials.pm +++ b/C4/Serials.pm @@ -51,7 +51,6 @@ BEGIN { &UpdateClaimdateIssues &GetSuppliersWithLateIssues &getsupplierbyserialid - &GetDistributedTo &SetDistributedTo &getroutinglist &delroutingmember &addroutingmember &reorder_members &check_routing &updateClaim &removeMissingIssue @@ -855,27 +854,6 @@ sub GetLatestSerials { return \@serials; } -=head2 GetDistributedTo - -=over 4 - -$distributedto=GetDistributedTo($subscriptionid) -This function select the old previous value of distributedto in the database. - -=back - -=cut - -sub GetDistributedTo { - my $dbh = C4::Context->dbh; - my $distributedto; - my $subscriptionid = @_; - my $query = "SELECT distributedto FROM subscription WHERE subscriptionid=?"; - my $sth = $dbh->prepare($query); - $sth->execute($subscriptionid); - return ($distributedto) = $sth->fetchrow; -} - =head2 GetNextSeq =over 4 @@ -1830,29 +1808,6 @@ sub HasSubscriptionExpired { return 0; # Notice that you'll never get here. } -=head2 SetDistributedto - -=over 4 - -SetDistributedto($distributedto,$subscriptionid); -This function update the value of distributedto for a subscription given on input arg. - -=back - -=cut - -sub SetDistributedto { - my ( $distributedto, $subscriptionid ) = @_; - my $dbh = C4::Context->dbh; - my $query = qq| - UPDATE subscription - SET distributedto=? - WHERE subscriptionid=? - |; - my $sth = $dbh->prepare($query); - $sth->execute( $distributedto, $subscriptionid ); -} - =head2 DelSubscription =over 4 diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/distributedto.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/distributedto.tmpl deleted file mode 100644 index f828d4a4b4..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/distributedto.tmpl +++ /dev/null @@ -1,106 +0,0 @@ - -Koha › Serials › Distribution Lists - - - - - - - - - -
- -
-
-
- -

Select borrowers or enter manually the names

-
- - - - - - - - -
- " /> - - -

Distributed to

-

- -

- - -

saved

- - - " /> - - -
- - - -
-
- -
-
- -
- -
-
- diff --git a/serials/distributedto.pl b/serials/distributedto.pl deleted file mode 100755 index af4088b354..0000000000 --- a/serials/distributedto.pl +++ /dev/null @@ -1,102 +0,0 @@ -#!/usr/bin/perl - -# Copyright 2000-2002 Katipo Communications -# -# This file is part of Koha. -# -# Koha is free software; you can redistribute it and/or modify it under the -# terms of the GNU General Public License as published by the Free Software -# Foundation; either version 2 of the License, or (at your option) any later -# version. -# -# Koha is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR -# A PARTICULAR PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along with -# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, -# Suite 330, Boston, MA 02111-1307 USA - - -=head1 NAME - -distributedto - -=head1 DESCRIPTION - -this script is launched as a popup. It allows to choose for who the subscription can be distributed. - -=head1 PARAMETERS - -=over 4 - -=item searchfield -to filter on the members. - -=item distributedto -to know if there are already some members to in the distributed list - -=item subscriptionid -to know what subscription this scrpit have to distribute. - -=item SaveList - -=back - -=cut - - -use strict; -use CGI; -use C4::Dates; -use C4::Auth; -use C4::Context; -use C4::Output; - -use C4::Serials; -use C4::Members; - -my $input = new CGI; -my $searchfield=$input->param('searchfield'); -defined $searchfield or $searchfield=''; -my $distributedto=$input->param('distributedto'); -my $subscriptionid = $input->param('subscriptionid'); -$searchfield=~ s/\,//g; -my $SaveList=$input->param('SaveList'); -my $dbh = C4::Context->dbh; - -$distributedto = GetDistributedTo($subscriptionid) unless $distributedto; - -SetDistributedto($distributedto,$subscriptionid) if ($SaveList) ; - -my ($template, $borrowernumber, $cookie) - = get_template_and_user({template_name => "serials/distributedto.tmpl", - query => $input, - type => "intranet", - authnotrequired => 0, - flagsrequired => {serials => 1}, - debug => 1, - }); - -my ($count,$results)=SearchMember($searchfield,"firstname","simple",) if $searchfield; -my $toggle="0"; -my @loop_data =(); -for (my $i=0; $i < $count; $i++){ - if ($i % 2){ - $toggle=1; - } else { - $toggle=0; - } - my %row_data; - $row_data{toggle} = $toggle; - $row_data{firstname} = $results->[$i]{'firstname'}; - $row_data{surname} = $results->[$i]{'surname'}; - push(@loop_data, \%row_data); -} -$template->param(borlist => \@loop_data, - searchfield => $searchfield, - distributedto => $distributedto, - SaveList => $SaveList, - subscriptionid => $subscriptionid, - ); -output_html_with_http_headers $input, $cookie, $template->output; diff --git a/t/lib/KohaTest/Serials.pm b/t/lib/KohaTest/Serials.pm index e572d1faff..07aa69ecca 100644 --- a/t/lib/KohaTest/Serials.pm +++ b/t/lib/KohaTest/Serials.pm @@ -28,7 +28,6 @@ sub methods : Test( 1 ) { GetSerials GetSerials2 GetLatestSerials - GetDistributedTo GetNextSeq GetSeq GetExpirationDate @@ -41,7 +40,6 @@ sub methods : Test( 1 ) { NewIssue ItemizeSerials HasSubscriptionExpired - SetDistributedto DelSubscription DelIssue GetLateOrMissingIssues -- 2.39.5