mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-02 01:52:10 +09:00
Fix #1773 add function to delete temp saved document
This commit is contained in:
parent
1a23fc3a71
commit
53a7e4d90f
3 changed files with 60 additions and 2 deletions
|
|
@ -343,6 +343,34 @@ class documentController extends document
|
|||
return $this->declaredDocumentCancel($document_srl);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete temporarily saved document
|
||||
*/
|
||||
public function procDocumentDeleteTempSaved()
|
||||
{
|
||||
$document_srl = Context::get('document_srl');
|
||||
if ($document_srl <= 0)
|
||||
{
|
||||
throw new Rhymix\Framework\Exceptions\InvalidRequest;
|
||||
}
|
||||
|
||||
$oDocument = DocumentModel::getDocument($document_srl);
|
||||
if (!$oDocument || !$oDocument->isExists())
|
||||
{
|
||||
throw new Rhymix\Framework\Exceptions\TargetNotFound;
|
||||
}
|
||||
if ($oDocument->get('member_srl') !== $this->user->member_srl || $oDocument->getStatus() !== 'TEMP' || !$oDocument->isGranted())
|
||||
{
|
||||
throw new Rhymix\Framework\Exceptions\TargetNotFound;
|
||||
}
|
||||
|
||||
$output = $this->deleteDocument($document_srl);
|
||||
if ($output instanceof BaseObject && !$output->toBool())
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete alias when module deleted
|
||||
* @param int $module_srl
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue