diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/data/core-init-01.sql b/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/data/core-init-01.sql index 850ded2f..cac76840 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/data/core-init-01.sql +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/data/core-init-01.sql @@ -1,15 +1,13 @@ - SET NAMES utf8; SET time_zone = '+00:00'; SET foreign_key_checks = 0; SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO'; INSERT IGNORE INTO `niveau01` (`id`, `label`, `siren`) VALUES -(-100, 'ldapbundle', '0000000A'); +(-100, 'BER', 'BERSIREN'); INSERT IGNORE INTO `user` (`id`, `niveau01_id`, `username`, `firstname`, `lastname`, `password`, `email`, `avatar`, `role`,`siren`,`authlevel`) VALUES -(-100, -100, 'admin', 'Administrateur', 'ldapbundle', 'PWD_CAS', 'admin@ldapbundle.ac-arno.fr', 'admin.jpg', 'ROLE_ADMIN', '0000000A', 'simple'); - +(-100, -100, 'admin', 'Administrateur', 'BER', '', 'admin.ber-assos.fr', 'admin.jpg', 'ROLE_ADMIN', 'BERSIREN', 'simple'); TRUNCATE TABLE sidebar; @@ -47,7 +45,7 @@ INSERT IGNORE INTO `config` (`order`, `visible`, `changeable`, `required`, `type ('002', 1, 0, 1, 'string', 'version', '1.0.0', '', 'Version de l\'application'), ('003', 1, 1, 0, 'string', 'subappname', 'Portail', '', 'Le sous titre de votre site'), ('004', 1, 1, 1, 'logo', 'logo', 'uploads/logo/logo.png', '', 'Le logo de votre site'), -('005', 0, 1, 0, 'theme', 'theme', '', '', 'Le theme de votre site'), +('005', 1, 1, 0, 'theme', 'theme', '', '', 'Le theme de votre site'), ('040', 1, 1, 1, 'boolean', 'fgheader', '1', '', 'Utiliser une image en bannière du site'), @@ -60,6 +58,6 @@ INSERT IGNORE INTO `config` (`order`, `visible`, `changeable`, `required`, `type ('060', 1, 1, 1, 'font', 'fontfacetitle', 'Anton-Regular', '', 'Police des titres de votre site'), ('061', 1, 1, 1, 'font', 'fontfacebody', 'Helvetica', '', 'Police des titres de votre site'), -('200', 1, 0, 1, 'boolean', 'PROXYactivate', '1', '', 'Définit un Proxy'), -('201', 1, 0, 1, 'string', 'PROXYserver', '192.168.57.160', 'PROXYactivate','Adresse du Proxy'), -('202', 1, 0, 1, 'string', 'PROXYport', '8080', 'PROXYactivate','Port du Proxy'); +('200', 1, 0, 1, 'boolean', 'PROXYactivate', '0', '', 'Définit un Proxy'), +('201', 1, 0, 1, 'string', 'PROXYserver', '', 'PROXYactivate','Adresse du Proxy'), +('202', 1, 0, 1, 'string', 'PROXYport', '', 'PROXYactivate','Port du Proxy'); diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Command/SynchroICSCommand.php b/src/ninegate-1.0/src/Cadoles/PortalBundle/Command/SynchroICSCommand.php index cc466c56..9c930f16 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Command/SynchroICSCommand.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Command/SynchroICSCommand.php @@ -547,26 +547,38 @@ class SynchroICSCommand extends Command $this->writeln("connected"); $this->writeln(""); $tbuid=array(); - $arrayOfCalendars = $client->findCalendars(); + $arrayOfCalendars = $client->findCalendars("afornerot"); foreach($arrayOfCalendars as $calcalendar) { + if($calcalendar->getDisplayName()!=$calendar->getCaldavname()) continue; + $client->setCalendar($calcalendar); $events = $client->getEvents(); foreach ($events as $calevent) { $event=$this->icsToArray($calevent->getData())[2]; + + foreach($event as $key => $value) { + if (strpos($key, 'DTSTART') === 0) $event["DTSTART"]=new \datetime($value); + if (strpos($key, 'DTEND') === 0) $event["DTEND"]=new \datetime($value); + } $event["SUMMARY"] = (isset($event["SUMMARY"])?$event["SUMMARY"]:""); $event["DESCRIPTION"] = (isset($event["DESCRIPTION"])?$event["DESCRIPTION"]:""); - $event["DTSTART"] = (isset($event["DTSTART;VALUE=DATE"])?new \datetime($event["DTSTART;VALUE=DATE"]):""); - $event["DTEND"] = (isset($event["DTEND;VALUE=DATE"])?new \datetime($event["DTEND;VALUE=DATE"]):""); $event["ALLDAY"] = (isset($event["ALLDAY"])?$event["ALLDAY"]:""); $event["SEQUENCE"] = (isset($event["SEQUENCE"])?$event["SEQUENCE"]:""); $event["UID"] = (isset($event["UID"])?$event["UID"]:""); + $event["DURATION"] = (isset($event["DURATION"])?$event["DURATION"]:""); if($event["UID"]!="") { // On sauvegarde l'uid array_push($tbuid,$event["UID"]); - + + if(!isset($event["DTEND"])&&isset($event["DURATION"])) { + $event["DTEND"]=clone $event["DTSTART"]; + $event["DTEND"]->add(new \DateInterval($event["DURATION"])); + } + + // Allday ? $allday=0; if($event["ALLDAY"]==1||$event["SEQUENCE"]>=1) @@ -641,7 +653,7 @@ class SynchroICSCommand extends Command //dump($subValue); $subValueArr = explode(":", $subValue, 2); //dump($subValueArr); - $icsDates[$key][$subValueArr[0]] = $subValueArr[1]; + if(key_exists(1,$subValueArr)) $icsDates[$key][$subValueArr[0]] = $subValueArr[1]; } } } diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Entity/Calendar.php b/src/ninegate-1.0/src/Cadoles/PortalBundle/Entity/Calendar.php index a3f9b296..848b5949 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Entity/Calendar.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Entity/Calendar.php @@ -67,6 +67,12 @@ class Calendar */ private $login; + /** + * @var string + * + * @ORM\Column(name="caldavname", type="string", nullable=true) + */ + private $caldavname; /** * @var string @@ -340,7 +346,29 @@ class Calendar return $this->login; } + /** + * Set caldavname + * + * @param string $caldavname + * + * @return Calendar + */ + public function setCaldavname($caldavname) + { + $this->caldavname = $caldavname; + return $this; + } + + /** + * Get caldavname + * + * @return string + */ + public function getCaldavname() + { + return $this->caldavname; + } /** * Set salt @@ -365,7 +393,7 @@ class Calendar { return $this->salt; } - + /** * Set roles * diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Form/CalendarType.php b/src/ninegate-1.0/src/Cadoles/PortalBundle/Form/CalendarType.php index 10a1ab2c..18bdf864 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Form/CalendarType.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Form/CalendarType.php @@ -49,6 +49,11 @@ class CalendarType extends AbstractType 'required' => false, ]) + ->add('caldavname', TextType::class, [ + 'label' => "Nom du Calendrier CalDAV", + 'required' => false, + ]) + ->add('login', TextType::class, [ 'label' => "Login", 'required' => false, diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Calendar/edit.html.twig b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Calendar/edit.html.twig index 49410141..b4b4daf1 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Calendar/edit.html.twig +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Calendar/edit.html.twig @@ -58,6 +58,7 @@ {{ form_row(form.url) }}