diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -2130,6 +2130,7 @@ 'PhabricatorCalendarImportICSFileTransaction' => 'applications/calendar/xaction/PhabricatorCalendarImportICSFileTransaction.php', 'PhabricatorCalendarImportICSLogType' => 'applications/calendar/importlog/PhabricatorCalendarImportICSLogType.php', 'PhabricatorCalendarImportICSURITransaction' => 'applications/calendar/xaction/PhabricatorCalendarImportICSURITransaction.php', + 'PhabricatorCalendarImportICSWarningLogType' => 'applications/calendar/importlog/PhabricatorCalendarImportICSWarningLogType.php', 'PhabricatorCalendarImportIgnoredNodeLogType' => 'applications/calendar/importlog/PhabricatorCalendarImportIgnoredNodeLogType.php', 'PhabricatorCalendarImportListController' => 'applications/calendar/controller/PhabricatorCalendarImportListController.php', 'PhabricatorCalendarImportLog' => 'applications/calendar/storage/PhabricatorCalendarImportLog.php', @@ -6991,6 +6992,7 @@ 'PhabricatorCalendarImportICSFileTransaction' => 'PhabricatorCalendarImportTransactionType', 'PhabricatorCalendarImportICSLogType' => 'PhabricatorCalendarImportLogType', 'PhabricatorCalendarImportICSURITransaction' => 'PhabricatorCalendarImportTransactionType', + 'PhabricatorCalendarImportICSWarningLogType' => 'PhabricatorCalendarImportLogType', 'PhabricatorCalendarImportIgnoredNodeLogType' => 'PhabricatorCalendarImportLogType', 'PhabricatorCalendarImportListController' => 'PhabricatorCalendarController', 'PhabricatorCalendarImportLog' => array( diff --git a/src/applications/calendar/import/PhabricatorCalendarICSImportEngine.php b/src/applications/calendar/import/PhabricatorCalendarICSImportEngine.php --- a/src/applications/calendar/import/PhabricatorCalendarICSImportEngine.php +++ b/src/applications/calendar/import/PhabricatorCalendarICSImportEngine.php @@ -28,6 +28,17 @@ $document = null; } + foreach ($parser->getWarnings() as $warning) { + $import->newLogMessage( + PhabricatorCalendarImportICSWarningLogType::LOGTYPE, + array( + 'ics.warning.code' => $warning['code'], + 'ics.warning.line' => $warning['line'], + 'ics.warning.text' => $warning['text'], + 'ics.warning.message' => $warning['message'], + )); + } + return $this->importEventDocument($viewer, $import, $document); } diff --git a/src/applications/calendar/importlog/PhabricatorCalendarImportICSWarningLogType.php b/src/applications/calendar/importlog/PhabricatorCalendarImportICSWarningLogType.php new file mode 100644 --- /dev/null +++ b/src/applications/calendar/importlog/PhabricatorCalendarImportICSWarningLogType.php @@ -0,0 +1,37 @@ +getParameter('ics.warning.code'), + $log->getParameter('ics.warning.line'), + $log->getParameter('ics.warning.message')); + } + + + public function getDisplayIcon( + PhabricatorUser $viewer, + PhabricatorCalendarImportLog $log) { + return 'fa-exclamation-triangle'; + } + + public function getDisplayColor( + PhabricatorUser $viewer, + PhabricatorCalendarImportLog $log) { + return 'yellow'; + } + +}