Skip to content

Commit 199c9b7

Browse files
[TASKSCLOUD-408] - Deployed new 20.8 version.
1 parent b86dce7 commit 199c9b7

File tree

10 files changed

+116
-31
lines changed

10 files changed

+116
-31
lines changed

src/Aspose/Tasks/Configuration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ class Configuration
135135
* Version of Aspose.Tasks Cloud API
136136
*
137137
*/
138-
protected $clientVersion = '20.6';
138+
protected $clientVersion = '20.8';
139139

140140
/*
141141
* Constructor

src/Aspose/Tasks/Model/Requests/CreateNewProjectRequest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class CreateNewProjectRequest
3737
* Initializes a new instance of the CreateNewProjectRequest class.
3838
*
3939
* @param string $name The file name
40-
* @param string $site_url The url of sharepoint site. For example, "https://your_company_name.sharepoint.com"
40+
* @param string $site_url The URL of PWA (Project Web Access) API of Project Online
4141
* @param string $user_name The user name for the sharepoint site
4242
* @param \Aspose\Tasks\Model\ProjectServerSaveOptionsDTO $save_options Dispensable save options for Project Server\Project Online
4343
* @param string $folder The document storage
@@ -73,7 +73,7 @@ public function __construct($name, $site_url, $save_options = null, $folder = nu
7373
public $folder;
7474

7575
/*
76-
* The url of sharepoint site. For example, "https://your_company_name.sharepoint.com"
76+
* The URL of PWA (Project Web Access) API of Project Online
7777
*/
7878
public $site_url;
7979

src/Aspose/Tasks/Model/Requests/GetProjectListRequest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class GetProjectListRequest
3737
/*
3838
* Initializes a new instance of the GetProjectListRequest class.
3939
*
40-
* @param string $site_url The url of sharepoint site.
40+
* @param string $site_url The URL of PWA (Project Web Access) API of Project Online.
4141
* @param string $token Authorization token for the SharePoint.
4242
* @param string $user_name The user name for the sharepoint site
4343
* @param string $x_sharepoint_password The password for the SharePoint site.
@@ -51,7 +51,7 @@ public function __construct($site_url, $token = null, $user_name = null, $x_shar
5151
}
5252

5353
/*
54-
* The url of sharepoint site. For example, "https://your_company_name.sharepoint.com".
54+
* The URL of PWA (Project Web Access) API of Project Online.
5555
*/
5656
public $site_url;
5757

