Quintiq file version 2.0
#parent: #root
Method Copy (
  internal[GUIComponent] parent,
  OptimizerPuzzle optimizerpuzzle,
  Boolean showhideddloptimizer
) as OptimizerPuzzleWIP id:Method_DialogCreateEditOptimizerPuzzle_Copy
{
  #keys: '[146140.0.1660172119]'
  Body:
  [*
    // Copy an optimizer puzzle, triggered from FormOptimizerPuzzle
    
    // Hide ddl and button
    Dialog.ShowHideComponents( showhideddloptimizer );
    
    wip := optimizerpuzzle.Copy( MacroPlan, QuintiqUser::CurrentUser().Name() );
    
    Dialog.Data( wip );
    
    result := Dialog.DoModal( parent );
    
    if( result > 0 )
    {
      wip.OptimizerPuzzle().Update( QuintiqUser::CurrentUser().Name(), 
                                    Dialog.GetOptimizerPuzzleName(),
                                    EditorDescription.Text(),
                                    false ); // isFromDB 
    }
    
    return wip;
  *]
}
