Changeset 5388
- Timestamp:
- 01/17/12 17:18:42 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoMail1_2/inc/class.db_functions.inc.php
r5380 r5388 363 363 364 364 function import_vcard($params){ 365 366 include_once('class.imap_functions.inc.php'); 367 $objImap = new imap_functions(); 368 $msg_number = $params['msg_number']; 369 $idx_file = $params['idx_file']; 370 $msg_part = $params['msg_part']; 371 $msg_folder = $params['msg_folder']; 365 include_once('class.imap_functions.inc.php'); 366 $objImap = new imap_functions(); 367 $msg_number = $params['msg_number']; 368 $idx_file = $params['idx_file']; 369 $msg_part = $params['msg_part']; 370 $msg_folder = $params['msg_folder']; 372 371 $from_ajax = $params['from_ajax']; 373 374 372 $encoding = strtolower($params['encoding']); 373 $fileContent = ""; 375 374 $cirus_delimiter = $params['cirus_delimiter']; 376 375 $expFolder = explode($cirus_delimiter, $msg_folder); … … 378 377 if($msg_number != null && $msg_part != null && $msg_folder != null && (intval($idx_file == '0' ? '1' : $idx_file))) 379 378 { 380 require_once dirname(__FILE__).'/class.attachment.inc.php';379 require_once PHPGW_INCLUDE_ROOT.'/expressoMail1_2/inc/class.attachment.inc.php'; 381 380 $attachmentObj = new attachment(); 382 381 $attachmentObj->setStructureFromMail($msg_folder,$msg_number); … … 384 383 $info = $attachmentObj->getAttachmentInfo($msg_part); 385 384 $filename = $info['name']; 386 387 388 389 390 // It's necessary to access calendar method. 385 } 386 else 387 $filename = $idx_file; 388 389 // It's necessary to access calendar method. 391 390 $GLOBALS['phpgw_info']['flags']['noappheader'] = True; 392 391 $GLOBALS['phpgw_info']['flags']['noappfooter'] = True; 393 392 $GLOBALS['phpgw_info']['flags']['currentapp'] = 'calendar'; 394 include_once(PHPGW_INCLUDE_ROOT.'/header.inc.php'); 395 $uiicalendar = CreateObject("calendar.uiicalendar"); 396 393 include_once(PHPGW_INCLUDE_ROOT.'/header.inc.php'); 394 $uiicalendar = CreateObject("calendar.uiicalendar"); 395 if($params['selected'] || $params['readable']){ 396 $_REQUEST['data'] = $fileContent; 397 $_REQUEST['type'] = 'iCal'; 398 $_REQUEST['params']['calendar'] = $params['selected']; 399 $_REQUEST['readable'] = $params['readable'] ? true : false; 400 $_REQUEST['params']['status'] = $params['status']; 401 $_REQUEST['params']['owner'] = $_SESSION['phpgw_info']['expressomail']['user']['account_id']; 402 ob_start(); 403 include_once(PHPGW_INCLUDE_ROOT.'/prototype/converter.php'); 404 $output = ob_get_clean(); 405 $valid = json_decode($output, true); 406 407 408 if($_REQUEST['readable']){ 409 if(!$valid) 410 { 411 $return = false; 412 $output = unserialize($output); 413 foreach($output[0] as $key => $value){ 414 if(array_key_exists("id",$output[0][$key])) 415 $return = true; 416 } 417 return $return; 418 } 419 return false; 420 } 421 422 if(empty($valid)) 423 return "error"; 424 return "ok"; 425 } 397 426 if(strtoupper($expFolder[0]) == 'USER' && $expFolder[1]) // IF se a conta o ical estiver em uma conta compartilhada 398 427 { … … 407 436 else 408 437 return $uiicalendar->import_from_mail($fileContent, $from_ajax); 409 410 438 411 439 } 412 440
Note: See TracChangeset
for help on using the changeset viewer.