Changeset 5346
- Timestamp:
- 01/10/12 14:54:53 (12 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoMail1_2/inc/class.db_functions.inc.php
r5316 r5346 354 354 355 355 function import_vcard($params){ 356 357 include_once('class.imap_functions.inc.php'); 358 $objImap = new imap_functions(); 359 $msg_number = $params['msg_number']; 360 $idx_file = $params['idx_file']; 361 $msg_part = $params['msg_part']; 362 $msg_folder = $params['msg_folder']; 356 include_once('class.imap_functions.inc.php'); 357 $objImap = new imap_functions(); 358 $msg_number = $params['msg_number']; 359 $idx_file = $params['idx_file']; 360 $msg_part = $params['msg_part']; 361 $msg_folder = $params['msg_folder']; 363 362 $from_ajax = $params['from_ajax']; 364 365 363 $encoding = strtolower($params['encoding']); 364 $fileContent = ""; 366 365 $cirus_delimiter = $params['cirus_delimiter']; 367 366 $expFolder = explode($cirus_delimiter, $msg_folder); … … 369 368 if($msg_number != null && $msg_part != null && $msg_folder != null && (intval($idx_file == '0' ? '1' : $idx_file))) 370 369 { 371 require_once dirname(__FILE__).'/class.attachment.inc.php';370 require_once PHPGW_INCLUDE_ROOT.'/expressoMail1_2/inc/class.attachment.inc.php'; 372 371 $attachmentObj = new attachment(); 373 372 $attachmentObj->setStructureFromMail($msg_folder,$msg_number); … … 375 374 $info = $attachmentObj->getAttachmentInfo($msg_part); 376 375 $filename = $info['name']; 377 378 379 380 381 // It's necessary to access calendar method. 376 } 377 else 378 $filename = $idx_file; 379 380 // It's necessary to access calendar method. 382 381 $GLOBALS['phpgw_info']['flags']['noappheader'] = True; 383 382 $GLOBALS['phpgw_info']['flags']['noappfooter'] = True; 384 383 $GLOBALS['phpgw_info']['flags']['currentapp'] = 'calendar'; 385 include_once(PHPGW_INCLUDE_ROOT.'/header.inc.php'); 386 $uiicalendar = CreateObject("calendar.uiicalendar"); 387 384 include_once(PHPGW_INCLUDE_ROOT.'/header.inc.php'); 385 $uiicalendar = CreateObject("calendar.uiicalendar"); 386 if($params['selected'] || $params['readable']){ 387 ob_start(); 388 print_r( "=== LOG BEGIN ===" . "\n" ); 389 print_r( var_export($fileContent) . "\n" ); 390 print_r( "=== LOG END ===" . "\n" ); 391 $output2 = ob_get_clean(); 392 file_put_contents( '/tmp/log-gustavo2.txt', file_get_contents( '/tmp/log-gustavo2.txt' ) . $output2 ); 393 $_REQUEST['data'] = $fileContent; 394 $_REQUEST['type'] = 'iCal'; 395 $_REQUEST['params']['calendar'] = $params['selected']; 396 $_REQUEST['readable'] = $params['readable'] ? true : false; 397 $_REQUEST['params']['status'] = $params['status']; 398 $_REQUEST['params']['owner'] = $_SESSION['phpgw_info']['expressomail']['user']['account_id']; 399 ob_start(); 400 include_once(PHPGW_INCLUDE_ROOT.'/prototype/converter.php'); 401 $output = ob_get_clean(); 402 $valid = json_decode($output, true); 403 404 ob_start(); 405 print_r( "=== LOG BEGIN ===" . "\n" ); 406 print_r( var_export($output) . "\n" ); 407 print_r( var_export($valid) . "\n" ); 408 print_r( "=== LOG END ===" . "\n" ); 409 $output2 = ob_get_clean(); 410 file_put_contents( '/tmp/log-gustavo2.txt', file_get_contents( '/tmp/log-gustavo2.txt' ) . $output2 ); 411 412 if($_REQUEST['readable']){ 413 if(!$valid) 414 { 415 $return = false; 416 $output = unserialize($output); 417 foreach($output[0] as $key => $value){ 418 if(array_key_exists("id",$output[0][$key])) 419 $return = true; 420 } 421 return $return; 422 } 423 return false; 424 } 425 426 if(empty($valid)) 427 return "error"; 428 return "ok"; 429 } 388 430 if(strtoupper($expFolder[0]) == 'USER' && $expFolder[1]) // IF se a conta o ical estiver em uma conta compartilhada 389 431 { -
trunk/expressoMail1_2/inc/class.imap_functions.inc.php
r5318 r5346 2592 2592 if ( $deny ) 2593 2593 return "The server denied your request to send a mail, you cannot use this mail address."; 2594 } 2595 $toaddress = implode(',',$db->getAddrs(explode(',',$params['input_to']))); 2596 $ccaddress = implode(',',$db->getAddrs(explode(',',$params['input_cc']))); 2597 $ccoaddress = implode(',',$db->getAddrs(explode(',',$params['input_cco']))); 2594 } 2595 2596 $toaddress = $db->getAddrs(explode(',',$params['input_to']));//implode(',',); 2597 $ccaddress = $db->getAddrs(explode(',',$params['input_cc']));//implode(',',); 2598 $ccoaddress = $db->getAddrs(explode(',',$params['input_cco']));//implode(',',); 2599 2600 if($toaddress["False"] || $ccaddress["False"] || $ccoaddress["False"]){ 2601 return $this->parse_error("Invalid Mail:", ($toaddress["False"] ? $toaddress["False"] : ($ccaddress["False"] ? $ccaddress["False"] : $ccoaddress["False"]))); 2602 } 2603 2604 $toaddress = implode(',', $toaddress); 2605 $ccaddress = implode(',', $ccaddress); 2606 $ccoaddress = implode(',', $ccoaddress); 2607 2608 if($toaddress == "" && $ccaddress == "" && $ccoaddress == ""){ 2609 return $this->parse_error("Invalid Mail:", ($params['input_to'] ? $params['input_to'] :($params['input_cc'] ? $params['input_cc'] : $params['input_cco'])) ); 2610 } 2598 2611 2599 2612 $toaddress = preg_replace('/<\s+/', '<', $toaddress); -
trunk/expressoMail1_2/index.php
r5316 r5346 244 244 var token_param = "'.$var_tokens.'"; 245 245 var locale = "'.$GLOBALS['phpgw']->common->getPreferredLanguage().'"; 246 var new_agenda = "'.$current_config['new_agenda'].'"; 246 247 </script>'; 247 248 -
trunk/expressoMail1_2/templates/default/config.tpl
r5134 r5346 116 116 </select> 117 117 </td> 118 </tr> 118 </tr> 119 <tr bgcolor="{row_off}"> 120 <td>{lang_New_agenda}</td> 121 <td> 122 <select name="newsettings[new_agenda]"> 123 <option value="false"{selected_new_agenda_False}>{lang_No}</option> 124 <option value="True"{selected_new_agenda_True}>{lang_Yes}</option> 125 </select> 126 </td> 127 </tr> 119 128 <tr bgcolor="{row_off}"> 120 129 <td>{lang_googlegears_url}</td> -
trunk/expressoMail1_2/templates/default/index.tpl
r5304 r5346 186 186 </fieldset> 187 187 </div> 188 <div id="import-dialog" title="Importar Evento" style="display:none"> 189 <p>Seleciona uma Agenda para o Evento :</p> 190 <p> 191 <select style="width:100%;" id="select-agenda"> 192 </select> 193 </p> 194 <p> 195 <label>Status : </label> 196 </p> 197 <p> 198 <select style="width:100%;" id="select-status"> 199 <option value="1">Eu vou</option> 200 <option value="2">Não vou</option> 201 <option value="3">Tentativa</option> 202 </select> 203 </p> 204 </div> 205 <div id="create-event-dialog" title="Criar Evento" style="display:none"> 206 </div> 188 207 <!-- END list --> -
trunk/prototype/converter.php
r5341 r5346 11 11 $_REQUEST['params'] ); 12 12 13 require_once 'Sync.php'; 13 if(!$_REQUEST['readable']) 14 require_once 'Sync.php'; 15 else 16 print_r(serialize($args)); 14 17 15 18 ?>
Note: See TracChangeset
for help on using the changeset viewer.