Changeset 5604 for trunk/prototype
- Timestamp:
- 03/02/12 03:48:47 (12 years ago)
- Location:
- trunk/prototype
- Files:
-
- 3 added
- 3 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/prototype/api/datalayer.js
r5601 r5604 19 19 20 20 if( isIframe.test( options.dataType ) || options.data instanceof FormData ) 21 { 21 { 22 options.url = options.fileInput.parents( 'form' ).attr( 'action' ); 23 22 24 res = internalUrl.exec( options.url ); 23 25 -
trunk/prototype/config/mailAttachment.ini
r5514 r5604 1 1 service = PostgreSQL 2 PostgreSQL.concept = attachment 3 4 [model.hasOne] 5 schedulable = schedulable.attachments 2 PostgreSQL.concept = mail_attachment 6 3 7 4 [before.create] 8 encodeCreateAttachment = modules/calendar/interceptors/DBMapping.php 9 10 [after.delete] 11 deleteAttachmentDependences = modules/calendar/interceptors/DBMapping.php 5 encodeCreateAttachment = modules/mail/interceptors/Attachments.php 12 6 13 7 [PostgreSQL.mapping] … … 17 11 name = "name" 18 12 size = "size" 19 13 owner = "owner" 14 disposition = "disposition" 15 dtstamp = "dtstamp" -
trunk/prototype/getArchive.php
r5514 r5604 7 7 8 8 foreach($data as $concept => $value){ 9 9 10 10 $arquive = Controller::find( array( 'concept' => $concept ) , false ,array( 'filter' => array('=', 'id' , $data[$concept]) )); 11 11 -
trunk/prototype/services/ImapServiceAdapter.php
r5586 r5604 333 333 334 334 public function create( $URI, $data) 335 { 335 { 336 336 switch( $URI['concept'] ) 337 337 { … … 364 364 } 365 365 return array (); 366 } 367 case 'message': 368 { 369 $GLOBALS['phpgw_info']['flags'] = array( 'noheader' => true, 'nonavbar' => true,'currentapp' => 'expressoMail1_2','enable_nextmatchs_class' => True ); 370 $return = array(); 371 372 require_once dirname(__FILE__) . '/../../services/class.servicelocator.php'; 373 $mailService = ServiceLocator::getService('mail'); 374 375 $msg_uid = $data['msg_id']; 376 $body = $data['body']; 377 $body = str_replace("%nbsp;"," ",$body); 378 $body = preg_replace("/\n/"," ",$body); 379 $body = preg_replace("/\r/","" ,$body); 380 $body = html_entity_decode ( $body, ENT_QUOTES , 'ISO-8859-1' ); 381 382 $folder = mb_convert_encoding($data['folder'], "UTF7-IMAP","ISO-8859-1, UTF-8"); 383 $folder = @eregi_replace("INBOX[/.]", "INBOX".$this->imap_delimiter, $folder); 384 385 $mailService->addTo($data['input_to']); 386 $mailService->addCc( $data['input_cc']); 387 $mailService->addBcc($data['input_cco']); 388 $mailService->setSubject($data['input_subject']); 389 390 if(isset($data['input_important_message'])) 391 $mailService->addHeaderField('Importance','High'); 392 393 if(isset($data['input_return_receipt'])) 394 $mailService->addHeaderField('Disposition-Notification-To', Config::me('mail')); 395 396 $isHTML = ( ( array_key_exists( 'type', $data ) && in_array( strtolower( $data[ 'type' ] ), array( 'html', 'plain' ) ) ) ? strtolower( $data[ 'type' ] ) != 'plain' : true ); 397 398 if (!$body) $body = ' '; 399 400 401 $mbox_stream = $this->open_mbox($folder); 402 403 $attachment = json_decode($data['attachments'],TRUE); 404 405 406 foreach ($attachment as &$value) 407 { 408 409 if((int)$value > 0) //BD attachment 410 { 411 $att = Controller::read(array('id'=> $value , 'concept' => 'mailAttachment')); 412 413 if($att['disposition'] == 'embedded') 414 { 415 $body = str_replace('"../prototype/getArchive.php?mailAttachment='.$att['id'].'"', $att['name'], $body); 416 $mailService->addStringImage(base64_decode($att['source']), $att['type'], $att['name']); 417 } 418 else 419 $mailService->addStringAttachment(base64_decode($att['source']), $att['name'], $att['type'], 'base64', isset($att['disposition']) ? $att['disposition'] :'attachment' ); 420 421 unset($att); 422 } 423 else //message attachment 424 { 425 $value = json_decode($value, true); 426 $sub = $value['name'] ? $value['name'].'.eml' :'no title.eml'; 427 $mbox_stream = $this->open_mbox($value['folder']); 428 $rawmsg = $this->getRawHeader($value['uid']) . "\r\n\r\n" . $this->getRawBody($value['uid']); 429 $mailService->addStringAttachment($rawmsg, $sub, 'message/rfc822', '7bit', 'attachment' ); 430 unset($rawmsg); 431 } 432 433 } 434 435 if($isHTML) $mailService->setBodyHtml($body); else $mailService->setBodyText($body); 436 437 if(imap_append($mbox_stream, "{".$this->imap_server.":".$this->imap_port."}".$folder, $mailService->getMessage(), "\\Seen \\Draft")) 438 { 439 $status = imap_status($mbox_stream, "{".$this->imap_server.":".$this->imap_port."}".$folder, SA_UIDNEXT); 440 $return['id'] = $status->uidnext - 1; 441 442 if($data['uidsSave'] ) 443 $this->delete_msgs(array('folder'=> $folder , 'msgs_number' => $data['uidsSave'])); 444 445 } 446 447 if($mbox_stream) imap_close($mbox_stream); 448 449 450 451 return $return; 366 452 } 367 453 }
Note: See TracChangeset
for help on using the changeset viewer.