Page MenuHomePhabricator

D16801.diff
No OneTemporary

D16801.diff

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 @@
+<?php
+
+final class PhabricatorCalendarImportICSWarningLogType
+ extends PhabricatorCalendarImportLogType {
+
+ const LOGTYPE = 'ics.warning';
+
+ public function getDisplayType(
+ PhabricatorUser $viewer,
+ PhabricatorCalendarImportLog $log) {
+ return pht('ICS Parser Warning');
+ }
+
+ public function getDisplayDescription(
+ PhabricatorUser $viewer,
+ PhabricatorCalendarImportLog $log) {
+ return pht(
+ 'Warning ("%s") while parsing ICS data (near line %s): %s',
+ $log->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';
+ }
+
+}

File Metadata

Mime Type
text/plain
Expires
Oct 19 2024, 1:29 AM (4 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6729636
Default Alt Text
D16801.diff (3 KB)

Event Timeline