陈清红
2025-04-14 880f3c0257eeb8c37761d484258fdd102a369a19
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
Quintiq file version 2.0
#parent: #root
Method InitializeTable (
  LibCal_Calendars subscribers
)
{
  TextBody:
  [*
    // 甄兰鸽 May-28-2024 (created)
    //rownr                 := this.LibCal_SubscriberEventRow( relsize );
    traverse( this.LibCal_Calendar(), Event.LeadingParticipation, lp, lp.Event().EventCategory().Name() = 'Unavailable' ){
      event               := lp.Event();
      rows                := selectset( this, LibCal_SubscriberEventRow, row, row.Event() = event.Subject() and row.EventType() = guard( event.EventType().Name(), '' ) );
      traverse( lp, Subscription, subscription ){
        row               := selectobject( rows, Elements, row, row.Subscriber() = subscription.Calendar().CalendarID() );
        
        if( isnull( row ) ){
          row             := this.LibCal_SubscriberEventRow( relnew, Subscriber   := subscription.Calendar().CalendarID()
                                                             , Event              := event.Subject()
                                                             , EventType          := guard( event.EventType().Name(), '' ) );
          
        }
        
        traverse( subscription, ExplicitTimeInterval, eti ){
          row.InitializeDate( this, eti.Start(), eti.End(), event.Description() );
        }
    
      }
    }
    //info( '----------------------1------------------------', this.LibCal_SubscriberEventColumn( relsize ) );
    //traverse( this, LibCal_SubscriberEventColumn, column ){
    //  info( '------------------------', column.Name(), column.Period(), column.TimeUnit() );
    //}
    //        
    //Transaction::Transaction().Propagate( attribute( LibCal_SubscriberEventTable, MaxDayDate ) );
    //Transaction::Transaction().Propagate( attribute( LibCal_SubscriberEventTable, MaxWeekDate ) );
    //Transaction::Transaction().Propagate( attribute( LibCal_SubscriberEventTable, MaxMonthDate ) );
    //Transaction::Transaction().Propagate( attribute( LibCal_SubscriberEventTable, MinDayDate ) );
    //Transaction::Transaction().Propagate( attribute( LibCal_SubscriberEventTable, MinWeekDate ) );
    //Transaction::Transaction().Propagate( attribute( LibCal_SubscriberEventTable, MinMonthDate ) );
    this.ProcessColumnDay();
    this.ProcessColumnWeek();
    this.ProcessColumnMonth();
    traverse( this, LibCal_SubscriberEventColumn, column ){
      traverse( this, LibCal_SubscriberEventRow, row ){
        if( not exists( column, LibCal_SubscriberEventCell, cell, cell.LibCal_SubscriberEventRow() = row ) ) {
          cell := column.LibCal_SubscriberEventCell( relnew, Value := '' );
          row.LibCal_SubscriberEventCell( relinsert, cell );
        }
      }
    }
  *]
}