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

Joshua Ferraro jmf at kados.org
Sun Oct 8 20:09:02 CEST 2006


CVSROOT:	/sources/koha
Module name:	koha
Branch:		dev_week
Changes by:	Joshua Ferraro <kados>	06/10/08 18:09:02

Modified files:
	C4             : Koha.pm 

Log message:
	updating the sort-by options

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Koha.pm?cvsroot=koha&only_with_tag=dev_week&r1=1.22.2.4.2.6&r2=1.22.2.4.2.7

Patches:
Index: Koha.pm
===================================================================
RCS file: /sources/koha/koha/C4/Koha.pm,v
retrieving revision 1.22.2.4.2.6
retrieving revision 1.22.2.4.2.7
diff -u -b -r1.22.2.4.2.6 -r1.22.2.4.2.7
--- Koha.pm	5 Oct 2006 16:02:08 -0000	1.22.2.4.2.6
+++ Koha.pm	8 Oct 2006 18:09:02 -0000	1.22.2.4.2.7
@@ -61,6 +61,8 @@
 
 			&GetItemtypes
 			&GetCcodes
+			&GetAuthItemlost
+			&GetAuthItembinding
 
 			&getitemtypeinfo
 			&getframeworks &getframeworkinfo
@@ -375,7 +377,7 @@
     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";
@@ -385,6 +387,52 @@
     return ($count, at results);
 }
 
+# grab itemlost authorized values
+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";
+        }
+    }
+    $sth->finish;
+    return ($count, at results);
+}
+
+# grab itemlost authorized values
+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
 
   $authtypes = &getauthtypes();
@@ -752,8 +800,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