Bitrix API

Efficiency extends Effective uses EfficiencyTrait

Class Effective

Table of Contents

Methods

__construct()  : mixed
agent()  : string
checkActiveViolations()  : array<string|int, mixed>
Checks if not repaired violations exists for task/user/group separately or in some combination.
createAgentForNextEfficiencyRecount()  : mixed
Creates agent for next efficiency recount
disableCache()  : static
get()  : int
getAverageEfficiency()  : int
Returns average efficiency for given dates.
getAverageEfficiencyForGroups()  : array<string|int, mixed>
getCountersByRange()  : array<string|int, mixed>
Returns count of violations, completed tasks and tasks in progress for given dates range.
getDatesRange()  : array<string|int, mixed>
Returns dates of current month borders (current month is used as default for now)
getEfficiencyForGraph()  : array<string|int, mixed>
Returns grouped data of average efficiency for graph building
getEfficiencyForNow()  : float|int
getEfficiencyFromUserCounter()  : bool|int
Returns value of efficiency user counter
getFilterId()  : string
Returns filter id on efficiency page
getFirstRecordTime()  : bool|DateTime
Returns time of first added efficiency record or false if it doesn't exist.
getPresetList()  : array<string|int, mixed>
Returns list of default presets
getViolationsCount()  : mixed
invalidate()  : void
isEnabled()  : bool
load()  : void
modify()  : bool
Modifies user efficiency. Also recounts efficiency user counter after modification if needed.
recountEfficiencyUserCounter()  : mixed
Recounts efficiency user counter
repair()  : bool
Repairs violations
runEfficiencyRecount()  : mixed
Starts efficiency recount
setEfficiencyToUserCounter()  : bool
Sets efficiency for efficiency user counter

Methods

agent()

public static agent([string $date = '' ]) : string
Parameters
$date : string = ''
Tags
throws
Exception
throws
SqlQueryException
throws
ObjectException
Return values
string

checkActiveViolations()

Checks if not repaired violations exists for task/user/group separately or in some combination.

public static checkActiveViolations([null $taskId = null ][, null $userId = null ][, null $groupId = null ]) : array<string|int, mixed>
Parameters
$taskId : null = null
$userId : null = null
$groupId : null = null
Tags
throws
ArgumentException
throws
ObjectPropertyException
throws
SystemException
Return values
array<string|int, mixed>

createAgentForNextEfficiencyRecount()

Creates agent for next efficiency recount

public static createAgentForNextEfficiencyRecount() : mixed
Tags
throws
Exception

disableCache()

public disableCache([bool $disable = true ]) : static
Parameters
$disable : bool = true
Return values
static

get()

public get(int $flowId) : int
Parameters
$flowId : int
Return values
int

getAverageEfficiency()

Returns average efficiency for given dates.

public static getAverageEfficiency([DateTime|null $dateFrom = null ][, DateTime|null $dateTo = null ][, int $userId = 0 ][, int $groupId = 0 ]) : int

If at least one of dates is not set, it will try to take the dates from the filter preset user pinned as default. If filter options were not set in b_user_options for some reason and we still haven't dates, it will take the default dates from static::getDatesRange(). For now they are borders of current month.

Parameters
$dateFrom : DateTime|null = null
$dateTo : DateTime|null = null
$userId : int = 0
$groupId : int = 0
Tags
throws
ArgumentException
throws
ObjectPropertyException
throws
SystemException
Return values
int

getAverageEfficiencyForGroups()

public static getAverageEfficiencyForGroups([DateTime $dateFrom = null ][, DateTime $dateTo = null ][, int $userId = 0 ][, array<string|int, mixed> $groupIds = [] ]) : array<string|int, mixed>
Parameters
$dateFrom : DateTime = null
$dateTo : DateTime = null
$userId : int = 0
$groupIds : array<string|int, mixed> = []
Return values
array<string|int, mixed>

getCountersByRange()

Returns count of violations, completed tasks and tasks in progress for given dates range.

public static getCountersByRange(DateTime $dateFrom, DateTime $dateTo[, int $userId = 0 ][, int $groupId = 0 ]) : array<string|int, mixed>
Parameters
$dateFrom : DateTime
$dateTo : DateTime
$userId : int = 0
$groupId : int = 0
Tags
throws
ArgumentException
throws
ObjectPropertyException
throws
SystemException
Return values
array<string|int, mixed>

getDatesRange()

Returns dates of current month borders (current month is used as default for now)

public static getDatesRange() : array<string|int, mixed>
Tags
throws
ObjectException
Return values
array<string|int, mixed>

getEfficiencyForGraph()

Returns grouped data of average efficiency for graph building

public static getEfficiencyForGraph([DateTime|null $timeFrom = null ][, DateTime|null $timeTo = null ][, int $userId = 0 ][, int $groupId = 0 ][, string $groupBy = 'DATE' ]) : array<string|int, mixed>
Parameters
$timeFrom : DateTime|null = null
$timeTo : DateTime|null = null
$userId : int = 0
$groupId : int = 0
$groupBy : string = 'DATE'
Tags
throws
ArgumentException
throws
ObjectPropertyException
throws
SystemException
Return values
array<string|int, mixed>

getEfficiencyForNow()

public static getEfficiencyForNow(mixed $userId[, int $groupId = 0 ]) : float|int
Parameters
$userId : mixed
$groupId : int = 0
Tags
throws
ArgumentException
throws
ObjectPropertyException
throws
SystemException
Return values
float|int

getEfficiencyFromUserCounter()

Returns value of efficiency user counter

public static getEfficiencyFromUserCounter(mixed $userId) : bool|int
Parameters
$userId : mixed
Return values
bool|int

getFilterId()

Returns filter id on efficiency page

public static getFilterId() : string
Return values
string

getFirstRecordTime()

Returns time of first added efficiency record or false if it doesn't exist.

public static getFirstRecordTime() : bool|DateTime
Tags
throws
ArgumentException
throws
ObjectPropertyException
throws
SystemException
Return values
bool|DateTime

getPresetList()

Returns list of default presets

public static getPresetList() : array<string|int, mixed>
Return values
array<string|int, mixed>

getViolationsCount()

public static getViolationsCount(DateTime $dateFrom, DateTime $dateTo, mixed $userId, mixed $groupId) : mixed
Parameters
$dateFrom : DateTime
$dateTo : DateTime
$userId : mixed
$groupId : mixed
Tags
throws
ArgumentException
throws
ObjectPropertyException
throws
SystemException

invalidate()

public invalidate(int $flowId) : void
Parameters
$flowId : int

isEnabled()

public static isEnabled() : bool
Return values
bool

load()

public load(int ...$flowIds) : void
Parameters
$flowIds : int
Tags
throws
ObjectPropertyException
throws
SystemException
throws
ArgumentException

modify()

Modifies user efficiency. Also recounts efficiency user counter after modification if needed.

public static modify(int $userId, string $userType, array<string|int, mixed> $taskData[, int $groupId = 0 ][, bool|null $isViolation = null ][, bool $recountEfficiency = true ]) : bool
Parameters
$userId : int
$userType : string
$taskData : array<string|int, mixed>
$groupId : int = 0
$isViolation : bool|null = null
$recountEfficiency : bool = true
Tags
throws
ArgumentException
throws
ObjectException
throws
ObjectPropertyException
throws
SystemException
Return values
bool

recountEfficiencyUserCounter()

Recounts efficiency user counter

public static recountEfficiencyUserCounter(mixed $userId) : mixed
Parameters
$userId : mixed
Tags
throws
ArgumentException
throws
ObjectPropertyException
throws
SystemException

repair()

Repairs violations

public static repair(mixed $taskId[, int $userId = 0 ][, string $userType = 'R' ]) : bool
Parameters
$taskId : mixed
$userId : int = 0
$userType : string = 'R'
Tags
throws
SqlQueryException
Return values
bool

runEfficiencyRecount()

Starts efficiency recount

public static runEfficiencyRecount() : mixed
Tags
throws
ArgumentOutOfRangeException

setEfficiencyToUserCounter()

Sets efficiency for efficiency user counter

public static setEfficiencyToUserCounter(mixed $userId, mixed $efficiency) : bool
Parameters
$userId : mixed
$efficiency : mixed
Return values
bool

        
On this page

Search results