Quintiq file version 2.0
#parent: MatrixEditorTimeCapacities
Response OnClick (
  structured[UnitPeriodTime] selection
) id:Response_MatrixEditorTimeCapacities_MenuResetToDefaultValue_OnClick
{
  #keys: '[139394.1.338496188]'
  CanBindMultiple: false
  DefinitionID => /MatrixEditorTimeCapacities/Responsedef_MatrixEditorTimeCapacities_WebMenu_OnClick
  Initiator: 'MenuResetToDefaultValue'
  Precondition:
  [*
    canedit := UnitPeriod::CanEdit( selection, feedback );
    return canedit;
  *]
  QuillAction
  {
    Body:
    [*
      // Reset value to default
      gp := MacroPlan.GlobalParameters_MP();
      firstEle := selection.Element( 0 );
      UnitAvailability::CreateOrUpdateForUnitPeriodTimes( selection,
                                                          false,
                                                          '',
                                                          firstEle.Maintenance(),
                                                          true,
                                                          gp.DefaultEfficiency(),
                                                          true,
                                                          gp.DefaultAllocation(),
                                                          true,
                                                          MacroPlan.DefaultShiftPattern(),
                                                          true,
                                                          gp.DefaultMaxLoadPercentage(),
                                                          true,
                                                          gp.DefaultNumberOfUnits(),
                                                          false,
                                                          false,
                                                          firstEle.MinimumLoadThreshold()
                                                        );
    *]
    GroupServerCalls: false
  }
}
