admin
2025-01-22 7e31442f0e9b07764e9c6a9680d3d4aeba5fe1de
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
Quintiq file version 2.0
#parent: #root
Method Open (
  internal[GUIComponent] parent_i,
  structured[LibCal_Calendar] calendars_i
) id:Method_LibCal_dlgSubscribeToEvent_Open_692
{
  #keys: '[131094.1.402444401]'
  Body:
  [*
    this.Title( "Select an event to subscribe the " + [String]calendars_i.Size() + " selected calendars to" );
    
    // Get the available events. In lstEventParticipations the LeadingParticipations of these events will be shown.
    // ToDo: for now, assume that all calendars can subscribe to the same events.
    //       Should be improved so that only the events that they really can call subscribe to are shown.
    events := calendars_i.Element( 0 ).GetPotentialEventsToSubscribeTo();
    
    // Get the calendars of the events. The events are shown per calendar.
    calendars := selectset( events, Elements.Calendar, cal, true, true ).Unique();
    
    // Disallow selecting an event from the selected calendar.
    calendars.Remove( calendars_i );
    
    // Register the selected calendars.
    calendarsAsSet := calendars_i.Copy();
    dhSubscribers.Data( &calendarsAsSet );
    
    dhCalendars.Data( &calendars );
    
    Dialog.DoModal( parent_i );
    
    // The dialog is closed when the followup dialog is closed with OK.
  *]
}