Documentation

ServiceContracts
in package

Service contracts utils class.

Table of Contents

$fieldsMap  : array<string|int, string>
Fields map.
businessTime()  : int
Get the amount of business time between two dates in minutes.
deleteSlaPolicy()  : void
Delete sla policy for service contracts.
getAllBusinessHours()  : array<string|int, mixed>
Get all business hours.
getBusinessHoursByIds()  : array<string|int, mixed>
Get business hours by ids .
getDefaultBusinessHours()  : array<string|int, mixed>
Get default business hours.
getDiff()  : int
Function returning difference in format between date times.
getDiffFromDefaultBusinessHours()  : int
Get the amount of default business time between two dates in minutes.
getDiffFromServiceContracts()  : int
Get the amount of business time between the two dates in minutes based on the service contracts.
getDiffFromSlaPolicy()  : int|null
Get the amount of business time between the two dates in minutes based on the global sla policy.
getModules()  : array<string|int, string>
Get modules name related to ServiceContracts.
getRulesForServiceContracts()  : array<string|int, mixed>
Get rules for service contracts.
getSlaPolicyByModule()  : array<string|int, mixed>
Get sla policy by module id.
getSlaPolicyForModule()  : array<string|int, mixed>
Get sla policy by crm id.
getSlaPolicyForServiceContracts()  : array<string|int, mixed>
Get sla policy from service contracts by crm id.
getSlaPolicyRulesForModule()  : array<string|int, mixed>
Get rules for record model which will be updated.
saveSlaPolicy()  : void
Save sla policy for service contracts.
updateExpectedTimes()  : void
Update expected times.
getExpectedTimes()  : array<string|int, mixed>
Get expected times from ServiceContracts.
getNextBusinessDay()  : array<string|int, mixed>|null
Get next business day.
getSlaPolicyById()  : array<string|int, mixed>
Get sla policy by id.
optimizeBusinessHours()  : array<string|int, mixed>
Undocumented function.
parseBusinessHoursToDays()  : array<string|int, mixed>
Parse business hours to days.

Properties

$fieldsMap

Fields map.

private static array<string|int, string> $fieldsMap = ['reaction_time' => 'response', 'resolve_time' => 'solution', 'idle_time' => 'idle']

Methods

businessTime()

Get the amount of business time between two dates in minutes.

public static businessTime(string $start, string $end, string $startHour, string $endHour, array<string|int, mixed> $days, bool $holidays) : int
Parameters
$start : string
$end : string
$startHour : string
$endHour : string
$days : array<string|int, mixed>
$holidays : bool
Return values
int —

deleteSlaPolicy()

Delete sla policy for service contracts.

public static deleteSlaPolicy(int $crmId, int $sourceModuleId[, int|null $rowId = null ]) : void
Parameters
$crmId : int
$sourceModuleId : int
$rowId : int|null = null
Return values
void —

getAllBusinessHours()

Get all business hours.

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

getBusinessHoursByIds()

Get business hours by ids .

public static getBusinessHoursByIds(string $ids) : array<string|int, mixed>
Parameters
$ids : string

ex. '1,2'

Return values
array<string|int, mixed> —

getDefaultBusinessHours()

Get default business hours.

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

getDiff()

Function returning difference in format between date times.

public static getDiff(string $start, Vtiger_Record_Model $recordModel[, string $end = '' ]) : int
Parameters
$start : string
$recordModel : Vtiger_Record_Model

Record the model that will be updated

$end : string = ''
Return values
int —

getDiffFromDefaultBusinessHours()

Get the amount of default business time between two dates in minutes.

public static getDiffFromDefaultBusinessHours(string $start, string $end) : int
Parameters
$start : string
$end : string
Return values
int —

getDiffFromServiceContracts()

Get the amount of business time between the two dates in minutes based on the service contracts.

public static getDiffFromServiceContracts(string $start, string $end, int $serviceContractId, Vtiger_Record_Model $recordModel) : int
Parameters
$start : string
$end : string
$serviceContractId : int

Service contracts id

$recordModel : Vtiger_Record_Model

Record the model that will be updated

Return values
int —

getDiffFromSlaPolicy()

Get the amount of business time between the two dates in minutes based on the global sla policy.

public static getDiffFromSlaPolicy(string $start, string $end, Vtiger_Record_Model $recordModel) : int|null
Parameters
$start : string
$end : string
$recordModel : Vtiger_Record_Model

Record the model that will be updated

Return values
int|null —

getModules()

Get modules name related to ServiceContracts.

public static getModules() : array<string|int, string>
Return values
array<string|int, string> —

getRulesForServiceContracts()

Get rules for service contracts.

public static getRulesForServiceContracts(int $serviceContractId, Vtiger_Record_Model $recordModel) : array<string|int, mixed>
Parameters
$serviceContractId : int

Service contracts id

$recordModel : Vtiger_Record_Model

Record the model that will be updated

Return values
array<string|int, mixed> —

getSlaPolicyByModule()

Get sla policy by module id.

public static getSlaPolicyByModule(int $moduleId) : array<string|int, mixed>
Parameters
$moduleId : int
Return values
array<string|int, mixed> —

getSlaPolicyForModule()

Get sla policy by crm id.

public static getSlaPolicyForModule(int $moduleId) : array<string|int, mixed>
Parameters
$moduleId : int
Return values
array<string|int, mixed> —

getSlaPolicyForServiceContracts()

Get sla policy from service contracts by crm id.

public static getSlaPolicyForServiceContracts(int $serviceContractId[, int|null $sourceModuleId = null ]) : array<string|int, mixed>
Parameters
$serviceContractId : int

Service contracts id

$sourceModuleId : int|null = null
Return values
array<string|int, mixed> —

getSlaPolicyRulesForModule()

Get rules for record model which will be updated.

public static getSlaPolicyRulesForModule(Vtiger_Record_Model $recordModel) : array<string|int, mixed>
Parameters
$recordModel : Vtiger_Record_Model

Record the model that will be updated

Return values
array<string|int, mixed> —

saveSlaPolicy()

Save sla policy for service contracts.

public static saveSlaPolicy(array<string|int, mixed> $data[, bool $delete = true ]) : void
Parameters
$data : array<string|int, mixed>
$delete : bool = true
Return values
void —

getExpectedTimes()

Get expected times from ServiceContracts.

private static getExpectedTimes(int $id, Vtiger_Record_Model $recordModel, array<string|int, mixed> $type) : array<string|int, mixed>
Parameters
$id : int

Service contract id

$recordModel : Vtiger_Record_Model
$type : array<string|int, mixed>
Return values
array<string|int, mixed> —

getNextBusinessDay()

Get next business day.

private static getNextBusinessDay(DateTime &$date, array<string|int, mixed> $days) : array<string|int, mixed>|null
Parameters
$date : DateTime
$days : array<string|int, mixed>
Return values
array<string|int, mixed>|null —

getSlaPolicyById()

Get sla policy by id.

private static getSlaPolicyById(int $id) : array<string|int, mixed>
Parameters
$id : int
Return values
array<string|int, mixed> —

optimizeBusinessHours()

Undocumented function.

private static optimizeBusinessHours(array<string|int, mixed> $businessHours) : array<string|int, mixed>
Parameters
$businessHours : array<string|int, mixed>
Return values
array<string|int, mixed> —

parseBusinessHoursToDays()

Parse business hours to days.

private static parseBusinessHoursToDays(array<string|int, mixed> $rows) : array<string|int, mixed>
Parameters
$rows : array<string|int, mixed>
Return values
array<string|int, mixed> —

        

Search results