diff --git a/atelier.php b/atelier.php index 9531c57..444f758 100644 --- a/atelier.php +++ b/atelier.php @@ -1,4 +1,7 @@ ] [--heure=] [action=] [cat=] atelier.php --action=sondage --date=<01/01/20> --heure=<10h30> atelier.php --action=sendmail [cat=] @@ -58,15 +50,23 @@ Avec l'argument --action=sendmail, elle envoi un mail contenant la liste des ate \t\t--courriel\tadresse courriel du destinataire "; +}else +{ + if ( empty($action) ) + { + // affiche le résumé des sondages + require_once("recap.php"); + recap(); }else { - switch ($opt["action"]) + + switch ($action) { case "sondage": // sondage => crée un nouveau sondage // enregistre le sondage dans la base opensurvey de dolibarr echo "Création du sondage "; - $date_time = date_reservation( $opt["date"], $opt["heure"]); + $date_time = date_reservation( $date, $heure); if ( !verif_agenda( $date_time ) ) { echo 'La date est disponible'; @@ -78,8 +78,8 @@ Avec l'argument --action=sendmail, elle envoi un mail contenant la liste des ate $sondage->mail_admin = "contact@lalis.fr"; $sondage->nom_admin = "Daniel"; $sondage->titre = "Atelier du " . $opt["date"] . " à " . $opt["heure"]; - //$sondage->write($db); - echo $sondage; + $sondage->write($db); + print_r($sondage); $db->close(); // enregistre la réservation dans mrbs @@ -87,13 +87,14 @@ Avec l'argument --action=sendmail, elle envoi un mail contenant la liste des ate $db = new db("librepcfr", "librepc"); $reservation = new reservation( $date_time[ "ts_debut" ], $date_time["ts_fin"], addslashes(html_entity_decode($commentaires, ENT_QUOTES ))); - //$reservation->write($db); - echo $reservation . EOL; + $reservation->write($db); + print_r($reservation) . EOL; // envoi de l'évènement sur l'agenda nextcloud + require_once("send_nextcloud.php"); echo "Ajout à l'agenda Nextcloud" . EOL; require_once('send_nextcloud.php'); - //envoi_event($date_time, $opt, $base_url . "dbarr/public/opensurvey/studs.php?sondage=" . $sondage->id_sondage); + envoi_event($date_time, $opt, $base_url . "dbarr/public/opensurvey/studs.php?sondage=" . $sondage->id_sondage); }else { echo "La date n'est pas disponible."; @@ -102,7 +103,7 @@ Avec l'argument --action=sendmail, elle envoi un mail contenant la liste des ate break; case "sendmail": require_once("send_mail.php"); - //send_mail( $opt["cat"], (empty($opt["courriel"])?"": $opt["courriel"]) ); + send_mail( $cat, $courriel); break; } } diff --git a/config/calendriers.php b/config/calendriers.php index 818a5ff..f3dd8e1 100644 --- a/config/calendriers.php +++ b/config/calendriers.php @@ -3,7 +3,18 @@ $calendriers = array( array( "url" => 'https://librepc.ddns.net:10081/cloud/remote.php/dav/principals/users/daniel/', "nom" => 'daniel', "pw" => 'Highlander%42', - "cal" => 'perso' ) - + "cal" => 'default' ), + array( "url" => 'https://lalis69.ddns.net:10443/laliscloud/remote.php/dav/principals/users/DTux/', + "nom" => 'DTux', + "pw" => '69Daniel%001', + "cal" => 'personal' ), + array( "url" => 'https://lalis69.ddns.net:10443/laliscloud/remote.php/dav/principals/users/DTux/', + "nom" => 'DTux', + "pw" => '69Daniel%001', + "cal" => 'personal_shared_by_lalis' ), + array( "url" => 'https://lalis69.ddns.net:10443/laliscloud/remote.php/dav/principals/users/lalis/', + "nom" => 'lalis', + "pw" => 'Lalis69_cloud', + "cal" => 'personal' ), ); ?> diff --git a/config/listCalendars.php b/config/listCalendars.php deleted file mode 100644 index ddd28b6..0000000 --- a/config/listCalendars.php +++ /dev/null @@ -1,62 +0,0 @@ - - * - * Open this file in a webbrowser to view a list of all accessible calendars - * on the server and the information related to those calendars. It can be used - * to determine the calendar-id, needed for SimpleCalDAV. - * - * @package simpleCalDAV - */ - -require_once('./include/SimpleCalDAVClient.php'); - -if($_POST == null) { - echo ' -
-

This formular can be used to view a list of all accessible calendars on the server and the information related to those calendars. It can be used to determine the calendar-id, needed for SimpleCalDAV.

-

Calendar-URL:

-

Username:

-

Password:

- -
'; -} - -else { - $client = new SimpleCalDAVClient(); - - try { - $client->connect($_POST['url'], $_POST['user'], $_POST['pass']); - - $calendars = $client->findCalendars(); - - echo' -'; - - $i = 0; - foreach($calendars as $cal) { - $i++; - - echo ' - - - - - - - - '; - } - - echo ' -
Calendar #'.$i.'
URL: '.$cal->getURL().'
Display Name: '.$cal->getDisplayName().'
Calendar ID: '.$cal->getCalendarID().'
CTAG: '.$cal->getCTag().'
RBG-Color: '.$cal->getRBGcolor().'
Order: '.$cal->getOrder().'
'; - } - - catch (Exception $e) { - echo $e->__toString(); - } -} - -?> diff --git a/listCalendars.php b/listCalendars.php new file mode 100644 index 0000000..82f11d8 --- /dev/null +++ b/listCalendars.php @@ -0,0 +1,92 @@ + + * + * Open this file in a webbrowser to view a list of all accessible calendars + * on the server and the information related to those calendars. It can be used + * to determine the calendar-id, needed for SimpleCalDAV. + * + * @package simpleCalDAV + */ +require_once("session_init.php"); +require_once("config.inc.php"); +require_once('SimpleCalDAVClient.php'); +require_once('fonctions.php'); + +$param = array( + "url::", + "user::", + "help::", + "pass::", + ); +$optind=null; + +if ( !($opt = getopt( 'h::', $param, $optind)) ) +{ + echo "erreur de paramètre de la commande" . EOL; + exit(1); +} + +if( !empty(getopt("h")) or !empty(getopt("help")) ) +{ + echo "les arguments sont: + --url= + --user= + --pass="; +}else +{ + + $url = getpost("url"); + $user = getpost("user"); + $pass = getpost("pass"); + + if( empty($url)) + { + echo ' +
+

This formular can be used to view a list of all accessible calendars on the server and the information related to those calendars. It can be used to determine the calendar-id, needed for SimpleCalDAV.

+

Calendar-URL:

+

Username:

+

Password:

+ +
'; + } + + else { + $client = new SimpleCalDAVClient(); + + try { + $client->connect($url, $user, $pass); + $calendars = $client->findCalendars(); + + echo' + '; + + $i = 0; + foreach($calendars as $cal) + { + $i++; + + echo ' + + + + + + + + '; + } + + echo '
Calendar #'.$i.'
URL: '.$cal->getURL().'
Display Name: '.$cal->getDisplayName().'
Calendar ID: '.$cal->getCalendarID().'
CTAG: '.$cal->getCTag().'
RBG-Color: '.$cal->getRBGcolor().'
Order: '.$cal->getOrder().'
'; + + }catch (Exception $e) + { + echo $e->__toString(); + } + } +} + +?>