Compare commits
104 Commits
27ab0758e7
...
master
Author | SHA1 | Date | |
---|---|---|---|
461324fe3f | |||
594122ed07 | |||
c5333887cc | |||
629d77175a | |||
1a54b9a3f9 | |||
d0d8183f7a | |||
4f2fa1db4f | |||
75d935aa57 | |||
27e23fffaf | |||
df8bcfc1a1 | |||
2b86aa4e2f | |||
57f96132f4 | |||
aac017c263 | |||
702d060503 | |||
c6d349696e | |||
d0d933f28e | |||
1249b7be21 | |||
6081e6a692 | |||
01da55e6d6 | |||
95e51c4d53 | |||
9157b78671 | |||
e66f8999ed | |||
41915a0547 | |||
c7586c86d5 | |||
6a8e102fc6 | |||
eedaa86dcf | |||
1d448e70c7 | |||
63c710c4fd | |||
ac37691536 | |||
13e5bfb428 | |||
ed75b5f5c3 | |||
f361110766 | |||
a5fbe134cc | |||
7dc7d708d3 | |||
7ecfa45d75 | |||
7380823897 | |||
911bea2b5d | |||
13c24bd1ee | |||
fac25a036e | |||
d61c2fc94d | |||
3e9e581116 | |||
14283a731e | |||
5271f992a7 | |||
e3188b1732 | |||
fa62b8aa36 | |||
3ba041b207 | |||
465bfd0374 | |||
2a2dfc55bb | |||
24e2fb3c2e | |||
ebd9a5a0a6 | |||
16eb147e5b | |||
e4cb40fae8 | |||
9d40aa6575 | |||
4399db9498 | |||
295c4bd4f7 | |||
27bcb3fbe7 | |||
d3c8a95336 | |||
2679d8f629 | |||
8ed97d8d96 | |||
2b4d048f9d | |||
20c131db2e | |||
72c5e49cf6 | |||
635f44a894 | |||
33841459d9 | |||
150e624fca | |||
f621ebea82 | |||
ccdacac7c5 | |||
0805750c33 | |||
ff7183ef5b | |||
67d026a8a0 | |||
cf255183bd | |||
743ffa7910 | |||
261129755d | |||
c150c15bc7 | |||
3fc0a1b809 | |||
1209c90388 | |||
d65a003422 | |||
04272afa3d | |||
4aa766759c | |||
dbade2fce4 | |||
ae4debf6b9 | |||
4ecfa70106 | |||
dd46b9ba01 | |||
5aefa64fce | |||
9a8105edb9 | |||
26d31f4fce | |||
0102239e09 | |||
e9242e4b0c | |||
0886f96cf4 | |||
ecfce10e3b | |||
cf85ca9023 | |||
8738cdeec5 | |||
569f3a5860 | |||
4c707c5899 | |||
b2c78b523a | |||
57606ce0d5 | |||
490d8112fa | |||
54158df23f | |||
81f4614680 | |||
49e2527337 | |||
3438392632 | |||
016f09983f | |||
cf91d5c9cd | |||
6d04f2a08e |
@ -2,6 +2,7 @@
|
||||
<creole>
|
||||
<files>
|
||||
<file filelist='ninegate' name='/etc/eole/eole-db.d/ninegate-db.yml' rm='True' mkdir='True'/>
|
||||
<file filelist='ninegate_nginx' name='/etc/nginx/web.d/ninegate.conf' source='ninegate-nginx.conf' rm='True' mkdir='True' />
|
||||
</files>
|
||||
|
||||
<containers>
|
||||
@ -9,6 +10,7 @@
|
||||
<package>ninegate-apps</package>
|
||||
|
||||
<file filelist='ninegate' name='/etc/apache2/sites-available/ninegate' source='ninegate-apache.conf' rm="True"/>
|
||||
<file filelist='ninegate' name='/lib/systemd/system/wssninegate.service' source='ninegate.service'/>
|
||||
<file filelist="ninegate" name="/var/www/html/ninegate/app/config/parameters.yml" source="ninegate-parameters.yml" rm="True"/>
|
||||
<file filelist="ninegate" name="/var/www/html/ninegate/app/config/template.yml" source="ninegate-template.yml" rm="True"/>
|
||||
<file filelist="ninegate" name="/var/www/html/ninegate/scripts/ninegate-postservice-00.sh" source="ninegate-postservice-00.sh" rm="True" mode="700" />
|
||||
@ -18,16 +20,12 @@
|
||||
<file filelist='ninegate-migration' name='/var/www/html/envole-migration/config/config-db-ninegate.php' source='ninegate-migration.php' mkdir='True'/>
|
||||
|
||||
<service method='apache' servicelist='ninegate'>ninegate</service>
|
||||
|
||||
<service_access service='ninegate_websocket'>
|
||||
<port port_type="SymLinkOption">ninegate_websocket_portexterne</port>
|
||||
</service_access>
|
||||
|
||||
<service servicelist="ninegate">wssninegate</service>
|
||||
</container>
|
||||
</containers>
|
||||
|
||||
<variables>
|
||||
<family name='Ninegate'>
|
||||
<family name='Ninegate' icon='home'>
|
||||
<variable type='oui/non' name='activer_cadolesldap' description='Activer Annuaire Cadoles' hidden='True' exists='False'/>
|
||||
<variable type='string' name='cadolesldap_pwdadmin' description="Mot de passe du compte admin durant l'instance" hidden='True' exists='False'/>
|
||||
<variable type='string' name='cadolesldap_organization' description="Nom de l'organisation principale" hidden='True' exists='False'/>
|
||||
@ -39,6 +37,7 @@
|
||||
<variable name="ninegate_test_ninegate" type="oui/non" hidden='True' exists='False'><value>non</value></variable>
|
||||
<variable name="activer_adminer" type="oui/non" description="Activer Adminer" hidden='True' exists='False'><value>non</value></variable>
|
||||
<variable name="activer_balado" type="oui/non" description="Activer Balado" hidden='True' exists='False'><value>non</value></variable>
|
||||
<variable name="activer_cdt" type="oui/non" description="Activer CdT" hidden='True' exists='False'><value>non</value></variable>
|
||||
<variable name="activer_dokuwiki" type="oui/non" description="Activer Dokuwiki" hidden='True' exists='False'><value>non</value></variable>
|
||||
<variable name="activer_econnect" type="oui/non" description="Activer eConnect" hidden='True' exists='False'><value>non</value></variable>
|
||||
<variable name="activer_ead_web" type="oui/non" description="Activer EAD" hidden='True' exists='False'><value>non</value></variable>
|
||||
@ -65,6 +64,7 @@
|
||||
<variable name="activer_roundcube" type="oui/non" description="Activer Roundcube" hidden='True' exists='False'><value>non</value></variable>
|
||||
<variable name="activer_sacoche" type="oui/non" description="Activer Sacoche" hidden='True' exists='False'><value>non</value></variable>
|
||||
<variable name="activer_wordpress" type="oui/non" description="Activer Wordpress" hidden='True' exists='False'><value>non</value></variable>
|
||||
<variable name="activer_revprox" type="oui/non" description="Activer le reverse proxy Nginx" hidden='True' exists='False'><value>non</value></variable>
|
||||
|
||||
|
||||
<variable name="activer_sondepiwik_local" type="oui/non" description="Activer Sonde Piwik" hidden='True' exists='False'><value>non</value></variable>
|
||||
@ -78,8 +78,6 @@
|
||||
<variable name='ninegate_test_conf_ldap' type='oui/non' hidden='True'/>
|
||||
|
||||
|
||||
|
||||
|
||||
<variable type='oui/non' name='activer_ninegate' description='Activer Ninegate'><value>oui</value></variable>
|
||||
|
||||
<variable type='string' name='ninegate_masteridentity' description="Maître de l'Identité" mandatory='True'><value>LDAP</value></variable>
|
||||
@ -90,6 +88,7 @@
|
||||
<variable type='string' name='ninegate_ssoreqgroup' description="Attribut SSO associé à la notion de groupe" mandatory='True'><value>user_groups</value></variable>
|
||||
<variable type='oui/non' name='ninegate_ssosynchroitem' description="Associer automatiquement les items en fonction d'un attribut SSO"><value>non</value></variable>
|
||||
<variable type='string' name='ninegate_ssoreqitem' description="Attribut SSO associé à la notion d'item" mandatory='True'><value></value></variable>
|
||||
<variable type='string' name='ninegate_typesso' description="Mode de connexion SSO (Client ou Proxy)" mandatory='True'><value>client</value></variable>
|
||||
|
||||
<variable type='oui/non' name='ninegate_syncldap' description="Synchroniser Ninegate vers votre Annuaire CadolesLDAP"><value>non</value></variable>
|
||||
<variable type='string' name='ninegate_ldaptemplate' description="Modèle d'annuaire"><value>scribe</value></variable>
|
||||
@ -197,6 +196,13 @@
|
||||
<variable type='string' name='ninegate_widbalado_url' description='URL complète de votre Balado' mandatory='True' />
|
||||
<variable type='string' name='ninegate_widbalado_syncenvole' description='URL Posh-Profil pour synchronisation Balado' mandatory='True' />
|
||||
|
||||
<!-- CDT -->
|
||||
<variable type="oui/non" name='ninegate_activate_widcdt' description='Activer CdT' mandatory='True'>
|
||||
<value>non</value>
|
||||
</variable>
|
||||
<variable type='string' name='ninegate_widcdt_url' description='URL complète de votre CdT' mandatory='True' />
|
||||
<variable type='string' name='ninegate_widcdt_syncenvole' description='URL Posh-Profil pour synchronisation CdT' mandatory='True' />
|
||||
|
||||
<!-- DOKUWIKI -->
|
||||
<variable type="oui/non" name='ninegate_activate_widdokuwiki' description='Activer Dokuwiki' mandatory='True'>
|
||||
<value>non</value>
|
||||
@ -213,7 +219,6 @@
|
||||
<variable type="oui/non" name='ninegate_activate_widead' description='Activer EAD' mandatory='True'>
|
||||
<value>non</value>
|
||||
</variable>
|
||||
<variable type='string' name='ninegate_widead_url' description='URL complète de votre EAD' mandatory='True' />
|
||||
|
||||
<!-- EOE -->
|
||||
<variable type="oui/non" name='ninegate_activate_wideoe' description='Activer EOE' mandatory='True'>
|
||||
@ -374,19 +379,6 @@
|
||||
<variable type='string' name='ninegate_widwordpress_url' description='URL complète de votre Wordpress' mandatory='True' />
|
||||
<variable type='string' name='ninegate_widwordpress_syncenvole' description='URL Posh-Profil pour synchronisation Wordpress' mandatory='True' />
|
||||
|
||||
|
||||
|
||||
<!-- WEBSOCKET -->
|
||||
<variable type='string' name='ninegate_websocket_url' description='Host du serveur Websocket' mandatory='True' />
|
||||
<variable type='string' name='ninegate_websocket_portexterne' description='Port de commuinication externe du serveur Websocket' mandatory='True' >
|
||||
<value>5555</value>
|
||||
</variable>
|
||||
<variable type='string' name='ninegate_websocket_portinterne' description='Port de commuinication interne du serveur Websocket' mandatory='True'>
|
||||
<value>5556</value>
|
||||
</variable>
|
||||
|
||||
|
||||
|
||||
<!-- EMAIL -->
|
||||
<variable type='string' name='ninegate_noreply' description='Adresse mail utilisé pour le noreply' mandatory='True' />
|
||||
<variable type="oui/non" name='ninegate_activer_localmail' description="Utiliser le serveur d'envoi de mail local" mandatory='True'>
|
||||
@ -398,9 +390,9 @@
|
||||
<variable type='string' name='ninegate_smtppwd' description='Fichier contenant le mot de passe associé du compte SMTP' />
|
||||
<variable type='string' name='ninegate_smtpencryption' description='Type Encryptage du serveur SMTP' />
|
||||
<variable type='string' name='ninegate_smtpauthmode' description='Mode Authentification du serveur SMTP' />
|
||||
</family>
|
||||
|
||||
|
||||
|
||||
<family name='EoleDB' icon='database' mode='expert'>
|
||||
<!-- EOLEDB -->
|
||||
<variable type='string' name='ninegate_db_mode' description='Serveur de bases de données à utiliser' mode='expert'/>
|
||||
<variable type='string' name='ninegate_dbserver' description='Adresse du serveur de base de données' mode='expert'/>
|
||||
@ -416,6 +408,7 @@
|
||||
<separator name="ninegate_activate_portal">Paramètres associés aux modules à activer</separator>
|
||||
<separator name="ninegate_activate_widadminer">Paramètres associés à Adminer</separator>
|
||||
<separator name="ninegate_activate_widbalado">Paramètres associés à Balado</separator>
|
||||
<separator name="ninegate_activate_widcdt">Paramètres associés à CdT</separator>
|
||||
<separator name="ninegate_activate_widdokuwiki">Paramètres associés à Dokuwiki</separator>
|
||||
<separator name="ninegate_activate_wideconnect">Paramètres associés à eConnect</separator>
|
||||
<separator name="ninegate_activate_widead">Paramètres associés à EAD</separator>
|
||||
@ -443,9 +436,9 @@
|
||||
<separator name="ninegate_activate_widroundcube">Paramètres associés à Roundcube</separator>
|
||||
<separator name="ninegate_activate_widsacoche">Paramètres associés à Sacoche</separator>
|
||||
<separator name="ninegate_activate_widwordpress">Paramètres associés à Wordpress</separator>
|
||||
<separator name="ninegate_websocket_url">Paramètres associés au Serveur WEBSOCKET</separator>
|
||||
<separator name="ninegate_activate_websocket">Paramètres associés au Serveur WEBSOCKET</separator>
|
||||
<separator name="ninegate_noreply">Paramètres associés aux Mails</separator>
|
||||
<separator name="ninegate_db_mode">Paramètres associés à la Base de Données</separator>
|
||||
<separator name="ninegate_db_mode">Paramètres EoleDB associés à Ninegate</separator>
|
||||
</separators>
|
||||
</variables>
|
||||
|
||||
@ -455,6 +448,11 @@
|
||||
<target type='variable'>activer_ninegate</target>
|
||||
</condition>
|
||||
|
||||
<condition name='hidden_if_in' source='activer_revprox'>
|
||||
<param>non</param>
|
||||
<target type='filelist'>nineboard_nginx</target>
|
||||
</condition>
|
||||
|
||||
<condition name='hidden_if_in' source='activer_ninegate'>
|
||||
<param>non</param>
|
||||
|
||||
@ -466,7 +464,8 @@
|
||||
<target type='variable'>ninegate_ssoreqgroup</target>
|
||||
<target type='variable'>ninegate_ssosynchroitem</target>
|
||||
<target type='variable'>ninegate_ssoreqitem</target>
|
||||
|
||||
<target type='variable'>ninegate_typesso</target>
|
||||
|
||||
<target type='variable'>ninegate_syncldap</target>
|
||||
<target type='variable'>ninegate_ldaptemplate</target>
|
||||
<target type='variable'>ninegate_scribegroup</target>
|
||||
@ -530,6 +529,7 @@
|
||||
<target type='variable'>ninegate_dbpass</target>
|
||||
|
||||
<target type='filelist'>ninegate</target>
|
||||
<target type='filelist'>ninegate_nginx</target>
|
||||
<target type='filelist'>ninegate-migration</target>
|
||||
|
||||
<target type='servicelist'>ninegate</target>
|
||||
@ -565,7 +565,15 @@
|
||||
<target type='variable'>ninegate_ssosynchrogroup</target>
|
||||
<target type='variable'>ninegate_ssoreqgroup</target>
|
||||
<target type='variable'>ninegate_ssosynchroitem</target>
|
||||
<target type='variable'>ninegate_ssoreqitem</target>
|
||||
<target type='variable'>ninegate_ssoreqitem</target>
|
||||
</condition>
|
||||
|
||||
<condition name='hidden_if_in' source='ninegate_mode_auth'>
|
||||
<param>SQL</param>
|
||||
<param>LDAP</param>
|
||||
<param>SAML</param>
|
||||
|
||||
<target type='variable'>ninegate_typesso</target>
|
||||
</condition>
|
||||
|
||||
<condition name='hidden_if_in' source='ninegate_syncldap'>
|
||||
@ -717,6 +725,7 @@
|
||||
|
||||
<target type='variable'>ninegate_activate_widadminer</target>
|
||||
<target type='variable'>ninegate_activate_widbalado</target>
|
||||
<target type='variable'>ninegate_activate_widcdt</target>
|
||||
<target type='variable'>ninegate_activate_widdokuwiki</target>
|
||||
<target type='variable'>ninegate_activate_wideconnect</target>
|
||||
<target type='variable'>ninegate_activate_widead</target>
|
||||
@ -766,6 +775,7 @@
|
||||
<param>non</param>
|
||||
|
||||
<target type='variable'>ninegate_widbalado_syncenvole</target>
|
||||
<target type='variable'>ninegate_widcdt_syncenvole</target>
|
||||
<target type='variable'>ninegate_widgepi_syncenvole</target>
|
||||
<target type='variable'>ninegate_widlimesurvey_syncenvole</target>
|
||||
<target type='variable'>ninegate_widmoodle_syncenvole</target>
|
||||
@ -784,30 +794,12 @@
|
||||
<condition name='hidden_if_in' source='poshprofil_typesynchro'>
|
||||
<param>Annuaire</param>
|
||||
<target type='variable'>ninegate_widbalado_syncenvole</target>
|
||||
<target type='variable'>ninegate_widcdt_syncenvole</target>
|
||||
<target type='variable'>ninegate_widgepi_syncenvole</target>
|
||||
<target type='variable'>ninegate_widnextcloud_syncenvole</target>
|
||||
<target type='variable'>ninegate_widsacoche_syncenvole</target>
|
||||
</condition>
|
||||
|
||||
|
||||
<!-- AFFICHAGE EN FONCTION DU MODULE WEBSOCKET -->
|
||||
<condition name='hidden_if_in' source='ninegate_activate_websocket'>
|
||||
<param>non</param>
|
||||
|
||||
<target type='variable'>ninegate_websocket_url</target>
|
||||
<target type='variable'>ninegate_websocket_portinterne</target>
|
||||
<target type='variable'>ninegate_websocket_portexterne</target>
|
||||
<target type='servicelist'>ninegate_websocket</target>
|
||||
</condition>
|
||||
|
||||
<fill name='calc_multi_condition' target='ninegate_websocket_url'>
|
||||
<param>oui</param>
|
||||
<param type='eole' name='condition_1' hidden='False'>activer_apache</param>
|
||||
<param type='eole' name='match' hidden='False'>web_url</param>
|
||||
<param name='default_mismatch'>None</param>
|
||||
</fill>
|
||||
|
||||
|
||||
<!-- AFFICHAGE EN FONCTION DU WIDGET ADMINER -->
|
||||
<fill name='calc_multi_condition' target='ninegate_activate_widadminer'>
|
||||
<param>oui</param>
|
||||
@ -832,7 +824,7 @@
|
||||
|
||||
|
||||
|
||||
<!-- AFFICHAGE EN FONCTION DU WIDGET BALADAO -->
|
||||
<!-- AFFICHAGE EN FONCTION DU WIDGET BALADO -->
|
||||
<fill name='calc_multi_condition' target='ninegate_activate_widbalado'>
|
||||
<param>oui</param>
|
||||
<param type='eole' name='condition_1' hidden='False'>activer_balado</param>
|
||||
@ -863,6 +855,39 @@
|
||||
</fill>
|
||||
|
||||
|
||||
|
||||
<!-- AFFICHAGE EN FONCTION DU WIDGET CDT -->
|
||||
<fill name='calc_multi_condition' target='ninegate_activate_widcdt'>
|
||||
<param>oui</param>
|
||||
<param type='eole' name='condition_1' hidden='False'>activer_cdt</param>
|
||||
<param name='match'>oui</param>
|
||||
<param name='mismatch'>non</param>
|
||||
<param name='default_mismatch'>non</param>
|
||||
</fill>
|
||||
|
||||
<condition name='hidden_if_in' source='ninegate_activate_widcdt'>
|
||||
<param>non</param>
|
||||
|
||||
<target type='variable'>ninegate_widcdt_url</target>
|
||||
<target type='variable'>ninegate_widcdt_syncenvole</target>
|
||||
</condition>
|
||||
|
||||
<fill name='calc_multi_condition' target='ninegate_widcdt_url'>
|
||||
<param>oui</param>
|
||||
<param type='eole' name='condition_1' hidden='False'>activer_cdt</param>
|
||||
<param name='match'>/cdt</param>
|
||||
<param name='default_mismatch'>None</param>
|
||||
</fill>
|
||||
|
||||
<fill name='calc_multi_condition' target='ninegate_widcdt_syncenvole'>
|
||||
<param>oui</param>
|
||||
<param type='eole' name='condition_1' hidden='False'>activer_cdt</param>
|
||||
<param name='match'>/posh-profil</param>
|
||||
<param name='default_mismatch'>None</param>
|
||||
</fill>
|
||||
|
||||
|
||||
|
||||
<!-- AFFICHAGE EN FONCTION DU WIDGET DOKUWIKI -->
|
||||
<fill name='calc_multi_condition' target='ninegate_activate_widdokuwiki'>
|
||||
<param>oui</param>
|
||||
@ -918,18 +943,6 @@
|
||||
<param name='mismatch'>non</param>
|
||||
<param name='default_mismatch'>non</param>
|
||||
</fill>
|
||||
|
||||
<condition name='hidden_if_in' source='ninegate_activate_widead'>
|
||||
<param>non</param>
|
||||
|
||||
<target type='variable'>ninegate_widead_url</target>
|
||||
</condition>
|
||||
|
||||
<fill name='concat' target='ninegate_widead_url'>
|
||||
<param>https://</param>
|
||||
<param type='eole'>web_url</param>
|
||||
<param>:4200</param>
|
||||
</fill>
|
||||
|
||||
<!-- AFFICHAGE EN FONCTION DU WIDGET EOE -->
|
||||
<fill name='calc_multi_condition' target='ninegate_activate_wideoe'>
|
||||
@ -1651,6 +1664,10 @@
|
||||
<param>['CAS', 'SAML', 'SQL', 'LDAP']</param>
|
||||
</check>
|
||||
|
||||
<check name='valid_enum' target='ninegate_typesso'>
|
||||
<param>['client', 'proxy']</param>
|
||||
</check>
|
||||
|
||||
<check name='valid_enum' target='ninegate_moderegistration'>
|
||||
<param>['none', 'byuser', 'byadmin']</param>
|
||||
</check>
|
||||
|
1
src/ninegate-1.0/.gitignore
vendored
@ -2,6 +2,7 @@
|
||||
/app/config/parameters.yml
|
||||
/app/config/template.yml
|
||||
/src/Cadoles/CoreBundle/Command/data/core-init-01.sql
|
||||
/src/Cadoles/CoreBundle/Command/LocalCommand.php
|
||||
/build/
|
||||
/phpunit.xml
|
||||
/var/*
|
||||
|
@ -127,16 +127,16 @@ gos_web_socket:
|
||||
firewall: main
|
||||
shared_config: true
|
||||
server:
|
||||
port: %websocket_port% #The port the socket server will listen on
|
||||
host: %websocket_host% #The host ip to bind to
|
||||
port: 443 #The port the socket server will listen on
|
||||
host: %weburl%/wssninegate #The host ip to bind to
|
||||
|
||||
router:
|
||||
resources:
|
||||
- "@CadolesWebsocketBundle/Resources/config/topic.yml"
|
||||
pushers:
|
||||
wamp:
|
||||
host: %websocket_host%
|
||||
port: %websocket_portinterne%
|
||||
host: 0.0.0.0
|
||||
port: 5556
|
||||
|
||||
# ckeditor configuration
|
||||
ivory_ck_editor:
|
||||
@ -147,7 +147,7 @@ ivory_ck_editor:
|
||||
language: fr
|
||||
toolbar: "my_toolbar_1"
|
||||
uiColor: "#ffffff"
|
||||
extraPlugins: ["html5video","pastebase64"]
|
||||
extraPlugins: ["html5video"]
|
||||
light_config:
|
||||
language: fr
|
||||
toolbar: "my_toolbar_2"
|
||||
|
46
src/ninegate-1.0/scripts/LocalCommand.php
Normal file
@ -0,0 +1,46 @@
|
||||
<?php
|
||||
namespace Cadoles\CoreBundle\Command;
|
||||
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Finder\Finder;
|
||||
use Symfony\Component\Filesystem\Filesystem;
|
||||
|
||||
class LocalCommand extends Command
|
||||
{
|
||||
private $container;
|
||||
private $em;
|
||||
private $output;
|
||||
private $filesystem;
|
||||
private $rootlog;
|
||||
|
||||
protected function configure()
|
||||
{
|
||||
$this
|
||||
->setName('Core:Local')
|
||||
->setDescription('Lauch Local Script')
|
||||
;
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
$this->container = $this->getApplication()->getKernel()->getContainer();
|
||||
$this->em = $this->container->get('doctrine')->getEntityManager();
|
||||
$this->output = $output;
|
||||
$this->filesystem = new Filesystem();
|
||||
$this->rootlog = $this->container->get('kernel')->getRootDir()."/../var/logs/";
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
private function writelnred($string) {
|
||||
$this->output->writeln('<fg=red>'.$string.'</>');
|
||||
$this->filesystem->appendToFile($this->rootlog.'cron.log', $string."\n");
|
||||
}
|
||||
private function writeln($string) {
|
||||
$this->output->writeln($string);
|
||||
$this->filesystem->appendToFile($this->rootlog.'cron.log', $string."\n");
|
||||
}
|
||||
}
|
@ -49,6 +49,11 @@ rm -f /var/www/html/ninegate/var/logs/dev.log
|
||||
# Copie des polices du projet dans le rep web
|
||||
cp -rf src/Cadoles/CoreBundle/Resources/public/fonts web/
|
||||
|
||||
# Copie de la commande local de base si elle la commande n'existe pas
|
||||
if [ ! -f src/Cadoles/CoreBundle/Command/LocalCommand.php ]; then
|
||||
cp -rf scripts/LocalCommand.php src/Cadoles/CoreBundle/Command/LocalCommand.php
|
||||
fi
|
||||
|
||||
# Nettoyage du cache
|
||||
echo
|
||||
echo CACHE = Refresh
|
||||
@ -66,6 +71,9 @@ php bin/console Portal:InitData --env=prod
|
||||
# Passage des scripts
|
||||
php bin/console Core:Script --env=prod
|
||||
|
||||
# Passage des scripts locaux
|
||||
php bin/console Core:Local --env=prod
|
||||
|
||||
# Generation des assets
|
||||
echo ASSET = Dump
|
||||
bin/console assetic:dump --env=prod --quiet
|
||||
|
@ -1,11 +1,9 @@
|
||||
#!/bin/bash
|
||||
websocket_url=$(CreoleGet adresse_ip_eth0 non)
|
||||
websocket_portinterne=$(CreoleGet ninegate_websocket_portinterne non)
|
||||
|
||||
# Server Websocket
|
||||
if [[ "$1" != "restartifdown" ]]; then
|
||||
echo WEBSOCKET = STOP
|
||||
pid="$(pgrep -a -f gos:websocket | grep $websocket_portinterne)"
|
||||
pid="$(pgrep -a -f gos:websocket | grep 5556)"
|
||||
if [ -n "${pid}" ]; then
|
||||
IFS=' ' read -r -a array <<< "$pid"
|
||||
kill -9 ${array[0]};
|
||||
@ -13,7 +11,7 @@ if [[ "$1" != "restartifdown" ]]; then
|
||||
fi
|
||||
|
||||
# Port LISTEN ?
|
||||
pid="$(pgrep -a -f gos:websocket | grep $websocket_portinterne)"
|
||||
pid="$(pgrep -a -f gos:websocket | grep 5556)"
|
||||
restart="yes"
|
||||
if [ "$1" == "restartifdown" ] && [ -n "${pid}" ] ; then
|
||||
restart="no"
|
||||
@ -22,5 +20,5 @@ fi
|
||||
if [ "$restart" == "yes" ] && [ "$1" != "stop" ] ; then
|
||||
echo WEBSOCKET = START
|
||||
cd /var/www/html/ninegate
|
||||
bin/console gos:websocket:server --port $websocket_portinterne -a $websocket_url --no-debug -n -q --env=prod & disown
|
||||
systemctl restart wssninegate
|
||||
fi
|
@ -30,7 +30,10 @@ class SecurityController extends Controller
|
||||
|
||||
// Init Client CAS
|
||||
\phpCAS::setDebug("/var/log/phpcas/phpCAS-ninegate.log");
|
||||
@\phpCAS::client(CAS_VERSION_2_0, $this->getParameter('cas_host'), $this->getParameter('cas_port'), is_null($this->getParameter('cas_path')) ? '' : $this->getParameter('cas_path'), false);
|
||||
if($this->getParameter("cas_type")=="client")
|
||||
@\phpCAS::client(CAS_VERSION_2_0, $this->getParameter('cas_host'), $this->getParameter('cas_port'), is_null($this->getParameter('cas_path')) ? '' : $this->getParameter('cas_path'), false);
|
||||
else
|
||||
@\phpCAS::proxy(CAS_VERSION_2_0, $this->getParameter('cas_host'), $this->getParameter('cas_port'), is_null($this->getParameter('cas_path')) ? '' : $this->getParameter('cas_path'), false);
|
||||
\phpCAS::setNoCasServerValidation();
|
||||
|
||||
|
||||
@ -75,19 +78,37 @@ class SecurityController extends Controller
|
||||
if($masteridentity=="LDAP") {
|
||||
// Normalement la synchronisation des comptes aurait du générer le compte en base c'est donc pas normal
|
||||
// Peut-être juste relancer une synchronisation
|
||||
throw $this->createNotFoundException('Permission denied. Need to synchronize LDAP ? Contact your administrator');
|
||||
// On tente une synchronisation via methode SSO
|
||||
$masteridentity="SSO";
|
||||
// throw $this->createNotFoundException('Permission denied. Need to synchronize LDAP ? Contact your administrator');
|
||||
}
|
||||
|
||||
if($masteridentity=="SSO") {
|
||||
if(empty($email)) $email = $username."@nomail.com";
|
||||
|
||||
// On s'assure qu'il n'y a pas déjà un utilisateur avec le même mail
|
||||
$usermail = $em->getRepository('CadolesCoreBundle:User')->findOneBy(array("email"=>$email));
|
||||
if($usermail) {
|
||||
return $this->render('CadolesCoreBundle:Registration:info.html.twig', [
|
||||
'useheader' => true,
|
||||
'usemenu' => false,
|
||||
'usesidebar' => false,
|
||||
'infotitle' => "Première connexion",
|
||||
'info' => "Votre compte ne peut être activé car votre adresse mel est déjà utilisée par un autre compte utilisateur.<br>Nous sommes désolés du désagrément et vous invitons à contacter un administrateur.",
|
||||
'mode' => "error",
|
||||
'redirectto' => "",
|
||||
]);
|
||||
}
|
||||
|
||||
// Là c'est normal que potentiellement il n'existe pas il faut donc l'autogénérer
|
||||
$user = new User();
|
||||
|
||||
// On calcule le niveau01 de l'utilisateur
|
||||
$niveau01=$em->getRepository('CadolesCoreBundle:Niveau01')->calculateNiveau01($attributes);
|
||||
if(!$niveau01)
|
||||
throw $this->createNotFoundException('Permission denied. No Organisation Niveau 01 match');
|
||||
if(!$niveau01) {
|
||||
$niveau01=$em->getRepository('CadolesCoreBundle:Niveau01')->findAll()[0];
|
||||
//throw $this->createNotFoundException('Permission denied. No Organisation Niveau 01 match');
|
||||
}
|
||||
|
||||
$user->setUsername($username);
|
||||
$user->setEmail($email);
|
||||
@ -104,6 +125,7 @@ class SecurityController extends Controller
|
||||
$user->setAvatar("noavatar.png");
|
||||
$user->setVisible(true);
|
||||
$user->setAuthlevel("simple");
|
||||
$user->setBelongingpopulation("agent");
|
||||
$user->setRole("ROLE_USER");
|
||||
|
||||
if(in_array($username,$this->getParameter("ldap_usersadmin")))
|
||||
@ -194,7 +216,10 @@ class SecurityController extends Controller
|
||||
public function logoutAction() {
|
||||
// Init Client CAS
|
||||
\phpCAS::setDebug(false);
|
||||
@\phpCAS::client(CAS_VERSION_2_0, $this->getParameter('cas_host'), $this->getParameter('cas_port'), is_null($this->getParameter('cas_path')) ? '' : $this->getParameter('cas_path'), true);
|
||||
if($this->getParameter("cas_type")=="client")
|
||||
@\phpCAS::client(CAS_VERSION_2_0, $this->getParameter('cas_host'), $this->getParameter('cas_port'), is_null($this->getParameter('cas_path')) ? '' : $this->getParameter('cas_path'), true);
|
||||
else
|
||||
@\phpCAS::proxy(CAS_VERSION_2_0, $this->getParameter('cas_host'), $this->getParameter('cas_port'), is_null($this->getParameter('cas_path')) ? '' : $this->getParameter('cas_path'), true);
|
||||
\phpCAS::setNoCasServerValidation();
|
||||
|
||||
|
||||
@ -208,7 +233,10 @@ class SecurityController extends Controller
|
||||
|
||||
// Init Client CAS
|
||||
\phpCAS::setDebug("/var/log/phpcas/phpCAS-ninegate.log");
|
||||
@\phpCAS::client(CAS_VERSION_2_0, $this->getParameter('cas_host'), $this->getParameter('cas_port'), is_null($this->getParameter('cas_path')) ? '' : $this->getParameter('cas_path'), false);
|
||||
if($this->getParameter("cas_type")=="client")
|
||||
@\phpCAS::client(CAS_VERSION_2_0, $this->getParameter('cas_host'), $this->getParameter('cas_port'), is_null($this->getParameter('cas_path')) ? '' : $this->getParameter('cas_path'), false);
|
||||
else
|
||||
@\phpCAS::proxy(CAS_VERSION_2_0, $this->getParameter('cas_host'), $this->getParameter('cas_port'), is_null($this->getParameter('cas_path')) ? '' : $this->getParameter('cas_path'), false);
|
||||
\phpCAS::setNoCasServerValidation();
|
||||
|
||||
|
||||
@ -294,4 +322,29 @@ class SecurityController extends Controller
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function imapunreadAction() {
|
||||
if($this->getParameter("active_imapunread")&&$this->getParameter("cas_type")=="proxy") {
|
||||
$ip=$this->getParameter("imapundread_ip");
|
||||
|
||||
// Init Client CAS
|
||||
\phpCAS::setDebug("/var/log/phpcas/phpCAS-ninegate.log");
|
||||
@\phpCAS::proxy(CAS_VERSION_2_0, $this->getParameter('cas_host'), $this->getParameter('cas_port'), is_null($this->getParameter('cas_path')) ? '' : $this->getParameter('cas_path'), false);
|
||||
\phpCAS::setNoCasServerValidation();
|
||||
\phpCAS::forceAuthentication();
|
||||
|
||||
|
||||
$pt= \phpCAS::retrievePT('imap://'.$ip,$t,$f);
|
||||
$a = \phpCAS::serviceMail("{".$ip.":993/imap/ssl/novalidate-cert}","imap://".$ip,0, $errc,$err,$pt);
|
||||
$unseen = imap_status($a, "{".$ip.":993/imap/ssl/novalidate-cert}INBOX", SA_UNSEEN);
|
||||
|
||||
$count=$unseen->unseen;
|
||||
$response = new Response(json_encode($count));
|
||||
}
|
||||
else
|
||||
$response = new Response(json_encode(""));
|
||||
|
||||
$response->headers->set('Content-Type', 'application/json');
|
||||
return $response;
|
||||
}
|
||||
}
|
||||
|
@ -10,3 +10,7 @@ cas_sp.test:
|
||||
path: /test
|
||||
defaults: { _controller: CadolesCASBundle:Security:test }
|
||||
|
||||
cas_sp.imapunread:
|
||||
path: /imapunread
|
||||
defaults: { _controller: CadolesCASBundle:Security:imapunread }
|
||||
|
||||
|
@ -138,6 +138,7 @@ class InitDataCommand extends ContainerAwareCommand
|
||||
$usergroup->setUser($user);
|
||||
$usergroup->setGroup($group);
|
||||
$usergroup->setKeyvalue($key);
|
||||
$usergroup->setRolegroup(0);
|
||||
$em->persist($usergroup);
|
||||
$em->flush();
|
||||
$em->clear();
|
||||
@ -227,9 +228,17 @@ class InitDataCommand extends ContainerAwareCommand
|
||||
$this->addModeration($profil,'cadoles_portal_config_flux',1);
|
||||
$this->addModeration($profil,'cadoles_portal_config_notice',1);
|
||||
$this->addModeration($profil,'cadoles_portal_config_icon',1);
|
||||
$this->addModeration($profil,'cadoles_portal_config_syncbalado',0);
|
||||
$this->addModeration($profil,'cadoles_portal_config_synccdt',0);
|
||||
$this->addModeration($profil,'cadoles_portal_config_syncgepiannu',0);
|
||||
$this->addModeration($profil,'cadoles_portal_config_syncgepisiecle',0);
|
||||
$this->addModeration($profil,'cadoles_portal_config_synclimesurvey',0);
|
||||
$this->addModeration($profil,'cadoles_portal_config_syncmoodle',0);
|
||||
$this->addModeration($profil,'cadoles_portal_config_syncnextcloud',0);
|
||||
$this->addModeration($profil,'cadoles_portal_config_syncsacoche',0);
|
||||
$this->addModeration($profil,'cadoles_portal_config_syncpiwik',0);
|
||||
$this->addModeration($profil,'cadoles_portal_config_syncwordpress',0);
|
||||
|
||||
$this->addModeration($profil,'cadoles_core_config_statistic',1);
|
||||
$this->addModeration($profil,'cadoles_core_config_mailing',1);
|
||||
$this->addModeration($profil,'cadoles_core_config_importuser',0);
|
||||
|
@ -287,7 +287,7 @@ class OnlyCommand extends Command
|
||||
$this->em->flush();
|
||||
|
||||
// On ajoute le propriétaire en tant que membre du groupe
|
||||
$this->addMember($group,$user,true);
|
||||
$this->addMember($group,$user,100);
|
||||
|
||||
// On controle que le groupe a bien page / calendrier / blog / project
|
||||
$this->ctrlFgcanshare($group,$user,$pagetemplate);
|
||||
@ -318,7 +318,7 @@ class OnlyCommand extends Command
|
||||
// On s'assure qu'il n'es pas déjà rattaché
|
||||
$usergroup=$this->em->getRepository("CadolesCoreBundle:UserGroup")->findOneBy(["user"=>$user,"group"=>$group]);
|
||||
if(!$usergroup) {
|
||||
$this->addMember($group,$user,false);
|
||||
$this->addMember($group,$user,0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -578,12 +578,12 @@ class OnlyCommand extends Command
|
||||
}
|
||||
|
||||
|
||||
private function addMember($group,$user,$fgmanager) {
|
||||
private function addMember($group,$user,$role) {
|
||||
$key = Uuid::uuid4();
|
||||
$usergroup=new Usergroup;
|
||||
$usergroup=new UserGroup();
|
||||
$usergroup->setUser($user);
|
||||
$usergroup->setGroup($group);
|
||||
$usergroup->setFgmanager($fgmanager);
|
||||
$usergroup->setRolegroup($role);
|
||||
$usergroup->setKeyvalue($key);
|
||||
$this->em->persist($usergroup);
|
||||
$this->em->flush();
|
||||
|
@ -380,6 +380,46 @@ class PurgeFileCommand extends Command
|
||||
if($result) $find=true;
|
||||
}
|
||||
|
||||
// Si pas trouvé on la cherche dans les projecttask
|
||||
if(!$find) {
|
||||
$result = $this->em
|
||||
->getRepository("CadolesPortalBundle:Projecttask")->createQueryBuilder('projecttask')
|
||||
->where('projecttask.description LIKE :tofind')
|
||||
->setParameter('tofind', '%'.$tofind.'%')
|
||||
->getQuery()->getResult();
|
||||
if($result) $find=true;
|
||||
}
|
||||
|
||||
// Si pas trouvé on la cherche dans les projectcomment
|
||||
if(!$find) {
|
||||
$result = $this->em
|
||||
->getRepository("CadolesPortalBundle:Projectcomment")->createQueryBuilder('projectcomment')
|
||||
->where('projectcomment.description LIKE :tofind')
|
||||
->setParameter('tofind', '%'.$tofind.'%')
|
||||
->getQuery()->getResult();
|
||||
if($result) $find=true;
|
||||
}
|
||||
|
||||
// Si pas trouvé on la cherche dans les blogcomment
|
||||
if(!$find) {
|
||||
$result = $this->em
|
||||
->getRepository("CadolesPortalBundle:Blogcomment")->createQueryBuilder('blogcomment')
|
||||
->where('blogcomment.description LIKE :tofind')
|
||||
->setParameter('tofind', '%'.$tofind.'%')
|
||||
->getQuery()->getResult();
|
||||
if($result) $find=true;
|
||||
}
|
||||
|
||||
// Si pas trouvé on la cherche dans les alert
|
||||
if(!$find) {
|
||||
$result = $this->em
|
||||
->getRepository("CadolesPortalBundle:Alert")->createQueryBuilder('alert')
|
||||
->where('alert.content LIKE :tofind')
|
||||
->setParameter('tofind', '%'.$tofind.'%')
|
||||
->getQuery()->getResult();
|
||||
if($result) $find=true;
|
||||
}
|
||||
|
||||
// Si pas trouvé on supprime
|
||||
if(!$find) {
|
||||
$this->writeln($name);
|
||||
|
@ -239,6 +239,7 @@ class ScribeToNinegateCommand extends Command
|
||||
$member= new UserGroup();
|
||||
$member->setGroup($group);
|
||||
$member->setUser($user);
|
||||
$member->setRolegroup(0);
|
||||
|
||||
$this->em->persist($member);
|
||||
$this->em->flush();
|
||||
|
@ -49,7 +49,7 @@ class ScriptCommand extends Command
|
||||
|
||||
$script=$this->em->getRepository("CadolesCoreBundle:Script")->findOneBy(["name"=>"visibletrue"]);
|
||||
if(!$script) {
|
||||
$this->writelnred("== SCRIPT = visibletrue");
|
||||
$this->writeln("== SCRIPT = visibletrue");
|
||||
$this->visibletrue();
|
||||
|
||||
$script=new Script();
|
||||
@ -61,7 +61,7 @@ class ScriptCommand extends Command
|
||||
|
||||
$script=$this->em->getRepository("CadolesCoreBundle:Script")->findOneBy(["name"=>"setusersniveau"]);
|
||||
if(!$script) {
|
||||
$this->writelnred("== SCRIPT = setusersniveau");
|
||||
$this->writeln("== SCRIPT = setusersniveau");
|
||||
$this->setusersniveau();
|
||||
|
||||
$script=new Script();
|
||||
@ -73,7 +73,7 @@ class ScriptCommand extends Command
|
||||
|
||||
$script=$this->em->getRepository("CadolesCoreBundle:Script")->findOneBy(["name"=>"setfgcancreateproject"]);
|
||||
if(!$script) {
|
||||
$this->writelnred("== SCRIPT = setfgcancreateproject");
|
||||
$this->writeln("== SCRIPT = setfgcancreateproject");
|
||||
$this->setfgcancreateproject();
|
||||
|
||||
$script=new Script();
|
||||
@ -85,7 +85,7 @@ class ScriptCommand extends Command
|
||||
|
||||
$script=$this->em->getRepository("CadolesCoreBundle:Script")->findOneBy(["name"=>"createproject"]);
|
||||
if(!$script) {
|
||||
$this->writelnred("== SCRIPT = createproject");
|
||||
$this->writeln("== SCRIPT = createproject");
|
||||
$this->createproject();
|
||||
|
||||
$script=new Script();
|
||||
@ -97,7 +97,7 @@ class ScriptCommand extends Command
|
||||
|
||||
$script=$this->em->getRepository("CadolesCoreBundle:Script")->findOneBy(["name"=>"createthumbmini"]);
|
||||
if(!$script) {
|
||||
$this->writelnred("== SCRIPT = createthumbmini");
|
||||
$this->writeln("== SCRIPT = createthumbmini");
|
||||
$this->createthumbmini();
|
||||
|
||||
$script=new Script();
|
||||
@ -109,7 +109,7 @@ class ScriptCommand extends Command
|
||||
|
||||
$script=$this->em->getRepository("CadolesCoreBundle:Script")->findOneBy(["name"=>"createwidgetproject"]);
|
||||
if(!$script) {
|
||||
$this->writelnred("== SCRIPT = createwidgetproject");
|
||||
$this->writeln("== SCRIPT = createwidgetproject");
|
||||
$this->createwidgetproject();
|
||||
|
||||
$script=new Script();
|
||||
@ -121,7 +121,7 @@ class ScriptCommand extends Command
|
||||
|
||||
$script=$this->em->getRepository("CadolesCoreBundle:Script")->findOneBy(["name"=>"renamegroup"]);
|
||||
if(!$script) {
|
||||
$this->writelnred("== SCRIPT = renamegroup");
|
||||
$this->writeln("== SCRIPT = renamegroup");
|
||||
$this->renamegroup();
|
||||
|
||||
$script=new Script();
|
||||
@ -132,6 +132,68 @@ class ScriptCommand extends Command
|
||||
}
|
||||
|
||||
|
||||
$script=$this->em->getRepository("CadolesCoreBundle:Script")->findOneBy(["name"=>"rolegroup"]);
|
||||
if(!$script) {
|
||||
$this->writeln("== SCRIPT = rolegroup");
|
||||
$this->rolegroup();
|
||||
|
||||
$script=new Script();
|
||||
$script->setName("rolegroup");
|
||||
$this->em->persist($script);
|
||||
$this->em->flush();
|
||||
$this->writeln("");
|
||||
}
|
||||
|
||||
$script=$this->em->getRepository("CadolesCoreBundle:Script")->findOneBy(["name"=>"userdefaultmissing"]);
|
||||
if(!$script) {
|
||||
$this->writeln("== SCRIPT = userdefaultmissing");
|
||||
$this->userdefaultmissing();
|
||||
|
||||
$script=new Script();
|
||||
$script->setName("userdefaultmissing");
|
||||
$this->em->persist($script);
|
||||
$this->em->flush();
|
||||
$this->writeln("");
|
||||
}
|
||||
|
||||
$script=$this->em->getRepository("CadolesCoreBundle:Script")->findOneBy(["name"=>"updateorthographe01"]);
|
||||
if(!$script) {
|
||||
$this->writeln("== SCRIPT = updateorthographe01");
|
||||
$this->updateorthographe01();
|
||||
|
||||
$script=new Script();
|
||||
$script->setName("updateorthographe01");
|
||||
$this->em->persist($script);
|
||||
$this->em->flush();
|
||||
$this->writeln("");
|
||||
}
|
||||
|
||||
$script=$this->em->getRepository("CadolesCoreBundle:Script")->findOneBy(["name"=>"updateorthographe02"]);
|
||||
if(!$script) {
|
||||
$this->writeln("== SCRIPT = updateorthographe02");
|
||||
$this->updateorthographe02();
|
||||
|
||||
$script=new Script();
|
||||
$script->setName("updateorthographe02");
|
||||
$this->em->persist($script);
|
||||
$this->em->flush();
|
||||
$this->writeln("");
|
||||
}
|
||||
|
||||
if($this->container->getParameter('ldap_template')=="scribe") {
|
||||
$script=$this->em->getRepository("CadolesCoreBundle:Script")->findOneBy(["name"=>"purgepageprofil"]);
|
||||
if(!$script) {
|
||||
$this->writeln("== SCRIPT = purgepageprofil");
|
||||
$this->purgepageprofil();
|
||||
|
||||
$script=new Script();
|
||||
$script->setName("purgepageprofil");
|
||||
$this->em->persist($script);
|
||||
$this->em->flush();
|
||||
$this->writeln("");
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -289,11 +351,116 @@ class ScriptCommand extends Command
|
||||
}
|
||||
}
|
||||
|
||||
private function rolegroup(){
|
||||
|
||||
$usergroups = $this->em->getRepository('CadolesCoreBundle:UserGroup')->findAll();
|
||||
foreach($usergroups as $usergroup) {
|
||||
if(!$usergroup->getRolegroup()) {
|
||||
$role=0;
|
||||
if($usergroup->getFgmanager()) {
|
||||
$role=50;
|
||||
if($usergroup->getUser()==$usergroup->getGroup()->getOwner()) $role=100;
|
||||
}
|
||||
|
||||
$usergroup->setRolegroup($role);
|
||||
$this->em->persist($usergroup);
|
||||
$this->em->flush();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function userdefaultmissing(){
|
||||
$users = $this->em->getRepository('CadolesCoreBundle:User')->findAll();
|
||||
foreach($users as $user) {
|
||||
if($user->getVisible()=="") {
|
||||
$user->setVisible(true);
|
||||
$this->em->persist($user);
|
||||
$this->em->flush();
|
||||
}
|
||||
|
||||
if($user->getAuthlevel()=="") {
|
||||
$user->setAuthlevel("simple");
|
||||
$this->em->persist($user);
|
||||
$this->em->flush();
|
||||
}
|
||||
|
||||
if($user->getBelongingpopulation()=="") {
|
||||
$user->setBelongingpopulation("agent");
|
||||
$this->em->persist($user);
|
||||
$this->em->flush();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function updateorthographe01(){
|
||||
$config=$this->em->getRepository('CadolesCoreBundle:Config')->find("fgforceconnect");
|
||||
if($config) {
|
||||
$config->setHelp("Forcer la connexion afin de rendre votre site privé");
|
||||
$this->em->persist($config);
|
||||
$this->em->flush();
|
||||
}
|
||||
|
||||
$config=$this->em->getRepository('CadolesCoreBundle:Config')->find("fontfacebody");
|
||||
if($config) {
|
||||
$config->setHelp("Police générale de votre site");
|
||||
$this->em->persist($config);
|
||||
$this->em->flush();
|
||||
}
|
||||
|
||||
$config=$this->em->getRepository('CadolesCoreBundle:Config')->find("permgroup");
|
||||
if($config) {
|
||||
$config->setHelp("Détermine quel rôle aura la permission de créer des groupes de travail");
|
||||
$this->em->persist($config);
|
||||
$this->em->flush();
|
||||
}
|
||||
|
||||
$config=$this->em->getRepository('CadolesCoreBundle:Config')->find("permannu");
|
||||
if($config) {
|
||||
$config->setHelp("Détermine quel rôle aura la permission de voir l'annuaire");
|
||||
$this->em->persist($config);
|
||||
$this->em->flush();
|
||||
}
|
||||
|
||||
$config=$this->em->getRepository('CadolesCoreBundle:Config')->find("labelbookmarkuser");
|
||||
if($config) {
|
||||
$config->setHelp("Titre de la section des items créés par l'utilisateur, et qui ne sont listés que dans cette section.");
|
||||
$this->em->persist($config);
|
||||
$this->em->flush();
|
||||
}
|
||||
|
||||
$config=$this->em->getRepository('CadolesCoreBundle:Config')->find("labelbookmarkitem");
|
||||
if($config) {
|
||||
$config->setHelp("Titre sur la section des items créés par l'administrateur ou le modérateur, mis à la disposition de l'utilisateur, et sélectionnés par ce dernier pour apparaitre dans cette section plutôt que dans leur catégorie d'origine.");
|
||||
$this->em->persist($config);
|
||||
$this->em->flush();
|
||||
}
|
||||
}
|
||||
|
||||
private function updateorthographe02(){
|
||||
$entityItem = $this->em->getRepository('CadolesPortalBundle:Item')->find(-398);
|
||||
if($entityItem) {
|
||||
if($entityItem->getSubtitle()!="Messagerie") {
|
||||
$entityItem->setSubtitle("Messagerie");
|
||||
$entityItem->setContent("Messagerie permettant la communication sécurisée par méls. La messagerie n’a pas pour but d’envoyer des gros fichiers mais plutôt de communiquer des informations, des liens.");
|
||||
$this->em->persist($entityItem);
|
||||
$this->em->flush();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function purgepageprofil() {
|
||||
$page=$this->em->getRepository('CadolesPortalBundle:Page')->findOneBy(['name'=>'PROFIL - Enseignants']);
|
||||
if($page) {
|
||||
$this->em->remove($page);
|
||||
$this->em->flush();
|
||||
}
|
||||
|
||||
$page=$this->em->getRepository('CadolesPortalBundle:Page')->findOneBy(['name'=>'PROFIL - Administratifs']);
|
||||
if($page) {
|
||||
$this->em->remove($page);
|
||||
$this->em->flush();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -128,7 +128,7 @@ class SynchroCommand extends Command
|
||||
$ldapfilter="(|(&(uid=*)(ENTPersonProfils=enseignant))(&(uid=*)(typeadmin=0))(&(uid=*)(typeadmin=2)))";
|
||||
$label="PROFIL - Enseignants";
|
||||
$this->writeln(" - $label");
|
||||
if(!$simulate) $this->addmodGroup($label,$ldapfilter,$scribe_group);
|
||||
if(!$simulate) $this->addmodGroup($label,$ldapfilter,false);
|
||||
|
||||
// Responsables
|
||||
$ldapfilter="(&(uid=*)(ENTPersonProfils=responsable))";
|
||||
@ -140,7 +140,20 @@ class SynchroCommand extends Command
|
||||
$ldapfilter="(&(uid=*)(ENTPersonProfils=administratif))";
|
||||
$label="PROFIL - Administratifs";
|
||||
$this->writeln(" - $label");
|
||||
if(!$simulate) $this->addmodGroup($label,$ldapfilter,$scribe_group);
|
||||
if(!$simulate) $this->addmodGroup($label,$ldapfilter,false);
|
||||
|
||||
// Niveaux
|
||||
$this->writeln('');
|
||||
$this->writeln('== NIVEAUX ==========================================');
|
||||
$results = $this->ldap->search("type=Niveau", ['cn','description','gidNumber'], $this->ldap_basedn);
|
||||
foreach($results as $result) {
|
||||
$cn=$result["cn"];
|
||||
$ldapfilter="(&(type=Niveau)(cn=$cn))";
|
||||
|
||||
$label="NIVEAU - ".$result["cn"];
|
||||
$this->writeln(" - $label");
|
||||
if(!$simulate) $this->addmodGroup($label,$ldapfilter,false);
|
||||
}
|
||||
|
||||
// Classes
|
||||
$this->writeln('');
|
||||
@ -155,6 +168,32 @@ class SynchroCommand extends Command
|
||||
if(!$simulate) $this->addmodGroup($label,$ldapfilter,$scribe_group);
|
||||
}
|
||||
|
||||
// Elèves des Classes
|
||||
$this->writeln('');
|
||||
$this->writeln('== ELEVES DES CLASSES ==========================================');
|
||||
$results = $this->ldap->search("type=Classe", ['cn','description','gidNumber'], $this->ldap_basedn);
|
||||
foreach($results as $result) {
|
||||
$cn=$result["cn"];
|
||||
$ldapfilter="(&(type=Classe)(cn=$cn))";
|
||||
|
||||
$label="ELEVES - ".$result["cn"];
|
||||
$this->writeln(" - $label");
|
||||
if(!$simulate) $this->addmodGroup($label,$ldapfilter,false);
|
||||
}
|
||||
|
||||
// Professeurs des Classes
|
||||
$this->writeln('');
|
||||
$this->writeln('== PROFESSEURS DES CLASSES ==========================================');
|
||||
$results = $this->ldap->search("type=Classe", ['cn','description','gidNumber'], $this->ldap_basedn);
|
||||
foreach($results as $result) {
|
||||
$cn=$result["cn"];
|
||||
$ldapfilter="(|(&(type=Equipe)(cn=profs-$cn))(&(ENTPersonProfils=Administratif)(divcod=$cn)))";
|
||||
|
||||
$label="PROFESSEURS - ".$result["cn"];
|
||||
$this->writeln(" - $label");
|
||||
if(!$simulate) $this->addmodGroup($label,$ldapfilter,false);
|
||||
}
|
||||
|
||||
// Options
|
||||
$this->writeln('');
|
||||
$this->writeln('== OPTIONS ==========================================');
|
||||
@ -899,6 +938,7 @@ class SynchroCommand extends Command
|
||||
$member= new UserGroup();
|
||||
$member->setGroup($group);
|
||||
$member->setUser($user);
|
||||
$member->setRolegroup(0);
|
||||
}
|
||||
|
||||
// Si modèle scribe
|
||||
@ -907,7 +947,7 @@ class SynchroCommand extends Command
|
||||
if($ldap_template=="scribe"&&$scribe_master) {
|
||||
$ldapfilter="(|(&(uid=".$user->getUsername().")(ENTPersonProfils=enseignant))(&(uid=".$user->getUsername().")(typeadmin=0))(&(uid=".$user->getUsername().")(typeadmin=2)))";
|
||||
$results = $this->ldap->search($ldapfilter, ['uid'], $this->ldap_basedn);
|
||||
if($results) $member->setFgmanager(true);
|
||||
if($results) $member->setRolegroup(50);
|
||||
}
|
||||
|
||||
$this->em->persist($member);
|
||||
|
@ -326,10 +326,9 @@ class ConfigController extends Controller
|
||||
$fields["niveau02"]["perm"]=1;
|
||||
$fields["niveau02"]["label"]=$session->get('labelniveau02');
|
||||
}
|
||||
if(!array_key_exists("group",$fields)) {
|
||||
$fields["group"]["perm"]=1;
|
||||
$fields["group"]["label"]="Groupes";
|
||||
}
|
||||
if(!array_key_exists("group",$fields)) $fields["group"]["perm"]=1;
|
||||
$fields["group"]["label"]="Groupes (caché uniquement pour le rôle Utilisateur) ";
|
||||
|
||||
if(!array_key_exists("job",$fields)) {
|
||||
$fields["job"]["perm"]=1;
|
||||
$fields["job"]["label"]="Métier";
|
||||
@ -346,10 +345,8 @@ class ConfigController extends Controller
|
||||
$fields["telephonenumber"]["perm"]=1;
|
||||
$fields["telephonenumber"]["label"]="Téléphone";
|
||||
}
|
||||
if(!array_key_exists("visitedate",$fields)) {
|
||||
$fields["visitedate"]["perm"]=1;
|
||||
$fields["visitedate"]["label"]="Visite";
|
||||
}
|
||||
if(!array_key_exists("visitedate",$fields)) $fields["visitedate"]["perm"]=1;
|
||||
$fields["visitedate"]["label"]="Visite (caché uniquement pour les rôles Animateur et Utilisateur) ";
|
||||
|
||||
if(!$session->get('viewniveau02'))
|
||||
unset($fields["niveau02"]);
|
||||
|
@ -59,17 +59,18 @@ class CoreController extends Controller
|
||||
|
||||
// Chargement des chartes à signer
|
||||
if($user) {
|
||||
|
||||
$notices=$em->getRepository("CadolesPortalBundle:Notice")->getNoticeToRead($user);
|
||||
if(! $notices->isEmpty()) {
|
||||
$notices=$em->getRepository("CadolesPortalBundle:Notice")->getNoticeUser($user,false);
|
||||
|
||||
return $this->render('CadolesPortalBundle:Notice:mustread.html.twig',[
|
||||
'useheader' => true,
|
||||
'usemenu' => false,
|
||||
'usesidebar' => false,
|
||||
'maxwidth' => true,
|
||||
'mustread' => true,
|
||||
'notices' => $notices
|
||||
'notices' => $notices,
|
||||
'id' => $id,
|
||||
]);
|
||||
}
|
||||
|
||||
@ -85,8 +86,8 @@ class CoreController extends Controller
|
||||
switch($key) {
|
||||
case "firstname": if($user->getFirstname()=="") $toprofil=true; break;
|
||||
case "visible": if($user->getVisible()=="") $toprofil=true; break;
|
||||
case "authlevel": if($user->getAuthlevel()=="") $toprofil=true; break;
|
||||
case "belongingpopulation": if($user->getBelongingpopulation()=="") $toprofil=true; break;
|
||||
//case "authlevel": if($user->getAuthlevel()=="") $toprofil=true; break;
|
||||
//case "belongingpopulation": if($user->getBelongingpopulation()=="") $toprofil=true; break;
|
||||
case "job": if($user->getJob()=="") $toprofil=true; break;
|
||||
case "position": if($user->getPosition()=="") $toprofil=true; break;
|
||||
case "niveau02": if($user->geNiveau02()=="") $toprofil=true; break;
|
||||
|
@ -26,6 +26,7 @@ class FileController extends Controller
|
||||
$clear=$request->get("clear");
|
||||
$view=$request->get("view");
|
||||
$sort=$request->get("sort");
|
||||
$order=$request->get("order");
|
||||
$defaultview=$request->get("defaultview");
|
||||
|
||||
// Récupérer les préférences utilisateur
|
||||
@ -68,7 +69,7 @@ class FileController extends Controller
|
||||
$preference["widgetviewdirectory"][$directory]=$view;
|
||||
}
|
||||
|
||||
// Prérence trie
|
||||
// Préférence trie
|
||||
if(!array_key_exists("widgetsortdirectory",$preference)) {
|
||||
$toupdate=true;
|
||||
$preference["widgetsortdirectory"]=[];
|
||||
@ -82,6 +83,21 @@ class FileController extends Controller
|
||||
$preference["widgetsortdirectory"][$directory]=$sort;
|
||||
}
|
||||
|
||||
// Préférence order
|
||||
if(!array_key_exists("widgetorderdirectory",$preference)) {
|
||||
$toupdate=true;
|
||||
$preference["widgetorderdirectory"]=[];
|
||||
}
|
||||
if((!array_key_exists($directory,$preference["widgetorderdirectory"]))) {
|
||||
$toupdate=true;
|
||||
$preference["widgetorderdirectory"][$directory]="SORT_ASC";
|
||||
}
|
||||
if($sort&&$preference["widgetorderdirectory"][$directory]!=$order) {
|
||||
$toupdate=true;
|
||||
$preference["widgetorderdirectory"][$directory]=$order;
|
||||
}
|
||||
|
||||
|
||||
// Mise à jour des préferences
|
||||
if($toupdate) {
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
@ -109,23 +125,27 @@ class FileController extends Controller
|
||||
|
||||
if($fs->exists($fulldirectory)) {
|
||||
$finder = new Finder();
|
||||
$finder->depth('== 0')->sortByName()->in($fulldirectory)->exclude('thumb')->exclude('thumbmini');
|
||||
$finder->depth('== 0')->sortByName()->in($fulldirectory)->exclude('thumb')->exclude('thumbmini')->exclude('__trash');
|
||||
|
||||
foreach ($finder as $file) {
|
||||
if(is_dir($file)) {
|
||||
$tmp=[];
|
||||
$tmp["name"]=$file->getRelativePathname();
|
||||
$tmp["namesort"]=strtolower($tmp["name"]);
|
||||
$tmp["date"]=date ("d/m/Y H:i", filemtime($file));
|
||||
$tmp["datesort"] = date ("YmdHi", filemtime($file));
|
||||
array_push($dirs,$tmp);
|
||||
}
|
||||
else {
|
||||
$tmp=[];
|
||||
$tmp["name"]=$file->getRelativePathname();
|
||||
$tmp["namesort"]=strtolower($tmp["name"]);
|
||||
$tmp["extension"]=strtolower($file->getExtension());
|
||||
$fileinfo = new file($file->getPathname());
|
||||
$tmp["minetype"]=$fileinfo->getMimeType();
|
||||
$tmp["minefamily"]=explode("/",$tmp["minetype"])[0];
|
||||
$tmp["date"] = date ("d/m/Y H:i", filemtime($file));
|
||||
$tmp["datesort"] = date ("YmdHi", filemtime($file));
|
||||
|
||||
$tmp["thumb"]="";
|
||||
if($tmp["extension"]=="pdf") {
|
||||
@ -148,12 +168,22 @@ class FileController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
// Trie du tableu
|
||||
$sort = array_column($files, $preference["widgetsortdirectory"][$directory]);
|
||||
array_multisort($sort, SORT_ASC, $files);
|
||||
// Flag poubelle
|
||||
$fgtrash=false;
|
||||
if(stripos($subdirectory,"_trash")==1) $fgtrash=true;
|
||||
|
||||
$sort = array_column($dirs, $preference["widgetsortdirectory"][$directory]);
|
||||
array_multisort($sort, SORT_ASC, $dirs);
|
||||
// Trie du tableu
|
||||
$sort = array_column($files, $preference["widgetsortdirectory"][$directory]."sort");
|
||||
if($preference["widgetorderdirectory"][$directory]=="SORT_ASC")
|
||||
array_multisort($sort, SORT_ASC, $files);
|
||||
else
|
||||
array_multisort($sort, SORT_DESC, $files);
|
||||
|
||||
$sort = array_column($dirs, $preference["widgetsortdirectory"][$directory]."sort");
|
||||
if($preference["widgetorderdirectory"][$directory]=="SORT_ASC")
|
||||
array_multisort($sort, SORT_ASC, $dirs);
|
||||
else
|
||||
array_multisort($sort, SORT_DESC, $dirs);
|
||||
|
||||
return $this->render('CadolesCoreBundle:File:list.html.twig',[
|
||||
'useheader' => false,
|
||||
@ -171,14 +201,19 @@ class FileController extends Controller
|
||||
'canadd' => $canupdate,
|
||||
'view' => $preference["widgetviewdirectory"][$directory],
|
||||
'sort' => $preference["widgetsortdirectory"][$directory],
|
||||
'order' => $preference["widgetorderdirectory"][$directory],
|
||||
'fgtrash' => $fgtrash,
|
||||
]);
|
||||
}
|
||||
|
||||
public function uploadAction($id,$type,Request $request,$access="config")
|
||||
{
|
||||
$subdirectory=$request->get("subdirectory");
|
||||
$forcereload=(is_null($request->get("forcereload"))?true:$request->get("forcereload"));
|
||||
$canupdate =$this->getPermission($access,$id);
|
||||
if(!$canupdate) throw $this->createNotFoundException('Permission denied');
|
||||
|
||||
$subdirectory=urldecode($request->get("subdirectory"));
|
||||
$forcereload=(is_null($request->get("forcereload"))?true:$request->get("forcereload"));
|
||||
|
||||
return $this->render('CadolesCoreBundle:File:upload.html.twig',[
|
||||
'useheader' => false,
|
||||
'usemenu' => false,
|
||||
@ -193,8 +228,10 @@ class FileController extends Controller
|
||||
|
||||
public function subdirectoryAction($id,$type,Request $request,$access="config")
|
||||
{
|
||||
$subdirectory=$request->get("subdirectory");
|
||||
$canupdate =$this->getPermission($access,$id);
|
||||
if(!$canupdate) throw $this->createNotFoundException('Permission denied');
|
||||
|
||||
$subdirectory=$request->get("subdirectory");
|
||||
$defaultData = [];
|
||||
$form = $this->createFormBuilder()
|
||||
->add('subdirectory', TextType::class,["label"=>"Répertoire"])
|
||||
@ -206,7 +243,7 @@ class FileController extends Controller
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$data = $form->getData();
|
||||
if($data["subdirectory"]=="thumb"||$data["subdirectory"]=="thumbmini") {
|
||||
if($data["subdirectory"]=="thumb"||$data["subdirectory"]=="thumbmini"||$data["subdirectory"]=="__trash") {
|
||||
$form->addError(new FormError('Nom de répertoire réservé, merci de choisir un autre nom de répertoire'));
|
||||
$this->get('session')->getFlashBag()->clear();
|
||||
$request->getSession()->getFlashBag()->add("error", 'Nom de répertoire réservé, merci de choisir un autre nom de répertoire');
|
||||
@ -234,6 +271,225 @@ class FileController extends Controller
|
||||
]);
|
||||
}
|
||||
|
||||
public function renameAction($id,$oldname, Request $request,$access="config")
|
||||
{
|
||||
$canupdate =$this->getPermission($access,$id);
|
||||
if(!$canupdate) throw $this->createNotFoundException('Permission denied');
|
||||
|
||||
$subdirectory=$request->get("subdirectory");
|
||||
|
||||
$form = $this->createFormBuilder()
|
||||
->add('subdirectory', TextType::class,["label"=>"Renommer"])
|
||||
->add('submit', SubmitType::class,["label"=>"Valider"])
|
||||
->getForm();
|
||||
|
||||
$form->handleRequest($request);
|
||||
$toclose=false;
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$data = $form->getData();
|
||||
if($data["subdirectory"]=="thumb"||$data["subdirectory"]=="thumbmini"||$data["subdirectory"]=="__trash") {
|
||||
$form->addError(new FormError('Nom réservé, merci de choisir un autre nom'));
|
||||
$this->get('session')->getFlashBag()->clear();
|
||||
$request->getSession()->getFlashBag()->add("error", 'Nom réservé, merci de choisir un autre nom');
|
||||
}
|
||||
else {
|
||||
$fs = new Filesystem();
|
||||
$fulldirectory=$this->get('kernel')->getRootDir()."/../uploads/file/".$id;
|
||||
if($subdirectory) $fulldirectory.="/".$subdirectory;
|
||||
|
||||
$urlsource= $fulldirectory."/".$oldname;
|
||||
$urldestination = $fulldirectory."/".$data["subdirectory"];
|
||||
|
||||
if($urlsource!=$urldestination) {
|
||||
|
||||
if($fs->exists($urldestination)) {
|
||||
$form->addError(new FormError('Ce nom existe déjà'));
|
||||
$this->get('session')->getFlashBag()->clear();
|
||||
$request->getSession()->getFlashBag()->add("error", 'Ce nom existe déjà');
|
||||
}
|
||||
elseif($fs->exists($urlsource)) {
|
||||
if(is_dir($urlsource)) {
|
||||
$fs->mirror($urlsource,$urldestination);
|
||||
$fs->remove($urlsource);
|
||||
}
|
||||
else {
|
||||
$fs->rename($urlsource,$urldestination,true);
|
||||
$fs->touch($urldestination);
|
||||
|
||||
$urlsource= $fulldirectory."/thumb/".$oldname;
|
||||
$urldestination = $fulldirectory."/thumb/".$data["subdirectory"];
|
||||
if($fs->exists($urlsource))
|
||||
$fs->rename($urlsource,$urldestination,true);
|
||||
|
||||
$urlsource= $fulldirectory."/thumbmini/".$oldname;
|
||||
$urldestination = $fulldirectory."/thumbmini/".$data["subdirectory"];
|
||||
if($fs->exists($urlsource))
|
||||
$fs->rename($urlsource,$urldestination,true);
|
||||
}
|
||||
|
||||
$toclose=true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
} else $form->get('subdirectory')->setData($oldname);
|
||||
|
||||
return $this->render('CadolesCoreBundle:File:subdirectory.html.twig',[
|
||||
'useheader' => false,
|
||||
'usemenu' => false,
|
||||
'usesidebar' => false,
|
||||
'access' => $access,
|
||||
'id' => $id,
|
||||
'subdirectory' => $subdirectory,
|
||||
'form' => $form->createView(),
|
||||
'toclose' => $toclose,
|
||||
]);
|
||||
}
|
||||
|
||||
public function trashAction(Request $request,$access="config")
|
||||
{
|
||||
// S'assurer que c'est un appel ajax
|
||||
if (!$request->isXmlHttpRequest()) {
|
||||
return new JsonResponse(array('message' => 'Interdit'), 400);
|
||||
}
|
||||
|
||||
$output=array();
|
||||
$directory=$request->request->get('directory');
|
||||
|
||||
// Récupération du répertoire source et le nom du fichier
|
||||
$racine=$this->get('kernel')->getRootDir()."/../uploads/file";
|
||||
$directory=$request->request->get('directory');
|
||||
$dirsource =$request->request->get('subdirectory');
|
||||
$namesource =$request->request->get('filename');
|
||||
|
||||
$canupdate =$this->getPermission($access,$directory);
|
||||
if(!$canupdate) throw $this->createNotFoundException('Permission denied');
|
||||
|
||||
$fs = new Filesystem();
|
||||
|
||||
// Déplacer le fichier
|
||||
$urlsource=$racine."/".$directory."/".$dirsource."/".$namesource;
|
||||
$urldestination=$racine."/".$directory."/__trash/".$dirsource."/".$namesource;
|
||||
$fs->mkdir($racine."/".$directory."/__trash/".$dirsource);
|
||||
if($fs->exists($urlsource)) {
|
||||
if(is_dir($urlsource)) {
|
||||
$fs->mirror($urlsource,$urldestination);
|
||||
$fs->remove($urlsource);
|
||||
}
|
||||
else $fs->rename($urlsource,$urldestination,true);
|
||||
|
||||
}
|
||||
|
||||
// Déplacer le thumb
|
||||
$fs->mkdir($racine."/".$directory."/__trash/".$dirsource."/thumb");
|
||||
$urlsource=$racine."/".$directory."/".$dirsource."/thumb/".$namesource;
|
||||
$urldestination=$racine."/".$directory."/__trash/".$dirsource."/thumb/".$namesource;
|
||||
if($fs->exists($urlsource)) {
|
||||
if(is_dir($urlsource)) {
|
||||
$fs->mirror($urlsource,$urldestination);
|
||||
$fs->remove($urlsource);
|
||||
}
|
||||
else $fs->rename($urlsource,$urldestination,true);
|
||||
}
|
||||
|
||||
// Déplacer le thumbmini
|
||||
$fs->mkdir($racine."/".$directory."/__trash/".$dirsource."/thumbmini");
|
||||
$urlsource=$racine."/".$directory."/".$dirsource."/thumbmini/".$namesource;
|
||||
$urldestination=$racine."/".$directory."/__trash/".$dirsource."/thumbmini/".$namesource;
|
||||
if($fs->exists($urlsource)) {
|
||||
if(is_dir($urlsource)) {
|
||||
$fs->mirror($urlsource,$urldestination);
|
||||
$fs->remove($urlsource);
|
||||
}
|
||||
else $fs->rename($urlsource,$urldestination,true);
|
||||
}
|
||||
|
||||
$response = new Response(json_encode($output));
|
||||
$response->headers->set('Content-Type', 'application/json');
|
||||
return $response;
|
||||
}
|
||||
|
||||
public function restaureAction(Request $request,$access="config")
|
||||
{
|
||||
// S'assurer que c'est un appel ajax
|
||||
if (!$request->isXmlHttpRequest()) {
|
||||
return new JsonResponse(array('message' => 'Interdit'), 400);
|
||||
}
|
||||
|
||||
$output=array();
|
||||
$directory=$request->request->get('directory');
|
||||
|
||||
// Récupération du répertoire source et le nom du fichier
|
||||
$racine=$this->get('kernel')->getRootDir()."/../uploads/file";
|
||||
$directory=$request->request->get('directory');
|
||||
$dirsource =$request->request->get('subdirectory');
|
||||
$namesource =$request->request->get('filename');
|
||||
|
||||
$canupdate =$this->getPermission($access,$directory);
|
||||
if(!$canupdate) throw $this->createNotFoundException('Permission denied');
|
||||
|
||||
$fs = new Filesystem();
|
||||
|
||||
// Déplacer le fichier
|
||||
$dirdestination=str_replace("__trash/","",$dirsource);
|
||||
$urlsource=$racine."/".$directory."/".$dirsource."/".$namesource;
|
||||
$urldestination=str_replace("__trash/","/",$urlsource);
|
||||
$fs->mkdir($racine."/".$directory."/".$dirdestination);
|
||||
if($fs->exists($urlsource)) {
|
||||
if(is_dir($urlsource)) {
|
||||
$fs->mirror($urlsource,$urldestination);
|
||||
$fs->remove($urlsource);
|
||||
}
|
||||
else $fs->rename($urlsource,$urldestination,true);
|
||||
}
|
||||
|
||||
// Déplacer le thumb
|
||||
$urlsource=$racine."/".$directory."/".$dirsource."/thumb/".$namesource;
|
||||
$urldestination=str_replace("__trash/","/",$urlsource);
|
||||
$fs->mkdir($racine."/".$directory."/".$dirdestination."/thumb");
|
||||
if($fs->exists($urlsource)) {
|
||||
if(is_dir($urlsource)) {
|
||||
$fs->mirror($urlsource,$urldestination);
|
||||
$fs->remove($urlsource);
|
||||
}
|
||||
else $fs->rename($urlsource,$urldestination,true);
|
||||
}
|
||||
|
||||
// Déplacer le thumbmini
|
||||
$urlsource=$racine."/".$directory."/".$dirsource."/thumbmini/".$namesource;
|
||||
$urldestination=str_replace("__trash/","/",$urlsource);
|
||||
$fs->mkdir($racine."/".$directory."/".$dirdestination."/thumbmini");
|
||||
if($fs->exists($urlsource)) {
|
||||
if(is_dir($urlsource)) {
|
||||
$fs->mirror($urlsource,$urldestination);
|
||||
$fs->remove($urlsource);
|
||||
}
|
||||
else $fs->rename($urlsource,$urldestination,true);
|
||||
}
|
||||
|
||||
$response = new Response(json_encode($output));
|
||||
$response->headers->set('Content-Type', 'application/json');
|
||||
return $response;
|
||||
}
|
||||
|
||||
public function purgetrashAction($directory,Request $request,$access="config")
|
||||
{
|
||||
$output=array();
|
||||
|
||||
$canupdate =$this->getPermission($access,$directory);
|
||||
if(!$canupdate) throw $this->createNotFoundException('Permission denied');
|
||||
|
||||
$fs = new Filesystem();
|
||||
$url=$this->get('kernel')->getRootDir()."/../uploads/file/".$directory."/__trash";
|
||||
if($fs->exists($url)) {
|
||||
$fs->remove($url);
|
||||
}
|
||||
|
||||
return $this->redirectToRoute('cadoles_core_'.$access.'_file_list',['directory'=>$directory]);
|
||||
}
|
||||
|
||||
public function deleteAction(Request $request,$access="config")
|
||||
{
|
||||
// S'assurer que c'est un appel ajax
|
||||
@ -247,7 +503,9 @@ class FileController extends Controller
|
||||
$filename=$request->request->get('filename');
|
||||
if($subdirectory) $directory.="/".$subdirectory;
|
||||
|
||||
$this->getPermission($access,$directory);
|
||||
$canupdate =$this->getPermission($access,$directory);
|
||||
if(!$canupdate) throw $this->createNotFoundException('Permission denied');
|
||||
|
||||
$fs = new Filesystem();
|
||||
$url=$this->get('kernel')->getRootDir()."/../uploads/file/".$directory."/".$filename;
|
||||
if($fs->exists($url)) {
|
||||
@ -267,25 +525,44 @@ class FileController extends Controller
|
||||
}
|
||||
|
||||
$output=array();
|
||||
$directory=$request->request->get('directory');+
|
||||
$directory=$request->request->get('directory');
|
||||
|
||||
|
||||
// Récupération du répertoire source et le nom du fichier
|
||||
$racine=$this->get('kernel')->getRootDir()."/../uploads/file";
|
||||
$dirsource =$request->request->get('dirsource');
|
||||
$namesource =$request->request->get('namesource');
|
||||
$dirdestination =$request->request->get('dirdestination');
|
||||
$namedestination =$request->request->get('namedestination');
|
||||
$directory = $request->request->get('directory');
|
||||
$dirsource = $request->request->get('dirsource');
|
||||
$namesource = $request->request->get('namesource');
|
||||
$dirdestination = $request->request->get('dirdestination');
|
||||
$namedestination = $request->request->get('namedestination');
|
||||
|
||||
$destid=$request->request->get('destid');
|
||||
|
||||
$this->getPermission($access,$directory);
|
||||
$canupdate =$this->getPermission($access,$directory);
|
||||
if(!$canupdate) throw $this->createNotFoundException('Permission denied');
|
||||
|
||||
$fs = new Filesystem();
|
||||
|
||||
// Déplacer le fichier
|
||||
$urlsource=$racine."/".$dirsource."/".$namesource;
|
||||
$urldestination=$racine."/".$dirdestination."/".$namedestination;
|
||||
$urlsource=str_replace("//","/",$racine."/".$dirsource."/".$namesource);
|
||||
$urldestination=str_replace("//","/",$racine."/".$dirdestination."/".$namedestination);
|
||||
|
||||
// Controle de cohérance du déplacement
|
||||
$fgerror=false;
|
||||
if(empty($racine)) $fgerror=true;
|
||||
if(empty($dirsource)) $fgerror=true;
|
||||
if(empty($directory)) $fgerror=true;
|
||||
if($urlsource==$urldestination) $fgerror=true;
|
||||
if(stripos($urldestination,$urlsource)!==false) $fgerror=true;
|
||||
if($fgerror) return new JsonResponse(array('message' => 'Interdit'), 400);
|
||||
|
||||
|
||||
if($fs->exists($urlsource)) {
|
||||
$fs->rename($urlsource,$urldestination);
|
||||
if(is_dir($urlsource)) {
|
||||
$fs->mirror($urlsource,$urldestination);
|
||||
$fs->remove($urlsource);
|
||||
}
|
||||
else
|
||||
$fs->rename($urlsource,$urldestination, true);
|
||||
}
|
||||
|
||||
// Déplacer le thumb
|
||||
@ -293,7 +570,12 @@ class FileController extends Controller
|
||||
$urlsource=$racine."/".$dirsource."/thumb/".$namesource;
|
||||
$urldestination=$racine."/".$dirdestination."/thumb/".$namedestination;
|
||||
if($fs->exists($urlsource)) {
|
||||
$fs->rename($urlsource,$urldestination);
|
||||
if(is_dir($urlsource)) {
|
||||
$fs->mirror($urlsource,$urldestination);
|
||||
$fs->remove($urlsource);
|
||||
}
|
||||
else
|
||||
$fs->rename($urlsource,$urldestination, true);
|
||||
}
|
||||
|
||||
// Déplacer le thumbmini
|
||||
@ -301,7 +583,12 @@ class FileController extends Controller
|
||||
$urlsource=$racine."/".$dirsource."/thumbmini/".$namesource;
|
||||
$urldestination=$racine."/".$dirdestination."/thumbmini/".$namedestination;
|
||||
if($fs->exists($urlsource)) {
|
||||
$fs->rename($urlsource,$urldestination);
|
||||
if(is_dir($urlsource)) {
|
||||
$fs->mirror($urlsource,$urldestination);
|
||||
$fs->remove($urlsource);
|
||||
}
|
||||
else
|
||||
$fs->rename($urlsource,$urldestination, true);
|
||||
}
|
||||
|
||||
$response = new Response(json_encode($output));
|
||||
@ -309,6 +596,7 @@ class FileController extends Controller
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
||||
public function viewAction($directory,$filename,Request $request,$access="config")
|
||||
{
|
||||
$this->getPermission($access,$directory);
|
||||
@ -447,8 +735,9 @@ class FileController extends Controller
|
||||
|
||||
// On s'assure que l'utilisateur à la permission de voir
|
||||
$page=$widget->getPage();
|
||||
$em->getRepository("CadolesPortalBundle:Page")->getPermission($this->getUser(),$page,$cansee,$canupdate);
|
||||
$em->getRepository("CadolesPortalBundle:Page")->getPermission($this->getUser(),$page,$cansee,$canupdate,$canadd);
|
||||
if(!$cansee) throw $this->createNotFoundException('Permission denied');
|
||||
return $canadd;
|
||||
break;
|
||||
|
||||
case "projecttask":
|
||||
@ -461,6 +750,7 @@ class FileController extends Controller
|
||||
$user=$this->getUser();
|
||||
$em->getRepository("CadolesPortalBundle:Project")->getPermission($user,$project,$cansee,$canupdate,$canadd);
|
||||
if(!$cansee) throw $this->createNotFoundException('Permission denied');
|
||||
return $canupdate;
|
||||
break;
|
||||
|
||||
case "calendarevent":
|
||||
@ -471,13 +761,12 @@ class FileController extends Controller
|
||||
// On s'assure que l'utilisateur à la permission de voir
|
||||
$calendar=$calendarevent->getCalendar();
|
||||
$user=$this->getUser();
|
||||
$em->getRepository("CadolesPortalBundle:Calendar")->getPermission($user,$calendar,$cansee,$canupdate);
|
||||
$em->getRepository("CadolesPortalBundle:Calendar")->getPermission($user,$calendar,$cansee,$canupdate,$canadd);
|
||||
if(!$cansee) throw $this->createNotFoundException('Permission denied');
|
||||
return $canadd;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else $canupdate=true;
|
||||
|
||||
return $canupdate;
|
||||
}
|
||||
}
|
||||
|
@ -139,16 +139,16 @@ class GroupController extends Controller
|
||||
case 6 :
|
||||
$qb->orderBy('table.owner',$order[0]["dir"]);
|
||||
break;
|
||||
case 7 :
|
||||
case 8 :
|
||||
$qb->orderBy('table.fgcancreatepage',$order[0]["dir"]);
|
||||
break;
|
||||
case 8 :
|
||||
case 9 :
|
||||
$qb->orderBy('table.fgcancreatecalendar',$order[0]["dir"]);
|
||||
break;
|
||||
case 9 :
|
||||
case 10 :
|
||||
$qb->orderBy('table.fgcancreateblog',$order[0]["dir"]);
|
||||
break;
|
||||
case 10 :
|
||||
case 11 :
|
||||
$qb->orderBy('table.fgcancreateproject',$order[0]["dir"]);
|
||||
break;
|
||||
}
|
||||
@ -175,30 +175,35 @@ class GroupController extends Controller
|
||||
if(!$data->getFgall()) $action .="<a href='".$this->generateUrl('cadoles_core_config_group_users', array('id'=>$data->getId()))."'><i class='fa fa-users fa-2x fa-fw'></i></a>";
|
||||
|
||||
if($data->getFgcanshare())
|
||||
$action.="<a href='".$this->generateUrl('cadoles_core_'.$access.'_group_statistic', array('id'=>$data->getId()))."'><i class='fa fa-bar-chart-o fa-fw fa-2x'></i></a>";
|
||||
$action.="<a href='".$this->generateUrl('cadoles_core_'.$access.'_group_statistic', array('id'=>$data->getId()))."'><i class='fa fa-chart-area fa-fw fa-2x'></i></a>";
|
||||
}
|
||||
else {
|
||||
$fgproprio=($user==$data->getOwner());
|
||||
$fgmanager=false;
|
||||
$fgcanupdate=($user==$data->getOwner());
|
||||
$fgcanmanage=false;
|
||||
$usergroup=$this->getDoctrine()->getRepository("CadolesCoreBundle:UserGroup")->findOneBy(["user"=>$this->getUser(),"group"=>$data]);
|
||||
if($usergroup) $fgmanager=$usergroup->getFgmanager();
|
||||
if($usergroup) $fgcanmanage=($usergroup->getRolegroup()>=90);
|
||||
|
||||
// Modification possible uniquement si l'utilisateur est propriétaire du groupe
|
||||
if($fgproprio) {
|
||||
if($fgcanupdate) {
|
||||
$action .="<a href='".$this->generateUrl('cadoles_core_'.$access.'_group_update', array('id'=>$data->getId()))."'><i class='fa fa-file fa-2x fa-fw'></i></a>";
|
||||
$action .="<a href='".$this->generateUrl('cadoles_core_'.$access.'_group_delete', array('id'=>$data->getId()))."'><i class='fa fa-trash fa-2x fa-fw'></i></a>";
|
||||
}
|
||||
|
||||
// Gestion des utilisateurs du groupe uniquement pour le proprio ou les managers
|
||||
if($fgproprio||$fgmanager) {
|
||||
if($fgcanupdate||$fgcanmanage) {
|
||||
$action .="<a href='".$this->generateUrl('cadoles_core_'.$access.'_group_users', array('id'=>$data->getId()))."'><i class='fa fa-users fa-2x fa-fw'></i></a>";
|
||||
}
|
||||
else {
|
||||
$action.="<a href='".$this->generateUrl('cadoles_core_'.$access.'_group_out', array('id'=>$data->getId()))."'><i class='fa fa-sign-out fa-fw fa-2x'></i></a>";
|
||||
// On ne peut se désinscrire que si le groupe est ouvert et qu'il n'est pas lié à un groupe ldap ou sso
|
||||
$fgcanleave=true;
|
||||
if($data->getFgtemplate() or $data->getFgall()) $fgcanleave=false;
|
||||
elseif(!$data->getFgcanshare() && !$data->getFgopen()) $fgcanleave=false;
|
||||
elseif($data->getFgcanshare() && !$this->get('session')->get('permunsubscribe') && !$data->getFgopen()) $fgcanleave=false;
|
||||
if($fgcanleave) $action.="<a href='".$this->generateUrl('cadoles_core_'.$access.'_group_out', array('id'=>$data->getId()))."'><i class='fa fa-sign-out-alt fa-fw fa-2x'></i></a>";
|
||||
}
|
||||
|
||||
if($data->getFgcanshare())
|
||||
$action.="<a href='".$this->generateUrl('cadoles_core_'.$access.'_group_statistic', array('id'=>$data->getId()))."'><i class='fa fa-bar-chart-o fa-fw fa-2x'></i></a>";
|
||||
$action.="<a href='".$this->generateUrl('cadoles_core_'.$access.'_group_statistic', array('id'=>$data->getId()))."'><i class='fa fa-chart-area fa-fw fa-2x'></i></a>";
|
||||
}
|
||||
|
||||
|
||||
@ -217,6 +222,12 @@ class GroupController extends Controller
|
||||
$userinfo.="<br>".$data->getOwner()->getUsername();
|
||||
}
|
||||
|
||||
$visitecpt="";
|
||||
$visitelast=null;
|
||||
foreach($data->getUsers() as $usergroup) {
|
||||
$visitecpt+=$usergroup->getVisitecpt();
|
||||
$visitelast=($usergroup->getVisitedate()>$visitelast?$usergroup->getVisitedate():$visitelast);
|
||||
}
|
||||
|
||||
|
||||
array_push($output["data"],array(
|
||||
@ -227,6 +238,7 @@ class GroupController extends Controller
|
||||
$filtre,
|
||||
($data->getFgcanshare()?"oui":"non"),
|
||||
$userinfo,
|
||||
($visitelast?$visitelast->format("d/m/Y H:i")."<br>":"")."nb = ".$visitecpt,
|
||||
($data->getFgcancreatepage()?"oui":"non"),
|
||||
($data->getFgcancreatecalendar()?"oui":"non"),
|
||||
($data->getFgcancreateblog()?"oui":"non"),
|
||||
@ -358,12 +370,10 @@ class GroupController extends Controller
|
||||
if($group->getLdapfilter()==""&&$group->getAttributes()=="")
|
||||
$action.="<a style='cursor:pointer' onClick='addUsers(".$data->getId().")'><i class='fa fa-plus fa-fw'></i></a>";
|
||||
|
||||
$fgmanager="<input type='checkbox' class='switch' onChange='switchManager(".$data->getId().");'>";
|
||||
|
||||
// Avatar
|
||||
$avatar="<img onClick='seeUser(".$data->getId().")' src='/".$this->container->getParameter('alias')."/uploads/avatar/".$data->getAvatar()."' style='width:30px;background-color:#337ab7;margin:auto;display:block;cursor:pointer;'>";
|
||||
|
||||
array_push($output["data"],array("DT_RowId"=>"user".$data->getId(),$action,$avatar,$data->getUsername(),$data->getEmail(),"",$fgmanager));
|
||||
array_push($output["data"],array("DT_RowId"=>"user".$data->getId(),$action,$avatar,$data->getUsername(),$data->getEmail(),"",""));
|
||||
}
|
||||
|
||||
// Retour
|
||||
@ -482,7 +492,15 @@ class GroupController extends Controller
|
||||
}
|
||||
|
||||
$datas=$qb->setFirstResult($start)->setMaxResults($length)->getQuery()->getResult();
|
||||
$user=$this->getUser();
|
||||
|
||||
$config=$em->getRepository('CadolesCoreBundle:Config')->find("datausers");
|
||||
$fields=$config->getValue();
|
||||
$fields=json_decode($fields,true);
|
||||
if(!is_array($fields)) $fields=[];
|
||||
if(!array_key_exists("visite",$fields)) $fields["visite"]["perm"]=0;
|
||||
$fgviewvisite=($fields["visite"]["perm"]==1);
|
||||
|
||||
foreach($datas as $data) {
|
||||
// Propriétaire
|
||||
$usergroup=$em->getRepository("CadolesCoreBundle:UserGroup")->findOneBy(["user"=>$data->getId(),"group"=>$id]);
|
||||
@ -497,22 +515,32 @@ class GroupController extends Controller
|
||||
$avatar="<img onClick='seeUser(".$data->getId().")' src='/".$this->container->getParameter('alias')."/uploads/avatar/".$data->getAvatar()."' style='width:30px;background-color:#337ab7;margin:auto;display:block;cursor:pointer'>";
|
||||
|
||||
// Flag manager
|
||||
$fgmanager="";
|
||||
$rolegroup="";
|
||||
if($fgcanshare) {
|
||||
|
||||
$checked=($usergroup->getFgmanager()?"checked":"");
|
||||
$fgmanager="<input type='checkbox' class='switch' onChange='switchManager(".$data->getId().");' $checked>";
|
||||
if($fgproprio) $fgmanager="Propriétaire du groupe";
|
||||
|
||||
if($fgproprio) $rolegroup="Propriétaire du groupe";
|
||||
elseif($user==$usergroup->getUser()) $rolegroup="Gestionnaire";
|
||||
else {
|
||||
$selectuser=($usergroup->getRolegroup()==0?"selected='selected'":"");
|
||||
$selectwritter=($usergroup->getRolegroup()==50?"selected='selected'":"");
|
||||
$selectmanager=($usergroup->getRolegroup()==90?"selected='selected'":"");
|
||||
|
||||
$rolegroup='<select id="roleuser-'.$data->getId().'" name="user[visible]" onChange="changeRole('.$data->getId().');"><option value="0" '.$selectuser.'>Utilisateur</option><option value="50" '.$selectwritter.'>Collaborateur</option><option value="90" '.$selectmanager.'>Gestionnaire</option></select>';
|
||||
}
|
||||
}
|
||||
|
||||
// Visite
|
||||
$visite="";
|
||||
if($usergroup->getVisitedate()) {
|
||||
$visite=$usergroup->getVisitedate()->format("d/m/Y H:i")."<br>nb = ".$usergroup->getVisitecpt();
|
||||
if($fgviewvisite) {
|
||||
$visite="";
|
||||
if($usergroup->getVisitedate()) {
|
||||
$visite=$usergroup->getVisitedate()->format("d/m/Y H:i")."<br>nb = ".$usergroup->getVisitecpt();
|
||||
}
|
||||
}
|
||||
if($fgviewvisite)
|
||||
$tmp=array("DT_RowId"=>"user".$data->getId(),$action,$avatar,$data->getUsername(),$data->getEmail(),$visite,$rolegroup);
|
||||
else
|
||||
$tmp=array("DT_RowId"=>"user".$data->getId(),$action,$avatar,$data->getUsername(),$data->getEmail(),$rolegroup);
|
||||
|
||||
array_push($output["data"],array("DT_RowId"=>"user".$data->getId(),$action,$avatar,$data->getUsername(),$data->getEmail(),$visite,$fgmanager));
|
||||
array_push($output["data"],$tmp);
|
||||
}
|
||||
|
||||
// Retour
|
||||
@ -545,11 +573,12 @@ class GroupController extends Controller
|
||||
}
|
||||
|
||||
$key = Uuid::uuid4();
|
||||
$usergroup=new Usergroup;
|
||||
$usergroup=new UserGroup();
|
||||
$user=$em->getRepository("CadolesCoreBundle:User")->find($userid);
|
||||
$usergroup->setUser($user);
|
||||
$usergroup->setGroup($group);
|
||||
$usergroup->setKeyvalue($key);
|
||||
$usergroup->setRolegroup(0);
|
||||
$em->persist($usergroup);
|
||||
$em->flush();
|
||||
|
||||
@ -559,9 +588,9 @@ class GroupController extends Controller
|
||||
$websocket = $this->container->get('cadoles.websocket.pushmessage')->send($key->toString(),$userid,$groupid,$message);
|
||||
|
||||
// Notification mail auprès de la personne inscrite
|
||||
if($group->getFgcanshare()) {
|
||||
if($group->getFgcanshare()&&$this->get('session')->get('fgnotifgroup')) {
|
||||
$idpage =$group->getPages()->first()->getId();
|
||||
$url = $this->generateUrl('cadoles_core_home', ["id"=>$idpage], UrlGeneratorInterface::ABSOLUTE_URL);
|
||||
$url = $this->generateUrl('cadoles_core_redirect', ["route"=>"cadoles_core_home","id"=>$idpage], UrlGeneratorInterface::ABSOLUTE_URL);
|
||||
$texthtml="Vous venez d'être inscrit dans le groupe de travail : ".$group->getLabel()."<br>Suivez le lien suivant pour y accéder = <a href='$url'>$url</a>";
|
||||
$text="Vous venez d'être inscrit dans le groupe de travail : ".$group->getLabel()."<br>Suivez le lien suivant pour y accéder = $url";
|
||||
|
||||
@ -613,7 +642,7 @@ class GroupController extends Controller
|
||||
$em->flush();
|
||||
|
||||
// Notification mail auprès des managers
|
||||
if($group->getFgcanshare()) {
|
||||
if($group->getFgcanshare()&&$this->get('session')->get('fgnotifgroup')) {
|
||||
$text=$user->getUsername()." a été désinscrit du groupe de travail : ".$group->getLabel();
|
||||
$template="template";
|
||||
$mail_params=array(
|
||||
@ -621,10 +650,11 @@ class GroupController extends Controller
|
||||
"body_html"=>nl2br($text),
|
||||
"body_text"=>$text
|
||||
);
|
||||
$managers=$em->getRepository("CadolesCoreBundle:Usergroup")->findBy(array("group"=>$groupid,"fgmanager"=>true));
|
||||
$usergroups=$em->getRepository("CadolesCoreBundle:Usergroup")->findBy(array("group"=>$groupid));
|
||||
$to=array();
|
||||
foreach($managers as $manager) {
|
||||
array_push($to,$manager->getUser()->getEmail());
|
||||
foreach($usergroups as $usergroup) {
|
||||
if($usergroup->getRolegroup()>=90)
|
||||
array_push($to,$usergroup->getUser()->getEmail());
|
||||
}
|
||||
|
||||
$from = $this->getParameter('noreply');;
|
||||
@ -658,7 +688,7 @@ class GroupController extends Controller
|
||||
$em->flush();
|
||||
|
||||
// Notification mail auprès des managers
|
||||
if($group->getFgcanshare()) {
|
||||
if($group->getFgcanshare()&&$this->get('session')->get('fgnotifgroup')) {
|
||||
$text=$user->getUsername()." a été désinscrit du groupe de travail : ".$group->getLabel();
|
||||
$template="template";
|
||||
$mail_params=array(
|
||||
@ -666,10 +696,11 @@ class GroupController extends Controller
|
||||
"body_html"=>nl2br($text),
|
||||
"body_text"=>$text
|
||||
);
|
||||
$managers=$em->getRepository("CadolesCoreBundle:Usergroup")->findBy(array("group"=>$group,"fgmanager"=>true));
|
||||
$usergroups=$em->getRepository("CadolesCoreBundle:Usergroup")->findBy(array("group"=>$group));
|
||||
$to=array();
|
||||
foreach($managers as $manager) {
|
||||
array_push($to,$manager->getUser()->getEmail());
|
||||
foreach($usergroups as $usergroup) {
|
||||
if($usergroup->getRolegroup()>=90)
|
||||
array_push($to,$usergroup->getUser()->getEmail());
|
||||
}
|
||||
|
||||
$from = $this->getParameter('noreply');;
|
||||
@ -683,7 +714,7 @@ class GroupController extends Controller
|
||||
return $this->redirect($this->generateUrl("cadoles_core_user_group"));
|
||||
}
|
||||
|
||||
public function switchmanagerAction(Request $request,$access="config")
|
||||
public function changeroleAction(Request $request,$access="config")
|
||||
{
|
||||
// S'assurer que c'est un appel ajax
|
||||
if (!$request->isXmlHttpRequest()) {
|
||||
@ -695,12 +726,13 @@ class GroupController extends Controller
|
||||
$output=array();
|
||||
$userid=$request->request->get('user');
|
||||
$groupid=$request->request->get('group');
|
||||
$role=$request->request->get('role');
|
||||
|
||||
$group=$em->getRepository("CadolesCoreBundle:Group")->find($groupid);
|
||||
$this->canManager($group,$access);
|
||||
|
||||
$data = $em->getRepository("CadolesCoreBundle:Usergroup")->findOneBy(array("user"=>$userid,"group"=>$groupid));
|
||||
if($data) $data->setFgmanager(!$data->getFgmanager());
|
||||
if($data) $data->setRolegroup($role);
|
||||
|
||||
$em->persist($data);
|
||||
$em->flush();
|
||||
@ -856,7 +888,7 @@ class GroupController extends Controller
|
||||
$this->ctrlFgcanshare($data,$access);
|
||||
|
||||
// Si le propriétaire change de main on prévient le nouveau propriétaire
|
||||
if($data->getOwner()&&$data->getOwner()!=$oldowner) {
|
||||
if($data->getOwner()&&$data->getOwner()!=$oldowner&&$this->get('session')->get('fgnotifgroup')) {
|
||||
// Email à destination de l'inscript pour le prévenir qu'un administrateur doit valider
|
||||
$text="On vient de vous tranférer la propriété du groupe ".$data->getLabel();
|
||||
$template="template";
|
||||
@ -999,6 +1031,14 @@ class GroupController extends Controller
|
||||
// idreturn ?
|
||||
$idreturn=$request->get("idreturn");
|
||||
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$config=$em->getRepository('CadolesCoreBundle:Config')->find("datausers");
|
||||
$fields=$config->getValue();
|
||||
$fields=json_decode($fields,true);
|
||||
if(!is_array($fields)) $fields=[];
|
||||
if(!array_key_exists("visite",$fields)) $fields["visite"]["perm"]=0;
|
||||
$fgviewvisite=($fields["visite"]["perm"]==1);
|
||||
|
||||
// Affichage du formulaire
|
||||
return $this->render($this->labelentity.':users.html.twig', [
|
||||
'useheader' => true,
|
||||
@ -1007,9 +1047,65 @@ class GroupController extends Controller
|
||||
'access' => $access,
|
||||
$this->labeldata => $data,
|
||||
'idreturn' => $idreturn,
|
||||
'fgviewvisite' => $fgviewvisite,
|
||||
]);
|
||||
}
|
||||
|
||||
public function groupexportAction(Request $request, $access="config")
|
||||
{
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$dir = $this->get('kernel')->getRootDir() . '/../uploads/export/';
|
||||
$file = "exportgroup.csv";
|
||||
|
||||
$fs = new Filesystem();
|
||||
$fs->mkdir($dir);
|
||||
|
||||
$csvh = fopen($dir.$file, 'w');
|
||||
$d = ';'; // this is the default but i like to be explicit
|
||||
$e = '"'; // this is the default but i like to be explicit
|
||||
|
||||
// Entête de colonne
|
||||
$data=["id","Label","Ouvert","Groupe de Travail","Propriétaire","Date Visite","Cpt Visite","Création Page","Création Calendriers","Création Blogs","Création Projets"];
|
||||
fputcsv($csvh, $data, $d, $e);
|
||||
|
||||
// Liste des utilisateurs en fonction du role de l'utilisateur en cours
|
||||
$groups=$em->getRepository("CadolesCoreBundle:Group")->findAll();
|
||||
|
||||
foreach($groups as $group) {
|
||||
$data = [
|
||||
"id"=>$group->getId(),
|
||||
"label"=>$group->getLabel(),
|
||||
"fgopen"=>($group->getFgopen()?"oui":"non"),
|
||||
"fgcanshare"=>($group->getFgcanshare()?"oui":"non"),
|
||||
"owner"=>($group->getOwner()?$group->getOwner()->getUsername():""),
|
||||
"visitedate"=>"",
|
||||
"visitecpt"=>"",
|
||||
"fgcancreatepage"=>($group->getFgcancreatepage()?"oui":"non"),
|
||||
"fgcancreatecalendar"=>($group->getFgcancreatecalendar()?"oui":"non"),
|
||||
"fgcancreateblog"=>($group->getFgcancreateblog()?"oui":"non"),
|
||||
"fgcancreateproject"=>($group->getFgcancreateproject()?"oui":"non"),
|
||||
];
|
||||
|
||||
$visitecpt="";
|
||||
$visitelast=null;
|
||||
foreach($group->getUsers() as $usergroup) {
|
||||
$visitecpt+=$usergroup->getVisitecpt();
|
||||
$visitelast=($usergroup->getVisitedate()>$visitelast?$usergroup->getVisitedate():$visitelast);
|
||||
}
|
||||
|
||||
$data["visitedate"]=($visitelast?$visitelast->format("d/m/Y H:i"):"");
|
||||
$data["visitecpt"]=$visitecpt;
|
||||
|
||||
fputcsv($csvh, $data, $d, $e);
|
||||
}
|
||||
fclose($csvh);
|
||||
|
||||
$response = new BinaryFileResponse($dir.$file);
|
||||
$response->setContentDisposition(ResponseHeaderBag::DISPOSITION_ATTACHMENT);
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
public function usergroupexportAction($id,Request $request, $access="config")
|
||||
{
|
||||
// Récupération de l'enregistrement courant
|
||||
@ -1131,11 +1227,51 @@ class GroupController extends Controller
|
||||
]);
|
||||
}
|
||||
|
||||
public function invitationAction($id,Request $request, $access="config")
|
||||
{
|
||||
// Récupération de l'enregistrement courant
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$group=$this->getData($id);
|
||||
$this->canManager($group,$access);
|
||||
|
||||
$invitations=$group->getInvitations();
|
||||
if(!is_array($invitations)) $invitations=[];
|
||||
|
||||
foreach($invitations as $key => $mail) {
|
||||
$user=$em->getRepository("CadolesCoreBundle:User")->findOneBy(["email"=>$mail]);
|
||||
// Si l'utilisateur est inscript plus la peine de le suivre
|
||||
if($user) {
|
||||
$listinvitations[$key]=["email"=>$mail,"statut"=>"","relance"=>false];
|
||||
$usergroup=$em->getRepository("CadolesCoreBundle:UserGroup")->findOneBy(["user"=>$user,"group"=>$group]);
|
||||
if($usergroup)
|
||||
$listinvitations[$key]["statut"]="Inscrit dans le groupe";
|
||||
else
|
||||
$listinvitations[$key]["statut"]="Inscrit sur ".$this->get('session')->get('appname')." mais pas dans le groupe";
|
||||
}
|
||||
else {
|
||||
$listinvitations[$key]=["email"=>$mail,"statut"=>"Non inscrit sur ".$this->get('session')->get('appname'),"relance"=>true];
|
||||
$user=$em->getRepository("CadolesCoreBundle:Registration")->findOneBy(["email"=>$mail]);
|
||||
if($user) {
|
||||
$listinvitations[$key]["statut"]=$user->getStatut()->getLabel();
|
||||
$listinvitations[$key]["relance"]=false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $this->render('CadolesCoreBundle:Group:invitations.html.twig',[
|
||||
'useheader' => false,
|
||||
'usemenu' => false,
|
||||
'usesidebar' => false,
|
||||
'id' => $id,
|
||||
'invitations' => $listinvitations,
|
||||
]);
|
||||
}
|
||||
|
||||
protected function canManager($group,$access) {
|
||||
if($access!="config") {
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$ismanager=$em->getRepository("CadolesCoreBundle:Usergroup")->findOneBy(["group"=>$group,"user"=>$this->getUser(),"fgmanager"=>true]);
|
||||
if(!$ismanager)
|
||||
$user=$em->getRepository("CadolesCoreBundle:Usergroup")->findOneBy(["group"=>$group,"user"=>$this->getUser()]);
|
||||
if(!$user||$user->getRolegroup()<90)
|
||||
throw $this->createNotFoundException('Permission denied');
|
||||
}
|
||||
}
|
||||
@ -1151,19 +1287,27 @@ class GroupController extends Controller
|
||||
|
||||
protected function ctrlOwner($group) {
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
// Le propriétaire passe manager
|
||||
$usergroups=$em->getRepository("CadolesCoreBundle:Usergroup")->findBy(["group"=>$group,"rolegroup"=>"100"]);
|
||||
foreach($usergroups as $usergroup) {
|
||||
$usergroup->setRolegroup(90);
|
||||
$em->persist($usergroup);
|
||||
$em->flush();
|
||||
}
|
||||
|
||||
// Le propriétaire prend son role dans le groupe
|
||||
if($group->getOwner()) {
|
||||
$usergroup=$em->getRepository("CadolesCoreBundle:Usergroup")->findOneBy(["group"=>$group,"user"=>$group->getOwner()]);
|
||||
if(!$usergroup) {
|
||||
$key = Uuid::uuid4();
|
||||
$usergroup=new Usergroup;
|
||||
$usergroup=new UserGroup();
|
||||
$usergroup->setUser($group->getOwner());
|
||||
$usergroup->setGroup($group);
|
||||
$usergroup->setKeyvalue($key);
|
||||
}
|
||||
$usergroup->setFgmanager(true);
|
||||
$usergroup->setRolegroup(100);
|
||||
$em->persist($usergroup);
|
||||
$em->flush();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -23,6 +23,10 @@ class MailController extends Controller
|
||||
throw $this->createNotFoundException('Unable to find '.$this->labeldata);
|
||||
}
|
||||
|
||||
// On récupère la liste des email invités
|
||||
$invitations=$group->getInvitations();
|
||||
if(!is_array($invitations)) $invitations=[];
|
||||
|
||||
// Création du formulaire
|
||||
$form = $this->createForm(MailType::class);
|
||||
|
||||
@ -34,7 +38,7 @@ class MailController extends Controller
|
||||
|
||||
// Sujet
|
||||
$url = $this->generateUrl('cadoles_core_registration',[], UrlGeneratorInterface::ABSOLUTE_URL)."?group=".$group->getId();
|
||||
$message = "Bonjour,<br><br>En tant que responsable du projet <b>'".$group->getLabel()."'</b>, je vous ai invité à rejoindre cette communauté de travail<br><br>";
|
||||
$message = "Bonjour,<br><br>En tant que responsable du groupe <b>'".$group->getLabel()."'</b>, je vous ai invité à rejoindre cette communauté de travail<br><br>";
|
||||
$message.= "Merci de bien vouloir tout d’abord vous inscrire sur <b>".$this->get('session')->get('appname')."</b> en suivant le lien suivant<br>";
|
||||
$message.= "<a href='$url'>$url</a><br><br>";
|
||||
$message.= "Une fois le processus d'inscription complété, vous serez automatiquement rattaché à notre groupe de travail<br><br>";
|
||||
@ -64,8 +68,15 @@ class MailController extends Controller
|
||||
if($usergroup) array_push($usersin,$user);
|
||||
else array_push($usersnotin,$user);
|
||||
}
|
||||
else {
|
||||
// On enregistre l'invitation si elle n'existe pas déjà
|
||||
if(!in_array($mail,$invitations)) {
|
||||
array_push($invitations,$mail);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
$text=$form->get("message")->getData();
|
||||
$subject=$form->get("subject")->getData();
|
||||
$template="template";
|
||||
@ -78,6 +89,17 @@ class MailController extends Controller
|
||||
$fromName = $this->getUser()->getFirstname()." ".$this->getUser()->getLastname();
|
||||
$message = $this->container->get('cadoles.core.service.mail');
|
||||
$message->sendEmail($template, $mail_params, $to, $from, $fromName);
|
||||
|
||||
// Sauvegarde des invitation
|
||||
$group->setInvitations($invitations);
|
||||
$em->persist($group);
|
||||
$em->flush();
|
||||
}
|
||||
else {
|
||||
$email=$request->get("email");
|
||||
if($email) {
|
||||
$form->get('destinataire')->setData($email);
|
||||
}
|
||||
}
|
||||
|
||||
if($closed && (!empty($usersin)||!empty($usersnotin))) {
|
||||
|
@ -331,8 +331,15 @@ class PermmodoprofilController extends Controller
|
||||
$this->addModeration($profil,'cadoles_portal_config_flux',1);
|
||||
$this->addModeration($profil,'cadoles_portal_config_notice',1);
|
||||
$this->addModeration($profil,'cadoles_portal_config_icon',1);
|
||||
$this->addModeration($profil,'cadoles_portal_config_syncbalado',0);
|
||||
$this->addModeration($profil,'cadoles_portal_config_synccdt',0);
|
||||
$this->addModeration($profil,'cadoles_portal_config_syncgepiannu',0);
|
||||
$this->addModeration($profil,'cadoles_portal_config_syncgepisiecle',0);
|
||||
$this->addModeration($profil,'cadoles_portal_config_synclimesurvey',0);
|
||||
$this->addModeration($profil,'cadoles_portal_config_syncmoodle',0);
|
||||
$this->addModeration($profil,'cadoles_portal_config_syncnextcloud',0);
|
||||
$this->addModeration($profil,'cadoles_portal_config_syncsacoche',0);
|
||||
$this->addModeration($profil,'cadoles_portal_config_syncpiwik',0);
|
||||
$this->addModeration($profil,'cadoles_portal_config_syncwordpress',0);
|
||||
$this->addModeration($profil,'cadoles_core_config_statistic',1);
|
||||
$this->addModeration($profil,'cadoles_core_config_mailing',1);
|
||||
|
@ -212,7 +212,7 @@ class RegistrationController extends Controller
|
||||
// Sur erreur
|
||||
$this->getErrorForm(null,$form,$request,$data,"submit",$idstatut);
|
||||
|
||||
// Sur validation(z)
|
||||
// Sur validation
|
||||
if ($form->get('submit')->isClicked() && $form->isValid()) {
|
||||
|
||||
$data = $form->getData();
|
||||
@ -342,6 +342,8 @@ class RegistrationController extends Controller
|
||||
// A voir retour sur un écran d'info indiquant si validation par admion ou s'il doit matter ses email
|
||||
$this->get('session')->set('registrationinfo', $info);
|
||||
$this->get('session')->set('registrationmode', "info");
|
||||
$this->get('session')->set('registrationredirectto', null);
|
||||
|
||||
return $this->redirectToRoute('cadoles_core_registration_info');
|
||||
}
|
||||
else {
|
||||
@ -360,12 +362,16 @@ class RegistrationController extends Controller
|
||||
{
|
||||
$info = $this->get('session')->get('registrationinfo');
|
||||
$mode = $this->get('session')->get('registrationmode');
|
||||
$redirectto = $this->get('session')->get('registrationredirectto');
|
||||
|
||||
|
||||
return $this->render($this->labelentity.':info.html.twig', [
|
||||
'useheader' => true,
|
||||
'usemenu' => false,
|
||||
'usesidebar' => false,
|
||||
'info' => $info,
|
||||
'mode' => $mode
|
||||
'mode' => $mode,
|
||||
'redirectto' => $redirectto,
|
||||
]);
|
||||
}
|
||||
|
||||
@ -467,6 +473,7 @@ class RegistrationController extends Controller
|
||||
{
|
||||
$moderegistration = $this->getParameter('moderegistration');
|
||||
$masteridentity = $this->getParameter('masteridentity');
|
||||
|
||||
if($moderegistration=="none"||$masteridentity!="SQL")
|
||||
throw $this->createNotFoundException('Permission denied');
|
||||
|
||||
@ -488,7 +495,8 @@ class RegistrationController extends Controller
|
||||
$mode="danger";
|
||||
|
||||
$this->get('session')->set('registrationinfo', $info);
|
||||
$this->get('session')->set('registrationmode', $mode);
|
||||
$this->get('session')->set('registrationmode', $mode);
|
||||
$this->get('session')->set('registrationredirectto', null);
|
||||
}
|
||||
else {
|
||||
$url=$this->getUrlLogin();
|
||||
@ -509,6 +517,7 @@ class RegistrationController extends Controller
|
||||
$user->setPasswordDirect($data[0]->getPassword());
|
||||
$user->setVisible($data[0]->getVisible());
|
||||
$user->setMotivation($data[0]->getMotivation());
|
||||
$user->setNote($data[0]->getNote());
|
||||
|
||||
$user->setNiveau01($data[0]->getNiveau01());
|
||||
$user->setSiren($data[0]->getNiveau01()->getSiren());
|
||||
@ -538,16 +547,24 @@ class RegistrationController extends Controller
|
||||
|
||||
// Si invitation à un groupe : on le rattache directement à ce groupe
|
||||
$groupid=$data[0]->getGroupid();
|
||||
|
||||
$userid=$user->getId();
|
||||
if($groupid) {
|
||||
$group=$em->getRepository("CadolesCoreBundle:Group")->find($groupid);
|
||||
if($group) {
|
||||
$idpage =$group->getPages()->first()->getId();
|
||||
$url = $this->generateUrl('cadoles_core_redirect', ["route"=>"cadoles_core_home","id"=>$idpage], UrlGeneratorInterface::ABSOLUTE_URL);
|
||||
$info="<p>Votre compte est à présent activé</p><p>Vous allez être redirigé vers la mire de connexion puis vers votre groupe de travail</p><p><a href='".$url."'>Connexion</a>";
|
||||
$this->get('session')->set('registrationinfo', $info);
|
||||
$this->get('session')->set('registrationredirectto', $url);
|
||||
|
||||
$key = Uuid::uuid4();
|
||||
$usergroup=new Usergroup;
|
||||
$usergroup=new UserGroup();
|
||||
$user=$em->getRepository("CadolesCoreBundle:User")->find($userid);
|
||||
$usergroup->setUser($user);
|
||||
$usergroup->setGroup($group);
|
||||
$usergroup->setKeyvalue($key);
|
||||
$usergroup->setRolegroup(0);
|
||||
$em->persist($usergroup);
|
||||
$em->flush();
|
||||
|
||||
@ -686,6 +703,7 @@ class RegistrationController extends Controller
|
||||
$mode="info";
|
||||
$this->get('session')->set('registrationinfo', $info);
|
||||
$this->get('session')->set('registrationmode', $mode);
|
||||
$this->get('session')->set('registrationredirectto', null);
|
||||
return $this->redirectToRoute('cadoles_core_registration_info');
|
||||
}
|
||||
|
||||
@ -700,9 +718,8 @@ class RegistrationController extends Controller
|
||||
|
||||
public function resetpwd02Action($key,Request $request)
|
||||
{
|
||||
$moderegistration = $this->getParameter('moderegistration');
|
||||
$masteridentity = $this->getParameter('masteridentity');
|
||||
if($moderegistration=="none"||$masteridentity!="SQL")
|
||||
if($masteridentity!="SQL")
|
||||
throw $this->createNotFoundException('Permission denied');
|
||||
|
||||
$now=new \DateTime();
|
||||
@ -723,6 +740,7 @@ class RegistrationController extends Controller
|
||||
$mode="danger";
|
||||
$this->get('session')->set('registrationinfo', $info);
|
||||
$this->get('session')->set('registrationmode', $mode);
|
||||
$this->get('session')->set('registrationredirectto', null);
|
||||
return $this->redirectToRoute('cadoles_core_registration_info');
|
||||
}
|
||||
else {
|
||||
@ -782,6 +800,7 @@ class RegistrationController extends Controller
|
||||
$mode="success";
|
||||
$this->get('session')->set('registrationinfo', $info);
|
||||
$this->get('session')->set('registrationmode', $mode);
|
||||
$this->get('session')->set('registrationredirectto', null);
|
||||
return $this->redirectToRoute('cadoles_core_registration_info');
|
||||
}
|
||||
|
||||
@ -872,7 +891,7 @@ class RegistrationController extends Controller
|
||||
$niveau01=strtolower($data->getNiveau01()->getLabel());
|
||||
if(stripos($niveau01,"autre")===0) {
|
||||
if(!$data->getNiveau01other()) {
|
||||
$form->addError(new FormError("Merci d'indiquer votre ".$this->getParameter("labelniveau01")));
|
||||
$form->addError(new FormError("Merci de compléter le champ 'Autre ".$this->getParameter("labelniveau01")."'"));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -46,6 +46,7 @@ class SondeController extends Controller
|
||||
elseif($route=="cadoles_portal_user_page_view") {
|
||||
if($usage=="group") $usagesonde="collaboratif";
|
||||
elseif($usage=="user") $usagesonde="collaboratif";
|
||||
elseif($usage=="accueil") $usagesonde="accueil";
|
||||
else $usagesonde="portail";
|
||||
}
|
||||
elseif(stripos($route,"cadoles_portal_user_calendar")!==false)
|
||||
|
@ -366,8 +366,8 @@ class UserController extends Controller
|
||||
// Initialisation de l'enregistrement
|
||||
$data = new User();
|
||||
$data->setVisible(true);
|
||||
$data->setBelongingpopulation("authlevel");
|
||||
$data->setAuthlevel("simple");
|
||||
$data->setBelongingpopulation("agent");
|
||||
$fields=$this->getDefaultDatauser();
|
||||
|
||||
// Création du formulaire
|
||||
@ -419,6 +419,7 @@ class UserController extends Controller
|
||||
$datagroup = $group;
|
||||
$usergroup->setGroup($datagroup);
|
||||
$usergroup->setKeyvalue($key);
|
||||
$usergroup->setRolegroup(0);
|
||||
$em->persist($usergroup);
|
||||
$em->flush();
|
||||
}
|
||||
@ -428,12 +429,16 @@ class UserController extends Controller
|
||||
$websocket = $this->container->get('cadoles.websocket.pushmessage')->send($key->toString(),$iduser,$idgroup,$message);
|
||||
|
||||
// Notification mail auprès de la personne inscrite
|
||||
if($group->getFgcanshare()) {
|
||||
$text="Vous venez d'être inscrit dans le groupe de travail : ".$group->getLabel();
|
||||
if($group->getFgcanshare()&&$this->get('session')->get('fgnotifgroup')) {
|
||||
$idpage =$group->getPages()->first()->getId();
|
||||
$url = $this->generateUrl('cadoles_core_redirect', ["route"=>"cadoles_core_home","id"=>$idpage], UrlGeneratorInterface::ABSOLUTE_URL);
|
||||
$texthtml="Vous venez d'être inscrit dans le groupe de travail : ".$group->getLabel()."<br>Suivez le lien suivant pour y accéder = <a href='$url'>$url</a>";
|
||||
$text="Vous venez d'être inscrit dans le groupe de travail : ".$group->getLabel()."<br>Suivez le lien suivant pour y accéder = $url";
|
||||
|
||||
$template="template";
|
||||
$mail_params=array(
|
||||
"subject" => $this->get('session')->get('appname')." : Inscription au groupe de travail : ".$group->getLabel()."\n\n".$group->getDescription(),
|
||||
"body_html"=>nl2br($text),
|
||||
"body_html"=>$texthtml,
|
||||
"body_text"=>$text
|
||||
);
|
||||
$to = $data->getEmail();
|
||||
@ -484,6 +489,7 @@ class UserController extends Controller
|
||||
$oldpassword=$data->getPassword();
|
||||
$fields=$this->getDefaultDatauser();
|
||||
|
||||
|
||||
// Si un acces modo via console d'admin on s'assure qu'il a les droit dessus sinon retour à la liste
|
||||
if($this->isGranted('ROLE_MODO')&&$access=="config") {
|
||||
$niveau01=$data->getNiveau01();
|
||||
@ -565,6 +571,7 @@ class UserController extends Controller
|
||||
$datagroup = $group;
|
||||
$usergroup->setGroup($datagroup);
|
||||
$usergroup->setKeyvalue($key);
|
||||
$usergroup->setRolegroup(0);
|
||||
$em->persist($usergroup);
|
||||
$em->flush();
|
||||
}
|
||||
@ -574,12 +581,16 @@ class UserController extends Controller
|
||||
$websocket = $this->container->get('cadoles.websocket.pushmessage')->send($key->toString(),$id,$idgroup,$message);
|
||||
|
||||
// Notification mail auprès de la personne inscrite
|
||||
if($group->getFgcanshare()) {
|
||||
$text="Vous venez d'être inscrit dans le groupe de travail : ".$group->getLabel();
|
||||
if($group->getFgcanshare()&&$this->get('session')->get('fgnotifgroup')) {
|
||||
$idpage =$group->getPages()->first()->getId();
|
||||
$url = $this->generateUrl('cadoles_core_redirect', ["route"=>"cadoles_core_home","id"=>$idpage], UrlGeneratorInterface::ABSOLUTE_URL);
|
||||
$texthtml="Vous venez d'être inscrit dans le groupe de travail : ".$group->getLabel()."<br>Suivez le lien suivant pour y accéder = <a href='$url'>$url</a>";
|
||||
$text="Vous venez d'être inscrit dans le groupe de travail : ".$group->getLabel()."<br>Suivez le lien suivant pour y accéder = $url";
|
||||
|
||||
$template="template";
|
||||
$mail_params=array(
|
||||
"subject" => $this->get('session')->get('appname')." : Inscription au groupe de travail : ".$group->getLabel()."\n\n".$group->getDescription(),
|
||||
"body_html"=>nl2br($text),
|
||||
"body_html"=>$texthtml,
|
||||
"body_text"=>$text
|
||||
);
|
||||
$to = $data->getEmail();
|
||||
@ -613,7 +624,7 @@ class UserController extends Controller
|
||||
$em->flush();
|
||||
|
||||
// Notification mail auprès des managers
|
||||
if($group->getFgcanshare()) {
|
||||
if($group->getFgcanshare()&&$this->get('session')->get('fgnotifgroup')) {
|
||||
$text=$data->getUsername()." a été désinscrit du groupe de travail : ".$group->getLabel();
|
||||
$template="template";
|
||||
$mail_params=array(
|
||||
@ -621,12 +632,14 @@ class UserController extends Controller
|
||||
"body_html"=>nl2br($text),
|
||||
"body_text"=>$text
|
||||
);
|
||||
$managers=$em->getRepository("CadolesCoreBundle:Usergroup")->findBy(array("group"=>$group,"fgmanager"=>true));
|
||||
$usergroups=$em->getRepository("CadolesCoreBundle:Usergroup")->findBy(array("group"=>$group));
|
||||
$to=array();
|
||||
foreach($managers as $manager) {
|
||||
array_push($to,$manager->getUser()->getEmail());
|
||||
foreach($usergroups as $usergroup) {
|
||||
if($usergroup->getRolegroup()>=90)
|
||||
array_push($to,$usergroup->getUser()->getEmail());
|
||||
}
|
||||
|
||||
|
||||
$from = $this->getParameter('noreply');;
|
||||
$fromName = $this->get('session')->get('appname');
|
||||
$message = $this->container->get('cadoles.core.service.mail');
|
||||
@ -829,12 +842,15 @@ class UserController extends Controller
|
||||
public function viewAction($id, Request $request)
|
||||
{
|
||||
$user=$this->getData($id);
|
||||
$fields=$this->getDefaultDatausers();
|
||||
|
||||
return $this->render('CadolesCoreBundle:User:view.html.twig', [
|
||||
'useheader' => false,
|
||||
'usemenu' => false,
|
||||
'usesidebar' => false,
|
||||
"user" => $user
|
||||
'user' => $user,
|
||||
'fields' => $fields,
|
||||
|
||||
]);
|
||||
}
|
||||
|
||||
@ -910,7 +926,7 @@ class UserController extends Controller
|
||||
public function exportuserAction(Request $request) {
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$dir = $this->get('kernel')->getRootDir() . '/../uploads/export/';
|
||||
$file = "export.csv";
|
||||
$file = "exportuser.csv";
|
||||
|
||||
$fs = new Filesystem();
|
||||
$fs->mkdir($dir);
|
||||
@ -920,7 +936,7 @@ class UserController extends Controller
|
||||
$e = '"'; // this is the default but i like to be explicit
|
||||
|
||||
// Entête de colonne
|
||||
$data=["id","Login","Nom","Prénom","Email","Téléphone",$this->getParameter("labelniveau01"),$this->getParameter("labelniveau02"),"Métier","Fonction","Nom Usage","Autres Prénom","Sexe","Adresse","Date Naissance","Pays Naissance","Ville Naissance"];
|
||||
$data=["id","Login","Nom","Prénom","Email","Téléphone",$this->getParameter("labelniveau01"),$this->getParameter("labelniveau02"),"Métier","Fonction","Nom Usage","Autres Prénom","Sexe","Adresse","Date Naissance","Pays Naissance","Ville Naissance","Date Visite","Cpt Visite","Groupes"];
|
||||
fputcsv($csvh, $data, $d, $e);
|
||||
|
||||
// Liste des utilisateurs en fonction du role de l'utilisateur en cours
|
||||
@ -942,6 +958,17 @@ class UserController extends Controller
|
||||
}
|
||||
|
||||
foreach($users as $user) {
|
||||
$groups="";
|
||||
$fgfirst=true;
|
||||
foreach($user->getGroups() as $key => $usergroup) {
|
||||
if(!$fgfirst) $groups.=" - ";
|
||||
$groups.=$usergroup->getGroup()->getLabel();
|
||||
if($fgfirst) $fgfirst=false;
|
||||
}
|
||||
|
||||
$visite = ($user->getVisitedate()?$user->getVisitedate()->format("d/m/Y H:i"):"");
|
||||
$cptvisite = ($user->getVisitedate()?$user->getVisitecpt():"");
|
||||
|
||||
$data = [
|
||||
"id"=>$user->getId(),
|
||||
"username"=>$user->getUsername(),
|
||||
@ -960,6 +987,9 @@ class UserController extends Controller
|
||||
"birthdate"=>($user->getBirthdate()?$user->getBirthdate()->format("d/m/Y"):""),
|
||||
"birthcountry"=>($user->getBirthcountry()?$user->getBirthcountry()->getLabel():""),
|
||||
"birthplace"=>($user->getBirthplace()?$user->getBirthplace()->getLabel():""),
|
||||
"visite"=>$visite,
|
||||
"cptvisite"=>$cptvisite,
|
||||
"groups"=>$groups,
|
||||
|
||||
];
|
||||
|
||||
@ -1229,7 +1259,7 @@ class UserController extends Controller
|
||||
$key=$request->request->get('key');
|
||||
$id=$request->request->get('id');
|
||||
$value=$request->request->get('value');
|
||||
|
||||
|
||||
// Récupérer les préférences de l'utilisateur
|
||||
$preference=$this->getUser()->getPreference();
|
||||
|
||||
@ -1264,7 +1294,7 @@ class UserController extends Controller
|
||||
$toupdate=true;
|
||||
$preference[$key][$id]=$value;
|
||||
}
|
||||
if($value&&$preference[$key][$id]!=$value) {
|
||||
if($preference[$key][$id]!=$value) {
|
||||
$toupdate=true;
|
||||
$preference[$key][$id]=$value;
|
||||
}
|
||||
@ -1426,7 +1456,76 @@ class UserController extends Controller
|
||||
if(!array_key_exists("visite",$fields)) {
|
||||
$fields["visite"]["perm"]=1;
|
||||
$fields["visite"]["label"]="Visite";
|
||||
}
|
||||
|
||||
|
||||
return $fields;
|
||||
}
|
||||
|
||||
protected function getDefaultDatausers()
|
||||
{
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$session=$this->get('session');
|
||||
$config=$em->getRepository('CadolesCoreBundle:Config')->find("datausers");
|
||||
$fields=$config->getValue();
|
||||
|
||||
$fields=json_decode($fields, true);
|
||||
if(!is_array($fields)) $fields=[];
|
||||
|
||||
// Valeur par défaut 0=caché / 3=visible
|
||||
if(!array_key_exists("avatar",$fields)) {
|
||||
$fields["avatar"]["perm"]=1;
|
||||
$fields["avatar"]["label"]="Avatar";
|
||||
}
|
||||
if(!array_key_exists("login",$fields)) {
|
||||
$fields["login"]["perm"]=1;
|
||||
$fields["login"]["label"]="Login";
|
||||
}
|
||||
if(!array_key_exists("lastname",$fields)) {
|
||||
$fields["lastname"]["perm"]=1;
|
||||
$fields["lastname"]["label"]="Nom";
|
||||
}
|
||||
if(!array_key_exists("firstname",$fields)) {
|
||||
$fields["firstname"]["perm"]=1;
|
||||
$fields["firstname"]["label"]="Prenom";
|
||||
}
|
||||
if(!array_key_exists("email",$fields)) {
|
||||
$fields["email"]["perm"]=1;
|
||||
$fields["email"]["label"]="Email";
|
||||
}
|
||||
if(!array_key_exists("niveau01",$fields)) {
|
||||
$fields["niveau01"]["perm"]=1;
|
||||
$fields["niveau01"]["label"]=$session->get('labelniveau01');
|
||||
}
|
||||
if(!array_key_exists("niveau02",$fields)) {
|
||||
$fields["niveau02"]["perm"]=1;
|
||||
$fields["niveau02"]["label"]=$session->get('labelniveau02');
|
||||
}
|
||||
if(!array_key_exists("group",$fields)) $fields["group"]["perm"]=1;
|
||||
$fields["group"]["label"]="Groupes (caché uniquement pour le rôle Utilisateur) ";
|
||||
|
||||
if(!array_key_exists("job",$fields)) {
|
||||
$fields["job"]["perm"]=1;
|
||||
$fields["job"]["label"]="Métier";
|
||||
}
|
||||
if(!array_key_exists("position",$fields)) {
|
||||
$fields["position"]["perm"]=1;
|
||||
$fields["position"]["label"]="Fonction";
|
||||
}
|
||||
if(!array_key_exists("role",$fields)) {
|
||||
$fields["role"]["perm"]=1;
|
||||
$fields["role"]["label"]="Rôles";
|
||||
}
|
||||
if(!array_key_exists("telephonenumber",$fields)) {
|
||||
$fields["telephonenumber"]["perm"]=1;
|
||||
$fields["telephonenumber"]["label"]="Téléphone";
|
||||
}
|
||||
if(!array_key_exists("visitedate",$fields)) $fields["visitedate"]["perm"]=1;
|
||||
$fields["visitedate"]["label"]="Visite (caché uniquement pour les rôles Animateur et Utilisateur) ";
|
||||
|
||||
if(!$session->get('viewniveau02'))
|
||||
unset($fields["niveau02"]);
|
||||
|
||||
return $fields;
|
||||
}
|
||||
|
||||
@ -1461,7 +1560,7 @@ class UserController extends Controller
|
||||
$niveau01=strtolower($data->getNiveau01()->getLabel());
|
||||
if(stripos($niveau01,"autre")===0) {
|
||||
if(!$data->getNiveau01other()) {
|
||||
$form->addError(new FormError("Merci d'indiquer votre ".$this->getParameter("labelniveau01")));
|
||||
$form->addError(new FormError("Merci de compléter le champ 'Autre ".$this->getParameter("labelniveau01")."'"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -207,6 +207,25 @@ class WhitelistController extends Controller
|
||||
]);
|
||||
}
|
||||
|
||||
public function ajaxiswhitelistAction(Request $request)
|
||||
{
|
||||
// S'assurer que c'est un appel ajax
|
||||
if (!$request->isXmlHttpRequest()) {
|
||||
return new JsonResponse(array('message' => 'Interdit'), 400);
|
||||
}
|
||||
$email=$request->request->get('email');
|
||||
$email=explode("@",$email);
|
||||
$domaine=end($email);
|
||||
|
||||
// Rechercher le mail dans la liste blanche
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$whitelist=$em->getRepository($this->labelentity)->findOneBy(["label"=>$domaine]);
|
||||
if($whitelist)
|
||||
return new Response("OK", 200);
|
||||
else
|
||||
return new Response("KO", 200);
|
||||
}
|
||||
|
||||
protected function getDatas()
|
||||
{
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
|
@ -103,6 +103,11 @@ class Group
|
||||
*/
|
||||
private $idonlyoffice;
|
||||
|
||||
/**
|
||||
* @ORM\Column(name="invitations", type="array", nullable=true)
|
||||
*/
|
||||
private $invitations;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="Cadoles\PortalBundle\Entity\Icon", inversedBy="groups")
|
||||
* @ORM\JoinColumn(nullable=true, onDelete="SET NULL")
|
||||
@ -1085,4 +1090,28 @@ class Group
|
||||
{
|
||||
return $this->email;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set invitations
|
||||
*
|
||||
* @param array $invitations
|
||||
*
|
||||
* @return Group
|
||||
*/
|
||||
public function setInvitations($invitations)
|
||||
{
|
||||
$this->invitations = $invitations;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get invitations
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getInvitations()
|
||||
{
|
||||
return $this->invitations;
|
||||
}
|
||||
}
|
||||
|
@ -27,10 +27,10 @@ class Registration implements UserInterface, \Serializable
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=25, unique=true)
|
||||
* @ORM\Column(type="string", length=128, unique=true)
|
||||
* @Assert\Length(
|
||||
* min = "5",
|
||||
* max = "25",
|
||||
* max = "128",
|
||||
* minMessage = "Votre nom doit faire au moins {{ limit }} caractères",
|
||||
* maxMessage = "Votre nom ne peut pas être plus long que {{ limit }} caractères"
|
||||
* )
|
||||
@ -68,7 +68,7 @@ class Registration implements UserInterface, \Serializable
|
||||
private $passwordad;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=60, unique=true)
|
||||
* @ORM\Column(type="string", length=128, unique=true)
|
||||
*/
|
||||
private $email;
|
||||
|
||||
@ -143,6 +143,11 @@ class Registration implements UserInterface, \Serializable
|
||||
*/
|
||||
private $motivation;
|
||||
|
||||
/**
|
||||
* @ORM\Column(name="note", type="text", nullable=true)
|
||||
*/
|
||||
private $note;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="integer", length=60, nullable=true)
|
||||
*/
|
||||
@ -840,4 +845,28 @@ class Registration implements UserInterface, \Serializable
|
||||
{
|
||||
return $this->passwordad;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set note
|
||||
*
|
||||
* @param string $note
|
||||
*
|
||||
* @return Registration
|
||||
*/
|
||||
public function setNote($note)
|
||||
{
|
||||
$this->note = $note;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get note
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getNote()
|
||||
{
|
||||
return $this->note;
|
||||
}
|
||||
}
|
||||
|
@ -30,10 +30,10 @@ class User implements UserInterface, \Serializable
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=50, unique=true)
|
||||
* @ORM\Column(type="string", length=128, unique=true)
|
||||
* @Assert\Length(
|
||||
* min = "5",
|
||||
* max = "25",
|
||||
* max = "128",
|
||||
* minMessage = "Votre nom doit faire au moins {{ limit }} caractères",
|
||||
* maxMessage = "Votre nom ne peut pas être plus long que {{ limit }} caractères"
|
||||
* )
|
||||
@ -71,7 +71,7 @@ class User implements UserInterface, \Serializable
|
||||
private $passwordad;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=60, unique=true)
|
||||
* @ORM\Column(type="string", length=128, unique=true)
|
||||
*/
|
||||
private $email;
|
||||
|
||||
@ -195,7 +195,12 @@ class User implements UserInterface, \Serializable
|
||||
* @ORM\Column(name="motivation", type="text", nullable=true)
|
||||
*/
|
||||
private $motivation;
|
||||
|
||||
|
||||
/**
|
||||
* @ORM\Column(name="note", type="text", nullable=true)
|
||||
*/
|
||||
private $note;
|
||||
|
||||
/**
|
||||
* @ORM\Column(name="preference", type="array", nullable=true)
|
||||
*/
|
||||
@ -2059,4 +2064,28 @@ class User implements UserInterface, \Serializable
|
||||
{
|
||||
return $this->passwordad;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set note
|
||||
*
|
||||
* @param string $note
|
||||
*
|
||||
* @return User
|
||||
*/
|
||||
public function setNote($note)
|
||||
{
|
||||
$this->note = $note;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get note
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getNote()
|
||||
{
|
||||
return $this->note;
|
||||
}
|
||||
}
|
||||
|
@ -37,9 +37,15 @@ class UserGroup
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="boolean", options={"default" : false})
|
||||
* CE CHAMP N'EST PLUS UTILSE
|
||||
*/
|
||||
private $fgmanager = false;
|
||||
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="integer", length=60, nullable=true)
|
||||
*/
|
||||
private $rolegroup;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=60, nullable=true)
|
||||
*/
|
||||
@ -208,4 +214,28 @@ class UserGroup
|
||||
{
|
||||
return $this->visitecpt;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set rolegroup
|
||||
*
|
||||
* @param integer $rolegroup
|
||||
*
|
||||
* @return UserGroup
|
||||
*/
|
||||
public function setRolegroup($rolegroup)
|
||||
{
|
||||
$this->rolegroup = $rolegroup;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get rolegroup
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getRolegroup()
|
||||
{
|
||||
return $this->rolegroup;
|
||||
}
|
||||
}
|
||||
|
@ -13,12 +13,15 @@
|
||||
class sessionListener {
|
||||
protected $container;
|
||||
protected $em;
|
||||
protected $token_storage;
|
||||
protected $session;
|
||||
|
||||
public function __construct($container, EntityManager $em, TokenStorageInterface $token_storage)
|
||||
public function __construct($container, EntityManager $em, TokenStorageInterface $token_storage,Session $session)
|
||||
{
|
||||
$this->container = $container;
|
||||
$this->em = $em;
|
||||
$this->token_storage = $token_storage;
|
||||
$this->session = $session;
|
||||
}
|
||||
|
||||
public function haveRole($curentuser,$roles,$tohave,$route) {
|
||||
@ -44,9 +47,7 @@
|
||||
}
|
||||
|
||||
public function onDomainParse(Event $event) {
|
||||
$session = new Session();
|
||||
|
||||
|
||||
$session = $this->session;
|
||||
|
||||
$configs = $this->em->getRepository("CadolesCoreBundle:Config")->findAll();
|
||||
foreach($configs as $config) {
|
||||
@ -93,6 +94,7 @@
|
||||
$app["activate_widwordpress"] =$this->container->getParameter('activate_widwordpress');
|
||||
|
||||
$app["widbalado_activate_syncenvole"] =$this->container->getParameter('widbalado_activate_syncenvole');
|
||||
$app["widcdt_activate_syncenvole"] =$this->container->getParameter('widcdt_activate_syncenvole');
|
||||
$app["widgepi_activate_syncenvole"] =$this->container->getParameter('widgepi_activate_syncenvole');
|
||||
$app["widnextcloud_activate_syncenvole"] =$this->container->getParameter('widnextcloud_activate_syncenvole');
|
||||
$app["widpiwik_activate_syncenvole"] =$this->container->getParameter('widpiwik_activate_syncenvole');
|
||||
|
@ -181,6 +181,7 @@ class syncUser implements EventSubscriber
|
||||
$data->setUser($user);
|
||||
$data->setGroup($fgall[0]);
|
||||
$data->setKeyvalue($key);
|
||||
$data->setRolegroup(0);
|
||||
$this->em->persist($data);
|
||||
$this->em->flush();
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ class MailType extends AbstractType
|
||||
'mapped'=> false,
|
||||
'required' => false,
|
||||
'attr' => array("class" => "form-control", "style" => "margin-bottom:15px"),
|
||||
'config' => ["height" => "150px",'filebrowserUploadRoute' => 'cadoles_portal_user_pagewidget_upload']
|
||||
'config' => ["height" => "150px"]
|
||||
]);
|
||||
}
|
||||
|
||||
|
@ -99,7 +99,7 @@ class MailingType extends AbstractType
|
||||
'mapped'=> false,
|
||||
'required' => true,
|
||||
'attr' => array("class" => "form-control", "style" => "margin-bottom:15px"),
|
||||
'config' => ["height" => "400px",'filebrowserUploadRoute' => 'cadoles_portal_user_pagewidget_upload']
|
||||
'config' => ["height" => "400px"]
|
||||
]);
|
||||
|
||||
}
|
||||
|
@ -45,6 +45,15 @@ class RegistrationType extends AbstractType
|
||||
"attr" => array("class" => "btn btn-success")
|
||||
)
|
||||
);
|
||||
|
||||
$builder->add('note',
|
||||
TextareaType::class, array(
|
||||
"label" => "Notes Administrateur",
|
||||
"required" => false,
|
||||
"disabled" => ($options["mode"]=="delete"?true:false),
|
||||
"attr" => array("class" => "form-control", "style" => "margin-bottom:15px; height: 130px")
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
# Obligatoire
|
||||
@ -87,7 +96,7 @@ class RegistrationType extends AbstractType
|
||||
|
||||
$builder->add('niveau01other',
|
||||
TextType::class, array(
|
||||
"label" =>"Autre ".$session->get('labelniveau01'),
|
||||
"label" =>"Autre ".$session->get('labelniveau01'). " *",
|
||||
"disabled" => ($options["mode"]=="delete"?true:false),
|
||||
"required" => false,
|
||||
"attr" => array("class" => "form-control", "style" => "margin-bottom:15px")
|
||||
@ -101,7 +110,8 @@ class RegistrationType extends AbstractType
|
||||
"type" => PasswordType::class,
|
||||
"required" => ($options["mode"]=="submit"?true:false),
|
||||
"first_options" => array("label" => "Mot de Passe","attr" => array("class" => "form-control", "style" => "margin-bottom:15px", "autocomplete" => "new-password")),
|
||||
"second_options" => array('label' => 'Confirmer Mot de Passe',"attr" => array("class" => "form-control", "style" => "margin-bottom:15px"))
|
||||
"second_options" => array('label' => 'Confirmer Mot de Passe',"attr" => array("class" => "form-control", "style" => "margin-bottom:15px")),
|
||||
"invalid_message" => "Mot de passe non valide"
|
||||
)
|
||||
);
|
||||
|
||||
|
@ -45,7 +45,8 @@ class ResetpwdType extends AbstractType
|
||||
"required" => ($options["mode"]=="submit"?true:false),
|
||||
"options" => array("always_empty" => true),
|
||||
"first_options" => array("label" => "Votre nouveau Mot de Passe","attr" => array("class" => "form-control", "style" => "margin-bottom:15px")),
|
||||
"second_options" => array('label' => 'Confirmer votre nouveau Mot de Passe',"attr" => array("class" => "form-control", "style" => "margin-bottom:15px"))
|
||||
"second_options" => array('label' => 'Confirmer votre nouveau Mot de Passe',"attr" => array("class" => "form-control", "style" => "margin-bottom:15px")),
|
||||
"invalid_message" => "Mot de passe non valide"
|
||||
)
|
||||
);
|
||||
}
|
||||
|
@ -85,7 +85,16 @@ class UserType extends AbstractType
|
||||
"required" => false,
|
||||
"attr" => array("class" => "form-control", "style" => "margin-bottom:15px;$readonly","onfocus" => $onfocus, "onchange" => $onchange),
|
||||
]
|
||||
);
|
||||
);
|
||||
|
||||
$builder->add('note',
|
||||
TextareaType::class, array(
|
||||
"label" => "Notes Administrateur",
|
||||
"required" => false,
|
||||
"disabled" => ($options["mode"]=="delete"?true:false),
|
||||
"attr" => array("class" => "form-control", "style" => "margin-bottom:15px; height: 130px")
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
$perm=$options["perm"];
|
||||
@ -132,7 +141,8 @@ class UserType extends AbstractType
|
||||
"required" => ($options["mode"]=="submit"?true:false),
|
||||
"options" => array("always_empty" => true),
|
||||
"first_options" => array("label" => "Mot de Passe","attr" => array("class" => "form-control", "style" => "margin-bottom:15px", "autocomplete" => "new-password")),
|
||||
"second_options" => array('label' => 'Confirmer Mot de Passe',"attr" => array("class" => "form-control", "style" => "margin-bottom:15px"))
|
||||
"second_options" => array('label' => 'Confirmer Mot de Passe',"attr" => array("class" => "form-control", "style" => "margin-bottom:15px")),
|
||||
"invalid_message" => "Mot de passe non valide"
|
||||
)
|
||||
);
|
||||
}
|
||||
|
@ -63,6 +63,7 @@ class GroupRepository extends \Doctrine\ORM\EntityRepository
|
||||
$usergroup->setUser($user);
|
||||
$usergroup->setGroup($retgroup);
|
||||
$usergroup->setKeyvalue($key);
|
||||
$usergroup->setRolegroup(0);
|
||||
|
||||
$this->_em->persist($usergroup);
|
||||
$this->_em->flush();
|
||||
|
@ -74,6 +74,22 @@ cadoles_core_config_file_subdirectory:
|
||||
path: /config/file/subdirectory/{id}/{type}
|
||||
defaults: { _controller: CadolesCoreBundle:File:subdirectory, access: config }
|
||||
|
||||
cadoles_core_config_file_rename:
|
||||
path: /config/file/rename/{id}/{oldname}
|
||||
defaults: { _controller: CadolesCoreBundle:File:rename, access: config }
|
||||
|
||||
cadoles_core_config_file_trash:
|
||||
path: /config/file/trash/
|
||||
defaults: { _controller: CadolesCoreBundle:File:trash, access: config }
|
||||
|
||||
cadoles_core_config_file_restaure:
|
||||
path: /config/file/restaure/
|
||||
defaults: { _controller: CadolesCoreBundle:File:restaure, access: config }
|
||||
|
||||
cadoles_core_config_file_purgetrash:
|
||||
path: /config/file/purgetrash/{directory}
|
||||
defaults: { _controller: CadolesCoreBundle:File:purgetrash, access: config }
|
||||
|
||||
cadoles_core_config_file_delete:
|
||||
path: /config/file/delete/
|
||||
defaults: { _controller: CadolesCoreBundle:File:delete, access: config }
|
||||
@ -107,6 +123,22 @@ cadoles_core_user_file_subdirectory:
|
||||
path: /user/file/subdirectory/{id}/{type}
|
||||
defaults: { _controller: CadolesCoreBundle:File:subdirectory, access: user }
|
||||
|
||||
cadoles_core_user_file_rename:
|
||||
path: /user/file/rename/{id}/{oldname}
|
||||
defaults: { _controller: CadolesCoreBundle:File:rename, access: user }
|
||||
|
||||
cadoles_core_user_file_trash:
|
||||
path: /user/file/trash/
|
||||
defaults: { _controller: CadolesCoreBundle:File:trash, access: user }
|
||||
|
||||
cadoles_core_user_file_restaure:
|
||||
path: /user/file/restaure/
|
||||
defaults: { _controller: CadolesCoreBundle:File:restaure, access: user }
|
||||
|
||||
cadoles_core_user_file_purgetrash:
|
||||
path: /user/file/purgetrash/{directory}
|
||||
defaults: { _controller: CadolesCoreBundle:File:purgetrash, access: user }
|
||||
|
||||
cadoles_core_user_file_delete:
|
||||
path: /user/file/delete
|
||||
defaults: { _controller: CadolesCoreBundle:File:delete, access: user }
|
||||
@ -128,6 +160,7 @@ cadoles_core_user_file_show:
|
||||
defaults: { _controller: CadolesCoreBundle:File:show, access: user }
|
||||
|
||||
|
||||
|
||||
#== Ajax =================================================================================================================
|
||||
cadoles_core_ajax_country_list:
|
||||
path: /ajax/country/list
|
||||
@ -161,6 +194,10 @@ cadoles_core_ajax_item_list:
|
||||
path: /ajax/item/list
|
||||
defaults: { _controller: CadolesCoreBundle:Ajax:itemlist }
|
||||
|
||||
cadoles_core_ajax_iswhitelist:
|
||||
path: /ajax/iswhitelist
|
||||
defaults: { _controller: CadolesCoreBundle:Whitelist:ajaxiswhitelist }
|
||||
|
||||
#== Home Config ==========================================================================================================
|
||||
cadoles_core_config:
|
||||
path: /config/home
|
||||
@ -457,14 +494,22 @@ cadoles_core_config_group_ajax_usergroup_del:
|
||||
path: /config/group/ajax/usergroupdel
|
||||
defaults: { _controller: CadolesCoreBundle:Group:usergroupdel, access: config }
|
||||
|
||||
cadoles_core_config_group_ajax_switchmanager:
|
||||
path: /config/group/ajax/switchmanager
|
||||
defaults: { _controller: CadolesCoreBundle:Group:switchmanager, access: config }
|
||||
cadoles_core_config_group_ajax_changerole:
|
||||
path: /config/group/ajax/changerole
|
||||
defaults: { _controller: CadolesCoreBundle:Group:changerole, access: config }
|
||||
|
||||
cadoles_core_config_group_export:
|
||||
path: /config/group/export
|
||||
defaults: { _controller: CadolesCoreBundle:Group:groupexport }
|
||||
|
||||
cadoles_core_config_group_usergroup_export:
|
||||
path: /config/group/users/export/{id}
|
||||
defaults: { _controller: CadolesCoreBundle:Group:usergroupexport, access: config }
|
||||
|
||||
cadoles_core_config_group_invitation:
|
||||
path: /config/group/invitation/{id}
|
||||
defaults: { _controller: CadolesCoreBundle:Group:invitation, access: config }
|
||||
|
||||
#-- Access user
|
||||
cadoles_core_user_group:
|
||||
path: /user/group
|
||||
@ -514,14 +559,18 @@ cadoles_core_user_group_ajax_usergroup_del:
|
||||
path: /user/group/ajax/usergroupdel
|
||||
defaults: { _controller: CadolesCoreBundle:Group:usergroupdel, access: user }
|
||||
|
||||
cadoles_core_user_group_ajax_switchmanager:
|
||||
path: /user/group/ajax/switchmanager
|
||||
defaults: { _controller: CadolesCoreBundle:Group:switchmanager, access: user }
|
||||
cadoles_core_user_group_ajax_changerole:
|
||||
path: /user/group/ajax/changerole
|
||||
defaults: { _controller: CadolesCoreBundle:Group:changerole, access: user }
|
||||
|
||||
cadoles_core_user_group_usergroup_export:
|
||||
path: /user/group/users/export/{id}
|
||||
defaults: { _controller: CadolesCoreBundle:Group:usergroupexport, access: user }
|
||||
|
||||
cadoles_core_user_group_invitation:
|
||||
path: /user/group/invitation/{id}
|
||||
defaults: { _controller: CadolesCoreBundle:Group:invitation, access: user }
|
||||
|
||||
|
||||
#== Whitelist ============================================================================================================
|
||||
cadoles_core_config_whitelist:
|
||||
|
@ -26,7 +26,7 @@ services:
|
||||
cadoles.core.session.listener:
|
||||
public: true
|
||||
class: Cadoles\CoreBundle\EventListener\sessionListener
|
||||
arguments: ['@service_container','@doctrine.orm.entity_manager',"@security.token_storage"]
|
||||
arguments: ['@service_container','@doctrine.orm.entity_manager',"@security.token_storage","@session"]
|
||||
tags:
|
||||
- { name: kernel.event_listener, event: kernel.request, method: onDomainParse }
|
||||
|
||||
|
12
src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/public/css/jquery-ui.multidatespicker.css
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
/* jQuery UI Datepicker moving pixels fix */
|
||||
table.ui-datepicker-calendar {border-collapse: separate;}
|
||||
.ui-datepicker-calendar td {border: 1px solid transparent;}
|
||||
|
||||
/* jQuery UI Datepicker hide datepicker helper */
|
||||
#ui-datepicker-div {display:none;}
|
||||
|
||||
/* jQuery UI Datepicker emphasis on selected dates */
|
||||
.ui-datepicker .ui-datepicker-calendar .ui-state-highlight a {
|
||||
background: #743620 none;
|
||||
color: white;
|
||||
}
|
@ -60,6 +60,17 @@ body {
|
||||
height: 20px;
|
||||
}
|
||||
|
||||
@media (max-width: 991px) {
|
||||
.header .title{
|
||||
font-size: 30px;
|
||||
}
|
||||
|
||||
.header small {
|
||||
font-size:14px;
|
||||
top: 25px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
.header { display: none }
|
||||
#menu-header { display: none }
|
||||
@ -110,6 +121,25 @@ body {
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
#navbar-nameuser {
|
||||
position: absolute;
|
||||
top: 50px;
|
||||
right: 30px;
|
||||
}
|
||||
|
||||
.navbar-top-links #navbar-nameuser {
|
||||
position: relative;
|
||||
top: -8px;
|
||||
right: inherit;
|
||||
}
|
||||
|
||||
@media (max-width: 991px) {
|
||||
.navbar-top-links #navbar-nameuser {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@media (max-width: 767px) {
|
||||
.navbar-default .navbar-header #title {
|
||||
display: none;
|
||||
@ -337,12 +367,12 @@ span.item-drag {
|
||||
|
||||
.grid-item .item-link img {
|
||||
display: block;
|
||||
max-width: 100%;
|
||||
//max-height: 110px;
|
||||
height: auto;
|
||||
margin: 10px;
|
||||
height: 105px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.grid-item .grid-item-title {
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
@ -381,6 +411,15 @@ a.item-update {
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
|
||||
a.item-restaure {
|
||||
display: none;
|
||||
position: absolute;
|
||||
right: 25px;
|
||||
top: 2px;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
a.item-delete {
|
||||
display: none;
|
||||
position: absolute;
|
||||
@ -726,6 +765,11 @@ a.item-heart {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.widget-ckeditor img {
|
||||
height:auto !important;
|
||||
}
|
||||
|
||||
|
||||
.frameitem {
|
||||
position: absolute;
|
||||
right: 0px;
|
||||
|
498
src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/public/js/jquery-ui.multidatespicker.js
vendored
Normal file
@ -0,0 +1,498 @@
|
||||
/*
|
||||
* MultiDatesPicker v1.6.4
|
||||
* http://multidatespickr.sourceforge.net/
|
||||
*
|
||||
* Copyright 2014, Luca Lauretta
|
||||
* Dual licensed under the MIT or GPL version 2 licenses.
|
||||
*/
|
||||
(function( $ ){
|
||||
$.extend($.ui, { multiDatesPicker: { version: "1.6.4" } });
|
||||
|
||||
$.fn.multiDatesPicker = function(method) {
|
||||
var mdp_arguments = arguments;
|
||||
var ret = this;
|
||||
var today_date = new Date();
|
||||
var day_zero = new Date(0);
|
||||
var mdp_events = {};
|
||||
|
||||
function removeDate(date, type) {
|
||||
if(!type) type = 'picked';
|
||||
date = dateConvert.call(this, date);
|
||||
for(var i = 0; i < this.multiDatesPicker.dates[type].length; i++)
|
||||
if(!methods.compareDates(this.multiDatesPicker.dates[type][i], date))
|
||||
return this.multiDatesPicker.dates[type].splice(i, 1).pop();
|
||||
}
|
||||
function removeIndex(index, type) {
|
||||
if(!type) type = 'picked';
|
||||
return this.multiDatesPicker.dates[type].splice(index, 1).pop();
|
||||
}
|
||||
function addDate(date, type, no_sort) {
|
||||
if(!type) type = 'picked';
|
||||
date = dateConvert.call(this, date);
|
||||
|
||||
// @todo: use jQuery UI datepicker method instead
|
||||
date.setHours(0);
|
||||
date.setMinutes(0);
|
||||
date.setSeconds(0);
|
||||
date.setMilliseconds(0);
|
||||
|
||||
if (methods.gotDate.call(this, date, type) === false) {
|
||||
this.multiDatesPicker.dates[type].push(date);
|
||||
if(!no_sort) this.multiDatesPicker.dates[type].sort(methods.compareDates);
|
||||
}
|
||||
}
|
||||
function sortDates(type) {
|
||||
if(!type) type = 'picked';
|
||||
this.multiDatesPicker.dates[type].sort(methods.compareDates);
|
||||
}
|
||||
function dateConvert(date, desired_type, date_format) {
|
||||
if(!desired_type) desired_type = 'object';/*
|
||||
if(!date_format && (typeof date == 'string')) {
|
||||
date_format = $(this).datepicker('option', 'dateFormat');
|
||||
if(!date_format) date_format = $.datepicker._defaults.dateFormat;
|
||||
}
|
||||
*/
|
||||
return methods.dateConvert.call(this, date, desired_type, date_format);
|
||||
}
|
||||
|
||||
var methods = {
|
||||
init : function( options ) {
|
||||
var $this = $(this);
|
||||
this.multiDatesPicker.changed = false;
|
||||
|
||||
var mdp_events = {
|
||||
beforeShow: function(input, inst) {
|
||||
this.multiDatesPicker.changed = false;
|
||||
if(this.multiDatesPicker.originalBeforeShow)
|
||||
this.multiDatesPicker.originalBeforeShow.call(this, input, inst);
|
||||
},
|
||||
onSelect : function(dateText, inst) {
|
||||
var $this = $(this);
|
||||
this.multiDatesPicker.changed = true;
|
||||
|
||||
if (dateText) {
|
||||
$this.multiDatesPicker('toggleDate', dateText);
|
||||
this.multiDatesPicker.changed = true;
|
||||
// @todo: this will be optimized when I'll move methods to the singleton.
|
||||
}
|
||||
|
||||
if (this.multiDatesPicker.mode == 'normal' && this.multiDatesPicker.pickableRange) {
|
||||
if(this.multiDatesPicker.dates.picked.length > 0) {
|
||||
var min_date = this.multiDatesPicker.dates.picked[0],
|
||||
max_date = new Date(min_date.getTime());
|
||||
|
||||
methods.sumDays(max_date, this.multiDatesPicker.pickableRange-1);
|
||||
|
||||
// counts the number of disabled dates in the range
|
||||
if(this.multiDatesPicker.adjustRangeToDisabled) {
|
||||
var c_disabled,
|
||||
disabled = this.multiDatesPicker.dates.disabled.slice(0);
|
||||
do {
|
||||
c_disabled = 0;
|
||||
for(var i = 0; i < disabled.length; i++) {
|
||||
if(disabled[i].getTime() <= max_date.getTime()) {
|
||||
if((min_date.getTime() <= disabled[i].getTime()) && (disabled[i].getTime() <= max_date.getTime()) ) {
|
||||
c_disabled++;
|
||||
}
|
||||
disabled.splice(i, 1);
|
||||
i--;
|
||||
}
|
||||
}
|
||||
max_date.setDate(max_date.getDate() + c_disabled);
|
||||
} while(c_disabled != 0);
|
||||
}
|
||||
|
||||
if(this.multiDatesPicker.maxDate && (max_date > this.multiDatesPicker.maxDate))
|
||||
max_date = this.multiDatesPicker.maxDate;
|
||||
|
||||
$this
|
||||
.datepicker("option", "minDate", min_date)
|
||||
.datepicker("option", "maxDate", max_date);
|
||||
} else {
|
||||
$this
|
||||
.datepicker("option", "minDate", this.multiDatesPicker.minDate)
|
||||
.datepicker("option", "maxDate", this.multiDatesPicker.maxDate);
|
||||
}
|
||||
}
|
||||
|
||||
if(this.multiDatesPicker.originalOnSelect && dateText)
|
||||
this.multiDatesPicker.originalOnSelect.call(this, dateText, inst);
|
||||
|
||||
},
|
||||
beforeShowDay : function(date) {
|
||||
var $this = $(this),
|
||||
gotThisDate = $this.multiDatesPicker('gotDate', date) !== false,
|
||||
isDisabledCalendar = $this.datepicker('option', 'disabled'),
|
||||
isDisabledDate = $this.multiDatesPicker('gotDate', date, 'disabled') !== false,
|
||||
areAllSelected = this.multiDatesPicker.maxPicks <= this.multiDatesPicker.dates.picked.length;
|
||||
|
||||
var bsdReturn = [true, '', null];
|
||||
if(this.multiDatesPicker.originalBeforeShowDay)
|
||||
bsdReturn = this.multiDatesPicker.originalBeforeShowDay.call(this, date);
|
||||
|
||||
bsdReturn[1] = gotThisDate ? 'ui-state-highlight '+bsdReturn[1] : bsdReturn[1];
|
||||
bsdReturn[0] = bsdReturn[0] && !(isDisabledCalendar || isDisabledDate || (areAllSelected && !bsdReturn[1]));
|
||||
return bsdReturn;
|
||||
}
|
||||
};
|
||||
|
||||
// value have to be extracted before datepicker is initiated
|
||||
if($this.val()) var inputDates = $this.val()
|
||||
|
||||
if(options) {
|
||||
// value have to be extracted before datepicker is initiated
|
||||
//if(options.altField) var inputDates = $(options.altField).val();
|
||||
if(options.separator) this.multiDatesPicker.separator = options.separator;
|
||||
if(!this.multiDatesPicker.separator) this.multiDatesPicker.separator = ', ';
|
||||
|
||||
this.multiDatesPicker.originalBeforeShow = options.beforeShow;
|
||||
this.multiDatesPicker.originalOnSelect = options.onSelect;
|
||||
this.multiDatesPicker.originalBeforeShowDay = options.beforeShowDay;
|
||||
this.multiDatesPicker.originalOnClose = options.onClose;
|
||||
|
||||
// datepicker init
|
||||
$this.datepicker(options);
|
||||
|
||||
this.multiDatesPicker.minDate = $.datepicker._determineDate(this, options.minDate, null);
|
||||
this.multiDatesPicker.maxDate = $.datepicker._determineDate(this, options.maxDate, null);
|
||||
if(options.addDates) methods.addDates.call(this, options.addDates);
|
||||
|
||||
if(options.addDisabledDates)
|
||||
methods.addDates.call(this, options.addDisabledDates, 'disabled');
|
||||
|
||||
methods.setMode.call(this, options);
|
||||
} else {
|
||||
$this.datepicker();
|
||||
}
|
||||
$this.datepicker('option', mdp_events);
|
||||
|
||||
// adds any dates found in the input or alt field
|
||||
if(inputDates) $this.multiDatesPicker('value', inputDates);
|
||||
|
||||
// generates the new string of added dates
|
||||
var inputs_values = $this.multiDatesPicker('value');
|
||||
|
||||
// fills the input field back with all the dates in the calendar
|
||||
$this.val(inputs_values);
|
||||
|
||||
// Fixes the altField filled with defaultDate by default
|
||||
var altFieldOption = $this.datepicker('option', 'altField');
|
||||
if (altFieldOption) $(altFieldOption).val(inputs_values);
|
||||
|
||||
// Updates the calendar view
|
||||
$this.datepicker('refresh');
|
||||
},
|
||||
compareDates : function(date1, date2) {
|
||||
date1 = dateConvert.call(this, date1);
|
||||
date2 = dateConvert.call(this, date2);
|
||||
// return > 0 means date1 is later than date2
|
||||
// return == 0 means date1 is the same day as date2
|
||||
// return < 0 means date1 is earlier than date2
|
||||
var diff = date1.getFullYear() - date2.getFullYear();
|
||||
if(!diff) {
|
||||
diff = date1.getMonth() - date2.getMonth();
|
||||
if(!diff)
|
||||
diff = date1.getDate() - date2.getDate();
|
||||
}
|
||||
return diff;
|
||||
},
|
||||
sumDays : function( date, n_days ) {
|
||||
var origDateType = typeof date;
|
||||
obj_date = dateConvert.call(this, date);
|
||||
obj_date.setDate(obj_date.getDate() + n_days);
|
||||
return dateConvert.call(this, obj_date, origDateType);
|
||||
},
|
||||
dateConvert : function( date, desired_format, dateFormat ) {
|
||||
var from_format = typeof date;
|
||||
var $this = $(this);
|
||||
|
||||
if(from_format == desired_format) {
|
||||
if(from_format == 'object') {
|
||||
try {
|
||||
date.getTime();
|
||||
} catch (e) {
|
||||
$.error('Received date is in a non supported format!');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return date;
|
||||
}
|
||||
|
||||
if(typeof date == 'undefined') date = new Date(0);
|
||||
|
||||
if(desired_format != 'string' && desired_format != 'object' && desired_format != 'number')
|
||||
$.error('Date format "'+ desired_format +'" not supported!');
|
||||
|
||||
if(!dateFormat) {
|
||||
// thanks to bibendus83 -> http://sourceforge.net/tracker/index.php?func=detail&aid=3213174&group_id=358205&atid=1495382
|
||||
var dp_dateFormat = $this.datepicker('option', 'dateFormat');
|
||||
if (dp_dateFormat) {
|
||||
dateFormat = dp_dateFormat;
|
||||
} else {
|
||||
dateFormat = $.datepicker._defaults.dateFormat;
|
||||
}
|
||||
}
|
||||
|
||||
// converts to object as a neutral format
|
||||
switch(from_format) {
|
||||
case 'object': break;
|
||||
case 'string': date = $.datepicker.parseDate(dateFormat, date); break;
|
||||
case 'number': date = new Date(date); break;
|
||||
default: $.error('Conversion from "'+ desired_format +'" format not allowed on jQuery.multiDatesPicker');
|
||||
}
|
||||
// then converts to the desired format
|
||||
switch(desired_format) {
|
||||
case 'object': return date;
|
||||
case 'string': return $.datepicker.formatDate(dateFormat, date);
|
||||
case 'number': return date.getTime();
|
||||
default: $.error('Conversion to "'+ desired_format +'" format not allowed on jQuery.multiDatesPicker');
|
||||
}
|
||||
return false;
|
||||
},
|
||||
gotDate : function( date, type ) {
|
||||
if(!type) type = 'picked';
|
||||
for(var i = 0; i < this.multiDatesPicker.dates[type].length; i++) {
|
||||
if(methods.compareDates.call(this, this.multiDatesPicker.dates[type][i], date) === 0) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
},
|
||||
value : function( value ) {
|
||||
if(value && typeof value == 'string') {
|
||||
methods.addDates.call(this, value.split(this.multiDatesPicker.separator));
|
||||
} else {
|
||||
var dates = methods.getDates.call(this, 'string');
|
||||
return dates.length
|
||||
? dates.join(this.multiDatesPicker.separator)
|
||||
: "";
|
||||
}
|
||||
},
|
||||
getDates : function( format, type ) {
|
||||
if(!format) format = 'string';
|
||||
if(!type) type = 'picked';
|
||||
switch (format) {
|
||||
case 'object':
|
||||
return this.multiDatesPicker.dates[type];
|
||||
case 'string':
|
||||
case 'number':
|
||||
var o_dates = new Array();
|
||||
for(var i in this.multiDatesPicker.dates[type])
|
||||
o_dates.push(
|
||||
dateConvert.call(
|
||||
this,
|
||||
this.multiDatesPicker.dates[type][i],
|
||||
format
|
||||
)
|
||||
);
|
||||
return o_dates;
|
||||
|
||||
default: $.error('Format "'+format+'" not supported!');
|
||||
}
|
||||
},
|
||||
addDates : function( dates, type ) {
|
||||
if(dates.length > 0) {
|
||||
if(!type) type = 'picked';
|
||||
switch(typeof dates) {
|
||||
case 'object':
|
||||
case 'array':
|
||||
if(dates.length) {
|
||||
for(var i = 0; i < dates.length; i++)
|
||||
addDate.call(this, dates[i], type, true);
|
||||
sortDates.call(this, type);
|
||||
break;
|
||||
} // else does the same as 'string'
|
||||
case 'string':
|
||||
case 'number':
|
||||
addDate.call(this, dates, type);
|
||||
break;
|
||||
default:
|
||||
$.error('Date format "'+ typeof dates +'" not allowed on jQuery.multiDatesPicker');
|
||||
}
|
||||
//$(this).datepicker('refresh');
|
||||
} else {
|
||||
$.error('Empty array of dates received.');
|
||||
}
|
||||
},
|
||||
removeDates : function( dates, type ) {
|
||||
if(!type) type = 'picked';
|
||||
var removed = [];
|
||||
if (Object.prototype.toString.call(dates) === '[object Array]') {
|
||||
for(var i in dates.sort(function(a,b){return b-a})) {
|
||||
removed.push(removeDate.call(this, dates[i], type));
|
||||
}
|
||||
} else {
|
||||
removed.push(removeDate.call(this, dates, type));
|
||||
}
|
||||
return removed;
|
||||
},
|
||||
removeIndexes : function( indexes, type ) {
|
||||
if(!type) type = 'picked';
|
||||
var removed = [];
|
||||
if (Object.prototype.toString.call(indexes) === '[object Array]') {
|
||||
for(var i in indexes.sort(function(a,b){return b-a})) {
|
||||
removed.push(removeIndex.call(this, indexes[i], type));
|
||||
}
|
||||
} else {
|
||||
removed.push(removeIndex.call(this, indexes, type));
|
||||
}
|
||||
return removed;
|
||||
},
|
||||
resetDates : function ( type ) {
|
||||
if(!type) type = 'picked';
|
||||
this.multiDatesPicker.dates[type] = [];
|
||||
},
|
||||
toggleDate : function( date, type ) {
|
||||
if(!type) type = 'picked';
|
||||
|
||||
switch(this.multiDatesPicker.mode) {
|
||||
case 'daysRange':
|
||||
this.multiDatesPicker.dates[type] = []; // deletes all picked/disabled dates
|
||||
var end = this.multiDatesPicker.autoselectRange[1];
|
||||
var begin = this.multiDatesPicker.autoselectRange[0];
|
||||
if(end < begin) { // switch
|
||||
end = this.multiDatesPicker.autoselectRange[0];
|
||||
begin = this.multiDatesPicker.autoselectRange[1];
|
||||
}
|
||||
for(var i = begin; i < end; i++)
|
||||
methods.addDates.call(this, methods.sumDays.call(this,date, i), type);
|
||||
break;
|
||||
default:
|
||||
if(methods.gotDate.call(this, date) === false) // adds dates
|
||||
methods.addDates.call(this, date, type);
|
||||
else // removes dates
|
||||
methods.removeDates.call(this, date, type);
|
||||
break;
|
||||
}
|
||||
},
|
||||
setMode : function( options ) {
|
||||
var $this = $(this);
|
||||
if(options.mode) this.multiDatesPicker.mode = options.mode;
|
||||
|
||||
switch(this.multiDatesPicker.mode) {
|
||||
case 'normal':
|
||||
for(option in options)
|
||||
switch(option) {
|
||||
case 'maxPicks':
|
||||
case 'minPicks':
|
||||
case 'pickableRange':
|
||||
case 'adjustRangeToDisabled':
|
||||
this.multiDatesPicker[option] = options[option];
|
||||
break;
|
||||
//default: $.error('Option ' + option + ' ignored for mode "'.options.mode.'".');
|
||||
}
|
||||
break;
|
||||
case 'daysRange':
|
||||
case 'weeksRange':
|
||||
var mandatory = 1;
|
||||
for(option in options)
|
||||
switch(option) {
|
||||
case 'autoselectRange':
|
||||
mandatory--;
|
||||
case 'pickableRange':
|
||||
case 'adjustRangeToDisabled':
|
||||
this.multiDatesPicker[option] = options[option];
|
||||
break;
|
||||
//default: $.error('Option ' + option + ' does not exist for setMode on jQuery.multiDatesPicker');
|
||||
}
|
||||
if(mandatory > 0) $.error('Some mandatory options not specified!');
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
if(options.pickableRange) {
|
||||
$this.datepicker("option", "maxDate", options.pickableRange);
|
||||
$this.datepicker("option", "minDate", this.multiDatesPicker.minDate);
|
||||
}
|
||||
*/
|
||||
|
||||
if(mdp_events.onSelect)
|
||||
mdp_events.onSelect();
|
||||
},
|
||||
destroy: function(){
|
||||
this.multiDatesPicker = null;
|
||||
$(this).datepicker('destroy');
|
||||
}
|
||||
};
|
||||
|
||||
this.each(function() {
|
||||
var $this = $(this);
|
||||
if (!this.multiDatesPicker) {
|
||||
this.multiDatesPicker = {
|
||||
dates: {
|
||||
picked: [],
|
||||
disabled: []
|
||||
},
|
||||
mode: 'normal',
|
||||
adjustRangeToDisabled: true
|
||||
};
|
||||
}
|
||||
|
||||
if(methods[method]) {
|
||||
var exec_result = methods[method].apply(this, Array.prototype.slice.call(mdp_arguments, 1));
|
||||
switch(method) {
|
||||
case 'removeDates':
|
||||
case 'removeIndexes':
|
||||
case 'resetDates':
|
||||
case 'toggleDate':
|
||||
case 'addDates':
|
||||
var altField = $this.datepicker('option', 'altField');
|
||||
// @todo: should use altFormat for altField
|
||||
var dates_string = methods.value.call(this);
|
||||
if (altField !== undefined && altField != "") {
|
||||
$(altField).val(dates_string);
|
||||
}
|
||||
$this.val(dates_string);
|
||||
|
||||
$.datepicker._refreshDatepicker(this);
|
||||
}
|
||||
switch(method) {
|
||||
case 'removeDates':
|
||||
case 'getDates':
|
||||
case 'gotDate':
|
||||
case 'sumDays':
|
||||
case 'compareDates':
|
||||
case 'dateConvert':
|
||||
case 'value':
|
||||
ret = exec_result;
|
||||
}
|
||||
return exec_result;
|
||||
} else if( typeof method === 'object' || ! method ) {
|
||||
return methods.init.apply(this, mdp_arguments);
|
||||
} else {
|
||||
$.error('Method ' + method + ' does not exist on jQuery.multiDatesPicker');
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
return ret;
|
||||
};
|
||||
|
||||
var PROP_NAME = 'multiDatesPicker';
|
||||
var dpuuid = new Date().getTime();
|
||||
var instActive;
|
||||
|
||||
$.multiDatesPicker = {version: false};
|
||||
//$.multiDatesPicker = new MultiDatesPicker(); // singleton instance
|
||||
$.multiDatesPicker.initialized = false;
|
||||
$.multiDatesPicker.uuid = new Date().getTime();
|
||||
$.multiDatesPicker.version = $.ui.multiDatesPicker.version;
|
||||
|
||||
// allows MDP not to hide everytime a date is picked
|
||||
$.multiDatesPicker._hideDatepicker = $.datepicker._hideDatepicker;
|
||||
$.datepicker._hideDatepicker = function(){
|
||||
var target = this._curInst.input[0];
|
||||
var mdp = target.multiDatesPicker;
|
||||
if(!mdp || (this._curInst.inline === false && !mdp.changed)) {
|
||||
return $.multiDatesPicker._hideDatepicker.apply(this, arguments);
|
||||
} else {
|
||||
mdp.changed = false;
|
||||
$.datepicker._refreshDatepicker(target);
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
// Workaround for #4055
|
||||
// Add another global to avoid noConflict issues with inline event handlers
|
||||
window['DP_jQuery_' + dpuuid] = $;
|
||||
})( jQuery );
|
Before Width: | Height: | Size: 8.7 KiB After Width: | Height: | Size: 8.7 KiB |
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
@ -49,6 +49,12 @@
|
||||
|
||||
.header.reduit .avatar {height: 25px; }
|
||||
|
||||
.header.reduit #navbar-nameuser
|
||||
{
|
||||
top: 14px;
|
||||
right: 210px;
|
||||
}
|
||||
|
||||
/* ===================== FIN MODE REDUIT ==========================*/
|
||||
|
||||
/* fix defaut d'affichage sur toogle switch */
|
||||
@ -57,7 +63,11 @@ body {
|
||||
background: linear-gradient(180deg, var(--main), white,50%);
|
||||
}
|
||||
|
||||
body.eleves, body.grp-National_1 {
|
||||
#navbar-nameuser a {
|
||||
color: var(--main, #004d9a) !important;
|
||||
}
|
||||
|
||||
body.eleves, body.grp-National_1, body.grp-eleves {
|
||||
--colorbody: #ffffff;
|
||||
--main: #169b62;
|
||||
--mainR: 22;
|
||||
@ -77,7 +87,7 @@ body.eleves, body.grp-National_1 {
|
||||
/* responsables #MAUVE #7D4E5B
|
||||
*/
|
||||
|
||||
body.responsables, body.grp-National_2 {
|
||||
body.responsables, body.grp-National_2,body.grp-responsables {
|
||||
--colorbody: #ffffff;
|
||||
--main: #7d4e5b;
|
||||
--mainR: 125;
|
||||
@ -96,7 +106,7 @@ body.responsables, body.grp-National_2 {
|
||||
|
||||
|
||||
/* professeurs, enseignants1d #BLEU1 #5770BE */
|
||||
body.professeurs, body.enseignants1d, body.grp-National_3 {
|
||||
body.professeurs, body.enseignants1d, body.grp-National_3, body.grp-professeurs {
|
||||
--colorbody: #ffffff;
|
||||
--main: #5770be;
|
||||
--mainR: 87;
|
||||
@ -114,7 +124,7 @@ body.professeurs, body.enseignants1d, body.grp-National_3 {
|
||||
}
|
||||
|
||||
/* administratifs, admin #ORANGE #FF6F4C */
|
||||
body.administratifs, body.admin, body.grp-National_4 , body.grp-National_5, body.grp-National_6 {
|
||||
body.administratifs, body.admin, body.grp-National_4 , body.grp-National_5, body.grp-National_6 , body.grp-administratifs, {
|
||||
--colorbody: #ffffff;
|
||||
--main: #ff6f4c;
|
||||
--mainR: 255;
|
||||
@ -278,7 +288,9 @@ div.header > a.title > span {
|
||||
}
|
||||
.nav.navbar-top-links.navbar-right > li a:hover {
|
||||
color: var(--fontcolorhover, white) !important;
|
||||
background: var(--fontcolorhoverdark, black) !important;
|
||||
background: var(--light, black) !important;
|
||||
border-radius: 5px;
|
||||
padding-top: 1px;
|
||||
}
|
||||
|
||||
/*
|
||||
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
@ -0,0 +1,26 @@
|
||||
{% set logo = "" %}
|
||||
|
||||
{% set header = "header.jpg" %}
|
||||
{% set heightheader = "" %}
|
||||
|
||||
{% set colormain = "" %}
|
||||
{% set fontcolorhover = "" %}
|
||||
{% set colorbody = "" %}
|
||||
|
||||
{% set fontfacetitle = "" %}
|
||||
{% set fontfacebody = "" %}
|
||||
|
||||
{{
|
||||
render(url("cadoles_core_theme_setconfig",
|
||||
{
|
||||
'logo':logo,
|
||||
'header': header,
|
||||
'heightheader': heightheader,
|
||||
'colormain': colormain,
|
||||
'fontcolorhover': fontcolorhover,
|
||||
'colorbody': colorbody,
|
||||
'fontfacetitle': fontfacetitle,
|
||||
'fontfacebody': fontfacebody
|
||||
}
|
||||
))
|
||||
}}
|
After Width: | Height: | Size: 30 KiB |
@ -0,0 +1,3 @@
|
||||
name: White
|
||||
author: Arnaud Fornerot
|
||||
version: 1.0
|
After Width: | Height: | Size: 286 KiB |
@ -0,0 +1,25 @@
|
||||
.header{
|
||||
background-image: url(header.jpg) !important;
|
||||
}
|
||||
|
||||
.header .title {
|
||||
color: var(--main);
|
||||
}
|
||||
|
||||
.header .title:hover {
|
||||
color: var(--light);
|
||||
}
|
||||
|
||||
.header a {
|
||||
color: var(--main);
|
||||
}
|
||||
|
||||
.header a:hover {
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.grid-item .grid-item-title h2 {
|
||||
font-weight: bold;
|
||||
text-transform: initial;
|
||||
font-size:110% !important;
|
||||
}
|
@ -4,6 +4,8 @@
|
||||
<form>
|
||||
<h1 class="page-header">Configuration Générale</h1>
|
||||
|
||||
Attention, selon la configuration du portail, certains paramètres sont forcés au niveau du serveur et donc certains réglages peuvent être inopérants dans cette interface.
|
||||
<br><br>
|
||||
<div class="panel panel-primary">
|
||||
<div class="panel-heading">
|
||||
<i class="fa fa-table fa-fw"></i> Liste des Configurations
|
||||
@ -17,6 +19,7 @@
|
||||
<th width="90px">Action</th>
|
||||
<th width="70px">Ordre</th>
|
||||
<th width="200px">Clé</th>
|
||||
<th>Description</th>
|
||||
<th>Valeur</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@ -38,6 +41,7 @@
|
||||
</td>
|
||||
<td>{{ config.order }}</td>
|
||||
<td>{{ config.id }}</td>
|
||||
<td>{{ config.help|raw }}</td>
|
||||
<td>
|
||||
{% if config.type == "boolean" %}
|
||||
{% if config.value == "0" %}
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
{% block pagewrapper %}
|
||||
{{ form_start(form) }}
|
||||
<h1 class="page-header">Modification Configuration Générale</h1>
|
||||
<h1 class="page-header">Modification Configuration Générale = {{config.id}}</h1>
|
||||
|
||||
{{ form_widget(form.submit) }} <a class="btn btn-default" href={{ path('cadoles_core_config_commun') }}>Annuler</a>
|
||||
|
||||
|
@ -49,5 +49,24 @@
|
||||
|
||||
$(window).load(function () {
|
||||
$('#largeimg').imgAreaSelect({ aspectRatio: '1:1', onSelectChange: preview });
|
||||
|
||||
|
||||
var selection = new Object();
|
||||
if($('#largeimg').height()<$('#largeimg').width()) {
|
||||
selection.width = $('#largeimg').height();
|
||||
selection.height = $('#largeimg').height();
|
||||
}
|
||||
else {
|
||||
selection.width = $('#largeimg').width();
|
||||
selection.height = $('#largeimg').width();
|
||||
}
|
||||
|
||||
selection.x1=0;
|
||||
selection.x2=0;
|
||||
selection.y1=0;
|
||||
selection.y2=0;
|
||||
|
||||
preview($('#largeimg'),selection);
|
||||
|
||||
});
|
||||
{% endblock %}
|
||||
|
@ -33,6 +33,10 @@
|
||||
text-transform: initial !important;
|
||||
}
|
||||
|
||||
a.item-update {
|
||||
right: 25px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
{% endblock %}
|
||||
@ -41,7 +45,7 @@
|
||||
|
||||
<div id="explorer">
|
||||
<div class="btn-toolbar" role="toolbar" aria-label="Toolbar with button groups" style="margin-top:5px">
|
||||
{% if canupdate %}
|
||||
{% if canupdate and not fgtrash %}
|
||||
<div class="btn-group mr-2" role="group" aria-label="First group">
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#mymodal" onClick="ModalLoad('mymodal','Téléchargez vos Fichiers','{{ path('cadoles_core_'~access~'_file_upload',{'id': directory,'type':'all','subdirectory':subdirectory}) }}');" title="Ajouter des fichiers">
|
||||
<i class="fa fa-upload"></i>
|
||||
@ -49,7 +53,6 @@
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#mymodal" onClick="ModalLoad('mymodal','Création Répertoire','{{ path('cadoles_core_'~access~'_file_subdirectory',{'id': directory,'type':'all','subdirectory':subdirectory}) }}');" title="Ajouter un Répertoire">
|
||||
<i class="fa fa-folder-plus"></i>
|
||||
</button>
|
||||
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
@ -71,23 +74,59 @@
|
||||
{% endif %}
|
||||
</a>
|
||||
|
||||
{% set active="" %}
|
||||
{% if sort=="name" %}
|
||||
{%set action="date" %}
|
||||
{% set active="active" %}
|
||||
{%endif%}
|
||||
|
||||
{% if order=="SORT_ASC" %}
|
||||
{%set action="SORT_DESC" %}
|
||||
{% else %}
|
||||
{%set action="name" %}
|
||||
{%set action="SORT_ASC" %}
|
||||
{% endif %}
|
||||
{% if not subdirectory is empty %}
|
||||
<a href="{{ path('cadoles_core_'~access~'_file_list',{'directory':directory,'subdirectory':subdirectory,'sort':action }) }}" type="button" class="btn btn-primary">
|
||||
<a href="{{ path('cadoles_core_'~access~'_file_list',{'directory':directory,'subdirectory':subdirectory,'sort':'name', 'order':action }) }}" type="button" class="btn btn-primary {{active}}">
|
||||
{% else %}
|
||||
<a href="{{ path('cadoles_core_'~access~'_file_list',{'directory':directory,'clear':true,'sort':action }) }}" type="button" class="btn btn-primary">
|
||||
<a href="{{ path('cadoles_core_'~access~'_file_list',{'directory':directory,'clear':true,'sort':'name', 'order':action }) }}" type="button" class="btn btn-primary {{active}}">
|
||||
{% endif %}
|
||||
{% if sort=="name" %}
|
||||
{% if order=="SORT_ASC" %}
|
||||
<i class="fas fa-long-arrow-alt-down"></i> Nom
|
||||
{% else %}
|
||||
<i class="fas fa-long-arrow-alt-up"></i> Nom
|
||||
{% endif %}
|
||||
</a>
|
||||
|
||||
{% set active="" %}
|
||||
{% if sort=="date" %}
|
||||
{% set active="active" %}
|
||||
{%endif%}
|
||||
|
||||
{% if order=="SORT_ASC" %}
|
||||
{%set action="SORT_DESC" %}
|
||||
{% else %}
|
||||
{%set action="SORT_ASC" %}
|
||||
{% endif %}
|
||||
{% if not subdirectory is empty %}
|
||||
<a href="{{ path('cadoles_core_'~access~'_file_list',{'directory':directory,'subdirectory':subdirectory,'sort':'date', 'order':action }) }}" type="button" class="btn btn-primary {{active}}">
|
||||
{% else %}
|
||||
<a href="{{ path('cadoles_core_'~access~'_file_list',{'directory':directory,'clear':true,'sort':'date', 'order':action }) }}" type="button" class="btn btn-primary {{active}}">
|
||||
{% endif %}
|
||||
{% if order=="SORT_ASC" %}
|
||||
<i class="fas fa-long-arrow-alt-down"></i> Date
|
||||
{% else %}
|
||||
<i class="fas fa-long-arrow-alt-up"></i> Date
|
||||
{% endif %}
|
||||
</a>
|
||||
</div>
|
||||
|
||||
{% if canupdate %}
|
||||
<div class="btn-group mr-2" role="group" aria-label="Third group">
|
||||
<a href="{{ path('cadoles_core_'~access~'_file_list',{'directory':directory,'subdirectory':'__trash' }) }}" type="button" class="btn btn-primary"><i class="fas fa-trash"></i></a>
|
||||
{% if fgtrash %}
|
||||
<a href="{{ path('cadoles_core_'~access~'_file_purgetrash',{'directory':directory }) }}" type="button" class="btn btn-primary" data-method="delete" data-confirm="Souhaitez-vous purger votre poubelle ? Cette action sera irrévocable.">Purger la poubelle</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
|
||||
@ -103,12 +142,14 @@
|
||||
{% set datadir = datadir~'/'~sub %}
|
||||
{% set sub = sub~"/"~parent %}
|
||||
{% endif %}
|
||||
|
||||
<li class="brea.dcrumb-item directory" data-dir="{{datadir}}" data-name="{{ parent }}"><a href="{{ path('cadoles_core_'~access~'_file_list',{'directory':directory,'subdirectory':sub }) }}">{{parent|raw}}</a></li>
|
||||
|
||||
{% set tmpdirname = parent|replace({'__trash': 'Poubelle'}) %}
|
||||
<li class="brea.dcrumb-item directory" data-dir="{{datadir}}" data-name="{{ parent }}"><a href="{{ path('cadoles_core_'~access~'_file_list',{'directory':directory,'subdirectory':sub }) }}">{{tmpdirname|raw}}</a></li>
|
||||
{% endfor %}
|
||||
|
||||
{% if not subdirectory is empty %}
|
||||
<li class="breadcrumb-item directory" data-dir="{{directory}}/{{sub}}" data-name="{{dirname}}"><a href="{{ path('cadoles_core_'~access~'_file_list',{'directory':directory,'subdirectory':subdirectory }) }}">{{dirname|raw}}</a></li>
|
||||
{% set tmpdirname = dirname|replace({'__trash': 'Poubelle'}) %}
|
||||
<li class="breadcrumb-item directory" data-dir="{{directory}}/{{sub}}" data-name="{{dirname}}"><a href="{{ path('cadoles_core_'~access~'_file_list',{'directory':directory,'subdirectory':subdirectory }) }}">{{tmpdirname|raw}}</a></li>
|
||||
{% endif %}
|
||||
|
||||
</ol>
|
||||
@ -124,9 +165,23 @@
|
||||
<div id="{{dir.name|e('js')|raw }}" class="grid-item grid-{{view}} directory" data-dir="{{directory}}/{{subdirectory}}" data-name="{{dir.name}}">
|
||||
<div class="grid-item-content">
|
||||
{% if canadd %}
|
||||
{% if fgtrash %}
|
||||
<a style="cursor:pointer;" onClick="restaureFile('{{ directory }}','{{subdirectory}}','{{dir.name|e('js')|raw }}')" class="item-restaure">
|
||||
<i class="fa fa-undo" title="Restaurer le fichier"></i>
|
||||
</a>
|
||||
|
||||
<a style="cursor:pointer;" onClick="delFile('{{ directory }}','{{subdirectory}}','{{dir.name|e('js')|raw }}')" class="item-delete">
|
||||
<i class="fa fa-trash" title="Supprimer le dossier"></i>
|
||||
</a>
|
||||
<i class="fa fa-trash" title="Supprimer le dossier"></i>
|
||||
</a>
|
||||
{% else %}
|
||||
<a style="cursor:pointer;" data-toggle="modal" data-target="#mymodal" onClick="ModalLoad('mymodal','Modification Répertoire','{{ path('cadoles_core_'~access~'_file_rename',{'id': directory,'subdirectory':subdirectory,'oldname':dir.name}) }}');" class="item-update">
|
||||
<i class="fa fa-file" title="Renommer le dossier"></i>
|
||||
</a>
|
||||
|
||||
<a style="cursor:pointer;" onClick="trashFile('{{ directory }}','{{subdirectory}}','{{dir.name|e('js')|raw }}')" class="item-delete">
|
||||
<i class="fa fa-trash" title="Supprimer le dossier"></i>
|
||||
</a>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% if subdirectory is empty %}
|
||||
@ -153,9 +208,23 @@
|
||||
<div class="grid-item grid-{{view}} file" data-dir="{{directory}}/{{subdirectory}}" data-name="{{file.name}}">
|
||||
<div class="grid-item-content">
|
||||
{% if canadd %}
|
||||
{% if fgtrash %}
|
||||
<a style="cursor:pointer;" onClick="restaureFile('{{ directory }}','{{subdirectory}}','{{file.name|e('js')|raw }}')" class="item-restaure">
|
||||
<i class="fa fa-undo" title="Restaurer le fichier"></i>
|
||||
</a>
|
||||
|
||||
<a style="cursor:pointer;" onClick="delFile('{{ directory }}','{{subdirectory}}','{{file.name|e('js')|raw }}')" class="item-delete">
|
||||
<i class="fa fa-trash" title="Supprimer le fichier"></i>
|
||||
</a>
|
||||
<i class="fa fa-trash" title="Supprimer le fichier"></i>
|
||||
</a>
|
||||
{% else %}
|
||||
<a style="cursor:pointer;" data-toggle="modal" data-target="#mymodal" onClick="ModalLoad('mymodal','Modification Fichier','{{ path('cadoles_core_'~access~'_file_rename',{'id': directory,'subdirectory':subdirectory,'oldname':file.name}) }}');" class="item-update">
|
||||
<i class="fa fa-file" title="Renommer le fichier"></i>
|
||||
</a>
|
||||
|
||||
<a style="cursor:pointer;" onClick="trashFile('{{ directory }}','{{subdirectory}}','{{file.name|e('js')|raw }}')" class="item-delete">
|
||||
<i class="fa fa-trash" title="Supprimer le fichier"></i>
|
||||
</a>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% if file.minefamily=="text" or file.minefamily=="image" or file.minetype == "application/pdf" %}
|
||||
@ -205,8 +274,12 @@
|
||||
else {
|
||||
color = "#{{ color["main"]}}";
|
||||
}
|
||||
$(".item-update").css("color",color);
|
||||
$(".item-update > i").css("color",color);
|
||||
$(".item-delete").css("color",color);
|
||||
$(".item-delete > i").css("color",color);
|
||||
$(".item-restaure").css("color",color);
|
||||
$(".item-restaure > i").css("color",color);
|
||||
$(".grid-item-title > h2").css("color",color);
|
||||
|
||||
$('#mymodal').on('shown.bs.modal', function() {
|
||||
@ -218,6 +291,7 @@
|
||||
});
|
||||
|
||||
|
||||
{% if canupdate and not fgtrash %}
|
||||
$('.file').on('dragstart', function (s) {
|
||||
dirsource=$(this).data("dir");
|
||||
namesource=$(this).data("name");
|
||||
@ -240,11 +314,17 @@
|
||||
dirdestination=$(this).data("dir")+"/"+$(this).data("name");
|
||||
namedestination=namesource;
|
||||
|
||||
// Si la source est la meme que la destination on ne fait rien
|
||||
if(dirdestination+"/"+namedestination==dirsource+"/"+namesource) return false;
|
||||
urlsource=dirsource+"/"+namesource;
|
||||
urlsource=urlsource.replace("//","/");
|
||||
urldestination=dirdestination+"/"+namedestination;
|
||||
urldestination=urldestination.replace("//","/");
|
||||
|
||||
// Si la source est la meme que la destination on ne fait rien
|
||||
if(urlsource==urldestination) return false;
|
||||
|
||||
// Si la source est dans la destination on ne fait rien
|
||||
//if(urldestination.includes(urlsource)) return false;
|
||||
|
||||
console.log(dirsource+"/"+namesource);
|
||||
console.log(dirdestination+"/"+namedestination);
|
||||
// On déplace l'element
|
||||
$.ajax({
|
||||
method: "POST",
|
||||
@ -263,11 +343,9 @@
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
{% endif %}
|
||||
|
||||
|
||||
});
|
||||
@ -293,9 +371,48 @@
|
||||
}
|
||||
}
|
||||
|
||||
{% if canupdate %}
|
||||
// Trasher un fichier
|
||||
function trashFile(directory,subdirectory,filename) {
|
||||
var r = confirm("Confirmez-vous la mise à la poubelle de ce fichier ? Vous pourrez le récupèrer si besoin.");
|
||||
if (r == true) {
|
||||
$.ajax({
|
||||
method: "POST",
|
||||
url: "{{ path('cadoles_core_'~access~'_file_trash') }}",
|
||||
data: {
|
||||
directory:directory,
|
||||
subdirectory:subdirectory,
|
||||
filename:filename
|
||||
},
|
||||
success: function() {
|
||||
location.reload();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Restaurer un fichier
|
||||
function restaureFile(directory,subdirectory,filename) {
|
||||
var r = confirm("Confirmez-vous la restauration de ce fichier ?");
|
||||
if (r == true) {
|
||||
$.ajax({
|
||||
method: "POST",
|
||||
url: "{{ path('cadoles_core_'~access~'_file_restaure') }}",
|
||||
data: {
|
||||
directory:directory,
|
||||
subdirectory:subdirectory,
|
||||
filename:filename
|
||||
},
|
||||
success: function() {
|
||||
location.reload();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Supprimer un fichier
|
||||
function delFile(directory,subdirectory,filename) {
|
||||
var r = confirm("Confirmez-vous la suppression de ce fichier ?");
|
||||
var r = confirm("Confirmez-vous la suppression définitive de ce fichier ?");
|
||||
if (r == true) {
|
||||
$.ajax({
|
||||
method: "POST",
|
||||
@ -311,6 +428,7 @@
|
||||
});
|
||||
}
|
||||
}
|
||||
{% endif %}
|
||||
|
||||
|
||||
// Affichage des frames associés aux items de bureau
|
||||
|
@ -46,7 +46,8 @@
|
||||
|
||||
$('document').ready(function(){
|
||||
{% if toclose %}
|
||||
parent.location.reload();
|
||||
href=parent.location.href;
|
||||
parent.location.href=href;
|
||||
{% endif %}
|
||||
$("#form_subdirectory").focus();
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
init: function() {
|
||||
this.on("sending", function(file, xhr, formData) {
|
||||
formData.append("directory", "{{ id }}");
|
||||
formData.append("subdirectory", "{{ subdirectory }}");
|
||||
formData.append("subdirectory", "{{ subdirectory|raw }}");
|
||||
});
|
||||
|
||||
var totalFiles = 0;
|
||||
|
@ -4,11 +4,11 @@
|
||||
{{ form_start(form) }}
|
||||
<h1 class="page-header">
|
||||
{% if mode=="update" %}
|
||||
Modification Groupe
|
||||
Modification Groupe = {{ group.label }}
|
||||
{% elseif mode=="submit" %}
|
||||
Création Groupe
|
||||
{% elseif mode=="delete" %}
|
||||
Suppression Groupe
|
||||
Suppression Groupe = {{ group.label }}
|
||||
{% endif %}
|
||||
</h1>
|
||||
|
||||
|
@ -0,0 +1,52 @@
|
||||
{% extends '@CadolesCore/base.html.twig' %}
|
||||
|
||||
{% block pagewrapper %}
|
||||
<a class="btn btn-default" onClick="closeModal()">Fermer</a>
|
||||
|
||||
<br><br>
|
||||
<table class="table table-striped table-bordered table-hover" id="dataTablesnotin" style="width:100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Action</th>
|
||||
<th>Email</th>
|
||||
<th>Statut</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
{% for invitation in invitations %}
|
||||
<tr>
|
||||
<td>
|
||||
{% if invitation.relance %}
|
||||
<a style='cursor:pointer' onClick='showMail("{{invitation.email}}")'><i class='fa fa-envelope fa-fw'></i></a>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>{{invitation.email}}</td>
|
||||
<td>{{invitation.statut}}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block localjavascript %}
|
||||
$(document).ready(function() {
|
||||
});
|
||||
|
||||
function showMail(email) {
|
||||
window.parent.$("#mymodal").hide();
|
||||
|
||||
$("#mymodal").find(".modal-title").html("INVITATION");
|
||||
var url="{{ path('cadoles_core_mail_invitationgroup',{id:id,email:'xxx'}) }}";
|
||||
url=url.replace('xxx',email);
|
||||
window.parent.$("#mymodal").find("#framemodal").attr("src",url);
|
||||
window.parent.$("#mymodal").modal().show();
|
||||
}
|
||||
|
||||
function closeModal() {
|
||||
url=window.parent.location;
|
||||
window.parent.location=url;
|
||||
}
|
||||
|
||||
{% endblock %}
|
@ -9,17 +9,21 @@
|
||||
{%endif%}
|
||||
</h1>
|
||||
|
||||
<p>
|
||||
{% set permgroup = app.session.get('permgroup') %}
|
||||
{% if is_granted('ROLE_ADMIN') or (is_granted('ROLE_MODO') and (permgroup=="ROLE_MODO" or permgroup=="ROLE_ANIM" or permgroup=="ROLE_USER")) or (is_granted('ROLE_ANIM') and (permgroup=="ROLE_ANIM" or permgroup=="ROLE_USER")) or (is_granted('ROLE_USER') and permgroup=="ROLE_USER") %}
|
||||
<p><a class="btn btn-success" href={{ path('cadoles_core_'~access~'_group_submit') }}>
|
||||
<a class="btn btn-success" href={{ path('cadoles_core_'~access~'_group_submit') }}>
|
||||
{% if access=="config" %}
|
||||
Ajouter
|
||||
{% else %}
|
||||
Créer un Groupe de Travail
|
||||
{% endif %}
|
||||
</a></p>
|
||||
</a>
|
||||
{% endif %}
|
||||
|
||||
{%if access=="config" %}
|
||||
<a class="btn btn-success" href={{ path('cadoles_core_config_group_export') }}>Exporter CSV</a>
|
||||
{% endif %}
|
||||
</p>
|
||||
|
||||
<div class="panel panel-primary">
|
||||
<div class="panel-heading">
|
||||
@ -39,6 +43,7 @@
|
||||
{% if portal_activate %}
|
||||
<th>Groupe de Travail</th>
|
||||
<th class="text-center">Propriétaire</th>
|
||||
<th class="no-sort">Visite</th>
|
||||
{% if access=="config" %}
|
||||
<th>Création Pages</th>
|
||||
<th>Création Calendriers</th>
|
||||
|
@ -9,9 +9,15 @@
|
||||
<a class="btn btn-default" href={{ path('cadoles_core_home',{'id':idreturn}) }}>Fermer</a>
|
||||
{% endif %}
|
||||
|
||||
{% if moderegistration!="none" and masteridentity=="SQL"%}
|
||||
{% if moderegistration!="none" and masteridentity=="SQL" and group.fgcanshare %}
|
||||
<a class="btn btn-primary" style="cursor:pointer" onClick="showMail();">Inviter des personnes non listées ci-dessous</a>
|
||||
<a class="btn btn-primary" style="cursor:pointer" onClick="showInvitations();">Suivi des Invitations</a>
|
||||
{%endif%}
|
||||
|
||||
{% if group.fgcanshare %}
|
||||
<button class="btn btn-default pull-right" style="margin-left:10px" data-toggle="modal" data-target="#modalperm">Matrice des permissions</button>
|
||||
{%endif%}
|
||||
|
||||
<a class="btn btn-default pull-right" href={{ path('cadoles_core_'~access~'_group_usergroup_export',{'id':group.id}) }}>Exporter CSV</a>
|
||||
<br><br>
|
||||
|
||||
@ -30,9 +36,11 @@
|
||||
<th width="70px" class="no-sort">Avatar</th>
|
||||
<th width="200px">Login</th>
|
||||
<th>Email</th>
|
||||
{% if fgviewvisite %}
|
||||
<th class="no-sort no-visible">Visite</th>
|
||||
{% endif %}
|
||||
{% if group.fgcanshare %}
|
||||
<th class="no-sort no-visible">Manager</th>
|
||||
<th class="no-sort no-visible">Permissions</th>
|
||||
{% endif %}
|
||||
</tr>
|
||||
</thead>
|
||||
@ -57,9 +65,11 @@
|
||||
<th width="70px" class="no-sort">Avatar</th>
|
||||
<th width="200px">Login</th>
|
||||
<th>Email</th>
|
||||
{% if fgviewvisite %}
|
||||
<th class="no-sort">Visite</th>
|
||||
{% endif %}
|
||||
{% if group.fgcanshare %}
|
||||
<th class="no-sort">Manager</th>
|
||||
<th class="no-sort">Permissions</th>
|
||||
{% endif %}
|
||||
</tr>
|
||||
</thead>
|
||||
@ -69,6 +79,333 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="modalperm" 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">×</button>
|
||||
<h4 class="modal-title">MATRICE DES PERMISSIONS</h4>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<div class="dataTable_wrapper">
|
||||
<table class="table table-striped table-bordered table-hover" id="dataTablesnotin" style="width:100%; text-align:center; zoom:80%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Permissions</th>
|
||||
<th style="text-align:center">Propriétaire<br>***</th>
|
||||
<th style="text-align:center">Gestionnaire<br>**</th>
|
||||
<th style="text-align:center">Collaborateur<br>*</th>
|
||||
<th style="text-align:center">Utilisateur<br> </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td colspan="5" style="font-weight: bold;">GROUPE</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:left;">Modifier le groupe</td>
|
||||
<td>x</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:left;">Supprimer le groupe</td>
|
||||
<td>x</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:left;">Changer le propriétaire du groupe</td>
|
||||
<td>x</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:left;">Affecter des utilisateurs au groupe</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:left;">Désaffecter des utilisateurs au groupe</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:left;">Inviter des utilisateurs dans le groupe</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:left;">Visualiser les statistiques du groupe</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:left;">S’inscrire par soi-même sur les groupes ouverts</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:left;">Se désinscrire par soi-même </td>
|
||||
<td></td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="5" style="font-weight: bold;">PAGE</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:left;">Créer / Modifier / Supprimer / Partager des Pages sur le groupe</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:left;">Placer en favoris une page du groupe</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="5" style="font-weight: bold;">WIDGET</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:left;">Widget Favoris = Ajouter / Modifier / Supprimer Lien</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:left;">Widget Fichier = Ajouter / Modifier / Supprimer Fichiers</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:left;">Widget Lien = Modifier Lien</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:left;">Widget Editeur = Modifier Texte</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:left;">Widget Carrousel = Créer / Modifier / Supprimer Image</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:left;">Widget Gallerie Images = Créer / Modifier / Supprimer Image</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:left;">Widget Chat = Ajouter commentaires</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:left;">Widget Chat = Modifier / Supprimer Commentaires des membres du groupe</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:left;">Widget Chat = Masquer Commentaires des membres du groupe</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="5" style="font-weight: bold;">BLOG</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:left;">Créer / Modifier / Supprimer / Partager un blog sur le groupe</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:left;">Créer des articles sur les blogs du groupe</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:left;">Modifier / Supprimer ses articles sur les blogs du groupe</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:left;">Modifier / Supprimer des articles de blog des autres membres du groupe</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:left;">Ajouter des commentaires sur les articles du blog</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:left;">Modifier / Supprimer ses propres commentaires</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:left;">Modifier / Supprimer les commentaires des autres membre du groupe de ses articles</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:left;">Modifier / Supprimer les commentaires des autres membre du groupe sur l'ensemble du blog</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="5" style="font-weight: bold;">PROJET</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:left;">Créer / Modifier / Supprimer / Partager des projets sur le groupe</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:left;">Créer des taches sur les projets du groupe</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:left;">Modifier / Supprimer ses propres tâches</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:left;">Affecter des tâches aux autres membres du groupe</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:left;">Modifier / Supprimer des Tâches à des autres membres du groupe</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:left;">Ajouter des commentaires sur les tâches</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:left;">Modifier / Supprimer ses propres commentaires de tâches</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:left;">Modifier / Supprimer les commentaires des autres membre du groupe de ses taches</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:left;">Modifier / Supprimer les commentaires des taches sur l'ensemble du projet</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="5" style="font-weight: bold;">CALENDRIER</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:left;">Créer / Modifier / Supprimer / Partager un calendrier sur le groupe</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:left;">Créer des évènements sur les calendriers du groupe</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:left;">Créer / Modifier / Supprimer / Partager des évènements sur les calendriers du groupe</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block localjavascript %}
|
||||
@ -151,15 +488,17 @@
|
||||
});
|
||||
}
|
||||
|
||||
function switchManager(id) {
|
||||
function changeRole(id) {
|
||||
$.ajax({
|
||||
method: "POST",
|
||||
url: "{{ path('cadoles_core_'~access~'_group_ajax_switchmanager') }}",
|
||||
url: "{{ path('cadoles_core_'~access~'_group_ajax_changerole') }}",
|
||||
data: {
|
||||
"group": {{ group.id }},
|
||||
"user": id,
|
||||
"role": $("#roleuser-"+id).val(),
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function showMail() {
|
||||
@ -168,4 +507,11 @@
|
||||
$("#mymodal").find("#framemodal").attr("src",url);
|
||||
$("#mymodal").modal().show();
|
||||
}
|
||||
|
||||
function showInvitations() {
|
||||
$("#mymodal").find(".modal-title").html("SUVI DES INVITATIONS");
|
||||
var url="{{ path('cadoles_core_'~access~'_group_invitation',{id:group.id}) }}";
|
||||
$("#mymodal").find("#framemodal").attr("src",url);
|
||||
$("#mymodal").modal().show();
|
||||
}
|
||||
{% endblock %}
|
||||
|
@ -217,6 +217,7 @@
|
||||
$( ".grid-item-content").hover(function() {
|
||||
$(this).children(".item-heart").show();
|
||||
$(this).children(".item-delete").show();
|
||||
$(this).children(".item-restaure").show();
|
||||
$(this).children(".item-update").show();
|
||||
$(this).children(".item-preview").show();
|
||||
});
|
||||
@ -224,6 +225,7 @@
|
||||
$( ".grid-item-content" ).mouseleave(function() {
|
||||
$(this).children(".item-heart").hide();
|
||||
$(this).children(".item-delete").hide();
|
||||
$(this).children(".item-restaure").hide();
|
||||
$(this).children(".item-update").hide();
|
||||
$(this).children(".item-preview").hide();
|
||||
});
|
||||
|
@ -6,9 +6,9 @@
|
||||
{% set permannu = app.session.get('permannu') %}
|
||||
|
||||
{% if fgheader %}
|
||||
<li id="menu-header"><a onclick="switchHeader()" title="Cacher / Affichier Bannière " style="cursor:pointer"><i class="fa fa-chevron-up fa-fw"></i></a>
|
||||
<li id="menu-header"><a onclick="switchHeader()" title="Cacher / Afficher Bannière " style="cursor:pointer"><i class="fa fa-chevron-up fa-fw"></i></a>
|
||||
{% else %}
|
||||
<li id="menu-header"><a onclick="switchHeader()" title="Cacher / Affichier Bannière " style="cursor:pointer"><i class="fa fa-chevron-down fa-fw"></i></a>
|
||||
<li id="menu-header"><a onclick="switchHeader()" title="Cacher / Afficher Bannière " style="cursor:pointer"><i class="fa fa-chevron-down fa-fw"></i></a>
|
||||
{% endif %}
|
||||
|
||||
{% if is_granted('ROLE_ADMIN') or (is_granted('ROLE_MODO') and (permannu=="ROLE_MODO" or permannu=="ROLE_ANIM" or permannu=="ROLE_USER")) or (is_granted('ROLE_ANIM') and (permannu=="ROLE_ANIM" or permannu=="ROLE_USER")) or (is_granted('ROLE_USER') and permannu=="ROLE_USER") %}
|
||||
|
@ -4,11 +4,11 @@
|
||||
{{ form_start(form) }}
|
||||
<h1 class="page-header">
|
||||
{% if mode=="update" %}
|
||||
Modification {{ labelniveau01 }}
|
||||
Modification {{ labelniveau01 }} = {{niveau01.label}}
|
||||
{% elseif mode=="submit" %}
|
||||
Création {{ labelniveau01 }}
|
||||
{% elseif mode=="delete" %}
|
||||
Suppression {{ labelniveau01 }}
|
||||
Suppression {{ labelniveau01 }} = {{niveau01.label}}
|
||||
{% endif %}
|
||||
</h1>
|
||||
|
||||
|
@ -4,11 +4,11 @@
|
||||
{{ form_start(form) }}
|
||||
<h1 class="page-header">
|
||||
{% if mode=="update" %}
|
||||
Modification {{ labelniveau02 }}
|
||||
Modification {{ labelniveau02 }} = {{niveau02.label}}
|
||||
{% elseif mode=="submit" %}
|
||||
Création {{ labelniveau02 }}
|
||||
{% elseif mode=="delete" %}
|
||||
Suppression {{ labelniveau02 }}
|
||||
Suppression {{ labelniveau02 }} = {{niveau02.label}}
|
||||
{% endif %}
|
||||
</h1>
|
||||
|
||||
|
@ -4,11 +4,11 @@
|
||||
{{ form_start(form) }}
|
||||
<h1 class="page-header">
|
||||
{% if mode=="update" %}
|
||||
Modification Profil de Modération
|
||||
Modification Profil de Modération = {{ permmodoprofil.name }}
|
||||
{% elseif mode=="submit" %}
|
||||
Création Profil de Modération
|
||||
{% elseif mode=="delete" %}
|
||||
Suppression Profil de Modération
|
||||
Suppression Profil de Modération = {{ permmodoprofil.name }}
|
||||
{% endif %}
|
||||
</h1>
|
||||
|
||||
|
@ -5,11 +5,11 @@
|
||||
{% if moderegistration!="none" %}
|
||||
<h1 class="page-header">
|
||||
{% if mode=="send" %}
|
||||
Confirmation à l'Utilisateur
|
||||
Confirmation à l'Utilisateur = {{ registration.username }}
|
||||
{% elseif mode=="submit" %}
|
||||
Inscription
|
||||
{% elseif mode=="delete" %}
|
||||
Suppression Inscription
|
||||
Suppression Inscription = {{ registration.username }}
|
||||
{% endif %}
|
||||
</h1>
|
||||
|
||||
@ -21,7 +21,11 @@
|
||||
{% endif %}
|
||||
|
||||
{% if mode!="submit" %}
|
||||
{% if mode=="send" %} {{ form_widget(form.save) }} {%endif%}
|
||||
{% if mode=="send" %}
|
||||
{{ form_widget(form.save) }}
|
||||
<a class="btn btn-default" href="mailto:{{registration.email}}?subject= {{app.session.get('appname')}} : à propos de votre inscription">Envoyer un mail</a>
|
||||
{%endif%}
|
||||
|
||||
<a class="btn btn-default" href={{ path('cadoles_core_config_registration') }}>Annuler</a>
|
||||
{% endif %}
|
||||
|
||||
@ -56,6 +60,19 @@
|
||||
{% endif %}
|
||||
|
||||
<div class="row">
|
||||
{% if mode=="send" %}
|
||||
<div class="col-sm-12">
|
||||
<div class="panel panel-primary">
|
||||
<div class="panel-heading">
|
||||
<i class="fa fa-key fa-fw"></i> Notes Administrateur
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
{{ form_widget(form.note) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{%endif%}
|
||||
|
||||
<div class="col-sm-6">
|
||||
<div class="panel panel-primary">
|
||||
<div class="panel-heading">
|
||||
@ -90,7 +107,13 @@
|
||||
<div class="panel-body">
|
||||
{% if form.firstname is defined %} {{ form_row(form.firstname) }} {% endif %}
|
||||
{{ form_row(form.lastname) }}
|
||||
{% if form.email is defined %} {{ form_row(form.email) }} {% endif %}
|
||||
{% if form.email is defined %}
|
||||
{{ form_row(form.email) }}
|
||||
<div class='alert alert-info alert-email' style='display:none; font-size: 80%;padding: 5px;margin-top: -10px;'>
|
||||
Votre mail ne fait pas partie des mails professonniels pré-inscrits dans {{app.session.get("appname")}}.<br>
|
||||
S'il s'agit de votre mail professionnel vous devez compléter le formulaire "Motivations" pour que l'administrateur de {{app.session.get("appname")}} valide votre demannde d'inscription.
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if form.visible is defined %} {{ form_row(form.visible) }} {% endif %}
|
||||
</div>
|
||||
</div>
|
||||
@ -196,6 +219,29 @@
|
||||
});
|
||||
});
|
||||
|
||||
$(document.body).on("focusout","#registration_email",function(){
|
||||
$.ajax({
|
||||
method: "POST",
|
||||
url: "{{ path('cadoles_core_ajax_iswhitelist') }}",
|
||||
data: {
|
||||
email:$("#registration_email").val(),
|
||||
},
|
||||
success: function(data) {
|
||||
if(data=="KO") {
|
||||
$("#registration_motivation").attr("required","required");
|
||||
$(".alert-email").show();
|
||||
$("label[for='registration_motivation']").text("Motivation *");
|
||||
}
|
||||
else {
|
||||
$("#registration_motivation").removeAttr("required");
|
||||
$(".alert-email").hide();
|
||||
$("label[for='registration_motivation']").text("Motivation");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function hideshow() {
|
||||
if($("#registration_birthcountry").val()==269)
|
||||
$("#blockcity").show();
|
||||
@ -207,10 +253,12 @@
|
||||
niveau01=$("#registration_niveau01 option:selected").text().toLowerCase();
|
||||
if(niveau01.startsWith("autre")) {
|
||||
$("#niveau01other").show();
|
||||
$("#registration_niveau01other").attr("required","required");
|
||||
}
|
||||
else {
|
||||
$("#registration_niveau01other").val("");
|
||||
$("#niveau01other").hide();
|
||||
$("#registration_niveau01other").removeAttr("required");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,13 +1,25 @@
|
||||
{% extends '@CadolesCore/base.html.twig' %}
|
||||
|
||||
{% block pagewrapper %}
|
||||
<h1 class="page-header">Inscriptions</h1>
|
||||
<h1 class="page-header">{%if infotitle is defined%}{{infotitle}}{%else%}Inscriptions{%endif%}</h1>
|
||||
|
||||
<div style="padding-top:50px;max-width: 1000px; margin:auto; font-size:18px;">
|
||||
<div class='alert alert-{{ mode }}' style='margin: 5px 0px'>
|
||||
{% autoescape %}
|
||||
<p>{{ info|raw }}</p>
|
||||
{% endautoescape %}
|
||||
|
||||
{% if mode=="error" %}
|
||||
{% if mode_auth == "SAML" %}
|
||||
<a class="btn btn-primary" href="{{ path("lightsaml_sp.logout") }}">Déconnexion</a>
|
||||
{% elseif mode_auth == "CAS" %}
|
||||
<a class="btn btn-primary" href="{{ path("cas_sp.logout") }}">Déconnexion</a>
|
||||
{% elseif mode_auth == "SQL" %}
|
||||
<a class="btn btn-primary" href="{{ path("cadoles_core_logout") }}">Déconnexion</a>
|
||||
{% elseif mode_auth == "LDAP" %}
|
||||
<a class="btn btn-primary" href="{{ path("cadoles_core_ldap_logout") }}">Déconnexion</a>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@ -18,7 +30,9 @@
|
||||
$(document).ready(function() {
|
||||
// Redirection vers la mire d'authentification
|
||||
setTimeout(function(){
|
||||
{% if mode_auth == "SAML" %}
|
||||
{% if redirectto is defined and redirectto is not null %}
|
||||
window.location.href="{{ redirectto }}";
|
||||
{% elseif mode_auth == "SAML" %}
|
||||
window.location.href="{{ path("lightsaml_sp.login") }}";
|
||||
{% elseif mode_auth == "CAS" %}
|
||||
window.location.href="{{ path("cas_sp.login") }}";
|
||||
@ -32,6 +46,5 @@
|
||||
}, 6000);
|
||||
});
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
<div class="panel panel-primary">
|
||||
<div class="panel-heading">
|
||||
<i class="fa fa-table fa-fw"></i> Compteur de visites journalière
|
||||
<i class="fa fa-table fa-fw"></i> Compteur de visites journalières
|
||||
</div>
|
||||
|
||||
<div class="panel-body">
|
||||
@ -15,7 +15,7 @@
|
||||
|
||||
<div class="panel panel-primary">
|
||||
<div class="panel-heading">
|
||||
<i class="fa fa-table fa-fw"></i> Compteur de visites journalière des groupes de travail
|
||||
<i class="fa fa-table fa-fw"></i> Compteur de visites journalières des groupes de travail
|
||||
</div>
|
||||
|
||||
<div class="panel-body">
|
||||
@ -27,7 +27,7 @@
|
||||
<div class="col col-md-6">
|
||||
<div class="panel panel-primary">
|
||||
<div class="panel-heading">
|
||||
<i class="fa fa-table fa-fw"></i> Evolution du nombre de message dans les tchat
|
||||
<i class="fa fa-table fa-fw"></i> Évolution du nombre de message dans les chats
|
||||
</div>
|
||||
|
||||
<div class="panel-body">
|
||||
@ -39,7 +39,7 @@
|
||||
<div class="col col-md-6">
|
||||
<div class="panel panel-primary">
|
||||
<div class="panel-heading">
|
||||
<i class="fa fa-table fa-fw"></i> Evolution du nombre d'articles de blog
|
||||
<i class="fa fa-table fa-fw"></i> Évolution du nombre d'articles de blog
|
||||
</div>
|
||||
|
||||
<div class="panel-body">
|
||||
|
@ -5,7 +5,7 @@
|
||||
<h1 class="page-header">
|
||||
{% if mode=="update" %}
|
||||
{% if access=="config" %}
|
||||
Modification Utilisateur
|
||||
Modification Utilisateur = {{ user.username}}
|
||||
{% else %}
|
||||
Profil
|
||||
{% endif %}
|
||||
@ -63,6 +63,19 @@
|
||||
<a class="btn btn-info" style="width:100%; margin-bottom:15px;" data-toggle="modal" data-target="#mymodal" onClick="ModalLoad('mymodal','Avatar','{{ path('cadoles_core_crop01') }}');" title='Ajouter un avatar'>Modifier</a>
|
||||
</div>
|
||||
|
||||
{% if access=="config" %}
|
||||
<div class="col-sm-12">
|
||||
<div class="panel panel-primary">
|
||||
<div class="panel-heading">
|
||||
<i class="fa fa-key fa-fw"></i> Notes Administrateur
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
{{ form_widget(form.note) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{%endif%}
|
||||
|
||||
<div class="col-sm-6">
|
||||
<div class="panel panel-primary">
|
||||
<div class="panel-heading">
|
||||
@ -169,12 +182,21 @@
|
||||
<tbody>
|
||||
{% for group in user.groups %}
|
||||
<tr id="linkgroup{{ group.group.id }}">
|
||||
{% if access=="config" and not group.group.fgall and group.group.ldapfilter=="" and group.group.attributes =="" %}
|
||||
<td><a style="cursor:pointer" title="Se Désinscrire"><i class="fa fa-sign-out fa-fw" onclick="removeLinkGroup({{ group.group.id }})"></i></a></td>
|
||||
{% elseif (group.group.fgopen or group.group.fgcanshare) and group.group.owner!=app.user and not group.group.fgall and group.group.ldapfilter=="" and group.group.attributes =="" %}
|
||||
<td><a style="cursor:pointer" title="Se Désinscrire"><i class="fa fa-sign-out fa-fw" onclick="removeLinkGroup({{ group.group.id }})"></i></a></td>
|
||||
{% set canleave = true %}
|
||||
{% if group.group.fgtemplate or group.group.fgall or group.group.owner==user %}
|
||||
{% set canleave = false %}
|
||||
{% elseif access!="config" %}
|
||||
{% if not group.group.fgcanshare and not group.group.fgopen %}
|
||||
{% set canleave = false %}
|
||||
{% elseif group.group.fgcanshare and not app.session.get('permunsubscribe') and not group.group.fgopen %}
|
||||
{% set canleave = false %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% if canleave %}
|
||||
<td><a style="cursor:pointer" title="Se Désinscrire"><i class="fa fa-sign-out-alt fa-fw" onclick="removeLinkGroup({{ group.group.id }})"></i></a></td>
|
||||
{% else %}
|
||||
<td></td>
|
||||
<td></td>
|
||||
{% endif %}
|
||||
|
||||
<td>
|
||||
|
@ -42,10 +42,10 @@ td { font-size: 10px; }
|
||||
{% if viewniveau02 %}
|
||||
<th class="no-sort {% if fields["niveau02"] is defined and fields["niveau02"].perm==0 %}no-visible{% endif %}">{{ labelniveau02 }}</th>
|
||||
{% endif %}
|
||||
<th class="no-sort {% if fields["group"] is defined and fields["group"].perm==0 %}no-visible{% endif %}">Groupes</th>
|
||||
<th class="no-sort {% if fields["group"] is defined and fields["group"].perm==0 and is_granted('ROLE_USER') %}no-visible{% endif %}">Groupes</th>
|
||||
<th class="{% if fields["job"] is defined and fields["job"].perm==0 %}no-visible{% endif %}">Métier</th>
|
||||
<th class="{% if fields["position"] is defined and fields["position"].perm==0 %}no-visible{% endif %}">Fonction</th>
|
||||
<th class="{% if fields["visitedate"] is defined and fields["visitedate"].perm==0 %}no-visible{% endif %}">Visite</th>
|
||||
<th class="{% if fields["visitedate"] is defined and fields["visitedate"].perm==0 and (is_granted('ROLE_USER') or is_granted('ROLE_ANIM')) %}no-visible{% endif %}">Visite</th>
|
||||
<th class="{% if fields["role"] is defined and fields["role"].perm==0 %}no-visible{% endif %}">Rôle</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
@ -11,28 +11,32 @@
|
||||
<br>L'utilisateur souhaite masquer ses informations personnelles.
|
||||
{% else %}
|
||||
{%if user.lastname %}<b>Nom</b> = {{ user.lastname }}<br>{%endif%}
|
||||
{%if user.firstname %}<b>Prénom</b> = {{ user.firstname }}<br>{%endif%}
|
||||
{%if user.firstname and not fields["firstname"]["perm"]==0 %}<b>{{fields["firstname"]["label"]}}</b> = {{ user.firstname }}<br>{%endif%}
|
||||
{%if user.email %}<b>Email</b> = <a href='mailto:{{ user.email }}'>{{ user.email }}</a><br>{%endif%}
|
||||
{%if user.telephonenumber %}<b>Téléphone</b> = {{ user.telephonenumber }}<br>{%endif%}
|
||||
{%if user.telephonenumber and not fields["telephonenumber"]["perm"]==0 %}<b>{{fields["telephonenumber"]["label"]}}</b> = {{ user.telephonenumber }}<br>{%endif%}
|
||||
{%if user.niveau01 %}<b>{{ labelniveau01 }}</b> = {{ user.niveau01.label }}<br>{%endif%}
|
||||
{%if viewniveau02 and user.niveau02%}<b>{{ labelniveau02 }}</b> = {{ user.niveau02.label }}<br>{% endif %}
|
||||
{%if user.job %}<b>Métier</b> = {{ user.job }}<br>{%endif%}
|
||||
{%if user.position %}<b>Fonction</b> = {{ user.position }}<br>{%endif%}
|
||||
{%if user.postaladress %}<b>Adresse</b> = {{ user.postaladress }}<br>{%endif%}
|
||||
{%if user.visitedate %}<b>Date de dernière visite</b> = {{ user.visitedate|date('d/m/Y H:i') }}<br>{%endif%}
|
||||
{%if user.visitecpt %}<b>Nombre de visites</b> = {{ user.visitecpt }}<br>{%endif%}
|
||||
<br>
|
||||
{% set fgtitle=false %}
|
||||
{% for usergroup in user.groups %}
|
||||
{% if usergroup.group.fgcanshare %}
|
||||
{% if not fgtitle %}
|
||||
<br><b>Groupes de Travail</b><br>
|
||||
{% set fgtitle=true %}
|
||||
{%if user.job and not fields["job"]["perm"]==0 %}<b>{{fields["position"]["job"]}}</b> = {{ user.job }}<br>{%endif%}
|
||||
{%if user.position and not fields["position"]["perm"]==0 %}<b>{{fields["position"]["label"]}}</b> = {{ user.position }}<br>{%endif%}
|
||||
{%if user.postaladress and not fields["postaladress"]["perm"]==0 %}<b>{{fields["postaladress"]["label"]}}</b> = {{ user.postaladress }}<br>{%endif%}
|
||||
|
||||
{%if user.visitedate and (not fields["visitedate"]["perm"]==0 or (not is_granted('ROLE_USER') and not is_granted('ROLE_ANIM'))) %}<b>Date de dernière visite</b> = {{ user.visitedate|date('d/m/Y H:i') }}<br>{%endif%}
|
||||
{%if user.visitecpt and (not fields["visitedate"]["perm"]==0 or (not is_granted('ROLE_USER') and not is_granted('ROLE_ANIM'))) %}<b>Nombre de visites</b> = {{ user.visitecpt }}<br>{%endif%}
|
||||
|
||||
{% if not fields["group"].perm==0 or not is_granted('ROLE_USER') %}
|
||||
<br>
|
||||
{% set fgtitle=false %}
|
||||
{% for usergroup in user.groups %}
|
||||
{% if usergroup.group.fgcanshare %}
|
||||
{% if not fgtitle %}
|
||||
<br><b>Groupes de Travail</b><br>
|
||||
{% set fgtitle=true %}
|
||||
{% endif %}
|
||||
|
||||
{{ usergroup.group.label }}<br>
|
||||
{% endif %}
|
||||
|
||||
{{ usergroup.group.label }}<br>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
@ -4,11 +4,11 @@
|
||||
{{ form_start(form) }}
|
||||
<h1 class="page-header">
|
||||
{% if mode=="update" %}
|
||||
Modification Liste Blanche
|
||||
Modification Liste Blanche = {{ whitelist.label }}
|
||||
{% elseif mode=="submit" %}
|
||||
Création Liste Blanche
|
||||
{% elseif mode=="delete" %}
|
||||
Suppression Liste Blanche
|
||||
Suppression Liste Blanche = {{ whitelist.label }}
|
||||
{% endif %}
|
||||
</h1>
|
||||
|
||||
|
@ -84,6 +84,10 @@
|
||||
{{ include('@CadolesCore/Include/menu.html.twig') }}
|
||||
{% endif %}
|
||||
</ul>
|
||||
|
||||
{% if app.user %}
|
||||
<div id="navbar-nameuser"><a href="{{ path('cadoles_core_user') }}" title="Profil">{{ app.user.firstname }} {{ app.user.lastname }}</a></div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
@ -106,6 +110,9 @@
|
||||
</div>
|
||||
|
||||
<ul class="nav navbar-top-links navbar-right">
|
||||
{% if app.user %}
|
||||
<a id="navbar-nameuser" href="{{ path('cadoles_core_user') }}" title="Profil">{{ app.user.firstname }} {{ app.user.lastname }}</a>
|
||||
{% endif %}
|
||||
{% if mustread is not defined %}
|
||||
{{ include('@CadolesCore/Include/menu.html.twig') }}
|
||||
{% endif %}
|
||||
|
@ -81,6 +81,7 @@ class samlUserCreatorService implements UserCreatorInterface
|
||||
$user->setAvatar("noavatar.png");
|
||||
$user->setVisible(true);
|
||||
$user->setAuthlevel("simple");
|
||||
$user->setBelongingpopulation("agent");
|
||||
$user->setRole("ROLE_USER");
|
||||
|
||||
// Création
|
||||
|
@ -145,7 +145,7 @@ class CronCommand extends ContainerAwareCommand
|
||||
if($cron->getRepeatcall()>0) $cron->setRepeatexec($cron->getRepeatexec()+1);
|
||||
|
||||
// Envoyer un mail à l'ensemble des administrateurs
|
||||
$this->sendMailerror();
|
||||
$this->sendMailerror($cron);
|
||||
}
|
||||
}
|
||||
|
||||
@ -161,7 +161,7 @@ class CronCommand extends ContainerAwareCommand
|
||||
}
|
||||
}
|
||||
|
||||
private function sendMailerror() {
|
||||
private function sendMailerror($cron) {
|
||||
$appname="";
|
||||
$config = $this->em->getRepository("CadolesCoreBundle:Config")->findOneBy(["id"=>"appname"]);
|
||||
if($config) $appname = $config->getValue();
|
||||
@ -184,8 +184,8 @@ class CronCommand extends ContainerAwareCommand
|
||||
|
||||
$mail_params=array(
|
||||
"subject" => $appname." : ERREUR SUR EXECUTION JOB",
|
||||
"body_html"=> "ATTENTION UN JOB EST EN ERREUR. MERCI DE VERIFIER LES LOGS.",
|
||||
"body_text"=> "ATTENTION UN JOB EST EN ERREUR. MERCI DE VERIFIER LES LOGS."
|
||||
"body_html"=> "ATTENTION UN JOB EST EN ERREUR. MERCI DE VERIFIER LES LOGS.<br>Command = ".$cron->getCommand()."<br>Description = ".$cron->getDescription(),
|
||||
"body_text"=> "ATTENTION UN JOB EST EN ERREUR. MERCI DE VERIFIER LES LOGS.\nCommand = ".$cron->getCommand()."\nDescription = ".$cron->getDescription()
|
||||
);
|
||||
|
||||
$message = $this->container->get('cadoles.core.service.mail');
|
||||
|
@ -39,6 +39,72 @@ use Cadoles\EdispatcherBundle\Entity\Datasource;
|
||||
|
||||
class ApiController extends Controller
|
||||
{
|
||||
|
||||
public function applicationsAction() {
|
||||
$itemcategorys = $this->getDoctrine()->getRepository('CadolesPortalBundle:Itemcategory')->findBy(
|
||||
[], ['rowOrder' => 'asc']);
|
||||
$groups = $this->getDoctrine()->getRepository('CadolesCoreBundle:Group')->findBy([], ['label' =>
|
||||
'asc']);
|
||||
foreach($itemcategorys as $itemcategory) {
|
||||
$items = $itemcategory->getItems();
|
||||
|
||||
foreach($items as $item) {
|
||||
$output = [];
|
||||
$output["id"] = $item->getId();
|
||||
$output["name"] = $item->getTitle();
|
||||
$output["libelle"] = $item->getSubtitle();
|
||||
$output["icon"] = $item->getIcon()?$item->getIcon()->getLabel():"default";
|
||||
$output["url"] = $item->getUrl();
|
||||
$output["profils"] = [];
|
||||
|
||||
foreach($item->getGroups() as $group) {
|
||||
$output["profils"]["groupes"][] = "NINEGATE|".$group->getLabel();
|
||||
}
|
||||
foreach($item->getRoles() as $role) {
|
||||
$output["profils"]["roles"][] = "NINEGATE|".$role;
|
||||
}
|
||||
if ($item->getSsoitem()!="") $output["profils"]["SSOITEM"] = $item->getSsoitem();
|
||||
$reponse[$item->getTitle()] = $output;
|
||||
}
|
||||
}
|
||||
|
||||
return new Response(json_encode($reponse), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function checkuserAction() {
|
||||
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
|
||||
$request = $this->container->get('request_stack')->getCurrentRequest();
|
||||
$id = $request->query->get('id',false);
|
||||
|
||||
if ($id) {
|
||||
|
||||
$user=$em->getRepository('CadolesCoreBundle:User')->findOneBy(["username"=>$id]);
|
||||
|
||||
if (!$user) {
|
||||
$output["error"]="id=".$id." : user not found";
|
||||
return new Response(json_encode($output), 400);
|
||||
}
|
||||
$output["username"] = $user->getUsername();
|
||||
$output["firstname"] = $user->getFirstname();
|
||||
$output["lastname"] = $user->getLastname();
|
||||
$output["email"] = $user->getEmail();
|
||||
$output["role"] = $user->getRole();
|
||||
foreach($user->getGroups() as $group) {
|
||||
$output["groupes"][] = $group->getGroup()->getLabel();
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
$output["error"]="id needed";
|
||||
return new Response(json_encode($output), 404);
|
||||
|
||||
}
|
||||
return new Response(json_encode($output), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
|
||||
public function testAction() {
|
||||
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
@ -134,7 +200,8 @@ class ApiController extends Controller
|
||||
$bookmarks=null;
|
||||
$items=null;
|
||||
$itemcategorys=null;
|
||||
$weburl="https://".$this->getParameter("weburl")."/".$this->getParameter("alias")."/";
|
||||
# fixe #31884 "https://" => "//"
|
||||
$weburl="//".$this->getParameter("weburl")."/".$this->getParameter("alias")."/";
|
||||
|
||||
$em->getRepository("CadolesPortalBundle:Item")->getUserItems($user,$bookmarks,$items,$itemcategorys,null,$ssoitems,3);
|
||||
|
||||
@ -607,10 +674,10 @@ $api('$id',data);";
|
||||
}
|
||||
|
||||
public function sessionAction($id="",$access="config") {
|
||||
// Masteridentity
|
||||
$masteridentity=$this->getParameter("masteridentity");
|
||||
if($masteridentity!="SSO") {
|
||||
$output["error"]="Le bundle Edispatcher ne fonctionne qu'en mode MasterIdentity=SSO";
|
||||
// mode_auth
|
||||
$mode_auth=$this->getParameter("mode_auth");
|
||||
if($mode_auth!="CAS") {
|
||||
$output["error"]="Le bundle Edispatcher ne fonctionne qu'en mode mode_auth=CAS";
|
||||
return new Response(json_encode($output), 400);
|
||||
}
|
||||
|
||||
@ -663,6 +730,7 @@ $api('$id',data);";
|
||||
$user->setAvatar("noavatar.png");
|
||||
$user->setVisible(true);
|
||||
$user->setAuthlevel("simple");
|
||||
$user->setBelongingpopulation("agent");
|
||||
$user->setRole("ROLE_USER");
|
||||
|
||||
if(in_array($username,$this->getParameter("ldap_usersadmin")))
|
||||
|
@ -24,7 +24,7 @@ class Datasource
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=50, unique=true)
|
||||
* @ORM\Column(type="string", length=128, unique=true)
|
||||
*/
|
||||
private $username;
|
||||
|
||||
|
@ -12,6 +12,10 @@ div.header {
|
||||
position: relative !important;
|
||||
}
|
||||
|
||||
#navbar-nameuser a {
|
||||
color: var(--main, #004d9a) !important;
|
||||
}
|
||||
|
||||
div.header > a > span {
|
||||
color: black !important;
|
||||
}
|
||||
|
@ -25,6 +25,14 @@ cadoles_edispatcher_api_public_hello:
|
||||
path: /edispatcher/api/public/hello
|
||||
defaults: { _controller: CadolesEdispatcherBundle:Api:hello }
|
||||
|
||||
cadoles_edispatcher_api_applications:
|
||||
path: /edispatcher/api/applications
|
||||
defaults: { _controller: CadolesEdispatcherBundle:Api:applications }
|
||||
|
||||
cadoles_edispatcher_api_checkuser:
|
||||
path: /edispatcher/api/checkuser
|
||||
defaults: { _controller: CadolesEdispatcherBundle:Api:checkuser }
|
||||
|
||||
cadoles_edispatcher_api_apps_all:
|
||||
path: /edispatcher/api/apps/all
|
||||
defaults: { _controller: CadolesEdispatcherBundle:Api:hello }
|
||||
|
@ -407,6 +407,7 @@ class GetLimesurveyCommand extends Command
|
||||
foreach($surveys as $survey) {
|
||||
// Si le sondage est actif
|
||||
if($survey["active"]=="Y") {
|
||||
$this->writeln("SURVEY = ".$survey["surveyls_title"]);
|
||||
|
||||
// Liste des participants
|
||||
$survey_id=$survey["sid"];
|
||||
@ -415,6 +416,8 @@ class GetLimesurveyCommand extends Command
|
||||
|
||||
foreach($users as $user) {
|
||||
if(isset($user["participant_info"]["email"]) && $user["participant_info"]["email"]!="") {
|
||||
$this->writeln("EMAIL = ".$user["participant_info"]["email"]);
|
||||
|
||||
$entity = $this->em->getRepository('CadolesCoreBundle:User')->findOneBy(["email"=>$user["participant_info"]["email"]]);
|
||||
if($entity) {
|
||||
$surveypropconf = $myJSONRPCClient->get_survey_properties($sessionKey,$survey["sid"],["datecreated"]);
|
||||
|
@ -43,6 +43,7 @@ class InitDataCommand extends ContainerAwareCommand
|
||||
|
||||
$activate_widadminer = $this->getContainer()->getParameter('activate_widadminer');
|
||||
$activate_widbalado = $this->getContainer()->getParameter('activate_widbalado');
|
||||
$activate_widcdt = $this->getContainer()->getParameter('activate_widcdt');
|
||||
$activate_widdokuwiki = $this->getContainer()->getParameter('activate_widdokuwiki');
|
||||
$activate_wideconnect = $this->getContainer()->getParameter('activate_wideconnect');
|
||||
$activate_widead = $this->getContainer()->getParameter('activate_widead');
|
||||
@ -380,7 +381,7 @@ class InitDataCommand extends ContainerAwareCommand
|
||||
$entityItem->setId(-394);
|
||||
$entityItem->setRowOrder(0);
|
||||
$entityItem->setTitle('Adminer');
|
||||
$entityItem->SetSubtitle("Gestionnaire de Bases de Données");
|
||||
$entityItem->setSubtitle("Gestionnaire de Bases de Données");
|
||||
$entityItem->setIcon($entityicon);
|
||||
$entityItem->setTarget("_blank");
|
||||
$entityItem->setItemcategory($entityItemcategoryadm);
|
||||
@ -402,7 +403,8 @@ class InitDataCommand extends ContainerAwareCommand
|
||||
$entityItem->setId(-377);
|
||||
$entityItem->setRowOrder(0);
|
||||
$entityItem->setTitle('Balado');
|
||||
$entityItem->SetSubtitle("Enregistrement en ligne et partage ses enregistrements");
|
||||
$entityItem->setSubtitle("Interactions orales et écrites en ligne avec possibilité d’enregistrement audio intégré");
|
||||
$entityItem->SetContent("Balad((o)) permet d’interagir avec les élèves en leur proposant une activité en ligne avec texte, image, audio déposé ou enregistré en ligne, vidéo déposée ou intégrée, documents joints.<br>Les élèves peuvent répondre en ligne avec texte, image, audio déposé ou enregistré en ligne, vidéo déposée ou intégrée, documents joints.<br>L’enseignant peut ensuite consulter en ligne les travaux rendus par les élèves, mais pas encore les annoter individuellement.");
|
||||
$entityItem->setIcon($entityicon);
|
||||
$entityItem->setTarget("_blank");
|
||||
$entityItem->setItemcategory($entityItemcategoryapp);
|
||||
@ -413,6 +415,29 @@ class InitDataCommand extends ContainerAwareCommand
|
||||
$em->persist($entityItem);
|
||||
}
|
||||
|
||||
// Item CdT
|
||||
if($activate_widcdt) {
|
||||
$widcdt_url =$this->getContainer()->getParameter('widcdt_url');
|
||||
$entityItem = $em->getRepository('CadolesPortalBundle:Item')->find(-391);
|
||||
if(!$entityItem) {
|
||||
$entityicon = $em->getRepository('CadolesPortalBundle:Icon')->findoneby(["label"=>"uploads/icon/icon_cdt.png"]);
|
||||
|
||||
$entityItem = new Item();
|
||||
$entityItem->setId(-391);
|
||||
$entityItem->setRowOrder(0);
|
||||
$entityItem->setTitle('CdT');
|
||||
$entityItem->setSubtitle("Application complète de gestion de cahier de texte scolaire");
|
||||
$entityItem->SetContent("Application complète de gestion de cahier de texte scolaire");
|
||||
$entityItem->setIcon($entityicon);
|
||||
$entityItem->setTarget("_blank");
|
||||
$entityItem->setItemcategory($entityItemcategoryapp);
|
||||
$entityItem->setEssential(true);
|
||||
$entityItem->addGroup($groupall);
|
||||
}
|
||||
$entityItem->setUrl($widcdt_url);
|
||||
$em->persist($entityItem);
|
||||
}
|
||||
|
||||
// Item Dokuwiki
|
||||
if($activate_widdokuwiki) {
|
||||
$widdokuwiki_url =$this->getContainer()->getParameter('widdokuwiki_url');
|
||||
@ -424,7 +449,8 @@ class InitDataCommand extends ContainerAwareCommand
|
||||
$entityItem->setId(-399);
|
||||
$entityItem->setRowOrder(0);
|
||||
$entityItem->setTitle('Dokuwiki');
|
||||
$entityItem->SetSubtitle("Création de documentations de toute sorte");
|
||||
$entityItem->setSubtitle("Base de connaissances sous forme d’un wiki");
|
||||
$entityItem->SetContent("Le wiki permet de mettre du contenu classé par catégories.<br>Sur chaque catégorie et sur chaque page, des droits de lecture, modification, suppression peuvent être affectés à des utilisateurs ou des groupes d’utilisateurs.<br>En établissement, le wiki peut être utilisé comme base de connaissances en intranet / extranet professionnel ou comme support pédagogique d’écriture collaborative.");
|
||||
$entityItem->setIcon($entityicon);
|
||||
$entityItem->setTarget("_blank");
|
||||
$entityItem->setItemcategory($entityItemcategoryapp);
|
||||
@ -446,7 +472,7 @@ class InitDataCommand extends ContainerAwareCommand
|
||||
$entityItem->setId(-376);
|
||||
$entityItem->setRowOrder(0);
|
||||
$entityItem->setTitle('Econnect');
|
||||
$entityItem->SetSubtitle("Gestion de connecteurs vers d'autres applications");
|
||||
$entityItem->setSubtitle("Gestion de connecteurs vers d'autres applications");
|
||||
$entityItem->setIcon($entityicon);
|
||||
$entityItem->setTarget("_blank");
|
||||
$entityItem->setItemcategory($entityItemcategoryapp);
|
||||
@ -468,7 +494,7 @@ class InitDataCommand extends ContainerAwareCommand
|
||||
$entityItem->setId(-393);
|
||||
$entityItem->setRowOrder(0);
|
||||
$entityItem->setTitle('EAD');
|
||||
$entityItem->SetSubtitle("Console d'administration du serveur scribe");
|
||||
$entityItem->setSubtitle("Console d'administration du serveur scribe");
|
||||
$entityItem->setIcon($entityicon);
|
||||
$entityItem->setTarget("_blank");
|
||||
$entityItem->setItemcategory($entityItemcategoryadm);
|
||||
@ -489,8 +515,9 @@ class InitDataCommand extends ContainerAwareCommand
|
||||
$entityItem = new Item();
|
||||
$entityItem->setId(-370);
|
||||
$entityItem->setRowOrder(0);
|
||||
$entityItem->setTitle('EOE');
|
||||
$entityItem->SetSubtitle("EOLE Outils Elève");
|
||||
$entityItem->setTitle('Outils Élève');
|
||||
$entityItem->setSubtitle("EOLE Outils Elève<br>(EOE)");
|
||||
$entityItem->setContent("EOLE Outils Élève (EOE) permet à l’élève en particulier de changer son mot de passe d’accès, dans l’objectif de maîtriser son identité numérique sur l’ENT.");
|
||||
$entityItem->setIcon($entityicon);
|
||||
$entityItem->setTarget("_blank");
|
||||
$entityItem->setItemcategory($entityItemcategoryapp);
|
||||
@ -511,8 +538,9 @@ class InitDataCommand extends ContainerAwareCommand
|
||||
$entityItem = new Item();
|
||||
$entityItem->setId(-371);
|
||||
$entityItem->setRowOrder(0);
|
||||
$entityItem->setTitle('EOP');
|
||||
$entityItem->SetSubtitle("EOLE Outils Professeur");
|
||||
$entityItem->setTitle('Outils Professeur');
|
||||
$entityItem->setSubtitle("EOLE Outils Professeur<br>(EOP)");
|
||||
$entityItem->setContent("Parmi les outils disponibles dans EOLE Outils Professeur (EOP) :<br>Changement de mot de passe local (Scribe) utilisé sur les postes en établissement<br>Changer le mot de passe des élèves (uniquement pour les professeurs principaux)<br>Distribuer des documents / devoirs à des classes et groupes à l’aide du dossier « perso » de l’enseignant et de chaque élève. Cette application est adaptée à un fonctionnement synchrone en établissement, un peu moins en distanciel asynchrone.");
|
||||
$entityItem->setIcon($entityicon);
|
||||
$entityItem->setTarget("_blank");
|
||||
$entityItem->setItemcategory($entityItemcategoryapp);
|
||||
@ -534,7 +562,8 @@ class InitDataCommand extends ContainerAwareCommand
|
||||
$entityItem->setId(-382);
|
||||
$entityItem->setRowOrder(0);
|
||||
$entityItem->setTitle('Etherhome');
|
||||
$entityItem->SetSubtitle("Gestion de vos pads et de vos calcs collaboratifs");
|
||||
$entityItem->setSubtitle("Accès aux pads, calcs et scrums");
|
||||
$entityItem->setContent("Etherhome permet de créer, partager et accéder aux pads (textes), calcs (tableaux) et scrums (murs de textes).<br>Les pads et calcs sont des supports de travail collaboratif synchrone ou asynchrone, à reprendre éventuellement ensuite dans un traitement de textes ou un tableur ou un logiciel de présentation.");
|
||||
$entityItem->setIcon($entityicon);
|
||||
$entityItem->setTarget("_blank");
|
||||
$entityItem->setItemcategory($entityItemcategoryapp);
|
||||
@ -556,7 +585,8 @@ class InitDataCommand extends ContainerAwareCommand
|
||||
$entityItem->setId(-397);
|
||||
$entityItem->setRowOrder(0);
|
||||
$entityItem->setTitle('Fluxbb');
|
||||
$entityItem->SetSubtitle("Forum");
|
||||
$entityItem->setSubtitle("Forum");
|
||||
$entityItem->setContent("Forum avec gestion des droits des utilisateurs.");
|
||||
$entityItem->setIcon($entityicon);
|
||||
$entityItem->setTarget("_blank");
|
||||
$entityItem->setItemcategory($entityItemcategoryapp);
|
||||
@ -578,7 +608,7 @@ class InitDataCommand extends ContainerAwareCommand
|
||||
$entityItem->setId(-368);
|
||||
$entityItem->setRowOrder(0);
|
||||
$entityItem->setTitle('Genconfig');
|
||||
$entityItem->SetSubtitle("Console de configuration du serveur");
|
||||
$entityItem->setSubtitle("Console de configuration du serveur");
|
||||
$entityItem->setIcon($entityicon);
|
||||
$entityItem->setTarget("_blank");
|
||||
$entityItem->setItemcategory($entityItemcategoryadm);
|
||||
@ -600,7 +630,7 @@ class InitDataCommand extends ContainerAwareCommand
|
||||
$entityItem->setId(-389);
|
||||
$entityItem->setRowOrder(0);
|
||||
$entityItem->setTitle('GEPI');
|
||||
$entityItem->SetSubtitle("Intégration du logiciel de gestion des notes, absences, cahier de texte");
|
||||
$entityItem->setSubtitle("Intégration du logiciel de gestion des notes, absences, cahier de texte");
|
||||
$entityItem->setIcon($entityicon);
|
||||
$entityItem->setTarget("_blank");
|
||||
$entityItem->setItemcategory($entityItemcategoryapp);
|
||||
@ -622,7 +652,7 @@ class InitDataCommand extends ContainerAwareCommand
|
||||
$entityItem->setId(-388);
|
||||
$entityItem->setRowOrder(0);
|
||||
$entityItem->setTitle('GLPI');
|
||||
$entityItem->SetSubtitle("Gestion de tickets");
|
||||
$entityItem->setSubtitle("Gestion de tickets");
|
||||
$entityItem->setIcon($entityicon);
|
||||
$entityItem->setTarget("_blank");
|
||||
$entityItem->setItemcategory($entityItemcategoryapp);
|
||||
@ -644,7 +674,8 @@ class InitDataCommand extends ContainerAwareCommand
|
||||
$entityItem->setId(-388);
|
||||
$entityItem->setRowOrder(0);
|
||||
$entityItem->setTitle('Grr');
|
||||
$entityItem->SetSubtitle("Gestion et de Réservations de Ressources");
|
||||
$entityItem->setSubtitle("Gestion et de Réservations de Ressources");
|
||||
$entityItem->setContent("GRR permet de réserver des ressources disponibles dans l’établissement : salles, matériels, etc.");
|
||||
$entityItem->setIcon($entityicon);
|
||||
$entityItem->setTarget("_blank");
|
||||
$entityItem->setItemcategory($entityItemcategoryapp);
|
||||
@ -666,7 +697,7 @@ class InitDataCommand extends ContainerAwareCommand
|
||||
$entityItem->setId(-363);
|
||||
$entityItem->setRowOrder(0);
|
||||
$entityItem->setTitle('Kanboard');
|
||||
$entityItem->SetSubtitle("Gestion de Projets");
|
||||
$entityItem->setSubtitle("Gestion de rojets");
|
||||
$entityItem->setIcon($entityicon);
|
||||
$entityItem->setTarget("_blank");
|
||||
$entityItem->setItemcategory($entityItemcategoryapp);
|
||||
@ -688,7 +719,8 @@ class InitDataCommand extends ContainerAwareCommand
|
||||
$entityItem->setId(-374);
|
||||
$entityItem->setRowOrder(0);
|
||||
$entityItem->setTitle('Limesurvey');
|
||||
$entityItem->SetSubtitle("Application de sondage");
|
||||
$entityItem->setSubtitle("Gestion d’enquêtes");
|
||||
$entityItem->setContent("Limesurvey permet de créer des enquêtes en ligne avec différents formats de réponses : texte, nombre, choix multiple avec réponse unique ou non, etc.<br>Chaque enquête peut être adressée :<br>soit à des utilisateurs ou groupes par invitation individuelle, ce qui permet d’éviter les doubles réponses<br>soit de manière anonyme par un lien public");
|
||||
$entityItem->setIcon($entityicon);
|
||||
$entityItem->setTarget("_blank");
|
||||
$entityItem->setItemcategory($entityItemcategoryapp);
|
||||
@ -710,7 +742,8 @@ class InitDataCommand extends ContainerAwareCommand
|
||||
$entityItem->setId(-369);
|
||||
$entityItem->setRowOrder(0);
|
||||
$entityItem->setTitle('Mindmaps');
|
||||
$entityItem->SetSubtitle("Carte Mentale");
|
||||
$entityItem->setSubtitle("Carte Mentale");
|
||||
$entityItem->setContent("Carte mentale simple, enregistrable mais non collaborative.");
|
||||
$entityItem->setIcon($entityicon);
|
||||
$entityItem->setTarget("_blank");
|
||||
$entityItem->setItemcategory($entityItemcategoryapp);
|
||||
@ -732,7 +765,8 @@ class InitDataCommand extends ContainerAwareCommand
|
||||
$entityItem->setId(-387);
|
||||
$entityItem->setRowOrder(0);
|
||||
$entityItem->setTitle('Moodle');
|
||||
$entityItem->SetSubtitle("Application de eLearning");
|
||||
$entityItem->setSubtitle("Cours en ligne");
|
||||
$entityItem->setContent("Plateforme d’apprentissage en ligne (« e-learning ») où l’enseignant peut mettre à disposition :<br>- des ressources à consulter : textes en ligne, documents joints, vidéos intégrées, etc.<br>- des activités : devoirs à rendre, tests auto-évalués, glossaire collaboratif, activités multimédia H5P, etc.");
|
||||
$entityItem->setIcon($entityicon);
|
||||
$entityItem->setTarget("_blank");
|
||||
$entityItem->setItemcategory($entityItemcategoryapp);
|
||||
@ -754,7 +788,8 @@ class InitDataCommand extends ContainerAwareCommand
|
||||
$entityItem->setId(-366);
|
||||
$entityItem->setRowOrder(0);
|
||||
$entityItem->setTitle('Nextcloud');
|
||||
$entityItem->SetSubtitle("Stockage de Fichiers");
|
||||
$entityItem->setSubtitle("Dépôt et partage de fichiers");
|
||||
$entityItem->setContent("Nextcloud permet de déposer des fichiers, organisés dans des dossiers.<br>Ces dossiers et fichiers peuvent être partagés avec des droits de lecture et/ou de modification / suppression :<br>Soit avec des utilisateurs ou groupes d’utilisateurs<br>Soit de manière anonyme avec un lien public, paramétrable (durée, mot de passe)");
|
||||
$entityItem->setIcon($entityicon);
|
||||
$entityItem->setTarget("_blank");
|
||||
$entityItem->setItemcategory($entityItemcategoryapp);
|
||||
@ -776,7 +811,8 @@ class InitDataCommand extends ContainerAwareCommand
|
||||
$entityItem->setId(-361);
|
||||
$entityItem->setRowOrder(0);
|
||||
$entityItem->setTitle('Nineboard');
|
||||
$entityItem->SetSubtitle("Gestionnaire de tableau de bord collaboratif");
|
||||
$entityItem->setSubtitle("Accès aux pads, calcs, scrums, whiteboards, timelines et mindmaps");
|
||||
$entityItem->setContent("Nineboard permet de créer, partager et accéder aux pads (textes), calcs (tableaux), scrums (murs de textes en colonne), whiteboards (murs de textes libre), timelines (frises temporelles) et mindmaps (cartes mentales)<br>Les pads et calcs sont des supports de travail collaboratif synchrone ou asynchrone, à reprendre éventuellement ensuite dans un traitement de textes ou un tableur ou un logiciel de présentation.");
|
||||
$entityItem->setIcon($entityicon);
|
||||
$entityItem->setTarget("_blank");
|
||||
$entityItem->setItemcategory($entityItemcategoryapp);
|
||||
@ -798,7 +834,7 @@ class InitDataCommand extends ContainerAwareCommand
|
||||
$entityItem->setId(-1001);
|
||||
$entityItem->setRowOrder(0);
|
||||
$entityItem->setTitle('Nineschool');
|
||||
$entityItem->SetSubtitle("Gestionnaire d'activités scolaire'");
|
||||
$entityItem->setSubtitle("Gestionnaire d'activités scolaire'");
|
||||
$entityItem->setIcon($entityicon);
|
||||
$entityItem->setTarget("_blank");
|
||||
$entityItem->setItemcategory($entityItemcategoryapp);
|
||||
@ -820,7 +856,7 @@ class InitDataCommand extends ContainerAwareCommand
|
||||
$entityItem->setId(-1002);
|
||||
$entityItem->setRowOrder(0);
|
||||
$entityItem->setTitle('Ninesurvey');
|
||||
$entityItem->SetSubtitle("Application de Sondage par Date");
|
||||
$entityItem->setSubtitle("Application de Sondage par Date");
|
||||
$entityItem->setIcon($entityicon);
|
||||
$entityItem->setTarget("_blank");
|
||||
$entityItem->setItemcategory($entityItemcategoryapp);
|
||||
@ -842,7 +878,7 @@ class InitDataCommand extends ContainerAwareCommand
|
||||
$entityItem->setId(-1000);
|
||||
$entityItem->setRowOrder(0);
|
||||
$entityItem->setTitle('Onlyoffice');
|
||||
$entityItem->SetSubtitle("Application Bureautique");
|
||||
$entityItem->setSubtitle("Application Bureautique");
|
||||
$entityItem->setIcon($entityicon);
|
||||
$entityItem->setTarget("_blank");
|
||||
$entityItem->setItemcategory($entityItemcategoryapp);
|
||||
@ -864,7 +900,7 @@ class InitDataCommand extends ContainerAwareCommand
|
||||
$entityItem->setId(-383);
|
||||
$entityItem->setRowOrder(0);
|
||||
$entityItem->setTitle('Opensondage');
|
||||
$entityItem->SetSubtitle("Application de Sondage par Date");
|
||||
$entityItem->setSubtitle("Création de sondage à réponse simple ou pour le choix d’une date");
|
||||
$entityItem->setIcon($entityicon);
|
||||
$entityItem->setTarget("_blank");
|
||||
$entityItem->setItemcategory($entityItemcategoryapp);
|
||||
@ -886,7 +922,7 @@ class InitDataCommand extends ContainerAwareCommand
|
||||
$entityItem->setId(-362);
|
||||
$entityItem->setRowOrder(0);
|
||||
$entityItem->setTitle('PhpLdapAdmin');
|
||||
$entityItem->SetSubtitle("Gestionnaire d’annuaire LDAP");
|
||||
$entityItem->setSubtitle("Gestionnaire d’annuaire LDAP");
|
||||
$entityItem->setIcon($entityicon);
|
||||
$entityItem->setTarget("_blank");
|
||||
$entityItem->setItemcategory($entityItemcategoryadm);
|
||||
@ -897,7 +933,7 @@ class InitDataCommand extends ContainerAwareCommand
|
||||
$em->persist($entityItem);
|
||||
}
|
||||
|
||||
// Item piwigo
|
||||
// Item Piwigo
|
||||
if($activate_widpiwigo) {
|
||||
$widpiwigo_url =$this->getContainer()->getParameter('widpiwigo_url');
|
||||
$entityItem = $em->getRepository('CadolesPortalBundle:Item')->find(-396);
|
||||
@ -908,7 +944,7 @@ class InitDataCommand extends ContainerAwareCommand
|
||||
$entityItem->setId(-396);
|
||||
$entityItem->setRowOrder(0);
|
||||
$entityItem->setTitle('Piwigo');
|
||||
$entityItem->SetSubtitle("Gestionnaire d’albums photos");
|
||||
$entityItem->setSubtitle("Gestionnaire d’albums photos");
|
||||
$entityItem->setIcon($entityicon);
|
||||
$entityItem->setTarget("_blank");
|
||||
$entityItem->setItemcategory($entityItemcategoryapp);
|
||||
@ -930,7 +966,7 @@ class InitDataCommand extends ContainerAwareCommand
|
||||
$entityItem->setId(-380);
|
||||
$entityItem->setRowOrder(0);
|
||||
$entityItem->setTitle('Piwik');
|
||||
$entityItem->SetSubtitle("Application de Statistique de Visite");
|
||||
$entityItem->setSubtitle("Mesures d’audience du portail");
|
||||
$entityItem->setIcon($entityicon);
|
||||
$entityItem->setTarget("_blank");
|
||||
$entityItem->setItemcategory($entityItemcategoryadm);
|
||||
@ -952,7 +988,8 @@ class InitDataCommand extends ContainerAwareCommand
|
||||
$entityItem->setId(-398);
|
||||
$entityItem->setRowOrder(0);
|
||||
$entityItem->setTitle('Roundcube');
|
||||
$entityItem->SetSubtitle("Webmail");
|
||||
$entityItem->setSubtitle("Messagerie");
|
||||
$entityItem->setContent("Messagerie permettant la communication sécurisée par méls. La messagerie n’a pas pour but d’envoyer des gros fichiers mais plutôt de communiquer des informations, des liens.");
|
||||
$entityItem->setIcon($entityicon);
|
||||
$entityItem->setTarget("_blank");
|
||||
$entityItem->setItemcategory($entityItemcategoryapp);
|
||||
@ -960,6 +997,12 @@ class InitDataCommand extends ContainerAwareCommand
|
||||
$entityItem->addGroup($groupall);
|
||||
}
|
||||
$entityItem->setUrl($widroundcube_url);
|
||||
|
||||
if($this->getContainer()->getParameter('cas_type')=="proxy")
|
||||
$entityItem->setBadgeurl("/ninegate/cas/imapunread");
|
||||
else
|
||||
$entityItem->setBadgeurl(null);
|
||||
|
||||
$em->persist($entityItem);
|
||||
}
|
||||
|
||||
@ -974,7 +1017,7 @@ class InitDataCommand extends ContainerAwareCommand
|
||||
$entityItem->setId(-372);
|
||||
$entityItem->setRowOrder(0);
|
||||
$entityItem->setTitle('Sacoche');
|
||||
$entityItem->SetSubtitle("Evaluation de compétences");
|
||||
$entityItem->setSubtitle("Evaluation de compétences");
|
||||
$entityItem->setIcon($entityicon);
|
||||
$entityItem->setTarget("_blank");
|
||||
$entityItem->setItemcategory($entityItemcategoryapp);
|
||||
@ -996,7 +1039,8 @@ class InitDataCommand extends ContainerAwareCommand
|
||||
$entityItem->setId(-400);
|
||||
$entityItem->setRowOrder(0);
|
||||
$entityItem->setTitle('Wordpress');
|
||||
$entityItem->SetSubtitle("Application de Blog");
|
||||
$entityItem->setSubtitle("Sites ou blogs en intranet ou sur internet");
|
||||
$entityItem->setContent("Avec la plateforme Wordpress, sur demande, un administrateur peut créer des blogs ou sites.<br>Pour chaque blog ou site, des droits peuvent être donnés aux utilisateurs :<br>Qui peut écrire des articles ?<br>Qui peut valider ces articles ?<br>Qui peut consulter ces articles ? (le blog peut aussi être rendu visible publiquement sur internet)<br>");
|
||||
$entityItem->setIcon($entityicon);
|
||||
$entityItem->setTarget("_blank");
|
||||
$entityItem->setItemcategory($entityItemcategoryapp);
|
||||
@ -1011,15 +1055,15 @@ class InitDataCommand extends ContainerAwareCommand
|
||||
//== WIDGET ============================================================================================================================================
|
||||
$output->writeln(' > Creation Widget');
|
||||
|
||||
// Widget URL
|
||||
// Widget Page web
|
||||
$entityWidget = $em->getRepository('CadolesPortalBundle:Widget')->find(-2000);
|
||||
if(!$entityWidget) $entityWidget = new Widget();
|
||||
$entityicon = $em->getRepository('CadolesPortalBundle:Icon')->findoneby(["label"=>"uploads/icon/icon_ribbon.png"]);
|
||||
$entityWidget->setId(-2000);
|
||||
$entityWidget->setRoworder(0);
|
||||
$entityWidget->setIcon($entityicon);
|
||||
$entityWidget->setName('URL');
|
||||
$entityWidget->setDescription("Affiche le contenu d'une url");
|
||||
$entityWidget->setName('Page web');
|
||||
$entityWidget->setDescription("Affiche le contenu d'une page web");
|
||||
$entityWidget->setRouteview("cadoles_portal_config_panelwidget_view_url");
|
||||
$entityWidget->setHeight("630");
|
||||
$entityWidget->setAutoajust(false);
|
||||
@ -1091,15 +1135,15 @@ class InitDataCommand extends ContainerAwareCommand
|
||||
$em->persist($entityWidget);
|
||||
|
||||
|
||||
// Widget Favoris
|
||||
// Widget Liens
|
||||
$entityWidget = $em->getRepository('CadolesPortalBundle:Widget')->find(-1960);
|
||||
if(!$entityWidget) $entityWidget = new Widget();
|
||||
$entityicon = $em->getRepository('CadolesPortalBundle:Icon')->findoneby(["label"=>"uploads/icon/icon_star.png"]);
|
||||
$entityWidget->setId(-1960);
|
||||
$entityWidget->setRoworder(0);
|
||||
$entityWidget->setIcon($entityicon);
|
||||
$entityWidget->setName('Favoris');
|
||||
$entityWidget->setDescription("Création de Favoris");
|
||||
$entityWidget->setName('Liens');
|
||||
$entityWidget->setDescription("Bibliothèque de Liens");
|
||||
$entityWidget->setRouteview("cadoles_portal_config_panelwidget_view_bookmark");
|
||||
$entityWidget->setHeight("630");
|
||||
$entityWidget->setAutoajust(true);
|
||||
@ -1111,7 +1155,7 @@ class InitDataCommand extends ContainerAwareCommand
|
||||
$em->persist($entityWidget);
|
||||
|
||||
|
||||
// Widget Liens
|
||||
// Widget Lien
|
||||
$entityWidget = $em->getRepository('CadolesPortalBundle:Widget')->find(-1950);
|
||||
if(!$entityWidget) $entityWidget = new Widget();
|
||||
$entityicon = $em->getRepository('CadolesPortalBundle:Icon')->findoneby(["label"=>"uploads/icon/icon_bolt.png"]);
|
||||
@ -1119,7 +1163,7 @@ class InitDataCommand extends ContainerAwareCommand
|
||||
$entityWidget->setRoworder(0);
|
||||
$entityWidget->setIcon($entityicon);
|
||||
$entityWidget->setName('Lien');
|
||||
$entityWidget->setDescription("Création d'un Lien");
|
||||
$entityWidget->setDescription("Création d'un Lien unique");
|
||||
$entityWidget->setRouteview("cadoles_portal_config_panelwidget_view_link");
|
||||
$entityWidget->setHeight("200");
|
||||
$entityWidget->setAutoajust(true);
|
||||
@ -1131,14 +1175,14 @@ class InitDataCommand extends ContainerAwareCommand
|
||||
$em->persist($entityWidget);
|
||||
|
||||
|
||||
// Widget Editor
|
||||
// Widget Texte
|
||||
$entityWidget = $em->getRepository('CadolesPortalBundle:Widget')->find(-1940);
|
||||
if(!$entityWidget) $entityWidget = new Widget();
|
||||
$entityicon = $em->getRepository('CadolesPortalBundle:Icon')->findoneby(["label"=>"uploads/icon/icon_compose.png"]);
|
||||
$entityWidget->setId(-1940);
|
||||
$entityWidget->setRoworder(0);
|
||||
$entityWidget->setIcon($entityicon);
|
||||
$entityWidget->setName('Editeur');
|
||||
$entityWidget->setName('Texte');
|
||||
$entityWidget->setDescription("Votre propre texte à éditer");
|
||||
$entityWidget->setRouteview("cadoles_portal_config_panelwidget_view_editor");
|
||||
$entityWidget->setHeight("630");
|
||||
@ -1302,14 +1346,14 @@ class InitDataCommand extends ContainerAwareCommand
|
||||
$em->persist($entityWidget);
|
||||
}
|
||||
|
||||
// Widget Information
|
||||
// Widget Informations
|
||||
$entityWidget = $em->getRepository('CadolesPortalBundle:Widget')->find(-1860);
|
||||
if(!$entityWidget) $entityWidget = new Widget();
|
||||
$entityicon = $em->getRepository('CadolesPortalBundle:Icon')->findoneby(["label"=>"uploads/icon/icon_info.png"]);
|
||||
$entityWidget->setId(-1860);
|
||||
$entityWidget->setRoworder(0);
|
||||
$entityWidget->setIcon($entityicon);
|
||||
$entityWidget->setName('Information Page');
|
||||
$entityWidget->setName('Informations');
|
||||
$entityWidget->setDescription("Afficher les informations associées à la page");
|
||||
$entityWidget->setRouteview("cadoles_portal_config_panelwidget_view_info");
|
||||
$entityWidget->setHeight("630");
|
||||
|
@ -8,6 +8,7 @@ use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Component\Form\FormError;
|
||||
use Symfony\Component\Filesystem\Filesystem;
|
||||
|
||||
use Cadoles\PortalBundle\Entity\Alert;
|
||||
use Cadoles\PortalBundle\Form\AlertType;
|
||||
@ -195,6 +196,32 @@ class AlertController extends Controller
|
||||
return $response;
|
||||
}
|
||||
|
||||
public function uploadAction(Request $request,$access=null) {
|
||||
// Fichier temporaire uploadé
|
||||
$tmpfile = $request->files->get('upload');
|
||||
$extention = $tmpfile->getClientOriginalExtension();
|
||||
|
||||
// Répertoire de Destination
|
||||
$fs = new Filesystem();
|
||||
$rootdir = $this->get('kernel')->getRootDir()."/../web";
|
||||
$fs->mkdir($rootdir."/uploads/ckeditor");
|
||||
|
||||
// Fichier cible
|
||||
$targetName = uniqid().".".$extention;
|
||||
$targetFile = $rootdir."/uploads/ckeditor/".$targetName;
|
||||
$targetUrl = "/".$this->getParameter('alias')."/uploads/ckeditor/".$targetName;
|
||||
$message = "";
|
||||
|
||||
move_uploaded_file($tmpfile,$targetFile);
|
||||
|
||||
$output["uploaded"]=1;
|
||||
$output["fileName"]=$targetName;
|
||||
$output["url"]=$targetUrl;
|
||||
|
||||
return new Response(json_encode($output));
|
||||
|
||||
}
|
||||
|
||||
public function readAction(Request $request) {
|
||||
$output=array();
|
||||
$id=$request->request->get('id');
|
||||
|
@ -361,7 +361,7 @@ class BlogController extends Controller
|
||||
if($groups[0]) {
|
||||
if($groups[0]->getFgcanshare()) {
|
||||
$pages=$groups[0]->getPages();
|
||||
if($pages) {
|
||||
if($pages[0]) {
|
||||
$idpage=$pages[0]->getId();
|
||||
$groups=$pages[0]->getGroups();
|
||||
$idgroup=$groups[0]->getId();
|
||||
|
@ -106,6 +106,7 @@ class BlogarticleController extends Controller
|
||||
if($access=="user") {
|
||||
$em->getRepository("CadolesPortalBundle:Blog")->getPermission($this->getUser(),$entity->getBlog(),$cansee,$canupdate,$canadd);
|
||||
if(!$canadd) throw $this->createNotFoundException('Permission denied');
|
||||
elseif(!$canupdate&&$this->getUser()!=$entity->getUser()) throw $this->createNotFoundException('Permission denied');
|
||||
}
|
||||
|
||||
// Création du formulaire
|
||||
@ -157,6 +158,7 @@ class BlogarticleController extends Controller
|
||||
if($access=="user") {
|
||||
$em->getRepository("CadolesPortalBundle:Blog")->getPermission($this->getUser(),$entity->getBlog(),$cansee,$canupdate,$canadd);
|
||||
if(!$canadd) throw $this->createNotFoundException('Permission denied');
|
||||
elseif(!$canupdate&&$this->getUser()!=$entity->getUser()) throw $this->createNotFoundException('Permission denied');
|
||||
}
|
||||
|
||||
// Suppression
|
||||
@ -180,7 +182,7 @@ class BlogarticleController extends Controller
|
||||
if($groups[0]) {
|
||||
if($groups[0]->getFgcanshare()) {
|
||||
$pages=$groups[0]->getPages();
|
||||
if($pages) {
|
||||
if($pages[0]) {
|
||||
$idpage=$pages[0]->getId();
|
||||
$groups=$pages[0]->getGroups();
|
||||
$idgroup=$groups[0]->getId();
|
||||
@ -208,12 +210,10 @@ class BlogarticleController extends Controller
|
||||
}
|
||||
else {
|
||||
$em->getRepository("CadolesPortalBundle:Blog")->getPermission($user,$entity->getBlog(),$cansee,$canupdate,$canadd);
|
||||
if(!$canupdate&&$this->getUser()==$entity->getUser()) $canupdate=true;
|
||||
}
|
||||
|
||||
if(!$cansee) throw $this->createNotFoundException('Permission denied');
|
||||
|
||||
$canupdate=false;
|
||||
if($user) $canupdate=true;
|
||||
}
|
||||
|
||||
$em->getRepository("CadolesPortalBundle:Blogarticle")->getBlogsArticles($blogs,0,10,$count,$blogarticles);
|
||||
|
@ -145,7 +145,8 @@ class BlogcommentController extends Controller
|
||||
// On s'assure que l'utilisateur à la permission de modifier
|
||||
if($access=="user") {
|
||||
$em->getRepository("CadolesPortalBundle:Blog")->getPermission($this->getUser(),$entity->getBlogarticle()->getBlog(),$cansee,$canupdate,$canadd);
|
||||
if(!$canadd&&$this->getUser()!=$entity->getUser()) throw $this->createNotFoundException('Permission denied');
|
||||
if(!$canupdate&&$this->getUser()==$entity->getBlogarticle()->getUser()) $canupdate=true;
|
||||
if(!$canupdate&&$this->getUser()!=$entity->getUser()) throw $this->createNotFoundException('Permission denied');
|
||||
}
|
||||
|
||||
// Création du formulaire
|
||||
@ -196,7 +197,7 @@ class BlogcommentController extends Controller
|
||||
// On s'assure que l'utilisateur à la permission de supprimer
|
||||
if($access=="user") {
|
||||
$em->getRepository("CadolesPortalBundle:Blog")->getPermission($this->getUser(),$entity->getBlogarticle()->getBlog(),$cansee,$canupdate,$canadd);
|
||||
if(!$canadd&&$this->getUser()!=$entity->getUser()) throw $this->createNotFoundException('Permission denied');
|
||||
if(!$canupdate&&$this->getUser()!=$entity->getUser()) throw $this->createNotFoundException('Permission denied');
|
||||
}
|
||||
|
||||
// Suppression
|
||||
|
@ -35,6 +35,19 @@ class BookmarkController extends Controller
|
||||
if (!$pagewidget) throw $this->createNotFoundException('Unable to find entity.');
|
||||
}
|
||||
|
||||
// Vérifier que cet enregistrement est modifiable
|
||||
if($access=="user") {
|
||||
if($usage=="user") {
|
||||
$user=$pagewidget->getPage()->getUser();
|
||||
if($user!=$this->getUser()) throw $this->createNotFoundException('Permission denied');
|
||||
}
|
||||
elseif($usage=="group") {
|
||||
$groupentity=$this->getDoctrine()->getRepository("CadolesCoreBundle:Group")->find($group);
|
||||
$usergroup=$this->getDoctrine()->getRepository("CadolesCoreBundle:UserGroup")->findoneby(["user"=>$this->getUser(),"group"=>$groupentity]);
|
||||
if(!$usergroup or $usergroup->getRolegroup()<50) throw $this->createNotFoundException('Permission denied');
|
||||
}
|
||||
}
|
||||
|
||||
// Création du formulaire
|
||||
$form = $this->createForm(BookmarkType::class,$data,array("mode"=>"submit"));
|
||||
|
||||
@ -123,8 +136,8 @@ class BookmarkController extends Controller
|
||||
}
|
||||
else {
|
||||
$groupentity=$this->getDoctrine()->getRepository("CadolesCoreBundle:Group")->find($group);
|
||||
$fgmanager=$this->getDoctrine()->getRepository("CadolesCoreBundle:UserGroup")->findoneby(["user"=>$this->getUser(),"group"=>$groupentity,"fgmanager"=>true]);
|
||||
if(!$fgmanager) throw $this->createNotFoundException('Permission denied');
|
||||
$usergroup=$this->getDoctrine()->getRepository("CadolesCoreBundle:UserGroup")->findoneby(["user"=>$this->getUser(),"group"=>$groupentity]);
|
||||
if(!$usergroup or $usergroup->getRolegroup()<50) throw $this->createNotFoundException('Permission denied');
|
||||
}
|
||||
}
|
||||
|
||||
@ -214,8 +227,8 @@ class BookmarkController extends Controller
|
||||
}
|
||||
else {
|
||||
$groupentity=$this->getDoctrine()->getRepository("CadolesCoreBundle:Group")->find($group);
|
||||
$fgmanager=$this->getDoctrine()->getRepository("CadolesCoreBundle:UserGroup")->findoneby(["user"=>$this->getUser(),"group"=>$groupentity,"fgmanager"=>true]);
|
||||
if(!$fgmanager) throw $this->createNotFoundException('Permission denied');
|
||||
$usergroup=$this->getDoctrine()->getRepository("CadolesCoreBundle:UserGroup")->findoneby(["user"=>$this->getUser(),"group"=>$groupentity]);
|
||||
if(!$usergroup or $usergroup->getRolegroup()<50) throw $this->createNotFoundException('Permission denied');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -220,7 +220,7 @@ class CalendarController extends Controller
|
||||
|
||||
// On s'assure que l'utilisateur à la permission de modifier
|
||||
if($access=="user") {
|
||||
$em->getRepository($this->labelentity)->getPermission($this->getUser(),$entity,$cansee,$canupdate);
|
||||
$em->getRepository($this->labelentity)->getPermission($this->getUser(),$entity,$cansee,$canupdate,$canadd);
|
||||
if(!$canupdate) throw $this->createNotFoundException('Permission denied');
|
||||
}
|
||||
$oldpassword=$entity->getPasswordDecrypt();
|
||||
@ -272,7 +272,7 @@ class CalendarController extends Controller
|
||||
|
||||
// On s'assure que l'utilisateur à la permission de modifier
|
||||
if($access=="user") {
|
||||
$em->getRepository($this->labelentity)->getPermission($this->getUser(),$entity,$cansee,$canupdate);
|
||||
$em->getRepository($this->labelentity)->getPermission($this->getUser(),$entity,$cansee,$canupdate,$canadd);
|
||||
if(!$canupdate) throw $this->createNotFoundException('Permission denied');
|
||||
}
|
||||
|
||||
@ -308,7 +308,7 @@ class CalendarController extends Controller
|
||||
|
||||
// On s'assure que l'utilisateur à la permission de supprimer
|
||||
if($access=="user") {
|
||||
$em->getRepository($this->labelentity)->getPermission($this->getUser(),$entity,$cansee,$canupdate);
|
||||
$em->getRepository($this->labelentity)->getPermission($this->getUser(),$entity,$cansee,$canupdate,$canadd);
|
||||
if(!$canupdate) throw $this->createNotFoundException('Permission denied');
|
||||
}
|
||||
|
||||
@ -341,7 +341,7 @@ class CalendarController extends Controller
|
||||
if($groups[0]) {
|
||||
if($groups[0]->getFgcanshare()) {
|
||||
$pages=$groups[0]->getPages();
|
||||
if($pages) {
|
||||
if($pages[0]) {
|
||||
$idpage=$pages[0]->getId();
|
||||
$groups=$pages[0]->getGroups();
|
||||
$idgroup=$groups[0]->getId();
|
||||
@ -369,6 +369,7 @@ class CalendarController extends Controller
|
||||
$calendar->setType(0);
|
||||
$calendar->setUser($user);
|
||||
$calendar->setCanupdate(true);
|
||||
$calendar->setCanadd(true);
|
||||
$key = Uuid::uuid4();
|
||||
$calendar->setKeyvalue($key);
|
||||
$em->persist($calendar);
|
||||
|
@ -40,9 +40,10 @@ class CalendareventController extends Controller
|
||||
if($access=="config")
|
||||
$calendar->setCanupdate(true);
|
||||
else {
|
||||
$this->getDoctrine()->getRepository("CadolesPortalBundle:Calendar")->getPermission($this->getUser(),$calendar,$cansee,$canupdate);
|
||||
$this->getDoctrine()->getRepository("CadolesPortalBundle:Calendar")->getPermission($this->getUser(),$calendar,$cansee,$canupdate,$canadd);
|
||||
if(!$cansee) throw $this->createNotFoundException('Permission denied');
|
||||
$calendar->setCanupdate($canupdate);
|
||||
$calendar->setCanadd($canadd);
|
||||
}
|
||||
|
||||
$calendars=[$calendar];
|
||||
@ -67,17 +68,43 @@ class CalendareventController extends Controller
|
||||
$tmp['color'] = "#".(is_null($calendar->getColor())?$this->get('session')->get('color')["main"]:$calendar->getColor());
|
||||
$tmp['allDay'] = $calendarevent->getAllday();
|
||||
$tmp['calendar'] = $calendar->getId();
|
||||
$tmp['editable'] = $calendarevent->getCalendar()->getCanupdate();
|
||||
$tmp['editable'] = $calendarevent->getCalendar()->getCanadd();
|
||||
$tmp['files'] = $this->loadpj($tmp['id'] );
|
||||
|
||||
array_push($events,$tmp);
|
||||
array_push($eventids,$tmp["id"]);
|
||||
}
|
||||
|
||||
// On recherche les taches associées aux groupes du calendrier
|
||||
if($this->getUser()) {
|
||||
$groups=$calendar->getGroups();
|
||||
foreach($groups as $group) {
|
||||
$projects=$group->getProjects();
|
||||
foreach($projects as $project) {
|
||||
$projecttasks = $this->getDoctrine()->getRepository("CadolesPortalBundle:Projecttask")->getProjectTasksByDate($project,$this->getUser(),$start,$end);
|
||||
foreach($projecttasks as $projecttask) {
|
||||
$tmp=[];
|
||||
$tmp['id'] = "TASK".strval($projecttask->getId());
|
||||
$tmp['title'] = "TACHE = ".$projecttask->getName();
|
||||
$tmp['description'] = $projecttask->getDescription();
|
||||
$tmp['start'] = $projecttask->getEnd()->format("Y-m-d\TH:i:s");
|
||||
$tmp['end'] = $projecttask->getEnd()->format("Y-m-d\TH:i:s");
|
||||
$tmp['color'] = "#".$this->get('session')->get('color')["main"];
|
||||
$tmp['allDay'] = true;
|
||||
$tmp['calendar'] = $project->getId();
|
||||
$tmp['name'] = $project->getName()." - Tache";
|
||||
$tmp['editable'] = false;
|
||||
|
||||
array_push($events,$tmp);
|
||||
array_push($eventids,$tmp["id"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// On récupére les évenement partagé de l'utilisateur
|
||||
if($this->getUser()) {
|
||||
|
||||
$calendarevents = $this->getDoctrine()->getRepository("CadolesPortalBundle:Calendarevent")->getCalendareventGroupsShareByDate($this->getUser(),$start,$end);
|
||||
|
||||
foreach($calendarevents as $calendarevent) {
|
||||
@ -128,8 +155,8 @@ class CalendareventController extends Controller
|
||||
|
||||
// On s'assure que l'utilisateur à la permission de supprimer
|
||||
if($access=="user") {
|
||||
$em->getRepository("CadolesPortalBundle:Calendar")->getPermission($this->getUser(),$calendar,$cansee,$canupdate);
|
||||
if(!$canupdate) throw $this->createNotFoundException('Permission denied');
|
||||
$em->getRepository("CadolesPortalBundle:Calendar")->getPermission($this->getUser(),$calendar,$cansee,$canupdate,$canadd);
|
||||
if(!$canadd) throw $this->createNotFoundException('Permission denied');
|
||||
}
|
||||
|
||||
$calendarevent=new Calendarevent();
|
||||
@ -182,8 +209,8 @@ class CalendareventController extends Controller
|
||||
|
||||
// On s'assure que l'utilisateur à la permission
|
||||
if($access=="user") {
|
||||
$em->getRepository("CadolesPortalBundle:Calendar")->getPermission($this->getUser(),$calendar,$cansee,$canupdate);
|
||||
if(!$canupdate) throw $this->createNotFoundException('Permission denied');
|
||||
$em->getRepository("CadolesPortalBundle:Calendar")->getPermission($this->getUser(),$calendar,$cansee,$canupdate,$canadd);
|
||||
if(!$canadd) throw $this->createNotFoundException('Permission denied');
|
||||
}
|
||||
|
||||
$calendarevent = $this->getDoctrine()->getRepository("CadolesPortalBundle:Calendarevent")->find($id);
|
||||
@ -240,8 +267,8 @@ class CalendareventController extends Controller
|
||||
|
||||
// On s'assure que l'utilisateur à la permission
|
||||
if($access=="user") {
|
||||
$em->getRepository("CadolesPortalBundle:Calendar")->getPermission($this->getUser(),$calendar,$cansee,$canupdate);
|
||||
if(!$canupdate) throw $this->createNotFoundException('Permission denied');
|
||||
$em->getRepository("CadolesPortalBundle:Calendar")->getPermission($this->getUser(),$calendar,$cansee,$canupdate,$canadd);
|
||||
if(!$canadd) throw $this->createNotFoundException('Permission denied');
|
||||
}
|
||||
|
||||
$calendarevent = $this->getDoctrine()->getRepository("CadolesPortalBundle:Calendarevent")->find($id);
|
||||
@ -265,8 +292,8 @@ class CalendareventController extends Controller
|
||||
|
||||
// On s'assure que l'utilisateur à la permission de modifier
|
||||
if($access=="user") {
|
||||
$em->getRepository("CadolesPortalBundle:Calendar")->getPermission($this->getUser(),$calendar,$cansee,$canupdate);
|
||||
if(!$canupdate) throw $this->createNotFoundException('Permission denied');
|
||||
$em->getRepository("CadolesPortalBundle:Calendar")->getPermission($this->getUser(),$calendar,$cansee,$canupdate,$canadd);
|
||||
if(!$canadd) throw $this->createNotFoundException('Permission denied');
|
||||
}
|
||||
|
||||
// Création du formulaire
|
||||
@ -303,8 +330,8 @@ class CalendareventController extends Controller
|
||||
|
||||
// On s'assure que l'utilisateur à la permission
|
||||
if($access=="user") {
|
||||
$em->getRepository("CadolesPortalBundle:Calendar")->getPermission($this->getUser(),$calendar,$cansee,$canupdate);
|
||||
if(!$canupdate) throw $this->createNotFoundException('Permission denied');
|
||||
$em->getRepository("CadolesPortalBundle:Calendar")->getPermission($this->getUser(),$calendar,$cansee,$canupdate,$canadd);
|
||||
if(!$canadd) throw $this->createNotFoundException('Permission denied');
|
||||
}
|
||||
|
||||
$files = $this->loadpj($id);
|
||||
|
@ -65,13 +65,18 @@ class ItemController extends Controller
|
||||
{
|
||||
// Initialisation de l'enregistrement
|
||||
$data = new Item();
|
||||
|
||||
if($this->GetParameter("activate_widsonde")) {
|
||||
$data->setClicksonde(true);
|
||||
$data->setClicksondeservice("PAGE_ENT");
|
||||
}
|
||||
|
||||
// Création du formulaire
|
||||
$form = $this->createForm(ItemType::class,$data,array(
|
||||
"mode" => "submit",
|
||||
"labelniveau01" => $this->GetParameter("labelsniveau01"),
|
||||
"ssosynchroitem" => $this->GetParameter("ssosynchroitem"),
|
||||
"user_attr_cas_item" => $this->GetParameter("user_attr_cas_item")
|
||||
"user_attr_cas_item" => $this->GetParameter("user_attr_cas_item"),
|
||||
"activate_widsonde" => $this->GetParameter("activate_widsonde"),
|
||||
));
|
||||
|
||||
// Récupération des data du formulaire
|
||||
@ -122,7 +127,8 @@ class ItemController extends Controller
|
||||
"idicon" => ($data->getIcon()?$data->getIcon()->getId():null),
|
||||
"labelniveau01" => $this->GetParameter("labelsniveau01"),
|
||||
"ssosynchroitem" => $this->GetParameter("ssosynchroitem"),
|
||||
"user_attr_cas_item" => $this->GetParameter("user_attr_cas_item")
|
||||
"user_attr_cas_item" => $this->GetParameter("user_attr_cas_item"),
|
||||
"activate_widsonde" => ($this->GetParameter("activate_widsonde")&&$data->getId()>0),
|
||||
));
|
||||
|
||||
// Récupération des data du formulaire
|
||||
@ -204,6 +210,26 @@ class ItemController extends Controller
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
||||
public function forceorderAction(Request $request)
|
||||
{
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$categorys=$em->getRepository("CadolesPortalBundle:Itemcategory")->findAll();
|
||||
|
||||
foreach($categorys as $category) {
|
||||
$i=0;
|
||||
$items=$em->getRepository("CadolesPortalBundle:Item")->findBy(["itemcategory"=>$category],["title"=>"ASC"]);
|
||||
foreach($items as $item) {
|
||||
$i++;
|
||||
$item->setRowOrder($i);
|
||||
$em->flush();
|
||||
}
|
||||
}
|
||||
|
||||
// Retour à la liste
|
||||
return $this->redirectToRoute($this->labelroute);
|
||||
}
|
||||
|
||||
protected function getDatas()
|
||||
{
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
@ -230,6 +256,13 @@ class ItemController extends Controller
|
||||
if ($form->get('submit')->isClicked() && $mode=="submit") {
|
||||
}
|
||||
|
||||
if ($form->get('submit')->isClicked() && ($mode=="submit" || $mode=="update")) {
|
||||
// si clicksonde alors clicksondeservice obligatoire
|
||||
if ($data->getClicksonde() && !$data->getClicksondeservice()) {
|
||||
$form->addError(new FormError('Type de service sur le click sonde est obligatoire'));
|
||||
}
|
||||
}
|
||||
|
||||
if ($form->get('submit')->isClicked() && !$form->isValid()) {
|
||||
$this->get('session')->getFlashBag()->clear();
|
||||
$validator = $this->get('validator');
|
||||
|
@ -210,6 +210,10 @@ class NoticeController extends Controller
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$user=$this->getUser();
|
||||
$notices=$em->getRepository("CadolesPortalBundle:Notice")->getNoticeToRead($user);
|
||||
|
||||
// Récupération redirection potentielle
|
||||
$id = $request->get('id');
|
||||
|
||||
foreach($notices as $notice) {
|
||||
$users=$notice->getUsers();
|
||||
|
||||
@ -223,7 +227,7 @@ class NoticeController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
return $this->redirectToRoute("cadoles_core_home");
|
||||
return $this->redirectToRoute("cadoles_core_home",["id"=>$id]);
|
||||
}
|
||||
|
||||
public function viewAction(Request $request) {
|
||||
|
@ -286,7 +286,7 @@ class PageController extends Controller
|
||||
|
||||
// On s'assure que l'utilisateur à la permission de modifier
|
||||
if($access=="user") {
|
||||
$em->getRepository($this->labelentity)->getPermission($this->getUser(),$entity,$cansee,$canupdate);
|
||||
$em->getRepository($this->labelentity)->getPermission($this->getUser(),$entity,$cansee,$canupdate,$canadd);
|
||||
if(!$canupdate) throw $this->createNotFoundException('Permission denied');
|
||||
}
|
||||
|
||||
@ -369,7 +369,7 @@ class PageController extends Controller
|
||||
|
||||
// On s'assure que l'utilisateur à la permission de modifier
|
||||
if($access=="user") {
|
||||
$em->getRepository($this->labelentity)->getPermission($this->getUser(),$entity,$cansee,$canupdate);
|
||||
$em->getRepository($this->labelentity)->getPermission($this->getUser(),$entity,$cansee,$canupdate,$canadd);
|
||||
if(!$canupdate) throw $this->createNotFoundException('Permission denied');
|
||||
}
|
||||
|
||||
@ -408,7 +408,7 @@ class PageController extends Controller
|
||||
|
||||
// On s'assure que l'utilisateur à la permission de supprimer
|
||||
if($access=="user") {
|
||||
$em->getRepository($this->labelentity)->getPermission($this->getUser(),$entity,$cansee,$canupdate);
|
||||
$em->getRepository($this->labelentity)->getPermission($this->getUser(),$entity,$cansee,$canupdate,$canadd);
|
||||
if(!$canupdate) throw $this->createNotFoundException('Permission denied');
|
||||
}
|
||||
|
||||
@ -438,7 +438,7 @@ class PageController extends Controller
|
||||
|
||||
// On s'assure que l'utilisateur à la permission
|
||||
if($access=="user") {
|
||||
$em->getRepository($this->labelentity)->getPermission($this->getUser(),$entity,$cansee,$canupdate);
|
||||
$em->getRepository($this->labelentity)->getPermission($this->getUser(),$entity,$cansee,$canupdate,$canadd);
|
||||
if(!$canupdate) throw $this->createNotFoundException('Permission denied');
|
||||
}
|
||||
|
||||
@ -474,7 +474,7 @@ class PageController extends Controller
|
||||
}
|
||||
else {
|
||||
// On s'assure que l'utilisateur à la permission de voir
|
||||
$em->getRepository($this->labelentity)->getPermission($this->getUser(),$entity,$cansee,$canupdate);
|
||||
$em->getRepository($this->labelentity)->getPermission($this->getUser(),$entity,$cansee,$canupdate,$canadd);
|
||||
if(!$cansee) {
|
||||
return $this->render('CadolesCoreBundle:Core:reconnect.html.twig', [
|
||||
'useheader' => false,
|
||||
|
@ -30,14 +30,15 @@ class PagewidgetController extends Controller
|
||||
private $access;
|
||||
private $look;
|
||||
private $mini;
|
||||
private $selwidget;
|
||||
private $selwidget;
|
||||
private $usage;
|
||||
private $group;
|
||||
|
||||
private $cansee;
|
||||
private $canudate;
|
||||
private $canupdate;
|
||||
private $canadd;
|
||||
|
||||
private function searchArray($array, $key, $value)
|
||||
{
|
||||
private function searchArray($array, $key, $value) {
|
||||
$results = array();
|
||||
|
||||
if (is_array($array))
|
||||
@ -52,8 +53,7 @@ class PagewidgetController extends Controller
|
||||
return $results;
|
||||
}
|
||||
|
||||
private function entityForm(Pagewidget $entity,$idpage,$id,$access="config",$by="view")
|
||||
{
|
||||
private function entityForm(Pagewidget $entity,$idpage,$id,$access="config",$by="view") {
|
||||
if ($this->getDoctrine()->getManager()->contains($entity)) {
|
||||
$widgettype= $this->getDoctrine()->getManager()->getRepository("CadolesPortalBundle:Pagewidget")->find($id)->getWidget();
|
||||
$params = $widgettype->getParameter();
|
||||
@ -97,8 +97,7 @@ class PagewidgetController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
public function submitAction(Request $request,$idpage,$idwidgettype,$access="config")
|
||||
{
|
||||
public function submitAction(Request $request,$idpage,$idwidgettype,$access="config") {
|
||||
$by=$request->query->get('by');
|
||||
$entity = new Pagewidget();
|
||||
$form = $this->entityForm($entity,$idpage,$idwidgettype,$access,$by);
|
||||
@ -190,8 +189,7 @@ class PagewidgetController extends Controller
|
||||
]);
|
||||
}
|
||||
|
||||
public function updateAction(Request $request,$idpage,$idwidget,$access="config")
|
||||
{
|
||||
public function updateAction(Request $request,$idpage,$idwidget,$access="config") {
|
||||
$by=$request->query->get('by');
|
||||
$usage=$request->query->get('usage');
|
||||
$group=$request->query->get('group');
|
||||
@ -203,7 +201,7 @@ class PagewidgetController extends Controller
|
||||
|
||||
// On s'assure que l'utilisateur à la permission de modifier
|
||||
if($access=="user") {
|
||||
$em->getRepository("CadolesPortalBundle:Page")->getPermission($this->getUser(),$entity->getPage(),$cansee,$canupdate);
|
||||
$em->getRepository("CadolesPortalBundle:Page")->getPermission($this->getUser(),$entity->getPage(),$cansee,$canupdate,$canadd);
|
||||
if(!$canupdate) throw $this->createNotFoundException('Permission denied');
|
||||
}
|
||||
|
||||
@ -273,8 +271,7 @@ class PagewidgetController extends Controller
|
||||
]);
|
||||
}
|
||||
|
||||
public function deleteAction(Request $request,$access="config")
|
||||
{
|
||||
public function deleteAction(Request $request,$access="config") {
|
||||
// S'assurer que c'est un appel ajax
|
||||
if (!$request->isXmlHttpRequest()) return new JsonResponse(array('message' => 'Interdit'), 400);
|
||||
|
||||
@ -289,7 +286,7 @@ class PagewidgetController extends Controller
|
||||
|
||||
// On s'assure que l'utilisateur à la permission de supprimer
|
||||
if($access=="user") {
|
||||
$em->getRepository("CadolesPortalBundle:Page")->getPermission($this->getUser(),$entity->getPage(),$cansee,$canupdate);
|
||||
$em->getRepository("CadolesPortalBundle:Page")->getPermission($this->getUser(),$entity->getPage(),$cansee,$canupdate,$canadd);
|
||||
if(!$canupdate) throw $this->createNotFoundException('Permission denied');
|
||||
}
|
||||
|
||||
@ -315,8 +312,7 @@ class PagewidgetController extends Controller
|
||||
return $response;
|
||||
}
|
||||
|
||||
public function orderAction(Request $request)
|
||||
{
|
||||
public function orderAction(Request $request) {
|
||||
// S'assurer que c'est un appel ajax
|
||||
if (!$request->isXmlHttpRequest()) return new JsonResponse(array('message' => 'Interdit'), 400);
|
||||
|
||||
@ -367,7 +363,6 @@ class PagewidgetController extends Controller
|
||||
|
||||
}
|
||||
|
||||
|
||||
protected function getErrorForm($id,$form,$request,$idwidgettype,$page,$data,$mode) {
|
||||
if ($form->get('submit')->isClicked()&&$mode=="delete") {
|
||||
|
||||
@ -405,7 +400,9 @@ class PagewidgetController extends Controller
|
||||
$this->access = $access;
|
||||
$this->look = $request->query->get('look');
|
||||
$this->selwidget = $request->query->get('selwidget');
|
||||
|
||||
$this->usage = $request->query->get('usage');
|
||||
$this->group = $request->query->get('group');
|
||||
|
||||
// Le widget existe-t-il ?
|
||||
$this->entity = $this->em->getRepository($this->labelentity)->find($this->id);
|
||||
if (!$this->entity) throw $this->createNotFoundException('Unable to find entity.');
|
||||
@ -417,7 +414,7 @@ class PagewidgetController extends Controller
|
||||
else {
|
||||
// On s'assure que l'utilisateur à la permission de voir
|
||||
$this->page=$this->entity->getPage();
|
||||
$this->em->getRepository("CadolesPortalBundle:Page")->getPermission($this->user,$this->page,$this->cansee,$this->canupdate);
|
||||
$this->em->getRepository("CadolesPortalBundle:Page")->getPermission($this->user,$this->page,$this->cansee,$this->canupdate,$this->canadd);
|
||||
if(!$this->cansee) throw $this->createNotFoundException('Permission denied');
|
||||
}
|
||||
|
||||
@ -450,6 +447,26 @@ class PagewidgetController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
protected function getKeyPreference(&$entity,$key,$value) {
|
||||
$user=$this->getUser();
|
||||
if(!$user)
|
||||
return $value;
|
||||
|
||||
$preference=$user->getPreference();
|
||||
$id=$entity->getId();
|
||||
|
||||
if(!is_array($preference))
|
||||
return $value;
|
||||
|
||||
if(!array_key_exists($key,$preference))
|
||||
return $value;
|
||||
|
||||
if(!array_key_exists($id,$preference[$key]))
|
||||
return $value;
|
||||
|
||||
return $preference[$key][$id];
|
||||
}
|
||||
|
||||
protected function getRender($view,$params) {
|
||||
// Paramétres toujours présent dans un rendu de widget
|
||||
$allways = [
|
||||
@ -605,6 +622,9 @@ class PagewidgetController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
// Préference utilisateur
|
||||
$modedesktop = $this->getKeyPreference($this->entity,"modedesktop",$modedesktop);
|
||||
|
||||
// Profilage
|
||||
$itemsordered = $this->em->getRepository("CadolesPortalBundle:Item")->getUserItems($this->user,$bookmarks,$items,$itemcategorys,$iditemcategory,$this->get('session')->get('ssoitems'),$withbookmark,false);
|
||||
}
|
||||
@ -642,10 +662,14 @@ class PagewidgetController extends Controller
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Préference utilisateur
|
||||
$modedesktop = $this->getKeyPreference($this->entity,"modedesktop",$modedesktop);
|
||||
|
||||
// Profilage
|
||||
$itemsordered = $this->em->getRepository("CadolesPortalBundle:Item")->getUserItems($this->user,$bookmarks,$items,$itemcategorys,null,$this->get('session')->get('ssoitems'),0,true);
|
||||
}
|
||||
|
||||
|
||||
// Render
|
||||
return $this->getRender('viewitemessential.html.twig', [
|
||||
@ -654,7 +678,7 @@ class PagewidgetController extends Controller
|
||||
'items' => $itemsordered,
|
||||
'bookmarks' => $bookmarks,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
public function viewalertAction(Request $request,$id,$access="config") {
|
||||
// Récupération de la requete
|
||||
@ -687,7 +711,6 @@ class PagewidgetController extends Controller
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
public function viewfluxAction(Request $request,$id,$access="config") {
|
||||
// Récupération de la requete
|
||||
$this->setRequest($request,$id,$access);
|
||||
@ -894,7 +917,6 @@ class PagewidgetController extends Controller
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
public function viewrssAction(Request $request,$id,$access="config") {
|
||||
// Récupération de la requete
|
||||
$this->setRequest($request,$id,$access);
|
||||
@ -1115,34 +1137,20 @@ class PagewidgetController extends Controller
|
||||
|
||||
// Render
|
||||
return $this->getRender('viewbookmark.html.twig', [
|
||||
'canadd' => $this->canadd,
|
||||
'modedesktop' => $modedesktop,
|
||||
'bookmarks' => $bookmarks,
|
||||
]);
|
||||
}
|
||||
|
||||
public function viewlinkAction(Request $request,$id,$access="config") {
|
||||
$look=$request->query->get('look');
|
||||
$selwidget=$request->query->get('selwidget');
|
||||
|
||||
$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');
|
||||
}
|
||||
// Récupération de la requete
|
||||
$this->setRequest($request,$id,$access);
|
||||
|
||||
// Récupération des paramétres du widget
|
||||
$url="";
|
||||
$target="_blank";
|
||||
foreach($entity->getParameter()["fields"] as $parameter) {
|
||||
foreach($this->entity->getParameter()["fields"] as $parameter) {
|
||||
switch($parameter["id"]) {
|
||||
case "url":
|
||||
$url=$parameter["value"];
|
||||
@ -1153,44 +1161,21 @@ class PagewidgetController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
// Préference utilisateur
|
||||
$this->getPreference($entity);
|
||||
|
||||
// Render
|
||||
return $this->render($this->labelentity.':viewlink.html.twig', [
|
||||
'entity' => $entity,
|
||||
return $this->getRender('viewlink.html.twig', [
|
||||
'canadd' => false,
|
||||
'canupdate' => $canupdate,
|
||||
'url' => $url,
|
||||
'target' => $target,
|
||||
'access' => $access,
|
||||
'look' => $look,
|
||||
'mini' => ($look=="list"&&$entity->getId()!=$selwidget),
|
||||
]);
|
||||
}
|
||||
|
||||
public function vieweditorAction(Request $request,$id,$access="config") {
|
||||
$look=$request->query->get('look');
|
||||
$selwidget=$request->query->get('selwidget');
|
||||
|
||||
$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');
|
||||
}
|
||||
// Récupération de la requete
|
||||
$this->setRequest($request,$id,$access);
|
||||
|
||||
// Récupération des paramétres du widget
|
||||
$html="";
|
||||
foreach($entity->getParameter()["fields"] as $parameter) {
|
||||
foreach($this->entity->getParameter()["fields"] as $parameter) {
|
||||
switch($parameter["id"]) {
|
||||
case "html":
|
||||
$html=$parameter["value"];
|
||||
@ -1199,91 +1184,45 @@ class PagewidgetController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
// Préference utilisateur
|
||||
$this->getPreference($entity);
|
||||
|
||||
// Render
|
||||
return $this->render($this->labelentity.':vieweditor.html.twig', [
|
||||
'entity' => $entity,
|
||||
return $this->getRender('vieweditor.html.twig', [
|
||||
'canadd' => false,
|
||||
'canupdate' => $canupdate,
|
||||
'html' => $html,
|
||||
'access' => $access,
|
||||
'look' => $look,
|
||||
'mini' => ($look=="list"&&$entity->getId()!=$selwidget),
|
||||
]);
|
||||
}
|
||||
|
||||
public function viewslideAction(Request $request,$id,$access="config") {
|
||||
$look=$request->query->get('look');
|
||||
$selwidget=$request->query->get('selwidget');
|
||||
|
||||
$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');
|
||||
}
|
||||
// Récupération de la requete
|
||||
$this->setRequest($request,$id,$access);
|
||||
|
||||
// Récupération des paramétres du widget
|
||||
$interval="2";
|
||||
foreach($entity->getParameter()["fields"] as $parameter) {
|
||||
foreach($this->entity->getParameter()["fields"] as $parameter) {
|
||||
switch($parameter["id"]) {
|
||||
case "interval":
|
||||
$interval=$parameter["value"];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Préference utilisateur
|
||||
$this->getPreference($entity);
|
||||
|
||||
// Récupération des slides
|
||||
$slides=$em->getRepository("CadolesPortalBundle:Slide")->findBy(["pagewidget"=>$entity],['roworder'=>'ASC','title'=>'ASC']);
|
||||
$slides=$this->em->getRepository("CadolesPortalBundle:Slide")->findBy(["pagewidget"=>$this->entity],['roworder'=>'ASC','title'=>'ASC']);
|
||||
|
||||
// Render
|
||||
return $this->render($this->labelentity.':viewslide.html.twig', [
|
||||
'entity' => $entity,
|
||||
'canadd' => $canupdate,
|
||||
'canupdate' => $canupdate,
|
||||
return $this->getRender('viewslide.html.twig', [
|
||||
'canadd' => $this->canadd,
|
||||
'slides' => $slides,
|
||||
'interval' => $interval,
|
||||
'access' => $access,
|
||||
'look' => $look,
|
||||
'mini' => ($look=="list"&&$entity->getId()!=$selwidget),
|
||||
]);
|
||||
}
|
||||
|
||||
public function viewfileAction(Request $request,$id,$access="config") {
|
||||
$look=$request->query->get('look');
|
||||
$selwidget=$request->query->get('selwidget');
|
||||
|
||||
$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');
|
||||
}
|
||||
// Récupération de la requete
|
||||
$this->setRequest($request,$id,$access);
|
||||
|
||||
// Récupération des paramétres du widget
|
||||
$view="small";
|
||||
foreach($entity->getParameter()["fields"] as $parameter) {
|
||||
foreach($this->entity->getParameter()["fields"] as $parameter) {
|
||||
switch($parameter["id"]) {
|
||||
case "modelist":
|
||||
$view=($parameter["value"]==0?"small":"list");
|
||||
@ -1291,45 +1230,17 @@ class PagewidgetController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
// Préference utilisateur
|
||||
$this->getPreference($entity);
|
||||
|
||||
return $this->render($this->labelentity.':viewfile.html.twig', [
|
||||
'entity' => $entity,
|
||||
'canadd' => $canupdate,
|
||||
'canupdate' => $canupdate,
|
||||
'access' => $access,
|
||||
// Render
|
||||
return $this->getRender('viewfile.html.twig', [
|
||||
'canadd' => $this->canadd,
|
||||
'directory' => "widget-".$id,
|
||||
'view' => $view,
|
||||
'look' => $look,
|
||||
'mini' => ($look=="list"&&$entity->getId()!=$selwidget),
|
||||
]);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function viewgaleryAction(Request $request,$id,$access="config") {
|
||||
$look=$request->query->get('look');
|
||||
$selwidget=$request->query->get('selwidget');
|
||||
|
||||
$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');
|
||||
}
|
||||
|
||||
// Préference utilisateur
|
||||
$this->getPreference($entity);
|
||||
// Récupération de la requete
|
||||
$this->setRequest($request,$id,$access);
|
||||
|
||||
$directory=$this->get('kernel')->getRootDir()."/../uploads/file/widget-".$id;
|
||||
$files=[];
|
||||
@ -1359,96 +1270,47 @@ class PagewidgetController extends Controller
|
||||
|
||||
|
||||
// Render
|
||||
return $this->render($this->labelentity.':viewgalery.html.twig', [
|
||||
'entity' => $entity,
|
||||
'canadd' => $canupdate,
|
||||
'canupdate' => $canupdate,
|
||||
return $this->getRender('viewgalery.html.twig', [
|
||||
'canadd' => $this->canadd,
|
||||
'files' => $files,
|
||||
'access' => $access,
|
||||
'look' => $look,
|
||||
'mini' => ($look=="list"&&$entity->getId()!=$selwidget),
|
||||
]);
|
||||
}
|
||||
|
||||
public function viewcalendarAction(Request $request,$id,$access="config") {
|
||||
$usage=$request->query->get('usage');
|
||||
$group=$request->query->get('group');
|
||||
$look=$request->query->get('look');
|
||||
$selwidget=$request->query->get('selwidget');
|
||||
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$entity = $em->getRepository($this->labelentity)->find($id);
|
||||
if (!$entity) throw $this->createNotFoundException('Unable to find entity.');
|
||||
|
||||
if($group) $groupentity=$em->getRepository("CadolesCoreBundle:Group")->find($group);
|
||||
|
||||
// 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');
|
||||
}
|
||||
// Récupération de la requete
|
||||
$this->setRequest($request,$id,$access);
|
||||
|
||||
// Récupération des paramétres du widget
|
||||
$nbday="0";
|
||||
foreach($entity->getParameter()["fields"] as $parameter) {
|
||||
foreach($this->entity->getParameter()["fields"] as $parameter) {
|
||||
switch($parameter["id"]) {
|
||||
case "nbday":
|
||||
$nbday=$parameter["value"];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Préference utilisateur
|
||||
$this->getPreference($entity);
|
||||
|
||||
// Récupérer les events de l'utilisateur
|
||||
$user=$this->getUser();
|
||||
$events=$em->getRepository("CadolesPortalBundle:Calendarevent")->getUserCalendarevents($user,$this->get('session')->get('color')["main"],$usage,$group,$firstcalendar);
|
||||
$events=$this->em->getRepository("CadolesPortalBundle:Calendarevent")->getUserCalendarevents($user,$this->get('session')->get('color')["main"],$this->usage,$this->group,$firstcalendar);
|
||||
|
||||
// Render
|
||||
return $this->render($this->labelentity.':viewcalendar.html.twig', [
|
||||
'entity' => $entity,
|
||||
'canadd' => $canupdate,
|
||||
'canupdate' => $canupdate,
|
||||
return $this->getRender('viewcalendar.html.twig', [
|
||||
'canadd' => $this->canadd,
|
||||
'events' => $events,
|
||||
'nbday' => $nbday,
|
||||
'access' => $access,
|
||||
'firstcalendar' => $firstcalendar,
|
||||
'usage' => $usage,
|
||||
'look' => $look,
|
||||
'mini' => ($look=="list"&&$entity->getId()!=$selwidget),
|
||||
'usage' => $this->usage,
|
||||
]);
|
||||
}
|
||||
|
||||
public function viewblogAction(Request $request,$id,$access="config") {
|
||||
$usage=$request->query->get('usage');
|
||||
$group=$request->query->get('group');
|
||||
$look=$request->query->get('look');
|
||||
$selwidget=$request->query->get('selwidget');
|
||||
|
||||
$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');
|
||||
}
|
||||
// Récupération de la requete
|
||||
$this->setRequest($request,$id,$access);
|
||||
|
||||
// Récupération des paramétres du widget
|
||||
$nbarticle=10;
|
||||
foreach($entity->getParameter()["fields"] as $parameter) {
|
||||
foreach($this->entity->getParameter()["fields"] as $parameter) {
|
||||
switch($parameter["id"]) {
|
||||
case "nbarticle":
|
||||
$nbarticle=$parameter["value"];
|
||||
@ -1456,64 +1318,38 @@ class PagewidgetController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
// Préference utilisateur
|
||||
$this->getPreference($entity);
|
||||
|
||||
// On récupère soit les blogs du group en cours soit l'ensemble des blogs de l'utilisateur
|
||||
if($usage=="group") {
|
||||
$blogs=$em->getRepository("CadolesPortalBundle:Blog")->getBlogsGroup($this->getUser(),$group);
|
||||
if($this->usage=="group") {
|
||||
$blogs=$this->em->getRepository("CadolesPortalBundle:Blog")->getBlogsGroup($this->getUser(),$this->group);
|
||||
if($blogs) $firstblog=$blogs[0]->getId();
|
||||
}
|
||||
else {
|
||||
$em->getRepository("CadolesPortalBundle:Blog")->getBlogsUser($this->getUser(),$blogsuser,$blogsadmin,$blogsshared);
|
||||
$this->em->getRepository("CadolesPortalBundle:Blog")->getBlogsUser($this->getUser(),$blogsuser,$blogsadmin,$blogsshared);
|
||||
$blogs=array_merge($blogsuser,$blogsadmin->toArray(),$blogsshared);
|
||||
$firstblog="all";
|
||||
}
|
||||
|
||||
// On récupère les nbarticle de ses blogs
|
||||
$em->getRepository("CadolesPortalBundle:Blogarticle")->getBlogsArticles($blogs,0,$nbarticle,$count,$blogarticles);
|
||||
$this->em->getRepository("CadolesPortalBundle:Blogarticle")->getBlogsArticles($blogs,0,$nbarticle,$count,$blogarticles);
|
||||
|
||||
|
||||
|
||||
// Render
|
||||
return $this->render($this->labelentity.':viewblog.html.twig', [
|
||||
'entity' => $entity,
|
||||
'canadd' => $canupdate,
|
||||
'canupdate' => $canupdate,
|
||||
return $this->getRender('viewblog.html.twig', [
|
||||
'canadd' => $this->canadd,
|
||||
'blogarticles' => $blogarticles,
|
||||
'nbarticle' => $nbarticle,
|
||||
'access' => $access,
|
||||
'firstblog' => $firstblog,
|
||||
'usage' => $usage,
|
||||
'look' => $look,
|
||||
'mini' => ($look=="list"&&$entity->getId()!=$selwidget),
|
||||
'usage' => $this->usage,
|
||||
]);
|
||||
}
|
||||
|
||||
public function viewprojectAction(Request $request,$id,$access="config") {
|
||||
$usage=$request->query->get('usage');
|
||||
$group=$request->query->get('group');
|
||||
$look=$request->query->get('look');
|
||||
$selwidget=$request->query->get('selwidget');
|
||||
|
||||
$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');
|
||||
}
|
||||
// Récupération de la requete
|
||||
$this->setRequest($request,$id,$access);
|
||||
|
||||
// Parametres
|
||||
$nbarticle=10;
|
||||
foreach($entity->getParameter()["fields"] as $parameter) {
|
||||
foreach($this->entity->getParameter()["fields"] as $parameter) {
|
||||
switch($parameter["id"]) {
|
||||
case "nbarticle":
|
||||
$nbarticle=$parameter["value"];
|
||||
@ -1521,76 +1357,56 @@ class PagewidgetController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
// Préference utilisateur
|
||||
$this->getPreference($entity);
|
||||
|
||||
// On récupère soit les projects du group en cours soit l'ensemble des projects de l'utilisateur
|
||||
$user=$this->getUser();
|
||||
if($usage=="group") {
|
||||
$projects=$em->getRepository("CadolesPortalBundle:Project")->getProjectsGroup($this->getUser(),$group);
|
||||
if($this->usage=="group") {
|
||||
$projects=$this->em->getRepository("CadolesPortalBundle:Project")->getProjectsGroup($this->getUser(),$this->group);
|
||||
if($projects) $firstproject=$projects[0]->getId();
|
||||
}
|
||||
else {
|
||||
$em->getRepository("CadolesPortalBundle:Project")->getProjectsUser($user,$projectsuser,$projectsadmin,$projectsshared);
|
||||
$this->em->getRepository("CadolesPortalBundle:Project")->getProjectsUser($user,$projectsuser,$projectsadmin,$projectsshared);
|
||||
$projects=array_merge($projectsuser,$projectsadmin->toArray(),$projectsshared);
|
||||
$firstproject="all";
|
||||
}
|
||||
|
||||
|
||||
// On récupère les nbarticle de ses projects
|
||||
$em->getRepository("CadolesPortalBundle:Projecttask")->getProjectsTasks($projects,0,$nbarticle,$count,$projecttasks);
|
||||
$this->em->getRepository("CadolesPortalBundle:Projecttask")->getProjectsTasks($projects,0,$nbarticle,$count,$projecttasks);
|
||||
|
||||
foreach($projecttasks as $key => $projecttask) {
|
||||
if($projecttask->getPercentage()==100) unset($projecttasks[$key]);
|
||||
}
|
||||
|
||||
if($usage!="group") {
|
||||
if($this->usage!="group") {
|
||||
foreach($projecttasks as $key => $projecttask) {
|
||||
if(!$user) unset($projecttasks[$key]);
|
||||
else {
|
||||
if($projecttask->getUser() && $projecttask->getUser()!=$user) unset($projecttasks[$key]);
|
||||
elseif($projecttask->getOwner() && $projecttask->getOwner()!=$user) unset($projecttasks[$key]);
|
||||
if($projecttask->getUser() && $projecttask->getUser()!=$user)
|
||||
unset($projecttasks[$key]);
|
||||
elseif(!$projecttask->getUser() && $projecttask->getOwner() && $projecttask->getOwner()!=$user)
|
||||
unset($projecttasks[$key]);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Render
|
||||
return $this->render($this->labelentity.':viewproject.html.twig', [
|
||||
'entity' => $entity,
|
||||
'canadd' => $canupdate,
|
||||
'canupdate' => $canupdate,
|
||||
return $this->getRender('viewproject.html.twig', [
|
||||
'canadd' => $this->canupdate,
|
||||
'projecttasks' => $projecttasks,
|
||||
'nbarticle' => $nbarticle,
|
||||
'access' => $access,
|
||||
'firstproject' => $firstproject,
|
||||
'usage' => $usage,
|
||||
'look' => $look,
|
||||
'mini' => ($look=="list"&&$entity->getId()!=$selwidget),
|
||||
'usage' => $this->usage,
|
||||
]);
|
||||
}
|
||||
|
||||
public function viewseparatorAction(Request $request,$id,$access="config") {
|
||||
$look=$request->query->get('look');
|
||||
$selwidget=$request->query->get('selwidget');
|
||||
|
||||
$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');
|
||||
}
|
||||
// Récupération de la requete
|
||||
$this->setRequest($request,$id,$access);
|
||||
|
||||
// Parametres
|
||||
$seetitle=false;
|
||||
$seeicon=false;
|
||||
foreach($entity->getParameter()["fields"] as $parameter) {
|
||||
foreach($this->entity->getParameter()["fields"] as $parameter) {
|
||||
switch($parameter["id"]) {
|
||||
case "seetitle":
|
||||
$seetitle=boolval($parameter["value"]);
|
||||
@ -1601,44 +1417,21 @@ class PagewidgetController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
// Préference utilisateur
|
||||
$this->getPreference($entity);
|
||||
|
||||
// Render
|
||||
return $this->render($this->labelentity.':viewseparator.html.twig', [
|
||||
'entity' => $entity,
|
||||
'canadd' => $canupdate,
|
||||
'canupdate' => $canupdate,
|
||||
return $this->getRender('viewseparator.html.twig', [
|
||||
'canadd' => $this->canupdate,
|
||||
'seetitle' => $seetitle,
|
||||
'seeicon' => $seeicon,
|
||||
'access' => $access,
|
||||
'look' => $look,
|
||||
'mini' => ($look=="list"&&$entity->getId()!=$selwidget),
|
||||
]);
|
||||
}
|
||||
|
||||
public function viewclockAction(Request $request,$id,$access="config") {
|
||||
$look=$request->query->get('look');
|
||||
$selwidget=$request->query->get('selwidget');
|
||||
|
||||
$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');
|
||||
}
|
||||
// Récupération de la requete
|
||||
$this->setRequest($request,$id,$access);
|
||||
|
||||
// Parametres
|
||||
$clock="0";
|
||||
foreach($entity->getParameter()["fields"] as $parameter) {
|
||||
foreach($this->entity->getParameter()["fields"] as $parameter) {
|
||||
switch($parameter["id"]) {
|
||||
case "clock":
|
||||
$clock=$parameter["value"];
|
||||
@ -1646,79 +1439,33 @@ class PagewidgetController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
// Préference utilisateur
|
||||
$this->getPreference($entity);
|
||||
|
||||
// Render
|
||||
return $this->render($this->labelentity.':viewframe.html.twig', [
|
||||
'entity' => $entity,
|
||||
'canadd' => $canupdate,
|
||||
'canupdate' => $canupdate,
|
||||
return $this->getRender('viewframe.html.twig', [
|
||||
'canadd' => $this->canupdate,
|
||||
'onheader' => true,
|
||||
'tool' => ($clock==0?"cadoles_portal_user_tool_clockanalogique":"cadoles_portal_user_tool_clocknumerique"),
|
||||
'access' => $access,
|
||||
'look' => $look,
|
||||
'mini' => ($look=="list"&&$entity->getId()!=$selwidget),
|
||||
]);
|
||||
}
|
||||
|
||||
public function viewcalculatorAction(Request $request,$id,$access="config") {
|
||||
$look=$request->query->get('look');
|
||||
$selwidget=$request->query->get('selwidget');
|
||||
|
||||
$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');
|
||||
}
|
||||
|
||||
// Préference utilisateur
|
||||
$this->getPreference($entity);
|
||||
// Récupération de la requete
|
||||
$this->setRequest($request,$id,$access);
|
||||
|
||||
// Render
|
||||
return $this->render($this->labelentity.':viewframe.html.twig', [
|
||||
'entity' => $entity,
|
||||
'canadd' => $canupdate,
|
||||
'canupdate' => $canupdate,
|
||||
return $this->getRender('viewframe.html.twig', [
|
||||
'canadd' => $this->canupdate,
|
||||
'onheader' => true,
|
||||
'tool' => "cadoles_portal_user_tool_calculator",
|
||||
'access' => $access,
|
||||
'look' => $look,
|
||||
'mini' => ($look=="list"&&$entity->getId()!=$selwidget),
|
||||
'tool' => "cadoles_portal_user_tool_calculator",
|
||||
]);
|
||||
}
|
||||
|
||||
public function viewappexternalAction(Request $request,$id,$access="config") {
|
||||
$look=$request->query->get('look');
|
||||
$selwidget=$request->query->get('selwidget');
|
||||
|
||||
$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');
|
||||
}
|
||||
// Récupération de la requete
|
||||
$this->setRequest($request,$id,$access);
|
||||
|
||||
// Récupération des paramétres du widget
|
||||
$idappexternal=null;
|
||||
foreach($entity->getParameter()["fields"] as $parameter) {
|
||||
foreach($this->entity->getParameter()["fields"] as $parameter) {
|
||||
switch($parameter["id"]) {
|
||||
case "appexternal":
|
||||
$idappexternal=$parameter["value"];
|
||||
@ -1729,15 +1476,12 @@ class PagewidgetController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
// Préference utilisateur
|
||||
$this->getPreference($entity);
|
||||
|
||||
$user=$this->getUser();
|
||||
$items=[];
|
||||
$itemcategorys=[];
|
||||
if($user) {
|
||||
if($idappexternal) $appextenals=$em->getRepository("CadolesPortalBundle:Appexternal")->findBy(["id"=>$idappexternal]);
|
||||
else $appextenals=$em->getRepository("CadolesPortalBundle:Appexternal")->findAll();
|
||||
if($idappexternal) $appextenals=$this->em->getRepository("CadolesPortalBundle:Appexternal")->findBy(["id"=>$idappexternal]);
|
||||
else $appextenals=$this->em->getRepository("CadolesPortalBundle:Appexternal")->findAll();
|
||||
foreach($appextenals as $appexternal) {
|
||||
switch($appexternal->getName()) {
|
||||
case "Limesurvey":
|
||||
@ -1790,161 +1534,86 @@ class PagewidgetController extends Controller
|
||||
array_multisort($title, SORT_ASC, $items);
|
||||
|
||||
// Render
|
||||
return $this->render($this->labelentity.':viewappexternal.html.twig', [
|
||||
'entity' => $entity,
|
||||
return $this->getRender('viewappexternal.html.twig', [
|
||||
'canadd' => ($user),
|
||||
'canupdate' => $canupdate,
|
||||
'modedesktop' => $modedesktop,
|
||||
'items' => $items,
|
||||
'itemcategorys' => $itemcategorys,
|
||||
'access' => $access,
|
||||
'look' => $look,
|
||||
'mini' => ($look=="list"&&$entity->getId()!=$selwidget),
|
||||
'itemcategorys' => $itemcategorys,
|
||||
]);
|
||||
}
|
||||
|
||||
public function viewinfoAction(Request $request,$id,$access="config") {
|
||||
$usage=$request->query->get('usage');
|
||||
$group=$request->query->get('group');
|
||||
$look=$request->query->get('look');
|
||||
$selwidget=$request->query->get('selwidget');
|
||||
$user=$this->getUser();
|
||||
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$entity = $em->getRepository($this->labelentity)->find($id);
|
||||
if (!$entity) throw $this->createNotFoundException('Unable to find entity.');
|
||||
$page=$entity->getPage();
|
||||
|
||||
// Permissions
|
||||
if($access=="config") {
|
||||
$canupdate = true;
|
||||
}
|
||||
else {
|
||||
// On s'assure que l'utilisateur à la permission de voir
|
||||
$em->getRepository("CadolesPortalBundle:Page")->getPermission($this->getUser(),$page,$cansee,$canupdate);
|
||||
if(!$cansee) throw $this->createNotFoundException('Permission denied');
|
||||
}
|
||||
|
||||
// Préference utilisateur
|
||||
$this->getPreference($entity);
|
||||
// Récupération de la requete
|
||||
$this->setRequest($request,$id,$access);
|
||||
|
||||
$icon=null;
|
||||
$title=null;
|
||||
$description=null;
|
||||
$members=[];
|
||||
if($usage=="group") {
|
||||
$group=$em->getRepository("CadolesCoreBundle:Group")->find($group);
|
||||
if($group) {
|
||||
$title=$group->getLabel();
|
||||
$id=$group->getId();
|
||||
if($group->getDescription())
|
||||
$description="<strong>Description</strong><br>".$group->getDescription();
|
||||
if($group->getIcon())
|
||||
$icon="/".$group->getIcon()->getLabel();
|
||||
if($this->usage=="group") {
|
||||
$groupentity=$this->em->getRepository("CadolesCoreBundle:Group")->find($this->group);
|
||||
if($groupentity) {
|
||||
$title=$this->entity->getPage()->getName();
|
||||
$id=$groupentity->getId();
|
||||
if($groupentity->getDescription())
|
||||
$description="<strong>Description</strong><br>".$groupentity->getDescription();
|
||||
if($groupentity->getIcon())
|
||||
$icon="/".$groupentity->getIcon()->getLabel();
|
||||
|
||||
|
||||
foreach($group->getUsers() as $usergroup) {
|
||||
|
||||
foreach($groupentity->getUsers() as $usergroup) {
|
||||
array_push($members,$usergroup);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
$title=$entity->getPage()->getName();
|
||||
$proprio=$entity->getPage()->getUser();
|
||||
$title=$this->entity->getPage()->getName();
|
||||
$proprio=$this->entity->getPage()->getUser();
|
||||
$id=0;
|
||||
if($proprio) {
|
||||
$description="Propriétaire de la page<br>".$proprio->getLastname()." ".$proprio->getLastname();
|
||||
$icon="/uploads/avatar/".$proprio->getAvatar();
|
||||
}
|
||||
}
|
||||
|
||||
// Render
|
||||
return $this->render($this->labelentity.':viewinfo.html.twig', [
|
||||
'entity' => $entity,
|
||||
'canadd' => $canupdate,
|
||||
'canupdate' => $canupdate,
|
||||
'usage' => $usage,
|
||||
return $this->getRender('viewinfo.html.twig', [
|
||||
'canadd' => $this->canupdate,
|
||||
'usage' => $this->usage,
|
||||
'icon' => $icon,
|
||||
'title' => $title,
|
||||
'description' => $description,
|
||||
'members' => $members,
|
||||
'id' => $id,
|
||||
'idpage' => $page->getId(),
|
||||
'look' => $look,
|
||||
'mini' => ($look=="list"&&$entity->getId()!=$selwidget),
|
||||
'idpage' => $this->entity->getPage()->getId(),
|
||||
]);
|
||||
}
|
||||
|
||||
public function viewchatAction(Request $request,$id,$access="config") {
|
||||
$usage=$request->query->get('usage');
|
||||
$group=$request->query->get('group');
|
||||
$look=$request->query->get('look');
|
||||
$selwidget=$request->query->get('selwidget');
|
||||
// Récupération de la requete
|
||||
$this->setRequest($request,$id,$access);
|
||||
|
||||
$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');
|
||||
}
|
||||
|
||||
// Préference utilisateur
|
||||
$this->getPreference($entity);
|
||||
|
||||
if($usage!="group"||!$group) {
|
||||
$group=$em->getRepository("CadolesCoreBundle:Group")->findOneBy(["fgall"=>true])->getId();
|
||||
$group=$this->group;
|
||||
if($this->usage!="group"||!$group) {
|
||||
$group=$this->em->getRepository("CadolesCoreBundle:Group")->findOneBy(["fgall"=>true])->getId();
|
||||
}
|
||||
|
||||
// Render
|
||||
return $this->render($this->labelentity.':viewchat.html.twig', [
|
||||
'entity' => $entity,
|
||||
'canadd' => $canupdate,
|
||||
'canupdate' => $canupdate,
|
||||
return $this->getRender('viewchat.html.twig', [
|
||||
'canadd' => $this->canupdate,
|
||||
'onheader' => false,
|
||||
'tool' => "cadoles_websocket_chat",
|
||||
'access' => $access,
|
||||
'usage' => $usage,
|
||||
'usage' => $this->usage,
|
||||
'group' => $group,
|
||||
'look' => $look,
|
||||
'mini' => ($look=="list"&&$entity->getId()!=$selwidget),
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
public function viewgroupAction(Request $request,$id,$access="config") {
|
||||
$usage=$request->query->get('usage');
|
||||
$group=$request->query->get('group');
|
||||
$look=$request->query->get('look');
|
||||
$selwidget=$request->query->get('selwidget');
|
||||
// Récupération de la requete
|
||||
$this->setRequest($request,$id,$access);
|
||||
|
||||
$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');
|
||||
}
|
||||
|
||||
// Préference utilisateur
|
||||
$this->getPreference($entity);
|
||||
|
||||
$mygroups=[];
|
||||
$this->getDoctrine()->getRepository("CadolesPortalBundle:Page")->getPagesUser($user,null,$default,$pagesuser,$pagesadmin,$groupsshared);
|
||||
if(is_array($groupsshared)) {
|
||||
@ -1962,47 +1631,21 @@ class PagewidgetController extends Controller
|
||||
}
|
||||
|
||||
// Render
|
||||
return $this->render($this->labelentity.':viewgroup.html.twig', [
|
||||
'entity' => $entity,
|
||||
return $this->getRender('viewgroup.html.twig', [
|
||||
'canadd' => ($user),
|
||||
'canupdate' => $canupdate,
|
||||
'usage' => $usage,
|
||||
'usage' => $this->usage,
|
||||
'groups' => $mygroups,
|
||||
'look' => $look,
|
||||
'mini' => ($look=="list"&&$entity->getId()!=$selwidget),
|
||||
]);
|
||||
}
|
||||
|
||||
public function viewgroupmessageAction(Request $request,$id,$access="config") {
|
||||
$usage=$request->query->get('usage');
|
||||
$group=$request->query->get('group');
|
||||
$look=$request->query->get('look');
|
||||
$selwidget=$request->query->get('selwidget');
|
||||
|
||||
$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');
|
||||
}
|
||||
|
||||
// Préference utilisateur
|
||||
$this->getPreference($entity);
|
||||
|
||||
// Récupération de la requete
|
||||
$this->setRequest($request,$id,$access);
|
||||
|
||||
// Récupération des paramétres du widget
|
||||
$modelist=1;
|
||||
$nbarticle=5;
|
||||
foreach($entity->getParameter()["fields"] as $parameter) {
|
||||
foreach($this->entity->getParameter()["fields"] as $parameter) {
|
||||
switch($parameter["id"]) {
|
||||
case "modelist":
|
||||
$modelist=$parameter["value"];
|
||||
@ -2013,8 +1656,8 @@ class PagewidgetController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
$mygroups=[];
|
||||
$mymsg= [];
|
||||
$user=$this->getUser();
|
||||
$this->getDoctrine()->getRepository("CadolesPortalBundle:Page")->getPagesUser($user,null,$default,$pagesuser,$pagesadmin,$groupsshared);
|
||||
if(is_array($groupsshared)) {
|
||||
foreach($groupsshared as $groupshared) {
|
||||
@ -2050,48 +1693,23 @@ class PagewidgetController extends Controller
|
||||
|
||||
|
||||
// Render
|
||||
return $this->render($this->labelentity.':viewgroupmessage.html.twig', [
|
||||
'entity' => $entity,
|
||||
return $this->getRender('viewgroupmessage.html.twig', [
|
||||
'canadd' => ($user),
|
||||
'canupdate' => $canupdate,
|
||||
'usage' => $usage,
|
||||
'usage' => $this->usage,
|
||||
'modelist' => $modelist,
|
||||
'messages' => $mymsg,
|
||||
'nbarticle' => $nbarticle,
|
||||
'look' => $look,
|
||||
'mini' => ($look=="list"&&$entity->getId()!=$selwidget),
|
||||
]);
|
||||
}
|
||||
|
||||
public function viewOnlydocAction(Request $request,$id,$access="config") {
|
||||
$usage=$request->query->get('usage');
|
||||
$group=$request->query->get('group');
|
||||
$look=$request->query->get('look');
|
||||
$selwidget=$request->query->get('selwidget');
|
||||
|
||||
$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;
|
||||
$cansee = 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');
|
||||
}
|
||||
|
||||
// Récupération de la requete
|
||||
$this->setRequest($request,$id,$access);
|
||||
|
||||
// Récupération des paramétres du widget
|
||||
$apponly=0;
|
||||
$view="small";
|
||||
foreach($entity->getParameter()["fields"] as $parameter) {
|
||||
foreach($this->entity->getParameter()["fields"] as $parameter) {
|
||||
switch($parameter["id"]) {
|
||||
case "apponly":
|
||||
$apponly=$parameter["value"];
|
||||
@ -2101,19 +1719,11 @@ class PagewidgetController extends Controller
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Préference utilisateur
|
||||
$this->getPreference($entity);
|
||||
|
||||
return $this->render($this->labelentity.':viewonlydoc.html.twig', [
|
||||
'entity' => $entity,
|
||||
'canadd' => $canupdate,
|
||||
'canupdate' => $canupdate,
|
||||
'access' => $access,
|
||||
|
||||
return $this->getRender('viewonlydoc.html.twig', [
|
||||
'canadd' => $this->canupdate,
|
||||
'directory' => $id,
|
||||
'view' => $view,
|
||||
'look' => $look,
|
||||
'mini' => ($look=="list"&&$entity->getId()!=$selwidget),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
@ -362,7 +362,7 @@ class ProjectController extends Controller
|
||||
if($groups[0]) {
|
||||
if($groups[0]->getFgcanshare()) {
|
||||
$pages=$groups[0]->getPages();
|
||||
if($pages) {
|
||||
if($pages[0]) {
|
||||
$idpage=$pages[0]->getId();
|
||||
$groups=$pages[0]->getGroups();
|
||||
$idgroup=$groups[0]->getId();
|
||||
@ -410,7 +410,6 @@ class ProjectController extends Controller
|
||||
}
|
||||
|
||||
if(!$cansee) throw $this->createNotFoundException('Permission denied');
|
||||
|
||||
$canupdate=$this->get('session')->get('cancreateproject');
|
||||
}
|
||||
|
||||
|
@ -116,6 +116,7 @@ class ProjecttaskController extends Controller
|
||||
$user=$this->getUser();
|
||||
$em->getRepository("CadolesPortalBundle:Project")->getPermission($user,$entity->getProject(),$cansee,$canupdate,$canadd);
|
||||
if($user && ((is_null($entity->getUser()) && $user==$entity->getOwner()) || $user==$entity->getUser())) $canadd=true;
|
||||
else $canadd = $em->getRepository("CadolesPortalBundle:Project")->getInvalideur($user,$entity->getProject());
|
||||
if(!$canadd) throw $this->createNotFoundException('Permission denied');
|
||||
}
|
||||
|
||||
@ -180,6 +181,7 @@ class ProjecttaskController extends Controller
|
||||
$user=$this->getUser();
|
||||
$em->getRepository("CadolesPortalBundle:Project")->getPermission($user,$entity->getProject(),$cansee,$canupdate,$canadd);
|
||||
if($user && ((is_null($entity->getUser()) && $user==$entity->getOwner()) || $user==$entity->getUser())) $canadd=true;
|
||||
else $canadd = $em->getRepository("CadolesPortalBundle:Project")->getInvalideur($user,$entity->getProject());
|
||||
|
||||
if(!$canadd) throw $this->createNotFoundException('Permission denied');
|
||||
}
|
||||
@ -205,7 +207,7 @@ class ProjecttaskController extends Controller
|
||||
if($groups[0]) {
|
||||
if($groups[0]->getFgcanshare()) {
|
||||
$pages=$groups[0]->getPages();
|
||||
if($pages) {
|
||||
if($pages[0]) {
|
||||
$idpage=$pages[0]->getId();
|
||||
$groups=$pages[0]->getGroups();
|
||||
$idgroup=$groups[0]->getId();
|
||||
@ -233,6 +235,7 @@ class ProjecttaskController extends Controller
|
||||
}
|
||||
else {
|
||||
$em->getRepository("CadolesPortalBundle:Project")->getPermission($user,$entity->getProject(),$cansee,$canupdate,$canadd);
|
||||
$canadd = $em->getRepository("CadolesPortalBundle:Project")->getInvalideur($user,$entity->getProject());
|
||||
}
|
||||
|
||||
if(!$cansee) throw $this->createNotFoundException('Permission denied');
|
||||
@ -266,17 +269,6 @@ class ProjecttaskController extends Controller
|
||||
$tmp["thumb"]="";
|
||||
if($tmp["extension"]=="pdf") {
|
||||
$tmp["thumb"]="/".$this->getParameter('alias')."/bundles/cadolescore/images/files/".$tmp["extension"].".png";
|
||||
|
||||
/* ne plus afficher l'apercu du pdf
|
||||
if($fs->exists($directory."/thumbmini/".$tmp["name"])) {
|
||||
$data = file_get_contents($directory."/thumbmini/".$tmp["name"]);
|
||||
$tmp["thumb"]="data:image/jpg;base64," . base64_encode($data);
|
||||
}
|
||||
elseif($fs->exists($directory."/thumb/".$tmp["name"])) {
|
||||
$data = file_get_contents($directory."/thumb/".$tmp["name"]);
|
||||
$tmp["thumb"]="data:image/jpg;base64," . base64_encode($data);
|
||||
}
|
||||
*/
|
||||
}
|
||||
elseif($fs->exists($directory."/thumbmini/".$tmp["name"])) {
|
||||
$data = file_get_contents($directory."/thumbmini/".$tmp["name"]);
|
||||
@ -353,7 +345,7 @@ class ProjecttaskController extends Controller
|
||||
$project=$em->getRepository("CadolesPortalBundle:Project")->find($projectid);
|
||||
if($project) {
|
||||
$user=$this->getUser();
|
||||
$em->getRepository("CadolesPortalBundle:Project")->getPermission($user,$project,$cansee,$canupdate,$canadd);
|
||||
$canadd = $em->getRepository("CadolesPortalBundle:Project")->getInvalideur($user,$project);
|
||||
|
||||
// Si permission alors il peut affecter tt les personnes du groupe
|
||||
if($canadd||$access=="config") {
|
||||
@ -405,9 +397,8 @@ class ProjecttaskController extends Controller
|
||||
// On s'assure que l'utilisateur à la permission de modifier
|
||||
if($access=="user") {
|
||||
$user=$this->getUser();
|
||||
$em->getRepository("CadolesPortalBundle:Project")->getPermission($user,$entity->getProject(),$cansee,$canupdate,$canadd);
|
||||
if($user && ((is_null($entity->getUser()) && $user==$entity->getOwner()) || $user==$entity->getUser())) $canadd=true;
|
||||
|
||||
else $canadd = $em->getRepository("CadolesPortalBundle:Project")->getInvalideur($user,$entity->getProject());
|
||||
if(!$canadd) throw $this->createNotFoundException('Permission denied');
|
||||
}
|
||||
|
||||
|
@ -37,8 +37,8 @@ class SlideController extends Controller
|
||||
}
|
||||
else {
|
||||
$groupentity=$this->getDoctrine()->getRepository("CadolesCoreBundle:Group")->find($group);
|
||||
$fgmanager=$this->getDoctrine()->getRepository("CadolesCoreBundle:UserGroup")->findoneby(["user"=>$this->getUser(),"group"=>$groupentity,"fgmanager"=>true]);
|
||||
if(!$fgmanager) throw $this->createNotFoundException('Permission denied');
|
||||
$usergroup=$this->getDoctrine()->getRepository("CadolesCoreBundle:UserGroup")->findoneby(["user"=>$this->getUser(),"group"=>$groupentity]);
|
||||
if(!$usergroup||$usergroup->getRolegroup()<50) throw $this->createNotFoundException('Permission denied');
|
||||
}
|
||||
}
|
||||
|
||||
@ -81,8 +81,8 @@ class SlideController extends Controller
|
||||
}
|
||||
else {
|
||||
$groupentity=$this->getDoctrine()->getRepository("CadolesCoreBundle:Group")->find($group);
|
||||
$fgmanager=$this->getDoctrine()->getRepository("CadolesCoreBundle:UserGroup")->findoneby(["user"=>$this->getUser(),"group"=>$groupentity,"fgmanager"=>true]);
|
||||
if(!$fgmanager) throw $this->createNotFoundException('Permission denied');
|
||||
$usergroup=$this->getDoctrine()->getRepository("CadolesCoreBundle:UserGroup")->findoneby(["user"=>$this->getUser(),"group"=>$groupentity]);
|
||||
if(!$usergroup||$usergroup->getRolegroup()<50) throw $this->createNotFoundException('Permission denied');
|
||||
}
|
||||
}
|
||||
|
||||
@ -142,8 +142,8 @@ class SlideController extends Controller
|
||||
}
|
||||
else {
|
||||
$groupentity=$this->getDoctrine()->getRepository("CadolesCoreBundle:Group")->find($group);
|
||||
$fgmanager=$this->getDoctrine()->getRepository("CadolesCoreBundle:UserGroup")->findoneby(["user"=>$this->getUser(),"group"=>$groupentity,"fgmanager"=>true]);
|
||||
if(!$fgmanager) throw $this->createNotFoundException('Permission denied');
|
||||
$usergroup=$this->getDoctrine()->getRepository("CadolesCoreBundle:UserGroup")->findoneby(["user"=>$this->getUser(),"group"=>$groupentity]);
|
||||
if(!$usergroup||$usergroup->getRolegroup()<50) throw $this->createNotFoundException('Permission denied');
|
||||
}
|
||||
}
|
||||
|
||||
@ -206,8 +206,8 @@ class SlideController extends Controller
|
||||
}
|
||||
else {
|
||||
$groupentity=$this->getDoctrine()->getRepository("CadolesCoreBundle:Group")->find($group);
|
||||
$fgmanager=$this->getDoctrine()->getRepository("CadolesCoreBundle:UserGroup")->findoneby(["user"=>$this->getUser(),"group"=>$groupentity,"fgmanager"=>true]);
|
||||
if(!$fgmanager) throw $this->createNotFoundException('Permission denied');
|
||||
$usergroup=$this->getDoctrine()->getRepository("CadolesCoreBundle:UserGroup")->findoneby(["user"=>$this->getUser(),"group"=>$groupentity]);
|
||||
if(!$usergroup||$usergroup->getRolegroup()<50) throw $this->createNotFoundException('Permission denied');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -39,6 +39,20 @@ class SyncenvoleController extends Controller
|
||||
]);
|
||||
}
|
||||
|
||||
public function cdtAction()
|
||||
{
|
||||
$url=$this->getParameter("widcdt_syncenvole");
|
||||
$color=$this->get('session')->get('colormain');
|
||||
$themename=$this->get('session')->get("theme");
|
||||
|
||||
return $this->render('CadolesPortalBundle:Tool:frame.html.twig', [
|
||||
'useheader' => true,
|
||||
'usemenu' => false,
|
||||
'usesidebar' => true,
|
||||
'url' => $url."/synchro.php?app=cdt&color=#color#"
|
||||
]);
|
||||
}
|
||||
|
||||
public function gepiannuAction()
|
||||
{
|
||||
$url=$this->getParameter("widgepi_syncenvole");
|
||||
|
@ -149,7 +149,7 @@ class Alert
|
||||
{
|
||||
$today = new \DateTime();
|
||||
if (null === $this->unpublishedat) {
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
if ($this->unpublishedat->getTimestamp() < $today->getTimestamp()) {
|
||||
return true;
|
||||
|
@ -132,6 +132,17 @@ class Calendar
|
||||
return $this;
|
||||
}
|
||||
|
||||
private $canadd;
|
||||
public function getCanadd()
|
||||
{
|
||||
return $this->canadd;
|
||||
}
|
||||
public function setCanadd($canadd)
|
||||
{
|
||||
$this->canadd = $canadd;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/* Password User */
|
||||
public function setPassword($password)
|
||||
{
|
||||
|