From 8c9bd2f8b03976c35546a0e69f71a1633db8b296 Mon Sep 17 00:00:00 2001 From: afornerot Date: Tue, 17 Dec 2019 10:47:09 +0100 Subject: [PATCH 1/4] =?UTF-8?q?autoriser=20plus=20de=20caract=C3=A8res=20d?= =?UTF-8?q?ans=20le=20nom=20des=20groupes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ninegate-1.0/src/Cadoles/CoreBundle/Command/OnlyCommand.php | 1 - .../src/Cadoles/CoreBundle/Command/data/core-init-01.sql | 2 +- .../src/Cadoles/CoreBundle/Controller/GroupController.php | 2 +- .../src/Cadoles/CoreBundle/Controller/Niveau01Controller.php | 2 +- .../src/Cadoles/CoreBundle/Controller/Niveau02Controller.php | 2 +- .../src/Cadoles/CoreBundle/Resources/views/Group/edit.html.twig | 2 +- .../Cadoles/CoreBundle/Resources/views/Niveau01/edit.html.twig | 2 +- .../Cadoles/CoreBundle/Resources/views/Niveau02/edit.html.twig | 2 +- 8 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/OnlyCommand.php b/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/OnlyCommand.php index e561679b..4bf94b89 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/OnlyCommand.php +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/OnlyCommand.php @@ -108,7 +108,6 @@ class OnlyCommand extends Command $this->writeln($this->only_url); $this->writeln($this->only_host); $this->writeln($this->only_user); - $this->writeln($this->only_password); if($this->only_sync) { // Only Office est-il dans le domaine 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 9dd73405..7cb69baf 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}XeJxoO2l4dkHFX78WQ1Ik30sjLt3kffh +(-100, -100, 'admin', 'Administrateur', 'draaf', '{SSHA}iEIczoPGRG4AD3gT80NOruss2uA94dV9 ', 'admin@ldapbundle.ac-arno.fr', 'admin.jpg', 'ROLE_ADMIN', '130007107', 'simple'); diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/GroupController.php b/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/GroupController.php index 7dbc9c04..dc4c379d 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/GroupController.php +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/GroupController.php @@ -1025,7 +1025,7 @@ class GroupController extends Controller if($tmp) $form->addError(new FormError('Un niveau de rang 02 utilise déjà ce label')); // On s'assure que le label ne contient pas des caractères speciaux - $string = preg_replace('~[^ @a-zA-Z0-9._-]~', '', $data->getLabel()); + $string = preg_replace('~[^ éèêôöàïî\'@a-zA-Z0-9._-]~', '', $data->getLabel()); if($string!=$data->getLabel()) { $form->addError(new FormError('Caractères interdit dans ce label')); diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/Niveau01Controller.php b/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/Niveau01Controller.php index 14701547..d33cf22c 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/Niveau01Controller.php +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/Niveau01Controller.php @@ -284,7 +284,7 @@ class Niveau01Controller extends Controller if($tmp) $form->addError(new FormError('Un niveau de rang 02 utilise déjà ce label')); // On s'assure que le label ne contient pas des caractères speciaux - $string = preg_replace('~[^ @a-zA-Z0-9._-]~', '', $data->getLabel()); + $string = preg_replace('~[^ éèêôöàïî\'@a-zA-Z0-9._-]~', '', $data->getLabel()); if($string!=$data->getLabel()) { $form->addError(new FormError('Caractères interdit dans ce label')); diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/Niveau02Controller.php b/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/Niveau02Controller.php index 27366b37..a64c1b4a 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/Niveau02Controller.php +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/Niveau02Controller.php @@ -269,7 +269,7 @@ class Niveau02Controller extends Controller if($tmp) $form->addError(new FormError('Un niveau de rang 01 utilise déjà ce label')); // On s'assure que le label ne contient pas des caractères speciaux - $string = preg_replace('~[^ @a-zA-Z0-9._-]~', '', $data->getLabel()); + $string = preg_replace('~[^ éèêôöàïî\'@a-zA-Z0-9._-]~', '', $data->getLabel()); if($string!=$data->getLabel()) { $form->addError(new FormError('Caractères interdit dans ce label')); diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Group/edit.html.twig b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Group/edit.html.twig index ef997617..e6144d3f 100755 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Group/edit.html.twig +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Group/edit.html.twig @@ -46,7 +46,7 @@ {% if form.label is defined %} {{ form_row(form.label) }}
- Caractères interdits = accent, caractères spéciaux sauf @ . - _
+ Caractères interdits = caractères spéciaux sauf ' @ . - _
{% if form.fgassoc is defined %} diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Niveau01/edit.html.twig b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Niveau01/edit.html.twig index 6312241d..b7799e5b 100755 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Niveau01/edit.html.twig +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Niveau01/edit.html.twig @@ -41,7 +41,7 @@
{{ form_row(form.label) }}
- Caractères interdits = accent, caractères spéciaux sauf @ . - _
+ Caractères interdits = caractères spéciaux sauf ' @ . - _
{{ form_row(form.siren) }} diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Niveau02/edit.html.twig b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Niveau02/edit.html.twig index e6d973a6..89e31b0a 100755 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Niveau02/edit.html.twig +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Niveau02/edit.html.twig @@ -42,7 +42,7 @@ {{ form_row(form.niveau01) }} {{ form_row(form.label) }}
- Caractères interdits = accent, caractères spéciaux sauf @ . - _
+ Caractères interdits = caractères spéciaux sauf ' @ . - _
{{ form_row(form.siret) }} From e124f3617d3a9634ef3ca7c7050422b037a9c735 Mon Sep 17 00:00:00 2001 From: afornerot Date: Tue, 17 Dec 2019 11:14:49 +0100 Subject: [PATCH 2/4] ajout item fluxbb (fixes #66) --- dicos/90_ninegate.xml | 33 ++++++++++++++++++ .../CoreBundle/Command/data/core-init-01.sql | 2 +- .../PortalBundle/Command/InitDataCommand.php | 23 ++++++++++++ .../web/uploads/icon/icon_fluxbb.png | Bin 0 -> 6425 bytes tmpl/ninegate-template.yml | 7 ++++ 5 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 src/ninegate-1.0/web/uploads/icon/icon_fluxbb.png diff --git a/dicos/90_ninegate.xml b/dicos/90_ninegate.xml index 80cb3a67..7b235ac7 100644 --- a/dicos/90_ninegate.xml +++ b/dicos/90_ninegate.xml @@ -31,6 +31,7 @@ + @@ -173,6 +174,12 @@ + + + non + + + non @@ -314,6 +321,7 @@ Paramètres associés à Dokuwiki Paramètres associés à eConnect Paramètres associés à Etherhome + Paramètres associés à Fluxbb Paramètres associés à GEPI Paramètres associés à Grr Paramètres associés à Kanboard @@ -471,6 +479,7 @@ ninegate_activate_widdokuwiki ninegate_activate_wideconnect ninegate_activate_widetherhome + ninegate_activate_widfluxbb ninegate_activate_widgepi ninegate_activate_widgrr ninegate_activate_widkanboard @@ -674,6 +683,30 @@ + + + oui + activer_fluxbb + oui + non + non + + + + non + + ninegate_widfluxbb_url + + + + oui + activer_fluxbb + /fluxbb + None + + + + oui 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 7cb69baf..fdebccb3 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}iEIczoPGRG4AD3gT80NOruss2uA94dV9 +(-100, -100, 'admin', 'Administrateur', 'draaf', '{SSHA}hTAPycxp8kXFhZIjteFA4fsB2CQcIenW ', '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 5b4fd08b..216cdd32 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Command/InitDataCommand.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Command/InitDataCommand.php @@ -43,6 +43,7 @@ class InitDataCommand extends ContainerAwareCommand $activate_widdokuwiki = $this->getContainer()->getParameter('activate_widdokuwiki'); $activate_wideconnect = $this->getContainer()->getParameter('activate_wideconnect'); $activate_widetherhome = $this->getContainer()->getParameter('activate_widetherhome'); + $activate_widfluxbb = $this->getContainer()->getParameter('activate_widfluxbb'); $activate_widgepi = $this->getContainer()->getParameter('activate_widgepi'); $activate_widgrr = $this->getContainer()->getParameter('activate_widgrr'); $activate_widkanboard = $this->getContainer()->getParameter('activate_widkanboard'); @@ -354,6 +355,28 @@ class InitDataCommand extends ContainerAwareCommand $em->persist($entityItem); } + // Item fluxbb + if($activate_widfluxbb) { + $widfluxbb_url =$this->getContainer()->getParameter('widfluxbb_url'); + $entityItem = $em->getRepository('CadolesPortalBundle:Item')->find(-397); + if(!$entityItem) { + $entityicon = $em->getRepository('CadolesPortalBundle:Icon')->findoneby(["label"=>"uploads/icon/icon_fluxbb.png"]); + + $entityItem = new Item(); + $entityItem->setId(-397); + $entityItem->setRowOrder(0); + $entityItem->setTitle('Fluxbb'); + $entityItem->SetSubtitle("Forum"); + $entityItem->setIcon($entityicon); + $entityItem->setTarget("_blank"); + $entityItem->setItemcategory($entityItemcategoryapp); + $entityItem->setEssential(true); + $entityItem->addGroup($groupall); + } + $entityItem->setUrl($widfluxbb_url); + $em->persist($entityItem); + } + // Item gepi if($activate_widgepi) { $widgepi_url =$this->getContainer()->getParameter('widgepi_url'); diff --git a/src/ninegate-1.0/web/uploads/icon/icon_fluxbb.png b/src/ninegate-1.0/web/uploads/icon/icon_fluxbb.png new file mode 100644 index 0000000000000000000000000000000000000000..ff9d8c281c6731851b00b530afc2cdbf75680cdb GIT binary patch literal 6425 zcmV+!8Rq7RP)!zEEK34x3G4vNk|lvH zFvc<)*laL9W~A|8Z-|I>>@EZg?6L$q9Kiy{K%m$S)+~gik;byMU=D{5FqRfu8eJv; zS+=oGW673eNi))1edgOARn=WxT|M1Zon6&q>+8tquI%c}*Of0b-}~}q72z!g253)5 z$LuuGl?2QN(Pa$GBw#v#Rt8!Lhy#cMXfl5`0wBdef`HQiP7`pFf!Dx%L=YVkQoeLe zU*BN@IIRCx3sBesREzChT^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Z->ktveXDJf%?A3SeQ&4L9hqOD?&Q znC~E>+Zd>uAbbY~0Q`c99!|dY+V7Tc-C9`$N{E;c3Sh^+_V(ydEOtEuH^WF*hA9s- z?;|0e1ksaI#>RdhhAUSMCY%B|v8%g#hRkG^GO!fDwEz|Xm|COi&H~sAU^j@KqfBO- zs=$n}FyR%z4gKBSmm!_Lf`Hi|x{Qft0%!wsD}Yu2jW7aYEfQ)7Kn4aWa~eda!F+;% n*BCg=z+sm1C6$2~^@9HgrN)lD$b1k600000NkvXXu0mjfYUt`g literal 0 HcmV?d00001 diff --git a/tmpl/ninegate-template.yml b/tmpl/ninegate-template.yml index 86b4a5ed..d51bb12b 100644 --- a/tmpl/ninegate-template.yml +++ b/tmpl/ninegate-template.yml @@ -220,6 +220,13 @@ parameters: activate_widetherhome: false %end if +%if %%getVar("ninegate_activate_widfluxbb", 'non') == "oui" + activate_widfluxbb: true + widfluxbb_url: %%ninegate_widfluxbb_url +%else + activate_widfluxbb: false +%end if + %if %%getVar("ninegate_activate_widgepi", 'non') == "oui" activate_widgepi: true widgepi_url: %%ninegate_widgepi_url From 4d7d0fd82be095ece2a84e43c9ab274237bb226b Mon Sep 17 00:00:00 2001 From: afornerot Date: Tue, 17 Dec 2019 14:56:15 +0100 Subject: [PATCH 3/4] widget only --- .../CoreBundle/Command/data/core-init-01.sql | 2 +- .../PortalBundle/Command/InitDataCommand.php | 51 ++++++- .../Controller/PagewidgetController.php | 36 ++++- .../PortalBundle/Resources/config/routing.yml | 8 ++ .../Resources/config/services.yml | 5 + .../views/Pagewidget/viewonlydoc.html.twig | 117 +++++++++++++++++ .../PortalBundle/Service/onlyService.php | 124 ++++++++++++++++++ .../web/uploads/icon/icon_onlyoffice.png | Bin 0 -> 9820 bytes 8 files changed, 340 insertions(+), 3 deletions(-) create mode 100644 src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewonlydoc.html.twig create mode 100644 src/ninegate-1.0/src/Cadoles/PortalBundle/Service/onlyService.php create mode 100644 src/ninegate-1.0/web/uploads/icon/icon_onlyoffice.png 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 fdebccb3..949a0a76 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}hTAPycxp8kXFhZIjteFA4fsB2CQcIenW +(-100, -100, 'admin', 'Administrateur', 'draaf', '{SSHA}Kvz21GjhkryG4l7EKniMJzVfwDufa+eI ', '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 216cdd32..a4e56586 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Command/InitDataCommand.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Command/InitDataCommand.php @@ -51,6 +51,7 @@ class InitDataCommand extends ContainerAwareCommand $activate_widmindmaps = $this->getContainer()->getParameter('activate_widmindmaps'); $activate_widmoodle = $this->getContainer()->getParameter('activate_widmoodle'); $activate_widnextcloud = $this->getContainer()->getParameter('activate_widnextcloud'); + $activate_widonlyoffice = $this->getContainer()->getParameter('activate_widonlyoffice'); $activate_widopensondage = $this->getContainer()->getParameter('activate_widopensondage'); $activate_widphpldapadmin = $this->getContainer()->getParameter('activate_widphpldapadmin'); $activate_widpiwik = $this->getContainer()->getParameter('activate_widpiwik'); @@ -58,6 +59,8 @@ class InitDataCommand extends ContainerAwareCommand $activate_widsacoche = $this->getContainer()->getParameter('activate_widsacoche'); $activate_widwordpress = $this->getContainer()->getParameter('activate_widwordpress'); $activate_websocket = $this->getContainer()->getParameter('websocket_activate'); + + $widonlyoffice_sync = $this->getContainer()->getParameter('widonlyoffice_sync'); $output->writeln('PORTAL = Default Data'); @@ -530,7 +533,29 @@ class InitDataCommand extends ContainerAwareCommand $entityItem->setUrl($widnextcloud_url); $em->persist($entityItem); } - + + // Item Onlyoffice + if($activate_widonlyoffice) { + $widonlyoffice_url =$this->getContainer()->getParameter('widonlyoffice_url'); + $entityItem = $em->getRepository('CadolesPortalBundle:Item')->find(-1000); + if(!$entityItem) { + $entityicon = $em->getRepository('CadolesPortalBundle:Icon')->findoneby(["label"=>"uploads/icon/icon_onlyoffice.png"]); + + $entityItem = new Item(); + $entityItem->setId(-1000); + $entityItem->setRowOrder(0); + $entityItem->setTitle('Onlyoffice'); + $entityItem->SetSubtitle("Application Bureautique"); + $entityItem->setIcon($entityicon); + $entityItem->setTarget("_blank"); + $entityItem->setItemcategory($entityItemcategoryapp); + $entityItem->setEssential(true); + $entityItem->addGroup($groupall); + } + $entityItem->setUrl($widonlyoffice_url); + $em->persist($entityItem); + } + // Item Opensondage if($activate_widopensondage) { $widopensondage_url =$this->getContainer()->getParameter('widopensondage_url'); @@ -1059,6 +1084,30 @@ class InitDataCommand extends ContainerAwareCommand $entityWidget->setParameter($parameter); $em->persist($entityWidget); + // Onlyoffice document + $entityWidget = $em->getRepository('CadolesPortalBundle:Widget')->find(-1810); + if($widonlyoffice_sync) { + if(!$entityWidget) $entityWidget = new Widget(); + $entityicon = $em->getRepository('CadolesPortalBundle:Icon')->findoneby(["label"=>"uploads/icon/icon_onlyoffice.png"]); + $entityWidget->setId(-1810); + $entityWidget->setRoworder(2); + $entityWidget->setIcon($entityicon); + $entityWidget->setName('Documents Onlyoffice'); + $entityWidget->setDescription("Les documents associés à votre groupe"); + $entityWidget->setRouteview("cadoles_portal_config_panelwidget_view_onlydoc"); + $entityWidget->setHeight("630"); + $entityWidget->setAutoajust(true); + $entityWidget->setBorder(false); + $entityWidget->setOpened(true); + $entityWidget->setAccess(["config","group"]); + $parameter = json_decode('{"fields": []}'); + $entityWidget->setParameter($parameter); + $em->persist($entityWidget); + } + elseif($entityWidget) { + $em->remove($entityWidget); + } + // Widget Séparateur $entityWidget = $em->getRepository('CadolesPortalBundle:Widget')->find(-1600); if(!$entityWidget) $entityWidget = new Widget(); 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 187e21f7..7000cd55 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/PagewidgetController.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/PagewidgetController.php @@ -2107,7 +2107,41 @@ class PagewidgetController extends Controller 'nbarticle' => $nbarticle, ]); - } + } + + public function viewOnlydocAction(Request $request,$id,$access="config") { + $usage=$request->query->get('usage'); + $group=$request->query->get('group'); + $user=$this->getUser(); + + $em = $this->getDoctrine()->getManager(); + $entity = $em->getRepository($this->labelentity)->find($id); + if (!$entity) throw $this->createNotFoundException('Unable to find entity.'); + + // Permissions + if($access=="config") { + $canupdate = true; + } + else { + // On s'assure que l'utilisateur à la permission de voir + $page=$entity->getPage(); + $em->getRepository("CadolesPortalBundle:Page")->getPermission($this->getUser(),$page,$cansee,$canupdate); + if(!$cansee) throw $this->createNotFoundException('Permission denied'); + } + $onlyservice = $this->container->get('cadoles.portal.service.only'); + $files=$onlyservice->getDocument($group, $folders, $firstfolder); + + // Render + return $this->render($this->labelentity.':viewonlydoc.html.twig', [ + 'entity' => $entity, + 'canadd' => $canupdate, + 'canupdate' => $canupdate, + 'firstfolder' => $firstfolder, + 'folders' => $folders, + 'files' => $files, + 'access' => $access, + ]); + } } diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/config/routing.yml b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/config/routing.yml index 7d56b011..6e2c5af4 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/config/routing.yml +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/config/routing.yml @@ -795,6 +795,10 @@ cadoles_portal_config_panelwidget_view_groupmessage: path: /config/pagewidget/view/groupmessage/{id} defaults: { _controller: CadolesPortalBundle:Pagewidget:viewgroupmessage, access: config } +cadoles_portal_config_panelwidget_view_onlydoc: + path: /config/pagewidget/view/onlydoc/{id} + defaults: { _controller: CadolesPortalBundle:Pagewidget:viewonlydoc, access: config } + #-- Access user cadoles_portal_user_pagewidget_widget_sumbit: path: /user/pagewidget/submit/{idpage}/{idwidgettype} @@ -904,3 +908,7 @@ cadoles_portal_user_panelwidget_view_groupmessage: path: /pagewidget/view/groupmessage/{id} defaults: { _controller: CadolesPortalBundle:Pagewidget:viewgroupmessage, access: user } +cadoles_portal_user_panelwidget_view_onlydoc: + path: /pagewidget/view/onlydoc/{id} + defaults: { _controller: CadolesPortalBundle:Pagewidget:viewonlydoc, access: user } + diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/config/services.yml b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/config/services.yml index 56f25a36..b24f48a7 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/config/services.yml +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/config/services.yml @@ -4,3 +4,8 @@ services: arguments: ['@service_container'] tags: - { name: form.type } + + cadoles.portal.service.only: + public: true + class: Cadoles\PortalBundle\Service\onlyService + arguments: ['@service_container','@doctrine.orm.entity_manager'] diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewonlydoc.html.twig b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewonlydoc.html.twig new file mode 100644 index 00000000..a49bc642 --- /dev/null +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewonlydoc.html.twig @@ -0,0 +1,117 @@ +{% set theme = app.session.get('theme') %} +{% if theme is not empty %} + {{ include('@Theme/'~theme~'/function.html.twig') }} +{% endif %} + +{% import "@CadolesPortal/Pagewidget/constants.twig" as constants %} + +{% set stylewidget = constants.mystylewidget(entity) %} +{% set stylewidgetmenu = constants.mystylewidgetmenu(entity) %} +{% set stylewidgetheader = constants.mystylewidgetheader(entity) %} +{% set stylewidgetbody = constants.mystylewidgetbody(entity) %} +{% set stylewidgetbodyreverse = constants.mystylewidgetbodyreverse(entity) %} + +{% set color = app.session.get('color') %} + +{% set colorbodyback = entity.colorbodyback %} +{% if colorbodyback is null %} + {% set colorbodyback = color['main'] %} +{% endif %} + + +{% set colorbodyfont = entity.colorbodyfont %} +{% if colorbodyfont is null %} + {% set colorbodyfont = color['fontcolorhover'] %} +{% endif %} + +
+ {% if canupdate or canadd %} +
+ {% if canupdate %} + + + {% endif %} + + {% if canadd %} + + {% endif %} +
+ {% endif %} + + +
+ {% if entity.icon %} + + {% else %} + + {% endif %} + {{ entity.name }} +
+ + {% if files|length >= 1 or canupdate %} +
+
+ {% if canupdate %} +
+
+ {% endif %} + + {% for file in files|sort %} + {% if loop.index==1 and not canupdate%} +
+
+ {% endif %} + +
+
+ {% if canadd %} + + + + {% endif %} + + {% if file.minefamily=="text" or file.minefamily=="image" or file.minetype == "application/pdf" %} + + {% else %} + + {% endif %} + + +
+
+ {% endfor %} + + {% if canadd %} +
+
+ +
+
+ {% endif %} +
+
+ {% endif %} +
+ + + diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Service/onlyService.php b/src/ninegate-1.0/src/Cadoles/PortalBundle/Service/onlyService.php new file mode 100644 index 00000000..0558b75a --- /dev/null +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Service/onlyService.php @@ -0,0 +1,124 @@ +container = $container; + $this->em = $em; + + $this->only_activate = $this->container->getParameter('activate_widonlyoffice'); + if($this->only_activate) { + $this->only_activate=$this->container->getParameter('widonlyoffice_sync'); + if($this->only_activate) { + $this->only_url = $this->container->getParameter('widonlyoffice_url')."/api/2.0/"; + $this->only_user = $this->container->getParameter('widonlyoffice_user'); + $this->only_password = $this->container->getParameter('widonlyoffice_password'); + $this->only_host = str_replace("https://","",str_replace("http://","",$this->container->getParameter("widonlyoffice_url"))); + } + } + } + + public function getDocument($idproject,&$folders,&$firstfolder) { + $files=[]; + $folders=[]; + + if($this->only_activate) { + if($this->authOnly()) { + $response = \Unirest\Request::get($this->only_url.'/project/'.$idproject,$this->headers); + if($this->koresponse($response)) return false; + $firstfolder=$response->body->response->projectFolder;; + + $response = \Unirest\Request::get($this->only_url.'/project/'.$idproject.'/files',$this->headers); + if($this->koresponse($response)) return 0; + foreach($response->body->response->files as $fileonly) { + array_push($files,$fileonly); + } + foreach($response->body->response->folders as $folderonly) { + $folders[$folderonly->id]=$folderonly; + $subfolder=$this->scanfolder($folderonly->id,$folders,$this->headers); + foreach($subfolder as $file) { + array_push($files,$file); + } + } + } + } + + return $files; + } + + private function authOnly() { + // Only Office est-il dans le domaine + if(stripos($this->only_url,"/")===0) + $this->only_url="https://".$this->container->getParameter("weburl").$this->only_url; + $indomaine = (stripos($this->only_url,$this->container->getParameter("weburl"))!==false); + + // Si hors domaine on utilise le proxy si proxy il y a + if(!$indomaine) { + $PROXYactivate = $this->em->getRepository("CadolesCoreBundle:Config")->find("PROXYactivate")->getValue(); + if($PROXYactivate) { + $PROXYserver = $this->em->getRepository("CadolesCoreBundle:Config")->find("PROXYserver")->getValue(); + $PROXYport = $this->em->getRepository("CadolesCoreBundle:Config")->find("PROXYport")->getValue(); + \Unirest\Request::proxy($PROXYserver, $PROXYport, CURLPROXY_HTTP, true); + } + } + + \Unirest\Request::verifyPeer(false); + \Unirest\Request::verifyHost(false); + \Unirest\Request::timeout(5); + $this->headers = ['Host' => $this->only_host, 'Accept' => 'application/json','Content-Type'=>'application/json','Retry-After'=>'5']; + $query = array('userName' => $this->only_user, 'password' => $this->only_password); + $body = \Unirest\Request\Body::json($query); + + $response = \Unirest\Request::post($this->only_url.'/authentication',$this->headers,$body); + if($this->koresponse($response)) return false; + $token=$response->body->response->token; + $this->headers["Authorization"]=$token; + return true; + } + + private function koresponse($response) { + if($response->code>=Response::HTTP_BAD_REQUEST) { + $this->mydebug("ERREUR ".$response->code); + if(property_exists($response,"body") && property_exists($response->body,"error")) $this->mydebug("ERREUR ".$response->body->error->message);; + return true; + } + + return false; + } + + private function scanfolder($folderid,&$folders,$headers) { + $files=[]; + $response = \Unirest\Request::get($this->only_url.'/files/'.$folderid,$headers); + if($this->koresponse($response)) return 0; + foreach($response->body->response->files as $fileonly) { + array_push($files,$fileonly); + } + foreach($response->body->response->folders as $folderonly) { + $folders['"'.$folderonly->id.'"']=$folderonly; + $subfolder=$this->scanfolder($folderonly->id,$folders,$headers); + foreach($subfolder as $file) { + array_push($files,$file); + } + } + + return $files; + } + +} diff --git a/src/ninegate-1.0/web/uploads/icon/icon_onlyoffice.png b/src/ninegate-1.0/web/uploads/icon/icon_onlyoffice.png new file mode 100644 index 0000000000000000000000000000000000000000..1579862e8a3c5bd3d5c46940746e47d298669db9 GIT binary patch literal 9820 zcmV-iCZpMjP)W4*S~2zC`FV(}iB0SuNA8e}8DTrvnt2n3SQ zIU3E~(>>Ey^-*W$@9iI%b#+%?(^b_Y&^MyHtFwOjd$01n-@ASKFfdph>h^f|r~E zTzAXxJ&Z_a3E(is+2iCBo9-0kL(QV`%K(J~ zuilZmWB>mBwi)v`MFIBg*&oX%Cl8A9Tg{mNmkz35NxPlz{oZHx=NdhA!xdo9p5N~% z#1mge5N_#C{s`srrSZ11P%%u!x*2TS!gyj0R_eP<#|HG|hUl9H>%x%Q1@y%ZXWbS}YK$7Q5_1EcNzbQH!}GkucY z>>x({)-k<2ykRKU@#nxFFZP5*EBWrdw_lIyHD6Z6XVHs1ZEi>X9_W! zr+4}^YceNE6sH=;X7iv1`L6+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:21 +0100 Subject: [PATCH 4/4] widget only --- .../CoreBundle/Controller/GroupController.php | 7 ++ .../Controller/PagewidgetController.php | 9 +- .../views/Pagewidget/viewonlydoc.html.twig | 84 +++++++++---------- .../PortalBundle/Service/onlyService.php | 51 +++++++---- 4 files changed, 88 insertions(+), 63 deletions(-) diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/GroupController.php b/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/GroupController.php index dc4c379d..ce6ed4ea 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/GroupController.php +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/GroupController.php @@ -501,6 +501,13 @@ class GroupController extends Controller if($group->getFgAll()||$group->getFgtemplate()) throw $this->createNotFoundException('Permission denied'); + $usergroup = $em->getRepository("CadolesCoreBundle:Usergroup")->findOneBy(array("user"=>$userid,"group"=>$groupid)); + if($usergroup) { + $response = new Response(json_encode($output)); + $response->headers->set('Content-Type', 'application/json'); + return $response; + } + $key = Uuid::uuid4(); $usergroup=new Usergroup; $user=$em->getRepository("CadolesCoreBundle:User")->find($userid); 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 7000cd55..bdbb6e3f 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/PagewidgetController.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/PagewidgetController.php @@ -2129,15 +2129,18 @@ class PagewidgetController extends Controller if(!$cansee) throw $this->createNotFoundException('Permission denied'); } $onlyservice = $this->container->get('cadoles.portal.service.only'); - $files=$onlyservice->getDocument($group, $folders, $firstfolder); + $files=$onlyservice->getDocument($group, $folders, $firstfolder, $tasks); + $idonly=$em->getRepository("CadolesCoreBundle:Group")->find($group)->getIdOnlyoffice(); // Render return $this->render($this->labelentity.':viewonlydoc.html.twig', [ 'entity' => $entity, - 'canadd' => $canupdate, - 'canupdate' => $canupdate, + 'canadd' => $cansee, + 'canupdate' => $cansee, 'firstfolder' => $firstfolder, 'folders' => $folders, + 'tasks' => $tasks, + 'urlonly' => $this->getParameter("widonlyoffice_url")."/products/projects/projects.aspx?prjID=".$idonly, 'files' => $files, 'access' => $access, ]); diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewonlydoc.html.twig b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewonlydoc.html.twig index a49bc642..ca26c873 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewonlydoc.html.twig +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewonlydoc.html.twig @@ -33,7 +33,7 @@ {% endif %} {% if canadd %} - + {% endif %}
{% endif %} @@ -51,44 +51,26 @@ {% if files|length >= 1 or canupdate %}
- {% if canupdate %} -
-
- {% endif %} - - {% for file in files|sort %} - {% if loop.index==1 and not canupdate%} -
-
- {% endif %} +
+
+ {% for file in files %}
@@ -96,19 +78,37 @@ {% if canadd %}
- + + {% if not tasks is empty %} +
+

Tâches

+ {% for task in tasks %} +
  • {{ task.title }}
  • + {% if not task.subtasks is empty %} +
      + {% for subtask in task.subtasks %} +
    • {{ subtask.title }}
    • + {% endfor %} +
    + {% endif %} + {% endfor %} +
    + {% endif %}
    {% endif %}
    diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Service/onlyService.php b/src/ninegate-1.0/src/Cadoles/PortalBundle/Service/onlyService.php index 0558b75a..ca9bf072 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Service/onlyService.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Service/onlyService.php @@ -4,6 +4,7 @@ namespace Cadoles\PortalBundle\Service; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\HttpFoundation\Session\Session; +use Symfony\Component\HttpFoundation\Response; use Doctrine\ORM\EntityManager; class onlyService @@ -35,28 +36,38 @@ class onlyService } } - public function getDocument($idproject,&$folders,&$firstfolder) { + public function getDocument($idgroup,&$folders,&$firstfolder,&$tasks) { $files=[]; $folders=[]; + $tasks=[]; - if($this->only_activate) { - if($this->authOnly()) { - $response = \Unirest\Request::get($this->only_url.'/project/'.$idproject,$this->headers); - if($this->koresponse($response)) return false; - $firstfolder=$response->body->response->projectFolder;; - - $response = \Unirest\Request::get($this->only_url.'/project/'.$idproject.'/files',$this->headers); - if($this->koresponse($response)) return 0; - foreach($response->body->response->files as $fileonly) { - array_push($files,$fileonly); - } - foreach($response->body->response->folders as $folderonly) { - $folders[$folderonly->id]=$folderonly; - $subfolder=$this->scanfolder($folderonly->id,$folders,$this->headers); - foreach($subfolder as $file) { - array_push($files,$file); + $group=$this->em->getRepository("CadolesCoreBundle:Group")->find($idgroup); + if($group&&$group->getIdonlyoffice()) { + if($this->only_activate) { + if($this->authOnly()) { + $response = \Unirest\Request::get($this->only_url.'/project/'.$group->getIdonlyoffice(),$this->headers); + if(!$this->koresponse($response)) { + $firstfolder=$response->body->response->projectFolder;; + + $response = \Unirest\Request::get($this->only_url.'/project/'.$group->getIdonlyoffice().'/files',$this->headers); + if(!$this->koresponse($response)) { + foreach($response->body->response->files as $fileonly) { + array_push($files,$fileonly); + } + foreach($response->body->response->folders as $folderonly) { + $folders[$folderonly->id]=$folderonly; + $subfolder=$this->scanfolder($folderonly->id,$folders,$this->headers); + foreach($subfolder as $file) { + array_push($files,$file); + } + } + + $response = \Unirest\Request::get($this->only_url.'/project/'.$group->getIdonlyoffice().'/task/open',$this->headers); + error_log($this->only_url.'/project/'.$group->getIdonlyoffice().'/tasks/open'); + if(!$this->koresponse($response)) $tasks=$response->body->response; + } } - } + } } } @@ -103,6 +114,10 @@ class onlyService return false; } + private function mydebug($texte) { + if($this->debug) error_log($texte); + } + private function scanfolder($folderid,&$folders,$headers) { $files=[]; $response = \Unirest\Request::get($this->only_url.'/files/'.$folderid,$headers);