* fix a bug for comment of testcase.

This commit is contained in:
shiyangyangwork@yahoo.cn
2012-02-20 04:34:54 +00:00
parent 457f8c53bd
commit 1bfb161111
2 changed files with 10 additions and 5 deletions
+9 -4
View File
@@ -340,15 +340,20 @@ class testcase extends control
* @access public
* @return void
*/
public function edit($caseID)
public function edit($caseID, $comment = false)
{
$this->loadModel('story');
if(!empty($_POST))
{
$changes = $this->testcase->update($caseID);
if(dao::isError()) die(js::error(dao::getError()));
$files = $this->loadModel('file')->saveUpload('testcase', $caseID);
$changes = array();
$files = array();
if($comment == false)
{
$changes = $this->testcase->update($caseID);
if(dao::isError()) die(js::error(dao::getError()));
$files = $this->loadModel('file')->saveUpload('testcase', $caseID);
}
if($this->post->comment != '' or !empty($changes) or !empty($files))
{
$this->loadModel('action');
+1 -1
View File
@@ -72,7 +72,7 @@
<div id='comment' class='hidden'>
<fieldset>
<legend><?php echo $lang->comment;?></legend>
<form method='post' action='<?php echo inlink('edit', "caseID=$case->id")?>'>
<form method='post' action='<?php echo inlink('edit', "caseID=$case->id&comment=true")?>'>
<table align='center' class='table-1'>
<tr><td><?php echo html::textarea('comment', '',"rows='5' class='w-p100'");?></td></tr>
<tr><td><?php echo html::submitButton() . html::resetButton();?></td></tr>