@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.

When viewing a Calendar import, show all the events it imported

Summary: Ref T10747. Show which events a source imported, and link to the full list as a query result.

Test Plan: {F1870049}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10747

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

+53
+45
src/applications/calendar/controller/PhabricatorCalendarImportViewController.php
··· 30 30 $curtain = $this->buildCurtain($import); 31 31 $details = $this->buildPropertySection($import); 32 32 33 + $imported_events = $this->buildImportedEvents($import); 34 + 33 35 $view = id(new PHUITwoColumnView()) 34 36 ->setHeader($header) 35 37 ->setMainColumn( 36 38 array( 39 + $imported_events, 37 40 $timeline, 38 41 )) 39 42 ->setCurtain($curtain) ··· 130 133 131 134 return $properties; 132 135 } 136 + 137 + private function buildImportedEvents( 138 + PhabricatorCalendarImport $import) { 139 + $viewer = $this->getViewer(); 140 + 141 + $engine = id(new PhabricatorCalendarEventSearchEngine()) 142 + ->setViewer($viewer); 143 + 144 + $saved = $engine->newSavedQuery() 145 + ->setParameter('importSourcePHIDs', array($import->getPHID())); 146 + 147 + $pager = $engine->newPagerForSavedQuery($saved); 148 + $pager->setPageSize(25); 149 + 150 + $query = $engine->buildQueryFromSavedQuery($saved); 151 + 152 + $results = $engine->executeQuery($query, $pager); 153 + $view = $engine->renderResults($results, $saved); 154 + $list = $view->getObjectList(); 155 + $list->setNoDataString(pht('No imported events.')); 156 + 157 + $all_uri = $this->getApplicationURI(); 158 + $all_uri = (string)id(new PhutilURI($all_uri)) 159 + ->setQueryParam('importSourcePHID', $import->getPHID()) 160 + ->setQueryParam('display', 'list'); 161 + 162 + $all_button = id(new PHUIButtonView()) 163 + ->setTag('a') 164 + ->setText(pht('View All')) 165 + ->setIcon('fa-search') 166 + ->setHref($all_uri); 167 + 168 + $header = id(new PHUIHeaderView()) 169 + ->setHeader(pht('Imported Events')) 170 + ->addActionLink($all_button); 171 + 172 + return id(new PHUIObjectBoxView()) 173 + ->setHeader($header) 174 + ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) 175 + ->setObjectList($list); 176 + } 177 + 133 178 }
+8
src/applications/calendar/query/PhabricatorCalendarEventSearchEngine.php
··· 51 51 ->setKey('isCancelled') 52 52 ->setOptions($this->getCancelledOptions()) 53 53 ->setDefault('active'), 54 + id(new PhabricatorPHIDsSearchField()) 55 + ->setLabel(pht('Import Sources')) 56 + ->setKey('importSourcePHIDs') 57 + ->setAliases(array('importSourcePHID')), 54 58 id(new PhabricatorSearchSelectField()) 55 59 ->setLabel(pht('Display Options')) 56 60 ->setKey('display') ··· 112 116 case 'cancelled': 113 117 $query->withIsCancelled(true); 114 118 break; 119 + } 120 + 121 + if ($map['importSourcePHIDs']) { 122 + $query->withImportSourcePHIDs($map['importSourcePHIDs']); 115 123 } 116 124 117 125 // Generate ghosts (and ignore stub events) if we aren't querying for