limj
2023-10-24 93652435728de839582440eefd5122c281181d35
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
Quintiq file version 2.0
#parent: #root
StaticMethod CanEditCalendar (
  structured_Object object,
  output String feedback_o
) remote as Boolean
{
  Description: 'Precondition call  in web designer'
  TextBody:
  [*
    value := false;
    if ( exists( object, Elements, o, o.istype( Entity ) ) )
    {           
      value := forall( object, Elements, o, o.istype( Unit ) and o.astype( Unit ).HasCapacityTypeTime() );
    }
    else if ( forall(  object, Elements, o, o.istype( UnitPeriod ) ) )
    {
      value := forall( object, Elements.astype( UnitPeriod ).Unit, unit, unit.HasCapacityTypeTime() );
    }          
    if( not value )
    {
      feedback_o := Translations::MP_WebDesigner_OnlyForUnitCapacityTime();
    }
    
    return value;
  *]
}