* [bug#57849,done,0.3h] use defaultFiles to show files.

This commit is contained in:
liumengyi
2024-12-30 09:51:11 +08:00
committed by 刘刚
parent 0492f8abbd
commit 39769f3eb6
4 changed files with 8 additions and 13 deletions
+2
View File
@@ -75,6 +75,8 @@ $config->bug->form->edit['resolvedDate'] = array('required' => false, 'type' =
$config->bug->form->edit['closedDate'] = array('required' => false, 'type' => 'date', 'default' => null);
$config->bug->form->edit['lastEditedDate'] = array('required' => false, 'type' => 'date', 'default' => helper::now());
$config->bug->form->edit['comment'] = array('required' => false, 'type' => 'string', 'default' => '', 'control' => 'editor');
$config->bug->form->edit['deleteFiles'] = array('required' => false, 'type' => 'array', 'default' => array());
$config->bug->form->edit['renameFiles'] = array('required' => false, 'type' => 'array', 'default' => array());
global $app;
$config->bug->form->close = array();
+5 -1
View File
@@ -317,7 +317,7 @@ class bugModel extends model
{
$oldBug = $this->fetchByID($bug->id);
$this->dao->update(TABLE_BUG)->data($bug, 'deleteFiles,comment')
$this->dao->update(TABLE_BUG)->data($bug, 'deleteFiles,renameFiles,comment')
->autoCheck()
->batchCheck($this->config->bug->edit->requiredFields, 'notempty')
->checkIF(!empty($bug->resolvedBy), 'resolution', 'notempty')
@@ -331,6 +331,10 @@ class bugModel extends model
if(dao::isError()) return false;
/* 更新 bug 的附件。*/
/* Update the files of bug. */
$this->loadModel('file')->processFileDiffsForObject('bug', $oldBug, $bug);
$changes = common::createChanges($oldBug, $bug);
if($changes || !empty($bug->comment))
{
+1 -8
View File
@@ -103,14 +103,7 @@ detailBody
section
(
set::title($lang->files),
$bug->files ? fileList
(
set::files($bug->files),
set::fieldset(false),
set::showEdit(true),
set::showDelete(true)
) : null,
fileSelector()
fileSelector($bug->files ? set::defaultFiles(array_values($bug->files)) : null)
),
section
(
-4
View File
@@ -1983,10 +1983,6 @@ class bugZen extends bug
/* Update the status of feedback. */
if(($this->config->edition != 'open') && $oldBug->feedback) $this->loadModel('feedback')->updateStatus('bug', $oldBug->feedback, $bug->status, $oldBug->status);
/* 更新 bug 的附件。*/
/* Update the files of bug. */
$this->loadModel('file')->processFile4Object('bug', $oldBug, $bug);
return !dao::isError();
}