[otrs-cvs] CVS: ITSMCMDB/Kernel/System ITSMCMDB.pm,1.26,1.27
cvs-log at otrs.org
cvs-log at otrs.org
Fri Nov 3 14:33:58 CET 2006
Update of /home/cvs/ITSMCMDB/Kernel/System
In directory lancelot:/tmp/cvs-serv14785/Kernel/System
Modified Files:
ITSMCMDB.pm
Log Message:
fixed bug in count calculation
Index: ITSMCMDB.pm
===================================================================
RCS file: /home/cvs/ITSMCMDB/Kernel/System/ITSMCMDB.pm,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -r1.26 -r1.27
*** ITSMCMDB.pm 2 Nov 2006 14:30:46 -0000 1.26
--- ITSMCMDB.pm 3 Nov 2006 13:33:56 -0000 1.27
***************
*** 979,988 ****
}
my %Count;
$Count{Min} = 1;
$Count{Max} = 1;
!
! if ($Param{Attribute}->{Count} && int($Param{Attribute}->{Count}) >= 0) {
! $Count{Min} = 1;
! $Count{Max} = int($Param{Attribute}->{Count});
}
--- 979,1004 ----
}
my %Count;
+ # calculate minimum
$Count{Min} = 1;
+ if (defined($Param{Attribute}->{CountMin}) && $Param{Attribute}->{CountMin} eq 0) {
+ $Count{Min} = 0;
+ }
+ elsif ($Param{Attribute}->{CountMin} && int($Param{Attribute}->{CountMin}) > 0) {
+ $Count{Min} = int($Param{Attribute}->{CountMin});
+ }
+ if ($Count{Min} > 99) {
+ $Count{Min} = 99;
+ }
+ # calculate maximum
$Count{Max} = 1;
! if ($Param{Attribute}->{CountMax} && int($Param{Attribute}->{CountMax}) > 0) {
! $Count{Max} = int($Param{Attribute}->{CountMax});
! }
! if ($Count{Max} > 99) {
! $Count{Max} = 99;
! }
! # check values
! if ($Count{Min} > $Count{Max}) {
! $Count{Min} = $Count{Max};
}
***************
*** 990,994 ****
$Count{Now} = $Count{Min};
if (defined($Param{Attribute}->{CountDefault}) &&
! int($Param{Attribute}->{CountDefault}) >= 0 &&
int($Param{Attribute}->{CountDefault}) <= $Count{Max}
) {
--- 1006,1010 ----
$Count{Now} = $Count{Min};
if (defined($Param{Attribute}->{CountDefault}) &&
! int($Param{Attribute}->{CountDefault}) >= $Count{Min} &&
int($Param{Attribute}->{CountDefault}) <= $Count{Max}
) {
More information about the cvs-log
mailing list