mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-12 06:52:12 +09:00
Merge pull request #996 from conory/pr/move_document
문서 이동 / 첨부 파일 삭제 기능 개선
This commit is contained in:
commit
8d812992e7
26 changed files with 743 additions and 782 deletions
|
|
@ -29,25 +29,19 @@ class documentModel extends document
|
|||
{
|
||||
return $_SESSION['granted_document'][$document_srl];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return document extra information from database
|
||||
* @param array $documentSrls
|
||||
* @param array $document_srls
|
||||
* @return object
|
||||
*/
|
||||
function getDocumentExtraVarsFromDB($documentSrls)
|
||||
function getDocumentExtraVarsFromDB($document_srls)
|
||||
{
|
||||
if(!is_array($documentSrls) || count($documentSrls) == 0)
|
||||
{
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$args = new stdClass();
|
||||
$args->document_srl = $documentSrls;
|
||||
$output = executeQueryArray('document.getDocumentExtraVars', $args);
|
||||
return $output;
|
||||
$args = new stdClass;
|
||||
$args->document_srl = $document_srls;
|
||||
return executeQueryArray('document.getDocumentExtraVars', $args);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Extra variables for each article will not be processed bulk select and apply the macro city
|
||||
* @return void
|
||||
|
|
@ -167,57 +161,42 @@ class documentModel extends document
|
|||
* @param array $columnList
|
||||
* @return array value type is documentItem
|
||||
*/
|
||||
function getDocuments($document_srls, $is_admin = false, $load_extra_vars=true, $columnList = array())
|
||||
function getDocuments($document_srls, $is_admin = false, $load_extra_vars = true, $columnList = array())
|
||||
{
|
||||
if(is_array($document_srls))
|
||||
{
|
||||
$list_count = count($document_srls);
|
||||
$document_srls = implode(',',$document_srls);
|
||||
}
|
||||
else
|
||||
{
|
||||
$list_count = 1;
|
||||
}
|
||||
$args = new stdClass();
|
||||
$args->document_srls = $document_srls;
|
||||
$args->list_count = $list_count;
|
||||
$args->list_count = is_array($document_srls) ? count($document_srls) : 1;
|
||||
$args->order_type = 'asc';
|
||||
|
||||
$output = executeQuery('document.getDocuments', $args, $columnList);
|
||||
$document_list = $output->data;
|
||||
if(!$document_list) return;
|
||||
if(!is_array($document_list)) $document_list = array($document_list);
|
||||
|
||||
$document_count = count($document_list);
|
||||
foreach($document_list as $key => $attribute)
|
||||
$output = executeQueryArray('document.getDocuments', $args, $columnList);
|
||||
|
||||
$documents = array();
|
||||
foreach($output->data as $key => $attribute)
|
||||
{
|
||||
$document_srl = $attribute->document_srl;
|
||||
if(!$document_srl) continue;
|
||||
|
||||
if(!$document_srl = $attribute->document_srl)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if(!$GLOBALS['XE_DOCUMENT_LIST'][$document_srl])
|
||||
{
|
||||
$oDocument = null;
|
||||
$oDocument = new documentItem();
|
||||
$oDocument->setAttribute($attribute, false);
|
||||
if($is_admin) $oDocument->setGrant();
|
||||
if($is_admin)
|
||||
{
|
||||
$oDocument->setGrant();
|
||||
}
|
||||
$GLOBALS['XE_DOCUMENT_LIST'][$document_srl] = $oDocument;
|
||||
}
|
||||
|
||||
$result[$attribute->document_srl] = $GLOBALS['XE_DOCUMENT_LIST'][$document_srl];
|
||||
|
||||
$documents[$document_srl] = $GLOBALS['XE_DOCUMENT_LIST'][$document_srl];
|
||||
}
|
||||
|
||||
if($load_extra_vars) $this->setToAllDocumentExtraVars();
|
||||
|
||||
$output = null;
|
||||
if(count($result))
|
||||
|
||||
if($load_extra_vars)
|
||||
{
|
||||
foreach($result as $document_srl => $val)
|
||||
{
|
||||
$output[$document_srl] = $GLOBALS['XE_DOCUMENT_LIST'][$document_srl];
|
||||
}
|
||||
$this->setToAllDocumentExtraVars();
|
||||
}
|
||||
|
||||
return $output;
|
||||
|
||||
return $documents;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue