[Koha-patches] [PATCH] fix calls to get_template_and_user in label-item-search.pl

Michael Hafen mdhafen at tech.washk12.org
Thu Oct 16 21:59:44 CEST 2008


remove extra flagsrequired line.
move call in first branch to the top.
  This will be important is IndepenantBranches code is later added to,
for example, C4::Items::get_itemnumbers_of()
---
 labels/label-item-search.pl |   23 +++++++++++------------
 1 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/labels/label-item-search.pl b/labels/label-item-search.pl
index 6871616..9f97dfb 100755
--- a/labels/label-item-search.pl
+++ b/labels/label-item-search.pl
@@ -86,6 +86,17 @@ if ( $op eq "do_search" ) {
 }
 
 if ( $show_results ) {
+  ( $template, $loggedinuser, $cookie ) = get_template_and_user(
+        {
+            template_name   => "labels/result.tmpl",
+            query           => $query,
+            type            => "intranet",
+            authnotrequired => 0,
+            flagsrequired   => { catalogue => 1 },
+            debug           => 1,
+        }
+    );
+
 	my $hits = $show_results;
         my (@results, @items);
         # This code needs to be refactored using these subs...
@@ -126,18 +137,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,
-        }
-    );
-
     my @field_data = ();
 
 	# FIXME: this relies on symmetric order of CGI params that IS NOT GUARANTEED by spec.
-- 
1.5.4.3




More information about the Koha-patches mailing list