mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-02 01:52:10 +09:00
issue 70 file module UX changed
document module develope for document management git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@8679 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
99d36039e9
commit
aadeda4f55
23 changed files with 444 additions and 261 deletions
|
|
@ -17,6 +17,48 @@
|
|||
* @brief Get all the attachments in order by time descending (for administrators)
|
||||
**/
|
||||
function getFileList($obj, $columnList = array()) {
|
||||
$this->_makeSearchParam($obj, $args);
|
||||
|
||||
// Set valid/invalid state
|
||||
if($obj->isvalid == 'Y') $args->isvalid = 'Y';
|
||||
elseif($obj->isvalid == 'N') $args->isvalid = 'N';
|
||||
// Set multimedia/common file
|
||||
if($obj->direct_download == 'Y') $args->direct_download = 'Y';
|
||||
elseif($obj->direct_download == 'N') $args->direct_download= 'N';
|
||||
// Set variables
|
||||
$args->sort_index = $obj->sort_index;
|
||||
$args->page = $obj->page?$obj->page:1;
|
||||
$args->list_count = $obj->list_count?$obj->list_count:20;
|
||||
$args->page_count = $obj->page_count?$obj->page_count:10;
|
||||
$args->s_module_srl = $obj->module_srl;
|
||||
$args->exclude_module_srl = $obj->exclude_module_srl;
|
||||
// Execute the file.getFileList query
|
||||
$output = executeQuery('file.getFileList', $args, $columnList);
|
||||
// Return if no result or an error occurs
|
||||
if(!$output->toBool()||!count($output->data)) return $output;
|
||||
|
||||
$oFileModel = &getModel('file');
|
||||
|
||||
foreach($output->data as $key => $file) {
|
||||
$file->download_url = $oFileModel->getDownloadUrl($file->file_srl, $file->sid);
|
||||
$output->data[$key] = $file;
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Return number of attachments which belongs to a specific document
|
||||
**/
|
||||
function getFilesCountByGroupValid($obj) {
|
||||
$this->_makeSearchParam($obj, $args);
|
||||
|
||||
$output = executeQueryArray('file.getFilesCountByGroupValid', $args);
|
||||
return $output->data;
|
||||
}
|
||||
|
||||
function _makeSearchParam(&$obj, &$args)
|
||||
{
|
||||
// Search options
|
||||
$search_target = $obj->search_target?$obj->search_target:trim(Context::get('search_target'));
|
||||
$search_keyword = $obj->search_keyword?$obj->search_keyword:trim(Context::get('search_keyword'));
|
||||
|
|
@ -57,35 +99,11 @@
|
|||
case 'nick_name' :
|
||||
$args->s_nick_name = $search_keyword;
|
||||
break;
|
||||
case 'isvalid' :
|
||||
$args->isvalid = $search_keyword;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// Set valid/invalid state
|
||||
if($obj->isvalid == 'Y') $args->isvalid = 'Y';
|
||||
elseif($obj->isvalid == 'N') $args->isvalid = 'N';
|
||||
// Set multimedia/common file
|
||||
if($obj->direct_download == 'Y') $args->direct_download = 'Y';
|
||||
elseif($obj->direct_download == 'N') $args->direct_download= 'N';
|
||||
// Set variables
|
||||
$args->sort_index = $obj->sort_index;
|
||||
$args->page = $obj->page?$obj->page:1;
|
||||
$args->list_count = $obj->list_count?$obj->list_count:20;
|
||||
$args->page_count = $obj->page_count?$obj->page_count:10;
|
||||
$args->s_module_srl = $obj->module_srl;
|
||||
$args->exclude_module_srl = $obj->exclude_module_srl;
|
||||
// Execute the file.getFileList query
|
||||
$output = executeQuery('file.getFileList', $args, $columnList);
|
||||
// Return if no result or an error occurs
|
||||
if(!$output->toBool()||!count($output->data)) return $output;
|
||||
|
||||
$oFileModel = &getModel('file');
|
||||
|
||||
foreach($output->data as $key => $file) {
|
||||
$file->download_url = $oFileModel->getDownloadUrl($file->file_srl, $file->sid);
|
||||
$output->data[$key] = $file;
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue