lazhen
2025-01-09 8afe90b633046db39042aada36b88193062f8cff
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
Quintiq file version 2.0
#parent: #root
Method CreateSubscription (
  structured[LibCal_Calendar] subscribers_i,
  structured[LibCal_LeadingParticipation] subscribeTo_i
) id:Method_LibCal_dlgSubscription_CreateSubscription_844
{
  #keys: '[146730.0.238492150]'
  Body:
  [*
    this.Title( "Create Subscription" );
    
    calendarsAsSet := subscribers_i.Copy();
    dhSubscribers.Data( &calendarsAsSet );
    
    participationsAsSet := subscribeTo_i.Copy();
    dhParticipationsToSubscribeTo.Data( &participationsAsSet );
    
    lblEvent.Text( [String]subscribeTo_i.Size() + " events" );
    imgInfo.Visible( false ); 
    
    // Use one of the participations as representative of the set to initialize the dialog.
    // Select a recurring event if possible.
    participation := select( dhParticipationsToSubscribeTo.Data(), Elements, part, true, part.IsRecurring() );
    if( isnull( participation ) )
    {
      participation := select( dhParticipationsToSubscribeTo.Data(), Elements, part, true, true );
    }
    
    dhParticipationToSubscribeTo.Data( participation );
    this.Open( participation );
  *]
}