PHPのタスクリンクを使用します

Aspose.Tasks -更新されたタスクリンクデータをmppに書き込む

php Aspose.Tasks javaを使用して更新されたタスクリンクデータをMPPに書き込むには、updateTasklinkモジュールを呼び出します。ここでは、サンプルコードを見ることができます。

PHPコード

 1$ one_sec = 10000000;
 2
 3$ one_min = 60 * $ one_sec;
 4
 5$ one_hour = 60 * $ one_min;
 6
 7$ project = new Project( 'test_tasks.mpp');
 8
 9$ tsk = new tsk();
10
11$ prj = new Prj();
12
13$ task1 = $ project-> getroottask() - > getChildren() - > add( "1");
14
15$ timeUnittype = new TimeUnittype();
16
17$ task1-> set($ tsk-> duration、$ project-> getDuration(8$ timeUnittype-> hour));
18
19$ task1-> set($ tsk-> start、$ project-> get($ prj-> start_date));
20
21$ task1-> set($ tsk-> finish、$ project-> get($ prj-> calendar) - > getTaskFinishDateFromDuration($ task1、(double)(string)($ task1-> get($ tsk-> duration)));
22
23$ task2 = $ project-> getroottask() - > getChildren() - > add( "2");
24
25$ task2-> set($ tsk-> duration、$ project-> getDuration(8$ timeNittype-> hour));
26
27$ task2-> set($ tsk-> start、$ project-> get($ prj-> start_date));
28
29$ task2-> set($ tsk-> finish、$ project-> get($ prj-> calendar) - > gettaskfinishdatefromduration($ task2、(double)(string)($ task2-> get($ tsk-> duration))));
30
31$ project-> getRoottask() - > getChildren() - > add($ task1);
32
33$ project-> getroottask() - > getChildren() - > add($ task2);
34
35$ tasklinktype = new TaskLinkType();
36
37$ link1 = $ project-> getTaskLinks() - > add($ task1、$ task2、$ tasklinktype-> starttostart);
38
39$ savefileformat = new SaveFileFormat();
40
41$ project-> save( "tasklinks.mpp"$ savefileformat-> mpp);
42
43「保存されたタスクリンクデータ」を印刷します。」;

実行中のコードをダウンロード

ダウンロード更新されたタスクリンクデータをMPP(Aspose.Tasks)に書き込む以下のソーシャルコーディングサイトのいずれかから:

Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.