backport of rev28975, rev28976: read event start+end if not given by caller to avoid broken recurrences

This commit is contained in:
Klaus Leithoff 2010-02-04 12:52:54 +00:00
parent cc3c15d623
commit 19a83cf60a
2 changed files with 10 additions and 3 deletions

View File

@ -599,11 +599,18 @@ class calendar_bo
*/
function set_recurrences($event,$start=0)
{
if ($this->debug && ((int) $this->debug >= 2 || $this->debug == 'set_recurrences' || $this->debug == 'check_move_horizont'))
if ($this->debug && ((int) $this->debug >= 2 || $this->debug == 'set_recurrences' || $this->debug == 'check_move_horizont'))
{
$this->debug_message('bocal::set_recurrences(%1,%2)',true,$event,$start);
}
// check if the caller gave the participants and if not read them from the DB
// check if the caller gave the event start and end times and if not read them from the DB
if (!isset($event['start']) || !isset($event['end']))
{
$event_read=$this->read($event['id']);
$event['start'] = $event_read['start'];
$event['end'] = $event_read['end'];
}
// check if the caller gave the participants and if not read them from the DB
if (!isset($event['participants']))
{
list(,$event_read) = each($this->so->read($event['id']));

View File

@ -120,7 +120,7 @@ class calendar_so
* All times (start, end and modified) are returned as timesstamps in servertime!
*
* @param int|array|string $ids id or array of id's of the entries to read, or string with a single uid
* @param int $recur_date=0 if set read the next recurrance at or after the timestamp, default 0 = read the initital one
* @param int $recur_date=0 if set read the next recurrence at or after the timestamp, default 0 = read the initital one
* @return array|boolean array with id => data pairs or false if entry not found
*/
function read($ids,$recur_date=0)