Page MenuHomePhorge

ManiphestSavedQueryDeleteController.php
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

ManiphestSavedQueryDeleteController.php

<?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

Mime Type
text/x-php
Expires
Mon, May 5, 12:30 AM (1 d, 10 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
68782
Default Alt Text
ManiphestSavedQueryDeleteController.php (1 KB)

Event Timeline