diff -uNr expressov2.2/calendar/inc/class.bocalendar.inc.php expressov2/calendar/inc/class.bocalendar.inc.php
old
|
new
|
|
2973 | 2973 | { |
2974 | 2974 | if(!is_array($event_arrays)) |
2975 | 2975 | return null; |
2976 | | |
| 2976 | $sender = $GLOBALS['phpgw_info']['user']['email']; |
| 2977 | $uid_dono = $GLOBALS['phpgw_info']['user']['account_lid']; |
2977 | 2978 | $tmpattach="BEGIN:VCALENDAR\n" |
2978 | 2979 | ."PRODID:-//Expresso Livre//Calendar//EN\n" |
2979 | 2980 | ."VERSION:1.0\n"; |
… |
… |
|
2999 | 3000 | ."DTSTART:".$start_time."\r\n" |
3000 | 3001 | ."DTEND:".$end_time."\r\n" |
3001 | 3002 | ."LAST-MODIFIED:".gmdate("Ymd\THis\Z")."\r\n" //Hora no formato UTC |
3002 | | ."UID:Expresso-".$event['id'].$event['uid']."\r\n" |
| 3003 | //."UID:Expresso-".$event['id'].$event['uid']."\r\n" |
| 3004 | ."UID:Expresso-".$event[id]."@".$uid_dono."\n" |
3003 | 3005 | ."DESCRIPTION:".$description."\r\n" |
3004 | 3006 | ."SUMMARY:".$event['title']."\r\n" |
3005 | 3007 | ."LOCATION:".$event['location']."\r\n" |
3006 | | ."END:VEVENT\r\n"; |
| 3008 | ."ORGANIZER:mailto:".$sender."\n"; |
| 3009 | $expart=preg_split('/,/', $event['ex_participants']); |
| 3010 | foreach ($expart as $mail) |
| 3011 | { if($mail != ""){ |
| 3012 | $tmpattach.="ATTENDEE;RSVP=TRUE;PARTSTAT=NEEDS-ACTION;ROLE=REQ-PARTICIPANT:mailto:".$mail."\n"; |
| 3013 | } |
| 3014 | } |
| 3015 | while (list($id,$status) = each($event['participants'])) |
| 3016 | { |
| 3017 | |
| 3018 | $preferences = CreateObject('phpgwapi.preferences',$id); |
| 3019 | $mail = $preferences->email_address($id); |
| 3020 | if ( $sender != $mail) |
| 3021 | { |
| 3022 | if($status == 'U' ){ |
| 3023 | $tmpattach.="ATTENDEE;RSVP=TRUE;PARTSTAT=NEEDS-ACTION;ROLE=REQ-PARTICIPANT:mailto:".$mail."\n"; |
| 3024 | } |
| 3025 | elseif($status == 'A' ){ |
| 3026 | $tmpattach.="ATTENDEE;RSVP=TRUE;PARTSTAT=ACCEPTED;ROLE=REQ-PARTICIPANT:mailto:".$mail."\n"; |
| 3027 | } |
| 3028 | elseif($status == 'T' ){ |
| 3029 | $tmpattach.="ATTENDEE;RSVP=TRUE;PARTSTAT=TENTATIVE;ROLE=REQ-PARTICIPANT:mailto:".$mail."\n"; |
| 3030 | } |
| 3031 | else |
| 3032 | { |
| 3033 | $tmpattach.="ATTENDEE;RSVP=TRUE;PARTSTAT=DECLINED;ROLE=REQ-PARTICIPANT:mailto:".$mail."\n"; |
| 3034 | } |
| 3035 | } |
| 3036 | } |
| 3037 | $tmpattach.="END:VEVENT"."\n"; |
| 3038 | //."END:VEVENT\r\n"; |
3007 | 3039 | } |
3008 | 3040 | $tmpattach.="END:VCALENDAR\r\n"; |
3009 | 3041 | return $tmpattach; |
… |
… |
|
3160 | 3192 | $mail->Port = $emailadmin['smtpPort']; |
3161 | 3193 | $mail->From = $GLOBALS['phpgw']->preferences->values['email']; |
3162 | 3194 | $mail->FromName = $GLOBALS['phpgw_info']['user']['fullname']; |
3163 | | $mail->IsHTML(true); |
3164 | | |
| 3195 | //$mail->IsHTML(true); |
| 3196 | $mail->IsCalendar(true); |
3165 | 3197 | // Aqui e enviado o email |
3166 | 3198 | foreach($to_notify as $userid => $statusid) |
3167 | 3199 | { |
… |
… |
|
3421 | 3453 | break; |
3422 | 3454 | } |
3423 | 3455 | $mail->AddAddress($to); |
3424 | | $mail->Body = $tmpbody; |
3425 | | $mail->From = $sender; |
| 3456 | //$mail->Body = $tmpbody; |
| 3457 | $tmpattach_n = $this->create_vcard($GLOBALS['bocalendar']->so->cal->event); |
| 3458 | $tmpattach = str_replace("Expresso-","",$tmpattach_n); |
| 3459 | $mail->Body = "This is a multi-part message in MIME format."; |
| 3460 | $mail->Body .= "\n--01BD3665.3AF0D360\n"; |
| 3461 | $mail->Body .= "Content-Type: text/html; charset=\"iso-8859-1\"\nContent-Transfer-Encoding: 8bit\n"; |
| 3462 | $mail->Body .= $tmpbody; |
| 3463 | $mail->Body .= "\n--01BD3665.3AF0D360\n"; |
| 3464 | $mail->Body .="Content-Type:text/calendar; method=REQUEST; charset=US-ASCII\nContent-Transfer-Encoding:7bit\n\n"; |
| 3465 | $mail->Body .= $tmpattach; |
| 3466 | $mail->Body .= "\n--01BD3665.3AF0D360--\n"; |
| 3467 | $mail->From = $sender; |
3426 | 3468 | $mail->FromName = $GLOBALS['phpgw_info']['user']['fullname']; |
3427 | 3469 | $mail->Sender = $mail->From; |
3428 | 3470 | $mail->SenderName = $mail->FromName; |
… |
… |
|
3447 | 3489 | if(count($to_notify) && $this->ex_participants){ |
3448 | 3490 | $mail->ClearAllRecipients(); |
3449 | 3491 | $var = explode(",",trim($this->ex_participants)); |
3450 | | $to = array(); |
| 3492 | $mail->IsHTML(true); |
| 3493 | $to = array(); |
3451 | 3494 | if(!$subject) { |
3452 | 3495 | $details['startdate'] = $GLOBALS['phpgw']->common->show_date($starttime); |
3453 | 3496 | $details['enddate'] = $GLOBALS['phpgw']->common->show_date($endtime); |
diff -uNr expressov2.2/phpgwapi/inc/class.phpmailer.inc.php expressov2/phpgwapi/inc/class.phpmailer.inc.php
old
|
new
|
|
233 | 233 | * @param bool $bool |
234 | 234 | * @return void |
235 | 235 | */ |
| 236 | function Iscalendar($bool) { |
| 237 | if($bool == true) |
| 238 | $this->ContentType = "multipart/alternative;\n boundary=\"01BD3665.3AF0D360\"\n"; |
| 239 | else |
| 240 | $this->ContentType = "text/plain"; |
| 241 | } |
236 | 242 | function IsHTML($bool) { |
237 | 243 | if($bool == true) |
238 | 244 | $this->ContentType = "text/html"; |