242 lines
8.5 KiB
Twig
Executable File
242 lines
8.5 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_'~access~'_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) }}
|
|
<div class='alert alert-info' style='font-size: 80%;padding: 5px;margin-top: -10px;'>
|
|
Caractères interdits = caractères spéciaux sauf ' @ . - _<br>
|
|
</div>
|
|
|
|
{% 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.owner is defined %}
|
|
{{ form_row(form.owner) }}
|
|
{% endif %}
|
|
|
|
{% 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 %}
|
|
|
|
{% if form.fgcancreatepage 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) }}
|
|
|
|
{{ form_label(form.fgcancreateproject) }}
|
|
{{ form_widget(form.fgcancreateproject) }}
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
|
|
<div class="col-sm-6">
|
|
<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 style="text-align:center;padding:0px">
|
|
{{ form_row(form.idicon) }}
|
|
<a class="btn btn-success" onClick="selectIcon()" 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>
|
|
<br>
|
|
|
|
{% if form.fgcancreatepage is defined %}
|
|
<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.projects) }}
|
|
{{ form_row(form.fluxs) }}
|
|
{{ form_row(form.notices) }}
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
</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,label) {
|
|
$("#group_idicon").val(idicon);
|
|
$("#diviconsel img").remove();
|
|
|
|
url="/{{ alias }}/"+label;
|
|
$("#diviconsel").append("<img src='"+url+"'>");
|
|
$("#diviconsel img").attr("height","100px");
|
|
$("#mymodal").modal("hide");
|
|
}
|
|
|
|
function selectIcon() {
|
|
$("#mymodal").find(".modal-title").html("SELECTIONNER UN ICONE");
|
|
var url="{{ path('cadoles_portal_user_icon_select') }}";
|
|
$("#mymodal").find("#framemodal").attr("src",url);
|
|
$("#mymodal").modal("show");
|
|
}
|
|
|
|
function delIcon() {
|
|
$("#diviconsel img").remove();
|
|
$("#group_idicon").val(null);
|
|
}
|
|
|
|
function hideshow() {
|
|
if($("#group_fgcanshare").val()==1)
|
|
$("#pagetemplate").show();
|
|
else {
|
|
$("#pagetemplate").hide();
|
|
}
|
|
}
|
|
|
|
{% endblock %}
|