Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F95928568
NuanceQueueViewController.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
Fri, Dec 20, 18:41
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Dec 22, 18:41 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
23080262
Attached To
rPH Phabricator
NuanceQueueViewController.php
View Options
<?php
final
class
NuanceQueueViewController
extends
NuanceQueueController
{
public
function
handleRequest
(
AphrontRequest
$request
)
{
$viewer
=
$this
->
getViewer
();
$queue
=
id
(
new
NuanceQueueQuery
())
->
setViewer
(
$viewer
)
->
withIDs
(
array
(
$request
->
getURIData
(
'id'
)))
->
executeOne
();
if
(!
$queue
)
{
return
new
Aphront404Response
();
}
$title
=
$queue
->
getName
();
$crumbs
=
$this
->
buildApplicationCrumbs
();
$crumbs
->
addTextCrumb
(
pht
(
'Queues'
),
$this
->
getApplicationURI
(
'queue/'
));
$crumbs
->
addTextCrumb
(
$queue
->
getName
());
$crumbs
->
setBorder
(
true
);
$header
=
$this
->
buildHeaderView
(
$queue
);
$curtain
=
$this
->
buildCurtain
(
$queue
);
$timeline
=
$this
->
buildTransactionTimeline
(
$queue
,
new
NuanceQueueTransactionQuery
());
$timeline
->
setShouldTerminate
(
true
);
$view
=
id
(
new
PHUITwoColumnView
())
->
setHeader
(
$header
)
->
setCurtain
(
$curtain
)
->
setMainColumn
(
$timeline
);
return
$this
->
newPage
()
->
setTitle
(
$title
)
->
setCrumbs
(
$crumbs
)
->
appendChild
(
$view
);
}
private
function
buildHeaderView
(
NuanceQueue
$queue
)
{
$viewer
=
$this
->
getViewer
();
$header
=
id
(
new
PHUIHeaderView
())
->
setUser
(
$viewer
)
->
setHeader
(
$queue
->
getName
())
->
setPolicyObject
(
$queue
);
return
$header
;
}
private
function
buildCurtain
(
NuanceQueue
$queue
)
{
$viewer
=
$this
->
getViewer
();
$id
=
$queue
->
getID
();
$can_edit
=
PhabricatorPolicyFilter
::
hasCapability
(
$viewer
,
$queue
,
PhabricatorPolicyCapability
::
CAN_EDIT
);
$curtain
=
$this
->
newCurtainView
(
$queue
);
$curtain
->
addAction
(
id
(
new
PhabricatorActionView
())
->
setName
(
pht
(
'Edit Queue'
))
->
setIcon
(
'fa-pencil'
)
->
setHref
(
$this
->
getApplicationURI
(
"queue/edit/{$id}/"
))
->
setDisabled
(!
$can_edit
)
->
setWorkflow
(!
$can_edit
));
return
$curtain
;
}
}
Event Timeline
Log In to Comment