[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Koha-cvs] CVS: koha/C4 Acquisitions.pm,1.8,1.9 Search.pm,1.23,1.24
From: |
Gynn Lomax |
Subject: |
[Koha-cvs] CVS: koha/C4 Acquisitions.pm,1.8,1.9 Search.pm,1.23,1.24 |
Date: |
Sun, 12 May 2002 08:37:55 -0700 |
Update of /cvsroot/koha/koha/C4
In directory usw-pr-cvs1:/tmp/cvs-serv5006/C4
Modified Files:
Acquisitions.pm Search.pm
Log Message:
New files, and changes to add associated webstes to a biblio.
Adds a new table to database - so installer needs updating again.
Index: Acquisitions.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Acquisitions.pm,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** Acquisitions.pm 9 May 2002 01:07:36 -0000 1.8
--- Acquisitions.pm 12 May 2002 15:37:53 -0000 1.9
***************
*** 20,24 ****
&updatecost &checkitems &modnote &getitemtypes &getbiblio
&getbiblioitem &getitemsbybiblioitem &isbnsearch &keywordsearch
! &websitesearch);
%EXPORT_TAGS = ( ); # eg: TAG => [ qw!name1 name2! ],
--- 20,24 ----
&updatecost &checkitems &modnote &getitemtypes &getbiblio
&getbiblioitem &getitemsbybiblioitem &isbnsearch &keywordsearch
! &websitesearch &addwebsite &updatewebsite &deletewebsite);
%EXPORT_TAGS = ( ); # eg: TAG => [ qw!name1 name2! ],
***************
*** 1341,1344 ****
--- 1341,1398 ----
return($count, @results);
} # sub websitesearch
+
+
+ sub addwebsite {
+ my ($website) = @_;
+ my $dbh = C4Connect;
+ my $query;
+
+ $website->{'biblionumber'} = $dbh->quote($website->{'biblionumber'});
+ $website->{'title'} = $dbh->quote($website->{'title'});
+ $website->{'description'} = $dbh->quote($website->{'description'});
+ $website->{'url'} = $dbh->quote($website->{'url'});
+
+ $query = "Insert into websites set
+ biblionumber = $website->{'biblionumber'},
+ title = $website->{'title'},
+ description = $website->{'description'},
+ url = $website->{'url'}";
+
+ $dbh->do($query);
+
+ $dbh->disconnect;
+ } # sub website
+
+
+ sub updatewebsite {
+ my ($website) = @_;
+ my $dbh = C4Connect;
+ my $query;
+
+ $website->{'title'} = $dbh->quote($website->{'title'});
+ $website->{'description'} = $dbh->quote($website->{'description'});
+ $website->{'url'} = $dbh->quote($website->{'url'});
+
+ $query = "Update websites set
+ title = $website->{'title'},
+ description = $website->{'description'},
+ url = $website->{'url'}
+ where websitenumber = $website->{'websitenumber'}";
+
+ $dbh->do($query);
+
+ $dbh->disconnect;
+ } # sub updatewebsite
+
+
+ sub deletewebsite {
+ my ($websitenumber) = @_;
+ my $dbh = C4Connect;
+ my $query = "Delete from websites where websitenumber = $websitenumber";
+
+ $dbh->do($query);
+
+ $dbh->disconnect;
+ } # sub deletewebsite
Index: Search.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Search.pm,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -r1.23 -r1.24
*** Search.pm 11 May 2002 01:50:35 -0000 1.23
--- Search.pm 12 May 2002 15:37:53 -0000 1.24
***************
*** 22,26 ****
&getboracctrecord &ItemType &itemissues &subject &subtitle
&addauthor &bibitems &barcodes &findguarantees &allissues &systemprefs
! &findguarantor);
%EXPORT_TAGS = ( ); # eg: TAG => [ qw!name1 name2! ],
--- 22,26 ----
&getboracctrecord &ItemType &itemissues &subject &subtitle
&addauthor &bibitems &barcodes &findguarantees &allissues &systemprefs
! &findguarantor &getwebsites);
%EXPORT_TAGS = ( ); # eg: TAG => [ qw!name1 name2! ],
***************
*** 1168,1171 ****
--- 1168,1193 ----
}
+
+
+ sub getwebsites {
+ my ($biblionumber) = @_;
+ my $dbh = C4Connect;
+ my $query = "Select * from websites where biblionumber = $biblionumber";
+ my $sth = $dbh->prepare($query);
+ my $count = 0;
+ my @results;
+
+ $sth->execute;
+ while (my $data = $sth->fetchrow_hashref) {
+ $results[$count] = $data;
+ $count++;
+ } # while
+
+ $sth->finish;
+ $dbh->disconnect;
+ return($count, @results);
+ } # sub getwebsites
+
+
END { } # module clean-up code here (global destructor)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Koha-cvs] CVS: koha/C4 Acquisitions.pm,1.8,1.9 Search.pm,1.23,1.24,
Gynn Lomax <=
- Prev by Date:
[Koha-cvs] CVS: koha database.mysql,1.5,1.6
- Next by Date:
[Koha-cvs] CVS: koha addwebsite.pl,NONE,1.1 deletewebsite.pl,NONE,1.1 modwebsites.pl,NONE,1.1 updatewebsite.pl,NONE,1.1 database.mysql,1.6,1.7 detail.pl,1.5,1.6 modbib.pl,1.2,1.3
- Previous by thread:
[Koha-cvs] CVS: koha database.mysql,1.5,1.6
- Next by thread:
[Koha-cvs] CVS: koha addwebsite.pl,NONE,1.1 deletewebsite.pl,NONE,1.1 modwebsites.pl,NONE,1.1 updatewebsite.pl,NONE,1.1 database.mysql,1.6,1.7 detail.pl,1.5,1.6 modbib.pl,1.2,1.3
- Index(es):