retour sur page groupe blog et calendrier (ref #168)
This commit is contained in:
parent
be3cfa2814
commit
8f85f5eb5e
@ -352,6 +352,23 @@ class BlogController extends Controller
|
||||
if (!$entity) throw $this->createNotFoundException('Unable to find entity.');
|
||||
}
|
||||
|
||||
// On recherche la premiere page associé au groupe du blog
|
||||
$idpage=null;
|
||||
$idgroup=null;
|
||||
if($id!=0) {
|
||||
$groups=$entity->getGroups();
|
||||
if($groups[0]) {
|
||||
if($groups[0]->getFgcanshare()) {
|
||||
$pages=$groups[0]->getPages();
|
||||
if($pages) {
|
||||
$idpage=$pages[0]->getId();
|
||||
$groups=$pages[0]->getGroups();
|
||||
$idgroup=$groups[0]->getId();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Permissions
|
||||
$user=$this->getUser();
|
||||
if($access=="config") {
|
||||
@ -402,7 +419,9 @@ class BlogController extends Controller
|
||||
'blogs' => $blogs,
|
||||
'countarticles' => $count,
|
||||
'pagination' => $pagination,
|
||||
'page' => $page
|
||||
'page' => $page,
|
||||
'idpage' => $idpage,
|
||||
'idgroup' => $idgroup
|
||||
]);
|
||||
|
||||
}
|
||||
|
@ -44,6 +44,13 @@ class BlogarticleController extends Controller
|
||||
$entity = new Blogarticle();
|
||||
$blog=$em->getRepository("CadolesPortalBundle:Blog")->find($idblog);
|
||||
if($blog) $entity->setBlog($blog);
|
||||
|
||||
$pageid=$request->get("page");
|
||||
if($pageid) {
|
||||
$page=$em->getRepository("CadolesPortalBundle:Page")->find($pageid);
|
||||
$groups=$page->getGroups();
|
||||
$idgroup=$groups[0]->getId();
|
||||
}
|
||||
|
||||
$form = $this->entityForm($entity,$access);
|
||||
$form->handleRequest($request);
|
||||
@ -68,7 +75,10 @@ class BlogarticleController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
return $this->redirect($this->generateUrl('cadoles_portal_'.$access.'_blogarticle_view',["id"=>$entity->getId()]));
|
||||
if(is_null($pageid))
|
||||
return $this->redirect($this->generateUrl('cadoles_portal_'.$access.'_blogarticle_view',["id"=>$entity->getId()]));
|
||||
else
|
||||
return $this->redirect($this->generateUrl('cadoles_portal_'.$access.'_page_view',["id"=>$pageid,"usage"=>"group","group"=>$idgroup]));
|
||||
}
|
||||
|
||||
return $this->render($this->labelentity.':edit.html.twig', [
|
||||
@ -79,7 +89,8 @@ class BlogarticleController extends Controller
|
||||
'entity' => $entity,
|
||||
'mode' => "submit",
|
||||
'access' => $access,
|
||||
'form' => $form->createView()
|
||||
'form' => $form->createView(),
|
||||
'pageid' => $pageid
|
||||
]);
|
||||
}
|
||||
|
||||
@ -160,6 +171,21 @@ class BlogarticleController extends Controller
|
||||
$entity = $em->getRepository($this->labelentity)->find($id);
|
||||
if (!$entity) throw $this->createNotFoundException('Unable to find entity.');
|
||||
|
||||
// On recherche la premiere page associé au groupe du blog
|
||||
$groups=$entity->getBlog()->getGroups();
|
||||
$idpage=null;
|
||||
$idgroup=null;
|
||||
if($groups[0]) {
|
||||
if($groups[0]->getFgcanshare()) {
|
||||
$pages=$groups[0]->getPages();
|
||||
if($pages) {
|
||||
$idpage=$pages[0]->getId();
|
||||
$groups=$pages[0]->getGroups();
|
||||
$idgroup=$groups[0]->getId();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Permissions
|
||||
$user=$this->getUser();
|
||||
if($access=="config") {
|
||||
@ -200,7 +226,9 @@ class BlogarticleController extends Controller
|
||||
'canupdate' => $canupdate,
|
||||
'canadd' => $canadd,
|
||||
'blogs' => $blogs,
|
||||
'blogarticles' => $blogarticles
|
||||
'blogarticles' => $blogarticles,
|
||||
'idpage' => $idpage,
|
||||
'idgroup' => $idgroup,
|
||||
]);
|
||||
|
||||
}
|
||||
|
@ -332,6 +332,23 @@ class CalendarController extends Controller
|
||||
if (!$entity) throw $this->createNotFoundException('Unable to find entity.');
|
||||
}
|
||||
|
||||
// On recherche la premiere page associé au groupe du calendrier
|
||||
$idpage=null;
|
||||
$idgroup=null;
|
||||
if($id!=0) {
|
||||
$groups=$entity->getGroups();
|
||||
if($groups[0]) {
|
||||
if($groups[0]->getFgcanshare()) {
|
||||
$pages=$groups[0]->getPages();
|
||||
if($pages) {
|
||||
$idpage=$pages[0]->getId();
|
||||
$groups=$pages[0]->getGroups();
|
||||
$idgroup=$groups[0]->getId();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Permissions
|
||||
if($access=="config") {
|
||||
$canupdate = true;
|
||||
@ -371,7 +388,10 @@ class CalendarController extends Controller
|
||||
'entity' => $entity,
|
||||
'access' => $access,
|
||||
'canupdate' => $canupdate,
|
||||
'calendars' => $calendars
|
||||
'calendars' => $calendars,
|
||||
'idpage' => $idpage,
|
||||
'idgroup' => $idgroup
|
||||
|
||||
]);
|
||||
|
||||
}
|
||||
|
@ -354,9 +354,10 @@ class ProjectController extends Controller
|
||||
|
||||
// On recherche la premiere page associé au groupe du projet
|
||||
$idpage=null;
|
||||
$idgroup=null;
|
||||
if($id!=0) {
|
||||
$groups=$entity->getGroups();
|
||||
if($groups) {
|
||||
if($groups[0]) {
|
||||
if($groups[0]->getFgcanshare()) {
|
||||
$pages=$groups[0]->getPages();
|
||||
if($pages) {
|
||||
|
@ -202,7 +202,7 @@ class ProjecttaskController extends Controller
|
||||
$groups=$entity->getProject()->getGroups();
|
||||
$idpage=null;
|
||||
$idgroup=null;
|
||||
if($groups) {
|
||||
if($groups[0]) {
|
||||
if($groups[0]->getFgcanshare()) {
|
||||
$pages=$groups[0]->getPages();
|
||||
if($pages) {
|
||||
|
@ -11,7 +11,12 @@
|
||||
<a href='{{ path('cadoles_portal_config_blog_delete', { id: entity.id }) }}' data-method='delete' data-confirm='Êtes-vous sûr de vouloir supprimer ?' title='Supprimer'><i class='fa fa-trash fa-fw'></i></a>
|
||||
</div>
|
||||
{% else %}
|
||||
<br>
|
||||
<div style="margin:10px 0px 10px 0px; text-align:left;height:34px;">
|
||||
{% if not idpage is empty %}
|
||||
<a href="{{path('cadoles_portal_user_page_view',{id:idpage,usage:'group',group:idgroup})}}" class="btn btn-success">Revenir sur le Groupe</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<ul class="nav navbar-default nav-pills">
|
||||
<li id="menublog-0" class="{% if entity.id is not defined %}active{%endif%}" style="cursor:pointer">
|
||||
<a href="{{ path("cadoles_portal_user_blog_view") }}">
|
||||
|
@ -19,7 +19,11 @@
|
||||
{% set blogid=entity.blog.id %}
|
||||
{%endif%}
|
||||
|
||||
<a class="btn btn-default" href='{{ path('cadoles_portal_'~access~'_blog_view',{'id':blogid})}}'>Annuler</a>
|
||||
{% if pageid is empty %}
|
||||
<a class="btn btn-default" href='{{ path('cadoles_portal_'~access~'_blog_view',{'id':blogid})}}'>Annuler</a>
|
||||
{% else %}
|
||||
<a class="btn btn-default" href="{{path('cadoles_core_home',{id:pageid})}}" target="_top">Annuler</a>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% if mode=="update" %}
|
||||
|
@ -31,7 +31,12 @@
|
||||
<a href="{{ path('cadoles_portal_config_blog_view', {id:entity.blog.id})}}">{{ entity.blog.name }}</a>
|
||||
</div>
|
||||
{% else %}
|
||||
<br>
|
||||
<div style="margin:10px 0px 10px 0px; text-align:left; height:34px">
|
||||
{% if not idpage is empty %}
|
||||
<a href="{{path('cadoles_portal_user_page_view',{id:idpage,usage:'group',group:idgroup})}}" class="btn btn-success">Revenir sur le Groupe</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<ul class="nav navbar-default nav-pills">
|
||||
<li id="menublog-0" class="{% if entity.id is not defined %}active{%endif%}" style="cursor:pointer">
|
||||
<a href="{{ path("cadoles_portal_user_blog_view") }}">
|
||||
|
@ -10,24 +10,36 @@
|
||||
<a href='{{ path('cadoles_portal_config_calendar_delete', { id: entity.id }) }}' data-method='delete' data-confirm='Êtes-vous sûr de vouloir supprimer ?' title='Supprimer le panel'><i class='fa fa-trash fa-fw'></i></a>
|
||||
</div>
|
||||
{% else %}
|
||||
<br>
|
||||
<div style="margin:10px 0px 10px 0px; text-align:left;height:34px;">
|
||||
{% if not idpage is empty %}
|
||||
<a href="{{path('cadoles_portal_user_page_view',{id:idpage,usage:'group',group:idgroup})}}" class="btn btn-success">Revenir sur le Groupe</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<ul class="nav navbar-default nav-pills">
|
||||
<li id="menucalendar-0" class="{% if entity.id is not defined %}active{%endif%}" style="cursor:pointer"><a onClick="showCalendar(0,{{ canupdate }})">Tout</a></li>
|
||||
<li id="menucalendar-0" class="{% if entity.id is not defined %}active{%endif%}" style="cursor:pointer">
|
||||
<a href="{{ path("cadoles_portal_user_calendar_view") }}">
|
||||
Tout
|
||||
</a>
|
||||
</li>
|
||||
|
||||
{% for calendar in calendars %}
|
||||
<li id="menucalendar-{{calendar.id}}" data-open="{% if calendar.canupdate %}true{%endif%}" class="{% if entity.id is defined and entity.id==calendar.id%}active{%endif%}" style="cursor:pointer">
|
||||
<a onClick="showCalendar({{ calendar.id }},{{ calendar.canupdate }})">
|
||||
|
||||
|
||||
<a href="{{ path("cadoles_portal_user_calendar_view",{'id':calendar.id}) }}">
|
||||
{% if not calendar.groups is empty %}
|
||||
<i class="fa fa-users fa-fw"></i>
|
||||
{% elseif app.user==calendar.user %}
|
||||
<i class="fa fa-user fa-fw"></i>
|
||||
{%endif%}
|
||||
|
||||
{{ calendar.name }}
|
||||
{% if not calendar.canupdate %}
|
||||
{% if calendar.canupdate %}
|
||||
<i class="fa fa-pencil"></i>
|
||||
{% else %}
|
||||
<i class="fa fa-lock"></i>
|
||||
{% endif %}
|
||||
</a>
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
|
||||
|
@ -29,11 +29,12 @@
|
||||
<a title="Gérer mes Blogs" href='{{ path('cadoles_portal_config_blog') }}' style="{{ stylewidgetmenu }}"><i class="fa fa-plus fa-fw"></i></a>
|
||||
{% else %}
|
||||
{% set idblog = "" %}
|
||||
{% set url= path('cadoles_portal_user_blog_view') %}
|
||||
{% set url= path('cadoles_portal_user_blogarticle_submit') %}
|
||||
{% if usage=="group" and firstblog is defined %}
|
||||
{% set url= path('cadoles_portal_user_blog_view',{id:firstblog}) %}
|
||||
{% set url= path('cadoles_portal_user_blogarticle_submit',{idblog:firstblog,page:entity.page.id}) %}
|
||||
{% endif %}
|
||||
<a title="Gérer mes Blogs" onClick="showFrameitem('blog','{{ url }}',true)" style="{{ stylewidgetmenu }}"><i class="fa fa-plus fa-fw"></i></a>
|
||||
|
||||
<a title="Créer un Article" onClick="showFrameitem('blog','{{ url }}',true)" style="{{ stylewidgetmenu }}"><i class="fa fa-plus fa-fw"></i></a>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
|
@ -30,7 +30,7 @@
|
||||
{% if usage=="group" and firstcalendar is defined %}
|
||||
{% set url= path('cadoles_portal_'~access~'_calendar_view',{id:firstcalendar}) %}
|
||||
{% endif %}
|
||||
<a title="Gérer mes Calendriers" onClick="showFrameitem('calendar','{{ url }}',true)" style="{{ stylewidgetmenu }}"><i class="fa fa-plus fa-fw"></i></a>
|
||||
<a title="Gérer mes Calendriers" onClick="showFrameitem('calendar','{{ url }}',true)" style="{{ stylewidgetmenu }}"><i class="fa fa-calendar fa-fw"></i></a>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
|
@ -60,7 +60,7 @@
|
||||
{% if projecttask.projecttasktag %}
|
||||
{% set colortask = projecttask.projecttasktag.color %}
|
||||
{% endif %}
|
||||
<div class="grid-item-content" style="background-color:#{{ colortask }}">
|
||||
<div class="grid-item-content" style="background-color:#{{ colortask }}; {%if not entity.border%}padding:5px;{%endif%}">
|
||||
<a title="Voir la Tâche" href="{{ path('cadoles_portal_'~access~'_projecttask_view',{'id':projecttask.id,page:entity.page.id}) }}">
|
||||
|
||||
<div class="item-link clearfix">
|
||||
|
@ -11,13 +11,16 @@
|
||||
<a href='{{ path('cadoles_portal_config_project_writer', {id:entity.id}) }}' title='Permission'><i class='fa fa-users fa-fw'></i></a>
|
||||
<a href='{{ path('cadoles_portal_config_project_delete', { id: entity.id }) }}' data-method='delete' data-confirm='Êtes-vous sûr de vouloir supprimer ?' title='Supprimer'><i class='fa fa-trash fa-fw'></i></a>
|
||||
</div>
|
||||
<div style="margin:10px 0px 10px 0px; text-align:left; display:inline-block;width:49%"></div>
|
||||
{% endif %}
|
||||
|
||||
<div style="margin:10px 0px 10px 0px; text-align:left; display:inline-block;width:49%">
|
||||
{% if not idpage is empty %}
|
||||
<a href="{{path('cadoles_portal_user_page_view',{id:idpage,usage:'group',group:idgroup})}}" class="btn btn-success">Revenir sur le Groupe</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if access!="config" %}
|
||||
<div style="margin:10px 0px 10px 0px; text-align:left; display:inline-block;width:49%">
|
||||
{% if not idpage is empty %}
|
||||
<a href="{{path('cadoles_portal_user_page_view',{id:idpage,usage:'group',group:idgroup})}}" class="btn btn-success">Revenir sur le Groupe</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div style="margin:10px 0px 10px 0px; text-align:right; display:inline-block;width:50%">
|
||||
<label for="alltask" class="control-label">Afficher les tâches fermées</label>
|
||||
|
Loading…
Reference in New Issue
Block a user