mise à plat des règles de désinscription (ref #235)
This commit is contained in:
parent
b2c78b523a
commit
4c707c5899
|
@ -175,7 +175,7 @@ class GroupController extends Controller
|
||||||
if(!$data->getFgall()) $action .="<a href='".$this->generateUrl('cadoles_core_config_group_users', array('id'=>$data->getId()))."'><i class='fa fa-users fa-2x fa-fw'></i></a>";
|
if(!$data->getFgall()) $action .="<a href='".$this->generateUrl('cadoles_core_config_group_users', array('id'=>$data->getId()))."'><i class='fa fa-users fa-2x fa-fw'></i></a>";
|
||||||
|
|
||||||
if($data->getFgcanshare())
|
if($data->getFgcanshare())
|
||||||
$action.="<a href='".$this->generateUrl('cadoles_core_'.$access.'_group_statistic', array('id'=>$data->getId()))."'><i class='fa fa-bar-chart-o fa-fw fa-2x'></i></a>";
|
$action.="<a href='".$this->generateUrl('cadoles_core_'.$access.'_group_statistic', array('id'=>$data->getId()))."'><i class='fa fa-chart-area fa-fw fa-2x'></i></a>";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$fgproprio=($user==$data->getOwner());
|
$fgproprio=($user==$data->getOwner());
|
||||||
|
@ -194,11 +194,16 @@ class GroupController extends Controller
|
||||||
$action .="<a href='".$this->generateUrl('cadoles_core_'.$access.'_group_users', array('id'=>$data->getId()))."'><i class='fa fa-users fa-2x fa-fw'></i></a>";
|
$action .="<a href='".$this->generateUrl('cadoles_core_'.$access.'_group_users', array('id'=>$data->getId()))."'><i class='fa fa-users fa-2x fa-fw'></i></a>";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$action.="<a href='".$this->generateUrl('cadoles_core_'.$access.'_group_out', array('id'=>$data->getId()))."'><i class='fa fa-sign-out-alt fa-fw fa-2x'></i></a>";
|
// On ne peut se désinscrire que si le groupe est ouvert et qu'il n'est pas lié à un groupe ldap ou sso
|
||||||
|
$fgcanleave=true;
|
||||||
|
if($data->getFgtemplate() or $data->getFgall()) $fgcanleave=false;
|
||||||
|
elseif(!$data->getFgcanshare() && !$data->getFgopen()) $fgcanleave=false;
|
||||||
|
elseif($data->getFgcanshare() && !$this->get('session')->get('permunsubscribe') && !$data->getFgopen()) $fgcanleave=false;
|
||||||
|
if($fgcanleave) $action.="<a href='".$this->generateUrl('cadoles_core_'.$access.'_group_out', array('id'=>$data->getId()))."'><i class='fa fa-sign-out-alt fa-fw fa-2x'></i></a>";
|
||||||
}
|
}
|
||||||
|
|
||||||
if($data->getFgcanshare())
|
if($data->getFgcanshare())
|
||||||
$action.="<a href='".$this->generateUrl('cadoles_core_'.$access.'_group_statistic', array('id'=>$data->getId()))."'><i class='fa fa-bar-chart-o fa-fw fa-2x'></i></a>";
|
$action.="<a href='".$this->generateUrl('cadoles_core_'.$access.'_group_statistic', array('id'=>$data->getId()))."'><i class='fa fa-chart-area fa-fw fa-2x'></i></a>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
<th width="90px">Action</th>
|
<th width="90px">Action</th>
|
||||||
<th width="70px">Ordre</th>
|
<th width="70px">Ordre</th>
|
||||||
<th width="200px">Clé</th>
|
<th width="200px">Clé</th>
|
||||||
|
<th>Description</th>
|
||||||
<th>Valeur</th>
|
<th>Valeur</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
@ -38,6 +39,7 @@
|
||||||
</td>
|
</td>
|
||||||
<td>{{ config.order }}</td>
|
<td>{{ config.order }}</td>
|
||||||
<td>{{ config.id }}</td>
|
<td>{{ config.id }}</td>
|
||||||
|
<td>{{ config.help|raw }}</td>
|
||||||
<td>
|
<td>
|
||||||
{% if config.type == "boolean" %}
|
{% if config.type == "boolean" %}
|
||||||
{% if config.value == "0" %}
|
{% if config.value == "0" %}
|
||||||
|
|
|
@ -182,13 +182,21 @@
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for group in user.groups %}
|
{% for group in user.groups %}
|
||||||
<tr id="linkgroup{{ group.group.id }}">
|
<tr id="linkgroup{{ group.group.id }}">
|
||||||
{% if access=="config" and not group.group.fgall and group.group.ldapfilter=="" and group.group.attributes =="" %}
|
{% set canleave = true %}
|
||||||
<td><a style="cursor:pointer" title="Se Désinscrire"><i class="fa fa-sign-out fa-fw" onclick="removeLinkGroup({{ group.group.id }})"></i></a></td>
|
{% if group.group.fgtemplate or group.group.fgall or group.group.owner==user %}
|
||||||
{% elseif (group.group.fgopen or group.group.fgcanshare) and group.group.owner!=app.user and not group.group.fgall and group.group.ldapfilter=="" and group.group.attributes =="" %}
|
{% set canleave = false %}
|
||||||
|
{% elseif access!="config" %}
|
||||||
|
{% if not group.group.fgcanshare and not group.group.fgopen %}
|
||||||
|
{% set canleave = false %}
|
||||||
|
{% elseif group.group.fgcanshare and not app.session.get('permunsubscribe') and not group.group.fgopen %}
|
||||||
|
{% set canleave = false %}
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if canleave %}
|
||||||
<td><a style="cursor:pointer" title="Se Désinscrire"><i class="fa fa-sign-out-alt fa-fw" onclick="removeLinkGroup({{ group.group.id }})"></i></a></td>
|
<td><a style="cursor:pointer" title="Se Désinscrire"><i class="fa fa-sign-out-alt fa-fw" onclick="removeLinkGroup({{ group.group.id }})"></i></a></td>
|
||||||
{% else %}
|
{% else %}
|
||||||
<td>
|
<td></td>
|
||||||
</td>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
|
|
|
@ -120,6 +120,7 @@ INSERT IGNORE INTO `config` (`order`, `visible`, `changeable`, `required`, `type
|
||||||
%end if
|
%end if
|
||||||
|
|
||||||
('500', 1, 1, 1, 'permgroup', 'permgroup', 'ROLE_ANIM', '', 'Determine quel rôle aura la permission de créer des groupes de travail'),
|
('500', 1, 1, 1, 'permgroup', 'permgroup', 'ROLE_ANIM', '', 'Determine quel rôle aura la permission de créer des groupes de travail'),
|
||||||
('501', 1, 1, 1, 'permgroup', 'permannu', 'ROLE_USER', '', 'Determine quel rôle aura la permission de voir l\'annuaire');
|
('501', 1, 1, 1, 'permgroup', 'permannu', 'ROLE_USER', '', 'Determine quel rôle aura la permission de voir l\'annuaire'),
|
||||||
|
('502', 1, 1, 1, 'boolean', 'permunsubscribe', '0', '', 'Permettre aux utilisateurs de se désinscrire par eux-mêmes des groupes de travail');
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue