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-mandatoryontransition
Commits
0463bab1
Commit
0463bab1
authored
Nov 05, 2012
by
Jim Brandt
Browse files
Add exception for TimeTaken on create
TimeTaken is only relevant on update, so skip if validating on create.
parent
04f33e13
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
4 deletions
+13
-4
lib/RT/Extension/MandatoryOnTransition.pm
lib/RT/Extension/MandatoryOnTransition.pm
+11
-2
lib/RT/Extension/MandatoryOnTransition/Test.pm.in
lib/RT/Extension/MandatoryOnTransition/Test.pm.in
+2
-2
No files found.
lib/RT/Extension/MandatoryOnTransition.pm
View file @
0463bab1
...
...
@@ -312,11 +312,20 @@ sub CheckMandatoryFields {
# Check core fields, after canonicalization for update
for
my
$field
(
@$core
)
{
# Will we have a value on update?
# If we have a Ticket, it's an update, so use the CORE_FOR_UPDATE values
# otherwise it's a create so use raw field value with no UPDATE prefix
my
$arg
=
$args
{'
Ticket
'}
?
$CORE_FOR_UPDATE
{
$field
}
||
$field
:
$field
;
my
$arg
;
if
(
$args
{'
Ticket
'}
){
$arg
=
$CORE_FOR_UPDATE
{
$field
}
||
$field
;
}
else
{
# It's create. No TimeTaken on create form.
next
if
$field
eq
'
TimeTaken
';
$arg
=
$field
;
}
next
if
defined
$ARGSRef
->
{
$arg
}
and
length
$ARGSRef
->
{
$arg
};
# Do we have a value currently?
...
...
lib/RT/Extension/MandatoryOnTransition/Test.pm.in
View file @
0463bab1
...
...
@@ -33,10 +33,10 @@ sub import {
$
args
{
'config'
}
=<<
CONFIG
;
Set
(
%
MandatoryOnTransition
,
'*'
=>
{
'open -> resolved'
=>
[
qw
(
TimeWorked
)]
'open -> resolved'
=>
[
qw
(
TimeWorked
TimeTaken
)]
},
'General'
=>
{
'* -> resolved'
=>
[
'TimeWorked'
,
'CF.Test Field'
]
'* -> resolved'
=>
[
'TimeWorked'
,
'TimeTaken'
,
'CF.Test Field'
]
},
);
CONFIG
...
...
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