From e4f3d4a880acac6559f8d91277fa559e4fd350c8 Mon Sep 17 00:00:00 2001
From: xiaoding721 <33130084+xiaoding721@users.noreply.github.com>
Date: 星期五, 31 五月 2024 16:12:48 +0800
Subject: [PATCH] Merge branch 'dev' of http://47.101.211.7:10101/r/VWED into dev

---
 _Main/BL/Type_LibCal_SubscriberEventTable/Method_InitializeTable.qbl |   36 +++++++++++++++++++++++++-----------
 1 files changed, 25 insertions(+), 11 deletions(-)

diff --git a/_Main/BL/Type_LibCal_SubscriberEventTable/Method_InitializeTable.qbl b/_Main/BL/Type_LibCal_SubscriberEventTable/Method_InitializeTable.qbl
index 61af153..89da25f 100644
--- a/_Main/BL/Type_LibCal_SubscriberEventTable/Method_InitializeTable.qbl
+++ b/_Main/BL/Type_LibCal_SubscriberEventTable/Method_InitializeTable.qbl
@@ -1,8 +1,7 @@
 Quintiq file version 2.0
 #parent: #root
 Method InitializeTable (
-  LibCal_Calendars subscribers,
-  LibCal_EventCategory category
+  LibCal_Calendars subscribers
 )
 {
   TextBody:
@@ -22,17 +21,23 @@
     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() = category ){
+      traverse( subscriber,Participation.astype( LibCal_Subscription ).LeadingParticipation, participation, participation.Event().EventCategory().Name() = 'Unavailable' ){
     //    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() );
+        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(), EventType := event.EventType() );
+          row := this.LibCal_SubscriberEventRow( relnew, RowNr := rownr, Subscriber := subscriber.CalendarID(), 
+                                                 Event := event.Subject(), 
+                                                 EventType := event.EventType().Name() );
           
-          if( counter( this, LibCal_SubscriberEventRow, linerow, linerow.Subscriber() = row.Subscriber() ) = 1 ){
-            subscribercell := subscribercolumn.LibCal_SubscriberEventCell( relnew, Value := row.Subscriber() );
-            row.LibCal_SubscriberEventCell( relinsert, subscribercell );
+          subscribercell := subscribercolumn.LibCal_SubscriberEventCell( relnew, Value := row.Subscriber() );
+          if( counter( this, LibCal_SubscriberEventRow, linerow, linerow.Subscriber() = row.Subscriber() ) <> 1 ){
+            subscribercell.Value( '' );
           }
+          row.LibCal_SubscriberEventCell( relinsert, subscribercell );
           
           eventcell := eventcolumn.LibCal_SubscriberEventCell( relnew, Value := row.Event() );
           row.LibCal_SubscriberEventCell( relinsert, eventcell );
@@ -43,14 +48,23 @@
         startTime   := participation.StartDate().DateTime( timezone ).AddAsPeriod( timezone, event.StartTimeOfDay() );
     //    info( this.ID(), startTime, endTime );
         if( this.ID() = 'Day' ){
-          this.InitializeDay( this, row, startTime, endTime );
+          this.InitializeDay( this, row, startTime, endTime, event.Description() );
         }else if( this.ID() = 'Week' ){
-          this.InitializeWeek( this, row, startTime, endTime );
+          this.InitializeWeek( this, row, startTime, endTime, event.Description() );
         }else{
-          this.InitializeMonth( this, row, startTime, endTime );
+          this.InitializeMonth( this, row, startTime, endTime, event.Description() );
         }
     
       }
     }
+    
+    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