2014-04-28 02:32:09 +02:00
|
|
|
<?php
|
|
|
|
|
2015-01-02 05:20:08 +01:00
|
|
|
final class PhabricatorActivitySettingsPanel extends PhabricatorSettingsPanel {
|
2014-04-28 02:32:09 +02:00
|
|
|
|
|
|
|
public function getPanelKey() {
|
|
|
|
return 'activity';
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getPanelName() {
|
|
|
|
return pht('Activity Logs');
|
|
|
|
}
|
|
|
|
|
2019-01-21 19:31:23 +01:00
|
|
|
public function getPanelMenuIcon() {
|
|
|
|
return 'fa-list';
|
|
|
|
}
|
|
|
|
|
2016-06-03 14:31:33 +02:00
|
|
|
public function getPanelGroupKey() {
|
|
|
|
return PhabricatorSettingsLogsPanelGroup::PANELGROUPKEY;
|
2014-04-28 02:32:09 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public function processRequest(AphrontRequest $request) {
|
|
|
|
$viewer = $request->getUser();
|
|
|
|
$user = $this->getUser();
|
|
|
|
|
2014-05-16 04:17:02 +02:00
|
|
|
$pager = id(new AphrontCursorPagerView())
|
|
|
|
->readFromRequest($request);
|
|
|
|
|
2014-04-28 02:32:09 +02:00
|
|
|
$logs = id(new PhabricatorPeopleLogQuery())
|
|
|
|
->setViewer($viewer)
|
|
|
|
->withRelatedPHIDs(array($user->getPHID()))
|
2014-05-16 04:17:02 +02:00
|
|
|
->executeWithCursorPager($pager);
|
2014-04-28 02:32:09 +02:00
|
|
|
|
|
|
|
$table = id(new PhabricatorUserLogView())
|
|
|
|
->setUser($viewer)
|
2018-01-30 15:09:35 +01:00
|
|
|
->setLogs($logs);
|
2014-04-28 02:32:09 +02:00
|
|
|
|
2017-09-06 04:30:52 +02:00
|
|
|
$panel = $this->newBox(pht('Account Activity Logs'), $table);
|
2014-04-28 02:32:09 +02:00
|
|
|
|
2014-05-16 04:17:02 +02:00
|
|
|
$pager_box = id(new PHUIBoxView())
|
|
|
|
->addMargin(PHUI::MARGIN_LARGE)
|
|
|
|
->appendChild($pager);
|
|
|
|
|
|
|
|
return array($panel, $pager_box);
|
2014-04-28 02:32:09 +02:00
|
|
|
}
|
|
|
|
|
2016-06-05 21:38:04 +02:00
|
|
|
public function isManagementPanel() {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2014-04-28 02:32:09 +02:00
|
|
|
}
|