From colin.campbell at ptfs-europe.com Fri Jun 1 09:15:37 2012
From: colin.campbell at ptfs-europe.com (Colin Campbell)
Date: Fri, 1 Jun 2012 08:15:37 +0100
Subject: [Koha-patches] [PATCH] Bug 8176 Assign an intial value to $sqlwhere
Message-ID: <1338534937-4852-1-git-send-email-colin.campbell@ptfs-europe.com>
warnings in log because of undefined value in
string concatenation
variable should be initialized to empty string rather
than left undefined
---
C4/Serials.pm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/C4/Serials.pm b/C4/Serials.pm
index 20ad706..af5c833 100644
--- a/C4/Serials.pm
+++ b/C4/Serials.pm
@@ -566,7 +566,7 @@ sub GetSubscriptions {
LEFT JOIN biblioitems ON biblio.biblionumber = biblioitems.biblionumber
);
my @bind_params;
- my $sqlwhere;
+ my $sqlwhere = q{};
if ($biblionumber) {
$sqlwhere = " WHERE biblio.biblionumber=?";
push @bind_params, $biblionumber;
--
1.7.11.rc0
From dpavlin at rot13.org Fri Jun 1 15:27:22 2012
From: dpavlin at rot13.org (Dobrica Pavlinusic)
Date: Fri, 1 Jun 2012 15:27:22 +0200
Subject: [Koha-patches] [PATCH] Bug 8178 - circ/circulation.pl under plack
duplicates checkout rows
Message-ID: <1338557242-19145-1-git-send-email-dpavlin@rot13.org>
Bug 7851 introduced our scoping for vairables, unfortunatly it has
side-effect that checkout rows accumulate on page reloads instead
of being initialized to empty array (which this patch fixes)
Test scenario:
1. start intranet under plack
2. open /cgi-bin/koha/circ/circulation.pl and reload page few time
confirming that rows gets duplicated
3. apply patch and reload page to verify that it works
---
circ/circulation.pl | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/circ/circulation.pl b/circ/circulation.pl
index c89abff..fdad5f2 100755
--- a/circ/circulation.pl
+++ b/circ/circulation.pl
@@ -417,10 +417,10 @@ if ($borrowernumber) {
# make the issued books table.
my $todaysissues = '';
my $previssues = '';
-our @todaysissues;
-our @previousissues;
-our @relissues;
-our @relprevissues;
+our @todaysissues = ();
+our @previousissues = ();
+our @relissues = ();
+our @relprevissues = ();
my $displayrelissues;
our $totalprice = 0;
--
1.7.2.5
From dpavlin at rot13.org Fri Jun 1 15:40:26 2012
From: dpavlin at rot13.org (Dobrica Pavlinusic)
Date: Fri, 1 Jun 2012 15:40:26 +0200
Subject: [Koha-patches] [PATCH] Bug 7844 - plack intranet tooling for
developers
Message-ID: <1338558026-22809-1-git-send-email-dpavlin@rot13.org>
koha.psgi example and plackup.sh script to run any Koha site
intranet or opac interface under plack with optional multi-process
Starman server
plackup.sh site-name [intranet]
site-name is used to find config /etc/koha/sites/site-name/koha-conf.xml
All configuration is specified in koha.psgi, which you are welcomed to edit
and tune according to your development needs.
When you are happy with it, rename it to site name and save it for safe-keeping.
Test scenario:
1. install plack and dependencies, as documented at
http://wiki.koha-community.org/wiki/Plack
2. start ./plackup.sh sitename
3. open intranet page http://localhost:5001/cgi-bin/koha/mainpage.pl
and verify that it works
4. start ./plackup.sh sitename i[ntranet]
5. open OPAC http://localhost:5000/cgi-bin/koha/opac-main.pl
and verify that it works
6. next step is to take a look into koha.psgi and enable additional
debug modules, save file and reload page (plackup will reload
code automatically)
---
misc/plack/README.plack | 32 +++++++++++++++++++
misc/plack/koha.psgi | 78 +++++++++++++++++++++++++++++++++++++++++++++++
misc/plack/plackup.sh | 53 ++++++++++++++++++++++++++++++++
3 files changed, 163 insertions(+), 0 deletions(-)
create mode 100644 misc/plack/README.plack
create mode 100644 misc/plack/koha.psgi
create mode 100755 misc/plack/plackup.sh
diff --git a/misc/plack/README.plack b/misc/plack/README.plack
new file mode 100644
index 0000000..71593f4
--- /dev/null
+++ b/misc/plack/README.plack
@@ -0,0 +1,32 @@
+Bug 7844 - plack intranet tooling for developers
+
+koha.psgi example and plackup.sh script to run any Koha site
+intranet or opac interface under plack with optional multi-process
+Starman server
+
+ plackup.sh site-name [intranet]
+
+site-name is used to find config /etc/koha/sites/site-name/koha-conf.xml
+
+All configuration is specified in koha.psgi, which you are welcomed to edit
+and tune according to your development needs.
+
+When you are happy with it, rename it to site name and save it for safe-keeping.
+
+Test scenario:
+1. install plack and dependencies, as documented at
+ http://wiki.koha-community.org/wiki/Plack
+
+2. start ./plackup.sh sitename
+
+3. open intranet page http://localhost:5001/cgi-bin/koha/mainpage.pl
+ and verify that it works
+
+4. start ./plackup.sh sitename i[ntranet]
+
+5. open OPAC http://localhost:5000/cgi-bin/koha/opac-main.pl
+ and verify that it works
+
+6. next step is to take a look into koha.psgi and enable additional
+ debug modules, save file and reload page (plackup will reload
+ code automatically)
diff --git a/misc/plack/koha.psgi b/misc/plack/koha.psgi
new file mode 100644
index 0000000..e388dae
--- /dev/null
+++ b/misc/plack/koha.psgi
@@ -0,0 +1,78 @@
+#!/usr/bin/perl
+use Plack::Builder;
+use Plack::App::CGIBin;
+use lib qw( ./lib );
+use Plack::Middleware::Debug;
+use Plack::App::Directory;
+
+BEGIN {
+
+# override configuration from startup script below:
+# (requires --reload option)
+
+$ENV{PLACK_DEBUG} = 1; # toggle debugging
+
+# memcache change requires restart
+$ENV{MEMCACHED_SERVERS} = "localhost:11211";
+#$ENV{MEMCACHED_DEBUG} = 0;
+
+$ENV{PROFILE_PER_PAGE} = 1; # reset persistant and profile counters after each page, like CGI
+#$ENV{INTRANET} = 1; # usually passed from script
+
+#$ENV{DBI_AUTOPROXY}='dbi:Gofer:transport=null;cache=DBI::Util::CacheMemory'
+
+} # BEGIN
+
+use C4::Context;
+use C4::Languages;
+use C4::Members;
+use C4::Dates;
+use C4::Boolean;
+use C4::Letters;
+use C4::Koha;
+use C4::XSLT;
+use C4::Branch;
+use C4::Category;
+=for preload
+use C4::Tags; # FIXME
+=cut
+
+use Devel::Size 0.77; # 0.71 doesn't work for Koha
+my $watch_capture_regex = '(C4|Koha)';
+
+sub watch_for_size {
+ my @watch =
+ map { s/^.*$watch_capture_regex/$1/; s/\//::/g; s/\.pm$//; $_ } # fix paths
+ grep { /$watch_capture_regex/ }
+ keys %INC
+ ;
+ warn "# watch_for_size ",join(' ', at watch);
+ return @watch;
+};
+
+my $CGI_ROOT = $ENV{INTRANET} ? $ENV{INTRANETDIR} : $ENV{OPACDIR};
+warn "# using Koha ", $ENV{INTRANET} ? 'intranet' : 'OPAC', " CGI from $CGI_ROOT\n";
+my $app=Plack::App::CGIBin->new(root => $CGI_ROOT);
+
+builder {
+
+ enable_if { $ENV{PLACK_DEBUG} } 'Debug', panels => [
+ qw(Koha Persistant),
+ qw(Environment Response Timer Memory),
+ # optional plugins (uncomment to enable) are sorted according to performance implact
+# [ 'Devel::Size', for => \&watch_for_size ], # https://github.com/dpavlin/p5-plack-devel-debug-devel-size
+# [ 'DBIProfile', profile => 2 ],
+# [ 'DBITrace', level => 1 ], # a LOT of fine-graded SQL trace
+# [ 'Profiler::NYTProf', exclude => [qw(.*\.css .*\.png .*\.ico .*\.js .*\.gif)] ],
+ ];
+
+ enable_if { $ENV{PLACK_DEBUG} } 'StackTrace';
+
+ enable_if { $ENV{INTRANETDIR} } "Plack::Middleware::Static",
+ path => qr{^/(intranet|opac)-tmpl/},
+ root => "$ENV{INTRANETDIR}/koha-tmpl/";
+
+ mount "/cgi-bin/koha" => $app;
+
+};
+
diff --git a/misc/plack/plackup.sh b/misc/plack/plackup.sh
new file mode 100755
index 0000000..35fcf0f
--- /dev/null
+++ b/misc/plack/plackup.sh
@@ -0,0 +1,53 @@
+#!/bin/sh -xe
+
+# This is plack startup script for Koha
+
+# ./plackup.sh [site] [intranet]
+
+site=$1
+test ! -z "$site" && shift || site=srvgit # default
+
+export KOHA_CONF=/etc/koha/sites/$site/koha-conf.xml
+export LOGDIR="$( sudo -u $site-koha xmlstarlet sel -t -v 'yazgfs/config/logdir' $KOHA_CONF )"
+export INTRANETDIR="$( sudo -u $site-koha xmlstarlet sel -t -v 'yazgfs/config/intranetdir' $KOHA_CONF )"
+export OPACDIR="$( sudo -u $site-koha xmlstarlet sel -t -v 'yazgfs/config/opacdir' $KOHA_CONF | sed 's,/cgi-bin/opac,,' )"
+
+dir=`dirname $0`
+
+# enable memcache - it's safe even on installation which don't have it
+# since Koha has check on C4::Context
+#export MEMCACHED_SERVERS=localhost:11211
+# pass site name as namespace to perl code
+export MEMCACHED_NAMESPACE=$site
+#export MEMCACHED_DEBUG=1
+
+if [ ! -e "$INTRANETDIR/C4" ] ; then
+ echo "intranetdir in $KOHA_CONF doesn't point to Koha git checkout"
+ exit 1
+fi
+
+if [ -z "$1" ] ; then # type anything after site name for intranet!
+ INTRANET=0
+ PORT=5000
+else
+ INTRANET=1
+ PORT=5001
+ shift # pass rest of arguments to plackup
+fi
+export INTRANET # pass to plack
+
+# uncomment to enable logging
+#opt="$opt --access-log $LOGDIR/opac-access.log --error-log $LOGDIR/opac-error.log"
+
+# --max-requests 50 decreased from 1000 to keep memory usage sane
+# --workers 4 number of cores on machine
+#test "$INTRANET" != 1 && \ # don't use Starman for intranet
+opt="$opt --server Starman -M FindBin --max-requests 50 --workers 4"
+
+# -E deployment turn off access log on STDOUT
+opt="$opt -E deployment"
+
+# comment out reload in production!
+opt="$opt --reload -R $INTRANETDIR/C4 -R $INTRANETDIR/Koha"
+
+sudo -E -u $site-koha plackup --port $PORT -I $INTRANETDIR -I $INTRANETDIR/installer $opt $* $dir/koha.psgi
--
1.7.2.5
From christophe.croullebois at biblibre.com Fri Jun 1 16:10:50 2012
From: christophe.croullebois at biblibre.com (Christophe Croullebois)
Date: Fri, 1 Jun 2012 16:10:50 +0200
Subject: [Koha-patches] [PATCH 1/1] Bug 7351 : Patch for minor visual changes
Message-ID: <1338559850-10238-1-git-send-email-christophe.croullebois@biblibre.com>
I have just put a space between the radio button and the text for the new lines..
And I have replaced tabulations by space.
You must have applied before :
"[SIGN OFF]Bug 7351 : feature that allows to delete a range of dates"
"Patch for minor textual changes"
---
.../prog/en/modules/tools/holidays.tt | 66 +++++++++++---------
1 files changed, 36 insertions(+), 30 deletions(-)
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt
index aa578cf..1cf239c 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt
@@ -215,36 +215,42 @@
Description:
-
-
-
Generate an exception for this repeated holiday.
-
[?]
-
You can make an exception for this holiday rule. This means that you will be able to say that for a repeatable holiday there is one day which is going to be an exception.
-
-
- Generate exceptions on a range of dates. .
- [?]
- You can make an exception on a range of dates repeated yearly.
-
- Delete this holiday
- [?]
- This will delete this holiday rule. If it is a repeatable holiday, this option checks for possible exceptions. If an exception exists, this option will remove the exception and set the date to a regular holiday.
- Delete the single holidays on a range .
- [?]
- This will delete the single holidays rules only. The repeatable holidays and exceptions will not be deleted.
-
- Delete the repeated holidays on a range .
- [?]
- This will delete the repeated holidays rules only. The repeatable holidays will be deleted but not the exceptions.
-
- Delete the exceptions on a range .
- [?]
- This will delete the exceptions inside a given range. Be careful about your scope range. If it is oversized, you could slow down Koha.
-
- Edit this holiday
- [?]
- This will save changes to the holiday's title and description. If the information for a repeatable holiday is modified, it affects all of the dates on which the holiday is repeated.
-
+
+
+
+
Generate an exception for this repeated holiday.
+
[?]
+
You can make an exception for this holiday rule. This means that you will be able to say that for a repeatable holiday there is one day which is going to be an exception.
+
+
+ Generate exceptions on a range of dates. .
+ [?]
+ You can make an exception on a range of dates repeated yearly.
+
+
+ Delete this holiday
+ [?]
+ This will delete this holiday rule. If it is a repeatable holiday, this option checks for possible exceptions. If an exception exists, this option will remove the exception and set the date to a regular holiday.
+
+ Delete the single holidays on a range .
+ [?]
+ This will delete the single holidays rules only. The repeatable holidays and exceptions will not be deleted.
+ /li>
+
+ Delete the repeated holidays on a range .
+ [?]
+ This will delete the repeated holidays rules only. The repeatable holidays will be deleted but not the exceptions.
+
+
+ Delete the exceptions on a range .
+ [?]
+ This will delete the exceptions inside a given range. Be careful about your scope range. If it is oversized, you could slow down Koha.
+
+
+ Edit this holiday
+ [?]
+ This will save changes to the holiday's title and description. If the information for a repeatable holiday is modified, it affects all of the dates on which the holiday is repeated.
+
Cancel
--
1.7.0.4
From oleonard at myacpl.org Fri Jun 1 16:19:01 2012
From: oleonard at myacpl.org (Owen Leonard)
Date: Fri, 1 Jun 2012 10:19:01 -0400
Subject: [Koha-patches] [PATCH] Bug 7747 [FOLLOW-UP] Replace YUI
autocomplete with jQueryUI
Message-ID:
This patch removes the template calls to the now-obsolete
YUI JS dependencies and removes the relevant YUI files themselves.
Patch is attached since it contains long lines.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Bug-7747-FOLLOW-UP-Replace-YUI-autocomplete-with-jQu.patch
Type: application/octet-stream
Size: 494156 bytes
Desc: not available
URL:
From dpavlin at rot13.org Fri Jun 1 16:40:13 2012
From: dpavlin at rot13.org (Dobrica Pavlinusic)
Date: Fri, 1 Jun 2012 16:40:13 +0200
Subject: [Koha-patches] [PATCH] Bug 8180 - cataloguing/additem.pl plack
scoping
Message-ID: <1338561613-31786-1-git-send-email-dpavlin@rot13.org>
$dbh needs our scoping when using "Add item" to prevent error
Can't call method "prepare" on an undefined value at /srv/koha/cataloguing/additem.pl line 88.
Test scenario:
1. start intranet with plack
2. select one Edit items on one record
3. fill in new item and click on "Add item"
---
cataloguing/additem.pl | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl
index f970890..deb0208 100755
--- a/cataloguing/additem.pl
+++ b/cataloguing/additem.pl
@@ -37,7 +37,7 @@ use C4::Search;
use MARC::File::XML;
use URI::Escape;
-my $dbh = C4::Context->dbh;
+our $dbh = C4::Context->dbh;
sub find_value {
my ($tagfield,$insubfield,$record) = @_;
--
1.7.2.5
From dpavlin at rot13.org Fri Jun 1 17:45:40 2012
From: dpavlin at rot13.org (Dobrica Pavlinusic)
Date: Fri, 1 Jun 2012 17:45:40 +0200
Subject: [Koha-patches] [PATCH] Bug 8178 - circ/circulation.pl under plack
duplicates checkout rows
Message-ID: <1338565540-9071-1-git-send-email-dpavlin@rot13.org>
Bug 7851 introduced our scoping for vairables, unfortunatly it has
side-effect that checkout rows accumulate on page reloads instead
of being initialized to empty array (which this patch fixes)
This also fixes %renew_failed initialization on each request.
Test scenario:
1. start intranet under plack
2. open /cgi-bin/koha/circ/circulation.pl and reload page few time
confirming that rows gets duplicated
3. apply patch and reload page to verify that it works
---
circ/circulation.pl | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/circ/circulation.pl b/circ/circulation.pl
index c89abff..858bfe5 100755
--- a/circ/circulation.pl
+++ b/circ/circulation.pl
@@ -94,7 +94,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user (
my $branches = GetBranches();
my @failedrenews = $query->param('failedrenew'); # expected to be itemnumbers
-our %renew_failed;
+our %renew_failed = {};
for (@failedrenews) { $renew_failed{$_} = 1; }
my $findborrower = $query->param('findborrower');
@@ -417,10 +417,10 @@ if ($borrowernumber) {
# make the issued books table.
my $todaysissues = '';
my $previssues = '';
-our @todaysissues;
-our @previousissues;
-our @relissues;
-our @relprevissues;
+our @todaysissues = ();
+our @previousissues = ();
+our @relissues = ();
+our @relprevissues = ();
my $displayrelissues;
our $totalprice = 0;
--
1.7.2.5
From oleonard at myacpl.org Fri Jun 1 18:24:16 2012
From: oleonard at myacpl.org (Owen Leonard)
Date: Fri, 1 Jun 2012 12:24:16 -0400
Subject: [Koha-patches] [PATCH] Bug 8143 - Upgrade jQuery tabs to current
jQueryUI version
Message-ID:
Current jQuery-driven tabs are done using a very old
version of the tabs plugin. This patch upgrades jQueryUI
to the latest version and adds the tabs widget dependency
to the jqueryui js file and updates the syntax for existing
tabs:
- $("#foo > ul").tabs(); changes to $("#foo").tabs();
- Remove full URL from tab links (use #anchor only).
Pages with "static" tabs (tabs which are built in the
markup rather than generated by the plugin) have been
modified to use their own style. Examples: pay.tt in
the staff client and opac-readingrecord.tt in the OPAC.
Patch is attached because it contains long lines.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Bug-8143-Upgrade-jQuery-tabs-to-current-jQueryUI-ver.patch
Type: application/octet-stream
Size: 263732 bytes
Desc: not available
URL:
From dpavlin at rot13.org Fri Jun 1 21:12:01 2012
From: dpavlin at rot13.org (Dobrica Pavlinusic)
Date: Fri, 1 Jun 2012 21:12:01 +0200
Subject: [Koha-patches] [PATCH] Bug 8183 - acqui/parcels.pl plack scoping
Message-ID: <1338577921-9623-1-git-send-email-dpavlin@rot13.org>
Scope our $template for plack to prevent following error:
Can't call method "param" on an undefined value at /srv/koha_ffzg/acqui/parcels.pl line 177.
Test scenario:
1. Home > Acquisitions > Search for vendor
2. click on "Receive shipment"
---
acqui/parcels.pl | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/acqui/parcels.pl b/acqui/parcels.pl
index 173c0c8..fdb46d5 100755
--- a/acqui/parcels.pl
+++ b/acqui/parcels.pl
@@ -86,7 +86,7 @@ my $dateto = $input->param('dateto');
my $resultsperpage = $input->param('resultsperpage');
$resultsperpage ||= 20;
-my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
+our ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{ template_name => 'acqui/parcels.tmpl',
query => $input,
type => 'intranet',
--
1.7.2.5
From dpavlin at rot13.org Fri Jun 1 21:24:52 2012
From: dpavlin at rot13.org (Dobrica Pavlinusic)
Date: Fri, 1 Jun 2012 21:24:52 +0200
Subject: [Koha-patches] [PATCH] Bug 7952 - PDF::Reuse under plack writes to
console STDOUT instead to browser
Message-ID: <1338578692-11411-1-git-send-email-dpavlin@rot13.org>
Without name option to prFile, PDF::Reuse opens '-' file which is real
console STDOUT on plack so pdf file gets emited to terminal instead of
sending it to browser.
This change creates temporary file using File::Temp, pass it to PDF::Reuse
and then reads it back and prints it out for plack (or CGI) to pick up.
DEBUG=1 it will debugging output
Test secenario:
1. Home ? Tools ? Patron Card Creator ? Manage Card Batches
2. select batch checkbox and click Export
3. select template and click Export
4. click on pdf file to download it
---
C4/Creators/PDF.pm | 16 +++++++++++++++-
1 files changed, 15 insertions(+), 1 deletions(-)
diff --git a/C4/Creators/PDF.pm b/C4/Creators/PDF.pm
index 0aae09c..b3dd1dd 100644
--- a/C4/Creators/PDF.pm
+++ b/C4/Creators/PDF.pm
@@ -21,6 +21,7 @@ use strict;
use warnings;
use PDF::Reuse;
use PDF::Reuse::Barcode;
+use File::Temp;
BEGIN {
use version; our $VERSION = qv('1.0.0_1');
@@ -42,7 +43,13 @@ sub new {
delete($opts{InitVars});
prDocDir($opts{'DocDir'}) if $opts{'DocDir'};
delete($opts{'DocDir'});
- prFile(%opts);
+
+ my $fh = File::Temp->new( UNLINK => 0, SUFFIX => '.pdf' );
+ $opts{Name} = $self->{filename} = "$fh"; # filename
+ close $fh; # we need just filename
+ warn "## Name [$opts{Name}] $fh";
+
+ prFile(\%opts);
bless ($self, $type);
return $self;
}
@@ -52,6 +59,13 @@ sub End {
# if the pdf stream is utf8, explicitly set it to utf8; this avoids at lease some wide character errors -chris_n
utf8::encode($PDF::Reuse::stream) if utf8::is_utf8($PDF::Reuse::stream);
prEnd();
+
+ # slurp temporary filename and print it out for plack to pick up
+ local $/ = undef;
+ open(my $fh, '<', $self->{filename}) || die "$self->{filename}: $!";
+ print <$fh>;
+ close $fh;
+ unlink $self->{filename};
}
sub Add {
--
1.7.2.5
From amit.gupta at osslabs.biz Mon Jun 4 06:12:05 2012
From: amit.gupta at osslabs.biz (Amit Gupta)
Date: Mon, 4 Jun 2012 09:42:05 +0530
Subject: [Koha-patches] [PATCH] Bug 7910 - Batch renewal of serials
Message-ID: <1338783125-1862-1-git-send-email-amit.gupta@osslabs.biz>
To Test:
1) Go to Serials click on Check expiration link.
2) Search some subscription which have to expire it will give some result.
3) Select atleast one subscription which you want to renew.
4) Check the expiration date after renew.
---
.../prog/en/modules/serials/checkexpiration.tt | 34 ++++++++++++++++++--
serials/subscription-renew.pl | 28 +++++++++++++---
2 files changed, 53 insertions(+), 9 deletions(-)
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/checkexpiration.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/checkexpiration.tt
index 272f19e..6163c76 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/checkexpiration.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/checkexpiration.tt
@@ -25,7 +25,23 @@
// ]]>
-
+
[% INCLUDE 'header.inc' %]
@@ -83,8 +99,15 @@
[% END %]
will expire before [% date %]
+
[% ELSE %]
No results for your query
[% END %]
diff --git a/serials/subscription-renew.pl b/serials/subscription-renew.pl
index 48861bc..815d910 100755
--- a/serials/subscription-renew.pl
+++ b/serials/subscription-renew.pl
@@ -61,7 +61,8 @@ my $dbh = C4::Context->dbh;
my $mode = $query->param('mode');
my $op = $query->param('op') || q{};
-my $subscriptionid = $query->param('subscriptionid');
+my @subscriptionid = $query->param('subscriptionid');
+my $date = $query->param('date');
my $done = 0; # for after form has been submitted
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
@@ -75,17 +76,32 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
);
if ( $op eq "renew" ) {
ReNewSubscription(
- $subscriptionid, $loggedinuser,
+ @subscriptionid, $loggedinuser,
C4::Dates->new($query->param('startdate'))->output('iso'), $query->param('numberlength'),
$query->param('weeklength'), $query->param('monthlength'),
$query->param('note')
);
}
-my $subscription = GetSubscription($subscriptionid);
+my $subid;
+if ( $op eq "renewall" ) {
+ foreach $subid (@subscriptionid){
+ next unless $subid;
+ my $data = GetSubscription($subid);
+ my $length = $data->{numberlength};
+ my $weeklength = $data->{weeklength};
+ my $monthlength = $data->{monthlength};
+ my $note = $data->{note};
+ my $startdate = $data->{enddate} || POSIX::strftime( "%Y-%m-%d", localtime );
+ ReNewSubscription( $subid,$loggedinuser,$startdate,$length,$weeklength, $monthlength, $note);
+ }
+ print $query->redirect("/cgi-bin/koha/serials/checkexpiration.pl?date=$date");
+}
+
+my $subscription = GetSubscription(@subscriptionid);
if ($subscription->{'cannotedit'}){
- carp "Attempt to renew subscription $subscriptionid by ".C4::Context->userenv->{'id'}." not allowed";
- print $query->redirect("/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=$subscriptionid");
+ carp "Attempt to renew subscription @subscriptionid by ".C4::Context->userenv->{'id'}." not allowed";
+ print $query->redirect("/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=@subscriptionid");
}
$template->param(
@@ -96,7 +112,7 @@ $template->param(
numberlength => $subscription->{numberlength},
weeklength => $subscription->{weeklength},
monthlength => $subscription->{monthlength},
- subscriptionid => $subscriptionid,
+ subscriptionid => @subscriptionid,
bibliotitle => $subscription->{bibliotitle},
$op => 1,
popup => ($query->param('mode')eq "popup"),
--
1.6.4.2
From oleonard at myacpl.org Mon Jun 4 21:24:48 2012
From: oleonard at myacpl.org (Owen Leonard)
Date: Mon, 4 Jun 2012 15:24:48 -0400
Subject: [Koha-patches] [PATCH] Bug 8171 - Improper escaping of quotes
during z39.50 queries leads to broken html
Message-ID: <1338837889-11278-1-git-send-email-oleonard@myacpl.org>
Implementing fix as suggested by Chris Cormack:
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8171#c4
---
.../prog/en/modules/cataloguing/z3950_search.tt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_search.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_search.tt
index 3db24d3..ffd29d2 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_search.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_search.tt
@@ -91,7 +91,7 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color :
- Title:
+ Title:
ISBN/ISSN:
LC call number:
Control no.:
--
1.7.9.5
From oleonard at myacpl.org Tue Jun 5 18:26:35 2012
From: oleonard at myacpl.org (Owen Leonard)
Date: Tue, 5 Jun 2012 12:26:35 -0400
Subject: [Koha-patches] [PATCH] Bug 8187 - Batch patron modification missing
from tools sidebar menu
Message-ID: <1338913595-15057-1-git-send-email-oleonard@myacpl.org>
Adding a link to the tools sidebar menu for batch patron modification.
Also changing the link text on the Tools home page to make it
somewhat clearer.
---
.../intranet-tmpl/prog/en/includes/tools-menu.inc | 3 +++
.../prog/en/modules/tools/tools-home.tt | 4 ++--
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/tools-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/tools-menu.inc
index b70ffd4..0c3ac93 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/tools-menu.inc
+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/tools-menu.inc
@@ -34,6 +34,9 @@
[% IF ( CAN_user_tools_delete_anonymize_patrons ) %]
Patrons (anonymize, bulk-delete)
[% END %]
+ [% IF ( CAN_user_tools_edit_patrons ) %]
+ Batch patron modification
+ [% END %]
[% IF ( CAN_user_tools_moderate_tags ) %]
Tag moderation
[% END %]
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt
index 3c8d641..1f4e1e2 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt
@@ -46,8 +46,8 @@
[% END %]
[% IF ( CAN_user_tools_edit_patrons ) %]
- Patrons (Modification)
- Modify patrons
+ Batch patron modification
+ Modify patrons in batch
[% END %]
[% IF ( CAN_user_tools_moderate_tags ) %]
--
1.7.9.5
From oleonard at myacpl.org Tue Jun 5 18:58:19 2012
From: oleonard at myacpl.org (Owen Leonard)
Date: Tue, 5 Jun 2012 12:58:19 -0400
Subject: [Koha-patches] [PATCH] Bug 8184 - Duplicate budget page lacks
heading and breadcrumbs
Message-ID: <1338915499-15825-1-git-send-email-oleonard@myacpl.org>
Adding title, heading, and breadcrumbs for "duplicate a budget"
operation. Also:
- adding cancel link for duplicate and edit
- correcting the CSS so that the "edit" menu button
is styled like an edit button.
operations.
---
.../intranet-tmpl/prog/en/css/staff-global.css | 5 +++--
.../prog/en/modules/admin/aqbudgetperiods.tt | 12 ++++++++----
2 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css b/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css
index e591a73..96c8b7e 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css
+++ b/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css
@@ -905,7 +905,7 @@ fieldset.rows .inputnote {
visibility:visible; /* you propably don't need to change this one */
display:block;
}
-#newbiblio a, #addchild a, #newentry a, #newshelf a, #newmenuc .first-child, #newsupplier .first-child, #newlabel a, #newtemplate a, #newlabelbatch a, #newpatroncardbatch a, #newprofile a, #newsubscription a, #newdictionary a, #newbasket a, #newrootbudget-button, #budgets_menuc .first-child, #periods_menuc .first-child {
+#newbiblio a, #addchild a, #newentry a, #newshelf a, #newmenuc .first-child, #newsupplier .first-child, #newlabel a, #newtemplate a, #newlabelbatch a, #newpatroncardbatch a, #newprofile a, #newsubscription a, #newdictionary a, #newbasket a, #newrootbudget-button, #budgets_menuc .first-child {
padding-left : 34px;
background-image: url("../../img/toolbar-new.gif");
background-position : center left;
@@ -943,7 +943,8 @@ fieldset.rows .inputnote {
#managelabel a,
#managetemplate a,
#managelabelbatch a,
-#manageprofile a {
+#manageprofile a,
+#periods_menuc .first-child {
padding-left : 34px;
background-image: url("../../img/toolbar-edit.gif");
background-position : center left;
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt
index aae5925..4b25992 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt
@@ -89,7 +89,7 @@
Add budget
[% END %]
[% END %]
-
+ [% IF ( duplicate_form ) %]› Duplicate budget[% END %]
[% IF ( delete_confirm ) %]›
Delete budget '[% budget_period_description %]'?
[% END %]
@@ -136,7 +136,10 @@
Delete budget '[% budget_period_description %]'?
[% END %]
[% END %]
-
+
+ [% IF ( duplicate_form ) %]
+ Budgets › Duplicate budget
+ [% END %]
[% IF ( else ) %]
@@ -152,6 +155,7 @@
[% INCLUDE 'budgets-admin-toolbar.inc' %]
[% IF ( duplicate_form ) %]
+Duplicate budget
@@ -287,7 +291,7 @@
-
+ [% IF ( budget_period_id ) %]Cancel [% END %]
--
1.7.9.5
From amit.gupta at osslabs.biz Wed Jun 6 14:09:00 2012
From: amit.gupta at osslabs.biz (Amit Gupta)
Date: Wed, 6 Jun 2012 17:39:00 +0530
Subject: [Koha-patches] [PATCH] Bug 7911 Greater flexibility in auto barcode
number
Message-ID: <1338984540-6115-1-git-send-email-amit.gupta@osslabs.biz>
Add option to generate autoBarcode with itemtype as prefix
To Test:
1) Go to More->Adminstration->Global system preferences
2) Choose (generated in the form itemtypecode) under autobarcode option.
3) Create one bibliographic record and add item.
4) Click on barcode field it will generate barcode automatically for ex: BK0001
---
cataloguing/value_builder/barcode.pl | 25 ++++++++++++++++++++
installer/data/mysql/sysprefs.sql | 1 +
installer/data/mysql/updatedatabase.pl | 7 +++++
.../en/modules/admin/preferences/cataloguing.pref | 1 +
4 files changed, 34 insertions(+), 0 deletions(-)
diff --git a/cataloguing/value_builder/barcode.pl b/cataloguing/value_builder/barcode.pl
index c5e1fd3..cb6abb0 100755
--- a/cataloguing/value_builder/barcode.pl
+++ b/cataloguing/value_builder/barcode.pl
@@ -60,6 +60,7 @@ sub plugin_javascript {
my ($year, $mon, $day) = split('-', C4::Dates->today('iso'));
my ($tag,$subfield) = GetMarcFromKohaField("items.barcode", '');
my ($loctag,$locsubfield) = GetMarcFromKohaField("items.homebranch", '');
+ my ($itypetag,$itypesubfield) = GetMarcFromKohaField("items.itype", '');
my $nextnum;
my $query;
@@ -122,6 +123,30 @@ sub plugin_javascript {
\$('#' + id).val(document.f.field_value[fnum].value + '$nextnum');
}
";
+ }
+ elsif ($autoBarcodeType eq 'itypeincr') { # Generates a barcode where itype = Itemtype, incr = incremental number
+
+ $query = "SELECT MAX(CAST(SUBSTRING(barcode,-4) AS signed)) AS number FROM items WHERE barcode REGEXP ?";
+ my $sth = $dbh->prepare($query);
+ $sth->execute();
+ while (my ($count)= $sth->fetchrow_array) {
+ $nextnum = $count if $count;
+ $nextnum = 0 if $nextnum == 9999; # this sequence only allows for cataloging 10000 books per month
+ warn "Existing incremental number = $nextnum" if $DEBUG;
+ }
+ $nextnum++;
+ $nextnum = sprintf("%0*d", "4",$nextnum);
+ warn "New itypeincr Barcode = $nextnum" if $DEBUG;
+ $scr = "
+ for (i=0 ; i
preference("Version") < TransformToNum($DBversion)) {
SetVersion ($DBversion);
}
+$DBversion = "3.09.00.XXX";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+ $dbh->do("update systempreferences set options='incremental|annual|hbyymmincr|itypeincr|OFF', explanation= 'Used to autogenerate a barcode: incremental will be of the form 1, 2, 3; annual of the form 2007-0001, 2007-0002; hbyymmincr of the form HB08010001 where HB=Home Branch; itypeincr of the form BK0001 where itype=Item type.' where variable='autobarcode'");
+ print "Upgrade to $DBversion done (Add option to generate autoBarcode with itemtype as prefix)\n";
+ SetVersion ($DBversion);
+}
+
=head1 FUNCTIONS
=head2 TableExists($table)
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref
index 10e1d13..68c1820 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref
@@ -89,6 +89,7 @@ Cataloging:
incremental: generated in the form 1, 2, 3.
annual: generated in the form <year>-0001, <year>-0002.
hbyymmincr: generated in the form <branchcode>yymm0001.
+ itypeincr: generated in the form <itemtypecode>0001.
"OFF": not generated automatically.
Display:
-
--
1.6.4.2
From christophe.croullebois at biblibre.com Wed Jun 6 16:16:23 2012
From: christophe.croullebois at biblibre.com (christophe croullebois)
Date: Wed, 6 Jun 2012 16:16:23 +0200
Subject: [Koha-patches] [PATCH 1/1] Bug 8197 : Software error when you have
cleaned cookies and try to past the url to opac-topissues.pl
Message-ID: <1338992183-12295-1-git-send-email-christophe.croullebois@biblibre.com>
Try to delete cookies and paste the url to opac-topissues.pl.
Without the patch we have a Software error.
---
opac/opac-topissues.pl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/opac/opac-topissues.pl b/opac/opac-topissues.pl
index 6ecc6ad..7fb902e 100755
--- a/opac/opac-topissues.pl
+++ b/opac/opac-topissues.pl
@@ -129,7 +129,7 @@ $template->param(do_it => 1,
results_loop => \@results,
);
-$template->param( branchloop => GetBranchesLoop(C4::Context->userenv->{'branch'}));
+$template->param( branchloop => GetBranchesLoop(C4::Context->userenv?C4::Context->userenv->{'branch'}:''));
# the index parameter is different for item-level itemtypes
my $itype_or_itemtype = (C4::Context->preference("item-level_itypes"))?'itype':'itemtype';
--
1.7.9.5
From jonathan.druart at biblibre.com Wed Jun 6 16:37:01 2012
From: jonathan.druart at biblibre.com (Jonathan Druart)
Date: Wed, 6 Jun 2012 16:37:01 +0200
Subject: [Koha-patches] [PATCH 1/1] Bug 8199 : Replace table in opac-results
with div
Message-ID: <1338993421-32181-1-git-send-email-jonathan.druart@biblibre.com>
Test plan:
launch a query from your opac search form and compare results before and
after applying this patch.
Normally, You don't show a lot of differences.
---
koha-tmpl/opac-tmpl/prog/en/css/opac.css | 44 ++
.../opac-tmpl/prog/en/modules/opac-results.tt | 520 +++++++++++--------
2 files changed, 345 insertions(+), 219 deletions(-)
diff --git a/koha-tmpl/opac-tmpl/prog/en/css/opac.css b/koha-tmpl/opac-tmpl/prog/en/css/opac.css
index ea538aa..0bf2421 100644
--- a/koha-tmpl/opac-tmpl/prog/en/css/opac.css
+++ b/koha-tmpl/opac-tmpl/prog/en/css/opac.css
@@ -1169,6 +1169,50 @@ a.cancel {
margin : 0 0 0 0;
}
+.searchresults .controls {
+ background-color : #EEE;
+ border : 1px solid #E8E8E8;
+ vertical-align : middle;
+ padding : 3px 3px 5px 5px;
+}
+
+.searchresults .controls {
+ font-size: 90%;
+}
+
+.searchresults .controls img {
+ vertical-align: middle;
+}
+
+.searchresults .controls select {
+ font-size: 90%;
+}
+
+.searchresults .controls label {
+ font-weight : bold;
+ margin-left : .5em;
+}
+
+.result {
+ overflow: hidden;
+ border-bottom: 1px solid #DDDDDD;
+ padding: 5px 10px 0;
+}
+.all_results>div.odd {
+ background-color: #F3F3F3;
+}
+
+.result > input{
+ float: left;
+}
+.result > span {
+ float: left;
+ margin-left: 5px;
+}
+.result > span.image {
+ float: right;
+}
+
#CheckAll, #CheckNone {
font-weight : normal;
margin : 0 .5em;
diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt
index 67b1686..cd1b873 100644
--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt
+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt
@@ -285,7 +285,6 @@ $(document).ready(function(){
[% END %]
-
[% IF ( total ) %]
[% IF ( scan ) %]
Scan index:
@@ -345,7 +344,7 @@ $(document).ready(function(){
[% ELSE %]
+ [% END %]
+
+
+
-
+
+
[% END %]
[% INCLUDE 'page-numbers.inc' %]
--
1.7.7.3
From dpavlin at rot13.org Wed Jun 6 17:40:21 2012
From: dpavlin at rot13.org (Dobrica Pavlinusic)
Date: Wed, 6 Jun 2012 17:40:21 +0200
Subject: [Koha-patches] [PATCH] Bug 7961 - Local cover images should support
CSV link files
Message-ID: <1338997221-25147-1-git-send-email-dpavlin@rot13.org>
Corrent code doesn't have support for filenames which contain spaces
or commans which breaks CSV files saved from spreadsheet similar to:
12345, "conver image, with spaces.jpg"
This patch tweaks file parsing a bit. We are always splitting line to
only two values (to support commas as part of filename) and removing
spaces only on beginning and end of filename (to cover space after
comma in CSV example above while preserving spaces in filename).
With this change only invalid character in picture filename left
are quotes (") which are commonly used to quote strings with spaces.
Covers added will be logged in action_log, using CATALOGUING / MODIFY
action (which is shown as "Catalog" in tools > Log viewer)
Test scenario:
1. collect pictures with spaces and commas in name
2. dump file list into CSV file and add biblio number as first column
(name of file is idlink.txt or datalink.txt)
3. create zip with CSV file and pictures
4. verify that all pictures got uploaded and linked to biblio records
5. verify that modification log includes cover image name
---
tools/upload-cover-image.pl | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/tools/upload-cover-image.pl b/tools/upload-cover-image.pl
index 7552e28..f73e7cd 100755
--- a/tools/upload-cover-image.pl
+++ b/tools/upload-cover-image.pl
@@ -48,6 +48,7 @@ use C4::Auth;
use C4::Output;
use C4::Images;
use C4::UploadedFile;
+use C4::Log;
my $debug = 1;
@@ -143,10 +144,13 @@ if ($fileID) {
$error = 'DELERR';
}
else {
- ( $biblionumber, $filename ) = split $delim, $line;
+ ( $biblionumber, $filename ) = split $delim, $line, 2;
$biblionumber =~
s/[\"\r\n]//g; # remove offensive characters
- $filename =~ s/[\"\r\n\s]//g;
+ $filename =~ s/[\"\r\n]//g;
+ $filename =~ s/^\s+//;
+ $filename =~ s/\s+$//;
+ logaction('CATALOGUING', 'MODIFY', $biblionumber, "cover image: $filename");
my $srcimage = GD::Image->new("$dir/$filename");
if ( defined $srcimage ) {
$total++;
--
1.7.2.5
From amit.gupta at osslabs.biz Fri Jun 8 13:21:18 2012
From: amit.gupta at osslabs.biz (Amit Gupta)
Date: Fri, 8 Jun 2012 16:51:18 +0530
Subject: [Koha-patches] [PATCH 3/3] Bug 6813: Acquistions duplicate search
across orders, suggestions and catalog
Message-ID: <1339154478-6788-1-git-send-email-amit.gupta@osslabs.biz>
To Test:
Create a an suggestion, order and catalog record for a certain title. Use the duplicate search tool available in the acquisitions menu (left navigation bar) to search and find the suggestion, order and catalog record matching the search term.
Enter one or more of title, author and ISBN in the search criteria.
---
C4/Biblio.pm | 55 ++++++++
C4/Suggestions.pm | 54 +++++++
acqui/duplicatesearch.pl | 105 ++++++++++++++
.../prog/en/includes/acquisitions-menu.inc | 1 +
.../prog/en/modules/acqui/duplicatesearch.tt | 145 ++++++++++++++++++++
5 files changed, 360 insertions(+), 0 deletions(-)
create mode 100755 acqui/duplicatesearch.pl
create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/acqui/duplicatesearch.tt
diff --git a/C4/Biblio.pm b/C4/Biblio.pm
index 2aa17d5..637c1a3 100644
--- a/C4/Biblio.pm
+++ b/C4/Biblio.pm
@@ -97,6 +97,7 @@ BEGIN {
&CountBiblioInOrders
&GetSubscriptionsId
&GetHolds
+ &FindBiblios
);
# To modify something
@@ -3700,6 +3701,60 @@ sub GetHolds {
return ($holds);
}
+=head2 FindBiblios
+
+Find biblios matching title, author, isbn and return a array containing details of matching biblios.
+
+=cut
+
+sub FindBiblios {
+ my $dbh = C4::Context->dbh;
+ my %params = @_;
+ my $title = $params{title};
+ my $author = $params{author};
+ my $isbn = $params{isbn};
+ my $query = "SELECT title, author, isbn, biblio.biblionumber FROM biblio LEFT JOIN biblioitems ON biblio.biblionumber = biblioitems.biblionumber";
+ $query .= " WHERE 1 ";
+ my @query_params = ();
+
+ if ( defined $title ) {
+ if ( $title eq ""){
+
+ } else {
+ $query .= " AND biblio.title LIKE ? ";
+ $title =~ s/\s+/%/g;
+ push @query_params, "%$title%";
+ }
+ }
+
+ if ( defined $author ) {
+ if( $author eq ""){
+
+ } else {
+ $query .= " AND biblio.author LIKE ? ";
+ push @query_params, "%$author%";
+ }
+ }
+
+ if ( defined $isbn) {
+ if ( $isbn eq ""){
+
+ } else {
+ $query .= " AND biblioitems.isbn LIKE ? ";
+ push @query_params, "%$isbn%";
+ }
+ }
+
+ my $sth = $dbh->prepare($query);
+ $sth->execute( @query_params );
+ my @bib_loop;
+ while (my $data=$sth->fetchrow_hashref){
+ push @bib_loop,$data;
+ }
+
+ return \@bib_loop;
+}
+
=head2 prepare_host_field
$marcfield = prepare_host_field( $hostbiblioitem, $marcflavour );
diff --git a/C4/Suggestions.pm b/C4/Suggestions.pm
index 60d0e99..635b338 100644
--- a/C4/Suggestions.pm
+++ b/C4/Suggestions.pm
@@ -47,6 +47,7 @@ our @EXPORT = qw<
NewSuggestion
SearchSuggestion
DelSuggestionsOlderThan
+ FindSuggestions
>;
=head1 NAME
@@ -448,6 +449,59 @@ sub ModSuggestion {
return $status_update_table;
}
+=head2 FindSuggestions
+
+Find Suggestions matching title, author, isbn and return a array containing details of matching Suggestions.
+
+=cut
+
+sub FindSuggestions {
+ my $dbh = C4::Context->dbh;
+ my %params = @_;
+ my $title = $params{title};
+ my $author = $params{author};
+ my $isbn = $params{isbn};
+ my $querysug="SELECT title, author, isbn, STATUS, suggestionid FROM suggestions";
+ $querysug .=" WHERE 1";
+ my @query_sug = ();
+
+ if ( defined $title ) {
+ if ( $title eq ""){
+
+ } else {
+ $querysug .= " AND suggestions.title LIKE ? ";
+ $title =~ s/\s+/%/g;
+ push @query_sug, "%$title%";
+ }
+ }
+
+ if ( defined $author ) {
+ if( $author eq ""){
+
+ } else {
+ $querysug .= " AND suggestions.author LIKE ? ";
+ push @query_sug, "%$author%";
+ }
+ }
+
+ if ( defined $isbn) {
+ if ( $isbn eq ""){
+
+ } else {
+ $querysug .= " AND suggestions.isbn LIKE ? ";
+ push @query_sug, "%$isbn%";
+ }
+ }
+ my $sth = $dbh->prepare($querysug);
+ $sth->execute( @query_sug );
+ my @sugg_loop;
+ while (my $data=$sth->fetchrow_hashref){
+ push (@sugg_loop,$data);
+ }
+
+ return \@sugg_loop;
+}
+
=head2 ConnectSuggestionAndBiblio
&ConnectSuggestionAndBiblio($ordernumber,$biblionumber)
diff --git a/acqui/duplicatesearch.pl b/acqui/duplicatesearch.pl
new file mode 100755
index 0000000..532bd91
--- /dev/null
+++ b/acqui/duplicatesearch.pl
@@ -0,0 +1,105 @@
+#!/usr/bin/perl
+
+#script to duplicate search (Orders, suggestions, bibliographic records)
+#written by amit.gupta at osslabs.biz 08/06/2012
+
+# Copyright 2012 Nucsoft Osslabs
+#
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with Koha; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+=head1 NAME
+
+duplicatesearch.pl
+
+=head1 DESCRIPTION
+
+This script is used to search duplicate orders, suggestions and catalog records
+
+=cut
+
+use strict;
+use warnings;
+use CGI;
+use C4::Auth; # get_template_and_user
+use C4::Output;
+use C4::Acquisition;
+use C4::Suggestions;
+use C4::Biblio;
+use C4::Debug;
+use C4::Search;
+
+my $input = new CGI;
+my $title = $input->param( 'title');
+my $author = $input->param('author');
+my $isbn = $input->param('isbn');
+my $op = $input->param('op');
+
+# getting the template
+my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
+ {
+ template_name => "acqui/duplicatesearch.tmpl",
+ query => $input,
+ type => "intranet",
+ authnotrequired => 0,
+ flagsrequired => { acquisition => 'group_manage', acquisition => 'order_manage', acquisition => 'order_receive' },
+ debug => 1,
+ }
+);
+
+
+if ($op eq "result"){
+ my ( $order_loop, $total_qty, $total_price, $total_qtyreceived ) = GetHistory(
+ title => $title,
+ author => $author,
+ isbn => $isbn,
+ name => undef,
+ from_placed_on => undef,
+ to_placed_on => undef,
+ basket => undef,
+ booksellerinvoicenumber => undef,
+ );
+
+ my $sugg_loop = FindSuggestions(
+ title => $title,
+ author => $author,
+ isbn => $isbn,
+ );
+
+ my $bib_loop = FindBiblios(
+ title => $title,
+ author => $author,
+ isbn => $isbn
+ );
+
+
+ $template->param(
+ result => 1,
+ orders_loop => $order_loop,
+ sugg_loop => $sugg_loop,
+ bib_loop => $bib_loop,
+ numresults_order => scalar(@$order_loop),
+ numresults_sugg => scalar(@$sugg_loop),
+ numresults_bib => scalar(@$bib_loop),
+ );
+}
+
+$template->param(
+ title => $title,
+ author => $author,
+ isbn => $isbn,
+);
+
+output_html_with_http_headers $input, $cookie, $template->output;
diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-menu.inc
index ac1a7a4..38cdf44 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-menu.inc
+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-menu.inc
@@ -4,6 +4,7 @@
[% IF ( CAN_user_acquisition_budget_manage ) %]
Budgets
Funds
+ Duplicate Search
[% END %]
[% IF ( CAN_user_parameters ) %]
Currencies
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/duplicatesearch.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/duplicatesearch.tt
new file mode 100644
index 0000000..711d780
--- /dev/null
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/duplicatesearch.tt
@@ -0,0 +1,145 @@
+[% USE KohaDates %]
+[% INCLUDE 'doc-head-open.inc' %]
+Koha › Acquisitions › Duplicate Search
+[% INCLUDE 'doc-head-close.inc' %]
+
+
+
+
+
+
+[% INCLUDE 'header.inc' %]
+[% INCLUDE 'acquisitions-search.inc' %]
+
+
+