catalogue.pm deals only with acquisitions.
so, renaming it... catalogue management is done in Biblio.pm package
This commit is contained in:
parent
b15407f227
commit
6376aa4326
|
|
@ -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;
|
||||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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…
Reference in New Issue