Commit 2ffd5b72 authored by tipaul's avatar tipaul

rel_3_0 moved to HEAD

parent dde84179
This diff is collapsed.
This diff is collapsed.
......@@ -34,12 +34,23 @@ package C4::Amazon;
# loop SimilarProducts (Product)
# loop Reviews (rating, Summary)
#
use XML::Simple;
use LWP::Simple;
use strict;
require Exporter;
use vars qw($VERSION @ISA @EXPORT);
$VERSION = 0.01;
$VERSION = 0.02;
=head1 NAME
C4::Amazon - Functions for retrieving Amazon.com content in Koha
=head1 FUNCTIONS
This module provides facilities for retrieving Amazon.com content in Koha
=cut
@ISA = qw(Exporter);
......@@ -47,15 +58,24 @@ $VERSION = 0.01;
&get_amazon_details
);
=head1 get_amazon_details($isbn);
=head2 $isbn is a isbn string
=cut
sub get_amazon_details {
my ( $isbn ) = @_;
# insert your dev key here
my $dev_key='neulibrary-20';
$isbn=substr($isbn,0,9);
$isbn =~ s/(p|-)//g;
# insert your associates tag here
my $af_tag='0YGCZ5GV9ZNGGS7THDG2';
my $dev_key=C4::Context->preference('AmazonDevKey');
#grab the associates tag: mine is '0ZRY7YASKJS280T7YB02'
my $af_tag=C4::Context->preference('AmazonAssocTag');
my $asin=$isbn;
......@@ -65,27 +85,19 @@ my $asin=$isbn;
# "&dev-t=" . $dev_key .
# "&type=heavy&f=xml&" .
# "AsinSearch=" . $asin;
my $url = "http://xml.amazon.com/onca/xml3?t=$dev_key&dev-t=$af_tag&type=heavy&f=xml&AsinSearch=" . $asin;
#Here's an example asin for the book "Cryptonomicon"
#0596005423";
use XML::Simple;
use LWP::Simple;
my $url = "http://xml.amazon.com/onca/xml3?t=$af_tag&dev-t=$dev_key&type=heavy&f=xml&AsinSearch=" . $asin;
my $content = get($url);
if ($content){
warn "could not retrieve $url" unless $content;
my $xmlsimple = XML::Simple->new();
my $response = $xmlsimple->XMLin($content,
forcearray => [ qw(Details Product AvgCustomerRating CustomerReview ) ],
forcearray => [ qw(Details Product AvgCustomerRating CustomerReview) ],
);
return $response;
#foreach my $result (@{$response->{Details}}){
# my $product_description = $result->{ProductDescription};
# my $image = $result->{ImageUrlMedium};
# my $price = $result->{ListPrice};
# my $reviews = $result->{
# return $result;
#}
}
}
\ No newline at end of file
=head1 NOTES
=head1 AUTHOR
Joshua Ferraro <jmf@liblime.com>
=cut
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -50,15 +50,11 @@ a bookseller.
=head1 FUNCTIONS
=over 2
=cut
#-------------------------------------------------------------------#
=head3 GetBookSeller
=over 4
=head2 GetBookSeller
@results = &GetBookSeller($searchstring);
......@@ -68,8 +64,6 @@ ID, or a string to look for in the book seller's name.
C<@results> is an array of references-to-hash, whose keys are the fields of of the
aqbooksellers table in the Koha database.
=back
=cut
sub GetBookSeller {
......@@ -93,20 +87,16 @@ sub GetBookSeller {
#-----------------------------------------------------------------#
=head3 GetBooksellersWithLateOrders
=over 4
=head2 GetBooksellersWithLateOrders
%results = &GetBooksellersWithLateOrders;
Searches for suppliers with late orders.
=back
=cut
sub GetBooksellersWithLateOrders {
my $delay = shift;
my ($delay,$branch) = @_;
my $dbh = C4::Context->dbh;
# FIXME NOT quite sure that this operation is valid for DBMs different from Mysql, HOPING so
......@@ -147,9 +137,7 @@ sub GetBooksellersWithLateOrders {
#--------------------------------------------------------------------#
=head3 AddBookseller
=over 4
=head2 AddBookseller
$id = &AddBookseller($bookseller);
......@@ -159,8 +147,6 @@ All fields must be present.
Returns the ID of the newly-created bookseller.
=back
=cut
sub AddBookseller {
......@@ -197,20 +183,18 @@ sub AddBookseller {
);
# return the id of this new supplier
my $query = "
$query = "
SELECT max(id)
FROM aqbooksellers
";
my $sth = $dbh->prepare($query);
$sth = $dbh->prepare($query);
$sth->execute;
return scalar($sth->fetchrow);
}
#-----------------------------------------------------------------#
=head3 ModSupplier
=over 4
=head2 ModSupplier
&ModSupplier($bookseller);
......@@ -223,8 +207,6 @@ The easiest way to get all of the necessary fields is to look up a
book seller with C<&booksellers>, modify what's necessary, then call
C<&ModSupplier> with the result.
=back
=cut
sub ModBookseller {
......@@ -260,15 +242,12 @@ sub ModBookseller {
$sth->finish;
}
END { } # module clean-up code here (global destructor)
1;
__END__
=back
=head1 AUTHOR
Koha Developement team <info@koha.org>
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -21,6 +21,7 @@ package C4::Input; #assumes C4/Input
use strict;
require Exporter;
use C4::Context;
use CGI;
use vars qw($VERSION @ISA @EXPORT);
......@@ -190,12 +191,14 @@ sub buildCGIsort {
if ($sth->rows>0){
my @values;
my %labels;
for (my $i =0;$i<=$sth->rows;$i++){
for (my $i =0;$i<$sth->rows;$i++){
my $results = $sth->fetchrow_hashref;
push @values, $results->{authorised_value};
$labels{$results->{authorised_value}}=$results->{lib};
}
$CGISort= CGI::scrolling_list(
unshift(@values,"");
$CGISort= CGI::scrolling_list(
-name => $input_name,
-values => \@values,
-labels => \%labels,
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -23,7 +23,8 @@ use C4::Context;
use vars qw($VERSION @ISA @EXPORT);
$VERSION = 0.01;
# set the version for version checking
$VERSION = do { my @v = '$Revision$' =~ /\d+/g; shift(@v).".".join( "_", map { sprintf "%03d", $_ } @v ); };
=head1 NAME
......@@ -47,8 +48,6 @@ Review.pm provides many routines for manipulating reviews.
=head1 FUNCTIONS
=over 2
=cut
@ISA = qw(Exporter);
......@@ -99,7 +98,6 @@ sub updatereview {
my $sth = $dbh->prepare($query);
$sth->execute( $review, 0, $borrowernumber, $biblionumber );
$sth->finish();
}
sub numberofreviews {
......@@ -151,7 +149,6 @@ sub getallreviews {
Takes a reviewid and marks that review approved
=cut
sub approvereview {
......@@ -171,7 +168,6 @@ sub approvereview {
Takes a reviewid and deletes it
=cut
sub deletereview {
......@@ -187,8 +183,6 @@ sub deletereview {
1;
__END__
=back
=head1 AUTHOR
Koha Team
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -29,9 +29,9 @@ package C4::Z3950;
use strict;
# standard or CPAN modules used
use DBI;
# Koha modules used
use C4::Context;
use C4::Input;
use C4::Biblio;
......@@ -42,7 +42,7 @@ require Exporter;
use vars qw($VERSION @ISA @EXPORT);
# set the version for version checking
$VERSION = 0.01;
$VERSION = do { my @v = '$Revision$' =~ /\d+/g; shift(@v).".".join( "_", map { sprintf "%03d", $_ } @v ); };
=head1 NAME
......@@ -305,8 +305,11 @@ Koha Developement team <info@koha.org>
#--------------------------------------
# $Log$
# Revision 1.13 2006/09/06 16:21:03 tgarip1957
# Clean up before final commits
# Revision 1.14 2007/03/09 14:31:47 tipaul
# rel_3_0 moved to HEAD
#
# Revision 1.10.10.1 2006/12/22 15:09:54 toins
# removing C4::Database;
#
# Revision 1.10 2003/10/01 15:08:14 tipaul
# fix fog bug #622 : processz3950queue fails
......
This diff is collapsed.
This diff is collapsed.
#!/usr/bin/perl -w
#!/usr/bin/perl
# Copyright 2006 Katipo Communications
#
......@@ -64,15 +64,14 @@ SELECT quantity,
ON aqorderbreakdown.ordernumber = aqorders.ordernumber
INNER JOIN aqbasket
ON aqbasket.basketno = aqorders.basketno
LEFT JOIN biblio
ON biblio.biblionumber = aqorders.biblionumber
LEFT JOIN biblioitems
ON biblioitems.biblioitemnumber = aqorders.biblioitemnumber
WHERE bookfundid = ?
AND budgetdate >= ?
AND budgetdate < ?
AND (datecancellationprinted IS NULL
OR datecancellationprinted = \'0000-00-00\')
';
##warn $query;
my $sth = $dbh->prepare($query);
$sth->execute( $bookfund, $start, $end );
my @commited_loop;
......@@ -97,6 +96,6 @@ $template->param(
total => $total
);
$sth->finish;
#$dbh->disconnect;
$dbh->disconnect;
output_html_with_http_headers $input, $cookie, $template->output;
This diff is collapsed.
......@@ -35,7 +35,6 @@ my @params=$input->param;
foreach my $param (@params){
if ($param ne 'type' && $param !~ /submit/){
my $data=$input->param($param);
# warn "$data / $param";
ModCurrencies($param,$data);
}
}
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -83,14 +83,13 @@ $data{'listprice'}=$input->param('list_currency');
$data{'invoiceprice'}=$input->param('invoice_currency');
$data{'gstreg'}=$input->param('gst');
$data{'listincgst'}=$input->param('list_gst');
$data{'invoiceincgst'}=$input->param('invoiceincgst');
$data{'invoiceincgst'}=$input->param('invoice_gst');
$data{'discount'}=$input->param('discount');
my $id=$input->param('id');
if ($data{'id'} != 0){
ModBookseller(\%data);
if ($data{'id'}){
ModBookseller(\%data);
} else {
$id=AddBookseller(\%data);
$data{id}=AddBookseller(\%data);
}
#redirect to booksellers.pl
print $input->redirect("booksellers.pl?supplier=$id");
print $input->redirect("booksellers.pl?supplier=".$data{id});
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -39,10 +39,9 @@
use strict;
use CGI;
use C4::Context;
use C4::Output;
use C4::Search;
use C4::Auth;
use C4::Interface::CGI::Output;
......@@ -193,7 +192,10 @@ if ($op eq 'add_form') {
} #---- END $OP eq DEFAULT
$template->param(intranetcolorstylesheet => C4::Context->preference("intranetcolorstylesheet"),
intranetstylesheet => C4::Context->preference("intranetstylesheet"),
IntranetNav => C4::Context->preference("IntranetNav"),
);
output_html_with_http_headers $input, $cookie, $template->output;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment