|
|
@ -17,6 +17,7 @@ use Symfony\Component\HttpFoundation\Request; |
|
|
|
use Symfony\Component\HttpFoundation\Response; |
|
|
|
use Symfony\Component\Routing\Attribute\Route; |
|
|
|
use Symfony\Component\Workflow\WorkflowInterface; |
|
|
|
use Symfony\Component\Routing\Generator\UrlGeneratorInterface; |
|
|
|
|
|
|
|
#[Route('/task')]
|
|
|
|
class TaskController extends AbstractController |
|
|
@ -91,6 +92,7 @@ class TaskController extends AbstractController |
|
|
|
return $this->redirect($request->headers->get('Referer')); |
|
|
|
} |
|
|
|
|
|
|
|
$project = $task->getProject(); |
|
|
|
$nextTask = $repository->findNextOne($task); |
|
|
|
|
|
|
|
$comment = new Comment(); |
|
|
@ -104,12 +106,36 @@ class TaskController extends AbstractController |
|
|
|
$geom = \geoPHP::load($task->getGeojson(), 'json'); |
|
|
|
$bbox = $geom->getBBox(); |
|
|
|
|
|
|
|
$josmCommands = [ |
|
|
|
'imagery' => [ |
|
|
|
'id' => $project->hasImagery() ? $project->getImagery() : 'osmfr', |
|
|
|
], |
|
|
|
'import' => [ |
|
|
|
'new_layer' => true, |
|
|
|
'layer_name' => $task->getName(), |
|
|
|
'url' => $this->generateUrl( |
|
|
|
'app_task_osm', |
|
|
|
['slug' => $task->getSlug()], |
|
|
|
UrlGeneratorInterface::ABSOLUTE_URL |
|
|
|
), |
|
|
|
], |
|
|
|
'zoom' => [ |
|
|
|
'bottom' => $bbox['miny'], |
|
|
|
'top' => $bbox['maxy'], |
|
|
|
'left' => $bbox['minx'], |
|
|
|
'right' => $bbox['maxx'], |
|
|
|
'changeset_comment' => sprintf('%s %s', $project->getName(), $task->getName()), |
|
|
|
'changeset_source' => $project->getSource(), |
|
|
|
'changeset_hashtags' => $project->getHashtags(), |
|
|
|
], |
|
|
|
]; |
|
|
|
|
|
|
|
return $this->render('task/show.html.twig', [ |
|
|
|
'task' => $task, |
|
|
|
'project' => $task->getProject(), |
|
|
|
'project' => $project, |
|
|
|
'commentForm' => $commentForm, |
|
|
|
'nextTask' => $nextTask, |
|
|
|
'bbox' => $bbox, |
|
|
|
'josmCommands' => json_encode($josmCommands), |
|
|
|
]); |
|
|
|
} |
|
|
|
|
|
|
|