Modif des droits sur les modules

This commit is contained in:
2021-04-13 17:11:47 +02:00
parent a291e88197
commit 32b7b08931
8 changed files with 29 additions and 20 deletions

View File

@@ -5,6 +5,7 @@ namespace ClickAndCollect\Controller\backOffice;
use ClickAndCollect\ClickAndCollect;
use PointRetrait\Model\PdrPlacesQuery;
use PointRetrait\Model\PdrPlaces;
use PointRetrait\Model\PdrScheduleQuery;
use Propel\Runtime\Map\TableMap;
use Propel\Runtime\Propel;
use Symfony\Component\HttpFoundation\RedirectResponse;
@@ -106,15 +107,23 @@ class PlaceController extends BaseAdminController
return $response;
$placeId = $this->getRequest()->get('attr-place-id');
$query = PdrPlacesQuery::create()->findById($placeId);
if ($query === null)
$query1 = PdrScheduleQuery::create()->findByIdPlace($placeId);
if ($query1 === null)
$error_msg = "Place not found by Id";
else
{
else {
$con = Propel::getConnection();
$con->beginTransaction();
$query->delete($con);
$query1->delete($con);
$con->commit();
$query2 = PdrPlacesQuery::create()->findById($placeId);
if ($query2 === null)
$error_msg = "Place not found by Id";
else {
$con->beginTransaction();
$query2->delete($con);
$con->commit();
}
}
if ($this->getRequest()->request->get("success_url") == null) {