[Koha-cvs] koha/C4 Search.pm [rel_2_2]

Joshua Ferraro jmf at kados.org
Fri Jul 7 22:37:28 CEST 2006


CVSROOT:	/sources/koha
Module name:	koha
Branch:		rel_2_2
Changes by:	Joshua Ferraro <kados>	06/07/07 20:37:28

Modified files:
	C4             : Search.pm 

Log message:
	fix to itemissues sub to show item statuses

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Search.pm?cvsroot=koha&only_with_tag=rel_2_2&r1=1.99.2.11&r2=1.99.2.12

Patches:
Index: Search.pm
===================================================================
RCS file: /sources/koha/koha/C4/Search.pm,v
retrieving revision 1.99.2.11
retrieving revision 1.99.2.12
diff -u -b -r1.99.2.11 -r1.99.2.12
--- Search.pm	14 Dec 2005 15:58:42 -0000	1.99.2.11
+++ Search.pm	7 Jul 2006 20:37:28 -0000	1.99.2.12
@@ -30,7 +30,7 @@
 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
 
 # set the version for version checking
-$VERSION = do { my @v = '$Revision: 1.99.2.11 $' =~ /\d+/g;
+$VERSION = do { my @v = '$Revision: 1.99.2.12 $' =~ /\d+/g;
           shift(@v) . "." . join("_", map {sprintf "%03d", $_ } @v); };
 
 =head1 NAME
@@ -1704,7 +1704,7 @@
     # gotten, the user might get a blank page. It would be much better
     # to at least print an error message. The easiest way to do this
     # is to set $SIG{__DIE__}.
-    my $sth   = $dbh->prepare("Select * from items where
+    my $sth   = $dbh->prepare("Select *,items.notforloan as itemnotforloan from items where
 items.biblioitemnumber = ?")
       || die $dbh->errstr;
     my $i     = 0;
@@ -1721,7 +1721,7 @@
         # fetchrow_hashref() can fail for any number of reasons (e.g.,
         # database server crash), not just because no items match the
         # search criteria.
-        my $sth2   = $dbh->prepare("select * from issues,borrowers
+        my $sth2   = $dbh->prepare("select *, items.notforloan as itemnotforloan from items,issues,borrowers
 where itemnumber = ?
 and returndate is NULL
 and issues.borrowernumber = borrowers.borrowernumber");
@@ -1757,6 +1757,17 @@
         } # for
 
         $sth2->finish;
+	# get notforloan complete status if applicable
+	my $sthnflstatus = $dbh->prepare('select authorised_value from marc_subfield_structure where kohafield="items.notforloan"');
+	$sthnflstatus->execute;
+	my ($authorised_valuecode) = $sthnflstatus->fetchrow;
+	if ($authorised_valuecode) {
+		$sthnflstatus = $dbh->prepare("select lib from authorised_values where category=? and authorised_value=?");
+		$sthnflstatus->execute($authorised_valuecode,$data->{itemnotforloan});
+		my ($lib) = $sthnflstatus->fetchrow;
+		$data->{notforloantext} = $lib;
+		warn "NOT FOR LOAN".$lib.$data->{itemnotforloan};
+	}
         $results[$i] = $data;
         $i++;
     }





More information about the Koha-cvs mailing list