WordPress.org

Plugin Directory

Changeset 714450


Ignore:
Timestamp:
05/17/13 15:40:51 (11 months ago)
Author:
joedolson
Message:

Bug fix: duplication of single events

Location:
my-calendar/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • my-calendar/trunk/my-calendar-core.php

    r714062 r714450  
    17261726    } else { 
    17271727        $begin = strtotime($orig_begin); 
    1728         $end = strtotime($orig_end); 
     1728        $end = strtotime($orig_end);     
    17291729        $data = array(  
    17301730            'occur_event_id'=>$id, 
    17311731            'occur_begin'=>date('Y-m-d H:i:s',$begin),  
    17321732            'occur_end'=>date('Y-m-d H:i:s',$end),  
    1733             'occur_group_id'=>$group_id ); 
    1734         $sql = $wpdb->insert( my_calendar_event_table(), $data, $format ); 
     1733            'occur_group_id'=>$group_id );   
     1734             
     1735        $occurs = $wpdb->get_results("SELECT * FROM ".my_calendar_event_table()." WHERE occur_event_id = $id ORDER BY occur_begin DESC"); 
     1736        if ( count($occurs) == 0 ) { 
     1737            $sql = $wpdb->insert( my_calendar_event_table(), $data, $format ); 
     1738        } 
    17351739    } 
    17361740    return $data; 
  • my-calendar/trunk/my-calendar-event-manager.php

    r714062 r714450  
    495495    $warning = ''; 
    496496    if ( $data ) { 
    497         $check = mc_increment_event( $data->event_id, array(), 'test' ); 
    498         if ( my_calendar_date_xcomp( $check['occur_begin'] , $data->event_end .' '.$data->event_endtime ) ) { 
    499             $warning = "<div class='updated'><p>".__('This event ends after the next occurrence begins. Events must end <strong>before</strong> the next occurrence begins.','my-calendar')."</p><p>".sprintf( __('Event end date: <strong>%s %s</strong>. Next occurrence starts: <strong>%s</strong>','my-calendar'), $data->event_end, $data->event_endtime, $check['occur_begin'] )."</p></div>"; 
    500             echo $warning; 
    501         }        
     497        if ( !( $data->event_recur == 'S' || $data->event_recur == 'S1' ) ) { 
     498            $check = mc_increment_event( $data->event_id, array(), 'test' ); 
     499            if ( my_calendar_date_xcomp( $check['occur_begin'] , $data->event_end .' '.$data->event_endtime ) ) { 
     500                $warning = "<div class='updated'><p>".__('This event ends after the next occurrence begins. Events must end <strong>before</strong> the next occurrence begins.','my-calendar')."</p><p>".sprintf( __('Event end date: <strong>%s %s</strong>. Next occurrence starts: <strong>%s</strong>','my-calendar'), $data->event_end, $data->event_endtime, $check['occur_begin'] )."</p></div>"; 
     501                echo $warning; 
     502            } 
     503        } 
    502504    } 
    503505    $instance = ( isset($_GET['date'] ) )?(int) $_GET['date']:false; 
     
    13991401        $title_length = strlen($title); 
    14001402        if ( $title_length > 1 && $title_length <= 255 ) { 
    1401             $title_ok =1; 
     1403            $title_ok = 1; 
    14021404        } else { 
    14031405            $errors .= "<div class='error'><p><strong>".__('Error','my-calendar').":</strong> ".__('The event title must be between 1 and 255 characters in length.','my-calendar')."</p></div>"; 
  • my-calendar/trunk/my-calendar.php

    r714062 r714450  
    66Author: Joseph C Dolson 
    77Author URI: http://www.joedolson.com 
    8 Version: 2.2.3 
     8Version: 2.2.4 
    99*/ 
    1010/*  Copyright 2009-2013  Joe Dolson (email : joe@joedolson.com) 
     
    2727 
    2828global $mc_version, $wpdb; 
    29 $mc_version = '2.2.3'; 
     29$mc_version = '2.2.4'; 
    3030 
    3131// Define the tables used in My Calendar 
  • my-calendar/trunk/readme.txt

    r714062 r714450  
    8585 
    8686== Changelog == 
     87 
     88= 2.2.4 = 
     89 
     90* Bug fix: event duplication bug in 2.2.3 
    8791 
    8892= 2.2.3 = 
Note: See TracChangeset for help on using the changeset viewer.