[Rt-commit] rt branch, 4.4/process-transaction-cf-updates, created. rt-4.4.0-260-g1bb5787

Jim Brandt jbrandt at bestpractical.com
Fri Jun 24 11:49:45 EDT 2016


The branch, 4.4/process-transaction-cf-updates has been created
        at  1bb578722e7d0a7c57134db82b7ed801cf9d79e8 (commit)

- Log -----------------------------------------------------------------
commit 1bb578722e7d0a7c57134db82b7ed801cf9d79e8
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Fri Jun 24 11:44:51 2016 -0400

    Support processing transaction cfs on ticket create and update
    
    The change here is scoped only to the changes that include
    TimeWorked. This was originally developed as part of
    RT::Extension::TimeTracking and supports the transaction
    custom field functionality provided there. Support for
    additional transaction cf updates may require a more
    comprehensive change.

diff --git a/lib/RT/Interface/Web.pm b/lib/RT/Interface/Web.pm
index e3cf905..935c62a 100644
--- a/lib/RT/Interface/Web.pm
+++ b/lib/RT/Interface/Web.pm
@@ -2930,7 +2930,6 @@ sub ProcessTicketBasics {
         FinalPriority
         Priority
         TimeEstimated
-        TimeWorked
         TimeLeft
         Type
         Status
@@ -2960,6 +2959,12 @@ sub ProcessTicketBasics {
         ARGSRef       => $ARGSRef,
     );
 
+    if ( $ARGSRef->{'TimeWorked'} ) {
+        my ( $val, $msg, $txn ) = $TicketObj->SetTimeWorked( $ARGSRef->{'TimeWorked'} );
+        push( @results, $msg );
+        $txn->UpdateCustomFields( %$ARGSRef) if $txn;
+    }
+
     # We special case owner changing, so we can use ForceOwnerChange
     if ( $ARGSRef->{'Owner'}
       && $ARGSRef->{'Owner'} !~ /\D/
@@ -3360,7 +3365,14 @@ sub ProcessObjectCustomFieldUpdatesForCreate {
                     );
             }
 
-            $parsed{"CustomField-$cfid"} = \@values if @values;
+            if (@values) {
+                if ( $class eq 'RT::Transaction' ) {
+                    $parsed{"Object-RT::Transaction--CustomField-$cfid"} = \@values;
+                }
+                else {
+                    $parsed{"CustomField-$cfid"} = \@values if @values;
+                }
+            }
         }
     }
 
diff --git a/lib/RT/Ticket.pm b/lib/RT/Ticket.pm
index 3fa0557..2c89658 100644
--- a/lib/RT/Ticket.pm
+++ b/lib/RT/Ticket.pm
@@ -2650,7 +2650,7 @@ sub _Set {
     # just made the ticket unreadable to us
     $trans->{ _object_is_readable } = 1;
 
-    return ( $ret, scalar $trans->BriefDescription );
+    return ( $ret, scalar $trans->BriefDescription, $trans );
 }
 
 

-----------------------------------------------------------------------


More information about the rt-commit mailing list