Changeset 8000 for trunk/prototype


Ignore:
Timestamp:
03/12/13 11:46:06 (11 years ago)
Author:
cristiano
Message:

Ticket #3385 - ERRO ao Ao excluir um evento de uma agenda compartilhada

Location:
trunk/prototype
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/prototype/config/participant.ini

    r7980 r8000  
    2828[before.delete] 
    2929prepareParticipantHistoric = modules/calendar/interceptors/DBMapping.php 
     30deleteParticipant = modules/calendar/interceptors/Notifications.php 
    3031 
    3132[after.delete] 
  • trunk/prototype/modules/calendar/interceptors/Notifications.php

    r7910 r8000  
    483483    public function deleteEvent(&$uri, &$result, &$params, $original) { 
    484484        $schedulable = Controller::read(array('concept' => 'schedulable', 'id' => $uri['id']), null, array('deepness' => '2')); 
     485 
    485486        if ((Config::regGet('noAlarm') === false) && (self::futureEvent($schedulable['startTime'], $schedulable['rangeEnd'], $schedulable['id']))) { 
    486487            $method = 'CANCEL'; 
     
    490491 
    491492            if (count($part) > 0) 
    492                 self::sendMail($data, $ical, implode(',', $part), $subject, 'notify_cancel_body'); 
     493        { 
     494            $from = false; 
     495            foreach($schedulable['participants'] as $v) 
     496            { 
     497                if($v['isOrganizer'] == 1) 
     498                    $from =  $v; 
     499            } 
     500 
     501            self::sendMail($data, $ical, implode(',', $part), $subject, 'notify_cancel_body' , $from ); 
     502        } 
    493503        } 
    494504    } 
     
    507517 
    508518        $participant = Controller::read(array('concept' => 'participant', 'id' => $uri['id']), null, array('deepness' => '1')); 
    509         $schedulable = Controller::read(array('concept' => 'schedulable', 'id' => $participant['schedulable'])); 
     519    $schedulable = Controller::read(array('concept' => 'schedulable', 'id' => $participant['schedulable']) , false , array('deepness' => '2')); 
    510520 
    511521        if ((Config::regGet('noAlarm') === false) && (self::futureEvent($schedulable['startTime'], $schedulable['rangeEnd'], $schedulable['id']))) { 
    512522            $method = 'CANCEL'; 
    513523            $notificationType = 'Cancelamento de Calendario'; 
    514             $part = 'others'; 
    515             self::mountStruture(false, $schedulable, false, $data, $subject, $ical, $part, $method, $notificationType); 
    516  
    517             self::sendMail($data, $ical, $participant['user']['mail'], $subject, 'notify_cancel_body'); 
     524            $part = 'me'; 
     525            self::mountStruture($schedulable['id'], $schedulable, false, $data, $subject, $ical, $part, $method, $notificationType); 
     526 
     527        $from = false; 
     528        foreach($schedulable['participants'] as $v) 
     529        { 
     530            if($v['isOrganizer'] == 1) 
     531                $from =  $v; 
     532        } 
     533            self::sendMail($data, $ical, $participant['user']['mail'], $subject, 'notify_cancel_body' , $from); 
    518534        } 
    519535    } 
Note: See TracChangeset for help on using the changeset viewer.