Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
best-practical
rt-extension-sla
Commits
20f84bdf
Commit
20f84bdf
authored
Apr 19, 2012
by
Ruslan Zakirov
Browse files
return more ->Agreement method and always use it
parent
01c7f3bf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
lib/RT/Extension/SLA.pm
lib/RT/Extension/SLA.pm
+7
-7
No files found.
lib/RT/Extension/SLA.pm
View file @
20f84bdf
...
...
@@ -359,6 +359,8 @@ sub Agreement {
}
}
$res
{'
BusinessHours
'}
=
$meta
->
{'
BusinessHours
'};
return
\
%res
;
}
...
...
@@ -369,11 +371,9 @@ sub Due {
my
$agreement
=
$self
->
Agreement
(
%args
);
return
undef
unless
$agreement
;
my
$meta
=
$
RT::
ServiceAgreements
{'
Levels
'}{
$args
{'
Level
'}
};
my
$res
=
$args
{'
Time
'};
if
(
defined
$agreement
->
{'
BusinessMinutes
'}
)
{
my
$bhours
=
$self
->
BusinessHours
(
$
meta
->
{'
BusinessHours
'}
);
my
$bhours
=
$self
->
BusinessHours
(
$
agreement
->
{'
BusinessHours
'}
);
$res
=
$bhours
->
add_seconds
(
$res
,
60
*
$agreement
->
{'
BusinessMinutes
'}
);
}
$res
+=
60
*
$agreement
->
{'
RealMinutes
'}
...
...
@@ -386,12 +386,12 @@ sub Starts {
my
$self
=
shift
;
my
%args
=
(
Level
=>
undef
,
Time
=>
undef
,
@
_
);
my
$
meta
=
$
RT::
ServiceAgreements
{'
Levels
'}{
$args
{'
Level
'}
}
;
return
undef
unless
$
meta
;
my
$
agreement
=
$self
->
Agreement
(
%args
)
;
return
undef
unless
$
agreement
;
return
$args
{'
Time
'}
if
$
meta
->
{'
StartImmediately
'};
return
$args
{'
Time
'}
if
$
agreement
->
{'
StartImmediately
'};
my
$bhours
=
$self
->
BusinessHours
(
$
meta
->
{'
BusinessHours
'}
);
my
$bhours
=
$self
->
BusinessHours
(
$
agreement
->
{'
BusinessHours
'}
);
return
$bhours
->
first_after
(
$args
{'
Time
'}
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment