Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F100745455
PhabricatorCalendarDeleteStatusController.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 2, 09:53
Size
1 KB
Mime Type
text/x-php
Expires
Tue, Feb 4, 09:53 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
24023064
Attached To
rPH Phabricator
PhabricatorCalendarDeleteStatusController.php
View Options
<?php
final
class
PhabricatorCalendarDeleteStatusController
extends
PhabricatorCalendarController
{
private
$id
;
public
function
willProcessRequest
(
array
$data
)
{
$this
->
id
=
idx
(
$data
,
'id'
);
}
public
function
processRequest
()
{
$request
=
$this
->
getRequest
();
$user
=
$request
->
getUser
();
$status
=
id
(
new
PhabricatorCalendarEvent
())
->
loadOneWhere
(
'id = %d'
,
$this
->
id
);
if
(!
$status
)
{
return
new
Aphront404Response
();
}
if
(
$status
->
getUserPHID
()
!=
$user
->
getPHID
())
{
return
new
Aphront403Response
();
}
if
(
$request
->
isFormPost
())
{
$status
->
delete
();
$uri
=
new
PhutilURI
(
$this
->
getApplicationURI
());
$uri
->
setQueryParams
(
array
(
'deleted'
=>
true
,
));
return
id
(
new
AphrontRedirectResponse
())
->
setURI
(
$uri
);
}
$dialog
=
new
AphrontDialogView
();
$dialog
->
setUser
(
$user
);
$dialog
->
setTitle
(
pht
(
'Really delete status?'
));
$dialog
->
appendChild
(
phutil_tag
(
'p'
,
array
(),
pht
(
'Permanently delete this status? This action can not be undone.'
)));
$dialog
->
addSubmitButton
(
pht
(
'Delete'
));
$dialog
->
addCancelButton
(
$this
->
getApplicationURI
(
'status/edit/'
.
$status
->
getID
().
'/'
));
return
id
(
new
AphrontDialogResponse
())->
setDialog
(
$dialog
);
}
}
Event Timeline
Log In to Comment