Browse Source

catalogue.pm deals only with acquisitions.

so, renaming it...
catalogue management is done in Biblio.pm package
3.0.x
tipaul 19 years ago
parent
commit
6376aa4326
  1. 119
      C4/Acquisition.pm
  2. 2
      ISBDdetail.pl
  3. 2
      MARCdetail.pl
  4. 7
      acqui/acqui-home.pl
  5. 2
      acqui/acquire.pl
  6. 2
      acqui/addorder.pl
  7. 22
      acqui/basket.pl
  8. 2
      acqui/finishreceive.pl
  9. 2
      acqui/newbasket2.pl
  10. 2
      acqui/newbiblio.pl
  11. 3
      acqui/order.pl
  12. 2
      acqui/receive.pl
  13. 2
      acqui/recieveorder.pl
  14. 3
      acqui/supplier.pl
  15. 2
      acqui/updatesupplier.pl
  16. 2
      catalogue-home.pl
  17. 2
      currency.pl
  18. 2
      modbibitem.pl
  19. 2
      moditem.pl
  20. 2
      moredetail.pl
  21. 2
      request.pl
  22. 2
      search.marc/search.pl
  23. 2
      search.marc/suggest.pl
  24. 5
      showbudget.pl

119
C4/Catalogue.pm → 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<biblionumber>, C<title>, 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;

2
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;

2
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;

7
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));

2
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;

2
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;

22
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;

2
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;

2
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;

2
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;

3
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;

2
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;

2
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');

3
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;

2
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;

2
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;

2
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;

2
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;

2
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;

2
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;

2
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;

2
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

2
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

5
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;

Loading…
Cancel
Save