#NEWLINE# def get_ticket_changes( self , req , ticket , action ) : #NEWLINE# #INDENT# this_action = self . actions [ action ] #NEWLINE# if ( not self . _has_perms_for_action ( req , this_action , ticket . resource ) ) : #NEWLINE# #INDENT# return { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# updated = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# status = this_action [ 'newstate' ] #NEWLINE# if ( status != '*' ) : #NEWLINE# #INDENT# updated [ 'status' ] = status #NEWLINE# #UNINDENT# for operation in this_action [ 'operations' ] : #NEWLINE# #INDENT# if ( operation == 'del_owner' ) : #NEWLINE# #INDENT# updated [ 'owner' ] = '' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( operation in ( 'set_owner' , 'may_set_owner' ) ) : #NEWLINE# #INDENT# set_owner = this_action . get ( 'set_owner' ) #NEWLINE# newowner = req . args . get ( ( 'action_%s_reassign_owner' % action ) , ( set_owner [ 0 ] if set_owner else '' ) ) #NEWLINE# if ( type ( newowner ) == list ) : #NEWLINE# #INDENT# newowner = newowner [ 0 ] #NEWLINE# #UNINDENT# updated [ 'owner' ] = self . _sub_owner_keyword ( newowner , ticket ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( operation == 'set_owner_to_self' ) : #NEWLINE# #INDENT# updated [ 'owner' ] = get_reporter_id ( req , 'author' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( operation == 'del_resolution' ) : #NEWLINE# #INDENT# updated [ 'resolution' ] = '' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( operation == 'set_resolution' ) : #NEWLINE# #INDENT# set_resolution = this_action . get ( 'set_resolution' ) #NEWLINE# newresolution = req . args . get ( ( 'action_%s_resolve_resolution' % action ) , ( set_resolution [ 0 ] if set_resolution else '' ) ) #NEWLINE# updated [ 'resolution' ] = newresolution #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# if ( ( not ticket . exists ) and ( 'owner' not in updated ) ) : #NEWLINE# #INDENT# updated [ 'owner' ] = self . _sub_owner_keyword ( ticket [ 'owner' ] , ticket ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( ticket [ 'status' ] == 'new' ) and ( 'component' in ticket . values ) and ( 'component' in ticket . _old ) and ( 'owner' not in updated ) ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# old_comp = TicketComponent ( self . env , ticket . _old [ 'component' ] ) #NEWLINE# #UNINDENT# except ResourceNotFound : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# old_owner = ( old_comp . owner or '' ) #NEWLINE# current_owner = ( ticket [ 'owner' ] or '' ) #NEWLINE# if ( old_owner == current_owner ) : #NEWLINE# #INDENT# new_comp = TicketComponent ( self . env , ticket [ 'component' ] ) #NEWLINE# if new_comp . owner : #NEWLINE# #INDENT# updated [ 'owner' ] = new_comp . owner #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# return updated