mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-04 09:32:15 +09:00
#19705602 refactoring source, when specify db table column parameter in file module
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@8341 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
e1ee2ac134
commit
612c4a6fbd
5 changed files with 15 additions and 10 deletions
|
|
@ -19,7 +19,8 @@
|
||||||
function deleteModuleFiles($module_srl) {
|
function deleteModuleFiles($module_srl) {
|
||||||
// Get a full list of attachments
|
// Get a full list of attachments
|
||||||
$args->module_srl = $module_srl;
|
$args->module_srl = $module_srl;
|
||||||
$output = executeQueryArray('file.getModuleFiles',$args);
|
$columnList = array('file_srl', 'uploaded_filename');
|
||||||
|
$output = executeQueryArray('file.getModuleFiles',$args, $columnList);
|
||||||
if(!$output) return $output;
|
if(!$output) return $output;
|
||||||
$files = $output->data;
|
$files = $output->data;
|
||||||
// Remove from the DB
|
// Remove from the DB
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@
|
||||||
/**
|
/**
|
||||||
* @brief Get all the attachments in order by time descending (for administrators)
|
* @brief Get all the attachments in order by time descending (for administrators)
|
||||||
**/
|
**/
|
||||||
function getFileList($obj) {
|
function getFileList($obj, $columnList = array()) {
|
||||||
// Search options
|
// Search options
|
||||||
$search_target = $obj->search_target?$obj->search_target:trim(Context::get('search_target'));
|
$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'));
|
$search_keyword = $obj->search_keyword?$obj->search_keyword:trim(Context::get('search_keyword'));
|
||||||
|
|
@ -73,7 +73,7 @@
|
||||||
$args->s_module_srl = $obj->module_srl;
|
$args->s_module_srl = $obj->module_srl;
|
||||||
$args->exclude_module_srl = $obj->exclude_module_srl;
|
$args->exclude_module_srl = $obj->exclude_module_srl;
|
||||||
// Execute the file.getFileList query
|
// Execute the file.getFileList query
|
||||||
$output = executeQuery('file.getFileList', $args);
|
$output = executeQuery('file.getFileList', $args, $columnList);
|
||||||
// Return if no result or an error occurs
|
// Return if no result or an error occurs
|
||||||
if(!$output->toBool()||!count($output->data)) return $output;
|
if(!$output->toBool()||!count($output->data)) return $output;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,9 @@
|
||||||
$args->module_srl = Context::get('module_srl');
|
$args->module_srl = Context::get('module_srl');
|
||||||
// Get a list
|
// Get a list
|
||||||
$oFileModel = &getAdminModel('file');
|
$oFileModel = &getAdminModel('file');
|
||||||
$output = $oFileModel->getFileList($args);
|
$columnList = array('file_srl', 'upload_target_srl', 'upload_target_type', 'module_srl'
|
||||||
|
, 'source_filename', 'isvalid', 'file_size', 'download_count', 'files.regdate', 'ipaddress');
|
||||||
|
$output = $oFileModel->getFileList($args, $columnList);
|
||||||
// Get the document for looping a list
|
// Get the document for looping a list
|
||||||
if($output->data) {
|
if($output->data) {
|
||||||
$oCommentModel = &getModel('comment');
|
$oCommentModel = &getModel('comment');
|
||||||
|
|
|
||||||
|
|
@ -121,7 +121,8 @@
|
||||||
$sid = Context::get('sid');
|
$sid = Context::get('sid');
|
||||||
$logged_info = Context::get('logged_info');
|
$logged_info = Context::get('logged_info');
|
||||||
// Get file information from the DB
|
// Get file information from the DB
|
||||||
$file_obj = $oFileModel->getFile($file_srl);
|
$columnList = array('file_srl', 'sid', 'isvalid', 'source_filename', 'module_srl', 'uploaded_filename', 'file_size', 'member_srl');
|
||||||
|
$file_obj = $oFileModel->getFile($file_srl, $columnList);
|
||||||
// If the requested file information is incorrect, an error that file cannot be found appears
|
// If the requested file information is incorrect, an error that file cannot be found appears
|
||||||
if($file_obj->file_srl!=$file_srl || $file_obj->sid!=$sid) return $this->stop('msg_file_not_found');
|
if($file_obj->file_srl!=$file_srl || $file_obj->sid!=$sid) return $this->stop('msg_file_not_found');
|
||||||
// Notify that file download is not allowed when standing-by(Only a top-administrator is permitted)
|
// Notify that file download is not allowed when standing-by(Only a top-administrator is permitted)
|
||||||
|
|
@ -506,7 +507,8 @@
|
||||||
function deleteFiles($upload_target_srl) {
|
function deleteFiles($upload_target_srl) {
|
||||||
// Get a list of attachements
|
// Get a list of attachements
|
||||||
$oFileModel = &getModel('file');
|
$oFileModel = &getModel('file');
|
||||||
$file_list = $oFileModel->getFiles($upload_target_srl);
|
$columnList = array('uploaded_filename', 'module_srl');
|
||||||
|
$file_list = $oFileModel->getFiles($upload_target_srl, $columnList);
|
||||||
// Success returned if no attachement exists
|
// Success returned if no attachement exists
|
||||||
if(!is_array($file_list)||!count($file_list)) return new Object();
|
if(!is_array($file_list)||!count($file_list)) return new Object();
|
||||||
// Remove from the DB
|
// Remove from the DB
|
||||||
|
|
|
||||||
|
|
@ -122,9 +122,9 @@
|
||||||
/**
|
/**
|
||||||
* @brief Get file information
|
* @brief Get file information
|
||||||
**/
|
**/
|
||||||
function getFile($file_srl) {
|
function getFile($file_srl, $columnList = array()) {
|
||||||
$args->file_srl = $file_srl;
|
$args->file_srl = $file_srl;
|
||||||
$output = executeQuery('file.getFile', $args);
|
$output = executeQuery('file.getFile', $args, $columnList);
|
||||||
if(!$output->toBool()) return $output;
|
if(!$output->toBool()) return $output;
|
||||||
|
|
||||||
$file = $output->data;
|
$file = $output->data;
|
||||||
|
|
@ -136,10 +136,10 @@
|
||||||
/**
|
/**
|
||||||
* @brief Return all files which belong to a specific document
|
* @brief Return all files which belong to a specific document
|
||||||
**/
|
**/
|
||||||
function getFiles($upload_target_srl) {
|
function getFiles($upload_target_srl, $columnList = array()) {
|
||||||
$args->upload_target_srl = $upload_target_srl;
|
$args->upload_target_srl = $upload_target_srl;
|
||||||
$args->sort_index = 'file_srl';
|
$args->sort_index = 'file_srl';
|
||||||
$output = executeQuery('file.getFiles', $args);
|
$output = executeQuery('file.getFiles', $args, $columnList);
|
||||||
if(!$output->data) return;
|
if(!$output->data) return;
|
||||||
|
|
||||||
$file_list = $output->data;
|
$file_list = $output->data;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue