Hi,
I'm new using this fantastic Scheduler. I'm trying to import an ICal format from my server side PHP controller. The iCal format is taken from your ecamples:
BEGIN:VCALENDAR
PRODID:-//Last.fm Limited Event Feeds//NONSGML//EN
VERSION:2.0
X-WR-CALNAME:Last.fm Events
X-WR-CALDESC:Event listing - supplied by Last.fm
BEGIN:VEVENT
UID:LFMEVENT-965499
URL;VALUE=URI:http://www.last.fm/event/965499
DTSTAMP:20100204T200000
DTSTART:20100204T200000
DTEND;VALUE=DATE:20100204
DESCRIPTION:some content here
END:VEVENT
END:VCALENDAR
The problem is that it is not rendering the event and in the javascript console appears the error "A.end_date undefined". Could you help me on that?
Thanks
Aleix Vergés
Same data works correctly in my tests - sample is attached
1265377816.zip (34.3 KB)
Hi Stanislav,
Thanks for you answer. Your right, If Icall the file from file system. In my case, the iCal file comes from a server side code and it is called for scheduler like:
scheduler.load("agenda/getical?agenda=1","ical");
This call returns an iCal stream as I see in firebug, but it seems that is not rendered by scheduler. How shoud I send the iCal file from my server side script? Maybe as a file and not as a stream?
Thanks
Aleix Vergés
Component takes whole response as text and parse it according to i-cal format rules. So the content type or any headers do not matter.
It possible that while outputting data by server side script, some extra formatting applied ( new lines, tabulation, white spaces ) which are hardly visible but may be enough to break the correct parsing.
Is the output of agenda/getical?agenda=1 exactly the same (byte-to-byte) as test data in attached sample?
I see no differences between the formats. In fact, I can copy 'n paste the event to a txt file and import it in Firebug without problems. Dont know what can happen. Could help to show you my PHP controller code?
public function geticalAction()
{
$this->_helper->GUI->disableViewRendering();
$idAgenda = $this->_getParam('agenda');
if($idAgenda != null && $idAgenda != "" && $idAgenda != 0) {
$agenda = new StaffModel($idAgenda);
$ical = $agenda->getICalendar();
}
echo $ical;
}
Thanks
Aleix Vergés
There is no any visible problems with your code.
Can you change php code, so instead of output to the browser it will save data to the file, and attach such file to the post ?
Hi,
Changed my code to:
public function geticalAction()
{
$this->_helper->GUI->disableViewRendering();
$idAgenda = $this->_getParam('agenda');
if($idAgenda != null && $idAgenda != "" && $idAgenda != 0) {
$agenda = new StaffModel($idAgenda);
$ical = $agenda->getStaff()->iCal;
}
header ( "Content-type: text/calendar" );
header ( 'Content-Disposition: attachment; filename="data.ical"');
echo $ical;
}
but still the same. Sorry!
Very strange isn't it?
Aleix Vergés