forked from Craffft/contao-calendar-ical-bundle
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove sorting from calendar import because it's quite useless and le…
…ads to errors on some ics files.
- Loading branch information
Showing
1 changed file
with
9 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -691,7 +691,7 @@ protected function importFromICSFile( | |
\Message::addError($e->getMessage()); | ||
$this->redirect(str_replace('&key=import', '', \Environment::get('request'))); | ||
} | ||
$tz = $this->cal->getProperty(Vcalendar::X_WR_TIMEZONE); | ||
$tz = $this->cal->getXprop(Vcalendar::X_WR_TIMEZONE); | ||
|
||
if ($timeshift == 0) { | ||
if (is_array($tz) && strlen($tz[1]) && strcmp($tz[1], $GLOBALS['TL_CONFIG']['timeZone']) != 0) { | ||
|
@@ -702,7 +702,7 @@ protected function importFromICSFile( | |
} else { | ||
if (!is_array($tz) || strlen($tz[1]) == 0) { | ||
if ($manualTZ === null) { | ||
return $this->getConfirmationForm($dc, $filename, $startDate->date, $endDate->date, $tz[1], | ||
return $this->getConfirmationForm($dc, $filename, $startDate->date, $endDate->date, null, | ||
$GLOBALS['TL_CONFIG']['timeZone'], $deleteCalendar); | ||
} | ||
} | ||
|
@@ -724,7 +724,9 @@ protected function importFromICS( | |
$deleteCalendar = false, | ||
$timeshift = 0 | ||
) { | ||
$this->cal->sort(); | ||
// $this->cal->sort() was previously in the code. This is quite useless because without arguments this methods | ||
// sorts by UID which doesn't give us any benefit. | ||
//$this->cal->sort(); | ||
$this->loadDataContainer('tl_calendar_events'); | ||
$fields = $this->Database->listFields('tl_calendar_events'); | ||
$fieldNames = array(); | ||
|
@@ -793,7 +795,7 @@ protected function importFromICS( | |
|
||
$title = $summary; | ||
if (!empty($this->patternEventTitle) && !empty($this->replacementEventTitle)) { | ||
$title = preg_replace($this->patternEventTitle, $this->replacementEventTitle, $title); | ||
$title = preg_replace($this->patternEventTitle, $this->replacementEventTitle, $summary); | ||
} | ||
|
||
// set values from vevent | ||
|
@@ -1005,6 +1007,8 @@ protected function importFromICS( | |
} | ||
$foundevents[$uid]++; | ||
|
||
$arrFields['description'] = $uid; | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
cgoIT
Author
Owner
|
||
|
||
if ($foundevents[$uid] <= 1) { | ||
if (array_key_exists('singleSRC', $arrFields) && $arrFields['singleSRC'] == "") { | ||
$arrFields['singleSRC'] = null; | ||
|
@@ -1117,6 +1121,7 @@ public function importCalendar(DataContainer $dc) { | |
$objUploader = new $class(); | ||
|
||
$this->loadLanguageFile("tl_calendar_events"); | ||
$this->loadLanguageFile("tl_files"); | ||
$this->Template = new BackendTemplate('be_import_calendar'); | ||
|
||
$class = $this->User->uploader; | ||
|
Hat diese Zeile einen besonderen Grund?