* complete task #299:use default file name when download.

+ complete task #297:add file delete function to all files.
This commit is contained in:
fujia
2010-08-19 09:02:39 +00:00
parent 8778545008
commit 8cbc0dcd4c
11 changed files with 123 additions and 22 deletions
+7
View File
@@ -255,6 +255,13 @@ class testcase extends control
}
}
/* 删除一个文件。*/
public function deleteFile($fileID)
{
$this->dao->delete()->from(TABLE_FILE)->where('id')->eq($fileID)->exec();
die(js::reload('parent'));
}
/* 确认需求变动。*/
public function confirmStoryChange($caseID)
{
+10 -1
View File
@@ -24,6 +24,7 @@
?>
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/colorize.html.php';?>
<?php include '../../file/view/download.html.php';?>
<div class='yui-d0'>
<div id='titlebar' <?php if($case->deleted) echo "class='deleted'";?>>
CASE #<?php echo $case->id . $lang->colon . $case->title;?>
@@ -66,7 +67,15 @@
</fieldset>
<fieldset>
<legend><?php echo $lang->testcase->legendAttatch;?></legend>
<div><?php foreach($case->files as $file) echo html::a($this->createLink('file', 'download', "fileID=$file->id"), $file->title, '_blank');?></div>
<div>
<?php
foreach($case->files as $file)
{
echo html::a($this->createLink('file', 'download', "fileID=$file->id"), $file->title, '_blank', "onclick='return downloadFile($file->id)'");
echo html::commonButton('x', "onclick=deleteFile($file->id)");
}
?>
</div>
</fieldset>
<?php include '../../common/view/action.html.php';?>