[Koha-patches] [PATCH] bug: add items to label batch - need userenv loaded before call to SimpleSearch
Michael Hafen
mdhafen at tech.washk12.org
Wed Mar 11 20:25:40 CET 2009
Since I added more IndependantBranches code to my git repo I need
userenv loaded before SimpleSearch() is called. I think
get_template_and_user() should be called as soon as possible. In this
case it could mean two calls, but it has to be so.
---
labels/label-item-search.pl | 24 ++++++++++++------------
1 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/labels/label-item-search.pl b/labels/label-item-search.pl
index 140f5d7..a04a9dc 100755
--- a/labels/label-item-search.pl
+++ b/labels/label-item-search.pl
@@ -82,6 +82,18 @@ if ( $op eq "do_search" ) {
$datefrom = $query->param('datefrom');
$dateto = $query->param('dateto');
+ ( $template, $loggedinuser, $cookie ) = get_template_and_user(
+ {
+ template_name => "labels/result.tmpl",
+ query => $query,
+ type => "intranet",
+ authnotrequired => 0,
+ flagsrequired => { borrowers => 1 },
+ flagsrequired => { catalogue => 1 },
+ debug => 1,
+ }
+ );
+
if ($datefrom) {
$datefrom = C4::Dates->new($datefrom);
$ccl_query .= ' and ' if $ccl_textbox;
@@ -177,18 +189,6 @@ if ($show_results) {
$debug and warn "**********\@results**********\n";
$debug and warn Dumper(@results);
- ( $template, $loggedinuser, $cookie ) = get_template_and_user(
- {
- template_name => "labels/result.tmpl",
- query => $query,
- type => "intranet",
- authnotrequired => 0,
- flagsrequired => { borrowers => 1 },
- flagsrequired => { catalogue => 1 },
- debug => 1,
- }
- );
-
# build page nav stuff.
my ( @field_data, @numbers );
$total = $total_hits;
--
1.5.6.3
More information about the Koha-patches
mailing list