xiaoding721
2023-11-10 79c746bf370b64a4f450448e63df9157b5652812
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
Quintiq file version 2.0
#parent: #root
Response OnCreated () id:Response_ApplicationLibMacroPlanner_OnCreated #extension
{
  Body:
  [*
    // Update application title.
    this.SelectScenarioManager();
    LabelPeriodRollStatus.Visible( [Boolean] ValueHolderPeriodRollStatus.Value() );
    
    if( not isnull( ScenarioManager ) )
    {                                            
      if( not isnull( MacroPlan ) )
      {                                                    
        // Check that current scenario is created by current user
        // or is authorized for the current user
        scenario := select( ScenarioManager,
                            ScenarioNode.astype( Scenario ),
                            node,
                            node.DatasetMDSID() = MacroPlan.MDSID()
                            and this.IsAuthorizedScenario( node ) )
        if ( isnull( scenario ) )
        {
    
          // false, deselect current scenario and select something else
          this.DeselectScenario( null( internal[GUIComponent] ), MacroPlan );
    
          scenario := select( ScenarioManager,
                              ScenarioNode.astype( Scenario ),
                              node,
                              this.IsAuthorizedScenario( node ) )
        }
        ApplicationLibMacroPlanner.SelectScenario( scenario );    
      }
    
      if( ScenarioManager.ScenarioMP( relsize ) = 0 )
      {
        // Create and launch start-up wizard
        ApplicationLibMacroPlanner.LaunchStartUpWizard();
      } 
    }
    
    ApplicationLibMacroPlanner.EnableWorkflow( guard( SWF_WorkflowDataset.IsWorkflowEnabled(), false ) );
    
    // Configure menus, hide menus with all of their submenus hidden due to functionalities
    if( not isnull( MPDomainHandler ) )
    {
      this.ConfigureMenus();
    }
    
    // Select default representation MacroPlanner instead of Global
    Application.RepresentationManager().SelectRepresentation( "MacroPlanner" );
    
    if ( not isnull( GlobalOTDLog )){
      IPAddressCache::SaveAddress( GlobalOTDLog,Application.ClientIPAddress());
    }
  *]
}