Page MenuHomePhabricator

D16703.diff
No OneTemporary

D16703.diff

diff --git a/src/applications/calendar/controller/PhabricatorCalendarImportViewController.php b/src/applications/calendar/controller/PhabricatorCalendarImportViewController.php
--- a/src/applications/calendar/controller/PhabricatorCalendarImportViewController.php
+++ b/src/applications/calendar/controller/PhabricatorCalendarImportViewController.php
@@ -30,10 +30,13 @@
$curtain = $this->buildCurtain($import);
$details = $this->buildPropertySection($import);
+ $imported_events = $this->buildImportedEvents($import);
+
$view = id(new PHUITwoColumnView())
->setHeader($header)
->setMainColumn(
array(
+ $imported_events,
$timeline,
))
->setCurtain($curtain)
@@ -130,4 +133,46 @@
return $properties;
}
+
+ private function buildImportedEvents(
+ PhabricatorCalendarImport $import) {
+ $viewer = $this->getViewer();
+
+ $engine = id(new PhabricatorCalendarEventSearchEngine())
+ ->setViewer($viewer);
+
+ $saved = $engine->newSavedQuery()
+ ->setParameter('importSourcePHIDs', array($import->getPHID()));
+
+ $pager = $engine->newPagerForSavedQuery($saved);
+ $pager->setPageSize(25);
+
+ $query = $engine->buildQueryFromSavedQuery($saved);
+
+ $results = $engine->executeQuery($query, $pager);
+ $view = $engine->renderResults($results, $saved);
+ $list = $view->getObjectList();
+ $list->setNoDataString(pht('No imported events.'));
+
+ $all_uri = $this->getApplicationURI();
+ $all_uri = (string)id(new PhutilURI($all_uri))
+ ->setQueryParam('importSourcePHID', $import->getPHID())
+ ->setQueryParam('display', 'list');
+
+ $all_button = id(new PHUIButtonView())
+ ->setTag('a')
+ ->setText(pht('View All'))
+ ->setIcon('fa-search')
+ ->setHref($all_uri);
+
+ $header = id(new PHUIHeaderView())
+ ->setHeader(pht('Imported Events'))
+ ->addActionLink($all_button);
+
+ return id(new PHUIObjectBoxView())
+ ->setHeader($header)
+ ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
+ ->setObjectList($list);
+ }
+
}
diff --git a/src/applications/calendar/query/PhabricatorCalendarEventSearchEngine.php b/src/applications/calendar/query/PhabricatorCalendarEventSearchEngine.php
--- a/src/applications/calendar/query/PhabricatorCalendarEventSearchEngine.php
+++ b/src/applications/calendar/query/PhabricatorCalendarEventSearchEngine.php
@@ -51,6 +51,10 @@
->setKey('isCancelled')
->setOptions($this->getCancelledOptions())
->setDefault('active'),
+ id(new PhabricatorPHIDsSearchField())
+ ->setLabel(pht('Import Sources'))
+ ->setKey('importSourcePHIDs')
+ ->setAliases(array('importSourcePHID')),
id(new PhabricatorSearchSelectField())
->setLabel(pht('Display Options'))
->setKey('display')
@@ -114,6 +118,10 @@
break;
}
+ if ($map['importSourcePHIDs']) {
+ $query->withImportSourcePHIDs($map['importSourcePHIDs']);
+ }
+
// Generate ghosts (and ignore stub events) if we aren't querying for
// specific events or exporting.
if (!empty($map['export'])) {

File Metadata

Mime Type
text/plain
Expires
Fri, Dec 20, 11:08 PM (11 h, 49 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6912217
Default Alt Text
D16703.diff (3 KB)

Event Timeline