koha-cvs
[Top][All Lists]
Advanced

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

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


From: Henri-Damien LAURENT
Subject: [Koha-cvs] koha/C4 Serials.pm [rel_3_0]
Date: Mon, 29 Jan 2007 10:29:54 +0000

CVSROOT:        /cvsroot/koha
Module name:    koha
Branch:         rel_3_0
Changes by:     Henri-Damien LAURENT <hdl>      07/01/29 10:29:54

Modified files:
        C4             : Serials.pm 

Log message:
        Adding seasonal management for GetSeq

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Serials.pm?cvsroot=koha&only_with_tag=rel_3_0&r1=1.5.2.29&r2=1.5.2.30

Patches:
Index: Serials.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Serials.pm,v
retrieving revision 1.5.2.29
retrieving revision 1.5.2.30
diff -u -b -r1.5.2.29 -r1.5.2.30
--- Serials.pm  26 Jan 2007 20:48:36 -0000      1.5.2.29
+++ Serials.pm  29 Jan 2007 10:29:54 -0000      1.5.2.30
@@ -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: Serials.pm,v 1.5.2.29 2007/01/26 20:48:36 hdl Exp $
+# $Id: Serials.pm,v 1.5.2.30 2007/01/29 10:29:54 hdl Exp $
 
 use strict;
 use C4::Date;
@@ -35,7 +35,7 @@
 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
 
 # set the version for version checking
-$VERSION = do { my @v = '$Revision: 1.5.2.29 $' =~ /\d+/g;
+$VERSION = do { my @v = '$Revision: 1.5.2.30 $' =~ /\d+/g;
     shift(@v) . "." . join( "_", map { sprintf "%03d", $_ } @v );
 };
 
@@ -1007,11 +1007,26 @@
 
 sub GetSeq {
     my ($val)      = @_;
+    my $pattern = $val->{numberpattern};
+    my @seasons = ( 'nothing', 'Winter', 'Spring', 'Summer', 'Autumn' );
+    my @southern_seasons = ( '', 'Summer', 'Autumn', 'Winter', 'Spring' );
     my $calculated = $val->{numberingmethod};
     my $x          = $val->{'lastvalue1'};
     $calculated =~ s/\{X\}/$x/g;
-    my $y = $val->{'lastvalue2'};
-    $calculated =~ s/\{Y\}/$y/g;
+    my $newlastvalue2 = $val->{'lastvalue2'};
+    if ( $pattern == 6 ) {
+        if ( $val->{hemisphere} == 2 ) {
+            my $newlastvalue2seq = $southern_seasons[$newlastvalue2];
+            $calculated =~ s/\{Y\}/$newlastvalue2seq/g;
+        }
+        else {
+            my $newlastvalue2seq = $seasons[$newlastvalue2];
+            $calculated =~ s/\{Y\}/$newlastvalue2seq/g;
+        }
+    }
+    else {
+        $calculated =~ s/\{Y\}/$newlastvalue2/g;
+    }
     my $z = $val->{'lastvalue3'};
     $calculated =~ s/\{Z\}/$z/g;
     return $calculated;




reply via email to

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