From eaffbfae0f6d1d39ba95f66e1f0b78c5b08f3d8d Mon Sep 17 00:00:00 2001 From: afornerot Date: Tue, 3 Sep 2019 10:05:18 +0200 Subject: [PATCH] lot 11 --- .../CoreBundle/Command/data/core-init-01.sql | 2 +- .../PortalBundle/Command/InitDataCommand.php | 4 +-- .../Controller/PagewidgetController.php | 11 +++---- .../views/Pagewidget/viewbookmark.html.twig | 16 +++++++++- .../views/Pagewidget/viewfile.html.twig | 18 +++++++++++ .../views/Pagewidget/viewgroup.html.twig | 30 +++++++++++++++++++ .../views/Pagewidget/viewitem.html.twig | 24 +++++++++++---- .../Pagewidget/viewitemessential.html.twig | 19 ++++++++++++ 8 files changed, 110 insertions(+), 14 deletions(-) diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/data/core-init-01.sql b/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/data/core-init-01.sql index eb904f81..6b956f03 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/data/core-init-01.sql +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/data/core-init-01.sql @@ -8,7 +8,7 @@ INSERT IGNORE INTO `niveau01` (`id`, `label`, `siren`) VALUES (-100, 'DRAAF', '130007107'); INSERT IGNORE INTO `user` (`id`, `niveau01_id`, `username`, `firstname`, `lastname`, `password`, `email`, `avatar`, `role`,`siren`,`authlevel`) VALUES -(-100, -100, 'admin', 'Administrateur', 'draaf', '{SSHA}2lrfIFu4o8CCYONiX7428WmRj4YYhRO2 +(-100, -100, 'admin', 'Administrateur', 'draaf', '{SSHA}wTxgoh4oDctfUvQYMDCurI6uofNO2oRA ', 'admin@ldapbundle.ac-arno.fr', 'admin.jpg', 'ROLE_ADMIN', '130007107', 'simple'); diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Command/InitDataCommand.php b/src/ninegate-1.0/src/Cadoles/PortalBundle/Command/InitDataCommand.php index 2299e5ed..c0421f63 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Command/InitDataCommand.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Command/InitDataCommand.php @@ -637,8 +637,8 @@ class InitDataCommand extends ContainerAwareCommand $entityWidget->setId(-1870); $entityWidget->setRoworder(14); $entityWidget->setIcon($entityicon); - $entityWidget->setName('Applications Externe'); - $entityWidget->setDescription("Afficher des informations provenant de vos applications"); + $entityWidget->setName('Mes Formulaires'); + $entityWidget->setDescription("Afficher vos formulaires provenant de vos applications"); $entityWidget->setRouteview("cadoles_portal_config_panelwidget_view_appexternal"); $entityWidget->setHeight("630"); $entityWidget->setAutoajust(true); diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/PagewidgetController.php b/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/PagewidgetController.php index 3a313dc9..1fa1ae4d 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/PagewidgetController.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/PagewidgetController.php @@ -578,6 +578,7 @@ class PagewidgetController extends Controller 'search' => $search, 'menu' => $menu, 'menuall' => $menuall, + 'withbookmark' => $withbookmark, ]); } @@ -1800,8 +1801,8 @@ class PagewidgetController extends Controller $files=[]; $fs = new Filesystem(); - if($fs->exists($directory."/survey.json")) { - $file=file_get_contents($directory."/survey.json"); + if($fs->exists($directory."/invitation.json")) { + $file=file_get_contents($directory."/invitation.json"); $json = substr($file, 0, -2); // sup dernier , $surveys = json_decode("{".$json."}", true); if(is_array($surveys)) { @@ -1821,13 +1822,13 @@ class PagewidgetController extends Controller $files=[]; $fs = new Filesystem(); - if($fs->exists($directory."/course.json")) { - $file=file_get_contents($directory."/course.json"); + if($fs->exists($directory."/invitation.json")) { + $file=file_get_contents($directory."/invitation.json"); $json = substr($file, 0, -2); // sup dernier , $courses = json_decode("{".$json."}", true); if(is_array($courses)) { foreach($courses as $id => $course) { - array_push($items,["id"=>$id,"title"=>$course["title"],"subtitle"=>"Sondage","url"=>$course["url"],"itemcategory"=>$category,"color"=>"f77f11","icon"=>"icon_moodle.png"]); + array_push($items,["id"=>$id,"title"=>$course["title"],"subtitle"=>"Cours","url"=>$course["url"],"itemcategory"=>$category,"color"=>"f77f11","icon"=>"icon_moodle.png"]); } } } diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewbookmark.html.twig b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewbookmark.html.twig index 86369dd3..8d226469 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewbookmark.html.twig +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewbookmark.html.twig @@ -9,6 +9,7 @@ {% set stylewidgetmenu = constants.mystylewidgetmenu(entity) %} {% set stylewidgetheader = constants.mystylewidgetheader(entity) %} {% set stylewidgetbody = constants.mystylewidgetbody(entity) %} +{% set color = app.session.get('color') %} {% if modedesktop==0 %} {% set stylegrid="" %} @@ -49,7 +50,7 @@ {{ entity.name }} - {% if bookmarks is not empty %} + {% if bookmarks is not empty or canupdate %}
@@ -88,6 +89,19 @@
{% endfor %} + +
+
+ +
+
diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewfile.html.twig b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewfile.html.twig index 023ccc03..0c48797d 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewfile.html.twig +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewfile.html.twig @@ -88,6 +88,24 @@ {% endfor %} + + {% if canadd %} +
+ +
+ {% endif %} {% endif %} diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewgroup.html.twig b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewgroup.html.twig index cec8dc8d..1d7ac634 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewgroup.html.twig +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewgroup.html.twig @@ -11,6 +11,11 @@ {% set stylewidgetbody = constants.mystylewidgetbody(entity) %} {% set stylewidgetbodyreverse = constants.mystylewidgetbodyreverse(entity) %} +{% set permgroup = app.session.get('permgroup') %} +{% set canadd = false %} +{% if is_granted('ROLE_ADMIN') or is_granted('ROLE_MODO') or (is_granted('ROLE_ANIM') and (permgroup=="ROLE_ADMIN" or permgroup=="ROLE_USER")) or (is_granted('ROLE_USER') and permgroup=="ROLE_USER") %} + {% set canadd = true %} +{% endif %}
{% if canupdate %} @@ -19,6 +24,12 @@ {% endif %} + + {% if canadd %} + + + + {% endif %}
{% endif %} @@ -30,6 +41,8 @@ {% endif %} {{ entity.name }} + +
@@ -56,6 +69,23 @@
{% endfor %} + + {% if canadd %} +
+ +
+ + + +
+ Ajouter un groupe +
+
+
+
+ {% endif %} diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewitem.html.twig b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewitem.html.twig index 4e11468e..bf4a4663 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewitem.html.twig +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewitem.html.twig @@ -86,12 +86,10 @@ {% endif %} - {% if bookmarks is not empty %} + {% if (bookmarks is not empty or (canadd and access!="config")) and (withbookmark==0 or withbookmark==2) %}
{% if items is not empty %}

Favoris

- {% else %} -

{% endif %}
@@ -127,6 +125,22 @@
{% endfor %} + + {% if (canadd and access!="config") %} +
+
+ +
+
+ {% endif %} {% endif %} @@ -141,7 +155,7 @@ {% if loop.index ==1 %} {% set haveitem=true %} - {% if bookmarks is not empty %} + {% if (bookmarks is not empty or (canadd and access!="config")) and (withbookmark==0 or withbookmark==2) %} {% set toview=true %} {% if menu and not menuall%} {% set toview=false %} @@ -164,7 +178,7 @@ {% set style="display:none;" %} {% endif %} - {% if mycategs|length > 1 or bookmarks is not empty %} + {% if mycategs|length > 1 or ((bookmarks is not empty or (canadd and access!="config")) and (withbookmark==0 or withbookmark==2)) %}

{{ itemcategory.label }}

{% else %}

diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewitemessential.html.twig b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewitemessential.html.twig index 69a7730d..7f5e72b0 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewitemessential.html.twig +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewitemessential.html.twig @@ -11,6 +11,7 @@ {% set stylewidgetheader = constants.mystylewidgetheader(entity) %} {% set stylewidgetbody = constants.mystylewidgetbody(entity) %} + {% if modedesktop==0 %} {% set stylegrid="" %} {% elseif modedesktop==1 %} @@ -141,6 +142,24 @@ {% endfor %} + + {% if canadd %} +
+ +
+ {% endif %}