Dear All,
i am trying to update an event on google calendar and when i do that, the
script throw an exception with this message :
"You must specify the location as either a string URI or a child of
Zend_Gdata_Query"
but the event get updated successfully
here is my code :
function updateEvent ($client, $eventId, $title, $desc, $where,
$startDate, $startTime, $endDate, $endTime, $tzOffset = '02')
{
$gdataCal = new Zend_Gdata_Calendar($client);
$eventOld = $gdataCal->getCalendarEventEntry($eventId);
if ($eventOld) {
$eventOld->title = $gdataCal->newTitle($title);
$eventOld->where = array($gdataCal->newWhere($where));
$eventOld->content = $gdataCal->newContent("$desc");
$when = $gdataCal->newWhen();
$when->startTime =
"{$startDate}T{$startTime}:00.000{$tzOffset}:00";
$when->endTime = "{$endDate}T{$endTime}:00.000{$tzOffset}:00";
$eventOld->when = array($when);
try {
$eventOld->save();
} catch (Zend_Gdata_App_Exception $e) {
var_dump($e);
return null;
}
$eventNew = $gdataCal->getCalendarEventEntry($client,
$eventId);
return $eventNew->id->text;
} else {
return null;
}
}
try {
$event_id = updateEvent($client, $event_id, $event_title,
$event_decription, $event_place, $event_start_day, $event_start_time,
$event_end_day, $event_end_time, '+03');
}catch (Exception $e){
//$now = new Zend_Date();
$reservations->update(array('event_id'=>$event_id,
'event_status'=>'saved'), 'reservation_id ='.$reservation_id);
}
////////////////////////////////////////////////////////////////////////////////
and here is the values i am passing to the function :
Array
(
[event_id] =>
http://www.google.com/calendar/feeds/default/private/full/flrm90e6jmnl3fm1i5o3o6564o
[reservation_id] => 1
[user] => [EMAIL PROTECTED]
[pass] => xxxxxxxxxxxxx
[event_title] => ok ok ok
[event_description] => description
[event_start_day] => 2008-07-16
[event_start_time] => 19:00
[event_end_day] => 2008-07-16
[event_end_time] => 20:50
[event_place] => Somewhere
[reminder_offset] => 5
)
anybody has any idea why i am getting this exception and how i can avoid it
???
--
Ahmed Abdel-Aliem