lazhen
2024-06-12 de982da373b3a8df0f1d6f28263fa591403e39d0
日历不可用时间表修改
已添加6个文件
已修改6个文件
已删除2个文件
219 ■■■■■ 文件已修改
_Main/BL/Relations/Relation_LibCal_SubscriberEventPeriod_Cell_LibCal_SubscriberEventCell_Period.qbl 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LibCal_SubscriberEventCell/Attribute_End.qbl 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LibCal_SubscriberEventCell/Attribute_Start.qbl 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LibCal_SubscriberEventCell/Method_GetMatrixTooltip.qbl 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LibCal_SubscriberEventPeriod/Attribute_End.qbl 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LibCal_SubscriberEventPeriod/Attribute_Start.qbl 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LibCal_SubscriberEventPeriod/DefaultValue_End.qbl 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LibCal_SubscriberEventPeriod/DefaultValue_Start.qbl 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LibCal_SubscriberEventPeriod/_ROOT_Type_LibCal_SubscriberEventPeriod.qbl 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LibCal_SubscriberEventTable/Method_InitializeDay.qbl 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LibCal_SubscriberEventTable/Method_InitializeMonth.qbl 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LibCal_SubscriberEventTable/Method_InitializeTable.qbl 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LibCal_SubscriberEventTable/Method_InitializeWeek.qbl 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Views/Calendar_unavailable_event_view.vw 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Relations/Relation_LibCal_SubscriberEventPeriod_Cell_LibCal_SubscriberEventCell_Period.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,23 @@
Quintiq file version 2.0
#parent: #root
Relation LibCal_SubscriberEventPeriod_Cell_LibCal_SubscriberEventCell_Period
{
  #keys: '1[415136.0.780371764]'
  DefaultRelationStrategy
  {
  }
  RelationSide.LeftSide Cell
  {
    #keys: '3[415136.0.780371766][415136.0.780371765][415136.0.780371767]'
    Cardinality: '0to1'
    ObjectDefinition: LibCal_SubscriberEventPeriod
    OwningSide: 'Reference'
  }
  RelationSide.RightSide Period
  {
    #keys: '3[415136.0.780371769][415136.0.780371768][415136.0.780371770]'
    Cardinality: '1toN'
    ObjectDefinition: LibCal_SubscriberEventCell
    OwningSide: 'Owned'
  }
}
_Main/BL/Type_LibCal_SubscriberEventCell/Attribute_End.qbl
ÎļþÒÑɾ³ý
_Main/BL/Type_LibCal_SubscriberEventCell/Attribute_Start.qbl
ÎļþÒÑɾ³ý
_Main/BL/Type_LibCal_SubscriberEventCell/Method_GetMatrixTooltip.qbl
@@ -7,8 +7,10 @@
  [*
    // ç”„兰鸽 May-30-2024 (created)
    tooltip := '<table>';
    tooltip := tooltip + '<tr><td><b>Start time:</b></td><td>' + this.Start() + '</td></tr>';
    tooltip := tooltip + '<tr><td><b>End time:</b></td><td>' + this.End() + '</td></tr>';
    traverse( this, Period, period ){
      tooltip := tooltip + '<tr><td><b>Start time:</b></td><td>' + period.Start() + '</td></tr>';
      tooltip := tooltip + '<tr><td><b>End time:</b></td><td>' + period.End() + '</td></tr>';
    }
    tooltip := tooltip + '<tr><td><b>Description:</b></td><td>';
    if( this.Description() <> '' ){
      tooltip := tooltip + this.Description() + '</td></tr>';
_Main/BL/Type_LibCal_SubscriberEventPeriod/Attribute_End.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,7 @@
Quintiq file version 2.0
#parent: #root
Attribute End
{
  #keys: '3[415136.0.780371748][415136.0.780371747][415136.0.780371749]'
  ValueType: String
}
_Main/BL/Type_LibCal_SubscriberEventPeriod/Attribute_Start.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,7 @@
Quintiq file version 2.0
#parent: #root
Attribute Start
{
  #keys: '3[415136.0.780371751][415136.0.780371750][415136.0.780371752]'
  ValueType: String
}
_Main/BL/Type_LibCal_SubscriberEventPeriod/DefaultValue_End.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,6 @@
Quintiq file version 2.0
#parent: #root
DefaultValue
{
  TargetAttribute: End
}
_Main/BL/Type_LibCal_SubscriberEventPeriod/DefaultValue_Start.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,6 @@
Quintiq file version 2.0
#parent: #root
DefaultValue
{
  TargetAttribute: Start
}
_Main/BL/Type_LibCal_SubscriberEventPeriod/_ROOT_Type_LibCal_SubscriberEventPeriod.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,10 @@
Quintiq file version 2.0
#root
#parent: #DomainModel
Type LibCal_SubscriberEventPeriod
{
  #keys: '5[415136.0.780371742][415136.0.780371740][0.0.0][415136.0.780371741][415136.0.780371743]'
  BaseType: Object
  Description: '日历不可用事件表的单元格绑定的日期区间'
  StructuredName: 'LibCal_SubscriberEventPeriods'
}
_Main/BL/Type_LibCal_SubscriberEventTable/Method_InitializeDay.qbl
@@ -21,16 +21,14 @@
      if( startTime.StartOfNextDay() > endtime ){
        duration := endtime - startTime;
        cell := column.LibCal_SubscriberEventCell( relnew, Value := [String]duration.HoursAsReal()
                                                   , Start := startTime.Format( 'M/D/Y H:m' )
                                                   , End := endtime.Format( 'M/D/Y H:m' )
                                                   , Description := desc );
        cell.Period( relnew, Start := startTime.Format( 'M/D/Y H:m' ), End := endtime.Format( 'M/D/Y H:m' ) );
        row.LibCal_SubscriberEventCell( relinsert, cell );
      }else{
        duration := startTime.StartOfNextDay() - startTime;
        cell := column.LibCal_SubscriberEventCell( relnew, Value := [String]duration.HoursAsReal()
                                                   , Start := startTime.Format( 'M/D/Y H:m' )
                                                   , End := startTime.StartOfNextDay().Format( 'M/D/Y H:m' )
                                                   , Description := desc );
        cell.Period( relnew, Start := startTime.Format( 'M/D/Y H:m' ), End := startTime.StartOfNextDay().Format( 'M/D/Y H:m' ) );
        row.LibCal_SubscriberEventCell( relinsert, cell );
      }
    //  info( startTime, column.Name(), duration.AsQUILL(), duration.HoursAsReal() );
_Main/BL/Type_LibCal_SubscriberEventTable/Method_InitializeMonth.qbl
@@ -21,21 +21,24 @@
        column := table.LibCal_SubscriberEventColumn( relnew, Name := time.Format( 'M/D/Y' ), Period := time.Date() );
      }
      
      if( startTime.StartOfNextMonth() > endtime ){
        duration := endtime - startTime;
        cell := column.LibCal_SubscriberEventCell( relnew, Value := [String]duration.HoursAsReal()
                                                   , Start := startTime.Format( 'M/D/Y H:m' )
                                                   , End := endtime.Format( 'M/D/Y H:m' )
                                                   , Description := desc );
        row.LibCal_SubscriberEventCell( relinsert, cell );
      }else{
        duration := startTime.StartOfNextMonth() - startTime;
        cell := column.LibCal_SubscriberEventCell( relnew, Value := [String]duration.HoursAsReal()
                                                   , Start := startTime.Format( 'M/D/Y H:m' )
                                                   , End := startTime.StartOfNextMonth().Format( 'M/D/Y H:m' )
                                                   , Description := desc );
      cell := selectobject( column, LibCal_SubscriberEventCell, cell, cell.LibCal_SubscriberEventRow() = row );
      if( isnull( cell ) ){
        cell := column.LibCal_SubscriberEventCell( relnew, Value := '0'
                                                     , Description := desc );
        row.LibCal_SubscriberEventCell( relinsert, cell );
      }
      value := [Real]cell.Value();
      if( startTime.StartOfNextMonth() > endtime ){
        duration := endtime - startTime;
        value := value + duration.HoursAsReal();
        cell.Period( relnew, Start := startTime.Format( 'M/D/Y H:m' ), End := endtime.Format( 'M/D/Y H:m' ) );
      }else{
        duration := startTime.StartOfNextMonth() - startTime;
        value := value + duration.HoursAsReal();
        cell.Period( relnew, Start := startTime.Format( 'M/D/Y H:m' ), End := startTime.StartOfNextMonth().Format( 'M/D/Y H:m' ) );
      }
      cell.Value( [String]value );
    //  info( startTime, column.Name(), duration.AsQUILL(), duration.HoursAsReal() );
    }
  *]
