...
 
Commits (19)
<a name="3.5.0"></a>
# [3.5.0](https://git.framasoft.org/agenda-libre/agenda-libre-php/compare/3.4.0...3.5.0) (2018-01-25)
### Bug Fixes
* **sql:** quote in region table ([77e5f36](https://git.framasoft.org/agenda-libre/agenda-libre-php/commit/77e5f36))
* allow only preview when editing new localgroup ([088d619](https://git.framasoft.org/agenda-libre/agenda-libre-php/commit/088d619))
* correct links in RSS subscribed in Firefox ([3c32d75](https://git.framasoft.org/agenda-libre/agenda-libre-php/commit/3c32d75)), closes [#42](https://git.framasoft.org/agenda-libre/agenda-libre-php/issues/42)
* hide context menu when not admin ([db7d422](https://git.framasoft.org/agenda-libre/agenda-libre-php/commit/db7d422))
* remove password from error message ([b329f1e](https://git.framasoft.org/agenda-libre/agenda-libre-php/commit/b329f1e))
* top of the page displayed twice when identification required ([e7140ca](https://git.framasoft.org/agenda-libre/agenda-libre-php/commit/e7140ca))
### Features
* Allow duplicate event. ([a970ff2](https://git.framasoft.org/agenda-libre/agenda-libre-php/commit/a970ff2)), closes [#6](https://git.framasoft.org/agenda-libre/agenda-libre-php/issues/6)
* improvement filter and export events ([f406a52](https://git.framasoft.org/agenda-libre/agenda-libre-php/commit/f406a52)), closes [#25](https://git.framasoft.org/agenda-libre/agenda-libre-php/issues/25)
* make easier purpose new event ([57724fd](https://git.framasoft.org/agenda-libre/agenda-libre-php/commit/57724fd)), closes [#37](https://git.framasoft.org/agenda-libre/agenda-libre-php/issues/37)
<a name="3.4.0"></a>
# [3.4.0](https://git.framasoft.org/agenda-libre/agenda-libre-php/compare/3.3.0...v3.4.0) (2017-06-16)
......
3.5.0-dev
3.6.0-dev
{
"name": "agenda-libre-php",
"version": "3.5.0-dev",
"version": "3.6.0-dev",
"description": "agenda libre is free software written in php that manages collaborative agenda",
"homepage": "https://git.framasoft.org/agenda-libre/agenda-libre-php",
"keywords": [
......
.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
......@@ -177,7 +177,9 @@ class campaign {
$html.= "<input type='hidden' name='camp[id]' value='{$this->id}' />";
$html.= "<input type='hidden' name='id' value='{$this->id}' />";
}
$html .= "<tr class='odd'><td>Nom*</td><th><input type='text' required name='camp[name]' value='{$this->name}' title=\"Saisir un nom de préférence unique qui servira de code pour reconnaître la campagne.\"/></th></tr>\n";
$html .= "<tr class='odd'><td>Nom*</td><th><input type='text' required name='camp[name]' value=\"".
stripslashes(htmlentities($this->name)).
"\" title=\"Saisir un nom de préférence unique qui servira de code pour reconnaître la campagne.\"/></th></tr>\n";
$html .= "<tr><td>Période*</td><th>".
"du <input type='date' required name=camp[start] value='". date("d/m/Y", $this->start). "' title=\"Date de début de la campagne, au format MYSQL aaaa-mm-jj.\" />".
"<br/> au <input type='date' required name=camp[end] value='". date("d/m/Y", $this->end). "' title=\"Date de fin de la campagne, au format jj/mm/aaaa.\" /></th></tr>\n";
......
<?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>
......@@ -52,6 +52,7 @@ class event {
$secret,
$decision_time,
$submission_time;
var $role; // role of a localgroup for this event
var $tags; // array of tags
var $localgroups; // array of localgroups
var $error, $message;
......@@ -341,34 +342,27 @@ 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"))
if (file_exists("js/tinymce"))
{
?>
<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" src="js/tinymce/tinymce.min.js"></script>
<script language="javascript" type="text/javascript">
// Notice: The simple theme does not use all options some of them are limited to the advanced theme
tinyMCE.init({
mode : "textareas",
language : "fr",
theme : "advanced",
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",
theme_advanced_buttons2 : "",
theme_advanced_buttons3 : "",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_path_location : "bottom",
plugin_preview_width : "500",
plugin_preview_height : "600",
extended_valid_elements : "a[name|href|target|title|onclick]"
});
tinymce.init({
selector: 'textarea',
language : 'fr_FR',
theme : 'modern',
plugins : 'textcolor advlist autolink link image lists table charmap paste table preview',
toolbar: 'undo redo | styleselect | bold italic forecolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | paste pastetext | code preview',
menubar: false,
width: '80%',
height: 300,
extended_valid_elements : [ 'a[name|href|target|title|onclick]',
'img[class=myclass|!src|border:0|alt|title|width|height|style]' ],
});
</script>
<!-- /tinyMCE -->
<?php
......@@ -393,7 +387,7 @@ class event {
<label for='__event_description' class='required only'>Description*</label>
<p class='legend'>Décrivez de la manière la plus complète possible votre évènement.</p>
<?php
if (file_exists("tiny_mce"))
if (file_exists("js/tinymce"))
echo "<noscript>". $adl_form_description_guide. "</noscript>\n";
else
echo $adl_form_description_guide. "\n";
......@@ -445,7 +439,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 +583,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 +621,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";
......@@ -719,15 +712,17 @@ class event {
else
$this->tags = "";
unset($this->localgroups);
$this->localgroups = array();
if (isset($_POST['__event_lg_id']))
{ // get localgroups
$event_lg_id = $_POST['__event_lg_id'];
$event_lg_role = $_POST['__event_lg_role'];
foreach ($_POST['__event_lg_id'] as $form_id=>$lg_id) {
$lg = new localgroup($this->db, $lg_id);
$lg->role = $event_lg_role[$form_id];
$lg = new localgroup($this->db, $lg_id);
$lg->role = $event_lg_role[$form_id];
$this->localgroups[] = $lg;
}
$this->localgroups[] = $lg;
}
return true;
......@@ -946,6 +941,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(\"".
......@@ -1014,6 +1100,25 @@ class event {
echo "</select>\n";
}
function toHtmlList()
{
$this->get();
$result = "<li>";
$result .= "<a href=\"showevent.php?id=" . $this->id . "\">";
$result .= stripslashes($this->title);
$result .= "</a>";
$result .= " en tant que ". $GLOBALS['adl_lg_role'][$this->role];
$startday = onlyday_timestamp2humanreadable(date_mysql2timestamp($this->start_time));
$endday = onlyday_timestamp2humanreadable(date_mysql2timestamp($this->end_time));
$result .= "<br/>";
if ($startday == $endday)
$result .= "le " . $startday . " ";
else
$result .= "du " . $startday . " au " . $endday . " ";
$result .= " à " . $this->city;
$result .= "</li>\n";
return $result;
}
}
?>
<?php
/*
* Copyright 2015-2017
* Copyright 2015-2018
* - Loic Dayot <ldayot CHEZ epnadmin POINT net>
*
* This file is part of agenda-libre-php.
......@@ -58,14 +58,15 @@ class exportEvent {
function getEventsList()
{
$sql = "SELECT events.id AS id FROM {$GLOBALS['db_tablename_prefix']}events AS events";
$sqlSelect = "SELECT events.id AS id";
$sqlFrom = " FROM {$GLOBALS['db_tablename_prefix']}events AS events";
$sqlWhere = " WHERE (moderated=1)";
// event_id
if ($this->event_id != 0)
{
$sqlWhere .= " AND (events.id=". $this->db->quote_smart($this->event_id). ")";
$sql .= $sqlWhere;
//$sql .= $sqlWhere;
}
else
{
......@@ -99,11 +100,12 @@ class exportEvent {
// localgroup_id
if ($this->localgroup_id != 0)
{
$sql .= " LEFT JOIN {$GLOBALS['db_tablename_prefix']}localgroups_events AS le ON events.id=le.event_id";
$sqlSelect .= ",role ";
$sqlFrom .= " LEFT JOIN {$GLOBALS['db_tablename_prefix']}localgroups_events AS le ON events.id=le.event_id";
$sqlWhere .= " AND (localgroup_id=". $this->db->quote_smart($this->localgroup_id). ")";
}
$sql .= $sqlWhere;
$sql = $sqlSelect. $sqlFrom. $sqlWhere;
if (count($this->tags)>0 || $this->localgroup_id != 0)
$sql .= " GROUP BY events.id";
// past/future
......@@ -116,6 +118,16 @@ class exportEvent {
return $this->db->query($sql);
}
function htmlListStartCalendar()
{
return " <ul>\n";
}
function htmlListEndCalendar()
{
return " </ul>\n";
}
function get2fields()
{
$this->map = get_safe_integer('map', 0);
......@@ -192,83 +204,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 +312,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 +396,8 @@ class exportEvent {
return "</rdf:RDF>\n";
}
// Javascript-------------------------------------------------------
function jsStartCalendar()
{
return "document.write(\"<ul>\");\n";
......@@ -378,6 +408,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;
......
This diff is collapsed.
<?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";