src/Aspose/Tasks/Model/Requests/PutImportFromProjectOnlineRequest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class PutImportFromProjectOnlineRequest
3636
* Initializes a new instance of the PutImportFromProjectOnlineRequest class.
3737
*
3838
* @param string $name The name of the resulting file.
39-
* @param string $site_url The url of sharepoint site. For example, "https://your_company_name.sharepoint.com"
39+
* @param string $site_url The URL of PWA (Project Web Access) API of Project Online
4040
* @param string $guid Guid of the project to import.
4141
* @param string $token Authorization token for the SharePoint.
4242
* @param string $format Format of the resulting file.
@@ -62,7 +62,7 @@ public function __construct($name, $site_url, $guid, $token = null, $user_name =
6262
public $name;
6363

6464
/*
65-
* The url of sharepoint site. For example, "https://your_company_name.sharepoint.com"
65+
* The URL of PWA (Project Web Access) API of Project Online
6666
*/
6767
public $site_url;
6868

src/Aspose/Tasks/Model/Requests/UpdateProjectRequest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class UpdateProjectRequest
3737
* Initializes a new instance of the UpdateProjectRequest class.
3838
*
3939
* @param string $name The file name
40-
* @param string $site_url The url of sharepoint site. For example, "https://your_company_name.sharepoint.com"
40+
* @param string $site_url The URL of PWA (Project Web Access) API of Project Online
4141
* @param string $user_name The user name for the sharepoint site
4242
* @param \Aspose\Tasks\Model\ProjectServerSaveOptionsDTO $save_options Dispensable save options for Project Server\Project Online
4343
* @param string $folder The document storage
@@ -73,7 +73,7 @@ public function __construct($name, $site_url, $save_options = null, $folder = nu
7373
public $folder;
7474

7575
/*
76-
* The url of sharepoint site. For example, "https://your_company_name.sharepoint.com"
76+
* The URL of PWA (Project Web Access) API of Project Online
7777
*/
7878
public $site_url;
7979

src/Aspose/Tasks/Model/ResourceAssignment.php

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@ class ResourceAssignment implements ArrayAccess
120120
'budget_work' => 'string',
121121
'rate_scale' => '\Aspose\Tasks\Model\RateScaleType',
122122
'baselines' => '\Aspose\Tasks\Model\AssignmentBaseline[]',
123-
'extended_attributes' => '\Aspose\Tasks\Model\ExtendedAttribute[]'
123+
'extended_attributes' => '\Aspose\Tasks\Model\ExtendedAttribute[]',
124+
'timephased_data' => '\Aspose\Tasks\Model\TimephasedData[]'
124125
];
125126

126127
/*
@@ -193,7 +194,8 @@ class ResourceAssignment implements ArrayAccess
193194
'budget_work' => 'time-span',
194195
'rate_scale' => null,
195196
'baselines' => null,
196-
'extended_attributes' => null
197+
'extended_attributes' => null,
198+
'timephased_data' => null
197199
];
198200

199201
/*
@@ -287,7 +289,8 @@ public static function swaggerFormats()
287289
'budget_work' => 'BudgetWork',
288290
'rate_scale' => 'RateScale',
289291
'baselines' => 'Baselines',
290-
'extended_attributes' => 'ExtendedAttributes'
292+
'extended_attributes' => 'ExtendedAttributes',
293+
'timephased_data' => 'TimephasedData'
291294
];
292295

293296
/*
@@ -360,7 +363,8 @@ public static function swaggerFormats()
360363
'budget_work' => 'setBudgetWork',
361364
'rate_scale' => 'setRateScale',
362365
'baselines' => 'setBaselines',
363-
'extended_attributes' => 'setExtendedAttributes'
366+
'extended_attributes' => 'setExtendedAttributes',
367+
'timephased_data' => 'setTimephasedData'
364368
];
365369

366370
/*
@@ -433,7 +437,8 @@ public static function swaggerFormats()
433437
'budget_work' => 'getBudgetWork',
434438
'rate_scale' => 'getRateScale',
435439
'baselines' => 'getBaselines',
436-
'extended_attributes' => 'getExtendedAttributes'
440+
'extended_attributes' => 'getExtendedAttributes',
441+
'timephased_data' => 'getTimephasedData'
437442
];
438443

439444
/*
@@ -561,6 +566,7 @@ public function __construct(array $data = null)
561566
$this->container['rate_scale'] = isset($data['rate_scale']) ? $data['rate_scale'] : null;
562567
$this->container['baselines'] = isset($data['baselines']) ? $data['baselines'] : null;
563568
$this->container['extended_attributes'] = isset($data['extended_attributes']) ? $data['extended_attributes'] : null;
569+
$this->container['timephased_data'] = isset($data['timephased_data']) ? $data['timephased_data'] : null;
564570
}
565571

566572
/*
@@ -2436,6 +2442,28 @@ public function setRateScale($rate_scale)
24362442
return $this;
24372443
}
24382444

2445+
/*
2446+
* Gets timephased_data
2447+
*
2448+
* @return \Aspose\Tasks\Model\TimephasedData[]
2449+
*/
2450+
public function getTimephasedData()
2451+
{
2452+
return $this->container['timephased_data'];
2453+
}
2454+
2455+
/*
2456+
* Sets timephased_data
2457+
*
2458+
* @param \Aspose\Tasks\Model\TimephasedData[] $timephased_data Collection of TimephasedData objects.
2459+
*/
2460+
public function setTimephasedData($timephased_data)
2461+
{
2462+
$this->container['timephased_data'] = $timephased_data;
2463+
2464+
return $this;
2465+
}
2466+
24392467
/*
24402468
* Gets baselines
24412469
*

src/Aspose/Tasks/TasksApi.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22768,7 +22768,7 @@ private function _uploadFileRequest($path, $file, $storage_name = null)
2276822768

2276922769
$query = \GuzzleHttp\Psr7\build_query($queryParams);
2277022770
return new Request(
22771-
'POST',
22771+
'PUT',
2277222772
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
2277322773
$headers,
2277422774
$httpBody

tests/Aspose/Tasks/Assignments/AssignmentsTest.php

Lines changed: 65 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
use Aspose\Tasks\Model\Requests;
3131
use PHPUnit\Framework\Assert;
3232
use Aspose\Tasks\Model\CalculationMode;
33+
use Aspose\Tasks\Model;
3334

3435
class AssignmentsTest extends BaseTestContext
3536
{
@@ -131,31 +132,87 @@ public function testGetResourceAssignments()
131132
Assert::assertEquals(1, $assignment->getResourceUid());
132133
}
133134
}
134-
135+
135136
public function testEditAssignment()
136137
{
137138
$remoteName = "testEditAssignment.mpp";
138139
$folder = $this->uploadTestFile("NewProductDev.mpp", $remoteName, '');
139-
140+
140141
$response = $this->tasks->getAssignment(new Requests\GetAssignmentRequest($remoteName, 63, self::$storageName, $folder));
141-
142+
142143
Assert::assertEquals(200, $response->getCode());
143144
Assert::assertNotNull($response->getAssignment());
144145
Assert::assertEquals(34, $response->getAssignment()->getTaskUid());
145-
146+
146147
$assignment = $response->getAssignment();
147148
$assignment->setTaskUid(0);
148-
149+
149150
$putResponse = $this->tasks->putAssignment(new Requests\PutAssignmentRequest($remoteName, 63, $assignment, CalculationMode::AUTOMATIC, true, self::$storageName, $folder, null));
150-
151+
151152
Assert::assertEquals(200, $putResponse->getCode());
152-
153+
153154
$response = $this->tasks->getAssignment(new Requests\GetAssignmentRequest($remoteName, 63, self::$storageName, $folder));
154-
155+
155156
Assert::assertEquals(200, $response->getCode());
156157
Assert::assertNotNull($response->getAssignment());
157158
Assert::assertEquals(0, $response->getAssignment()->getTaskUid());
158159
}
160+
161+
public function testEditAssignmentWithTimephasedDataAndBaselines()
162+
{
163+
$remoteName = "testEditAssignmentWithTimephasedDataAndBaselines.mpp";
164+
$folder = $this->uploadTestFile("sample.mpp", $remoteName, '');
165+
166+
$response = $this->tasks->getAssignment(new Requests\GetAssignmentRequest($remoteName, 1, self::$storageName, $folder));
167+
168+
Assert::assertEquals(200, $response->getCode());
169+
$assignment = $response->getAssignment();
170+
$assignment->setCost(100);
171+
$assignment->setStart(new DateTime("2001-10-10T00:00:00"));
172+
$assignment->setFinish(new DateTime("2002-10-10T00:00:00"));
173+
$assignmentBaseline = new Model\AssignmentBaseline();
174+
$assignmentBaseline->setStart(new DateTime("2002-10-10T00:00:00"));
175+
$assignment->setBaselines(array($assignmentBaseline));
176+
$assignment->setActualWork("10:10:10");
177+
$assignment->setActualCost(100);
178+
$assignment->setActualStart(new DateTime("2001-10-10T00:00:00"));
179+
$assignment->setActualFinish(new DateTime("2002-10-10T00:00:00"));
180+
$assignment->setActualOvertimeWork("100:10:10");
181+
$assignment->setWork("80:0:0");
182+
$assignment->setUid(1);
183+
$assignment->setVac(10);
184+
$assignment->setWorkContour(Model\WorkContourType::CONTOURED);
185+
$timephasedData = new Model\TimephasedData();
186+
$timephasedData->setUid($assignment->getUid());
187+
$timephasedData->setStart(new DateTime("2001-10-10T09:00:00"));
188+
$timephasedData->setFinish(new DateTime("2001-10-10T14:00:00"));
189+
$timephasedData->setUnit(Model\TimeUnitType::HOUR);
190+
$timephasedData->setValue("4:0:0");
191+
$timephasedData->setTimephasedDataType(Model\TimephasedDataType::ASSIGNMENT_REMAINING_WORK);
192+
$assignment->setTimephasedData(array($timephasedData));
193+
194+
$putResponse = $this->tasks->putAssignment(new Requests\PutAssignmentRequest($remoteName, 1, $assignment, CalculationMode::NONE, false, self::$storageName, $folder, null));
195+
196+
Assert::assertEquals(200, $putResponse->getCode());
197+
Assert::assertEquals($assignment->getUid(), $putResponse->getAssignment()->getUid());
198+
Assert::assertEquals($assignment->getVac(), $putResponse->getAssignment()->getVac());
199+
Assert::assertEquals($assignment->getCost(), $putResponse->getAssignment()->getCost());
200+
Assert::assertEquals($assignment->getStart(), $putResponse->getAssignment()->getStart());
201+
Assert::assertEquals($assignment->getFinish(), $putResponse->getAssignment()->getFinish());
202+
Assert::assertEquals("80.00:00:00", $putResponse->getAssignment()->getWork());
203+
Assert::assertEquals($assignment->getActualWork(), $putResponse->getAssignment()->getActualWork());
204+
Assert::assertEquals($assignment->getActualStart(), $putResponse->getAssignment()->getActualStart());
205+
Assert::assertEquals($assignment->getActualFinish(), $putResponse->getAssignment()->getActualFinish());
206+
Assert::assertEquals("100.10:10:00", $putResponse->getAssignment()->getActualOvertimeWork());
207+
Assert::assertEquals(1, count($putResponse->getAssignment()->getBaselines()));
208+
Assert::assertEquals($assignmentBaseline->getStart(), $putResponse->getAssignment()->getBaselines()[0]->getStart());
209+
Assert::assertEquals(1, count($putResponse->getAssignment()->getTimephasedData()));
210+
Assert::assertEquals($timephasedData->getUid(), $putResponse->getAssignment()->getTimephasedData()[0]->getUid());
211+
Assert::assertEquals("PT4H0M0S", $putResponse->getAssignment()->getTimephasedData()[0]->getValue());
212+
Assert::assertEquals($timephasedData->getStart(), $putResponse->getAssignment()->getTimephasedData()[0]->getStart());
213+
Assert::assertEquals($timephasedData->getFinish(), $putResponse->getAssignment()->getTimephasedData()[0]->getFinish());
214+
Assert::assertEquals($timephasedData->getTimephasedDataType(), $putResponse->getAssignment()->getTimephasedData()[0]->getTimephasedDataType());
215+
}
159216

160217

161218
public function testDeleteAssignment()

tests/Aspose/Tasks/Project/ImportProjectTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public function testImportFromProjectOnlineByTokenCredentials()
8383
$remoteName = "testImportFromProjectOnline.pdf";
8484

8585
$response = $this->tasks->putImportFromProjectOnline(new Requests\PutImportFromProjectOnlineRequest($remoteName,
86-
"your_company_name.sharepoint.com",
86+
"http://project_server_instance.local/sites/pwa",
8787
"262e5ead-1048-4a26-b558-c5eab06bcc5b",
8888
"SOMESECRETTOKEN",
8989
null,
@@ -104,7 +104,7 @@ public function testImportFromProjectOnlineByLoginAndPasswordCredentials()
104104
$remoteName = "testImportFromProjectOnline.pdf";
105105

106106
$response = $this->tasks->putImportFromProjectOnline(new Requests\PutImportFromProjectOnlineRequest($remoteName,
107-
"your_company_name.sharepoint.com",
107+
"http://project_server_instance.local/sites/pwa",
108108
"262e5ead-1048-4a26-b558-c5eab06bcc5b",
109109
null,
110110
"SomeLogin",

tests/Aspose/Tasks/ProjectOnline/ProjectOnlineTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function testGetProjectListByTokenCredential()
4141
static::markTestSkipped('Ignored because real credentials for project server online is required');
4242

4343
$response = $this->tasks->getProjectList(new GetProjectListRequest
44-
('https://your_company_name.sharepoint.com', 'SOMESECRETTOKEN'));
44+
('http://project_server_instance.local/sites/pwa', 'SOMESECRETTOKEN'));
4545

4646
Assert::assertEquals(200, $response->getCode());
4747
Assert::assertNotEmpty($response->getProjects());
@@ -52,7 +52,7 @@ public function testGetProjectListByLoginAndPasswordCredentials()
5252
static::markTestSkipped('Ignored because real credentials for project server online is required');
5353

5454
$response = $this->tasks->getProjectList(new GetProjectListRequest
55-
('https://your_company_name.sharepoint.com', null, 'SomeLogin', 'SomePassword'));
55+
('http://project_server_instance.local/sites/pwa', null, 'SomeLogin', 'SomePassword'));
5656

5757
Assert::assertEquals(200, $response->getCode());
5858
Assert::assertNotEmpty($response->getProjects());
@@ -66,7 +66,7 @@ public function testCreateNewProjectByTokenCredential()
6666
$folder = $this->uploadTestFile("NewProductDev.mpp", $remoteName, '');
6767

6868
$response = $this->tasks->createNewProject(new CreateNewProjectRequest
69-
($remoteName, 'https://your_company_name.sharepoint.com', null, $folder, self::$storageName, 'SOMESECRETTOKEN'));
69+
($remoteName, 'http://project_server_instance.local/sites/pwa', null, $folder, self::$storageName, 'SOMESECRETTOKEN'));
7070

7171
Assert::assertEquals(200, $response->getCode());
7272
}
@@ -79,7 +79,7 @@ public function testCreateNewProjectByLoginAndPasswordCredentials()
7979
$folder = $this->uploadTestFile("NewProductDev.mpp", $remoteName, '');
8080

8181
$response = $this->tasks->createNewProject(new CreateNewProjectRequest
82-
($remoteName, 'https://your_company_name.sharepoint.com', null, $folder, self::$storageName, null, 'SomeLogin', 'SomePassword'));
82+
($remoteName, 'http://project_server_instance.local/sites/pwa', null, $folder, self::$storageName, null, 'SomeLogin', 'SomePassword'));
8383

8484
Assert::assertEquals(200, $response->getCode());
8585
}
@@ -92,7 +92,7 @@ public function testUpdateProjectByTokenCredential()
9292
$folder = $this->uploadTestFile("NewProductDev.mpp", $remoteName, '');
9393

9494
$response = $this->tasks->updateProject(new UpdateProjectRequest
95-
($remoteName, 'https://your_company_name.sharepoint.com', null, $folder, self::$storageName, 'SOMESECRETTOKEN'));
95+
($remoteName, 'http://project_server_instance.local/sites/pwa', null, $folder, self::$storageName, 'SOMESECRETTOKEN'));
9696

9797
Assert::assertEquals(200, $response->getCode());
9898
}
@@ -105,7 +105,7 @@ public function testUpdateProjectByLoginAndPasswordCredentials()
105105
$folder = $this->uploadTestFile("NewProductDev.mpp", $remoteName, '');
106106

107107
$response = $this->tasks->updateProject(new UpdateProjectRequest
108-
($remoteName, 'https://your_company_name.sharepoint.com', null, $folder, self::$storageName, null, 'SomeLogin', 'SomePassword'));
108+
($remoteName, 'http://project_server_instance.local/sites/pwa', null, $folder, self::$storageName, null, 'SomeLogin', 'SomePassword'));
109109

110110
Assert::assertEquals(200, $response->getCode());
111111
}

0 commit comments

Comments
 (0)