Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F444958
PhabricatorCalendarImportDeleteController.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
PhabricatorCalendarImportDeleteController.php
View Options
<?php
final
class
PhabricatorCalendarImportDeleteController
extends
PhabricatorCalendarController
{
public
function
handleRequest
(
AphrontRequest
$request
)
{
$viewer
=
$request
->
getViewer
();
$import
=
id
(
new
PhabricatorCalendarImportQuery
())
->
setViewer
(
$viewer
)
->
withIDs
(
array
(
$request
->
getURIData
(
'id'
)))
->
requireCapabilities
(
array
(
PhabricatorPolicyCapability
::
CAN_VIEW
,
PhabricatorPolicyCapability
::
CAN_EDIT
,
))
->
executeOne
();
if
(!
$import
)
{
return
new
Aphront404Response
();
}
$import_uri
=
$import
->
getURI
();
$engine
=
$import
->
getEngine
();
if
(!
$engine
->
canDeleteAnyEvents
(
$viewer
,
$import
))
{
return
$this
->
newDialog
()
->
setTitle
(
pht
(
'No Imported Events'
))
->
appendParagraph
(
pht
(
'No events from this source currently exist. They may have '
.
'failed to import, have been updated by another source, or '
.
'already have been deleted.'
))
->
addCancelButton
(
$import_uri
,
pht
(
'Done'
));
}
if
(
$request
->
isFormPost
())
{
$xactions
=
array
();
$xactions
[]
=
id
(
new
PhabricatorCalendarImportTransaction
())
->
setTransactionType
(
PhabricatorCalendarImportDeleteTransaction
::
TRANSACTIONTYPE
)
->
setNewValue
(
true
);
$editor
=
id
(
new
PhabricatorCalendarImportEditor
())
->
setActor
(
$viewer
)
->
setContinueOnNoEffect
(
true
)
->
setContinueOnMissingFields
(
true
)
->
setContentSourceFromRequest
(
$request
);
$editor
->
applyTransactions
(
$import
,
$xactions
);
return
id
(
new
AphrontRedirectResponse
())->
setURI
(
$import_uri
);
}
return
$this
->
newDialog
()
->
setTitle
(
pht
(
'Delete Imported Events'
))
->
appendParagraph
(
pht
(
'Delete all the events that were imported from this source? '
.
'This action can not be undone.'
))
->
addCancelButton
(
$import_uri
)
->
addSubmitButton
(
pht
(
'Delete Events'
));
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, May 4, 12:57 PM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
65458
Default Alt Text
PhabricatorCalendarImportDeleteController.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment