Permalink
Browse files

Corrigido problema na sincronização do calendário

  • Loading branch information...
1 parent 09bb137 commit 0c2bdd571cfaece3bac784a5caa4d4c005df07a5 @p-lambert p-lambert committed Jul 28, 2011
Showing with 6 additions and 6 deletions.
  1. +5 −5 apps/frontend/modules/calendario/actions/actions.class.php
  2. +1 −1 web/js/bookequip.js
@@ -63,10 +63,10 @@ public function executeAdicionar (sfWebRequest $request)
Zend_Loader::loadClass('Zend_Gdata_AuthSub');
Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
Zend_Loader::loadClass('Zend_Gdata_Calendar');
-
+
$gdataCal = new Zend_Gdata_Calendar($this->getClientLogin());
-
- if (!is_null($appointmentData->getCalendarUrl())) {
+
+ if ($appointmentData->getCalendarUrl() != '') {
// Remove a entrada antiga do evento, caso haja alguma.
try {
$event = $gdataCal->getCalendarEventEntry($appointmentData->getCalendarUrl());
@@ -76,7 +76,7 @@ public function executeAdicionar (sfWebRequest $request)
// TODO: Verificar se a remoção de fato ocorreu
$event->delete();
}
-
+
$newEvent = $gdataCal->newEventEntry();
$newEvent->title = $gdataCal->newTitle($appointmentData->getUser()->getProfileFirstName());
$newEvent->where = array($gdataCal->newWhere('Laboratório UNIFESP'));
@@ -85,7 +85,7 @@ public function executeAdicionar (sfWebRequest $request)
$when->startTime = $appointmentData->getAppointmentDate().'T'.$appointmentData->getScheduleInfo()->getStartTime().'-03:00';
$when->endTime = $appointmentData->getAppointmentDate().'T'.$appointmentData->getScheduleInfo()->getEndTime().'-03:00';
$newEvent->when = array($when);
-
+
$equipmentInfo = Doctrine::getTable('LabEquipment')->find($appointmentData->getEquipmentId());
$calendarUrl = str_replace('@', '%40', $equipmentInfo->getCalendarUrl());
View
@@ -2,7 +2,7 @@ $(function() {
function calendarLoop() {
$.ajax({
- url:'http://bookequip/frontend_dev.php/calendario/adicionar',
+ url:'adicionar',
dataType: 'json',
data: {},
success: function(data) {

0 comments on commit 0c2bdd5

Please sign in to comment.