Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F97423778
ReleephRequestViewController.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
Sat, Jan 4, 09:44
Size
2 KB
Mime Type
text/x-php
Expires
Mon, Jan 6, 09:44 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
23405621
Attached To
rPH Phabricator
ReleephRequestViewController.php
View Options
<?php
final
class
ReleephRequestViewController
extends
ReleephBranchController
{
public
function
handleRequest
(
AphrontRequest
$request
)
{
$id
=
$request
->
getURIData
(
'requestID'
);
$viewer
=
$request
->
getViewer
();
$pull
=
id
(
new
ReleephRequestQuery
())
->
setViewer
(
$viewer
)
->
withIDs
(
array
(
$id
))
->
executeOne
();
if
(!
$pull
)
{
return
new
Aphront404Response
();
}
$this
->
setBranch
(
$pull
->
getBranch
());
// Redirect older URIs to new "Y" URIs.
// TODO: Get rid of this eventually.
$actual_path
=
$request
->
getRequestURI
()->
getPath
();
$expect_path
=
'/'
.
$pull
->
getMonogram
();
if
(
$actual_path
!=
$expect_path
)
{
return
id
(
new
AphrontRedirectResponse
())->
setURI
(
$expect_path
);
}
// TODO: Break this 1:1 stuff?
$branch
=
$pull
->
getBranch
();
$field_list
=
PhabricatorCustomField
::
getObjectFields
(
$pull
,
PhabricatorCustomField
::
ROLE_VIEW
);
$field_list
->
setViewer
(
$viewer
)
->
readFieldsFromStorage
(
$pull
);
// TODO: This should be more modern and general.
$engine
=
id
(
new
PhabricatorMarkupEngine
())
->
setViewer
(
$viewer
);
foreach
(
$field_list
->
getFields
()
as
$field
)
{
if
(
$field
->
shouldMarkup
())
{
$field
->
setMarkupEngine
(
$engine
);
}
}
$engine
->
process
();
$pull_box
=
id
(
new
ReleephRequestView
())
->
setUser
(
$viewer
)
->
setCustomFields
(
$field_list
)
->
setPullRequest
(
$pull
);
$timeline
=
$this
->
buildTransactionTimeline
(
$pull
,
new
ReleephRequestTransactionQuery
());
$add_comment_header
=
pht
(
'Plea or Yield'
);
$draft
=
PhabricatorDraft
::
newFromUserAndKey
(
$viewer
,
$pull
->
getPHID
());
$title
=
hsprintf
(
'%s %s'
,
$pull
->
getMonogram
(),
$pull
->
getSummaryForDisplay
());
$add_comment_form
=
id
(
new
PhabricatorApplicationTransactionCommentView
())
->
setUser
(
$viewer
)
->
setObjectPHID
(
$pull
->
getPHID
())
->
setDraft
(
$draft
)
->
setHeaderText
(
$add_comment_header
)
->
setAction
(
$this
->
getApplicationURI
(
'/request/comment/'
.
$pull
->
getID
().
'/'
))
->
setSubmitButtonName
(
pht
(
'Comment'
));
$crumbs
=
$this
->
buildApplicationCrumbs
();
$crumbs
->
addTextCrumb
(
$pull
->
getMonogram
(),
'/'
.
$pull
->
getMonogram
());
return
$this
->
buildStandardPageResponse
(
array
(
$crumbs
,
$pull_box
,
$timeline
,
$add_comment_form
,
),
array
(
'title'
=>
$title
,
));
}
}
Event Timeline
Log In to Comment