[interchange-cvs] interchange - heins modified dist/lib/UI/Primitive.pm

interchange-core@interchange.redhat.com interchange-core@interchange.redhat.com
Fri Sep 7 11:04:00 2001


User:      heins
Date:      2001-09-07 15:03:04 GMT
Modified:  dist/lib/UI Primitive.pm
Log:
	* Add ability to set beginning/ending years in date widget.

Revision  Changes    Path
2.4       +12 -0     interchange/dist/lib/UI/Primitive.pm


rev 2.4, prev_rev 2.3
Index: Primitive.pm
===================================================================
RCS file: /anon_cvs/repository/interchange/dist/lib/UI/Primitive.pm,v
retrieving revision 2.3
retrieving revision 2.4
diff -u -r2.3 -r2.4
--- Primitive.pm	2001/09/04 22:20:15	2.3
+++ Primitive.pm	2001/09/07 15:03:04	2.4
@@ -1,6 +1,6 @@
 # UI::Primitive - Interchange configuration manager primitives
 
-# $Id: Primitive.pm,v 2.3 2001/09/04 22:20:15 mheins Exp $
+# $Id: Primitive.pm,v 2.4 2001/09/07 15:03:04 mheins Exp $
 
 # Copyright (C) 1998-2001 Red Hat, Inc. <interchange@redhat.com>
 
@@ -25,7 +25,7 @@
 
 package UI::Primitive;
 
-$VERSION = substr(q$Revision: 2.3 $, 10);
+$VERSION = substr(q$Revision: 2.4 $, 10);
 $DEBUG = 0;
 
 use vars qw!
@@ -664,6 +664,18 @@
 	$out .= qq{</SELECT>};
 	$out .= qq{<INPUT TYPE=hidden NAME="$name" VALUE="/">};
 	$out .= qq{<SELECT NAME="$name">};
+	if($::Variable->{UI_DATE_BEGIN}) {
+		my $cy = $t[5] + 1900;
+		my $by = $::Variable->{UI_DATE_BEGIN};
+		my $ey = $::Variable->{UI_DATE_END} || ($cy + 10);
+		if($by < 100) {
+			$by = $cy - abs($by);
+		}
+		if($ey < 100) {
+			$ey += $cy;
+		}
+		@years = ($by .. $ey);
+	}
 	for(@years) {
 		$o = qq{<OPTION>$_};
 		($out .= $o, next) unless ! $sel and $val;