* finish task#1251.

This commit is contained in:
chencongzhi520@gmail.com
2013-04-17 06:45:08 +00:00
parent fe82eb02f1
commit c31a78e23b
6 changed files with 198 additions and 137 deletions

View File

@@ -170,13 +170,14 @@ $lang->story->methodOrder[65] = 'report';
/* Product plan. */
$lang->resource->productplan = new stdclass();
$lang->resource->productplan->browse = 'browse';
$lang->resource->productplan->create = 'create';
$lang->resource->productplan->edit = 'edit';
$lang->resource->productplan->delete = 'delete';
$lang->resource->productplan->view = 'view';
$lang->resource->productplan->linkStory = 'linkStory';
$lang->resource->productplan->unlinkStory = 'unlinkStory';
$lang->resource->productplan->browse = 'browse';
$lang->resource->productplan->create = 'create';
$lang->resource->productplan->edit = 'edit';
$lang->resource->productplan->delete = 'delete';
$lang->resource->productplan->view = 'view';
$lang->resource->productplan->linkStory = 'linkStory';
$lang->resource->productplan->unlinkStory = 'unlinkStory';
$lang->resource->productplan->batchUnlinkStory = 'batchUnlinkStory';
$lang->productplan->methodOrder[5] = 'browse';
$lang->productplan->methodOrder[10] = 'create';
@@ -185,6 +186,7 @@ $lang->productplan->methodOrder[20] = 'delete';
$lang->productplan->methodOrder[25] = 'view';
$lang->productplan->methodOrder[30] = 'linkStory';
$lang->productplan->methodOrder[35] = 'unlinkStory';
$lang->productplan->methodOrder[40] = 'batchUnlinkStory';
/* Release. */
$lang->resource->release = new stdclass();

View File

@@ -154,7 +154,7 @@ class productplan extends control
{
$this->session->set('storyList', $this->app->getURI(true));
if(!empty($_POST)) $this->productplan->linkStory($planID);
if(!empty($_POST['stories'])) $this->productplan->linkStory($planID);
$plan = $this->productplan->getByID($planID);
$this->commonAction($plan->product);
@@ -189,4 +189,20 @@ class productplan extends control
die(js::reload('parent'));
}
}
/**
* Batch unlink story.
*
* @param string $confirm
* @access public
* @return void
*/
public function batchUnlinkStory($confirm = 'no')
{
foreach($this->post->unlinkStories as $storyID)
{
$this->productplan->unlinkStory($storyID);
}
die(js::reload('parent'));
}
}

View File

@@ -16,10 +16,11 @@ $lang->productplan->create = "Create";
$lang->productplan->edit = "Edit";
$lang->productplan->delete = "Delete";
$lang->productplan->view = "Info";
$lang->productplan->linkStory = "Link story";
$lang->productplan->unlinkStory = "Remove story";
$lang->productplan->linkedStories = 'Stories linked';
$lang->productplan->unlinkedStories = 'Stories unlinked';
$lang->productplan->linkStory = "Link story";
$lang->productplan->unlinkStory = "Remove story";
$lang->productplan->batchUnlinkStory = "Batch Remove";
$lang->productplan->linkedStories = 'Stories linked';
$lang->productplan->unlinkedStories = 'Stories unlinked';
$lang->productplan->confirmDelete = "Are you sure to delete this plan?";
$lang->productplan->confirmUnlinkStory = "Are you sure to remove this story?";

View File

@@ -16,10 +16,11 @@ $lang->productplan->create = "创建计划";
$lang->productplan->edit = "编辑计划";
$lang->productplan->delete = "删除计划";
$lang->productplan->view = "计划详情";
$lang->productplan->linkStory = "关联需求";
$lang->productplan->unlinkStory = "移除需求";
$lang->productplan->linkedStories = '已关联需求列表';
$lang->productplan->unlinkedStories = '关联需求列表';
$lang->productplan->linkStory = "关联需求";
$lang->productplan->unlinkStory = "移除需求";
$lang->productplan->batchUnlinkStory = "批量移除";
$lang->productplan->linkedStories = '关联需求列表';
$lang->productplan->unlinkedStories = '未关联需求列表';
$lang->productplan->confirmDelete = "您确认删除该计划吗?";
$lang->productplan->confirmUnlinkStory = "您确认移除该需求吗?";

View File

