Commit c32cdcaf authored by Francesco Iannuzzelli's avatar Francesco Iannuzzelli

Fixed upgrade to icalcreator

parent 47df243f
<?php
use ICal\ICal;
use Kigkonsult\Icalcreator\TimezoneHandler;
use Kigkonsult\Icalcreator\Vcalendar;
/********************************************************************
......@@ -326,33 +326,33 @@ class Events
$vevent = $this->vcalendar->newVevent();
$link = "$base_url/event.php?id={$event['id_event']}";
if($event['allday']) {
$vevent->setProperty(
'DTSTART',
$vevent->setDtstart(
date("Ymd",$event['start_date_ts']),
[ "VALUE" => "DATE" ]
);
} else {
$vevent->setProperty(
'DTSTART',
$vevent->setDtstart(
new DateTime( date("Y-m-d H:i:s",$event['start_date_ts']))
);
if($event['length']>0) {
$vevent->setProperty(
'DTSTART',
$vevent->setDtend(
new DateTime( date("Y-m-d H:i:s",$event['start_date_ts'] + ($event['length']*3600)))
);
}
}
$vevent->setProperty('LOCATION', "{$event['address']} {$event['place']}" );
$vevent->setProperty('SUMMARY', $event['title'] );
$vevent->setLocation("{$event['address']} {$event['place']}" );
if(isset($event['latitude']) && $event['latitude']>0) {
$vevent->setGeo($event['latitude'],$event['longitude']);
}
$vevent->setSummary($event['title']);
$html = $this->th->Htmlise($event['description'],false) . "<p><a href='$link'>$link</a></p>";
$vevent->setProperty( "X-ALT-DESC", $html);
$vevent->setXprop( "X-ALT-DESC", $html);
if($event['is_html']) {
$this->th->Html2Text($event['description']);
}
$description = str_replace("\t",'',trim($event['description']));
$vevent->setProperty('DESCRIPTION', $description . "\n\n$link");
$vevent->setProperty( "URL", $link);
$vevent->setDescription($description . "\n\n$link");
$vevent->setUrl($link);
if($event['has_image']=='1') {
$vevent->setXprop('X-WP-IMAGES-URL',$event['orig']);
}
......@@ -368,22 +368,22 @@ class Events
$ini = new Ini();
$tz = "Europe/Rome";
$config = [
'UNIQUE_ID' => "peacelink.it"
Vcalendar::UNIQUE_ID => "peacelink.it"
];
$uuid = "pck-events";
if($id!='') {
$uuid .= "-{$id}";
$calname .= " - {$name}";
$config['filename'] = "{$uuid}.ics"; // date( "YmdHis" ).".ics"
// $config['filename'] = "{$uuid}.ics"; // date( "YmdHis" ).".ics"
}
$this->vcalendar = new Kigkonsult\Icalcreator\Vcalendar($config);
$this->vcalendar->setProperty( 'method', "PUBLISH" );
$this->vcalendar->setProperty( "x-wr-calname", $calname);
$this->vcalendar->setProperty( "X-WR-CALDESC", $caldesc );
$this->vcalendar->setProperty( "X-WR-TIMEZONE", $tz );
$this->vcalendar = new Vcalendar($config);
$this->vcalendar->setMethod( Vcalendar::PUBLISH );
$this->vcalendar->setXprop( Vcalendar::X_WR_CALNAME, $calname);
$this->vcalendar->setXprop( Vcalendar::X_WR_CALDESC, $caldesc);
$this->vcalendar->setXprop( Vcalendar::X_WR_TIMEZONE, $tz);
$url = $ini->Get("pub_web") . '/' . $ini->Get("events_path");
$this->vcalendar->setProperty( "X-FROM-URL", $url);
$this->vcalendar->setProperty( "X-WR-RELCALID", $uuid );
// $this->vcalendar->setXprop( "X-FROM-URL", $url);
$this->vcalendar->setXprop( Vcalendar::X_WR_RELCALID, $uuid);
return $url;
}
......@@ -607,6 +607,7 @@ class Events
$gjoin = $this->geo->GeoJoin("e.id_geo");
$db =& Db::globaldb();
$sqljoin = "";
$wheres = $scores = [];
for ($i = 0; $i < count($words); $i++)
{
$sqljoin .= "INNER JOIN search_index2 si$i ON si$i.id = e.id_event AND si$i.id_res=8 ";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment