koha-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Mason James
Subject: [Koha-cvs] koha/C4 Labels.pm [dev_week]
Date: Fri, 06 Jul 2007 14:16:36 +0000

CVSROOT:        /sources/koha
Module name:    koha
Branch:         dev_week
Changes by:     Mason James <sushi>     07/07/06 14:16:36

Modified files:
        C4             : Labels.pm 

Log message:
        adding a dummy batchid = 1, to make things happy.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Labels.pm?cvsroot=koha&only_with_tag=dev_week&r1=1.3.4.14&r2=1.3.4.15

Patches:
Index: Labels.pm
===================================================================
RCS file: /sources/koha/koha/C4/Labels.pm,v
retrieving revision 1.3.4.14
retrieving revision 1.3.4.15
diff -u -b -r1.3.4.14 -r1.3.4.15
--- Labels.pm   6 Jul 2007 04:08:18 -0000       1.3.4.14
+++ Labels.pm   6 Jul 2007 14:16:36 -0000       1.3.4.15
@@ -105,7 +105,7 @@
     my $new_batch;
     my $dbh = C4::Context->dbh;
     my $q =
-      "select distinct batch_id from labels order by batch_id asc limit 1";
+      "select distinct batch_id from labels order by batch_id desc limit 1";
     my $sth = $dbh->prepare($q);
     $sth->execute();
     my $data = $sth->fetchrow_hashref;
@@ -130,6 +130,11 @@
         push( @resultsloop, $data );
     }
     $sth->finish;
+
+# adding a dummy batch=1 value , if none exists in the db
+    if (!scalar(@resultsloop) ) {
+        push (@resultsloop ,  { batch_id => '1'});
+    }
     return @resultsloop;
 }
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]