Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F452425
ManiphestSavedQueryDeleteController.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
ManiphestSavedQueryDeleteController.php
View Options
<?php
/**
* @group maniphest
*/
final
class
ManiphestSavedQueryDeleteController
extends
ManiphestController
{
private
$id
;
public
function
willProcessRequest
(
array
$data
)
{
$this
->
id
=
$data
[
'id'
];
}
public
function
processRequest
()
{
$request
=
$this
->
getRequest
();
$user
=
$request
->
getUser
();
$id
=
$this
->
id
;
$query
=
id
(
new
ManiphestSavedQuery
())->
load
(
$id
);
if
(!
$query
)
{
return
new
Aphront404Response
();
}
if
(
$query
->
getUserPHID
()
!=
$user
->
getPHID
())
{
return
new
Aphront400Response
();
}
if
(
$request
->
isDialogFormPost
())
{
$query
->
delete
();
return
id
(
new
AphrontRedirectResponse
())->
setURI
(
'/maniphest/custom/'
);
}
$name
=
$query
->
getName
();
$dialog
=
id
(
new
AphrontDialogView
())
->
setUser
(
$user
)
->
setTitle
(
'Really delete this query?'
)
->
appendChild
(
hsprintf
(
'<p>Really delete the query "%s"? It will be lost forever!</p>'
,
$name
))
->
addCancelButton
(
'/maniphest/custom/'
)
->
addSubmitButton
(
'Delete'
);
return
id
(
new
AphrontDialogResponse
())->
setDialog
(
$dialog
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, May 5, 12:30 AM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
68782
Default Alt Text
ManiphestSavedQueryDeleteController.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment