Show
Ignore:
Timestamp:
09/01/08 19:33:58 (4 months ago)
Author:
ogawa
Message:

Use accessors instead of directly accessing object fields.
Modify Event constructors' parameters so as to be subjected to Cybozu scripting.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • cybozu2ical/trunk/lib/WWW/CybozuOffice6/CalendarDriver/ApiCalendar.pm

    r515 r518  
    8686        my $num_fields = @fields - 1; 
    8787        next if $num_fields < 14; 
    88         $fields[1] =~ s/^ts\.//;    # remove rubbish 
    8988 
    9089        # Cybozu Calendar CSV Format 
     
    107106        my %param; 
    108107        @param{ 
    109             qw(id created freq freq_value start_date end_date start_time end_time abbrev summary description) 
     108            qw(id timestamp type day set_date end_date set_time end_time event detail memo) 
    110109          } = @fields[ 0, 1, 4, 5, 8 .. 11, 12 .. 14 ]; 
    111110 
    112111        $param{time_zone} = $cal->{time_zone} || 'Asia/Tokyo'; 
    113112 
     113        if ( $num_fields > 14 ) { 
     114            my @exception = @fields[ 14 .. $num_fields ]; 
     115            $param{exception} = \@exception; 
     116        } 
     117 
    114118        my $item; 
    115         if ( !$param{freq} ) { 
     119        if ( !$param{type} ) { 
    116120            $item = WWW::CybozuOffice6::Calendar::Event->new(%param); 
    117121        } 
    118122        else { 
    119123            @param{qw(end_date until_date)} = @fields[ 8, 9 ]; 
    120             if ( $num_fields > 14 ) { 
    121                 my @exdates = @fields[ 14 .. $num_fields ]; 
    122                 $param{exdates} = \@exdates; 
    123             } 
    124             my $freq = $param{freq}; 
    125             if ( $freq =~ /^[1-5]$/ ) { 
    126                 $param{freq} = 'm'; 
    127                 my @week_str = ( 'SU', 'MO', 'TU', 'WE', 'TH', 'FR', 'SA' ); 
    128                 $param{freq_value} = $freq . $week_str[ $param{freq_value} ]; 
    129             } 
    130124            $item = WWW::CybozuOffice6::Calendar::RecurrentEvent->new(%param); 
    131125        }