Summary: This commit doesn't change license of any file. It just makes the license implicit (inherited from LICENSE file in the root directory). We are removing the headers for these reasons: - It wastes space in editors, less code is visible in editor upon opening a file. - It brings noise to diff of the first change of any file every year. - It confuses Git file copy detection when creating small files. - We don't have an explicit license header in other files (JS, CSS, images, documentation). - Using license header in every file is not obligatory: http://www.apache.org/dev/apply-license.html#new. This change is approved by Alma Chao (Lead Open Source and IP Counsel at Facebook). Test Plan: Verified that the license survived only in LICENSE file and that it didn't modify externals. Reviewers: epriestley, davidrecordon Reviewed By: epriestley CC: aran, Korvin Maniphest Tasks: T2035 Differential Revision: https://secure.phabricator.com/D3886
96 lines
2.3 KiB
PHP
96 lines
2.3 KiB
PHP
<?php
|
|
|
|
final class PhabricatorCountdownListController
|
|
extends PhabricatorCountdownController {
|
|
|
|
public function processRequest() {
|
|
|
|
$request = $this->getRequest();
|
|
$user = $request->getUser();
|
|
|
|
$pager = new AphrontPagerView();
|
|
$pager->setOffset($request->getInt('page'));
|
|
$pager->setURI($request->getRequestURI(), 'page');
|
|
|
|
$timers = id(new PhabricatorTimer())->loadAllWhere(
|
|
'1 = 1 ORDER BY id DESC LIMIT %d, %d',
|
|
$pager->getOffset(),
|
|
$pager->getPageSize() + 1);
|
|
|
|
$timers = $pager->sliceResults($timers);
|
|
|
|
$phids = mpull($timers, 'getAuthorPHID');
|
|
$handles = $this->loadViewerHandles($phids);
|
|
|
|
$rows = array();
|
|
foreach ($timers as $timer) {
|
|
$edit_button = null;
|
|
$delete_button = null;
|
|
if ($user->getIsAdmin() ||
|
|
($user->getPHID() == $timer->getAuthorPHID())) {
|
|
$edit_button = phutil_render_tag(
|
|
'a',
|
|
array(
|
|
'class' => 'small button grey',
|
|
'href' => '/countdown/edit/'.$timer->getID().'/'
|
|
),
|
|
'Edit');
|
|
|
|
$delete_button = javelin_render_tag(
|
|
'a',
|
|
array(
|
|
'class' => 'small button grey',
|
|
'href' => '/countdown/delete/'.$timer->getID().'/',
|
|
'sigil' => 'workflow'
|
|
),
|
|
'Delete');
|
|
}
|
|
$rows[] = array(
|
|
phutil_escape_html($timer->getID()),
|
|
$handles[$timer->getAuthorPHID()]->renderLink(),
|
|
phutil_render_tag(
|
|
'a',
|
|
array(
|
|
'href' => '/countdown/'.$timer->getID().'/',
|
|
),
|
|
phutil_escape_html($timer->getTitle())),
|
|
phabricator_datetime($timer->getDatepoint(), $user),
|
|
$edit_button,
|
|
$delete_button,
|
|
);
|
|
}
|
|
|
|
$table = new AphrontTableView($rows);
|
|
$table->setHeaders(
|
|
array(
|
|
'ID',
|
|
'Author',
|
|
'Title',
|
|
'End Date',
|
|
'',
|
|
''
|
|
));
|
|
|
|
$table->setColumnClasses(
|
|
array(
|
|
null,
|
|
null,
|
|
'wide pri',
|
|
null,
|
|
'action',
|
|
'action',
|
|
));
|
|
|
|
$panel = id(new AphrontPanelView())
|
|
->appendChild($table)
|
|
->setHeader('Timers')
|
|
->setCreateButton('Create Timer', '/countdown/edit/')
|
|
->appendChild($pager);
|
|
|
|
return $this->buildStandardPageResponse($panel,
|
|
array(
|
|
'title' => 'Countdown',
|
|
));
|
|
}
|
|
}
|