260 lines
9.8 KiB
Twig
Executable File
260 lines
9.8 KiB
Twig
Executable File
{% extends '@CadolesCore/base.html.twig' %}
|
|
|
|
{% block pagewrapper %}
|
|
{{ form_start(form) }}
|
|
<h1 class="page-header">
|
|
{% if mode=="update" %}
|
|
Modification Groupe
|
|
{% elseif mode=="submit" %}
|
|
Création Groupe
|
|
{% elseif mode=="delete" %}
|
|
Suppression Groupe
|
|
{% endif %}
|
|
</h1>
|
|
|
|
{{ form_widget(form.submit) }} <a class="btn btn-default" href={{ path('cadoles_core_config_group') }}>Annuler</a>
|
|
|
|
<br><br>
|
|
|
|
{% if app.session.flashbag.has('error') %}
|
|
<div class='alert alert-danger' style='margin: 5px 0px'>
|
|
<strong>Erreur</strong><br>
|
|
{% for flashMessage in app.session.flashbag.get('error') %}
|
|
{{ flashMessage }}<br>
|
|
{% endfor %}
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% if app.session.flashbag.has('notice') %}
|
|
<div class='alert alert-info' style='margin: 5px 0px'>
|
|
<strong>Information</strong><br>
|
|
{% for flashMessage in app.session.flashbag.get('notice') %}
|
|
{{ flashMessage }}<br>
|
|
{% endfor %}
|
|
</div>
|
|
{% endif %}
|
|
|
|
<div class="row">
|
|
<div class="col-sm-6">
|
|
|
|
<div class="panel panel-primary">
|
|
<div class="panel-heading">
|
|
<i class="fa fa-pencil fa-fw"></i> Informations
|
|
</div>
|
|
|
|
<div class="panel-body">
|
|
{% if form.label is defined %}
|
|
{{ form_row(form.label) }}
|
|
|
|
{% if form.fgassoc is defined %}
|
|
{% if masteridentity=="LDAP" %}
|
|
{{ form_row(form.fgassoc) }}
|
|
{{ form_row(form.ldapfilter) }}
|
|
{% endif %}
|
|
|
|
{% if masteridentity=="SSO" %}
|
|
{{ form_row(form.fgassoc) }}
|
|
{{ form_row(form.attributes) }}
|
|
{% endif %}
|
|
{% endif %}
|
|
{% endif %}
|
|
{{ form_row(form.description) }}
|
|
{{ form_row(form.color) }}
|
|
</div>
|
|
</div>
|
|
|
|
{% if form.fgcanshare is defined or form.fgopen is defined %}
|
|
<div class="panel panel-primary">
|
|
<div class="panel-heading">
|
|
<i class="fa fa-pencil fa-fw"></i> Configuration du Groupe
|
|
</div>
|
|
|
|
<div class="panel-body">
|
|
{% if form.fgopen is defined %}
|
|
{{ form_row(form.fgopen) }}
|
|
{% endif %}
|
|
|
|
{% if form.fgcanshare is defined %}
|
|
{{ form_row(form.fgcanshare) }}
|
|
<div id="pagetemplate">{{ form_row(form.pagetemplate) }}</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
|
|
<div id="diviconsel" class="col-md-12 text-left" style="height:140px; padding:20px; text-align:center; background-color: {{ group.color ? "#"~group.color : '#000000' }};">
|
|
{% if group.icon %}
|
|
<img src="/{{ alias }}/{{ group.icon.label }}" height="100" />
|
|
{% endif %}
|
|
</div>
|
|
|
|
<div class="col-md-12" style="text-align:center;padding:0px">
|
|
{{ form_row(form.idicon) }}
|
|
<a class="btn btn-success" data-toggle="modal" data-target="#selicon" title='Ajouter' style="width:100%">Selectionner un Icône</a>
|
|
<a class="btn btn-danger" onClick="delIcon()" title='Détacher' style="width:100%">Détacher l'Icône</a>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-sm-6">
|
|
{% if form.fgcanshare is defined %}
|
|
<div class="panel panel-primary">
|
|
<div class="panel-heading">
|
|
<i class="fa fa-pencil fa-fw"></i> Permissions Portail
|
|
</div>
|
|
|
|
<div class="panel-body">
|
|
{{ form_label(form.fgcancreatepage) }}
|
|
{{ form_widget(form.fgcancreatepage) }}
|
|
|
|
{{ form_label(form.fgcancreatecalendar) }}
|
|
{{ form_widget(form.fgcancreatecalendar) }}
|
|
|
|
{{ form_label(form.fgcancreateblog) }}
|
|
{{ form_widget(form.fgcancreateblog) }}
|
|
</div>
|
|
</div>
|
|
|
|
<div class="panel panel-primary">
|
|
<div class="panel-heading">
|
|
<i class="fa fa-pencil fa-fw"></i> Elements du Portail
|
|
</div>
|
|
|
|
<div class="panel-body">
|
|
{{ form_row(form.pages) }}
|
|
{{ form_row(form.items) }}
|
|
{{ form_row(form.alerts) }}
|
|
{{ form_row(form.calendars) }}
|
|
{{ form_row(form.blogs) }}
|
|
{{ form_row(form.fluxs) }}
|
|
{{ form_row(form.notices) }}
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
|
|
<div id="selicon" class="modal fade bs-item-modal" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
|
|
<div class="modal-dialog modal-lg">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
|
<h4 class="modal-title">SELECTIONNER UN ICONE</h4>
|
|
</div>
|
|
|
|
<div class="modal-body">
|
|
<div class="form-group row clearfix">
|
|
<div class="col-md-12" style="margin-bottom:15px">
|
|
<a onclick="$('#selicon').modal('hide');" class="btn btn-default">Annuler</a>
|
|
{% if access=="user" %}
|
|
<a href="{{ path('cadoles_portal_user_icon') }}" target="_parent" class="btn btn-default">Gérer mes Icônes</a>
|
|
{% endif %}
|
|
</div>
|
|
|
|
<div class="col-md-12">
|
|
{% if iconsuser is not empty %}
|
|
<h3>Mes Icônes</h3>
|
|
{% for icon in iconsuser %}
|
|
<a style="cursor:pointer" onClick="selIcon({{ icon.id }})">
|
|
<img id="icon-{{ icon.id }}" class="grid-item-img" height="40" src="/{{ alias }}/{{ icon.label }}" style="padding:2px">
|
|
</a>
|
|
{% endfor %}
|
|
|
|
<h3>Icônes Communs</h3>
|
|
{% endif %}
|
|
{% for icon in icons %}
|
|
<a style="cursor:pointer" onClick="selIcon({{ icon.id }})">
|
|
<img id="icon-{{ icon.id }}" class="grid-item-img" height="40" src="/{{ alias }}/{{ icon.label }}" style="padding:2px">
|
|
</a>
|
|
{% endfor %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{{ form_end(form) }}
|
|
{% endblock %}
|
|
|
|
{% block localjavascript %}
|
|
$('document').ready(function(){
|
|
|
|
{% if masteridentity=="LDAP" %}
|
|
fgaff=($("#group_ldapfilter").val()!="");
|
|
if(!fgaff) {
|
|
$("#group_ldapfilter").hide();
|
|
$("#label_group_ldapfilter").hide();
|
|
$("#group_fgassoc").val(0);
|
|
}
|
|
{% endif %}
|
|
|
|
{% if masteridentity=="LDAP" %}
|
|
$( "#group_fgassoc").change(function() {
|
|
|
|
if($("#group_fgassoc").val()==0) {
|
|
$("#group_ldapfilter").hide();
|
|
$("#label_group_ldapfilter").hide();
|
|
$("#group_ldapfilter").val("");
|
|
}
|
|
else {
|
|
$("#group_ldapfilter").show();
|
|
$("#label_group_ldapfilter").show();
|
|
}
|
|
});
|
|
{% endif %}
|
|
|
|
|
|
{% if masteridentity=="SSO" %}
|
|
fgaff=($("#group_attributes").val()!="");
|
|
if(!fgaff) {
|
|
$("#group_attributes").hide();
|
|
$("#label_group_attributes").hide();
|
|
$("#group_fgassoc").val(0);
|
|
}
|
|
{% endif %}
|
|
|
|
{% if masteridentity=="SSO" %}
|
|
$( "#group_fgassoc").change(function() {
|
|
|
|
if($("#group_fgassoc").val()==0) {
|
|
$("#group_attributes").hide();
|
|
$("#label_group_attributes").hide();
|
|
$("#group_attributes").val("");
|
|
}
|
|
else {
|
|
$("#group_attributes").show();
|
|
$("#label_group_attributes").show();
|
|
}
|
|
});
|
|
{% endif %}
|
|
|
|
hideshow();
|
|
});
|
|
|
|
$(document.body).on("change","#group_fgcanshare",function(){
|
|
hideshow();
|
|
});
|
|
|
|
function selIcon(idicon) {
|
|
$("#group_idicon").val(idicon);
|
|
$("#diviconsel img").remove();
|
|
|
|
$("#icon-"+idicon).clone().appendTo($("#diviconsel"));
|
|
$("#diviconsel img").attr("height","100px");
|
|
$('#selicon').modal('hide');
|
|
}
|
|
|
|
function delIcon() {
|
|
$("#diviconsel img").remove();
|
|
$("#group_idicon").val(null);
|
|
}
|
|
|
|
function hideshow() {
|
|
if($("#group_fgcanshare").val()==1)
|
|
$("#pagetemplate").show();
|
|
else {
|
|
$("#pagetemplate").hide();
|
|
}
|
|
}
|
|
|
|
{% endblock %}
|