@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Raise ICS warnings in Phabricator on ICS import

Summary: Ref T11816. Depends on D16800. Show warnings generated by ICS import in the UI.

Test Plan: {F1904122}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11816

Differential Revision: https://secure.phabricator.com/D16801

+50
+2
src/__phutil_library_map__.php
··· 2130 2130 'PhabricatorCalendarImportICSFileTransaction' => 'applications/calendar/xaction/PhabricatorCalendarImportICSFileTransaction.php', 2131 2131 'PhabricatorCalendarImportICSLogType' => 'applications/calendar/importlog/PhabricatorCalendarImportICSLogType.php', 2132 2132 'PhabricatorCalendarImportICSURITransaction' => 'applications/calendar/xaction/PhabricatorCalendarImportICSURITransaction.php', 2133 + 'PhabricatorCalendarImportICSWarningLogType' => 'applications/calendar/importlog/PhabricatorCalendarImportICSWarningLogType.php', 2133 2134 'PhabricatorCalendarImportIgnoredNodeLogType' => 'applications/calendar/importlog/PhabricatorCalendarImportIgnoredNodeLogType.php', 2134 2135 'PhabricatorCalendarImportListController' => 'applications/calendar/controller/PhabricatorCalendarImportListController.php', 2135 2136 'PhabricatorCalendarImportLog' => 'applications/calendar/storage/PhabricatorCalendarImportLog.php', ··· 6991 6992 'PhabricatorCalendarImportICSFileTransaction' => 'PhabricatorCalendarImportTransactionType', 6992 6993 'PhabricatorCalendarImportICSLogType' => 'PhabricatorCalendarImportLogType', 6993 6994 'PhabricatorCalendarImportICSURITransaction' => 'PhabricatorCalendarImportTransactionType', 6995 + 'PhabricatorCalendarImportICSWarningLogType' => 'PhabricatorCalendarImportLogType', 6994 6996 'PhabricatorCalendarImportIgnoredNodeLogType' => 'PhabricatorCalendarImportLogType', 6995 6997 'PhabricatorCalendarImportListController' => 'PhabricatorCalendarController', 6996 6998 'PhabricatorCalendarImportLog' => array(
+11
src/applications/calendar/import/PhabricatorCalendarICSImportEngine.php
··· 28 28 $document = null; 29 29 } 30 30 31 + foreach ($parser->getWarnings() as $warning) { 32 + $import->newLogMessage( 33 + PhabricatorCalendarImportICSWarningLogType::LOGTYPE, 34 + array( 35 + 'ics.warning.code' => $warning['code'], 36 + 'ics.warning.line' => $warning['line'], 37 + 'ics.warning.text' => $warning['text'], 38 + 'ics.warning.message' => $warning['message'], 39 + )); 40 + } 41 + 31 42 return $this->importEventDocument($viewer, $import, $document); 32 43 } 33 44
+37
src/applications/calendar/importlog/PhabricatorCalendarImportICSWarningLogType.php
··· 1 + <?php 2 + 3 + final class PhabricatorCalendarImportICSWarningLogType 4 + extends PhabricatorCalendarImportLogType { 5 + 6 + const LOGTYPE = 'ics.warning'; 7 + 8 + public function getDisplayType( 9 + PhabricatorUser $viewer, 10 + PhabricatorCalendarImportLog $log) { 11 + return pht('ICS Parser Warning'); 12 + } 13 + 14 + public function getDisplayDescription( 15 + PhabricatorUser $viewer, 16 + PhabricatorCalendarImportLog $log) { 17 + return pht( 18 + 'Warning ("%s") while parsing ICS data (near line %s): %s', 19 + $log->getParameter('ics.warning.code'), 20 + $log->getParameter('ics.warning.line'), 21 + $log->getParameter('ics.warning.message')); 22 + } 23 + 24 + 25 + public function getDisplayIcon( 26 + PhabricatorUser $viewer, 27 + PhabricatorCalendarImportLog $log) { 28 + return 'fa-exclamation-triangle'; 29 + } 30 + 31 + public function getDisplayColor( 32 + PhabricatorUser $viewer, 33 + PhabricatorCalendarImportLog $log) { 34 + return 'yellow'; 35 + } 36 + 37 + }