forked from Combodo/combodo-coverage-windows-computation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
module.combodo-coverage-windows-computation.php
executable file
·61 lines (52 loc) · 1.52 KB
/
module.combodo-coverage-windows-computation.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php
SetupWebPage::AddModule(
__FILE__,
'combodo-coverage-windows-computation/2.1.2',
array(
// Identification
//
'label' => 'Plug-in SLA computation with coverage windows for UserRequest and Incidents',
'category' => 'business',
// Setup
//
'dependencies' => array(
'combodo-sla-computation/1.0.0',
'itop-service-mgmt/2.0.0||itop-service-mgmt-provider/2.0.0',
),
'mandatory' => false,
'visible' => true,
'installer' => 'CoverageWindowComputationInstaller',
// Components
//
'datamodel' => array(
),
'webservice' => array(
),
'data.struct' => array(
),
'data.sample' => array(
),
// Documentation
//
'doc.manual_setup' => '',
'doc.more_information' => '',
// Default settings
//
'settings' => array(
),
)
);
class CoverageWindowComputationInstaller extends ModuleInstallerAPI
{
public static function BeforeWritingConfig(Config $oConfiguration)
{
$sValue = $oConfiguration->GetModuleSetting('combodo-sla-computation', 'coverage_oql', 'SELECT CoverageWindow', null);
if (($sValue === null) || ($sValue == 'SELECT CoverageWindow'))
{
// Set the value if it equals the default value, or if it is not already present
$oConfiguration->SetModuleSetting('combodo-sla-computation', 'coverage_oql', 'SELECT CoverageWindow AS cw JOIN lnkCustomerContractToService AS l1 ON l1.coveragewindow_id = cw.id JOIN CustomerContract AS cc ON l1.customercontract_id = cc.id WHERE cc.org_id= :this->org_id AND l1.service_id = :this->service_id');
}
return $oConfiguration;
}
}
?>