Page MenuHomePhabricator

D17659.id42474.diff
No OneTemporary

D17659.id42474.diff

diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -2408,7 +2408,6 @@
'PhabricatorCountdownDAO' => 'applications/countdown/storage/PhabricatorCountdownDAO.php',
'PhabricatorCountdownDefaultEditCapability' => 'applications/countdown/capability/PhabricatorCountdownDefaultEditCapability.php',
'PhabricatorCountdownDefaultViewCapability' => 'applications/countdown/capability/PhabricatorCountdownDefaultViewCapability.php',
- 'PhabricatorCountdownDeleteController' => 'applications/countdown/controller/PhabricatorCountdownDeleteController.php',
'PhabricatorCountdownEditController' => 'applications/countdown/controller/PhabricatorCountdownEditController.php',
'PhabricatorCountdownEditEngine' => 'applications/countdown/editor/PhabricatorCountdownEditEngine.php',
'PhabricatorCountdownEditor' => 'applications/countdown/editor/PhabricatorCountdownEditor.php',
@@ -7492,6 +7491,7 @@
'PhabricatorTokenReceiverInterface',
'PhabricatorSpacesInterface',
'PhabricatorProjectInterface',
+ 'PhabricatorDestructibleInterface',
),
'PhabricatorCountdownApplication' => 'PhabricatorApplication',
'PhabricatorCountdownController' => 'PhabricatorController',
@@ -7499,7 +7499,6 @@
'PhabricatorCountdownDAO' => 'PhabricatorLiskDAO',
'PhabricatorCountdownDefaultEditCapability' => 'PhabricatorPolicyCapability',
'PhabricatorCountdownDefaultViewCapability' => 'PhabricatorPolicyCapability',
- 'PhabricatorCountdownDeleteController' => 'PhabricatorCountdownController',
'PhabricatorCountdownEditController' => 'PhabricatorCountdownController',
'PhabricatorCountdownEditEngine' => 'PhabricatorEditEngine',
'PhabricatorCountdownEditor' => 'PhabricatorApplicationTransactionEditor',
diff --git a/src/applications/countdown/application/PhabricatorCountdownApplication.php b/src/applications/countdown/application/PhabricatorCountdownApplication.php
--- a/src/applications/countdown/application/PhabricatorCountdownApplication.php
+++ b/src/applications/countdown/application/PhabricatorCountdownApplication.php
@@ -48,8 +48,6 @@
=> 'PhabricatorCountdownCommentController',
$this->getEditRoutePattern('edit/')
=> 'PhabricatorCountdownEditController',
- 'delete/(?P<id>[1-9]\d*)/'
- => 'PhabricatorCountdownDeleteController',
),
);
}
diff --git a/src/applications/countdown/controller/PhabricatorCountdownController.php b/src/applications/countdown/controller/PhabricatorCountdownController.php
--- a/src/applications/countdown/controller/PhabricatorCountdownController.php
+++ b/src/applications/countdown/controller/PhabricatorCountdownController.php
@@ -6,6 +6,4 @@
return $this->newApplicationMenu()
->setSearchEngine(new PhabricatorCountdownSearchEngine());
}
-
-
}
diff --git a/src/applications/countdown/controller/PhabricatorCountdownDeleteController.php b/src/applications/countdown/controller/PhabricatorCountdownDeleteController.php
deleted file mode 100644
--- a/src/applications/countdown/controller/PhabricatorCountdownDeleteController.php
+++ /dev/null
@@ -1,45 +0,0 @@
-<?php
-
-final class PhabricatorCountdownDeleteController
- extends PhabricatorCountdownController {
-
- public function handleRequest(AphrontRequest $request) {
- $viewer = $request->getViewer();
- $id = $request->getURIData('id');
-
- $countdown = id(new PhabricatorCountdownQuery())
- ->setViewer($viewer)
- ->withIDs(array($id))
- ->requireCapabilities(
- array(
- PhabricatorPolicyCapability::CAN_VIEW,
- PhabricatorPolicyCapability::CAN_EDIT,
- ))
- ->executeOne();
-
- if (!$countdown) {
- return new Aphront404Response();
- }
-
- if ($request->isFormPost()) {
- $countdown->delete();
- return id(new AphrontRedirectResponse())
- ->setURI('/countdown/');
- }
-
- $inst = pht(
- 'Are you sure you want to delete the countdown %s?',
- $countdown->getTitle());
-
- $dialog = new AphrontDialogView();
- $dialog->setUser($request->getUser());
- $dialog->setTitle(pht('Really delete this countdown?'));
- $dialog->appendChild(phutil_tag('p', array(), $inst));
- $dialog->addSubmitButton(pht('Delete'));
- $dialog->addCancelButton('/countdown/');
- $dialog->setSubmitURI($request->getPath());
-
- return id(new AphrontDialogResponse())->setDialog($dialog);
- }
-
-}
diff --git a/src/applications/countdown/controller/PhabricatorCountdownViewController.php b/src/applications/countdown/controller/PhabricatorCountdownViewController.php
--- a/src/applications/countdown/controller/PhabricatorCountdownViewController.php
+++ b/src/applications/countdown/controller/PhabricatorCountdownViewController.php
@@ -102,14 +102,6 @@
->setDisabled(!$can_edit)
->setWorkflow(!$can_edit));
- $curtain->addAction(
- id(new PhabricatorActionView())
- ->setIcon('fa-times')
- ->setName(pht('Delete Countdown'))
- ->setHref($this->getApplicationURI("delete/{$id}/"))
- ->setDisabled(!$can_edit)
- ->setWorkflow(true));
-
return $curtain;
}
diff --git a/src/applications/countdown/storage/PhabricatorCountdown.php b/src/applications/countdown/storage/PhabricatorCountdown.php
--- a/src/applications/countdown/storage/PhabricatorCountdown.php
+++ b/src/applications/countdown/storage/PhabricatorCountdown.php
@@ -8,7 +8,8 @@
PhabricatorApplicationTransactionInterface,
PhabricatorTokenReceiverInterface,
PhabricatorSpacesInterface,
- PhabricatorProjectInterface {
+ PhabricatorProjectInterface,
+ PhabricatorDestructibleInterface {
protected $title;
protected $authorPHID;
@@ -141,8 +142,19 @@
/* -( PhabricatorSpacesInterface )------------------------------------------- */
+
public function getSpacePHID() {
return $this->spacePHID;
}
+/* -( PhabricatorDestructibleInterface )----------------------------------- */
+
+
+ public function destroyObjectPermanently(
+ PhabricatorDestructionEngine $engine) {
+
+ $this->openTransaction();
+ $this->delete();
+ $this->saveTransaction();
+ }
}

File Metadata

Mime Type
text/plain
Expires
Fri, Mar 21, 7:43 AM (2 w, 15 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7715178
Default Alt Text
D17659.id42474.diff (6 KB)

Event Timeline