@@ -12,20 +12,19 @@
?>
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/tablesorter.html.php';?>
<form method='post'>
<table class='table-1 tablesorter a-center'>
<form method='post' id='unlinkedStoriesForm'>
<table class='table-1 tablesorter a-center fixed'>
<caption class='caption-tl'><?php echo $plan->title .$lang->colon . $lang->productplan->unlinkedStories;?></caption>
<thead>
<tr class='colhead'>
<th class='w-id'><?php echo $lang->idAB;?></th>
<th class='w-pri'><?php echo $lang->priAB;?></th>
<th><?php echo $lang->story->plan;?></th>
<th><?php echo $lang->story->title;?></th>
<th><?php echo $lang->openedByAB;?></th>
<th><?php echo $lang->assignedToAB;?></th>
<th><?php echo $lang->story->estimateAB;?></th>
<th><?php echo $lang->statusAB;?></th>
<th class='w-40px {sorter: false}'><?php echo $lang->link;?></th>
<th class='w-id'> <?php echo $lang->idAB;?></th>
<th class='w-pri'> <?php echo $lang->priAB;?></th>
<th class='w-200px'> <?php echo $lang->story->plan;?></th>
<th> <?php echo $lang->story->title;?></th>
<th class='w-user'> <?php echo $lang->openedByAB;?></th>
<th class='w-user'> <?php echo $lang->assignedToAB;?></th>
<th class='w-30px'> <?php echo $lang->story->estimateAB;?></th>
<th class='w-status'><?php echo $lang->statusAB;?></th>
</tr>
</thead>
<tbody>
@@ -35,7 +34,10 @@
if($story->plan and helper::diffDate($plans[$story->plan], helper::today()) > 0) continue;
?>
<tr>
<td><?php echo html::a($this->createLink('story', 'view', "storyID=$story->id"), $story->id);?></td>
<td class='a-left'>
<input class='ml-10px' type='checkbox' name='stories[]' value='<?php echo $story->id;?>'/>
<?php echo html::a($this->createLink('story', 'view', "storyID=$story->id"), $story->id);?>
</td>
<td><span class='<?php echo 'pri' . $story->pri;?>'><?php echo $story->pri?></span></td>
<td><?php echo $story->planTitle;?></td>
<td class='a-left nobr'><?php echo html::a($this->createLink('story', 'view', "storyID=$story->id"), $story->title);?></td>
@@ -43,47 +45,66 @@
<td><?php echo $users[$story->assignedTo];?></td>
<td><?php echo $story->estimate;?></td>
<td><?php echo $lang->story->statusList[$story->status];?></td>
<td><input type='checkbox' name='stories[]' value='<?php echo $story->id;?>' /></td>
</tr>
<?php endforeach;?>
</tbody>
<tfoot>
<tr>
<td colspan='9'><?php echo html::submitButton($lang->story->linkStory);?></td>
<td colspan='8' class='a-left'>
<?php if(count($allStories)) echo html::selectAll('unlinkedStoriesForm') . html::selectReverse('unlinkedStoriesForm') . html::submitButton($lang->story->linkStory);?>
</td>
</tr>
</tfoot>
</table>
</form>
<table class='table-1 tablesorter a-center'>
<caption class='caption-tl'><?php echo $plan->title .$lang->colon . $lang->productplan->linkedStories;?></caption>
<thead>
<tr class='colhead'>
<th class='w-id'><?php echo $lang->idAB;?></th>
<th class='w-pri'><?php echo $lang->priAB;?></th>
<th><?php echo $lang->story->title;?></th>
<th><?php echo $lang->openedByAB;?></th>
<th><?php echo $lang->assignedToAB;?></th>
<th><?php echo $lang->story->estimateAB;?></th>
<th><?php echo $lang->statusAB;?></th>
<th><?php echo $lang->story->stageAB;?></th>
<th class='w-50px {sorter:false}'><?php echo $lang->actions?></th>
</tr>
</thead>
<tbody>
<?php foreach($planStories as $story):?>
<tr>
<td><?php echo html::a($this->createLink('story', 'view', "storyID=$story->id"), $story->id);?></td>
<td><span class='<?php echo 'pri' . $story->pri;?>'><?php echo $story->pri?></span></td>
<td class='a-left nobr'><?php echo html::a($this->createLink('story', 'view', "storyID=$story->id"), $story->title);?></td>
<td><?php echo $users[$story->openedBy];?></td>
<td><?php echo $users[$story->assignedTo];?></td>
<td><?php echo $story->estimate;?></td>
<td><?php echo $lang->story->statusList[$story->status];?></td>
<td><?php echo $lang->story->stageList[$story->stage];?></td>
<td><?php common::printIcon('productplan', 'unlinkStory', "story=$story->id", '', 'list', '', 'hiddenwin');?></td>
</tr>
<?php endforeach;?>
</tbody>
</table>
<form method='post' target='hiddenwin' action="<?php echo $this->inLink('batchUnlinkStory');?>" id='linkedStoriesForm'>
<table class='table-1 tablesorter a-center fixed'>
<caption class='caption-tl'><?php echo $plan->title .$lang->colon . $lang->productplan->linkedStories;?></caption>
<thead>
<tr class='colhead'>
<th class='w-id'> <?php echo $lang->idAB;?></th>
<th class='w-pri'> <?php echo $lang->priAB;?></th>
<th> <?php echo $lang->story->title;?></th>
<th class='w-user'> <?php echo $lang->openedByAB;?></th>
<th class='w-user'> <?php echo $lang->assignedToAB;?></th>
<th class='w-30px'> <?php echo $lang->story->estimateAB;?></th>
<th class='w-status'><?php echo $lang->statusAB;?></th>
<th class='w-60px'> <?php echo $lang->story->stageAB;?></th>
<th class='w-50px {sorter:false}'><?php echo $lang->actions?></th>
</tr>
</thead>
<tbody>
<?php foreach($planStories as $story):?>
<tr>
<td class='a-left'>
<input class='ml-10px' type='checkbox' name='unlinkStories[]' value='<?php echo $story->id;?>'/>
<?php echo html::a($this->createLink('story', 'view', "storyID=$story->id"), $story->id);?>
</td>
<td><span class='<?php echo 'pri' . $story->pri;?>'><?php echo $story->pri?></span></td>
<td class='a-left nobr'><?php echo html::a($this->createLink('story', 'view', "storyID=$story->id"), $story->title);?></td>
<td><?php echo $users[$story->openedBy];?></td>
<td><?php echo $users[$story->assignedTo];?></td>
<td><?php echo $story->estimate;?></td>
<td><?php echo $lang->story->statusList[$story->status];?></td>
<td><?php echo $lang->story->stageList[$story->stage];?></td>
<td><?php common::printIcon('productplan', 'unlinkStory', "story=$story->id", '', 'list', '', 'hiddenwin');?></td>
</tr>
<?php endforeach;?>
<tfoot>
<tr>
<td colspan='9' class='a-left'>
<?php
if(count($planStories) and common::hasPriv('productPlan', 'batchUnlinkStory'))
{
echo html::selectAll('linkedStoriesForm') . html::selectReverse('linkedStoriesForm');
echo html::submitButton($lang->productplan->batchUnlinkStory);
}
?>
</td>
</tr>
</tfoot>
</tbody>
</table>
</form>
<?php include '../../common/view/footer.html.php';?>

