Changeset 3966 for branches/2.2.0.1/calendar/inc
- Timestamp:
- 04/11/11 09:44:40 (13 years ago)
- Location:
- branches/2.2.0.1/calendar/inc
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.0.1/calendar/inc/class.bocalendar.inc.php
r3910 r3966 1014 1014 $GLOBALS['phpgw']->datetime = createobject('phpgwapi.date_time'); 1015 1015 } 1016 1016 1017 $l_cal = (@isset($params['cal']) && $params['cal']?$params['cal']:$_POST['cal']); 1018 1019 $post_max_size = ini_get('post_max_size'); 1020 $mul = substr($post_max_size, -1); 1021 $mul = ($mul == 'M' ? 1048576 : ($mul == 'K' ? 1024 : ($mul == 'G' ? 1073741824 : 1))); 1022 if ($_SERVER['CONTENT_LENGTH'] > $mul*(int)$post_max_size && $post_max_size) 1023 $l_cal['attachment'] = 'ERROR'; 1024 1025 if(count($_FILES['cal']) > 0){ 1026 1027 if($l_cal['attachment'] != '') 1028 $attachments = unserialize($l_cal['attachment']); 1029 else 1030 $attachments = Array(); 1031 1032 foreach ($_FILES['cal']['error']['attachment'] as $key => $error) { 1033 1034 if ($error == UPLOAD_ERR_OK) { 1035 1036 $new_file= $GLOBALS['phpgw_info']['server']['temp_dir'].'/'.$_SESSION[ 'phpgw_session' ][ 'session_id' ].md5($attachment['name'].microtime()); 1037 move_uploaded_file($_FILES['cal']['tmp_name']['attachment'][$key], $new_file); 1038 $attach = Array('tmp_name' => $new_file, 'name' => $_FILES['cal']['name']['attachment'][$key], 'type' => $_FILES['cal']['type']['attachment'][$key]); 1039 1040 $attachments[] = $attach; 1041 1042 }elseif($error == UPLOAD_ERR_INI_SIZE){ 1043 $attachments = 'ERROR'; 1044 break; 1045 1046 } 1047 } 1048 $l_cal['attachment'] = $attachments; 1049 1050 } 1017 1051 $l_participants = (@$params['participants']?$params['participants']:$_POST['participants']); 1018 1052 $this->ex_participants = (@$params['ex_participants']?$params['ex_participants']:$_POST['ex_participants']); … … 1153 1187 $this->so->set_title($l_cal['title']); 1154 1188 $this->so->set_description($l_cal['description']); 1189 $this->so->set_attachment($l_cal['attachment']); 1155 1190 $this->so->set_ex_participants($l_cal['ex_participants']); 1156 1191 $this->so->set_start($l_start['year'],$l_start['month'],$l_start['mday'],$l_start['hour'],$l_start['min'],0); … … 1722 1757 } 1723 1758 } 1759 if($event['attachment'] == 'ERROR') 1760 $error = 99; 1761 1724 1762 return $error; 1725 1763 } … … 3502 3540 fclose($attach_fd); 3503 3541 } 3542 3543 if(isset($new_event['attachment'])){ 3544 foreach($new_event['attachment'] as $attach){ 3545 $mail->AddAttachment($attach['tmp_name'], $attach['name'], "base64", $attach['type']); 3546 } 3547 } 3548 3504 3549 $mail->From = $sender; 3505 3550 $mail->FromName = $GLOBALS['phpgw_info']['user']['fullname']; … … 3911 3956 'data' => $GLOBALS['phpgw']->common->show_date($this->maketime($event['modtime']) - $GLOBALS['phpgw']->datetime->tz_offset) 3912 3957 ); 3958 3959 $var['attachment'] = Array( 3960 'field' => $this->translate('Attachment'), 3961 'data' => $event['attachment'] 3962 ); 3913 3963 3914 3964 $var['access'] = Array( -
branches/2.2.0.1/calendar/inc/class.bocustom_fields.inc.php
r2 r3966 31 31 'updated' => 'Updated', 32 32 'alarm' => 'Alarm', 33 'recure_type' => 'Repetition' 33 'recure_type' => 'Repetition', 34 'attachment' => 'attachment' 34 35 ); 35 36 -
branches/2.2.0.1/calendar/inc/class.socalendar.inc.php
r1729 r3966 369 369 $this->cal->set_description($description); 370 370 } 371 function set_attachment($attachment='') 372 { 373 $this->cal->set_attachment($attachment); 374 } 371 375 function set_ex_participants($ex_participants='') 372 376 { -
branches/2.2.0.1/calendar/inc/class.socalendar__.inc.php
r2 r3966 102 102 } 103 103 104 function set_attachment($attachment='') 105 { 106 $this->add_attribute('attachment',$attachment); 107 } 108 104 109 function set_ex_participants($ex_participants='') 105 110 { -
branches/2.2.0.1/calendar/inc/class.socalendar_sql.inc.php
r3608 r3966 569 569 $this->set_title(stripslashes($GLOBALS['phpgw']->strip_html($this->stream->f('title')))); 570 570 $this->set_description(stripslashes($GLOBALS['phpgw']->strip_html($this->stream->f('description')))); 571 $this->set_attachment(stripslashes($GLOBALS['phpgw']->strip_html($this->stream->f('attachment')))); 571 572 $this->set_ex_participants(stripslashes($GLOBALS['phpgw']->strip_html($this->stream->f('ex_participants')))); 572 573 $this->add_attribute('uid',$GLOBALS['phpgw']->strip_html($this->stream->f('uid'))); … … 976 977 . "title='".$this->stream->db_addslashes($event['title'])."', " 977 978 . "description='".$this->stream->db_addslashes($event['description'])."', " 979 . "attachment='".$this->stream->db_addslashes(serialize($event['attachment']))."', " 978 980 . "ex_participants='".$this->stream->db_addslashes($event['ex_participants'])."', " 979 981 . "location='".$this->stream->db_addslashes($event['location'])."', " -
branches/2.2.0.1/calendar/inc/class.uicalendar.inc.php
r3914 r3966 3561 3561 } 3562 3562 3563 if($event['attachment'] != '') 3564 { 3565 $picture[] = Array( 3566 'pict' => $GLOBALS['phpgw']->common->image('calendar','clip'), 3567 'width' => 9, 3568 'height'=> 9, 3569 'title' => lang('Notification with attachments sent.') 3570 ); 3571 } 3572 3563 3573 $description = $this->bo->get_short_field($event,$is_private,'description'); 3564 3574 for($i=0;$i<count($picture);$i++) … … 4487 4497 $vars = $this->bo->event2array($event); 4488 4498 4499 if($vars['attachment']['data'] == "") 4500 $vars['attachment']['data'] = lang('No Attachment'); 4501 else{ 4502 $vars['attachment']['data'] = lang('Has attachment(s)'); 4503 } 4504 4489 4505 $vars['title']['tr_color'] = $this->theme['th_bg']; 4490 4506 … … 5406 5422 // $this->output_template_array($p,'row','list',Array('data' => '<script src="simple_show_hide.js" type="text/javascript"></script>')); 5407 5423 5424 if ($event['attachment'] == '' || $event['attachment'] == 'ERROR' || is_array($event['attachment'])) 5425 $data = '<a onClick="javascript:addAttach()" href="#divFiles" >Anexos: adicionar+</a><div id="divFiles"</div>'; 5426 else 5427 $data = '<input type="hidden" name="cal[attachment]" value='.$event["attachment"].'>'.lang('Notification with attachments sent.').'<br><a onClick="javascript:addAttach()" href="#divFiles" >Anexos: adicionar+</a><div id="divFiles"</div>'; 5428 5429 $var['attachment'] = Array( 5430 'field' => lang('Attachment'), 5431 //'data' => '<input type="file" name="cal[attachment]" />' 5432 'data' => $data 5433 ); 5434 5408 5435 if (!isset($this->fields)) 5409 5436 { -
branches/2.2.0.1/calendar/inc/class.uipublicview.inc.php
r3201 r3966 466 466 ); 467 467 } 468 if($event['attachment'] != '') 469 { 470 $picture[] = Array( 471 'pict' => $GLOBALS['phpgw']->common->image('calendar','circle'), 472 'width' => 9, 473 'height'=> 9, 474 'title' => lang('Has Attachment') 475 ); 476 } 468 477 else 469 478 { … … 520 529 } 521 530 531 if($event['attachment'] != '') 532 { 533 $picture[] = Array( 534 'pict' => $GLOBALS['phpgw']->common->image('calendar','circle'), 535 'width' => 9, 536 'height'=> 9, 537 'title' => lang('Has Attachment') 538 ); 539 } 522 540 $description = $this->bo->get_short_field($event,$is_private,'description'); 523 541 for($i=0;$i<count($picture);$i++)
Note: See TracChangeset
for help on using the changeset viewer.