mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-02 01:52:10 +09:00
Fix #1129 display total size when selecting files for deletion
This commit is contained in:
parent
a23323335b
commit
188c4aa34a
2 changed files with 8 additions and 4 deletions
|
|
@ -643,6 +643,7 @@ class fileController extends file
|
|||
{
|
||||
$oFileModel = getModel('file');
|
||||
$fileList = $oFileModel->getFile($fileSrlList);
|
||||
$fileSizeTotal = 0;
|
||||
if(!is_array($fileList)) $fileList = array($fileList);
|
||||
|
||||
if(is_array($fileList))
|
||||
|
|
@ -652,16 +653,20 @@ class fileController extends file
|
|||
$value->human_file_size = FileHandler::filesize($value->file_size);
|
||||
if($value->isvalid=='Y') $value->validName = $lang->is_valid;
|
||||
else $value->validName = $lang->is_stand_by;
|
||||
$fileSizeTotal += $value->file_size;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$fileList = array();
|
||||
$fileSizeTotal = 0;
|
||||
$this->setMessage($lang->no_files);
|
||||
}
|
||||
|
||||
$this->add('file_list', $fileList);
|
||||
$this->add('file_size_total', $fileSizeTotal);
|
||||
$this->add('file_size_total_human', FileHandler::filesize($fileSizeTotal));
|
||||
}
|
||||
/**
|
||||
* A trigger to return numbers of attachments in the upload_target_srl (document_srl)
|
||||
|
|
|
|||
|
|
@ -10,10 +10,9 @@ function getFileList() {
|
|||
});
|
||||
|
||||
var params = new Array();
|
||||
var response_tags = ['error','message', 'file_list'];
|
||||
params["file_srls"] = cartList.join(",");
|
||||
|
||||
exec_xml('file','procFileGetList',params, completeGetFileList, response_tags);
|
||||
exec_json('file.procFileGetList', params, completeGetFileList);
|
||||
}
|
||||
|
||||
function completeGetFileList(ret_obj, response_tags)
|
||||
|
|
@ -27,7 +26,7 @@ function completeGetFileList(ret_obj, response_tags)
|
|||
}
|
||||
else
|
||||
{
|
||||
var file_list = ret_obj['file_list']['item'];
|
||||
var file_list = ret_obj['file_list']['item'] ? ret_obj['file_list']['item'] : ret_obj['file_list'];
|
||||
if(!jQuery.isArray(file_list)) file_list = [file_list];
|
||||
for(var x in file_list)
|
||||
{
|
||||
|
|
@ -39,7 +38,7 @@ function completeGetFileList(ret_obj, response_tags)
|
|||
'</tr>' +
|
||||
'<input type="hidden" name="cart[]" value="'+objFile.file_srl+'" />';
|
||||
}
|
||||
jQuery('#selectedFileCount').html(file_list.length);
|
||||
jQuery('#selectedFileCount').html(file_list.length + ' (' + ret_obj['file_size_total_human'] + ')');
|
||||
}
|
||||
jQuery('#fileManageListTable>tbody').html(htmlListBuffer);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue