Changeset 5346


Ignore:
Timestamp:
01/10/12 14:54:53 (12 years ago)
Author:
gustavo
Message:

Ticket #2433 - Adicionar a configuração da nova agenda no expressoMail

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/expressoMail1_2/inc/class.db_functions.inc.php

    r5316 r5346  
    354354         
    355355        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']; 
    363362            $from_ajax = $params['from_ajax']; 
    364                 $encoding = strtolower($params['encoding']); 
    365                 $fileContent = ""; 
     363            $encoding = strtolower($params['encoding']); 
     364            $fileContent = ""; 
    366365            $cirus_delimiter = $params['cirus_delimiter']; 
    367366            $expFolder = explode($cirus_delimiter, $msg_folder); 
     
    369368            if($msg_number != null && $msg_part != null && $msg_folder != null && (intval($idx_file == '0' ? '1' : $idx_file))) 
    370369            { 
    371                 require_once dirname(__FILE__).'/class.attachment.inc.php'; 
     370                require_once PHPGW_INCLUDE_ROOT.'/expressoMail1_2/inc/class.attachment.inc.php'; 
    372371                $attachmentObj = new attachment(); 
    373372                $attachmentObj->setStructureFromMail($msg_folder,$msg_number); 
     
    375374                $info = $attachmentObj->getAttachmentInfo($msg_part); 
    376375                $filename = $info['name']; 
    377                 } 
    378                 else 
    379                         $filename = $idx_file; 
    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. 
    382381            $GLOBALS['phpgw_info']['flags']['noappheader'] = True; 
    383382            $GLOBALS['phpgw_info']['flags']['noappfooter'] = True; 
    384383            $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']){ 
     387ob_start(); 
     388print_r( "=== LOG BEGIN ===" . "\n" ); 
     389print_r( var_export($fileContent) . "\n" ); 
     390print_r( "=== LOG END ===" . "\n" ); 
     391$output2 = ob_get_clean(); 
     392file_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 
     404ob_start(); 
     405print_r( "=== LOG BEGIN ===" . "\n" ); 
     406print_r( var_export($output) . "\n" ); 
     407print_r( var_export($valid) . "\n" ); 
     408print_r( "=== LOG END ===" . "\n" ); 
     409$output2 = ob_get_clean(); 
     410file_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                        } 
    388430            if(strtoupper($expFolder[0]) == 'USER' && $expFolder[1]) // IF se a conta o ical estiver em uma conta compartilhada 
    389431            { 
  • trunk/expressoMail1_2/inc/class.imap_functions.inc.php

    r5318 r5346  
    25922592                        if ( $deny ) 
    25932593                                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                } 
    25982611 
    25992612                $toaddress  = preg_replace('/<\s+/', '<', $toaddress);                   
  • trunk/expressoMail1_2/index.php

    r5316 r5346  
    244244    var token_param = "'.$var_tokens.'"; 
    245245    var locale = "'.$GLOBALS['phpgw']->common->getPreferredLanguage().'"; 
     246        var new_agenda = "'.$current_config['new_agenda'].'"; 
    246247    </script>'; 
    247248 
  • trunk/expressoMail1_2/templates/default/config.tpl

    r5134 r5346  
    116116           </select>  
    117117            </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> 
    119128    <tr bgcolor="{row_off}"> 
    120129    <td>{lang_googlegears_url}</td> 
  • trunk/expressoMail1_2/templates/default/index.tpl

    r5304 r5346  
    186186        </fieldset>    
    187187</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> 
    188207<!-- END list --> 
  • trunk/prototype/converter.php

    r5341 r5346  
    1111                          $_REQUEST['params'] ); 
    1212 
    13 require_once 'Sync.php'; 
     13if(!$_REQUEST['readable']) 
     14        require_once 'Sync.php'; 
     15else 
     16        print_r(serialize($args)); 
    1417 
    1518?> 
Note: See TracChangeset for help on using the changeset viewer.