mirror of
https://forge.chapril.org/tykayn/osm-commerces
synced 2025-10-04 17:04:53 +02:00
lien de modification dans le graphe détaillé
This commit is contained in:
parent
68c9ed283b
commit
c5bf83a4f8
3 changed files with 29 additions and 6 deletions
|
@ -574,6 +574,8 @@ final class AdminController extends AbstractController
|
|||
'tags' => ['main_tag' => $place->getMainTag()],
|
||||
'is_complete' => !empty($place->getName()),
|
||||
'osm_url' => 'https://www.openstreetmap.org/' . $place->getOsmKind() . '/' . $place->getOsmId(),
|
||||
'uuid' => $place->getUuidForUrl(),
|
||||
'zip_code' => $place->getZipCode(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -422,10 +422,7 @@ class PublicController extends AbstractController
|
|||
$exception = true;
|
||||
$exception_message = $e->getMessage();
|
||||
|
||||
// Debug de la réponse en cas d'erreur
|
||||
if (method_exists($e, 'getResponse')) {
|
||||
var_dump($e->getResponse()->getBody()->getContents());
|
||||
// Faire un log d'action lors d'une erreur de soumission
|
||||
// On ne suppose plus la présence de getResponse (évite l'erreur linter)
|
||||
$this->actionLogger->log('ERROR_submit_object_exception', [
|
||||
'osm_id' => $osm_object_id ?? null,
|
||||
'version' => $version ?? null,
|
||||
|
@ -434,7 +431,6 @@ class PublicController extends AbstractController
|
|||
'exception_message' => $e->getMessage(),
|
||||
'trace' => $e->getTraceAsString(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -680,4 +676,28 @@ class PublicController extends AbstractController
|
|||
'icons' => \App\Service\FollowUpService::getFollowUpIcons(),
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route('/edit-by-osm/{osm_kind}/{osm_id}', name: 'app_public_edit_by_osm')]
|
||||
public function editByOsm(string $osm_kind, string $osm_id, Request $request): Response
|
||||
{
|
||||
$place = $this->entityManager->getRepository(\App\Entity\Place::class)->findOneBy([
|
||||
'osm_kind' => $osm_kind,
|
||||
'osmId' => $osm_id
|
||||
]);
|
||||
if ($place) {
|
||||
return $this->redirectToRoute('app_public_edit', [
|
||||
'zipcode' => $place->getZipCode(),
|
||||
'name' => $place->getName() !== '' ? $place->getName() : '?',
|
||||
'uuid' => $place->getUuidForUrl()
|
||||
]);
|
||||
} else {
|
||||
$this->addFlash('warning', "Aucun lieu trouvé pour {$osm_kind} {$osm_id}.");
|
||||
$referer = $request->headers->get('referer');
|
||||
if ($referer) {
|
||||
return $this->redirect($referer);
|
||||
} else {
|
||||
return $this->redirectToRoute('app_public_index');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -301,7 +301,8 @@
|
|||
<span style='font-size:0.95em;'>
|
||||
${Object.entries(f.properties.tags).map(([k,v]) => `<span><b>${k}</b>: ${v}</span>`).join('<br>')}
|
||||
</span>
|
||||
<a href='${f.properties.osm_url}' target='_blank'>Voir sur OSM</a>
|
||||
<a href='${f.properties.osm_url}' target='_blank'>Voir sur OSM</a><br>
|
||||
${f.properties.uuid && f.properties.zip_code && f.properties.name ? `<a href='/edit/${f.properties.zip_code}/${encodeURIComponent(f.properties.name)}/${f.properties.uuid}' target='_blank'>📝 Modifier ce lieu</a>` : ''}
|
||||
</div>
|
||||
`)
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue