[Koha-patches] [PATCH] bug 3302: removed disused references to opac_electronic

Galen Charlton galen.charlton at liblime.com
Sun Jun 7 23:39:08 CEST 2009


Removed routines in C4/NewsChannels.pm that refer to
a missing opac_electronic table.
---
 C4/NewsChannels.pm             |   70 ----------------------------------------
 t/lib/KohaTest/NewsChannels.pm |    5 ---
 2 files changed, 0 insertions(+), 75 deletions(-)

diff --git a/C4/NewsChannels.pm b/C4/NewsChannels.pm
index 59ab124..81c685e 100644
--- a/C4/NewsChannels.pm
+++ b/C4/NewsChannels.pm
@@ -34,7 +34,6 @@ BEGIN {
 		&news_channels_categories &get_new_channel_category &del_channels_categories
 		&add_channel_category &update_channel_category &news_channels_by_category
 		&add_opac_new &upd_opac_new &del_opac_new &get_opac_new &get_opac_news
-		&add_opac_electronic &upd_opac_electronic &del_opac_electronic &get_opac_electronic &get_opac_electronics
 	);
 }
 
@@ -347,75 +346,6 @@ sub GetNewsToDisplay {
     return \@results;
 }
 
-### get electronic databases
-
-sub add_opac_electronic {
-    my ($title, $edata, $lang,$image,$href,$section) = @_;
-    my $dbh = C4::Context->dbh;
-    my $sth = $dbh->prepare("INSERT INTO opac_electronic (title, edata, lang,image,href,section) VALUES (?,?,?,?,?,?)");
-    $sth->execute($title, $edata, $lang,$image,$href,$section);
-    $sth->finish;
-    return 1;
-}
-
-sub upd_opac_electronic {
-    my ($idelectronic, $title, $edata, $lang, $image, $href,$section) = @_;
-    my $dbh = C4::Context->dbh;
-    my $sth = $dbh->prepare("UPDATE opac_electronic SET title = ?, edata = ?, lang = ? , image=?, href=? ,section=? WHERE idelectronic = ?");
-    $sth->execute($title, $edata, $lang, $image,$href ,$section, $idelectronic);
-    $sth->finish;
-    return 1;
-}
-
-sub del_opac_electronic {
-    my ($ids) = @_;
-    if ($ids) {
-        my $dbh = C4::Context->dbh;
-        my $sth = $dbh->prepare("DELETE FROM opac_electronic WHERE idelectronic IN ($ids)");
-        $sth->execute();
-        $sth->finish;
-        return 1;
-    } else {
-        return 0;
-    }
-}
-
-sub get_opac_electronic {
-    my ($idelectronic) = @_;
-    my $dbh = C4::Context->dbh;
-    my $sth = $dbh->prepare("SELECT * FROM opac_electronic WHERE idelectronic = ?");
-    $sth->execute($idelectronic);
-    my $data = $sth->fetchrow_hashref;
-    $data->{$data->{'lang'}} = 1;
-    $data->{$data->{'section'}} = 1;
-    $sth->finish;
-    return $data;
-}
-
-sub get_opac_electronics {
-    my ($section, $lang) = @_;
-    my $dbh = C4::Context->dbh;
-    my $query = "SELECT *, DATE_FORMAT(timestamp, '%d/%m/%Y') AS newdate FROM opac_electronic";
-    if ($lang) {
-        $query.= " WHERE lang = '" .$lang ."' ";
-    }
-    if ($section) {
-        $query.= " and section= '" . $section."' ";
-    }
-    $query.= " ORDER BY title ";
-    
-    my $sth = $dbh->prepare($query);
-    $sth->execute();
-    my @opac_electronic;
-    my $count = 0;
-    while (my $row = $sth->fetchrow_hashref) {
-            push @opac_electronic, $row;
-        $count++;
-    }
-
-    return ($count,\@opac_electronic);
-}
-
 1;
 __END__
 
diff --git a/t/lib/KohaTest/NewsChannels.pm b/t/lib/KohaTest/NewsChannels.pm
index 917dfc9..93065b9 100644
--- a/t/lib/KohaTest/NewsChannels.pm
+++ b/t/lib/KohaTest/NewsChannels.pm
@@ -29,11 +29,6 @@ sub methods : Test( 1 ) {
                       get_opac_new 
                       get_opac_news 
                       GetNewsToDisplay 
-                      add_opac_electronic 
-                      upd_opac_electronic 
-                      del_opac_electronic 
-                      get_opac_electronic 
-                      get_opac_electronics 
                 );
     
     can_ok( $self->testing_class, @methods );    
-- 
1.5.6.5




More information about the Koha-patches mailing list