Read a Task's Timephased Data in PHP
Contents
[
Hide
Show
]Aspose.Tasks - Read a Task’s Timephased Data
To read a Task’s Timephased Data using Aspose.Tasks Java for PHP, simply invoke GetTaskTimephasedData module. Here you can see example code.
PHP Code
1$project = new Project('test_tasks.mpp');
2$prj = new Prj();
3$tsk = new Tsk();
4$cal = new Calendar();
5$cal = $cal->getInstance();
6$cal->set(2013,7,17,8,0,0);
7$project->set($prj->START_DATE, $cal->getTime());
8$project->set($prj->NEW_TASKS_ARE_MANUAL, new NullableBool(false));
9$task = $project->getRootTask()->getChildren()->add("Task");
10$rsc = $project->getResources()->add("Rsc");
11$resource = new Rsc();
12$bigDecimal = new BigDecimal();
13$rsc->set($resource->STANDARD_RATE, $bigDecimal->valueOf(10));
14$rsc->set($resource->OVERTIME_RATE, $bigDecimal->valueOf(15));
15$task->set($tsk->DURATION, $project->getDuration(6));
16$assignment = $project->getResourceAssignments()->add($task, $rsc);
17$d = new Date(0);
18$assignment = new Asn();
19$assignment->set($assignment->STOP, new Date(0));
20$assignment->set($assignment->RESUME, new Date(0));
21$workContourType = new WorkContourType();
22$assignment->set($assignment->WORK_CONTOUR, $workContourType->BackLoaded);
23$baselineType = new BaselineType();
24$project->setBaseline($baselineType->Baseline);
25$task->set($tsk->PERCENT_COMPLETE, 50);
26$timephasedDataType = new TimephasedDataType();
27$td = $assignment->getTimephasedData($assignment->get($assignment->START),
28$assignment->get($assignment->FINISH),
29$timephasedDataType->AssignmentRemainingWork)->toList();
30print "Size: " . (string)$td->size();
31print "\nValue: " . (string)$td->get(0)->getValue();
Download Running Code
Download Read a Task’s Timephased Data (Aspose.Tasks) from any of the below mentioned social coding sites: