Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93192377
PhabricatorCalendarEventDeleteController.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
Tue, Nov 26, 22:07
Size
1 KB
Mime Type
text/x-php
Expires
Thu, Nov 28, 22:07 (2 d)
Engine
blob
Format
Raw Data
Handle
22593015
Attached To
rPH Phabricator
PhabricatorCalendarEventDeleteController.php
View Options
<?php
final
class
PhabricatorCalendarEventDeleteController
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
PhabricatorCalendarEventQuery
())
->
setViewer
(
$user
)
->
withIDs
(
array
(
$this
->
id
))
->
requireCapabilities
(
array
(
PhabricatorPolicyCapability
::
CAN_VIEW
,
PhabricatorPolicyCapability
::
CAN_EDIT
,
))
->
executeOne
();
if
(!
$status
)
{
return
new
Aphront404Response
();
}
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
(
pht
(
'Permanently delete this status? This action can not be undone.'
));
$dialog
->
addSubmitButton
(
pht
(
'Delete'
));
$dialog
->
addCancelButton
(
$this
->
getApplicationURI
(
'event/'
));
return
id
(
new
AphrontDialogResponse
())->
setDialog
(
$dialog
);
}
}
Event Timeline
Log In to Comment