Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F101384507
ReleephRequestStatusView.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, Feb 9, 22:35
Size
1 KB
Mime Type
text/x-php
Expires
Tue, Feb 11, 22:35 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
24149211
Attached To
rPH Phabricator
ReleephRequestStatusView.php
View Options
<?php
final
class
ReleephRequestStatusView
extends
AphrontView
{
private
$releephRequest
;
public
function
setReleephRequest
(
ReleephRequest
$rq
)
{
$this
->
releephRequest
=
$rq
;
return
$this
;
}
public
function
render
()
{
require_celerity_resource
(
'releeph-status'
);
$request
=
$this
->
releephRequest
;
$status
=
$request
->
getStatus
();
$pick_status
=
$request
->
getPickStatus
();
$description
=
ReleephRequestStatus
::
getStatusDescriptionFor
(
$status
);
$warning
=
null
;
if
(
$status
==
ReleephRequestStatus
::
STATUS_NEEDS_PICK
)
{
if
(
$pick_status
==
ReleephRequest
::
PICK_FAILED
)
{
$warning
=
'Last pick failed!'
;
}
}
elseif
(
$status
==
ReleephRequestStatus
::
STATUS_NEEDS_REVERT
)
{
if
(
$pick_status
==
ReleephRequest
::
REVERT_FAILED
)
{
$warning
=
'Last revert failed!'
;
}
}
return
phutil_tag
(
'div'
,
array
(
'class'
=>
'releeph-status'
,
),
array
(
phutil_tag
(
'div'
,
array
(
'class'
=>
'description'
,
),
$description
),
phutil_tag
(
'div'
,
array
(
'class'
=>
'warning'
,
),
$warning
)));
}
}
Event Timeline
Log In to Comment