From 6376aa43263cd868098bad1551b00567fe09491e Mon Sep 17 00:00:00 2001 From: tipaul Date: Tue, 13 Jul 2004 12:52:13 +0000 Subject: [PATCH] catalogue.pm deals only with acquisitions. so, renaming it... catalogue management is done in Biblio.pm package --- C4/{Catalogue.pm => Acquisition.pm} | 119 ---------------------------- ISBDdetail.pl | 2 +- MARCdetail.pl | 2 +- acqui/acqui-home.pl | 7 +- acqui/acquire.pl | 2 +- acqui/addorder.pl | 2 +- acqui/basket.pl | 22 ++--- acqui/finishreceive.pl | 2 +- acqui/newbasket2.pl | 2 +- acqui/newbiblio.pl | 2 +- acqui/order.pl | 3 +- acqui/receive.pl | 2 +- acqui/recieveorder.pl | 2 +- acqui/supplier.pl | 3 +- acqui/updatesupplier.pl | 2 +- catalogue-home.pl | 2 +- currency.pl | 2 +- modbibitem.pl | 2 +- moditem.pl | 2 +- moredetail.pl | 2 +- request.pl | 2 +- search.marc/search.pl | 2 +- search.marc/suggest.pl | 2 +- showbudget.pl | 5 +- 24 files changed, 38 insertions(+), 157 deletions(-) rename C4/{Catalogue.pm => Acquisition.pm} (89%) diff --git a/C4/Catalogue.pm b/C4/Acquisition.pm similarity index 89% rename from C4/Catalogue.pm rename to C4/Acquisition.pm index d976a9f25e..d5f06ed6a9 100644 --- a/C4/Catalogue.pm +++ b/C4/Acquisition.pm @@ -70,7 +70,6 @@ orders, converting money to different currencies, and so forth. &findall &needsmod &branches &updatesup &insertsup &bookseller &breakdown &checkitems - &websitesearch &addwebsite &updatewebsite &deletewebsite ); # @@ -943,124 +942,6 @@ sub insertsup { return($data->{'id'}); } -=item websitesearch - - ($count, @results) = &websitesearch($keywordlist); - -Looks up biblioitems by URL. - -C<$keywordlist> is a space-separated list of search terms. -C<&websitesearch> returns those biblioitems whose URL contains at -least one of the search terms. - -C<$count> is the number of elements in C<@results>. C<@results> is an -array of references-to-hash, whose keys are the fields of the biblio -and biblioitems tables in the Koha database. - -=cut -#' -sub websitesearch { - my ($keywordlist) = @_; - my $dbh = C4::Context->dbh; - my $sth; - my @results = (); - my @keywords = split(/ +/, $keywordlist); - - $sth = $dbh->prepare("Select distinct biblio.* from biblio, biblioitems where - biblio.biblionumber = biblioitems.biblionumber and (" - .(join(") or (",map { "url like ?" } @keywords)).")"); - $sth->execute(map { s/([%_])/\\\1/g; "%$_%" } @keywords); - - while (my $data = $sth->fetchrow_hashref) { - push(@results,$data); - } # while - - $sth->finish; - return(scalar(@results), @results); -} # sub websitesearch - -=item addwebsite - - &addwebsite($website); - -Adds a new web site. C<$website> is a reference-to-hash, with the keys -C, C, C<description>, and C<url>. All of these -are mandatory. - -=cut -#' -sub addwebsite { - my ($website) = @_; - my $dbh = C4::Context->dbh; - my $query; - - # FIXME - - # for (qw( biblionumber title description url )) # and any others - # { - # $website->{$_} = $dbh->quote($_); - # } - # Perhaps extend this to building the query as well. This might allow - # some of the fields to be optional. - $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); -} # sub website - -=item updatewebsite - - &updatewebsite($website); - -Updates an existing web site. C<$website> is a reference-to-hash with -the keys C<websitenumber>, C<title>, C<description>, and C<url>. All -of these are mandatory. C<$website-E<gt>{websitenumber}> identifies -the entry to update. - -=cut -#' -sub updatewebsite { - my ($website) = @_; - my $dbh = C4::Context->dbh; - 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); -} # sub updatewebsite - -=item deletewebsite - - &deletewebsite($websitenumber); - -Deletes the web site with number C<$websitenumber>. - -=cut -#' -sub deletewebsite { - my ($websitenumber) = @_; - my $dbh = C4::Context->dbh; - # FIXME - $query is unneeded - my $query = "Delete from websites where websitenumber = $websitenumber"; - - $dbh->do($query); -} # sub deletewebsite - END { } # module clean-up code here (global destructor) 1; diff --git a/ISBDdetail.pl b/ISBDdetail.pl index bdccdd368d..086f70c935 100755 --- a/ISBDdetail.pl +++ b/ISBDdetail.pl @@ -46,7 +46,7 @@ use CGI; use C4::Search; use MARC::Record; use C4::Biblio; -use C4::Catalogue; +use C4::Acquisition; use HTML::Template; my $query=new CGI; diff --git a/MARCdetail.pl b/MARCdetail.pl index c1edbb4435..efcbe0cd66 100755 --- a/MARCdetail.pl +++ b/MARCdetail.pl @@ -55,7 +55,7 @@ use CGI; use C4::Search; use MARC::Record; use C4::Biblio; -use C4::Catalogue; +use C4::Acquisition; use HTML::Template; my $query=new CGI; diff --git a/acqui/acqui-home.pl b/acqui/acqui-home.pl index c3898192cd..ba7666a1c3 100755 --- a/acqui/acqui-home.pl +++ b/acqui/acqui-home.pl @@ -6,8 +6,9 @@ use C4::Auth; use C4::Output; use C4::Interface::CGI::Output; use C4::Database; +use C4::Suggestions; use HTML::Template; -use C4::Catalogue; +use C4::Acquisition; my $query = new CGI; my ($template, $loggedinuser, $cookie) @@ -51,11 +52,15 @@ for (my $i=0;$i<$count;$i++){ $line{rate} = $rates->[$i]->{'rate'}; push @loop_currency, \%line; } + +# suggestions ? +my $suggestion = countsuggestion("ASKED"); $template->param(classlist => $classlist, type => 'intranet', loop_budget => \@loop_budget, loop_currency => \@loop_currency, total => sprintf("%.2f",$total), + suggestion => $suggestion, totspent => sprintf("%.2f",$totspent), totcomtd => sprintf("%.2f",$totcomtd), totavail => sprintf("%.2f",$totavail)); diff --git a/acqui/acquire.pl b/acqui/acquire.pl index 2cd9dbe41b..98d6932f74 100755 --- a/acqui/acquire.pl +++ b/acqui/acquire.pl @@ -25,7 +25,7 @@ use strict; use CGI; use C4::Context; -use C4::Catalogue; +use C4::Acquisition; use C4::Biblio; use C4::Output; use C4::Search; diff --git a/acqui/addorder.pl b/acqui/addorder.pl index 40573f6e7b..cbc16b54c7 100755 --- a/acqui/addorder.pl +++ b/acqui/addorder.pl @@ -25,7 +25,7 @@ use strict; use CGI; use C4::Auth; use C4::Output; -use C4::Catalogue; +use C4::Acquisition; use C4::Biblio; use C4::Output; use C4::Interface::CGI::Output; diff --git a/acqui/basket.pl b/acqui/basket.pl index e1f4824b4c..0e896d5236 100755 --- a/acqui/basket.pl +++ b/acqui/basket.pl @@ -97,15 +97,15 @@ $gist=sprintf("%.2f",$sub_total*$prefgist); $grand_total=$sub_total+$gist; $template->param(basket => $basket, - authorisedby => $results[0]->{'authorisedby'}, - entrydate => format_date($results[0]->{'entrydate'}), - id=> $results[0]->{'booksellerid'}, - name => $booksellers[0]->{'name'}, - books_loop => \@books_loop, - count =>$count, - sub_total => $sub_total, - gist => $gist, - grand_total =>$grand_total, - currency => $booksellers[0]->{'listprice'}, - ); + authorisedby => $results[0]->{'authorisedby'}, + entrydate => format_date($results[0]->{'entrydate'}), + id=> $results[0]->{'booksellerid'}, + name => $booksellers[0]->{'name'}, + books_loop => \@books_loop, + count =>$count, + sub_total => $sub_total, + gist => $gist, + grand_total =>$grand_total, + currency => $booksellers[0]->{'listprice'}, + ); output_html_with_http_headers $query, $cookie, $template->output; diff --git a/acqui/finishreceive.pl b/acqui/finishreceive.pl index 1945060ae9..dd351a3307 100755 --- a/acqui/finishreceive.pl +++ b/acqui/finishreceive.pl @@ -22,7 +22,7 @@ # Suite 330, Boston, MA 02111-1307 USA use C4::Output; -use C4::Catalogue; +use C4::Acquisition; use C4::Biblio; use CGI; use C4::Search; diff --git a/acqui/newbasket2.pl b/acqui/newbasket2.pl index 2d4ea65d70..19aaea0e2a 100755 --- a/acqui/newbasket2.pl +++ b/acqui/newbasket2.pl @@ -24,7 +24,7 @@ use strict; use C4::Search; use CGI; use C4::Output; -use C4::Catalogue; +use C4::Acquisition; use C4::Biblio; use HTML::Template; use C4::Auth; diff --git a/acqui/newbiblio.pl b/acqui/newbiblio.pl index 308b8c360f..3f85931104 100755 --- a/acqui/newbiblio.pl +++ b/acqui/newbiblio.pl @@ -24,7 +24,7 @@ use strict; use CGI; use C4::Context; -use C4::Catalogue; +use C4::Acquisition; use C4::Search; use C4::Auth; use C4::Output; diff --git a/acqui/order.pl b/acqui/order.pl index e11db2a41c..3da75ee58e 100755 --- a/acqui/order.pl +++ b/acqui/order.pl @@ -24,7 +24,6 @@ # Suite 330, Boston, MA 02111-1307 USA use strict; -use C4::Catalogue; use C4::Auth; use C4::Biblio; use C4::Output; @@ -32,7 +31,7 @@ use CGI; use C4::Interface::CGI::Output; use C4::Database; use HTML::Template; -use C4::Catalogue; +use C4::Acquisition; use C4::Date; my $query=new CGI; diff --git a/acqui/receive.pl b/acqui/receive.pl index 38fc6cc8ea..16e2fd1af9 100755 --- a/acqui/receive.pl +++ b/acqui/receive.pl @@ -24,7 +24,7 @@ # Suite 330, Boston, MA 02111-1307 USA use C4::Auth; -use C4::Catalogue; +use C4::Acquisition; use C4::Biblio; use C4::Output; use CGI; diff --git a/acqui/recieveorder.pl b/acqui/recieveorder.pl index aefd861f72..302df0f2ff 100755 --- a/acqui/recieveorder.pl +++ b/acqui/recieveorder.pl @@ -29,7 +29,7 @@ use C4::Output; use C4::Interface::CGI::Output; use C4::Database; use HTML::Template; -use C4::Catalogue; +use C4::Acquisition; my $input=new CGI; my $id=$input->param('id'); diff --git a/acqui/supplier.pl b/acqui/supplier.pl index 1835963019..4df003f177 100755 --- a/acqui/supplier.pl +++ b/acqui/supplier.pl @@ -24,14 +24,13 @@ # Suite 330, Boston, MA 02111-1307 USA use C4::Auth; -use C4::Catalogue; +use C4::Acquisition; use C4::Biblio; use C4::Output; use CGI; use C4::Interface::CGI::Output; use C4::Database; use HTML::Template; -use C4::Catalogue; use strict; my $query=new CGI; diff --git a/acqui/updatesupplier.pl b/acqui/updatesupplier.pl index 9c3bd819a1..f06ef80e2c 100755 --- a/acqui/updatesupplier.pl +++ b/acqui/updatesupplier.pl @@ -21,7 +21,7 @@ # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, # Suite 330, Boston, MA 02111-1307 USA -use C4::Catalogue; +use C4::Acquisition; use C4::Biblio; use C4::Output; use CGI; diff --git a/catalogue-home.pl b/catalogue-home.pl index 428724c86a..5431ebafae 100755 --- a/catalogue-home.pl +++ b/catalogue-home.pl @@ -6,7 +6,7 @@ use C4::Auth; use C4::Output; use C4::Interface::CGI::Output; use C4::Database; -use C4::Catalogue; +use C4::Acquisition; use C4::Biblio; use HTML::Template; diff --git a/currency.pl b/currency.pl index 8431453fb2..f0647c201f 100755 --- a/currency.pl +++ b/currency.pl @@ -25,7 +25,7 @@ # Suite 330, Boston, MA 02111-1307 USA use CGI; -use C4::Catalogue; +use C4::Acquisition; use C4::Biblio; my $input=new CGI; diff --git a/modbibitem.pl b/modbibitem.pl index 13a44ba545..674b0bf367 100755 --- a/modbibitem.pl +++ b/modbibitem.pl @@ -35,7 +35,7 @@ use CGI; use HTML::Template; use C4::Date; use C4::Biblio; -use C4::Catalogue; +use C4::Acquisition; use C4::Auth; use C4::Interface::CGI::Output; diff --git a/moditem.pl b/moditem.pl index 46c0e34986..13608dff4e 100755 --- a/moditem.pl +++ b/moditem.pl @@ -35,7 +35,7 @@ use C4::Output; use C4::Biblio; use HTML::Template; use C4::Koha; -use C4::Catalogue; +use C4::Acquisition; use C4::Auth; use C4::Interface::CGI::Output; diff --git a/moredetail.pl b/moredetail.pl index 209be72c25..ee09f97249 100755 --- a/moredetail.pl +++ b/moredetail.pl @@ -26,7 +26,7 @@ require Exporter; use C4::Koha; use CGI; use C4::Search; -use C4::Catalogue; +use C4::Acquisition; use C4::Output; # contains gettemplate use C4::Auth; use C4::Interface::CGI::Output; diff --git a/request.pl b/request.pl index 162d3a767a..1f28e766d5 100755 --- a/request.pl +++ b/request.pl @@ -33,7 +33,7 @@ use C4::Biblio; use C4::Koha; use C4::Circulation::Circ2; use HTML::Template; -use C4::Catalogue; +use C4::Acquisition; use CGI; use C4::Date; diff --git a/search.marc/search.pl b/search.marc/search.pl index fabbf1884f..bc54f1a16b 100755 --- a/search.marc/search.pl +++ b/search.marc/search.pl @@ -30,7 +30,7 @@ use C4::Output; use C4::Interface::CGI::Output; use C4::Biblio; use C4::SearchMarc; -use C4::Catalogue; +use C4::Acquisition; use C4::Koha; # XXX subfield_is_koha_internal_p # Creates the list of active tags using the active MARC configuration diff --git a/search.marc/suggest.pl b/search.marc/suggest.pl index 0225863431..5b0e857682 100755 --- a/search.marc/suggest.pl +++ b/search.marc/suggest.pl @@ -30,7 +30,7 @@ use C4::Output; use C4::Interface::CGI::Output; use C4::Biblio; use C4::SearchMarc; -use C4::Catalogue; +use C4::Acquisition; use C4::Koha; # XXX subfield_is_koha_internal_p # Creates the list of active tags using the active MARC configuration diff --git a/showbudget.pl b/showbudget.pl index efcd96e38a..4c3d1e808e 100755 --- a/showbudget.pl +++ b/showbudget.pl @@ -24,11 +24,8 @@ # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, # Suite 330, Boston, MA 02111-1307 USA -use C4::Catalogue; +use C4::Acquisition; use C4::Biblio; -#use CGI; -#my $inp=new CGI; -#print $inp->header; my ($count,@results)=bookfunds; -- 2.39.5