_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 );
    //    }
    //  }
    //}
  *]
}
_Main/BL/Type_LibCal_SubscriberEventTable/Method_InitializeWeek.qbl
@@ -21,21 +21,25 @@
        column := table.LibCal_SubscriberEventColumn( relnew, Name := time.Format( 'M/D/Y' ), Period := time.Date() );
      }
      
      if( startTime.StartOfNextWeek() > endtime ){
        duration := endtime - startTime;
        cell := column.LibCal_SubscriberEventCell( relnew, Value := [String]duration.HoursAsReal()
                                                   , Start := startTime.Format( 'M/D/Y H:m' )
                                                   , End := endtime.Format( 'M/D/Y H:m' )
                                                   , Description := desc );
        row.LibCal_SubscriberEventCell( relinsert, cell );
      }else{
        duration := startTime.StartOfNextWeek() - startTime;
        cell := column.LibCal_SubscriberEventCell( relnew, Value := [String]duration.HoursAsReal()
                                                   , Start := startTime.Format( 'M/D/Y H:m' )
                                                   , End := startTime.StartOfNextWeek().Format( 'M/D/Y H:m' )
                                                   , Description := desc );
      cell := selectobject( column, LibCal_SubscriberEventCell, cell, cell.LibCal_SubscriberEventRow() = row );
      if( isnull( cell ) ){
        cell := column.LibCal_SubscriberEventCell( relnew, Value := '0'
                                                     , Description := desc );
        row.LibCal_SubscriberEventCell( relinsert, cell );
      }
      value := [Real]cell.Value();
      if( startTime.StartOfNextWeek() > endtime ){
        duration := endtime - startTime;
        value := value + duration.HoursAsReal();
        cell.Period( relnew, Start := startTime.Format( 'M/D/Y H:m' ), End := endtime.Format( 'M/D/Y H:m' ) );
      }else{
        duration := startTime.StartOfNextWeek() - startTime;
        value := value + duration.HoursAsReal();
        cell.Period( relnew, Start := startTime.Format( 'M/D/Y H:m' ), End := startTime.StartOfNextWeek().Format( 'M/D/Y H:m' ) );
      }
      cell.Value( [String]value );
    //  info( startTime, column.Name(), duration.AsQUILL(), duration.HoursAsReal() );
    }
  *]
_Main/UI/MacroPlannerWebApp/Views/Calendar_unavailable_event_view.vw
@@ -51,6 +51,35 @@
          {
            sizeRatio: 1
          }
          FormCalendarUnavailableEvent_ListCalendarEventTypes
          {
          }
          FormCalendarUnavailableEvent_DataSetLevelCalendarEventTypes
          {
            groupDepth: -1
            column_Name
            {
              columnId: 'Name'
              dataPath: 'Name'
              dataType: 'string'
              index: 0
              subtotals: ''
              width: 150
            }
          }
          FormCalendarUnavailableEvent_DataSetLevelChildEventType
          {
            groupDepth: -1
            column_Name
            {
              columnId: 'Name'
              dataPath: 'Name'
              dataType: 'string'
              index: 0
              subtotals: ''
              width: 150
            }
          }
          FormCalendarUnavailableEvent_PanelCalendarUnavailableEventSearchList
          {
            sizeRatio: 1