Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F538246
PhabricatorApplicationTransactionCommentRawController.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
PhabricatorApplicationTransactionCommentRawController.php
View Options
<?php
final
class
PhabricatorApplicationTransactionCommentRawController
extends
PhabricatorApplicationTransactionController
{
public
function
handleRequest
(
AphrontRequest
$request
)
{
$viewer
=
$this
->
getViewer
();
$phid
=
$request
->
getURIData
(
'phid'
);
$xaction
=
id
(
new
PhabricatorObjectQuery
())
->
withPHIDs
(
array
(
$phid
))
->
setViewer
(
$viewer
)
->
executeOne
();
if
(!
$xaction
)
{
return
new
Aphront404Response
();
}
if
(!
$xaction
->
getComment
())
{
// You can't view a raw comment if there is no comment.
return
new
Aphront404Response
();
}
if
(
$xaction
->
getComment
()->
getIsRemoved
())
{
// You can't view a raw comment if the comment is deleted.
return
new
Aphront400Response
();
}
$obj_phid
=
$xaction
->
getObjectPHID
();
$obj_handle
=
id
(
new
PhabricatorHandleQuery
())
->
setViewer
(
$viewer
)
->
withPHIDs
(
array
(
$obj_phid
))
->
executeOne
();
$title
=
pht
(
'Raw Comment'
);
$body
=
$xaction
->
getComment
()->
getContent
();
$addendum
=
null
;
if
(
$request
->
getExists
(
'email'
))
{
$content_source
=
$xaction
->
getContentSource
();
$source_email
=
PhabricatorEmailContentSource
::
SOURCECONST
;
if
(
$content_source
->
getSource
()
==
$source_email
)
{
$source_id
=
$content_source
->
getContentSourceParameter
(
'id'
);
if
(
$source_id
)
{
$message
=
id
(
new
PhabricatorMetaMTAReceivedMail
())->
loadOneWhere
(
'id = %d'
,
$source_id
);
if
(
$message
)
{
$title
=
pht
(
'Email Body Text'
);
$body
=
$message
->
getRawTextBody
();
$details_text
=
pht
(
'For full details, run `/bin/mail show-inbound --id %d`'
,
$source_id
);
$addendum
=
new
PHUIRemarkupView
(
$viewer
,
$details_text
);
}
}
}
}
$dialog
=
id
(
new
AphrontDialogView
())
->
setUser
(
$viewer
)
->
addCancelButton
(
$obj_handle
->
getURI
())
->
setTitle
(
$title
);
$dialog
->
addHiddenInput
(
'anchor'
,
$request
->
getStr
(
'anchor'
))
->
appendChild
(
id
(
new
PHUIFormLayoutView
())
->
setFullWidth
(
true
)
->
appendChild
(
id
(
new
AphrontFormTextAreaControl
())
->
setReadOnly
(
true
)
->
setValue
(
$body
)));
if
(
$addendum
)
{
$dialog
->
appendParagraph
(
$addendum
);
}
return
id
(
new
AphrontDialogResponse
())->
setDialog
(
$dialog
);
}
public
function
shouldAllowPublic
()
{
return
true
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, May 12, 8:39 AM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
119940
Default Alt Text
PhabricatorApplicationTransactionCommentRawController.php (2 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment