Redano,
Thanks for your time.
Here is the sql for rows that causes problem:
CREATE TABLE IF NOT EXISTS `events` (
`event_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`start_date` datetime NOT NULL,
`end_date` datetime NOT NULL,
`text` varchar(255) NOT NULL,
`rec_type` varchar(64) NOT NULL,
`event_pid` int(11) NOT NULL,
`event_length` int(11) unsigned NOT NULL,
`user_id` int(11) unsigned NOT NULL,
`res_id` int(11) unsigned NOT NULL,
PRIMARY KEY (`event_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=142 ;
INSERT INTO `events` (`event_id`, `start_date`, `end_date`, `text`, `rec_type`, `event_pid`, `event_length`, `user_id`, `res_id`) VALUES
(70, '2013-08-19 06:00:00', '2013-08-24 06:00:00', 'New event', 'day_1___#5', 0, 6000, 15, 2),
(124, '2013-08-19 10:30:00', '2013-08-24 10:30:00', 'aaaaaaaaaaaaaaa41', 'day_1___#5', 0, 6600, 15, 2),
(138, '2013-08-21 10:30:00', '2013-08-21 12:20:00', 'aaaaaaaaaaaaaaa41', 'none', 124, 1377073800, 15, 2),
(141, '2013-08-24 05:30:00', '2013-08-24 08:05:00', 'New event', '', 0, 0, 4, 1);
In my code I blocked no end date option, so the recurring event has its end date always set by number of occurrences or end date. I assume that problem can occur as the js end date for recurring event is not always the end date of last event in series. In this case the real end date should be 2013-08-23 12:20:00.
new regular event that is used for get_dates() checking is:
start date: 2013-08-24 10:10
end date: 2013-08-24 12:45
As you have some knowledge about SH I wanted to ask you about one more thing - namely generating all recurring events from recurring event data during creation - I have this custom function added to help finding collision when adding new recurring event:
[code] function get_dates_from_pattern($event) {
$this->date_start = $event[‘start_date’];
$this->date_end = $event[‘end_date’];
$date_start = date_parse($event[‘start_date’]);
$this->date_start_ts = mktime($date_start[‘hour’], $date_start[‘minute’], $date_start[‘second’], $date_start[‘month’], $date_start[‘day’], $date_start[‘year’]);
$date_end = date_parse($event[‘end_date’]);
$this->date_end_ts = mktime($date_end[‘hour’], $date_end[‘minute’], $date_end[‘second’], $date_end[‘month’], $date_end[‘day’], $date_end[‘year’]);
$final = array();
$updates = Array();
$event_cur = new SchedulerDate($event, $updates, $this->date_start);
$event_cur->transpositor($this->date_start_ts);
$final_temp = $event_cur->date_generator($this->date_start_ts, $this->date_end_ts);
foreach ($final_temp as $v) {
$final[] = $v;
}
return $final;
}[/code]
The $event var is array from $action->get_data() in my beforeProcessing I check array of new events against all events from new event timerange in a loop also with checking some additional fields as user_id and res_id to prevent the same user from creating event at the same time, and/or the same resource.
Regards,
Grzesiek