* finish task #1429.
This commit is contained in:
@@ -25,5 +25,5 @@ function changeAction(formName, actionName, actionLink)
|
||||
$(function()
|
||||
{
|
||||
if(browseType == 'bysearch') ajaxGetSearchForm();
|
||||
$(function(){$('.iframe').colorbox({width:900, height:500, iframe:true, transition:'none', onCleanup:function(){parent.location.href=parent.location.href;}});})
|
||||
loadColorbox('iframe', 'storyList');
|
||||
})
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php if(isonlybody())die(include './storylist.html.php'); ?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php include '../../common/view/treeview.html.php';?>
|
||||
<?php include '../../common/view/colorize.html.php';?>
|
||||
@@ -53,84 +54,7 @@ var browseType = '<?php echo $browseType;?>';
|
||||
</td>
|
||||
<td class='divider <?php echo $treeClass;?>'></td>
|
||||
<td>
|
||||
<table class='table-1 fixed colored tablesorter datatable'>
|
||||
<thead>
|
||||
<tr class='colhead'>
|
||||
<?php $vars = "productID=$productID&browseType=$browseType¶m=$moduleID&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}";?>
|
||||
<th class='w-id'> <?php common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?></th>
|
||||
<th class='w-pri'> <?php common::printOrderLink('pri', $orderBy, $vars, $lang->priAB);?></th>
|
||||
<th class='w-p30'> <?php common::printOrderLink('title', $orderBy, $vars, $lang->story->title);?></th>
|
||||
<th> <?php common::printOrderLink('plan', $orderBy, $vars, $lang->story->planAB);?></th>
|
||||
<th> <?php common::printOrderLink('source', $orderBy, $vars, $lang->story->source);?></th>
|
||||
<th> <?php common::printOrderLink('openedBy', $orderBy, $vars, $lang->openedByAB);?></th>
|
||||
<th> <?php common::printOrderLink('assignedTo', $orderBy, $vars, $lang->assignedToAB);?></th>
|
||||
<th class='w-hour'><?php common::printOrderLink('estimate', $orderBy, $vars, $lang->story->estimateAB);?></th>
|
||||
<th> <?php common::printOrderLink('status', $orderBy, $vars, $lang->statusAB);?></th>
|
||||
<th> <?php common::printOrderLink('stage', $orderBy, $vars, $lang->story->stageAB);?></th>
|
||||
<th class='w-140px {sorter:false}'><?php echo $lang->actions;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($stories as $key => $story):?>
|
||||
<?php
|
||||
$viewLink = $this->createLink('story', 'view', "storyID=$story->id");
|
||||
$canView = common::hasPriv('story', 'view');
|
||||
?>
|
||||
<tr class='a-center'>
|
||||
<td>
|
||||
<input type='checkbox' name='storyIDList[<?php echo $story->id;?>]' value='<?php echo $story->id;?>' />
|
||||
<?php if($canView) echo html::a($viewLink, sprintf('%03d', $story->id)); else printf('%03d', $story->id);?>
|
||||
</td>
|
||||
<td><span class='<?php echo 'pri' . $lang->story->priList[$story->pri];?>'><?php echo $lang->story->priList[$story->pri]?></span></td>
|
||||
<td class='a-left' title="<?php echo $story->title?>"><nobr><?php echo html::a($viewLink, $story->title);?></nobr></td>
|
||||
<td title="<?php echo $story->planTitle?>"><?php echo $story->planTitle;?></td>
|
||||
<td><?php echo $lang->story->sourceList[$story->source];?></td>
|
||||
<td><?php echo $users[$story->openedBy];?></td>
|
||||
<td><?php echo $users[$story->assignedTo];?></td>
|
||||
<td><?php echo $story->estimate;?></td>
|
||||
<td class='<?php echo $story->status;?>'><?php echo $lang->story->statusList[$story->status];?></td>
|
||||
<td><?php echo $lang->story->stageList[$story->stage];?></td>
|
||||
<td class='a-right'>
|
||||
<?php
|
||||
$vars = "story={$story->id}";
|
||||
common::printIcon('story', 'change', $vars, $story, 'list');
|
||||
common::printIcon('story', 'review', $vars, $story, 'list');
|
||||
common::printIcon('story', 'close', $vars, $story, 'list', '', '', 'iframe', true);
|
||||
common::printIcon('story', 'edit', $vars, $story, 'list');
|
||||
common::printIcon('story', 'createCase', "productID=$story->product&module=0&from=¶m=0&$vars", $story, 'list', 'createCase');
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan='11' class='a-right'>
|
||||
<div class='f-left'>
|
||||
<?php
|
||||
if(count($stories))
|
||||
{
|
||||
echo html::selectAll() . html::selectReverse();
|
||||
|
||||
if(common::hasPriv('story', 'batchEdit'))
|
||||
{
|
||||
$actionLink = $this->createLink('story', 'batchEdit', "from=productBrowse&productID=$productID&projectID=0&orderBy=$orderBy");
|
||||
echo html::commonButton($lang->edit, "onclick=\"changeAction('productStoryForm', 'batchEdit', '$actionLink')\"");
|
||||
}
|
||||
if(common::hasPriv('story', 'batchClose') and strtolower($browseType) != 'closedbyme' and strtolower($browseType) != 'closedstory')
|
||||
{
|
||||
$actionLink = $this->createLink('story', 'batchClose', "from=productBrowse&productID=$productID&projectID=0&orderBy=$orderBy");
|
||||
echo html::commonButton($lang->close, "onclick=\"changeAction('productStoryForm', 'batchClose', '$actionLink')\"");
|
||||
}
|
||||
}
|
||||
echo $summary;
|
||||
?>
|
||||
</div>
|
||||
<?php $pager->show();?>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
<?php include "./storylist.html.php";?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
79
module/product/view/storylist.html.php
Normal file
79
module/product/view/storylist.html.php
Normal file
@@ -0,0 +1,79 @@
|
||||
<?php $_GET['onlybody'] = 'no';?>
|
||||
<table class='table-1 fixed colored tablesorter datatable' id='storyList'>
|
||||
<thead>
|
||||
<tr class='colhead'>
|
||||
<?php $vars = "productID=$productID&browseType=$browseType¶m=$moduleID&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}";?>
|
||||
<th class='w-id'> <?php common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?></th>
|
||||
<th class='w-pri'> <?php common::printOrderLink('pri', $orderBy, $vars, $lang->priAB);?></th>
|
||||
<th class='w-p30'> <?php common::printOrderLink('title', $orderBy, $vars, $lang->story->title);?></th>
|
||||
<th> <?php common::printOrderLink('plan', $orderBy, $vars, $lang->story->planAB);?></th>
|
||||
<th> <?php common::printOrderLink('source', $orderBy, $vars, $lang->story->source);?></th>
|
||||
<th> <?php common::printOrderLink('openedBy', $orderBy, $vars, $lang->openedByAB);?></th>
|
||||
<th> <?php common::printOrderLink('assignedTo', $orderBy, $vars, $lang->assignedToAB);?></th>
|
||||
<th class='w-hour'><?php common::printOrderLink('estimate', $orderBy, $vars, $lang->story->estimateAB);?></th>
|
||||
<th> <?php common::printOrderLink('status', $orderBy, $vars, $lang->statusAB);?></th>
|
||||
<th> <?php common::printOrderLink('stage', $orderBy, $vars, $lang->story->stageAB);?></th>
|
||||
<th class='w-140px {sorter:false}'><?php echo $lang->actions;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($stories as $key => $story):?>
|
||||
<?php
|
||||
$viewLink = $this->createLink('story', 'view', "storyID=$story->id");
|
||||
$canView = common::hasPriv('story', 'view');
|
||||
?>
|
||||
<tr class='a-center'>
|
||||
<td>
|
||||
<input type='checkbox' name='storyIDList[<?php echo $story->id;?>]' value='<?php echo $story->id;?>' />
|
||||
<?php if($canView) echo html::a($viewLink, sprintf('%03d', $story->id)); else printf('%03d', $story->id);?>
|
||||
</td>
|
||||
<td><span class='<?php echo 'pri' . $lang->story->priList[$story->pri];?>'><?php echo $lang->story->priList[$story->pri]?></span></td>
|
||||
<td class='a-left' title="<?php echo $story->title?>"><nobr><?php echo html::a($viewLink, $story->title);?></nobr></td>
|
||||
<td title="<?php echo $story->planTitle?>"><?php echo $story->planTitle;?></td>
|
||||
<td><?php echo $lang->story->sourceList[$story->source];?></td>
|
||||
<td><?php echo $users[$story->openedBy];?></td>
|
||||
<td><?php echo $users[$story->assignedTo];?></td>
|
||||
<td><?php echo $story->estimate;?></td>
|
||||
<td class='<?php echo $story->status;?>'><?php echo $lang->story->statusList[$story->status];?></td>
|
||||
<td><?php echo $lang->story->stageList[$story->stage];?></td>
|
||||
<td class='a-right'>
|
||||
<?php
|
||||
$vars = "story={$story->id}";
|
||||
common::printIcon('story', 'change', $vars, $story, 'list');
|
||||
common::printIcon('story', 'review', $vars, $story, 'list');
|
||||
common::printIcon('story', 'close', $vars, $story, 'list', '', '', 'iframe', true);
|
||||
common::printIcon('story', 'edit', $vars, $story, 'list');
|
||||
common::printIcon('story', 'createCase', "productID=$story->product&module=0&from=¶m=0&$vars", $story, 'list', 'createCase');
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan='11' class='a-right'>
|
||||
<div class='f-left'>
|
||||
<?php
|
||||
if(count($stories))
|
||||
{
|
||||
echo html::selectAll() . html::selectReverse();
|
||||
|
||||
if(common::hasPriv('story', 'batchEdit'))
|
||||
{
|
||||
$actionLink = $this->createLink('story', 'batchEdit', "from=productBrowse&productID=$productID&projectID=0&orderBy=$orderBy");
|
||||
echo html::commonButton($lang->edit, "onclick=\"changeAction('productStoryForm', 'batchEdit', '$actionLink')\"");
|
||||
}
|
||||
if(common::hasPriv('story', 'batchClose') and strtolower($browseType) != 'closedbyme' and strtolower($browseType) != 'closedstory')
|
||||
{
|
||||
$actionLink = $this->createLink('story', 'batchClose', "from=productBrowse&productID=$productID&projectID=0&orderBy=$orderBy");
|
||||
echo html::commonButton($lang->close, "onclick=\"changeAction('productStoryForm', 'batchClose', '$actionLink')\"");
|
||||
}
|
||||
}
|
||||
echo $summary;
|
||||
?>
|
||||
</div>
|
||||
<?php $pager->show();?>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
@@ -587,6 +587,7 @@ class story extends control
|
||||
$actionID = $this->action->create('story', $storyID, 'Closed', $this->post->comment, ucfirst($this->post->closedReason));
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
$this->sendMail($storyID, $actionID);
|
||||
if(isonlybody()) die(js::closeColorbox('parent.parent'));
|
||||
die(js::locate(inlink('view', "storyID=$storyID"), 'parent'));
|
||||
}
|
||||
|
||||
|
||||
@@ -708,15 +708,13 @@ class storyModel extends model
|
||||
*/
|
||||
public function getProductStories($productID = 0, $moduleIds = 0, $status = 'all', $orderBy = 'id_desc', $pager = null)
|
||||
{
|
||||
return $this->dao->select('t1.*, t2.title as planTitle, t3.verify, t3.spec')
|
||||
return $this->dao->select('t1.*, t2.title as planTitle')
|
||||
->from(TABLE_STORY)->alias('t1')
|
||||
->leftJoin(TABLE_PRODUCTPLAN)->alias('t2')->on('t1.plan = t2.id')
|
||||
->leftJoin(TABLE_STORYSPEC)->alias('t3')->on('t1.id = t3.story')
|
||||
->where('t1.product')->in($productID)
|
||||
->beginIF(!empty($moduleIds))->andWhere('module')->in($moduleIds)->fi()
|
||||
->beginIF($status != 'all')->andWhere('status')->in($status)->fi()
|
||||
->andWhere('t1.deleted')->eq(0)
|
||||
->andWhere('t3.version=t1.version')
|
||||
->orderBy($orderBy)->page($pager)->fetchAll();
|
||||
}
|
||||
|
||||
@@ -1027,17 +1025,15 @@ class storyModel extends model
|
||||
*/
|
||||
public function getUserStories($account, $type = 'assignedTo', $orderBy = 'id_desc', $pager = null)
|
||||
{
|
||||
$stories = $this->dao->select('t1.*, t2.title as planTitle, t3.name as productTitle, t4.spec, t4.verify')
|
||||
$stories = $this->dao->select('t1.*, t2.title as planTitle, t3.name as productTitle')
|
||||
->from(TABLE_STORY)->alias('t1')
|
||||
->leftJoin(TABLE_PRODUCTPLAN)->alias('t2')->on('t1.plan = t2.id')
|
||||
->leftJoin(TABLE_PRODUCT)->alias('t3')->on('t1.product = t3.id')
|
||||
->leftJoin(TABLE_STORYSPEC)->alias('t4')->on('t1.id = t4.story')
|
||||
->where('t1.deleted')->eq(0)
|
||||
->beginIF($type == 'assignedTo')->andWhere('assignedTo')->eq($account)->fi()
|
||||
->beginIF($type == 'openedBy')->andWhere('openedBy')->eq($account)->fi()
|
||||
->beginIF($type == 'reviewedBy')->andWhere('reviewedBy')->like('%' . $account . '%')->fi()
|
||||
->beginIF($type == 'closedBy')->andWhere('closedBy')->eq($account)->fi()
|
||||
->andWhere('t4.version=t1.version')
|
||||
->orderBy($orderBy)
|
||||
->page($pager)
|
||||
->fetchAll();
|
||||
|
||||
@@ -834,11 +834,8 @@ function loadColorbox(colorboxClass, replaceID)
|
||||
onCleanup:function()
|
||||
{
|
||||
saveWindowSize();
|
||||
var link = self.location.href;
|
||||
var onlybody = config.requestType == 'PATH_INFO' ? "?onlybody=yes" : '&onlybody=yes';
|
||||
|
||||
link = link + onlybody;
|
||||
$.get(link, function(data)
|
||||
var link = self.location.href;
|
||||
$.get(link, {onlybody:"yes"}, function(data)
|
||||
{
|
||||
$('#' + replaceID).replaceWith(data)
|
||||
loadColorbox(colorboxClass, replaceID)
|
||||
|
||||
Reference in New Issue
Block a user