...
 
Commits (13)
.marker-cluster-small {
background-color: rgba(181, 226, 140, 0.6);
}
.marker-cluster-small div {
background-color: rgba(110, 204, 57, 0.6);
}
.marker-cluster-medium {
background-color: rgba(241, 211, 87, 0.6);
}
.marker-cluster-medium div {
background-color: rgba(240, 194, 12, 0.6);
}
.marker-cluster-large {
background-color: rgba(253, 156, 115, 0.6);
}
.marker-cluster-large div {
background-color: rgba(241, 128, 23, 0.6);
}
/* IE 6-8 fallback colors */
.leaflet-oldie .marker-cluster-small {
background-color: rgb(181, 226, 140);
}
.leaflet-oldie .marker-cluster-small div {
background-color: rgb(110, 204, 57);
}
.leaflet-oldie .marker-cluster-medium {
background-color: rgb(241, 211, 87);
}
.leaflet-oldie .marker-cluster-medium div {
background-color: rgb(240, 194, 12);
}
.leaflet-oldie .marker-cluster-large {
background-color: rgb(253, 156, 115);
}
.leaflet-oldie .marker-cluster-large div {
background-color: rgb(241, 128, 23);
}
.marker-cluster {
background-clip: padding-box;
border-radius: 20px;
}
.marker-cluster div {
width: 30px;
height: 30px;
margin-left: 5px;
margin-top: 5px;
text-align: center;
border-radius: 15px;
font: 12px "Helvetica Neue", Arial, Helvetica, sans-serif;
}
.marker-cluster span {
line-height: 30px;
}
\ No newline at end of file
.leaflet-cluster-anim .leaflet-marker-icon, .leaflet-cluster-anim .leaflet-marker-shadow {
-webkit-transition: -webkit-transform 0.3s ease-out, opacity 0.3s ease-in;
-moz-transition: -moz-transform 0.3s ease-out, opacity 0.3s ease-in;
-o-transition: -o-transform 0.3s ease-out, opacity 0.3s ease-in;
transition: transform 0.3s ease-out, opacity 0.3s ease-in;
}
.leaflet-cluster-spider-leg {
/* stroke-dashoffset (duration and function) should match with leaflet-marker-icon transform in order to track it exactly */
-webkit-transition: -webkit-stroke-dashoffset 0.3s ease-out, -webkit-stroke-opacity 0.3s ease-in;
-moz-transition: -moz-stroke-dashoffset 0.3s ease-out, -moz-stroke-opacity 0.3s ease-in;
-o-transition: -o-stroke-dashoffset 0.3s ease-out, -o-stroke-opacity 0.3s ease-in;
transition: stroke-dashoffset 0.3s ease-out, stroke-opacity 0.3s ease-in;
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -8,9 +8,13 @@
<link rel="shortcut icon" type="image/x-icon" href="adl/image/favicon.ico" />
<link rel="stylesheet" type="text/css" href="adl/css/calendar.css" />
<link rel="stylesheet" type="text/css" href="adl/css/font-awesome.min.css" />
<link rel="stylesheet" type="text/css" href="adl/css/fontawesome-all.min.css" />
<link rel="stylesheet" type="text/css" href="adl/css/jquery-ui.css" />
<link rel="stylesheet" href="adl/css/leaflet.css" />
<link rel="stylesheet" href="adl/css/MarkerCluster.css" />
<link rel="stylesheet" href="adl/css/MarkerCluster.Default.css" />
%rss_feeds%
%javascript%
</head>
......
......@@ -8,9 +8,13 @@
<link rel="shortcut icon" type="image/x-icon" href="adl/image/favicon.ico" />
<link rel="stylesheet" type="text/css" href="adl/css/calendar.css" />
<link rel="stylesheet" type="text/css" href="adl/css/font-awesome.min.css" />
<link rel="stylesheet" type="text/css" href="adl/css/fontawesome-all.min.css" />
<link rel="stylesheet" type="text/css" href="adl/css/jquery-ui.css" />
<link rel="stylesheet" href="adl/css/leaflet.css" />
<link rel="stylesheet" href="adl/css/MarkerCluster.css" />
<link rel="stylesheet" href="adl/css/MarkerCluster.Default.css" />
%rss_feeds%
%javascript%
</head>
......
......@@ -67,7 +67,7 @@ $adl_ical_more = "<p>Quelques fonctionnalités additionnelles des calendriers iC
"exemple de récupérer un calendrier iCal des évènements organisés uniquement ".
"par votre association, à partir du moment où vous pensez à marquer ".
"tous vos évènements avec un mot-clés précis.<br/>\n".
"Exemple&nbsp;: <code>http://{$adl_uid_end}/ical.php?tag=formation</code>. ".
"Exemple&nbsp;: <code>http://{$adl_uid_end}/exportevents.php?format=ical&amp;tag=formation</code>. ".
"</li>\n".
"</ul>\n";
......@@ -102,11 +102,11 @@ $adl_rss_more = "<p>Quelques fonctionnalités intéressantes des flux RSS&nbsp;:
"mots-clés avec le paramètre <code>tag</code>'. Par exemple, en marquant ".
"tous les évènements d'un espace avec le même mot-clé, vous pouvez afficher le ".
"flux RSS des évènements organisés uniquement par cet espace.<br /> ".
"Exemple&nbsp;: <code>". calendar_absolute_url('rss.php?tag=formation'). "</code>. ".
"Exemple&nbsp;: <code>". calendar_absolute_url('exportevents.php?format=rss&amp;tag=formation'). "</code>. ".
"</li>\n ".
"<li>Vous pouvez modifier la limite aux 30 prochains jours des flux ".
"RSS en utilisant le paramètre <code>daylimit</code>.<br/> ".
"Exemple&nbsp;: <code>". calendar_absolute_url('rss.php?region=6&amp;daylimit=42'). "</code> ".
"Exemple&nbsp;: <code>". calendar_absolute_url('exportevents.php?format=rss&amp;region=6&amp;daylimit=42'). "</code> ".
"</li>\n</ul>\n";
// javascriptlist.php
......@@ -117,7 +117,7 @@ $adl_js_more = "<p>Quelques fonctionnalités intéressantes du widget Javascript
"<ul>\n".
"<li>Vous pouvez obtenir plus ou moins d'événements dans votre liste ".
" en ajoutant le paramètre <code>count</code><br /> ".
"Exemple&nbsp;: <code>". calendar_absolute_url('javascript.php?region=10&count=20'). "</code>. ".
"Exemple&nbsp;: <code>". calendar_absolute_url('exportevents.php?format=js&amp;region=10&amp;count=20'). "</code>. ".
"</li>\n</ul>\n".
"<h5>Ci-dessous, vous pouvez voir le résultat de votre sélection&nbsp;:</h5>";
......
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
<?php
/*
* Copyright 2018
* - Loic Dayot <ldayot CHEZ epnadmin POINT net>
*
* This file is part of agenda-libre-php.
*
* agenda-libre-php is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* agenda-libre-ph is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with agenda-libre-php. If not, see <http://www.gnu.org/licenses/>.
*/
$privatePage = false;
include("inc/main.inc.php");
include_once("inc/class.event.inc.php");
include_once("inc/class.export.inc.php");
$eventList = new exportEvent($db);
$eventList->get2fields();
$format = get_safe_string('format', 'rss');
if (($list = $eventList->getEventsList()) == FALSE)
{
error ("Erreur lors de la récupération des évènements");
exit;
}
switch ($format) {
case 'js' : {
echo $eventList->jsStartCalendar();
while ($eventList->event->id = $db->getOne($list))
{
$eventList->event->get();
echo $eventList->event->toJs();
}
echo $eventList->jsEndCalendar();
break;
}
case 'ical' : {
echo $eventList->icalStartCalendar();
while ($eventList->event->id = $db->getOne($list))
{
$eventList->event->get();
echo $eventList->event->toIcal();
}
echo $eventList->icalEndCalendar();
break;
}
case 'kml' : {
echo $eventList->kmlStartCalendar();
while ($eventList->event->id = $db->getOne($list))
{
$eventList->event->get();
echo $eventList->event->toKml();
}
echo $eventList->kmlEndCalendar();
break;
}
case 'geojson' : {
echo $eventList->geojsonStartCalendar();
$isfirst=true;
while ($eventList->event->id = $db->getOne($list))
{
$eventList->event->get();
if ($isfirst) {
$isfirst = false;
} else {
echo ",\n";
}
echo $eventList->event->toGeojson();
}
echo $eventList->geojsonEndCalendar();
break;
}
// TODO : XML from old xmllistevents.php
case 'xml' : {
$xml = $eventList->XmlStartCalendar($xml = new xmlWriter());
while ($eventList->event->id = $db->getOne($list))
{
$eventList->event->get();
$eventList->event->toXml($xml);
}
echo $eventList->XmlEndCalendar($xml);
break;
}
default :
case 'georss' :
case 'rss' : {
echo $eventList->rssStartCalendar();
while ($eventList->event->id = $db->getOne($list))
{
echo $eventList->rssEventHeaderCalendar();
}
echo $eventList->rssEndHeaderCalendar();
$list = $eventList->getEventsList();
while ($eventList->event->id = $db->getOne($list))
{
$eventList->event->get();
echo $eventList->event->toRss($format == 'georss');
}
echo $eventList->rssEndCalendar();
break;
}
} // end switch
?>
<?php
/*
* Copyright 2015-2017
* Copyright 2015-2018
* - Loic Dayot <ldayot CHEZ epnadmin POINT net>
*
* This file is part of agenda-libre-php.
......@@ -41,12 +41,15 @@ $export->getTagList('tags');
echo "<ul class='fa-ul'>\n";
echo " <li><i class='fa fa-li fa-rss'></i>&nbsp;Flux RSS 1.0 : <a href=\"". $export->rssUrl(). "\">". $export->rssUrl(). "</a>\n";
echo " <li><i class='fa fa-li fa-rss'></i>&nbsp;Flux GeoRSS (sans les détails) : <a href=\"". $export->rssGeoUrl(). "\">". $export->rssGeoUrl(). "</a>\n";
echo " <li><i class='fa fa-li fa-calendar'></i>&nbsp;Calendrier iCal : <a href=\"". $export->iCalUrl(). "\">". $export->iCalUrl(). "</a>\n";
echo " <li><i class='fa fa-li fa-google'></i>&nbsp;Google calendar : <a href=\"". $export->calGoogleUrl(). "\">". $export->calGoogleUrl(). "</a>\n";
echo " <li><i class='fa fa-li fa-code'></i>&nbsp;widget (JavaScript) : <code><a href=\"". $export->jsUrl(). "\">". $export->jsCode(). "</a></code>\n";
echo " <li><i class='fa fa-li fa-share'></i>&nbsp;web (liste dans le navigateur) : <code><a href=\"". $export->webUrl(). "\">". $export->webUrl(). "</a></code>\n";
echo " <li><i class='fas fa-li fa-rss'></i>&nbsp;Flux RSS 1.0 : <a href=\"". $export->rssUrl(). "\">". $export->rssUrl(). "</a>\n";
echo " <li><i class='fas fa-li fa-rss'></i>&nbsp;Flux GeoRSS (sans les détails) : <a href=\"". $export->georssUrl(). "\">". $export->georssUrl(). "</a>\n";
echo " <li><i class='fas fa-li fa-code'></i>&nbsp;Flux XML : <a href=\"". $export->XmlUrl(). "\">". $export->XmlUrl(). "</a>\n";
echo " <li><i class='fas fa-li fa-code'></i>&nbsp;Flux KML : <a href=\"". $export->KmlUrl(). "\">". $export->KmlUrl(). "</a>\n";
echo " <li><i class='fab fa-li fa-jsfiddle'></i>&nbsp;Flux GeoJSON : <a href=\"". $export->geoJsonUrl(). "\">". $export->geoJsonUrl(). "</a>\n";
echo " <li><i class='fas fa-li fa-calendar'></i>&nbsp;Calendrier iCal : <a href=\"". $export->iCalUrl(). "\">". $export->iCalUrl(). "</a>\n";
echo " <li><i class='fab fa-li fa-google'></i>&nbsp;Google calendar : <a href=\"". $export->calGoogleUrl(). "\">". $export->calGoogleUrl(). "</a>\n";
echo " <li><i class='fab fa-li fa-js'></i>&nbsp;widget (JavaScript) : <code><a href=\"". $export->jsUrl(). "\">". $export->jsCode(). "</a></code>\n";
echo " <li><i class='fas fa-li fa-share'></i>&nbsp;web (liste dans le navigateur) : <a href=\"". $export->webUrl(). "\">". $export->webUrl(). "</a>\n";
echo "</ul>\n";
echo "</fieldset>\n";
......
......@@ -25,39 +25,24 @@ $privatePage = false;
include("inc/main.inc.php");
include("inc/class.localgroup.inc.php");
include("inc/class.export.inc.php");
$localgroup_id = get_safe_integer('id', 0);
$region_id = get_safe_integer('region', 0);
$depart_id = get_safe_integer('depart', 0);
$partOfLocalgroupName = (isset($_GET['queryString']) ? $_GET['queryString'] : "");
$format = get_safe_string('format', 'geojson');
$partOfLocalgroupName = get_safe_string('queryString', "");
$localgroups = new localgroups($db);
if ($localgroup_id>0)
{
if ($localgroup_id>0) {
$localgroups->getOne($localgroup_id);
}
elseif ($depart_id>0)
{
} elseif ($depart_id>0) {
$localgroups->getFromDepartment($depart_id);
}
elseif ($region_id>0)
{
} elseif ($region_id>0) {
$localgroups->getFromRegion($region_id);
}
elseif (isset($_GET['queryString']))
{
if ($partOfLocalgroupName>"")
{ // -----------------------------------------------------------------
// Ajax query from Event form
$localgroups->getFromName($partOfLocalgroupName);
http_response_code(200);
header('Content-type: application/json');
echo $localgroups->formatJson();
} else {
http_response_code(500);
}
exit;
} elseif ($partOfLocalgroupName>"") {
$localgroups->getFromName($partOfLocalgroupName);
}
if (count($localgroups->localgroups)==0)
......@@ -68,6 +53,31 @@ if (count($localgroups->localgroups)==0)
exit;
}
Header("Content-type: text/plain; charset: utf-8");
switch ($format) {
case 'csv' : {
Header("Content-type: text/plain; charset: utf-8");
echo $localgroups->formatCsvOsm();
break;
}
echo $localgroups->formatCsvOsm();
case 'json' : {
// Ajax query from Event form
if ($partOfLocalgroupName>"") {
http_response_code(200);
header('Content-type: application/json');
echo $localgroups->formatJson();
break;
} else {
http_response_code(500);
}
break;
}
case 'geojson' : {
$export = new exportEvent($db);
echo $export->geoJsonStartCalendar();
echo $localgroups->formatGeojson();
echo $export->geoJsonEndCalendar();
break;
}
} // end switch
<?php
/*
* Copyright 2004-2017
* Copyright 2004-2018
* - Melanie Bats <melanie POINT bats CHEZ utbm POINT fr>
* - Thomas Petazzoni <thomas POINT petazzoni CHEZ enix POINT org>
* - Loic Dayot <ldayot CHEZ epnadmin POINT net>
......@@ -341,13 +341,12 @@ class event {
echo "<form method=\"post\" name='event' action=\"{$postUrl}\">\n";
echo '<script type="text/javascript" src="js/jquery-3.2.1.min.js"></script>'.
'<script type="text/javascript" src="js/jquery-ui.min.js"></script>';
echo "<script type=\"text/javascript\" src=\"js/jquery-3.2.1.min.js\"></script>\n".
"<script type=\"text/javascript\" src=\"js/jquery-ui.min.js\"></script>";
if (file_exists("tiny_mce"))
{
?>
<script type="text/javascript" src="https://openlayers.org/api/OpenLayers.js"></script>
<!-- tinyMCE -->
<script language="javascript" type="text/javascript" src="tiny_mce/tiny_mce.js"></script>
<script language="javascript" type="text/javascript">
......@@ -356,7 +355,7 @@ class event {
mode : "textareas",
language : "fr",
theme : "advanced",
plugins : "paste,preview",
plugins : "paste", // preview
theme_advanced_buttons1 : "bold,italic,underline,separator,"+
"bullist,numlist,undo,redo,link,unlink,separator,cut,copy,"+
"paste,pastetext,pasteword,separator,code,preview",
......@@ -445,7 +444,7 @@ class event {
name='lg_name' id='lg_name' />
</span>
<span id='loading' class='loading' style='display:none;'>
<i class='fa fa-circle-o-notch fa-spin'></i></span>
<i class='fas fa-circle-notch fa-spin'></i></span>
<input type='hidden' name='localgroup_id' /> en tant que
<select name='localgroup_role' title='Choisir le r&ocirc;le'>
<option value=''></option>
......@@ -589,7 +588,7 @@ class event {
$title = stripslashes($this->title);
//$start = date_timestamp2humanreadable($this->start);
$end = date_timestamp2humanreadable($this->end);
//$end = date_timestamp2humanreadable($this->end);
$address = stripslashes($this->address);
$postalcode = stripslashes($this->postalcode);
$city = stripslashes($this->city);
......@@ -627,7 +626,6 @@ class event {
$result .= "<h3>Informations</h3>\n";
$result .= "<p>Site Web: <a href=\"" . $url . "\">" . $url . "</a></p>\n";
$result .= "<h3>Organisateurs</h3>";
if (count($this->localgroups)>0) {
$result .= "<p>". ucfirst($GLOBALS['adl_localgroups']). " et leur r&ocirc;le&nbsp:<ul>\n";
......@@ -946,6 +944,97 @@ class event {
return $ret;
}
function toKml()
{
// title
$start_day = onlyday_timestamp2humanreadable($this->start);
$end_day = onlyday_timestamp2humanreadable($this->end);
$name = $this->xmlentities($this->city) . " : " . $this->xmlentities($this->title);
if ($start_day == $end_day)
$name .= ", le " . $start_day;
else
$name .= ", du " . $start_day . " au " . $end_day;
// description
$link = calendar_absolute_url("showevent.php?id=". $this->id);
$description = "<a href=\"{$link}\">$link</a><br/>\n".
$this->xmlentities(substr(strip_tags($this->formatHTML()),0,128));
return <<<PARTOFKML
<Placemark>
<name>{$name}</name>
<description><![CDATA[{$description}]]></description>
<styleUrl>#eventIcon</styleUrl>
<Point>
<coordinates>{$this->latitude},{$this->longitude},0</coordinates>
</Point>
</Placemark>\n
PARTOFKML;
}
function toXml($xml)
{
$xml->startElement("event");
$xml->writeElement("title", $this->title);
$xml->writeElement("start-time", $this->start_time);
$xml->writeElement("end-time", $this->end_time);
$xml->writeElement("city", $this->city);
$region = new region($this->db, $this->region);
$xml->writeElement("region", $region->name);
unset($region);
$xml->writeElement("locality", $this->locality);
$xml->writeElement("url", $this->url);
$xml->writeElement("tags", $this->tags);
$xml->writeElement("contact", $this->contact);
$xml->writeElement("adlurl", calendar_absolute_url("showevent.php?id=" . $this->id));
$xml->startElement("description");
$xml->writeCData($this->description);
$xml->endElement();
$xml->endElement();
return $xml;
}
// -------------------------------------------------------------------
function toGeojson()
{
// title
$start_day = onlyday_timestamp2humanreadable($this->start);
$end_day = onlyday_timestamp2humanreadable($this->end);
$name = $this->xmlentities($this->city) . " : " . $this->xmlentities($this->title);
if ($start_day == $end_day)
$name .= ", le " . $start_day;
else
$name .= ", du " . $start_day . " au " . $end_day;
$properties = new \StdClass();
$properties->id = $this->id;
$properties->name = $name;
$properties->href = calendar_absolute_url("showevent.php?id=". $this->id);
$properties->start_time = $this->start_time;
$properties->end_time = $this->end_time;
$properties->place_name = $this->place;
$properties->address = $this->address;
$properties->city = $this->city;
$properties->postalcode = $this->postalcode;
$properties->tags = explode(" ", $this->tags);
$properties->description = $this->description;
$JSON_properties = json_encode($properties);
return <<<PARTOFGEOJSON
{ "type": "Feature",
"properties": {$JSON_properties},
"geometry": {
"type": "Point",
"coordinates": [ {$this->longitude}, {$this->latitude} ]
}
}
PARTOFGEOJSON;
}
// -------------------------------------------------------------------
function toJs()
{
return "document.write(\"".
......
<?php
/*
* Copyright 2015-2017
* Copyright 2015-2018
* - Loic Dayot <ldayot CHEZ epnadmin POINT net>
*
* This file is part of agenda-libre-php.
......@@ -192,83 +192,69 @@ class exportEvent {
return $url;
}
// RSS -------------------------------------------------------------
// -------------------------------------------------------------------
/* Prepare RSS feeds */
function RssFeed()
function rssUrl()
{
global $adl_short_title, $adl_all_region;
$region = new region($this->db);
$regionList = $region->getList();
if ($region->error)
{
echo returnError($region->message);
put_footer();
exit;
}
$return = $this->rssFeedHeader (calendar_absolute_url("rss.php?region=all"), $adl_short_title. ", ". $adl_all_region);
foreach ($regionList as $region)
{
$return .= $this->rssFeedHeader(calendar_absolute_url("rss.php?region=". $region['id']), $adl_short_title. ", " . $region['name']);
}
return $return;
return calendar_absolute_url("exportevents.php?format=rss&amp;". $this->partOfUrl());
}
// -------------------------------------------------------------------
function rssFeedHeader($href, $title)
function georssUrl()
{
return " <link rel=\"alternate\" href=\"" . $href .
"\" title=\"" . $title . "\" type=\"application/rss+xml\" />\n";
return calendar_absolute_url("exportevents.php?format=georss&amp;". $this->partOfUrl());
//return $this->rssUrl(). "&map=1";
}
// -------------------------------------------------------------------
function rssUrl()
function iCalUrl()
{
return calendar_absolute_url("rss.php?". $this->partOfUrl());
return calendar_absolute_url("exportevents.php?format=ical&amp;". $this->partOfUrl(), 'webcal:');
}
// -------------------------------------------------------------------
function rssGeoUrl()
function calGoogleUrl()
{
return $this->rssUrl(). "&map=1";
return "http://www.google.com/calendar/render?cid=".
calendar_absolute_url("exportevents.php?format=ical&amp;". $this->partOfUrl());
}
// -------------------------------------------------------------------
function iCalUrl()
function jsUrl()
{
return calendar_absolute_url("ical.php?". $this->partOfUrl(), 'webcal:');
return calendar_absolute_url("exportevents.php?format=js&amp;". $this->partOfUrl());
}
// -------------------------------------------------------------------
function calGoogleUrl()
function webUrl()
{
return "http://www.google.com/calendar/render?cid=".
calendar_absolute_url("ical.php?". $this->partOfUrl());
return calendar_absolute_url("listevents.php?". $this->partOfUrl());
}
// -------------------------------------------------------------------
function jsUrl()
function KmlUrl()
{
return calendar_absolute_url("javascript.php?region=". $this->partOfUrl());
return calendar_absolute_url("exportevents.php?format=kml&amp;". $this->partOfUrl());
}
function jsCode()
// -------------------------------------------------------------------
function XmlUrl()
{
return htmlentities("<script type=\"text/javascript\" language=\"JavaScript\" src=\"".
$this->jsUrl(). "\"></script>\n");
return calendar_absolute_url("exportevents.php?format=xml&amp;". $this->partOfUrl());
}
// -------------------------------------------------------------------
function webUrl()
function geoJsonUrl()
{
return calendar_absolute_url("listevents.php?". $this->partOfUrl());
return calendar_absolute_url("exportevents.php?format=geojson&amp;". $this->partOfUrl());
}
// iCal ------------------------------------------------------------
......@@ -314,6 +300,36 @@ class exportEvent {
// RSS -------------------------------------------------------------
/* Prepare RSS feeds */
function RssFeed()
{
global $adl_short_title, $adl_all_region;
$region = new region($this->db);
$regionList = $region->getList();
if ($region->error)
{
echo returnError($region->message);
put_footer();
exit;
}
$return = $this->rssFeedHeader (calendar_absolute_url("exportevents.php?format=rss&region=all"),
$adl_short_title. ", ". $adl_all_region);
foreach ($regionList as $region)
{
$return .= $this->rssFeedHeader(calendar_absolute_url("exportevents.php?format=rss&region=".
$region['id']), $adl_short_title. ", " . $region['name']);
}
return $return;
}
// -------------------------------------------------------------------
function rssFeedHeader($href, $title)
{
return " <link rel=\"alternate\" href=\"" . $href .
"\" title=\"" . $title . "\" type=\"application/rss+xml\" />\n";
}
function rssStartCalendar()
{
global $adl_short_title, $adl_title, $adl_subtitle, $adl_url;
......@@ -368,6 +384,8 @@ class exportEvent {
return "</rdf:RDF>\n";
}
// Javascript-------------------------------------------------------
function jsStartCalendar()
{
return "document.write(\"<ul>\");\n";
......@@ -378,6 +396,92 @@ class exportEvent {
return "document.write(\"</ul>\");\n";
}
function jsCode()
{
return htmlentities("<script type=\"text/javascript\" language=\"JavaScript\" src=\"".
$this->jsUrl(). "\"></script>\n");
}
// KML -------------------------------------------------------------
function KmlStartCalendar()
{
$imageUrl = calendar_absolute_url(_themeFile('image/tux-adl.png'));
header("Content-type: text/xml; charset=utf-8");
return <<<KMLSTART
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<name>KML {$GLOBALS['adl_short_title']} events</name>
<open>1</open>
<description>{$GLOBALS['adl_title']} events</description>
<Style id="eventIcon">
<IconStyle>
<Icon>
<href>{$imageUrl}</href>
</Icon>
</IconStyle>
</Style>\n
KMLSTART;
}
function KmlEndCalendar()
{
return <<<KMLEND
</Document>
</kml>
KMLEND;
}
// XML -------------------------------------------------------------
function XmlStartCalendar()
{
$xml = new xmlWriter();
$xml->openMemory();
$xml->startDocument("1.0", "UTF-8");
$xml->startElement("events");
return $xml;
}
function XmlEndCalendar($xml)
{
$xml->EndElement();
$xml->endDocument();
header("Content-type: text/xml");
return $xml->outputMemory(true);
}
// geoJSON ---------------------------------------------------------
function geoJsonStartCalendar()
{
header("Content-Type: application/json; charset=utf-8");
return <<<GEOJSONSTART
{ "type": "FeatureCollection",
"crs": {
"type": "name",
"properties": {
"name": "urn:ogc:def:crs:OGC:1.3:CRS84"
}
},
"features": [
GEOJSONSTART;
}
function geoJsonEndCalendar()
{
return "\n ]\n}\n";
}
// -----------------------------------------------------------------
// Function to choose daylimit (int)
// $daylimit is (int) or 0 for no limit
// output if HTML string select part of form
......
<?php
/*
* Copyright 2014-2017
* Copyright 2014-2018
* - Loic Dayot <ldayot CHEZ epnadmin POINT net>
*
* This file is part of agenda-libre-php.
......@@ -193,8 +193,12 @@ class geocode {
$mapElementZoom = max($GLOBALS['mapEventDisplay']['zoom'], $GLOBALS['mapLocalgroupDisplay']['zoom']);
$html = <<<MAPINPUT
<div style="margin: auto; width:90%; height:320px; border: 1px solid black;" id="map"></div>
<script type="text/javascript">
<script type="text/javascript" src="js/leaflet.js"></script>
<script type="text/javascript" src="js/leaflet.markercluster-src.js"></script>
<script type="text/javascript" src="js/displayMap.js"></script>
<script type="text/javascript" src="js/findPlace.js"></script>
<script type="text/javascript">
var moderatorlist = '{$GLOBALS['moderatorlist']}';
var fieldName = '$fieldName';
var latitude = {$object->latitude};
......@@ -203,12 +207,17 @@ class geocode {
var lat={$GLOBALS['mapGlobalDisplay']['lat']}
var lon={$GLOBALS['mapGlobalDisplay']['lon']}
var zoom={$GLOBALS['mapGlobalDisplay']['zoom']}
function init() {
displayMap(lat, lon, zoom);
}
</script>
<ul class='mist' id='map' style="margin: auto; width:90%; height:320px; border: 1px solid black;"></ul>
<input name='{$fieldName}[lon]' type='hidden' value="{$object->longitude}" />
<input name='{$fieldName}[lat]' type='hidden' value="{$object->latitude}"/>
<span id='plloading' class='loading' style='display:none;'><i class='fa fa-circle-o-notch fa-spin'></i></span>
<span id='plloading' class='loading' style='display:none;'><i class='fas fa-circle-notch fa-spinner'></i></span>
<div id='pl-container'></div>
<script type="text/javascript" src="js/findPlace.js"></script>
<!-- label for='{$fieldName}place'>Lieu</label -->
<input type='hidden' size='70' name='{$fieldName}[place]' id='{$fieldName}place' value="{$object->place}" />
<!--p class='legend'>Adresse seule pour la géolocalisation.</p-->
......@@ -221,6 +230,10 @@ class geocode {
<br/><label for='{$fieldName}country'>Pays</label>
<input type='text' size='40' name='{$fieldName}[country]' id='{$fieldName}country' value="{$object->country}" />
<p class='legend'><a href="#" onClick="javascript:searchLocation(); return false;">Tenter de trouver une g&eacute;olocalisation</a></p>
<script type="text/javascript">
initFindPlace();
</script>
MAPINPUT;
return $html;
......
<?php
/*
* Copyright 2015-2017
* Copyright 2015-2018
* - Loic Dayot <ldayot CHEZ epnadmin POINT net>
*
* This file is part of agenda-libre-php.
......@@ -282,7 +282,7 @@ class localgroup {
* Form (edit function)
* $duplicate=true seems get datas but as new record
*/
function formHtml($duplicate = false)
function formHtml($duplicate = false, $previewEnable=false, $submitEnable=true)
{
global $adl_localgroup, $session;
$html = <<<JQUERY
......@@ -301,7 +301,7 @@ JQUERY;
mode : "textareas",
language : "fr",
theme : "advanced",
plugins : "paste,preview",
plugins : "paste", //,preview",
theme_advanced_buttons1 : "bold,italic,underline,separator,"+
"bullist,numlist,undo,redo,link,unlink,separator,cut,copy,"+
"paste,pastetext,pasteword,separator,code,preview",
......@@ -375,9 +375,14 @@ MCE;
" name='lg[submitter]' value=\"{$this->submitter}\" id='__lg_submitter' />\n";
$html .= "</fieldset>\n";
$html .= "<p class='legend'><input type=\"submit\" name=\"lg[preview]\" ".
"value=\"". _("Prévisualisation"). "\" /> <input type=\"submit\" ".
"name=\"submit\" value=\"". _("Enregistrement"). "\" /></p>\n";
$html .= "<p class='legend'>";
if ($previewEnable)
$html .= "<input type=\"submit\" name=\"lg[preview]\" ".
"value=\"". _("Prévisualisation"). "\" /> ";
$html .= "<input type=\"submit\" ".
"name=\"submit\" value=\"". _("Enregistrement"). "\" ".
(! $submitEnable ? "disabled='disabled'" : ""). " />".
"</p>\n";
$html .= "</form>\n";
......@@ -716,7 +721,33 @@ MCE;
return $ret;
}
// -------------------------------------------------------------------
function toGeojson()
{
$properties = new \StdClass();
$properties->id = $this->id;
$properties->name = $this->name;
$properties->href = calendar_absolute_url("showlocalgroup.php?id=". $this->id);
$properties->place_name = $this->place;
$properties->address = $this->address;
$properties->city = $this->city;
$properties->country = $this->country;
$properties->postalcode = $this->postalcode;
$properties->comment = $this->comment;
$JSON_properties = json_encode($properties);
return <<<PARTOFGEOJSON
{ "type": "Feature",
"properties": {$JSON_properties},
"geometry": {
"type": "Point",
"coordinates": [ {$this->longitude}, {$this->latitude} ]
}
}
PARTOFGEOJSON;
}
// -------------------------------------------------------------------
......@@ -730,20 +761,20 @@ MCE;
$html .= "En attente depuis ". ($this->waiting_time == 0 ?
"aujourd'hui" : ($this->waiting_time == 1 ? "hier" :
$this->waiting_time. " jours"));
$html .= "<br/><a href='moderatelocalgroups.php?op=validateform&id={$this->id}'><i class='fa fa-files-o'></i> Valider</a>".
$html .= "<br/><a href='moderatelocalgroups.php?op=validateform&id={$this->id}'><i class='fas fa-file'></i> Valider</a>".
"<br/><a href='moderatelocalgroups.php?op=rejectform&id={$this->id}'>".
"<i class='fa fa-files-o'></i> Refuser</a>".
"<i class='fas fa-minux-circle'></i> Refuser</a>".
"<br/><a href='moderatelocalgroups.php?op=requestinfoform&id={$this->id}'>".
"<i class='fa fa-files-o'></i> Demander des infos</a>".
"<i class='fas fa-question'></i> Demander des infos</a>".
"<br/><a href='moderatelocalgroups.php?op=addnoteform&id={$this->id}'>".
"<i class='fa fa-files-o'></i> Ajouter une note</a><br/><br />";
"<i class='fas fa-comment-alt'></i> Ajouter une note</a><br/><br />";
}
$html .= "<a href='moderatelocalgroups.php?op=edit&id={$this->id}'>".
"<i class='fa fa-pencil'></i> Éditer</a>";
"<i class='fas fa-edit'></i> Éditer</a>";
$html .= "<br/><a href='moderatelocalgroups.php?op=dupl&id={$this->id}'>".
"<i class='fa fa-files-o'></i> Dupliquer</a>".
"<i class='fas fa-copy'></i> Dupliquer</a>".
"<br/><a href='moderatelocalgroups.php?op=del&id={$this->id}'>".
"<i class='fa fa-trash'></i> Supprimer</a>\n";
"<i class='fas fa-trash'></i> Supprimer</a>\n";
$html .= "</div>\n";
return $html;
}
......@@ -1052,7 +1083,7 @@ class localgroups {
$region_id = $localgroup->region_id;
}
$html .= " <li><a href='moderatelocalgroups.php?op=info&id={$localgroup->id}'>".
"<i class='fa fa-users'></i>&nbsp;{$localgroup->name}</a> à {$localgroup->city} ".
"<i class='fas fa-users'></i>&nbsp;{$localgroup->name}</a> à {$localgroup->city} ".
"(". $localgroup->formatReachHtml(). ")".
"</li>\n";
}
......@@ -1180,6 +1211,17 @@ class localgroups {
return $html;
}
// -------------------------------------------------------------------
function formatGeojson()
{
$html = "";
foreach ($this->localgroups as $localgroup)
{
$html .= ($html=='' ? '' : ', '). $localgroup->toGeojson();
}
return $html;
}
// -----------------------------------------------------------------
// Used to link event to localgroups in class.event.inc.php
// event->edit()
......@@ -1222,7 +1264,7 @@ class localgroups {
$html .= "/>
</span>
<span id='loading' class='loading' style='display:none;'>
<i class='fa fa-circle-o-notch fa-spin'></i></span>
<i class='fas fa-circle-notch fa-spin'></i></span>
<input type='hidden' name='localgroup_id' value='{$this->localgroup_id}'/>
</select>\n";
return $html;
......
<?php
/*
* Copyright 2015-2016
* Copyright 2015-2018
* - Loic Dayot <ldayot CHEZ epnadmin POINT net>
*
* This file is part of agenda-libre-php.
......@@ -114,10 +114,10 @@ class region {
}
$return = ""; //"<strong>". _("Région :") ."</strong> ";
$return .= "<select name='region' $onChange>";
$return .= " <optgroup label=\"France\">\n";
$return .= " <option value='all' ".
($this->id=="all" ? "selected='selected' " : ""). ">".
_("Toutes les régions"). "</option>";
$return .= " <optgroup label=\"France\">\n";
while ($row = $this->db->fetchObject($ret))
{
$return .= " <option value='{$row->id}' ".
......
......@@ -49,7 +49,7 @@ class user
}
return $ret;
}
private function get_from_sql($sql)
{
$ret = $this->query($sql);
......@@ -68,7 +68,7 @@ class user
{
$sql =
"SELECT id FROM {$GLOBALS['db_tablename_prefix']}users WHERE login=".
$this->db->quote_smart($login).
$this->db->quote_smart($login).
($exceptId!=null ? " AND id<>". $this->db->quote_smart($exceptId) : "");
$row = $this->get_from_sql($sql);
return is_object($row) ? $row->id : false;
......@@ -88,7 +88,7 @@ class user
function get()
{
$sql = "select * from {$GLOBALS['db_tablename_prefix']}users where id=" .
$sql = "select * from {$GLOBALS['db_tablename_prefix']}users where id=" .
$this->db->quote_smart(!isset($this->id) ? $this->session->value("agenda_libre_id") : $this->id);
$row = $this->get_from_sql($sql);
if (! $row || ! is_object($row)) return false;
......@@ -120,10 +120,10 @@ class user
$this->message = returnError("La requête <i>". $sql. "</i> a échoué");
return false;
}
if (!isset($this->id))
$this->id = $this->db->insertid();
return true;
} // end function save();
......@@ -136,7 +136,7 @@ class user
$this->message = returnError("La requête <i>". $sql. "</i> a échoué");
return false;
}
return true;
} // end function delete();
......@@ -188,6 +188,7 @@ class user
{
if (! isset($_POST['__user_identify']))
{
ob_end_clean();
put_header("Accès réservé");
echo "<h2>Identification</h2>";
......@@ -212,6 +213,7 @@ class user
}
else
{
ob_end_clean();
put_header("Accès réservé");
echo returnError("Mauvais identifiant/mot de passe");
put_footer();
......@@ -220,7 +222,7 @@ class user
}
}
}
/* Presente un formulaire d'edition d'utilisateur */
function edit($postUrl='moderateusers.php')
{
......@@ -249,16 +251,16 @@ class user
echo "<tr><td>Rôle*:</td>".
"<td><label>Le rôle d'administrateur donne le droit de gérer les comptes de tous les utilisateurs</label>".
"<br/><select name='__user_admin'/>".
"<option value='0'". ($this->admin ? '' : ' selected').
"<option value='0'". ($this->admin ? '' : ' selected').
($this->id==$this->session->value("agenda_libre_id") ? ' disabled' : ''). ">modérateur</option>".
"<option value='1'". ($this->admin ? ' selected' : ''). ">administrateur</option>";
"</td></tr>\n";
echo "<tr class='even'><td></td><td><input type=\"submit\" name=\"__user_form\" value=\"Envoyer\"></td></tr>\n";
echo "</table>\n";
echo "</form>\n";
}
/* Presente un formulaire de suppression d'utilisateur */
function delForm($postUrl='moderateusers.php')
{
......@@ -279,7 +281,7 @@ class user
function fromForm()
{
$afieldName = array('id', 'login', 'password',
$afieldName = array('id', 'login', 'password',
'password2', 'email', 'lastname', 'firstname');
foreach ($afieldName as $fieldName)
{
......@@ -288,13 +290,13 @@ class user
else
unset($this->$fieldName);
}
if (isset($_POST['__user_admin']))
$this->admin = ($_POST['__user_admin'] == 1);
return true;
}
function check()
{
if (!isset($_POST['__user_form']))
......@@ -329,7 +331,7 @@ class user
$this->message .= returnError("Identifiant déjà utilisé.");
return (""==$this->message);
}
function checkDel()
{
if (!isset($_POST['__user_delform']))
......@@ -354,7 +356,7 @@ class user
$output .= "<td>". ($this->admin ? 'admin' : ''). "</td>";
return $output;
}
function listHTML()
{
$return = "<table class='stats'>\n";
......@@ -369,7 +371,7 @@ class user
$return .= "<tr". ($impair ? " class='even'" : ""). ">". $this->formatTrHtml();
$return .= "<td>".
"<a href='?op=edit&id={$this->id}'>Editer</a>".
($this->session->value("agenda_libre_id")!=$this->id && !$this->admin ?
($this->session->value("agenda_libre_id")!=$this->id && !$this->admin ?
" - <a href='?op=del&id={$this->id}'>Supprimer</a>" : "").
"</td>";
$return .= "</tr>\n";
......@@ -379,5 +381,5 @@ class user
$return .= "</table>\n";
return $return;
}
}
......@@ -72,6 +72,9 @@ $localgroupManagement = false;
/* Availability of submit localgroup
* true = available */
$localgroupSubmit = false;
/* Availability of show local groups list
* true = available */
$localgroupList = false;
/**
* Calendar display settings
......
<?php
/*
* Copyright 2005-2017
* Copyright 2005-2018
* - Mélanie Bats <melanie POINT bats CHEZ utbm POINT fr>
* - Thomas Petazzoni <thomas POINT petazzoni CHEZ enix POINT org>
* - Loic Dayot <ldayot CHEZ epnadmin POINT net>
......@@ -185,33 +185,33 @@ function menu_html()
$r = "";
if ($session->exists("agenda_libre_id"))
{ // moderateur
$r .= "<a class='list-group-item' href=\"moderation.php\"><i class='fa fa-gavel'></i>&nbsp;Modérer les événements</a>".
" - <a class='list-group-item' href=\"moderatetags.php\"><i class='fa fa-tags'></i>&nbsp;tags</a>".
" - <a class='list-group-item' href=\"campaigns.php\"><i class='fa fa-book'></i>&nbsp;campagnes</a>". "\n";
$r .= "<a class='list-group-item' href=\"moderation.php\"><i class='fas fa-gavel'></i>&nbsp;Modérer les événements</a>".
" - <a class='list-group-item' href=\"moderatetags.php\"><i class='fas fa-tags'></i>&nbsp;tags</a>".
" - <a class='list-group-item' href=\"campaigns.php\"><i class='fas fa-book'></i>&nbsp;campagnes</a>". "\n";
if ($localgroupManagement) {
$r .= " - <a class='list-group-item' href=\"moderatelocalgroups.php\"><i class='fa fa-users'></i>&nbsp;{$adl_localgroups}</a>". "\n";
$r .= " - <a class='list-group-item' href=\"moderatelocalgroups.php\"><i class='fas fa-users'></i>&nbsp;{$adl_localgroups}</a>". "\n";
}
if (is_object($user) && $user->is_admin())
{
$r .= " - <a class='list-group-item' href=\"moderateusers.php\"><i class='fa fa-user'></i>&nbsp;utilisateurs</a>\n";
$r .= " - <a class='list-group-item' href=\"moderateusers.php\"><i class='fas fa-user'></i>&nbsp;utilisateurs</a>\n";
}
$r .= "- <a class='list-group-item' href='moderation.php?disconnect=1'><i class='fa fa-sign-out'></i>&nbsp;Se déconnecter</a><br/>\n";
$r .= "- <a class='list-group-item' href='moderation.php?disconnect=1'><i class='fas fa-sign-out-alt'></i>&nbsp;Se déconnecter</a><br/>\n";
}
$r .= "<a class='list-group-item big' href=\"submit.php\"><i class='fa fa-pencil'></i>&nbsp;Proposer un évènement</a> (publication après modération)";
$r .= "<a class='list-group-item big' href=\"submit.php\"><i class='fas fa-edit'></i>&nbsp;Proposer un évènement</a> (publication après modération)";
if ($localgroupManagement & $localgroupSubmit) {
$r .= " - <a class='list-group-item' href=\"moderatelocalgroups.php?op=new\"><i class='fa fa-users'></i>&nbsp;Proposer un {$adl_localgroup}</a>";
$r .= " - <a class='list-group-item' href=\"moderatelocalgroups.php?op=new\"><i class='fas fa-users'></i>&nbsp;Proposer un {$adl_localgroup}</a>";
}
$r .= "<br />\n";
$r .= "<a class='list-group-item' href=\"index.php\"><i class='fa fa-calendar'></i>&nbsp;Consulter l'agenda</a>";
$r .= " - <a class='list-group-item' href=\"map.php\"><i class='fa fa-map-marker'></i>&nbsp;Carte</a>";
$r .= " - <a class='list-group-item' href=\"tags.php\"><i class='fa fa-tags'></i>&nbsp;Mots-clés</a>";
$r .= " - <a class='list-group-item' href=\"exportlist.php\"><i class='fa fa-external-link'></i>&nbsp;Exporter RSS-iCal-widget</a>";
$r .= "<br/><a class='list-group-item' href=\"stats.php\"><i class='fa fa-signal'></i>&nbsp;Statistiques</a>";
$r .= " - <a class='list-group-item' href=\"infos.php\"><i class='fa fa-info'></i>&nbsp;À propos</a>";
$r .= " - <a class='list-group-item' href=\"contact.php\"><i class='fa fa-envelope'></i>&nbsp;Contact</a>";
$r .= "<a class='list-group-item' href=\"index.php\"><i class='fas fa-calendar-alt'></i>&nbsp;Consulter l'agenda</a>";
$r .= " - <a class='list-group-item' href=\"map.php\"><i class='fas fa-map'></i>&nbsp;Carte</a>";
$r .= " - <a class='list-group-item' href=\"tags.php\"><i class='fas fa-tags'></i>&nbsp;Mots-clés</a>";
$r .= " - <a class='list-group-item' href=\"exportlist.php\"><i class='fas fa-external-link-alt'></i>&nbsp;Exporter</a>";
$r .= "<br/><a class='list-group-item' href=\"stats.php\"><i class='fas fa-signal'></i>&nbsp;Statistiques</a>";
$r .= " - <a class='list-group-item' href=\"infos.php\"><i class='fas fa-info'></i>&nbsp;À propos</a>";
$r .= " - <a class='list-group-item' href=\"contact.php\"><i class='fas fa-envelope'></i>&nbsp;Contact</a>";
if (! $session->exists("agenda_libre_id"))
{ // moderateur
$r .= " - <a class='list-group-item' href=\"moderation.php\" title=\"Accès réservé à la modération et l'administration de l'agenda\"><i class='fa fa-sign-in'></i>&nbsp;(réservé)</a>\n";
$r .= " - <a class='list-group-item' href=\"moderation.php\" title=\"Accès réservé à la modération et l'administration de l'agenda\"><i class='fas fa-sign-in-alt'></i>&nbsp;(réservé)</a>\n";
}
return $r;
}
......@@ -483,7 +483,7 @@ global $maxEventsInCalendar;
echo "<a href=\"showoneday.php?date=".
substr(date_timestamp2mysql($curtime),0,10). "\" title=\"".
sprintf( _("Les évènements du %s"), $thisDate ). "\">". $day. "</a> ";
echo "<a href='submit.php?start=$curtime' title='Proposer un &eacute;v&eacute;nement'><i class='fa fa-pencil'></i></a>";
echo "<a href='submit.php?start=$curtime' title='Proposer un &eacute;v&eacute;nement'><i class='fas fa-edit'></i></a>";
echo "</h1>\n";
show_day_events ($db, $day, $month, $year, $region, $maxEventsInCalendar);
echo "</td>\n";
......
......@@ -35,7 +35,7 @@ include('inc/config.inc.php');
/*
* Return a string with path and name to file in path theme if
* exists else to default path
*
*
* $filename param could be 'text/text.inc.php'
* or 'template/header.php' ...
*/
......@@ -43,17 +43,17 @@ function _themeFile($filename)
{
global $default_theme, $theme;
if (is_file('./'. $theme. '/'. $filename))
if (is_file(/*'./'.*/ $theme. '/'. $filename))
{
return './'. $theme. '/'. $filename;
}
elseif (is_file('./'. $default_theme. '/'. $filename))
return /*'./'.*/ $theme. '/'. $filename;
}
elseif (is_file(/*'./'.*/ $default_theme