* add link when export to html.

This commit is contained in:
areyou123456
2012-06-20 08:18:46 +00:00
parent 815158966f
commit d617b5f697
6 changed files with 32 additions and 1 deletions
+1
View File
@@ -991,6 +991,7 @@ class bug extends control
$this->post->set('fields', $fields);
$this->post->set('rows', $bugs);
$this->post->set('kind', 'bug');
$this->fetch('file', 'export2' . $this->post->fileType, $_POST);
}
+27
View File
@@ -158,6 +158,33 @@ class file extends control
{
$this->view->fields = $this->post->fields;
$this->view->rows = $this->post->rows;
switch($this->post->kind)
{
case 'task':
foreach($this->view->rows as $row)
{
$row->name = html::a('http://' . $_SERVER['HTTP_HOST'] . $this->createLink('task', 'view', "taskID=$row->id"), $row->name);
}
break;
case 'story':
foreach($this->view->rows as $row)
{
$row->title= html::a('http://' . $_SERVER['HTTP_HOST'] . $this->createLink('story', 'view', "storyID=$row->id"), $row->title);
}
break;
case 'bug':
foreach($this->view->rows as $row)
{
$row->title= html::a('http://' . $_SERVER['HTTP_HOST'] . $this->createLink('bug', 'view', "bugID=$row->id"), $row->title);
}
break;
case 'testcase':
foreach($this->view->rows as $row)
{
$row->title= html::a('http://' . $_SERVER['HTTP_HOST'] . $this->createLink('testcase', 'view', "caseID=$row->id"), $row->title);
}
break;
}
$this->view->fileName = $this->post->fileName;
$output = $this->parse('file', 'export2Html');
+1 -1
View File
@@ -22,7 +22,7 @@ table, th, td{font-size:12px; border:1px solid gray; border-collapse:collapse;}
<tr>
<?php
foreach($fields as $fieldLabel)
{
{
echo "<th><nobr>$fieldLabel</nobr></th>\n";
}
?>
+1
View File
@@ -903,6 +903,7 @@ class story extends control
$this->post->set('fields', $fields);
$this->post->set('rows', $stories);
$this->post->set('kind', 'story');
$this->fetch('file', 'export2' . $this->post->fileType, $_POST);
}
+1
View File
@@ -813,6 +813,7 @@ class task extends control
$this->post->set('fields', $fields);
$this->post->set('rows', $tasks);
$this->post->set('kind', 'task');
$this->fetch('file', 'export2' . $this->post->fileType, $_POST);
}
+1
View File
@@ -549,6 +549,7 @@ class testcase extends control
$this->post->set('fields', $fields);
$this->post->set('rows', $cases);
$this->post->set('kind', 'testcase');
$this->fetch('file', 'export2' . $this->post->fileType, $_POST);
}