Compare commits

..

No commits in common. "3eedb4d086a31aa2d9e7fcc40cdb3c569745108d" and "362047c295d26c7ef6c163616fe73157582474df" have entirely different histories.

11 changed files with 93 additions and 145 deletions

View File

@ -286,7 +286,7 @@ class RegistrationController extends Controller
array_push($to,$emailmodo["email"]); array_push($to,$emailmodo["email"]);
} }
$url = $this->generateUrl('cadoles_core_config_registration', [], UrlGeneratorInterface::ABSOLUTE_URL); $url = $this->generateUrl('cadoles_core_config_registration', '', UrlGeneratorInterface::ABSOLUTE_URL);
$mail_params=array( $mail_params=array(
"subject" => $appname." : Inscription à valider", "subject" => $appname." : Inscription à valider",
"body_html"=>"Un utilisateur dont le mail nest pas en liste blanche souhaite sinscrire au ".$appname.".\nMerci dapprouver son inscription pour finaliser celle-ci.<br><br>Veuillez vérifier cette inscription à cette adresse:<br><a href='$url'>$url</a>", "body_html"=>"Un utilisateur dont le mail nest pas en liste blanche souhaite sinscrire au ".$appname.".\nMerci dapprouver son inscription pour finaliser celle-ci.<br><br>Veuillez vérifier cette inscription à cette adresse:<br><a href='$url'>$url</a>",

View File

@ -33,7 +33,7 @@ class RegistrationType extends AbstractType
$builder->add('submit', $builder->add('submit',
SubmitType::class, array( SubmitType::class, array(
"label" => ($options["mode"]=="delete"?"Confirmer la Suppression":($options["mode"]=="submit"?"Confirmer":"Sauvegarder et envoyer le mail")), "label" => ($options["mode"]=="delete"?"Confirmer la Suppression":"Confirmer"),
"attr" => ($options["mode"]=="delete"?array("class" => "btn btn-danger"):array("class" => "btn btn-success")) "attr" => ($options["mode"]=="delete"?array("class" => "btn btn-danger"):array("class" => "btn btn-success"))
) )
); );
@ -41,7 +41,7 @@ class RegistrationType extends AbstractType
if($options["mode"]=="send") { if($options["mode"]=="send") {
$builder->add('save', $builder->add('save',
SubmitType::class, array( SubmitType::class, array(
"label" => "Sauvegarder sans envoyer le mail", "label" => "Sauvegarder",
"attr" => array("class" => "btn btn-success") "attr" => array("class" => "btn btn-success")
) )
); );

View File

@ -89,6 +89,20 @@
</div> </div>
{% endif %} {% 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.fgcancreatepage is defined %} {% if form.fgcancreatepage is defined %}
<div class="panel panel-primary"> <div class="panel panel-primary">
<div class="panel-heading"> <div class="panel-heading">
@ -109,24 +123,7 @@
{{ form_widget(form.fgcancreateproject) }} {{ form_widget(form.fgcancreateproject) }}
</div> </div>
</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 panel-primary">
<div class="panel-heading"> <div class="panel-heading">
<i class="fa fa-pencil fa-fw"></i> Elements du Portail <i class="fa fa-pencil fa-fw"></i> Elements du Portail
@ -146,6 +143,46 @@
{% endif %} {% endif %}
</div> </div>
</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">&times;</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; margin-bottom:2px; background-color: #{{ color["main"]}}">
</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; margin-bottom:2px; background-color: #{{ color["main"]}}">
</a>
{% endfor %}
</div>
</div>
</div>
</div>
</div>
</div>
{{ form_end(form) }} {{ form_end(form) }}
{% endblock %} {% endblock %}
@ -208,21 +245,13 @@
hideshow(); hideshow();
}); });
function selIcon(idicon,label) { function selIcon(idicon) {
$("#group_idicon").val(idicon); $("#group_idicon").val(idicon);
$("#diviconsel img").remove(); $("#diviconsel img").remove();
url="/{{ alias }}/"+label; $("#icon-"+idicon).clone().appendTo($("#diviconsel"));
$("#diviconsel").append("<img src='"+url+"'>");
$("#diviconsel img").attr("height","100px"); $("#diviconsel img").attr("height","100px");
$("#mymodal").modal("hide"); $('#selicon').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() { function delIcon() {

View File

@ -7,7 +7,7 @@
{% if not usersnotin is empty %} {% if not usersnotin is empty %}
<h3>Les utilisateurs suivants existent déjà dans {{ app.session.get('appname') }}</h3> <h3>Les utilisateurs suivants existent déjà dans {{ app.session.get('appname') }}</h3>
Pour les ajouter à votre groupe cliquez sur le symbole bleu “+” situé à gauche de leur nom<br> Vous pouvez les ajouter dès maintenant à votre groupe<br>
<div class="dataTable_wrapper"> <div class="dataTable_wrapper">
<table class="table table-striped table-bordered table-hover" id="dataTablesnotin" style="width:100%"> <table class="table table-striped table-bordered table-hover" id="dataTablesnotin" style="width:100%">

View File

@ -19,10 +19,8 @@ class IconController extends Controller
private $labeldata = 'icon'; private $labeldata = 'icon';
private $labeldatas = 'icons'; private $labeldatas = 'icons';
public function listAction(Request $request,$access="config") public function listAction($access="config")
{ {
$inframe=$request->get("inframe");
$em = $this->getDoctrine()->getManager(); $em = $this->getDoctrine()->getManager();
if($access=="config") if($access=="config")
$icons=$this->getDoctrine()->getRepository("CadolesPortalBundle:Icon")->findBy(["user"=>null]); $icons=$this->getDoctrine()->getRepository("CadolesPortalBundle:Icon")->findBy(["user"=>null]);
@ -30,19 +28,16 @@ class IconController extends Controller
$icons=$this->getDoctrine()->getRepository("CadolesPortalBundle:Icon")->findBy(["user"=>$this->getUser()]); $icons=$this->getDoctrine()->getRepository("CadolesPortalBundle:Icon")->findBy(["user"=>$this->getUser()]);
return $this->render($this->labelentity.':list.html.twig',[ return $this->render($this->labelentity.':list.html.twig',[
'useheader' => !($inframe), 'useheader' => true,
'usemenu' => false, 'usemenu' => false,
'usesidebar' => ($access=="config"), 'usesidebar' => ($access=="config"),
'access' => $access, 'access' => $access,
$this->labeldatas => $icons, $this->labeldatas => $icons
'inframe' => $inframe
]); ]);
} }
public function submitAction(Request $request,$access="config") public function submitAction(Request $request,$access="config")
{ {
$inframe=$request->get("inframe");
// Initialisation de l'enregistrement // Initialisation de l'enregistrement
$data = new Icon(); $data = new Icon();
@ -67,26 +62,23 @@ class IconController extends Controller
$em->flush(); $em->flush();
// Retour à la liste // Retour à la liste
return $this->redirectToRoute('cadoles_portal_'.$access.'_icon',['inframe'=>$inframe]); return $this->redirectToRoute('cadoles_portal_'.$access.'_icon');
} }
// Affichage du formulaire // Affichage du formulaire
return $this->render($this->labelentity.':edit.html.twig', [ return $this->render($this->labelentity.':edit.html.twig', [
'useheader' => !($inframe), 'useheader' => true,
'usemenu' => false, 'usemenu' => false,
'usesidebar' => ($access=="config"), 'usesidebar' => ($access=="config"),
'access' => $access, 'access' => $access,
$this->labeldata => $data, $this->labeldata => $data,
'mode' => 'submit', 'mode' => 'submit',
'form' => $form->createView(), 'form' => $form->createView(),
'inframe' => $inframe,
]); ]);
} }
public function updateAction($id,Request $request,$access="config") public function updateAction($id,Request $request,$access="config")
{ {
$inframe=$request->get("inframe");
// Récupération de l'enregistrement courant // Récupération de l'enregistrement courant
$data=$this->getData($id); $data=$this->getData($id);
@ -111,13 +103,13 @@ class IconController extends Controller
$em->flush(); $em->flush();
// Retour à la liste // Retour à la liste
return $this->redirectToRoute('cadoles_portal_'.$access.'_icon',['inframe'=>$inframe]); return $this->redirectToRoute('cadoles_portal_'.$access.'_icon');
} }
// Affichage du formulaire // Affichage du formulaire
return $this->render($this->labelentity.':edit.html.twig', [ return $this->render($this->labelentity.':edit.html.twig', [
'useheader' => !($inframe), 'useheader' => true,
'usemenu' => false, 'usemenu' => false,
'usesidebar' => ($access=="config"), 'usesidebar' => ($access=="config"),
'access' => $access, 'access' => $access,
@ -125,14 +117,11 @@ class IconController extends Controller
'mode' => 'update', 'mode' => 'update',
'form' => $form->createView(), 'form' => $form->createView(),
'refresh' => false, 'refresh' => false,
'inframe' => $inframe
]); ]);
} }
public function deleteAction($id,Request $request,$access="config") public function deleteAction($id,Request $request,$access="config")
{ {
$inframe=$request->get("inframe");
// Récupération de l'enregistrement courant // Récupération de l'enregistrement courant
$data=$this->getData($id); $data=$this->getData($id);
@ -143,25 +132,9 @@ class IconController extends Controller
$em->remove($data); $em->remove($data);
$em->flush(); $em->flush();
return $this->redirectToRoute('cadoles_portal_'.$access.'_icon',['inframe'=>$inframe]); return $this->redirectToRoute('cadoles_portal_'.$access.'_icon');
} }
public function selectAction($access="config") {
// Affichage du formulaire
$icons=$this->getDoctrine()->getRepository("CadolesPortalBundle:Icon")->findBy(["user"=>null]);
$iconsuser=null;
if($access=="user") $iconsuser=$this->getDoctrine()->getRepository("CadolesPortalBundle:Icon")->findBy(["user"=>$this->getUser()]);
return $this->render($this->labelentity.':select.html.twig',[
'useheader' => false,
'usemenu' => false,
'usesidebar' => false,
'access' => $access,
$this->labeldatas => $icons,
'iconsuser' => $iconsuser
]);
}
public function iconAction() public function iconAction()
{ {

View File

@ -59,10 +59,6 @@ cadoles_portal_config_icon_delete:
path: /config/icon/delete/{id} path: /config/icon/delete/{id}
defaults: { _controller: CadolesPortalBundle:Icon:delete, access: config } defaults: { _controller: CadolesPortalBundle:Icon:delete, access: config }
cadoles_portal_config_icon_select:
path: /config/icon/select
defaults: { _controller: CadolesPortalBundle:Icon:select, access: config }
cadoles_portal_config_icon_icon: cadoles_portal_config_icon_icon:
path: /config/icon/icon path: /config/icon/icon
defaults: { _controller: CadolesPortalBundle:Icon:icon, access: config } defaults: { _controller: CadolesPortalBundle:Icon:icon, access: config }
@ -83,10 +79,6 @@ cadoles_portal_user_icon_delete:
path: /user/icon/delete/{id} path: /user/icon/delete/{id}
defaults: { _controller: CadolesPortalBundle:Icon:delete, access: user } defaults: { _controller: CadolesPortalBundle:Icon:delete, access: user }
cadoles_portal_user_icon_select:
path: /user/icon/select
defaults: { _controller: CadolesPortalBundle:Icon:select, access: user }
cadoles_portal_user_icon_icon: cadoles_portal_user_icon_icon:
path: /user/icon/icon path: /user/icon/icon
defaults: { _controller: CadolesPortalBundle:Icon:icon, access: user } defaults: { _controller: CadolesPortalBundle:Icon:icon, access: user }

View File

@ -2,20 +2,18 @@
{% block pagewrapper %} {% block pagewrapper %}
{{ form_start(form) }} {{ form_start(form) }}
{% if not inframe %} <h1 class="page-header">
<h1 class="page-header"> {% if mode=="update" %}
{% if mode=="update" %} Modification Icône
Modification Icône {% elseif mode=="submit" %}
{% elseif mode=="submit" %} Création Icône
Création Icône {% endif %}
{% endif %} </h1>
</h1>
{%endif%}
{{ form_widget(form.submit) }} {{ form_widget(form.submit) }}
<a class="btn btn-default" href={{ path('cadoles_portal_'~access~'_icon',{'inframe':inframe}) }}>Annuler</a> <a class="btn btn-default" href={{ path('cadoles_portal_'~access~'_icon') }}>Annuler</a>
{% if mode=="update" %} {% if mode=="update" %}
<a href={{ path('cadoles_portal_'~access~'_icon_delete',{'id':icon.id,'inframe':inframe}) }} <a href={{ path('cadoles_portal_'~access~'_icon_delete',{'id':icon.id}) }}
class="btn btn-danger pull-right" class="btn btn-danger pull-right"
data-method="delete" data-csrf="_token:{{ 'csrf' }}" data-method="delete" data-csrf="_token:{{ 'csrf' }}"
data-confirm="Êtes-vous sûr de vouloir supprimer cet icône ?"> data-confirm="Êtes-vous sûr de vouloir supprimer cet icône ?">

View File

@ -1,20 +1,13 @@
{% extends '@CadolesCore/base.html.twig' %} {% extends '@CadolesCore/base.html.twig' %}
{% block pagewrapper %} {% block pagewrapper %}
{% if not inframe %} <h1 class="page-header">Gestion des Icônes</h1>
<h1 class="page-header">Gestion des Icônes</h1>
{% endif %}
<p> <p><a class="btn btn-success" href={{ path('cadoles_portal_'~access~'_icon_submit') }}>Ajouter</a></p>
<a class="btn btn-success" href={{ path('cadoles_portal_'~access~'_icon_submit',{'inframe': inframe}) }}>Ajouter</a>
{% if inframe %}
<a class="btn btn-default" href={{ path('cadoles_portal_'~access~'_icon_select') }}>Fermer</a>
{% endif %}
</p>
<div class="row"> <div class="row">
{% for icon in icons %} {% for icon in icons %}
<a href="{{ path('cadoles_portal_'~access~'_icon_update', {id : icon.id, 'inframe': inframe}) }}"><img class="icon" height="90" src="/{{ alias }}/{{ icon.label }}" style="padding:10px; margin-bottom:2px; background-color: #{{color["main"]}}"></a> <a href="{{ path('cadoles_portal_'~access~'_icon_update', {id : icon.id}) }}"><img class="icon" height="90" src="/{{ alias }}/{{ icon.label }}" style="padding:10px; margin-bottom:2px; background-color: #{{color["main"]}}"></a>
{% endfor %} {% endfor %}
</div> </div>
{% endblock %} {% endblock %}

View File

@ -1,32 +0,0 @@
{% extends '@CadolesCore/base.html.twig' %}
{% block pagewrapper %}
<div class="row">
<div class="col-md-12" style="margin-bottom:15px">
<a onclick="window.parent.$('#mymodal').modal('hide');" class="btn btn-default">Fermer</a>
{% if access=="user" %}
<a href="{{ path('cadoles_portal_user_icon',{'inframe':true}) }}" 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="window.parent.selIcon({{ icon.id }},'{{icon.label}}')">
<img id="icon-{{ icon.id }}" class="grid-item-img" height="40" src="/{{ alias }}/{{ icon.label }}" style="padding:2px; margin-bottom:2px; background-color: #{{ color["main"]}}">
</a>
{% endfor %}
<h3>Icônes Communs</h3>
{% endif %}
{% for icon in icons %}
<a style="cursor:pointer" onClick="window.parent.selIcon({{ icon.id }},'{{icon.label}}')">
<img id="icon-{{ icon.id }}" class="grid-item-img" height="40" src="/{{ alias }}/{{ icon.label }}" style="padding:2px; margin-bottom:2px; background-color: #{{ color["main"]}}">
</a>
{% endfor %}
</div>
</div>
{% endblock %}

View File

@ -160,11 +160,11 @@
{% endif %} {% endif %}
{% if entity.border %} {% if entity.border %}
{% set stylewidgetbody = stylewidgetbody ~ "padding:10px;" %} {% set stylewidgetbody = stylewidgetbody ~ "padding:10px" %}
{% endif %} {% endif %}
{% if not entity.opened %} {% if not entity.opened %}
{% set stylewidgetbody = stylewidgetbody ~ "display:none;" %} {% set stylewidgetbody = stylewidgetbody ~ "display:none" %}
{% endif %} {% endif %}
{{ stylewidgetbody }} {{ stylewidgetbody }}

View File

@ -28,27 +28,22 @@
</div> </div>
{% endif %} {% endif %}
<div class="widgetheader" style="{{ stylewidgetheader }}"> <div class="widgetheader" style="{{ stylewidgetheader }}; padding-top:10px;">
{% if entity.icon %}
<img src="/{{ alias }}/{{ entity.icon.label }}" class="logo"/>
{% else %}
<img src="/{{ alias }}/uploads/icon/icon_pin.png" class="logo"/>
{% endif %}
<span class="title">{{ entity.name }}</span>
</div>
<div class="widgetbody" style="{{ stylewidgetbody }}">
{% set style = "margin: auto; display: inherit;background-color:transparent;" %} {% set style = "margin: auto; display: inherit;background-color:transparent;" %}
{% if icon %} {% if icon %}
<img src="/{{ alias }}{{ icon }}" class="avatar big" style="{{ style }}" /> <img src="/{{ alias }}{{ icon }}" class="avatar big" style="{{ style }}" />
{% else %} {% else %}
<img src="/{{ alias }}/uploads/icon/icon_users.png" class="avatar big" style="{{ style }}" /> <img src="/{{ alias }}/uploads/icon/icon_users.png" class="avatar big" style="{{ style }}" />
{% endif %} {% endif %}
</div>
<div style="text-align: center;">
<div class="widgetbody" style="{{ stylewidgetbody }}">
<div style="text-align: center; margin-top:50px;">
{%if usage=="group" %}<small>Groupe<br></small>{% endif %} {%if usage=="group" %}<small>Groupe<br></small>{% endif %}
<span style="font-size:120%">{{ title }}</span><br> <span style="font-size:120%">{{ title }}</span><br><br>
{{ description | raw }} {{ description | raw }}
{%if usage=="group" %} {%if usage=="group" %}