Modif des droits sur les modules
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
</thead>
|
||||
|
||||
<caption class="clearfix">
|
||||
{loop name="auth-create" type="auth" role="ADMIN" resource="admin.pdr.main" access="CREATE" module="ClickAndCollect"}
|
||||
{loop name="auth-create" type="auth" role="ADMIN" access="CREATE" module="ClickAndCollect"}
|
||||
<div class="pull-right">
|
||||
<a class="btn btn-default btn-primary"
|
||||
title="{intl l='Add a new place' d='clickandcollect'}"
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<table class="table table-striped table-condensed">
|
||||
|
||||
<caption class="clearfix">
|
||||
{loop name="auth-create" type="auth" role="ADMIN" resource="admin.cnc.schedule" access="CREATE" module="ClickAndCollect"}
|
||||
{loop name="auth-create" type="auth" role="ADMIN" access="CREATE" module="ClickAndCollect"}
|
||||
<div class="pull-right">
|
||||
<a class="btn btn-default btn-primary place-schedule-create"
|
||||
title="{intl l='Add a new opening day' d='clickandcollect'}"
|
||||
@@ -55,7 +55,7 @@
|
||||
{* Actions *}
|
||||
<td>
|
||||
<div class="btn-group">
|
||||
{loop name="auth-edit" type="auth" role="ADMIN" resource="admin.cnc.schedule" access="UPDATE" module="ClickAndCollect"}
|
||||
{loop name="auth-edit" type="auth" role="ADMIN" access="UPDATE" module="ClickAndCollect"}
|
||||
<a class="btn btn-info btn-responsive place-schedule-update-default"
|
||||
title="{intl l='Edit this working day' d='clickandcollect'}"
|
||||
data-target="#place-schedule-update" data-toggle="modal" data-id="{$ID}"
|
||||
@@ -65,7 +65,7 @@
|
||||
<i class="glyphicon glyphicon-edit"></i>
|
||||
</a>
|
||||
{/loop}
|
||||
{loop name="auth-delete" type="auth" role="ADMIN" resource="admin.cnc.schedule" access="DELETE" module="ClickAndCollect"}
|
||||
{loop name="auth-delete" type="auth" role="ADMIN" access="DELETE" module="ClickAndCollect"}
|
||||
<a class="btn btn-danger btn-responsive place-schedule-delete"
|
||||
title="{intl l='Delete this working day' d='clickandcollect'}"
|
||||
data-target="#place-schedule-delete" data-toggle="modal" data-id="{$ID}">
|
||||
|
||||
Reference in New Issue
Block a user