[Rt-commit] r20051 - rtir/2.5/trunk/html/RTIR/Elements
sunnavy at bestpractical.com
sunnavy at bestpractical.com
Thu Jun 25 04:33:52 EDT 2009
Author: sunnavy
Date: Thu Jun 25 04:33:51 2009
New Revision: 20051
Modified:
rtir/2.5/trunk/html/RTIR/Elements/EditCustomFields
Log:
find cf ip defaults
Modified: rtir/2.5/trunk/html/RTIR/Elements/EditCustomFields
==============================================================================
--- rtir/2.5/trunk/html/RTIR/Elements/EditCustomFields (original)
+++ rtir/2.5/trunk/html/RTIR/Elements/EditCustomFields Thu Jun 25 04:33:51 2009
@@ -38,6 +38,26 @@
if ( $CustomField->Name eq 'SLA' ) {
$ARGS{"CustomField-".$CustomField->Id} = RT::IR::DefaultSLA();
}
+ elsif ( $CustomField->Name eq 'IP' ) {
+ if ( $ARGS{"IP-Value"} ) {
+ $ARGS{"CustomField-".$CustomField->Id} = $ARGS{"IP-Value"};
+ }
+ elsif ( $ChildObj || $IncidentObj ) {
+ my $Obj = $ChildObj || $IncidentObj;
+ $ARGS{"CustomField-".$CustomField->Id} = join "\n",
+ grep $_, map $_->Content,
+ @{ $Obj->CustomFieldValues( 'IP' )->ItemsArrayRef };
+ }
+ elsif ( $Defaults{IP} ) {
+ if ( ref $Defaults{IP} eq 'ARRAY' ) {
+ $ARGS{"CustomField-".$CustomField->Id} =
+ join "\n", @{$Defaults{IP}};
+ }
+ else {
+ $ARGS{"CustomField-".$CustomField->Id} = $Defaults{IP};
+ }
+ }
+ }
else {
my $Name = $CustomField->Name;
if ( $ARGS{"$Name-Value"} ) {
@@ -46,9 +66,7 @@
elsif ( $Defaults{$Name} && !ref $Defaults{$Name} ) {
# if $Defaults{$Name} is ref, it should be treated carefully, like the 'SLA'
# above
-
$ARGS{"CustomField-".$CustomField->Id} = $Defaults{$Name};
-#TODO special treatment of CF IP
}
}
}
@@ -58,4 +76,6 @@
<%ARGS>
$TicketObj => undef
$QueueObj => undef
+$ChildObj => undef
+$IncidentObj => undef
</%ARGS>
More information about the Rt-commit
mailing list