This commit is contained in:
wangchunsheng
2010-02-10 06:45:02 +00:00
parent fc8899c1ca
commit b810bb9c88
5 changed files with 98 additions and 1 deletions
+21
View File
@@ -144,6 +144,27 @@ class story extends control
$this->display();
}
/* 激活需求。*/
public function activate($storyID)
{
$this->loadModel('action');
if(!empty($_POST))
{
$this->story->activate($storyID);
if(dao::isError()) die(js::error(dao::getError()));
$actionID = $this->action->create('story', $storyID, 'Activated', $this->post->comment);
$this->action->logHistory($actionID, $changes);
die(js::locate($this->createLink('story', 'view', "storyID=$storyID"), 'parent'));
}
$this->commonAction($storyID);
/* 赋值到模板。*/
$this->view->header->title = $this->view->product->name . $this->lang->colon . $this->lang->story->activate . $this->lang->colon . $this->view->story->title;
$this->view->position[] = $this->lang->story->activate;
$this->display();
}
/* 需求详情。*/
public function view($storyID, $version = 0)
{
+1
View File
@@ -27,6 +27,7 @@ $lang->story->change = "变更";
$lang->story->review = '评审';
$lang->story->edit = "编辑需求";
$lang->story->close = '关闭';
$lang->story->activate = '激活';
$lang->story->delete = "删除需求";
$lang->story->view = "需求详情";
$lang->story->tasks = "相关任务";
+26
View File
@@ -227,12 +227,17 @@ class storyModel extends model
$oldStory = $this->dao->findById($storyID)->from(TABLE_STORY)->fetch();
$now = date('Y-m-d H:i:s');
$story = fixer::input('post')
->add('lastEditedBy', $this->app->user->account)
->add('lastEditedDate', $now)
->add('closedDate', $now)
->add('closedBy', $this->app->user->account)
->add('assignedTo', 'closed')
->add('assignedDate', $now)
->add('status', 'closed')
->removeIF($this->post->closedReason != 'duplicate', 'duplicateStory')
->removeIF($this->post->closedReason != 'subdivided', 'childStories')
->setIF($this->post->closedReason == 'done', 'stage', 'released')
->setIF($this->post->closedReason != 'done', 'plan', 0)
->remove('comment')
->get();
$this->dao->update(TABLE_STORY)->data($story)
@@ -244,6 +249,27 @@ class storyModel extends model
return true;
}
/* 激活需求。*/
public function activate($storyID)
{
$oldStory = $this->dao->findById($storyID)->from(TABLE_STORY)->fetch();
$now = date('Y-m-d H:i:s');
$story = fixer::input('post')
->add('lastEditedBy', $this->app->user->account)
->add('lastEditedDate', $now)
->add('assignedDate', $now)
->add('status', 'active')
->add('closedBy', '')
->add('closedReason', '')
->add('closedDate', '0000-00-00')
->add('reviewedBy', '')
->add('reviewedDate', '0000-00-00')
->remove('comment')
->get();
$this->dao->update(TABLE_STORY)->data($story)->autoCheck()->where('id')->eq($storyID)->exec();
return true;
}
/* 获得某一个产品某一个模块下面的所有需求列表。*/
public function getProductStories($productID = 0, $moduleIds = 0, $status = 'all', $orderBy = 'id|desc', $pager = null)
{
+47
View File
@@ -0,0 +1,47 @@
<?php
/**
* The activate view file of story module of ZenTaoMS.
*
* ZenTaoMS is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ZenTaoMS is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with ZenTaoMS. If not, see <http://www.gnu.org/licenses/>.
*
* @copyright Copyright: 2009 Chunsheng Wang
* @author Chunsheng Wang <wwccss@263.net>
* @package story
* @version $Id$
* @link http://www.zentao.cn
*/
?>
<?php include './header.html.php';?>
<div class='yui-d0'>
<form method='post' enctype='multipart/form-data' target='hiddenwin'>
<table class='table-1'>
<caption><?php echo $lang->story->activate;?></caption>
<tr>
<th class='rowhead'><?php echo $lang->story->assignedTo;?></th>
<td><?php echo html::select('assignedTo', $users, $story->closedBy, 'class="select-3"');?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->story->comment;?></th>
<td><?php echo html::textarea('comment', '', 'rows=5 class="area-1"');?></td>
</tr>
<tr>
<td colspan='2' class='a-center'>
<?php echo html::submitButton() . html::linkButton($lang->goback, inlink('view', "storyID=$story->id"));?>
</td>
</tr>
</table>
<?php include '../../common/action.html.php';?>
</form>
</div>
<?php include '../../common/footer.html.php';?>
+3 -1
View File
@@ -33,6 +33,7 @@
if(!($story->status != 'closed' and common::printLink('story', 'change', "storyID=$story->id", $lang->story->change))) echo $lang->story->change . ' ';
if(!(($story->status == 'draft' or $story->status == 'changed') and common::printLink('story', 'review', "storyID=$story->id", $lang->story->review))) echo $lang->story->review . ' ';
if(!($story->status != 'closed' and common::printLink('story', 'close', "storyID=$story->id", $lang->story->close))) echo $lang->story->close . ' ';
if(!($story->status == 'closed' and $story->closedReason == 'postponed' and common::printLink('story', 'activate', "storyID=$story->id", $lang->story->activate))) echo $lang->story->activate . ' ';
if(!common::printLink('story', 'edit', "storyID=$story->id", $lang->edit)) echo $lang->edit . ' ';
echo html::a($browseLink, $lang->goback);
?>
@@ -57,6 +58,7 @@
if(!($story->status != 'closed' and common::printLink('story', 'change', "storyID=$story->id", $lang->story->change))) echo $lang->story->change . ' ';
if(!(($story->status == 'draft' or $story->status == 'changed') and common::printLink('story', 'review', "storyID=$story->id", $lang->story->review))) echo $lang->story->review . ' ';
if(!($story->status != 'closed' and common::printLink('story', 'close', "storyID=$story->id", $lang->story->close))) echo $lang->story->close . ' ';
if(!($story->status == 'closed' and $story->closedReason == 'postponed' and common::printLink('story', 'activate', "storyID=$story->id", $lang->story->activate))) echo $lang->story->activate . ' ';
if(!common::printLink('story', 'edit', "storyID=$story->id", $lang->edit)) echo $lang->edit . ' ';
echo html::a($browseLink, $lang->goback);
?>
@@ -134,7 +136,7 @@
<td>
<?php
if($story->closedReason) echo $lang->story->reasonList[$story->closedReason];
if($story->duplicateStory)
if(isset($story->extraStories[$story->duplicateStory]))
{
echo html::a(inlink('view', "storyID=$story->duplicateStory"), '#' . $story->duplicateStory . ' ' . $story->extraStories[$story->duplicateStory]);
}