|
@@ -4,6 +4,8 @@
|
|
|
* @var int $id
|
|
* @var int $id
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
|
|
+use Carbon\CarbonImmutable;
|
|
|
|
|
+
|
|
|
$project = Project::get($id);
|
|
$project = Project::get($id);
|
|
|
if(!$project) {
|
|
if(!$project) {
|
|
|
throw new RuntimeException("Project not found.");
|
|
throw new RuntimeException("Project not found.");
|
|
@@ -73,9 +75,16 @@ if($action) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// OK at this point
|
|
// OK at this point
|
|
|
|
|
+ $dt_new_due = CarbonImmutable::now(TIMEZONE)->addDays(7);
|
|
|
|
|
|
|
|
foreach($source_tests as $source_test) {
|
|
foreach($source_tests as $source_test) {
|
|
|
|
|
+ $dt_deadline = $target_project->getDateTimeDeadline();
|
|
|
|
|
+
|
|
|
|
|
+ /** @var CarbonImmutable $dt_due */
|
|
|
|
|
+ $dt_due = min($dt_deadline, $dt_new_due);
|
|
|
|
|
+
|
|
|
$source_test->project_id = $target_project_id;
|
|
$source_test->project_id = $target_project_id;
|
|
|
|
|
+ $source_test->dts_due = $dt_due->utc()->toDateTimeString();
|
|
|
$source_test->commit();
|
|
$source_test->commit();
|
|
|
}
|
|
}
|
|
|
|
|
|