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
35
36
37
38
Quintiq file version 2.0
#parent: #root
Method UpdateSubscriptionPeriod (
  String periodType_i,
  Date startDate_i,
  Duration startTime_i,
  Date endDate_i,
  Duration endTime_i
) id:Method_LibCal_dlgSubscription_UpdateSubscriptionPeriod
{
  #keys: '[146730.0.1711442457]'
  Body:
  [*
    // This method is meant to be called when dlgEvent is closed, when it was opened from this dialog.
    
    // A non-recurring Event should subscribe to all (one) occurrences, and has an end date. 
    if( periodType_i = LibCal_RecurrencePattern::TYPE_NONE() )
    {
      ckbAllOccurrences.Checked( true );
      periodType_i := LibCal_RecurrencePeriod::TYPE_WITHENDDATE();
    }
    
    // Update the data of the subscription period with the data from the Event if the subscription
    // is set to all occurrences. Otherwise keep the data of the subscription.
    if( ckbAllOccurrences.Checked() )
    {
      dhStartOfPeriod.  Data(     startDate_i );
      dsStartOfPeriod.  Date(     startDate_i );
      durStartTimeOfDay.Duration( startTime_i );
      dsEndOfPeriod.    Date(     endDate_i   );
      durEndTimeOfDay.  Duration( endTime_i   );
      
      // NrOfOccurrences is not supported for subscriptions, 'cast' it to WithEndDate.
      ckbEndOfPeriod.Checked( periodType_i = LibCal_RecurrencePeriod::TYPE_WITHENDDATE() or
                              periodType_i = LibCal_RecurrencePeriod::TYPE_NROFOCCURRENCES() );
    }
  *]
}