Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F97587708
PhabricatorPeopleProfileTasksController.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, Jan 5, 12:25
Size
2 KB
Mime Type
text/x-php
Expires
Tue, Jan 7, 12:25 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
23356058
Attached To
rPH Phabricator
PhabricatorPeopleProfileTasksController.php
View Options
<?php
final
class
PhabricatorPeopleProfileTasksController
extends
PhabricatorPeopleProfileController
{
public
function
handleRequest
(
AphrontRequest
$request
)
{
$viewer
=
$this
->
getViewer
();
$id
=
$request
->
getURIData
(
'id'
);
$user
=
id
(
new
PhabricatorPeopleQuery
())
->
setViewer
(
$viewer
)
->
withIDs
(
array
(
$id
))
->
needProfile
(
true
)
->
needProfileImage
(
true
)
->
needAvailability
(
true
)
->
requireCapabilities
(
array
(
PhabricatorPolicyCapability
::
CAN_VIEW
,
))
->
executeOne
();
if
(!
$user
)
{
return
new
Aphront404Response
();
}
$class
=
'PhabricatorManiphestApplication'
;
if
(!
PhabricatorApplication
::
isClassInstalledForViewer
(
$class
,
$viewer
))
{
return
new
Aphront404Response
();
}
$this
->
setUser
(
$user
);
$title
=
array
(
pht
(
'Assigned Tasks'
),
$user
->
getUsername
());
$header
=
$this
->
buildProfileHeader
();
$tasks
=
$this
->
buildTasksView
(
$user
);
$crumbs
=
$this
->
buildApplicationCrumbs
();
$crumbs
->
addTextCrumb
(
pht
(
'Assigned Tasks'
));
$crumbs
->
setBorder
(
true
);
$nav
=
$this
->
getProfileMenu
();
$nav
->
selectFilter
(
PhabricatorPeopleProfileMenuEngine
::
ITEM_TASKS
);
$view
=
id
(
new
PHUITwoColumnView
())
->
setHeader
(
$header
)
->
addClass
(
'project-view-home'
)
->
addClass
(
'project-view-people-home'
)
->
setFooter
(
array
(
$tasks
,
));
return
$this
->
newPage
()
->
setTitle
(
$title
)
->
setCrumbs
(
$crumbs
)
->
setNavigation
(
$nav
)
->
appendChild
(
$view
);
}
private
function
buildTasksView
(
PhabricatorUser
$user
)
{
$viewer
=
$this
->
getViewer
();
$open
=
ManiphestTaskStatus
::
getOpenStatusConstants
();
$tasks
=
id
(
new
ManiphestTaskQuery
())
->
setViewer
(
$viewer
)
->
withOwners
(
array
(
$user
->
getPHID
()))
->
withStatuses
(
$open
)
->
needProjectPHIDs
(
true
)
->
setLimit
(
100
)
->
execute
();
$handles
=
ManiphestTaskListView
::
loadTaskHandles
(
$viewer
,
$tasks
);
$list
=
id
(
new
ManiphestTaskListView
())
->
setUser
(
$viewer
)
->
setHandles
(
$handles
)
->
setTasks
(
$tasks
)
->
setNoDataString
(
pht
(
'No open, assigned tasks.'
));
$view
=
id
(
new
PHUIObjectBoxView
())
->
setHeaderText
(
pht
(
'Assigned Tasks'
))
->
setBackground
(
PHUIObjectBoxView
::
BLUE_PROPERTY
)
->
appendChild
(
$list
);
return
$view
;
}
}
Event Timeline
Log In to Comment