View File

@@ -13,84 +13,104 @@
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/tablesorter.html.php';?>
<div id='titlebar' <?php if($plan->deleted) echo "class='deleted'";?>>PLAN #<?php echo $plan->id . ' ' . $plan->title;?></div>
<table class='cont-rt5'>
<tr valign='top'>
<td>
<fieldset>
<legend><?php echo $lang->productplan->desc;?></legend>
<div class='content'><?php echo $plan->desc;?></div>
</fieldset>
<?php include '../../common/view/action.html.php';?>
<div class='a-center f-16px strong'>
<?php
$browseLink = $this->session->productPlanList ? $this->session->productPlanList : inlink('browse', "planID=$plan->id");
if(!$plan->deleted)
{
common::printIcon('productplan', 'linkStory',"planID=$plan->id");
common::printIcon('productplan', 'edit', "planID=$plan->id");
common::printIcon('productplan', 'delete', "planID=$plan->id", '', 'button', '', 'hiddenwin');
}
common::printRPN($browseLink);
?>
</div>
<table class='table-1 tablesorter a-center'>
<caption class='caption-tl'><?php echo $plan->title .$lang->colon . $lang->productplan->linkedStories;?></caption>
<thead>
<tr class='colhead'>
<th class='w-id'><?php echo $lang->idAB;?></th>
<th class='w-pri'><?php echo $lang->priAB;?></th>
<th><?php echo $lang->story->title;?></th>
<th><?php echo $lang->openedByAB;?></th>
<th><?php echo $lang->assignedToAB;?></th>
<th><?php echo $lang->story->estimateAB;?></th>
<th><?php echo $lang->statusAB;?></th>
<th><?php echo $lang->story->stageAB;?></th>
<th class='w-50px {sorter:false}'><?php echo $lang->actions?></th>
</tr>
</thead>
<tbody>
<?php $totalEstimate = 0.0;?>
<?php foreach($planStories as $story):?>
<?php
$viewLink = $this->createLink('story', 'view', "storyID=$story->id");
$totalEstimate += $story->estimate;
?>
<tr>
<td><?php echo html::a($viewLink, $story->id);?></td>
<td><span class='<?php echo 'pri' . $story->pri?>'><?php echo $story->pri;?></span></td>
<td class='a-left nobr'><?php echo html::a($viewLink , $story->title);?></td>
<td><?php echo $users[$story->openedBy];?></td>
<td><?php echo $users[$story->assignedTo];?></td>
<td><?php echo $story->estimate;?></td>
<td><?php echo $lang->story->statusList[$story->status];?></td>
<td><?php echo $lang->story->stageList[$story->stage];?></td>
<td><?php common::printIcon('productplan', 'unlinkStory', "story=$story->id", '', 'list', '', 'hiddenwin');?></td>
<form method='post' target='hiddenwin' action="<?php echo $this->inLink('batchUnlinkStory');?>">
<table class='cont-rt5'>
<tr valign='top'>
<td>
<fieldset>
<legend><?php echo $lang->productplan->desc;?></legend>
<div class='content'><?php echo $plan->desc;?></div>
</fieldset>
<?php include '../../common/view/action.html.php';?>
<div class='a-center f-16px strong'>
<?php
$browseLink = $this->session->productPlanList ? $this->session->productPlanList : inlink('browse', "planID=$plan->id");
if(!$plan->deleted)
{
common::printIcon('productplan', 'linkStory',"planID=$plan->id");
common::printIcon('productplan', 'edit', "planID=$plan->id");
common::printIcon('productplan', 'delete', "planID=$plan->id", '', 'button', '', 'hiddenwin');
}
common::printRPN($browseLink);
?>
</div>
<table class='table-1 tablesorter a-center fixed'>
<caption class='caption-tl'><?php echo $plan->title .$lang->colon . $lang->productplan->linkedStories;?></caption>
<thead>
<tr class='colhead'>
<th class='w-id'> <?php echo $lang->idAB;?></th>
<th class='w-pri'> <?php echo $lang->priAB;?></th>
<th> <?php echo $lang->story->title;?></th>
<th class='w-user'> <?php echo $lang->openedByAB;?></th>
<th class='w-user'> <?php echo $lang->assignedToAB;?></th>
<th class='w-30px'> <?php echo $lang->story->estimateAB;?></th>
<th class='w-status'><?php echo $lang->statusAB;?></th>
<th class='w-60px'> <?php echo $lang->story->stageAB;?></th>
<th class='w-50px {sorter:false}'><?php echo $lang->actions?></th>
</tr>
<?php endforeach;?>
</tbody>
<tfoot><tr><td colspan='9' class='a-right'><?php printf($lang->product->storySummary, count($planStories), $totalEstimate);?> </td></tr></tfoot>
</table>
</td>
<td class="divider"></td>
<td class="side">
<fieldset>
<legend><?php echo $lang->productplan->basicInfo?></legend>
<table class='table-1 a-left'>
</thead>
<tbody>
<?php $totalEstimate = 0.0;?>
<?php foreach($planStories as $story):?>
<?php
$viewLink = $this->createLink('story', 'view', "storyID=$story->id");
$totalEstimate += $story->estimate;
?>
<tr>
<td class='a-left'>
<input class='ml-10px' type='checkbox' name='unlinkStories[]' value='<?php echo $story->id;?>'/>
<?php echo html::a($viewLink, $story->id);?>
</td>
<td><span class='<?php echo 'pri' . $story->pri?>'><?php echo $story->pri;?></span></td>
<td class='a-left nobr'><?php echo html::a($viewLink , $story->title);?></td>
<td><?php echo $users[$story->openedBy];?></td>
<td><?php echo $users[$story->assignedTo];?></td>
<td><?php echo $story->estimate;?></td>
<td><?php echo $lang->story->statusList[$story->status];?></td>
<td><?php echo $lang->story->stageList[$story->stage];?></td>
<td><?php common::printIcon('productplan', 'unlinkStory', "story=$story->id", '', 'list', '', 'hiddenwin');?></td>
</tr>
<?php endforeach;?>
</tbody>
<tfoot>
<tr>
<th width='25%' class='a-right'><?php echo $lang->productplan->title;?></th>
<td><?php echo $plan->title;?></th>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->productplan->begin;?></th>
<td><?php echo $plan->begin;?></th>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->productplan->end;?></th>
<td><?php echo $plan->end;?></th>
<td colspan='9'>
<div class='a-left'>
<?php
if(count($planStories) and common::hasPriv('productPlan', 'batchUnlinkStory'))
{
echo html::selectAll() . html::selectReverse();
echo html::submitButton($lang->productplan->batchUnlinkStory);
}
?>
</div>
<div class='a-right'><?php printf($lang->product->storySummary, count($planStories), $totalEstimate);?> </div>
</td>
</tr>
</tfoot>
</table>
</fieldset>
</td>
</tr>
</table>
</td>
<td class="divider"></td>
<td class="side">
<fieldset>
<legend><?php echo $lang->productplan->basicInfo?></legend>
<table class='table-1 a-left'>
<tr>
<th width='25%' class='a-right'><?php echo $lang->productplan->title;?></th>
<td><?php echo $plan->title;?></th>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->productplan->begin;?></th>
<td><?php echo $plan->begin;?></th>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->productplan->end;?></th>
<td><?php echo $plan->end;?></th>
</tr>
</table>
</fieldset>
</td>
</tr>
</table>
</form>
<?php include '../../common/view/footer.html.php';?>