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) {

View File

@@ -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'}"

View File

@@ -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}">

View File

@@ -39,7 +39,7 @@
</thead>
<caption class="clearfix">
{loop name="auth-create" type="auth" role="ADMIN" resource="admin.lps.general" access="CREATE" module="LivraisonParSecteurs"}
{loop name="auth-create" type="auth" role="ADMIN" access="CREATE" module="LivraisonParSecteurs"}
<div class="pull-right">
<a class="btn btn-default btn-primary"
title="{intl l='Add a new area' d='livraisonparsecteurs'}"

View File

@@ -67,7 +67,7 @@
<th>{intl l="City" d="livraisonparsecteurs"}</th>
<th class="pull-right">
<div>
{loop name="auth-delete" type="auth" role="ADMIN" resource="admin.lps.cities" access="CREATE" module="LivraisonParSecteurs"}
{loop name="auth-delete" type="auth" role="ADMIN" access="CREATE" module="LivraisonParSecteurs"}
<a class="btn btn-default btn-primary city-add"
title="{intl l='Add a new city' d='livraisonparsecteurs'}"
data-target="#area-cities-add" data-toggle="modal">
@@ -85,7 +85,7 @@
<td>{$TITLE}{if $LATITUDE eq '' or $LONGITUDE eq ''}<img src="{image file='assets/img/pin.svg' source='LivraisonParSecteurs'}" title="Pas de coordonnées pour cette commune" alt="Pas de coordonnées" class="pin-lps" />{/if}</td>
<td class="actions">
<div class="btn-group" role="group">
{loop name="auth-delete" type="auth" role="ADMIN" resource="admin.lps.cities" access="DELETE" module="LivraisonParSecteurs"}
{loop name="auth-delete" type="auth" role="ADMIN" access="DELETE" module="LivraisonParSecteurs"}
<a class="btn btn-danger btn-responsive cities-remove" title="{intl l='Remove this city'}" data-target="#area-cities-remove" data-toggle="modal" data-id="{$ID}">
<i class="glyphicon glyphicon-trash"></i>
</a>

View File

@@ -27,7 +27,7 @@
<table class="table table-striped table-condensed">
<caption class="clearfix">
{loop name="auth-create" type="auth" role="ADMIN" resource="admin.lps.schedule" access="CREATE" module="LivraisonParSecteurs"}
{loop name="auth-create" type="auth" role="ADMIN" access="CREATE" module="LivraisonParSecteurs"}
<div class="pull-right">
<a class="btn btn-default btn-primary area-schedule-add"
title="{intl l='Add a new delivery day' d='livraisonparsecteurs'}"
@@ -56,7 +56,7 @@
{* Actions *}
<td>
<div class="btn-group">
{loop name="auth-edit" type="auth" role="ADMIN" resource="admin.lps.schedule" access="UPDATE" module="LivraisonParSecteurs"}
{loop name="auth-edit" type="auth" role="ADMIN" access="UPDATE" module="LivraisonParSecteurs"}
<a class="btn btn-info btn-responsive area-schedule-update-default"
title="{intl l='Modify this delivery day' d='livraisonparsecteurs'}"
data-target="#area-schedule-update" data-toggle="modal" data-id="{$ID}"
@@ -66,7 +66,7 @@
<i class="glyphicon glyphicon-edit"></i>
</a>
{/loop}
{loop name="auth-delete" type="auth" role="ADMIN" resource="admin.lps.schedule" access="DELETE" module="LivraisonParSecteurs"}
{loop name="auth-delete" type="auth" role="ADMIN" access="DELETE" module="LivraisonParSecteurs"}
<a class="btn btn-danger btn-responsive area-schedule-delete"
title="{intl l='Delete this delivery day' d='livraisonparsecteurs'}"
data-target="#area-schedule-delete" data-toggle="modal" data-id="{$ID}">

View File

@@ -17,7 +17,7 @@
}
{form_field form=$form field="place_id"}
<input type="hidden" name="{$name}" value="{$place_id}"/>
<input type="hidden" name="{$name}" value="{$place_id}"/>@
{/form_field}
<div class="row">
@@ -26,7 +26,7 @@
<table class="table table-striped table-condensed">
<caption class="clearfix">
{loop name="auth-create" type="auth" role="ADMIN" resource="admin.pdr.schedule" access="CREATE" module="PointRetrait"}
{loop name="auth-create" type="auth" role="ADMIN" access="CREATE" module="PointRetrait"}
<div class="pull-right">
<a class="btn btn-default btn-primary place-schedule-create"
title="{intl l='Add a new withdrawal day' d='pointretrait'}"
@@ -55,7 +55,7 @@
{* Actions *}
<td>
<div class="btn-group">
{loop name="auth-edit" type="auth" role="ADMIN" resource="admin.pdr.schedule" access="UPDATE" module="PointRetrait"}
{loop name="auth-edit" type="auth" role="ADMIN" access="UPDATE" module="PointRetrait"}
<a class="btn btn-info btn-responsive place-schedule-update-default"
title="{intl l='Edit this withdrawal day' d='pointretrait'}"
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.pdr.schedule" access="DELETE" module="PointRetrait"}
{loop name="auth-delete" type="auth" role="ADMIN" access="DELETE" module="PointRetrait"}
<a class="btn btn-danger btn-responsive place-schedule-delete"
title="{intl l='Delete this withdrawal day' d='pointretrait'}"
data-target="#place-schedule-delete" data-toggle="modal" data-id="{$ID}">

View File

@@ -39,7 +39,7 @@
</thead>
<caption class="clearfix">
{loop name="auth-create" type="auth" role="ADMIN" resource="admin.pdr.main" access="CREATE" module="PointRetrait"}
{loop name="auth-create" type="auth" role="ADMIN" access="CREATE" module="PointRetrait"}
<div class="pull-right">
<a class="btn btn-default btn-primary"
title="{intl l='Add a new place' d='pointretrait'}"