Ignore:
Timestamp:
10/08/12 09:39:44 (11 years ago)
Author:
eduardow
Message:

Ticket #3140 - Problemas naas tarefas e atividades (title e formato de emails).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.4/prototype/modules/calendar/interceptors/Notifications.php

    r7228 r7360  
    275275        $data = array_merge($data, $delegatedParams); 
    276276 
    277         self::sendMail($data, $ical, $part['user']['mail'], $subject, 'notify_response_delegated_status_body'); 
     277        self::sendMail($data, $ical, $part['user']['mail'], $subject, $schedulable['type'] == '1' ? 'notify_response_delegated_status_body' : 'notify_response_delegated_status_body_task'); 
    278278    } 
    279279 
     
    296296 
    297297            if ($schedulable['allDay']) 
    298                 $schedulable['endTime'] = $schedulable['endTime'] + 86400000; 
     298                        $schedulable['endTime'] = $schedulable['endTime'] + 86400000; 
    299299        } 
    300300 
     
    365365     */ 
    366366    public static function participantCreated(&$partID, &$schedulable, $type = false, $delegatedParams = false, $organizer = false) { 
    367         $method = 'REQUEST'; 
    368         $notificationType = 'Convite de Calendario'; 
    369         $part = 'attendees'; 
    370         self::mountStruture($partID, $schedulable, $type, $data, $subject, $ical, $part, $method, $notificationType, true); 
    371  
    372         if ($delegatedParams) 
    373             $data = array_merge($data, $delegatedParams); 
    374  
    375         self::sendMail($data, $ical, $part['user']['mail'], $subject, !$delegatedParams ? 'notify_create_body' : 'notify_create_delegated_body', $organizer); 
     367                $method = 'REQUEST';  
     368        $notificationType = 'Convite de Calendario';  
     369        $part = 'attendees';  
     370  
     371        if($schedulable['type'] == '2'){  
     372            $template = !$delegatedParams ? 'notify_create_body_task' : 'notify_create_delegated_body_task';  
     373        }else{  
     374            $template = !$delegatedParams ? 'notify_create_body' : 'notify_create_delegated_body';  
     375        }  
     376  
     377        self::mountStruture($partID, $schedulable, $type, $data, $subject, $ical, $part, $method, $notificationType, true);  
     378  
     379        if ($delegatedParams)  
     380            $data = array_merge($data, $delegatedParams);  
     381  
     382        self::sendMail($data, $ical, $part['user']['mail'], $subject, $template, $organizer); 
    376383    } 
    377384 
     
    395402        if ($delegatedParams) { 
    396403            $data = array_merge($data, $delegatedParams); 
    397             $tplDelegated = 'notify_delegated_status_body'; 
     404            $tplDelegated = $schedulable['type'] == '1' ? 'notify_delegated_status_body' : 'notify_delegated_status_body_task'; 
    398405        } 
    399406 
    400407        switch ($type) { 
    401408            case STATUS_ACCEPTED: 
    402                 $tpl = !$delegatedParams ? 'notify_accept_body' : $tplDelegated; 
     409                $tpl = $delegatedParams ? $tplDelegated : ($schedulable['type'] == '1' ? 'notify_accept_body' : 'notify_accept_body_task'); 
    403410                $subject['notificationType'] = 'Convite Aceito'; 
    404411                break; 
    405412            case STATUS_TENTATIVE: 
    406                 $tpl = !$delegatedParams ? 'notify_attempt_body' : $tplDelegated; 
     413                $tpl = $delegatedParams ? $tplDelegated :($schedulable['type'] == '1' ? 'notify_attempt_body' : 'notify_attempt_body_task'); 
    407414                $subject['notificationType'] = 'Convite  aceito provisoriamente'; 
    408415                break; 
    409416            case STATUS_CANCELLED: 
    410                 $tpl = !$delegatedParams ? 'notify_reject_body' : $tplDelegated; 
     417                $tpl = $delegatedParams ? $tplDelegated :($schedulable['type'] == '1' ? 'notify_reject_body' : 'notify_reject_body_task'); 
    411418                $subject['notificationType'] = 'Convite rejeitado'; 
    412419                break; 
     
    414421                if ($delegatedParams) 
    415422                    $data = array_merge($data, $delegatedParams); 
    416                 $tpl = 'notify_delegated_body'; 
     423                $tpl = $schedulable['type'] == '1' ? 'notify_delegated_body' : 'notify_delegated_body_task'; 
    417424                $subject['notificationType'] = 'Convite delegado'; 
    418425                break; 
     
    534541 
    535542        if (isset($part) && $part && count($part) > 0)  
    536             self::sendMail($data, $ical, implode(',', $part), $subject, 'notify_modify_body', $from);  
     543            self::sendMail($data, $ical, implode(',', $part), $subject, $schedulableOld['type'] == '1' ?  'notify_modify_body' : 'notify_modify_body_task', $from);  
    537544    }  
    538545    } 
Note: See TracChangeset for help on using the changeset viewer.