+ add the feature of upload.

This commit is contained in:
wangchunsheng
2009-11-16 09:45:13 +00:00
parent e96be7d340
commit 6e46daed50
10 changed files with 238 additions and 38 deletions

View File

@@ -156,10 +156,14 @@ class bug extends control
{
$changes = $this->bug->update($bugID);
if(dao::isError()) die(js::error(dao::getError()));
if($this->post->comment != '' or !empty($changes))
$this->loadModel('file');
$files = $this->file->saveUpload('files', 'bug', $bugID);
if($this->post->comment != '' or !empty($changes) or !empty($files))
{
$action = !empty($changes) ? 'Edited' : 'Commented';
$actionID = $this->action->create('bug', $bugID, $action, $this->post->comment);
$fileAction = '';
if(!empty($files)) $fileAction = "Add Files " . join(',', $files) . "\n" ;
$actionID = $this->action->create('bug', $bugID, $action, $fileAction . $this->post->comment);
$this->action->logHistory($actionID, $changes);
}
die(js::locate($this->createLink('bug', 'view', "bugID=$bugID"), 'parent'));
@@ -231,6 +235,8 @@ class bug extends control
{
$this->bug->activate($bugID);
if(dao::isError()) die(js::error(dao::getError()));
$this->loadModel('file');
$files = $this->file->saveUpload('files', 'bug', $bugID);
$this->action->create('bug', $bugID, 'Activated', $this->post->comment);
die(js::locate($this->createLink('bug', 'view', "bugID=$bugID"), 'parent'));
}