[otrs-cvs] ITSMService/Kernel/System SLA.pm,1.9,1.10
cvs-log at otrs.org
cvs-log at otrs.org
Mon Jul 2 14:04:58 GMT 2007
Comments:
Update of /home/cvs/ITSMService/Kernel/System
In directory lancelot:/tmp/cvs-serv4952/Kernel/System
Modified Files:
SLA.pm
Log Message:
Update file to framework version 1.14.
Author: mh
Index: SLA.pm
===================================================================
RCS file: /home/cvs/ITSMService/Kernel/System/SLA.pm,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** SLA.pm 26 May 2007 18:42:32 -0000 1.9
--- SLA.pm 2 Jul 2007 14:04:53 -0000 1.10
***************
*** 4,8 ****
# --
# $Id$
! # $OldId: SLA.pm,v 1.11 2007/05/26 18:10:16 mh Exp $
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
--- 4,8 ----
# --
# $Id$
! # $OldId: SLA.pm,v 1.14 2007/06/29 01:00:39 martin Exp $
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
***************
*** 161,164 ****
--- 161,165 ----
SLAID => 123,
UserID => 1,
+ Cache => 1, # optional
);
***************
*** 175,178 ****
--- 176,182 ----
}
}
+ if ($Param{Cache} && $Self->{"Cache::SLAGet::$Param{SLAID}"}) {
+ return %{$Self->{"Cache::SLAGet::$Param{SLAID}"}};
+ }
# quote
foreach (qw(SLAID UserID)) {
***************
*** 213,216 ****
--- 217,221 ----
# ---
}
+ $Self->{"Cache::SLAGet::$Param{SLAID}"} = \%SLAData;
return %SLAData;
}
***************
*** 241,244 ****
--- 246,253 ----
}
if ($Param{SLAID}) {
+ # check cache
+ if ($Self->{"Cache::SLALookup::ID::$Param{SLAID}"}) {
+ return $Self->{"Cache::SLALookup::ID::$Param{SLAID}"};
+ }
my $Name;
# quote
***************
*** 252,258 ****
--- 261,273 ----
$Name = $Row[0];
}
+ # cache
+ $Self->{"Cache::SLALookup::ID::$Param{SLAID}"} = $Name;
return $Name;
}
else {
+ # check cache
+ if ($Self->{"Cache::SLALookup::Name::$Param{Name}"}) {
+ return $Self->{"Cache::SLALookup::Name::$Param{Name}"};
+ }
my $ID;
# quote
***************
*** 266,269 ****
--- 281,286 ----
$ID = $Row[0];
}
+ # cache
+ $Self->{"Cache::SLALookup::Name::$Param{Name}"} = $ID;
return $ID;
}
***************
*** 405,408 ****
--- 422,429 ----
}
}
+ # reset cache
+ $Self->{"Cache::SLALookup::Name::$Param{Name}"} = 0;
+ $Self->{"Cache::SLALookup::ID::$Param{SLAID}"} = 0;
+ # set default values
foreach (qw(Calendar Comment)) {
$Param{$_} = $Param{$_} || '';
***************
*** 465,467 ****
$Revision$ $Date$
! =cut
--- 486,488 ----
$Revision$ $Date$
! =cut
\ No newline at end of file
More information about the cvs-log
mailing list