* Fix bug.

This commit is contained in:
滔哥
2018-10-12 16:43:01 +08:00
parent af96722cc7
commit e2e7a0c694
2 changed files with 7 additions and 6 deletions
+6 -5
View File
@@ -365,13 +365,14 @@ class file extends control
if($_POST)
{
$this->app->loadLang('action');
$file = $this->file->getByID($fileID);
$data = fixer::input('post')->get();
$this->dao->update(TABLE_FILE)->set('title')->eq($data->fileName)->where('id')->eq($fileID)->exec();
$file = $this->file->getByID($fileID);
$data = fixer::input('post')->get();
$fileName = $data->fileName . '.' . $file->extension;
$this->dao->update(TABLE_FILE)->set('title')->eq($fileName)->where('id')->eq($fileID)->exec();
$extension = "." . $file->extension;
$actionID = $this->loadModel('action')->create($file->objectType, $file->objectID, 'editfile', '', $data->fileName . $extension);
$changes[] = array('field' => 'fileName', 'old' => $file->title . $extension, 'new' => $data->fileName . $extension);
$actionID = $this->loadModel('action')->create($file->objectType, $file->objectID, 'editfile', '', $fileName);
$changes[] = array('field' => 'fileName', 'old' => $file->title . $extension, 'new' => $fileName);
$this->action->logHistory($actionID, $changes);
die(js::reload('parent.parent'));
+1 -1
View File
@@ -36,7 +36,7 @@ function closeWindow()
<tr>
<td>
<div class='input-group'>
<?php echo html::input('fileName', $file->title, "class='form-control' autocomplete='off'");?>
<?php echo html::input('fileName', rtrim($file->title, '.' . $file->extension), "class='form-control' size='40' autocomplete='off'");?>
<strong class='input-group-addon'>.<?php echo $file->extension;?></strong>
</div>
</td>