2013-02-19 23:12:33 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @group pholio
|
|
|
|
*/
|
|
|
|
final class PholioInlineDeleteController extends PholioController {
|
|
|
|
|
|
|
|
private $id;
|
|
|
|
|
|
|
|
public function willProcessRequest(array $data) {
|
|
|
|
$this->id = $data['id'];
|
|
|
|
}
|
|
|
|
|
|
|
|
public function processRequest() {
|
|
|
|
$request = $this->getRequest();
|
|
|
|
$user = $request->getUser();
|
|
|
|
|
|
|
|
$inline_comment = id(new PholioTransactionComment())->loadOneWhere(
|
|
|
|
'id = %d AND authorphid = %s AND transactionphid IS NULL',
|
|
|
|
$this->id,
|
|
|
|
$user->getPHID());
|
|
|
|
|
|
|
|
if ($inline_comment == null) {
|
|
|
|
return new Aphront404Response();
|
|
|
|
} else {
|
2013-02-22 15:39:08 +01:00
|
|
|
|
|
|
|
$inline_comment->delete();
|
2013-02-19 23:12:33 +01:00
|
|
|
return id(new AphrontAjaxResponse())
|
|
|
|
->setContent(array('success' => true));
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|