[otrs-cvs] otrs/Kernel/Modules AgentTicketProcess.pm,1.42,1.43

"CVS commits notifications of OTRS.org" <[email protected]>
Newsgroups gmane.comp.otrs.cvs
Message-ID <[email protected]>
Comments:
Update of /home/cvs/otrs/Kernel/Modules
In directory lancelot:/tmp/cvs-serv11398/Kernel/Modules

Modified Files:
	AgentTicketProcess.pm 
Log Message:
QA follow-up for bug#9159 - ProcessManagement: Date fields are activated by default.

Author: cr

Index: AgentTicketProcess.pm
===================================================================
RCS file: /home/cvs/otrs/Kernel/Modules/AgentTicketProcess.pm,v
retrieving revision 1.42
retrieving revision 1.43
diff -2 -u -d -r1.42 -r1.43
--- AgentTicketProcess.pm	14 Feb 2013 01:40:21 -0000	1.42
+++ AgentTicketProcess.pm	14 Feb 2013 13:49:50 -0000	1.43
@@ -843,7 +843,11 @@
             # If we got a submitted param, take it and next out
             if (
-                IsStringWithData($Value)
-                || IsArrayRefWithData($Value)
-                || IsHashRefWithData($Value)
+                defined $Value
+                && (
+                    $Value eq ''
+                    || IsStringWithData($Value)
+                    || IsArrayRefWithData($Value)
+                    || IsHashRefWithData($Value)
+                )
                 )
             {
@@ -854,7 +858,15 @@
             # If we didn't have a Param Value try the ticket Value
             # next out if it was successful
-            $Value = $Ticket{$CurrentField};
-            if ($Value) {
-                $GetParam{$CurrentField} = $Value;
+            if (
+                defined $Ticket{$CurrentField}
+                && (
+                    $Ticket{$CurrentField} eq ''
+                    || IsStringWithData( $Ticket{$CurrentField} )
+                    || IsArrayRefWithData( $Ticket{$CurrentField} )
+                    || IsHashRefWithData( $Ticket{$CurrentField} )
+                )
+                )
+            {
+                $GetParam{$CurrentField} = $Ticket{$CurrentField};
                 next DIALOGFIELD;
             }
@@ -862,9 +874,5 @@
             # If we had neighter submitted nor ticket param get the ActivityDialog's default Value
             # next out if it was successful
-            # skip CustomerID field otherwise the value will be in GetParam but never shown in the
-            # activity dialog field
-            if ( $CurrentField ne 'CustomerID' ) {
-                $Value = $ActivityDialog->{Fields}{$CurrentField}{DefaultValue};
-            }
+            $Value = $ActivityDialog->{Fields}{$CurrentField}{DefaultValue};
             if ($Value) {
                 $GetParam{$CurrentField} = $Value;
@@ -880,6 +888,8 @@
             }
 
-            # if all that failed, use ''
-            $GetParam{$CurrentField} = '';
+            # if all that failed then the field should not have a defined value otherwise
+            # if a value (even empty) is sent, fields like Date or DateTime will mark the field as
+            # used with the field display value, this could lead to unwanted field sets,
+            # see bug#9159
             next DIALOGFIELD;
         }
@@ -2102,14 +2112,11 @@
         DynamicFieldConfig   => $DynamicFieldConfig,
         PossibleValuesFilter => $PossibleValuesFilter,
-
-        # if a value (even empty) is sent fields like Date or DateTime will mark the field as used
-        # with the field display value, this could lead to unwanted field sets, see bug#9159
-        Value => $Param{GetParam}{ 'DynamicField_' . $Param{FieldName} } || undef,
-        LayoutObject    => $Self->{LayoutObject},
-        ParamObject     => $Self->{ParamObject},
-        AJAXUpdate      => 1,
-        Mandatory       => $Param{ActivityDialogField}->{Display} == 2,
-        UpdatableFields => $Param{AJAXUpdatableFields},
-        ServerError     => $ServerError,
+        Value                => $Param{GetParam}{ 'DynamicField_' . $Param{FieldName} },
+        LayoutObject         => $Self->{LayoutObject},
+        ParamObject          => $Self->{ParamObject},
+        AJAXUpdate           => 1,
+        Mandatory            => $Param{ActivityDialogField}->{Display} == 2,
+        UpdatableFields      => $Param{AJAXUpdatableFields},
+        ServerError          => $ServerError,
     );
 
---------------------------------------------------------------------
OTRS mailing list: cvs-log - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/cvs-log
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/cvs-log
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.