mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-08 03:01:43 +09:00
문서 이동 / 첨부 파일 삭제 기능 개선
This commit is contained in:
parent
b180270e08
commit
3d2ade4aa1
14 changed files with 253 additions and 234 deletions
|
|
@ -2869,26 +2869,47 @@ class documentController extends document
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function updateUploaedCount($documentSrlList)
|
||||
|
||||
public function updateUploaedCount($document_srl_list)
|
||||
{
|
||||
$oDocumentModel = getModel('document');
|
||||
$oFileModel = getModel('file');
|
||||
|
||||
if(is_array($documentSrlList))
|
||||
if(!is_array($document_srl_list))
|
||||
{
|
||||
$documentSrlList = array_unique($documentSrlList);
|
||||
foreach($documentSrlList AS $key => $documentSrl)
|
||||
$document_srl_list = array($document_srl_list);
|
||||
}
|
||||
|
||||
if(empty($document_srl_list))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$oFileModel = getModel('file');
|
||||
$document_srl_list = array_unique($document_srl_list);
|
||||
|
||||
foreach($document_srl_list as $document_srl)
|
||||
{
|
||||
if(!$document_srl = (int) $document_srl)
|
||||
{
|
||||
$fileCount = $oFileModel->getFilesCount($documentSrl);
|
||||
$args = new stdClass();
|
||||
$args->document_srl = $documentSrl;
|
||||
$args->uploaded_count = $fileCount;
|
||||
executeQuery('document.updateUploadedCount', $args);
|
||||
continue;
|
||||
}
|
||||
|
||||
$args = new stdClass;
|
||||
$args->document_srl = $document_srl;
|
||||
$args->uploaded_count = $oFileModel->getFilesCount($document_srl);
|
||||
executeQuery('document.updateUploadedCount', $args);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function triggerAfterDeleteFile($file)
|
||||
{
|
||||
$oDocument = getModel('document')->getDocument($file->upload_target_srl, false, false);
|
||||
if(!$oDocument->isExists())
|
||||
{
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
$this->updateUploaedCount($file->upload_target_srl);
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy extra keys when module copied
|
||||
* @param object $obj
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue