/
FiscalYearProperties.php
51 lines (36 loc) · 1.64 KB
/
FiscalYearProperties.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
<?php
namespace Aspose\Tasks\WorkingWithProjects;
use com\aspose\tasks\Project as Project;
use com\aspose\tasks\Prj as Prj;
use com\aspose\tasks\Month as Month;
use com\aspose\tasks\NullableBool as NullableBool;
use com\aspose\tasks\SaveFileFormat as SaveFileFormat;
class FiscalYearProperties{
public static function run($dataDir=null){
# Reading Fiscal Year Properties
FiscalYearProperties::get_fiscal_year_properties($dataDir);
# Writing Fiscal Year Properties
FiscalYearProperties::set_fiscal_year_properties($dataDir);
}
public static function get_fiscal_year_properties($dataDir=null){
# Instantiate project object
$project = new Project($dataDir . 'test_tasks.mpp');
$prj = new Prj();
# Display fiscal year properties
print "Fiscal Year Start Date : " . (string)$project->get($prj->FY_START_DATE).PHP_EOL;//.toString();
print "Fiscal Year Numbering : " . (string)$project->get($prj->FISCAL_YEAR_START).PHP_EOL;//.toString()
}
public static function set_fiscal_year_properties($dataDir=null){
# Instantiate project object
$project = new Project();
$prj = new Prj();
# Set fiscal year properties
$month=new Month();
$project->set($prj->FY_START_DATE, $month->July);
$project->set($prj->FISCAL_YEAR_START, new NullableBool(true));
$saveFileFormat=new SaveFileFormat();
$project->save($dataDir . "fiscal_year_properties.xml", $saveFileFormat->XML);
print "Set fiscal year properties, please check the output file.".PHP_EOL;
}
}
?>