From de982da373b3a8df0f1d6f28263fa591403e39d0 Mon Sep 17 00:00:00 2001
From: lazhen <17772815105@139.com>
Date: 星期三, 12 六月 2024 14:41:07 +0800
Subject: [PATCH] 日历不可用时间表修改

---
 _Main/BL/Type_LibCal_SubscriberEventTable/Method_InitializeTable.qbl |   46 ++++++++++++++++++++++++++--------------------
 1 files changed, 26 insertions(+), 20 deletions(-)

diff --git a/_Main/BL/Type_LibCal_SubscriberEventTable/Method_InitializeTable.qbl b/_Main/BL/Type_LibCal_SubscriberEventTable/Method_InitializeTable.qbl
index 89da25f..cbe5916 100644
--- a/_Main/BL/Type_LibCal_SubscriberEventTable/Method_InitializeTable.qbl
+++ b/_Main/BL/Type_LibCal_SubscriberEventTable/Method_InitializeTable.qbl
@@ -16,18 +16,19 @@
     if( isnull( eventcolumn ) ){
       eventcolumn := this.LibCal_SubscriberEventColumn( relnew, RowName := 'Event' );
     }
-    timezone := this.LibCal_Calendar().GetTimeZone();
     
     traverse( subscribers, Elements, subscriber ){
     //  info( '------------------------', subscriber.CalendarID(), subscriber.CalendarType() );
     //  traverse( subscriber,Participation.astype( LibCal_Subscription ).LeadingParticipation, participation ){
-      traverse( subscriber,Participation.astype( LibCal_Subscription ).LeadingParticipation, participation, participation.Event().EventCategory().Name() = 'Unavailable' ){
+      traverse( subscriber,Participation.astype( LibCal_Subscription ).LeadingParticipation, participation, participation.Event().EventCategory().Name() = 'Unavailable' and participation.Event().Subject() = '娴嬭瘯' ){
     //    info( '------------------------', participation.Event().Subject(), '------', participation.Event().EventCategory().Name() );
         event := participation.Event();
+        
         row := selectobject( this, LibCal_SubscriberEventRow, row, row.Subscriber() = subscriber.CalendarID() 
                              and row.Event() = event.Subject() 
                              and row.EventType() = event.EventType().Name() 
                              );
+        
         if( isnull( row ) ){
           row := this.LibCal_SubscriberEventRow( relnew, RowNr := rownr, Subscriber := subscriber.CalendarID(), 
                                                  Event := event.Subject(), 
@@ -43,28 +44,33 @@
           row.LibCal_SubscriberEventCell( relinsert, eventcell );
           rownr := rownr + 1;
         }
-    
-        endTime     := participation.EndDate().DateTime( timezone ).AddAsPeriod( timezone, event.EndTimeOfDay() );
-        startTime   := participation.StartDate().DateTime( timezone ).AddAsPeriod( timezone, event.StartTimeOfDay() );
-    //    info( this.ID(), startTime, endTime );
-        if( this.ID() = 'Day' ){
-          this.InitializeDay( this, row, startTime, endTime, event.Description() );
-        }else if( this.ID() = 'Week' ){
-          this.InitializeWeek( this, row, startTime, endTime, event.Description() );
-        }else{
-          this.InitializeMonth( this, row, startTime, endTime, event.Description() );
+        
+        traverse( participation, ExplicitTimeInterval, eti ){
+          info( eti.Start(), eti.End(), eti.DefinitionName() );
+          if( this.ID() = 'Day' ){
+            this.InitializeDay( this, row, eti.Start(), eti.End(), event.Description() );
+          }else if( this.ID() = 'Week' ){
+            this.InitializeWeek( this, row, eti.Start(), eti.End(), event.Description() );
+          }else{
+            this.InitializeMonth( this, row, eti.Start(), eti.End(), event.Description() );
+          }
         }
+        
+        
+    //
+    //    endTime     := participation.EndDate().DateTime( timezone ).AddAsPeriod( timezone, event.EndTimeOfDay() );
+    //    startTime   := participation.StartDate().DateTime( timezone ).AddAsPeriod( timezone, event.StartTimeOfDay() );
     
       }
     }
     
-    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 );
-        }
-      }
-    }
+    //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 );
+    //    }
+    //  }
+    //}
   *]
 }

--
Gitblit v1.9.3