Documentation

timeman.timecontrol.settings.set

Scope: timeman Permisisons: admin

The method is used to set the time control settings.

Parameters

ParameterBy defaultRequiredDescription
ACTIVE false No
ACTIVE false No Availability of time control tool .
Enabled via active: true. You can disable feature via active: false when data is sent in bool format. When sending data as as text false as text is deemed as true , it can be disabled only via active: 0.
MINIMUM_IDLE_FOR_REPORT 15 No Minimum time interval in minutes to request the report.
REGISTER_OFFLINE true No Register the user offline status.
REGISTER_IDLE true No Register the user away status.
REGISTER_DESKTOP true No Register when the desktop app is started and closed.
REPORT_REQUEST_TYPE none No Users from which the report to be requested (all - from all, user - only from the specified users, none - from no users).
REPORT_REQUEST_USERS [] No* List of users from which the report to be requested (if report_request_type == user).
REPORT_SIMPLE_TYPE all No Users with access to simple type of report (all - to all, user - only to specified users).
REPORT_SIMPLE_USERS [] No* List of users with access to simple type of report (if report_simple_type == user).
REPORT_FULL_TYPE user No Users with access to have the expanded report (all - all, user - only to specified users).
REPORT_FULL_USERS [] No* List of users with access to have the expanded report (if report_simple_type == user).

* - if you pass the parameter REPORT_REQUEST_TYPE = user (or REPORT_SIMPLE_TYPE = user, or REPORT_FULL_TYPE = user), you must correspondingly pass REPORT_REQUEST_USERS (or REPORT_SIMPLE_USERS, or REPORT_FULL_USERS).

Call example

JavaScript

BX24.callMethod('timeman.timecontrol.settings.set', {
	active: true,
	report_request_type: 'user',
	report_request_users: [1,2,3],
}, function(result){
	if(result.error())
	{
		console.error(result.error().ex);
	}
	else
	{
		console.log(result.data());
	}
});

PHP

$result = restCommand('timeman.timecontrol.settings.set', Array(
	active: true,
	report_request_type: 'user',
	report_request_users: [1,2,3],
), $_REQUEST["auth"]);

Response example

{
	"result": true
}

Response example in case of an error

{
    "error": "ACCESS_ERROR",
    "error_description": "You don't have access to user this method"
}
  • Key error - error code.
  • Key error_description - brief error description.

Possible error codes

CodeDescription
ACCESS_ERRORSpecified method is available only to the administrators.
INVALID_FORMATIncorrect format is passed in the field RANGE.


© «Bitrix24», 2001-2024