Ignore:
Timestamp:
02/07/11 17:15:46 (13 years ago)
Author:
eduardoalex
Message:

Ticket #1532 - Adicionada mensagem de erro ao tentar importar o evento 2 vezes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2/calendar/inc/class.uiicalendar.inc.php

    r678 r3736  
    8080                        return $this->bo->import(explode("\n",$calendar),true); 
    8181                } 
    82  
     82                 
     83                function get_error_message($error_number) { 
     84                        switch ($error_number) { 
     85                                case 1: 
     86                                        return lang('event already exists'); 
     87                        } 
     88                } 
    8389 
    8490                function import() 
     
    102108                        } 
    103109 
    104                         $this->template->set_file( 
    105                                 Array( 
    106                                         'vcalimport' => 'vcal_import.tpl' 
    107                                 ) 
    108                         ); 
    109  
     110                        $this->template->set_file(array('vcalimport' => 'vcal_import.tpl')); 
     111                        $this->template->set_block('vcalimport','page_block'); 
     112                        $this->template->set_block('vcalimport','error_block'); 
     113                         
     114                        if($GLOBALS['HTTP_GET_VARS']['error_number']) { 
     115                                $this->template->set_var('error_message',$this->get_error_message( $GLOBALS['HTTP_GET_VARS']['error_number'] ) ); 
     116                                $this->template->parse('error_box','error_block',true); 
     117                        } 
     118                         
    110119                        $var = Array( 
    111120                                'vcal_header'   => '<p>', 
     
    119128                        ); 
    120129                        $this->template->set_var($var); 
    121                         $this->template->pparse('out','vcalimport'); 
     130                        $this->template->pfp('out', 'page_block'); 
     131                        // $this->template->pparse('out','page_block'); 
    122132                } 
    123133        } 
Note: See TracChangeset for help on using the changeset viewer.