Fix 403s in Phrequent by rendering actions as forms, and make properties fancier

Summary:
Also cleans up some stuff like logged out users a bit. This provides a more subtle alternative to {D5485}.

(This is fairly rough, and the icons need to be sprited if we stick with this approach.)

Test Plan:
{F38047}
{F38048}

Reviewers: hach-que, btrahan

Reviewed By: hach-que

CC: aran, chad

Maniphest Tasks: T2857

Differential Revision: https://secure.phabricator.com/D5494
This commit is contained in:
epriestley
2013-03-30 19:37:13 -07:00
parent 33f2bf7c32
commit 1196675697
7 changed files with 114 additions and 13 deletions

View File

@@ -114,6 +114,17 @@ final class PhrequentUserTimeQuery extends PhabricatorOffsetPagedQuery {
return $count['N'] > 0;
}
public static function loadUserStack(PhabricatorUser $user) {
if (!$user->isLoggedIn()) {
return array();
}
return id(new PhrequentUserTime())->loadAllWhere(
'userPHID = %s AND dateEnded IS NULL
ORDER BY dateStarted DESC, id DESC',
$user->getPHID());
}
public static function getTotalTimeSpentOnObject($phid) {
$usertime_dao = new PhrequentUserTime();
$conn = $usertime_dao->establishConnection('r');