Changeset 5132 for trunk/calendar/inc/class.socalendar_sql.inc.php
- Timestamp:
- 11/03/11 13:21:19 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/calendar/inc/class.socalendar_sql.inc.php
r4316 r5132 13 13 * option) any later version. * 14 14 \**************************************************************************/ 15 15 if($_SESSION['isCrun']){ 16 $_SESSION['isCrun'] = false; 17 $_SESSION['rootPath'] = PHPGW_INCLUDE_ROOT; 18 require_once $_SESSION['rootPath'].'/API/class.servicelocator.php'; 19 }else{ 20 require_once $_SESSION['rootPath'].'/API/class.servicelocator.php'; 21 } 16 22 17 23 if (@$GLOBALS['phpgw_info']['flags']['included_classes']['socalendar_']) … … 569 575 $this->set_title(stripslashes($GLOBALS['phpgw']->strip_html($this->stream->f('title')))); 570 576 $this->set_description(stripslashes($GLOBALS['phpgw']->strip_html($this->stream->f('description')))); 571 $this->set_observations(stripslashes($GLOBALS['phpgw']->strip_html($this->stream->f('observations'))));572 $this->set_notifications_owner(stripslashes($GLOBALS['phpgw']->strip_html($this->stream->f('notifications_owner'))));573 $this->set_alter_by(stripslashes($GLOBALS['phpgw']->strip_html($this->stream->f('alter_by'))));574 $this->set_attachment(stripslashes($GLOBALS['phpgw']->strip_html($this->stream->f('attachment'))));575 577 $this->set_ex_participants(stripslashes($GLOBALS['phpgw']->strip_html($this->stream->f('ex_participants')))); 576 578 $this->add_attribute('uid',$GLOBALS['phpgw']->strip_html($this->stream->f('uid'))); 577 579 $this->add_attribute('location',stripslashes($GLOBALS['phpgw']->strip_html($this->stream->f('location')))); 580 $this->add_attribute('organizer',stripslashes($GLOBALS['phpgw']->strip_html($this->stream->f('organizer')))); 578 581 $this->add_attribute('reference',(int)$this->stream->f('reference')); 579 582 … … 737 740 else 738 741 { 739 //$user_where .= $this->user;740 742 $user_where .= $this->user . ') OR (phpgw_cal.owner=' . $this->user; 741 743 } … … 902 904 } 903 905 904 function save_event(&$event )906 function save_event(&$event,$sendMail = true, $importAccount = false) 905 907 { 906 908 … … 954 956 $enddate = $this->maketime($event['end']) - $GLOBALS['phpgw']->datetime->tz_offset; 955 957 $today = time() - $GLOBALS['phpgw']->datetime->tz_offset; 956 // 957 // if($event['recur_type'] != MCAL_RECUR_NONE) 958 // { 959 // $type = 'M'; 960 // } 961 // else 962 // { 958 959 963 960 if ($event['type'] == 'hourAppointment') 964 961 $type = 'H'; … … 967 964 }else 968 965 $type = 'E'; 969 // } 970 if(is_array($event['attachment'])) 971 $sattach=serialize($event['attachment']); 972 else if(is_array(unserialize($event['attachment']))) 973 $sattach=$event['attachment']; 974 else 975 $sattach=''; 966 976 967 977 968 $sql = 'UPDATE phpgw_cal SET ' … … 986 977 . "title='".$this->stream->db_addslashes($event['title'])."', " 987 978 . "description='".$this->stream->db_addslashes($event['description'])."', " 988 . "observations='".$this->stream->db_addslashes($event['observations'])."', "989 . 'notifications_owner='.(int)$event['notifications_owner'].','990 . "attachment='".$this->stream->db_addslashes($sattach)."', "991 . "alter_by='".$this->stream->db_addslashes($GLOBALS['phpgw_info']['user']['fullname'])."', "992 979 . "ex_participants='".$this->stream->db_addslashes($event['ex_participants'])."', " 980 . "organizer='".$this->stream->db_addslashes($event['organizer'])."', " 993 981 . "location='".$this->stream->db_addslashes($event['location'])."', " 994 982 . ($event['groups']?"groups='".(count($event['groups'])>1?implode(',',$event['groups']):','.$event['groups'][0].',')."', ":'') … … 1095 1083 $GLOBALS['phpgw_info']['cal_new_event_id'] = $event['id']; 1096 1084 $this->event = $event; 1085 1086 if($sendMail) 1087 { 1088 if($importAccount) 1089 $this->sendEmailEvendAccepted($event,$importAccount); 1090 else 1091 $this->sendEmailEvendAccepted($event); 1092 } 1093 1097 1094 return True; 1098 1095 } 1096 1097 function sendEmailEvendAccepted($event,$importAccount = false) 1098 { 1099 1100 if(!$importAccount) 1101 $importAccount['mail'] = $GLOBALS['phpgw_info']['user']['email']; 1102 1103 //verifica se eh um evento externo se sim envia o vcard de aceitação em anexo 1104 if($event['owner'] == '-2') 1105 { 1106 $mailService = ServiceLocator::getService('mail'); 1107 1108 $tmpbody.= "<b>".lang("Event Accepted")."</b> "; 1109 $tmpbody.= "<br><br>".lang("name").": ".$event['title']."<br>"; 1110 $tmpbody.= "<br>".lang("description").": ".$event['description']."<br>"; 1111 1112 $ev[0] = $event; 1113 1114 $tmpattach= $GLOBALS['calendar']->bocalendar->create_vcard($ev,'REPLY',true,$importAccount); 1115 1116 $mailService->addStringAttachment($tmpattach, 'suggestion.ics', 'application/ics'); 1117 $mailService->addStringAttachment($tmpattach, 'vcalendar.ics', 'utf-8', 'text/calendar; charset=utf-8; method=REPLY;', '7bit', ''); 1118 1119 if(strchr($event['organizer'],'@') && strchr($event['organizer'],'<') && strchr($event['organizer'],'>')) 1120 { 1121 $mail = substr($event['organizer'], strpos($event['organizer'],'<'), strpos($event['organizer'],'>')); 1122 $mail = str_replace('<','', str_replace('>','',$mail)); 1123 } 1124 1125 if($mail) 1126 $mailService->sendMail($mail,$importAccount['mail'],$event['title'],$tmpbody); 1127 1128 } 1129 else 1130 $GLOBALS['calendar']->bocalendar->send_update(MSG_ACCEPTED, $event['participants'],$event); 1131 1132 return; 1133 } 1099 1134 1100 1135 function get_alarm($cal_id)
Note: See TracChangeset
for help on using the changeset viewer.