[Koha-cvs] koha/C4 Koha.pm [rel_3_0]

Antoine Farnault antoine at koha-fr.org
Mon Oct 9 18:24:26 CEST 2006


CVSROOT:	/sources/koha
Module name:	koha
Branch:		rel_3_0
Changes by:	Antoine Farnault <toins>	06/10/09 16:24:26

Modified files:
	C4             : Koha.pm 

Log message:
	Sync with dev_week.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Koha.pm?cvsroot=koha&only_with_tag=rel_3_0&r1=1.40.2.8&r2=1.40.2.9

Patches:
Index: Koha.pm
===================================================================
RCS file: /sources/koha/koha/C4/Koha.pm,v
retrieving revision 1.40.2.8
retrieving revision 1.40.2.9
diff -u -b -r1.40.2.8 -r1.40.2.9
--- Koha.pm	3 Oct 2006 12:34:16 -0000	1.40.2.8
+++ Koha.pm	9 Oct 2006 16:24:26 -0000	1.40.2.9
@@ -17,7 +17,7 @@
 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
 # Suite 330, Boston, MA  02111-1307 USA
 
-# $Id: Koha.pm,v 1.40.2.8 2006/10/03 12:34:16 toins Exp $
+# $Id: Koha.pm,v 1.40.2.9 2006/10/09 16:24:26 toins Exp $
 
 use strict;
 require Exporter;
@@ -25,7 +25,7 @@
 use C4::Output;
 use vars qw($VERSION @ISA @EXPORT);
 
-$VERSION = do { my @v = '$Revision: 1.40.2.8 $' =~ /\d+/g; shift(@v) . "." . join("_", map {sprintf "%03d", $_ } @v); };
+$VERSION = do { my @v = '$Revision: 1.40.2.9 $' =~ /\d+/g; shift(@v) . "." . join("_", map {sprintf "%03d", $_ } @v); };
 
 =head1 NAME
 
@@ -56,7 +56,10 @@
             &getprinters &getprinter
             &GetItemTypes &getitemtypeinfo
 	        &GetCcodes
+			&GetAuthItemlost
+			&GetAuthItembinding
                         get_itemtypeinfos_of
+
             &getframeworks &getframeworkinfo
             &getauthtypes &getauthtype
 	    &getallthemes &GetLanguages
@@ -405,8 +408,35 @@
     my $sth=$dbh->prepare("SELECT * FROM authorised_values ORDER BY authorised_value");
     $sth->execute;
     while (my $data=$sth->fetchrow_hashref) {
-		if ($data->{category} =/CCODE/) {
+		if ($data->{category} eq "CCODE") {
+			$count++;
+			$results[$count] = $data;
+			#warn "data: $data";
+		}
+    }
+	$sth->finish;
+    return ($count, at results);
+}
+
+=head2
+
+grab itemlost authorized values
+
+=cut
+
+sub GetAuthItemlost {
+	my $itemlost = shift;
+    my $count = 0;
+    my @results;
+    my $dbh = C4::Context->dbh;
+    my $sth=$dbh->prepare("SELECT * FROM authorised_values ORDER BY authorised_value");
+    $sth->execute;
+    while (my $data=$sth->fetchrow_hashref) {
+        if ($data->{category} eq "ITEMLOST") {
 			$count++;
+			if ($itemlost eq $data->{'authorised_value'} ){
+				$data->{'selected'} = 1;
+			}
 			$results[$count] = $data;
 			#warn "data: $data";
 		}
@@ -415,6 +445,35 @@
     return ($count, at results);
 }
 
+=head2 GetAuthItembinding
+
+grab itemlost authorized values
+
+=cut 
+
+
+sub GetAuthItembinding {
+    my $itembinding = shift;
+    my $count = 0;
+    my @results;
+    my $dbh = C4::Context->dbh;
+    my $sth=$dbh->prepare("SELECT * FROM authorised_values ORDER BY authorised_value");
+    $sth->execute;
+    while (my $data=$sth->fetchrow_hashref) {
+        if ($data->{category} eq "BINDING") {
+            $count++;
+            if ($itembinding eq $data->{'authorised_value'} ){
+                $data->{'selected'} = 1;
+            }
+            $results[$count] = $data;
+            #warn "data: $data";
+        }
+    }
+    $sth->finish;
+    return ($count, at results);
+}
+
+
 
 =head2 getauthtypes
 
@@ -990,8 +1049,8 @@
     {value =>"1=20 <i", label => "Call Number (Non-fiction 0-9 to Fiction A-Z)"},
     {value =>"1=20 >i", label => "Call Number (Fiction Z-A to Non-fiction 9-0)"},
     {value =>"1=31 >i", label => "Dates"},
-    {value =>"1=31 <i", label => "&nbsp;&nbsp;&nbsp;Publication/Copyright Date: Newest to Oldest"},
-    {value =>"1=31 >i", label => "&nbsp;&nbsp;&nbsp;Publication/Copyright Date: Oldest to Newest"},
+    {value =>"1=31 >i", label => "&nbsp;&nbsp;&nbsp;Publication/Copyright Date: Newest to Oldest"},
+    {value =>"1=31 <i", label => "&nbsp;&nbsp;&nbsp;Publication/Copyright Date: Oldest to Newest"},
     {value =>"1=32 >i", label => "&nbsp;&nbsp;&nbsp;Acquisition Date: Newest to Oldest"},
     {value =>"1=32 <i", label => "&nbsp;&nbsp;&nbsp;Acquisition Date: Oldest to Newest"},
     {value =>"1=36 <i", label => "Title (A-Z)"},





More information about the Koha-cvs mailing list