# What's new in Scheduler Pro v5.3.0

## AjaxHelper.fetch now supports passing parameters in request body

Since this release [AjaxHelper.fetch](#Core/helper/AjaxHelper#function-fetch-static) method can pass provided `queryParams`
in the request body instead of query string. This happens for `application/x-www-form-urlencoded` and
`multipart/form-data` content types when `addQueryParamsToBody` option is set to `true`:

```javascript
AjaxHelper.fetch('url', {
    headers : {
        'Content-Type' : 'application/x-www-form-urlencoded'
    },
    addQueryParamsToBody : true
});
```

Please check `addQueryParamsToBody` in [FetchOptions](#Core/helper/AjaxHelper#typedef-FetchOptions)

**Please note** that this behavior is disabled by default so if you need to enable it globally please use
[AjaxHelper.DEFAULT_FETCH_OPTIONS](#Core/helper/AjaxHelper#property-DEFAULT_FETCH_OPTIONS-static):

```javascript
// enable addQueryParamsToBody by default
AjaxHelper.DEFAULT_FETCH_OPTIONS = {
    addQueryParamsToBody : true
}
```

## Basic recurring events support

Scheduler Pro now supports recurring events in a way very similar to the basic Scheduler. This means that while the
original event adheres to Pro specific logic such as calendars and dependencies, the occurrences of it do not. For
example an event repeated every third day will eventually occur on a weekend. To enable recurring events, configure your
scheduler with `enableRecurringEvents : true`.

<div class="external-example" data-file="SchedulerPro/guides/whats-new/5.3.0/recurrence.js"></div>

## Time zone support

Support for Time zone conversion has been added to all Bryntum scheduling products. Simply set a IANA time zone
identifier as value for the [timeZone](#SchedulerPro/model/ProjectModel#config-timeZone) config and that's it.

But since time zones is not natively supported in JavaScript we strongly recommend to read our
[Time zone guide](#Scheduler/guides/customization/timezone.md).

Also, please check out the new [Time zone demo](https://bryntum.com/examples/schedulerpro/timezone/).

```javascript
new SchedulerPro({
    timeZone : 'America/Chicago'
});
```

## Versions feature

You can now enable the Versions feature on Scheduler Pro to capture, restore, and compare snapshots of a project, plus
detailed change logs. The Versions feature adds a VersionStore and a ChangeLogStore to the project, and
captures change logs using the STM feature.

Versions can be captured at any time programmatically, or on a configured
schedule. Versions contain both a full snapshot of the project and a set of change log transactions describing the
changes since the previous version, in a format useful for display to the user.

See demo below under VersionGrid widget.

## VersionGrid widget

The VersionGrid widget displays versions and their change logs in a TreeGrid. Versions can be expanded to show the
change logs they contain, and the context menu for version rows supports renaming, restoring, and comparing saved
versions. If desired, the version rows can be hidden, providing a continuous view of change log actions for the project.

<div class="external-example" data-file="SchedulerPro/guides/whats-new/5.3.0/versions.js"></div>

## New locales

New locales for 31 languages have been added. Currently available languages are listed in the
[localization guide](#SchedulerPro/guides/customization/localization.md#locales).

## New effort aware scheduling mode

In this release Scheduler Pro adds support for __event effort__ calculations. __And event effort__ represents total
amount of time scheduled on the event for all its assigned resources.

[EventModel](#SchedulerPro/model/EventModel) class has got four new fields:

* [schedulingMode](#SchedulerPro/model/EventModel#field-schedulingMode)
* [effort](#SchedulerPro/model/EventModel#field-effort)
* [effortUnit](#SchedulerPro/model/EventModel#field-effortUnit)
* [effortDriven](#SchedulerPro/model/EventModel#field-effortDriven)

To switch to the new mode [EventModel](#SchedulerPro/model/EventModel) class has got a new
[schedulingMode](#SchedulerPro/model/EventModel#field-schedulingMode) field that
supports two values, `Normal` (old backward compatible behavior) and `FixedDuration` (the new mode that enables effort
related calculations).

The new mode means, that event has _fixed_ (provided by the user) duration, start and end dates,
but its [effort](#SchedulerPro/model/EventModel#field-effort) is computed dynamically,
based on the assigned resources information.

Typical example of such event is a meeting. Meetings typically have pre-defined start and end dates and the more
people are participating in the meeting, the more effort is spent on the event.

In this mode when an event [duration](#SchedulerPro/model/EventModel#field-duration) increases,
its [effort](#SchedulerPro/model/EventModel#field-effort) is increased too.
Whereas changing of [effort](#SchedulerPro/model/EventModel#field-effort) does not cause
[duration](#SchedulerPro/model/EventModel#field-duration) change but instead adjusts corresponding
assignment [units](#SchedulerPro/model/AssignmentModel#field-units)
to distribute the effort value across the duration.

**Please note** the above logic can be slightly changed by enabling the new
[effortDriven](#SchedulerPro/model/EventModel#field-effortDriven) flag on the event. Effort driven events tend to
preserve user provided effort value. So when changing such events duration they adjust their assignment units.

Enabling of the mode can be done by providing the field value either dynamically:

```javascript
// set event1 effort to 8 hours and toggle scheduling mode to distribute the effort
event1.effort = 8;
event1.schedulingMode = 'FixedDuration';
```

Or if you need to make this mode enabled by default just change
the [schedulingMode](#SchedulerPro/model/EventModel#field-schedulingMode) field default value:

```javascript
class MyEventModel extends EventModel {
    static fields = [
        { name : 'schedulingMode', defaultValue : 'FixedDuration' }
    ]
}
```

On the UI level new fields have been added to the task editor:

* `Effort` on the `General` tab.
* `Scheduling mode` and `Effort driven` on the `Advanced`.

The `Effort driven` field is hidden by default and can be shown like this:

```javascript
const scheduler = new SchedulerPro({
    features : {
        taskEdit : {
            items : {
                advancedTab : {
                    type  : 'schedulerAdvancedTab',
                    items : {
                        // show "Effort driven" checkbox
                        effortDrivenField : {
                            hidden : false
                        }
                    }
                }
            }
        }
    }
});
```


<p class="last-modified">Last modified on 2023-10-26 8:19:27</p>