Quintiq file version 2.0
#parent: #root
Method SetDialogData () id:Method_SWF_DialogCreateEditActivity_SetDialogData
{
  #keys: '[136682.0.610434231]'
  Body:
  [*
    // Set web view manager into data holder.
    DataHolderViewManager.Data( ApplicationScope.ViewManager() );
    
    // Set dialog component for delgate forward/reply/close
    is_forward  := DataHolderIsForward.Data();
    is_new_edit := DataHolderIsNew.Data();
    name        := "";
    description := "";
    
    // Enable/Disable dialog component for delegate actions
    DropDownStringListAssignedTo.Enabled( is_forward or is_new_edit, "" );
    // Set data for edit, reply or forward
    if( not isnull( DataHolderOriginActivity.Data() ) )
    {
        
      origin_activity := DataHolderOriginActivity.Data();
      name := origin_activity.Name();
      description := origin_activity.Description();
      DropDownStringListAssignedTo.Text( origin_activity.AssignedAuthorization().DisplayName() );
      //only set for reply or forward
      if( not is_new_edit )
      {
        name_prefix := ifexpr( is_forward, 
                               SWF_Translation::TRANSLATE_PrefixForwardActivityName(), 
                               SWF_Translation::TRANSLATE_PrefixReplyActivityName() );                                      
        name := name_prefix + origin_activity.Name();
        description := SWF_Workflow::GetDefaultForwardedDescription( origin_activity );
        
        if( not is_forward )
        {
          DropDownStringListAssignedTo.Text( origin_activity.Creator().DisplayName() );
        }  
        
      }
      duedate := origin_activity.DueDate();
      DateTimeSelectorDueDate.DateTime( duedate.DateTime() );  
      EditFieldTitle.Text( name );
      EditFieldDescription.Text( description )
    }
  *]
}
