* code for task#1528.

This commit is contained in:
chencongzhi520@gmail.com
2013-07-11 07:02:43 +00:00
parent 8aca120201
commit 4f060ab0fd
9 changed files with 97 additions and 39 deletions
+5 -2
View File
@@ -36,11 +36,14 @@
</tr>
</thead>
<tbody>
<?php $canBatchEdit = common::hasPriv('bug', 'batchEdit');?>
<?php foreach($bugs as $bug):?>
<?php $bugLink = inlink('view', "bugID=$bug->id");?>
<tr class='a-center'>
<td class='<?php echo $bug->status;?>' style="font-weight:bold">
<?php if($canBatchEdit):?>
<input type='checkbox' name='bugIDList[]' value='<?php echo $bug->id;?>'/>
<?php endif;?>
<?php echo html::a($bugLink, sprintf('%03d', $bug->id));?>
</td>
<td><span class='<?php echo 'severity' . $bug->severity;?>'><?php echo $bug->severity;?></span></td>
@@ -93,11 +96,11 @@
if($browseType == 'needconfirm') $columns = $this->cookie->windowWidth >= $this->config->wideSize ? 7 : 6;
?>
<td colspan='<?php echo $columns;?>'>
<?php if(!empty($bugs)):?>
<?php if(!empty($bugs) and $canBatchEdit):?>
<div class='f-left'>
<?php
echo html::selectAll() . html::selectReverse();
if(common::hasPriv('bug', 'batchEdit') and $bugs) echo html::submitButton($lang->edit);
echo html::submitButton($lang->edit);
?>
</div>
<?php endif?>
+13 -4
View File
@@ -48,9 +48,18 @@ js::set('deptID', $deptID);
</thead>
<tbody>
<form action='<?php echo $this->createLink('user', 'batchEdit', "deptID=$deptID")?>' method='post' id='userListForm'>
<?php
$canBatchEdit = common::hasPriv('user', 'batchEdit');
$canManageContacts = common::hasPriv('user', 'manageContacts');
?>
<?php foreach($users as $user):?>
<tr class='a-center'>
<td><?php echo "<input type='checkbox' name='users[]' value='$user->account'> "; printf('%03d', $user->id);?></td>
<td>
<?php
if($canBatchEdit or $canManageContacts) echo "<input type='checkbox' name='users[]' value='$user->account'> ";
printf('%03d', $user->id);
?>
</td>
<td><?php if(!common::printLink('user', 'view', "account=$user->account", $user->realname)) echo $user->realname;?></td>
<td><?php echo $user->account;?></td>
<td><?php echo $lang->user->roleList[$user->role];?></td>
@@ -78,9 +87,9 @@ js::set('deptID', $deptID);
<tr>
<td colspan='12'>
<?php
echo html::selectAll() . html::selectReverse();
echo html::submitButton($lang->edit, 'onclick=batchEdit()');
echo html::submitButton($lang->user->contacts->manage, 'onclick=manageContacts()');
if($canBatchEdit or $canManageContacts) echo html::selectAll() . html::selectReverse();
if($canBatchEdit) echo html::submitButton($lang->edit, 'onclick=batchEdit()');
if($canManageContacts) echo html::submitButton($lang->user->contacts->manage, 'onclick=manageContacts()');
$pager->show();
?>
</td>
+9 -3
View File
@@ -17,6 +17,10 @@
</tr>
</thead>
<tbody>
<?php
$canBatchEdit = common::hasPriv('story', 'batchEdit');
$canBatchClose = common::hasPriv('story', 'batchClose') and strtolower($browseType) != 'closedbyme' and strtolower($browseType) != 'closedstory';
?>
<?php foreach($stories as $key => $story):?>
<?php
$viewLink = $this->createLink('story', 'view', "storyID=$story->id");
@@ -24,7 +28,9 @@
?>
<tr class='a-center'>
<td>
<?php if($canBatchEdit or $canBatchClose):?>
<input type='checkbox' name='storyIDList[<?php echo $story->id;?>]' value='<?php echo $story->id;?>' />
<?php endif;?>
<?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>
@@ -56,14 +62,14 @@
<?php
if(count($stories))
{
echo html::selectAll() . html::selectReverse();
if($canBatchEdit or $canBatchClose) echo html::selectAll() . html::selectReverse();
if(common::hasPriv('story', 'batchEdit'))
if($canBatchEdit)
{
$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')
if($canBatchClose)
{
$actionLink = $this->createLink('story', 'batchClose', "from=productBrowse&productID=$productID&projectID=0&orderBy=$orderBy");
echo html::commonButton($lang->close, "onclick=\"changeAction('productStoryForm', 'batchClose', '$actionLink')\"");
+9 -7
View File
@@ -77,11 +77,14 @@
</tr>
</thead>
<tbody>
<?php $canBatchUnlink = common::hasPriv('productPlan', 'batchUnlinkStory');?>
<?php foreach($planStories as $story):?>
<tr>
<td class='a-left'>
<td class='a-center'>
<?php if($canBatchUnlink):?>
<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);?>
<?php endif;?>
<?php echo html::a($this->createLink('story', 'view', "storyID=$story->id"), sprintf("%03d", $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>
@@ -93,19 +96,18 @@
<td><?php common::printIcon('productplan', 'unlinkStory', "story=$story->id", '', 'list', '', 'hiddenwin');?></td>
</tr>
<?php endforeach;?>
<?php if(count($planStories) and $canBatchUnlink):?>
<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);
}
echo html::selectAll('linkedStoriesForm') . html::selectReverse('linkedStoriesForm');
echo html::submitButton($lang->productplan->batchUnlinkStory);
?>
</td>
</tr>
</tfoot>
<?php endif;?>
</tbody>
</table>
</form>
+12 -7
View File
@@ -73,16 +73,21 @@
</tr>
</thead>
<tbody>
<?php $totalEstimate = 0.0;?>
<?php
$totalEstimate = 0.0;
$canBatchUnlink = common::hasPriv('productPlan', 'batchUnlinkStory');
?>
<?php foreach($planStories as $story):?>
<?php
$viewLink = $this->createLink('story', 'view', "storyID=$story->id");
$totalEstimate += $story->estimate;
?>
$viewLink = $this->createLink('story', 'view', "storyID=$story->id");
$totalEstimate += $story->estimate;
?>
<tr>
<td class='a-left'>
<td class='a-center'>
<?php if($canBatchUnlink):?>
<input class='ml-10px' type='checkbox' name='unlinkStories[]' value='<?php echo $story->id;?>'/>
<?php echo html::a($viewLink, $story->id);?>
<?php endif;?>
<?php echo html::a($viewLink, sprintf("%03d", $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>
@@ -100,7 +105,7 @@
<td colspan='9'>
<div class='a-left'>
<?php
if(count($planStories) and common::hasPriv('productPlan', 'batchUnlinkStory'))
if(count($planStories) and $canBatchUnlink)
{
echo html::selectAll() . html::selectReverse();
echo html::submitButton($lang->productplan->batchUnlinkStory);
+10 -4
View File
@@ -43,7 +43,11 @@
</tr>
</thead>
<tbody>
<?php $totalEstimate = 0;?>
<?php
$totalEstimate = 0;
$canBatchEdit = common::hasPriv('story', 'batchEdit');
$canBatchClose = common::hasPriv('story', 'batchClose');
?>
<?php foreach($stories as $key => $story):?>
<?php
$storyLink = $this->createLink('story', 'view', "storyID=$story->id");
@@ -51,7 +55,9 @@
?>
<tr class='a-center'>
<td>
<?php if($canBatchEdit or $canBatchClose):?>
<input type='checkbox' name='storyIDList[<?php echo $story->id;?>]' value='<?php echo $story->id;?>' />
<?php endif;?>
<?php echo html::a($storyLink, sprintf('%03d', $story->id));?>
</td>
<td><span class='<?php echo 'pri' . $lang->story->priList[$story->pri]?>'><?php echo $lang->story->priList[$story->pri];?></span></td>
@@ -91,14 +97,14 @@
<?php
if(count($stories))
{
echo html::selectAll() . html::selectReverse();
if($canBatchEdit or $canBatchClose) echo html::selectAll() . html::selectReverse();
if(common::hasPriv('story', 'batchEdit'))
if($canBatchEdit)
{
$actionLink = $this->createLink('story', 'batchEdit', "from=projectStory&productID=0&projectID=$project->id&orderBy=$orderBy");
echo html::commonButton($lang->edit, "onclick=\"changeAction('projectStoryForm', 'batchEdit', '$actionLink')\"");
}
if(common::hasPriv('story', 'batchClose'))
if($canBatchClose)
{
$actionLink = $this->createLink('story', 'batchClose', "from=projectStory&productID=0&projectID=$project->id&orderBy=$orderBy");
echo html::commonButton($lang->close, "onclick=\"changeAction('projectStoryForm', 'batchClose', '$actionLink')\"");
+9 -3
View File
@@ -28,11 +28,17 @@
</tr>
</thead>
<tbody>
<?php
$canBatchEdit = common::hasPriv('task', 'batchEdit');
$canBatchClose = common::hasPriv('task', 'batchClose') and strtolower($browseType) != 'closedBy';
?>
<?php foreach($tasks as $task):?>
<?php $class = $task->assignedTo == $app->user->account ? 'style=color:red' : ''; ?>
<tr class='a-center'>
<td>
<?php if($canBatchEdit or $canBatchClose):?>
<input type='checkbox' name='taskIDList[]' value='<?php echo $task->id;?>'/>
<?php endif;?>
<?php if(!common::printLink('task', 'view', "task=$task->id", sprintf('%03d', $task->id))) printf('%03d', $task->id);?>
</td>
<td><span class='<?php echo 'pri'. $lang->task->priList[$task->pri]?>'><?php echo $lang->task->priList[$task->pri];?></span></td>
@@ -102,14 +108,14 @@
<?php
if(count($tasks))
{
echo html::selectAll() . html::selectReverse();
if($canBatchEdit or $canBatchClose) echo html::selectAll() . html::selectReverse();
if(common::hasPriv('task', 'batchEdit'))
if($canBatchEdit)
{
$actionLink = $this->createLink('task', 'batchEdit', "projectID=$projectID&from=projectTask&orderBy=$orderBy");
echo html::commonButton($lang->edit, "onclick=\"changeAction('projectTaskForm', 'batchEdit', '$actionLink')\"");
}
if(common::hasPriv('task', 'batchClose') and strtolower($browseType) != 'closedBy')
if($canBatchClose)
{
$actionLink = $this->createLink('task', 'batchClose');
echo html::commonButton($lang->close, "onclick=\"changeAction('projectTaskForm', 'batchClose', '$actionLink')\"");
+9 -3
View File
@@ -19,11 +19,17 @@
<th class='w-150px {sorter:false}'><?php echo $lang->actions;?></th>
<?php endif;?>
</tr>
<?php
$canBatchEdit = common::hasPriv('testcase', 'batchEdit');
$canBatchClose = common::hasPriv('testtask', 'batchRun');
?>
<?php foreach($cases as $case):?>
<tr class='a-center'>
<?php $viewLink = inlink('view', "caseID=$case->id");?>
<td>
<?php if($canBatchEdit or $canBatchClose):?>
<input type='checkbox' name='caseIDList[]' value='<?php echo $case->id;?>'/>
<?php endif;?>
<?php echo html::a($viewLink, sprintf('%03d', $case->id));?>
</td>
<td><span class='<?php echo 'pri' . $case->pri?>'><?php echo $case->pri?></span></td>
@@ -59,9 +65,9 @@
<?php if($cases):?>
<div class='f-left'>
<?php
echo html::selectAll() . html::selectReverse();
if(common::hasPriv('testcase', 'batchEdit'))echo html::submitButton($lang->edit, "onclick='changeAction(\"" . inLink('batchEdit', "from=testcaseBrowse&productID=$productID&orderBy=$orderBy") . "\")'");
if(common::hasPriv('testtask', 'batchRun')) echo html::submitButton($lang->testtask->runCase, "onclick='changeAction(\"" . $this->createLink('testtask', 'batchRun', "productID=$productID&orderBy=$orderBy") . "\")'");
if($canBatchEdit or $canBatchClose) echo html::selectAll() . html::selectReverse();
if($canBatchEdit) echo html::submitButton($lang->edit, "onclick='changeAction(\"" . inLink('batchEdit', "from=testcaseBrowse&productID=$productID&orderBy=$orderBy") . "\")'");
if($canBatchClose) echo html::submitButton($lang->testtask->runCase, "onclick='changeAction(\"" . $this->createLink('testtask', 'batchRun', "productID=$productID&orderBy=$orderBy") . "\")'");
?>
</div>
<?php endif?>
+21 -6
View File
@@ -60,9 +60,19 @@ var moduleID = '<?php echo $moduleID;?>';
</tr>
</thead>
<tbody>
<?php
$canBatchEdit = common::hasPriv('testcase', 'batchEdit');
$canBatchAssign = common::hasPriv('testtask', 'batchAssign');
$canBatchRun = common::hasPriv('testtask', 'batchRun');
?>
<?php foreach($runs as $run):?>
<tr class='a-center'>
<td class='a-left'><input type='checkbox' name='caseIDList[]' value='<?php echo $run->case;?>'/> <?php printf('%03d', $run->case);?></td>
<td class='a-left'>
<?php if($canBatchEdit or $canBatchAssign or $canBatchRun):?>
<input type='checkbox' name='caseIDList[]' value='<?php echo $run->case;?>'/>
<?php endif;?>
<?php printf('%03d', $run->case);?>
</td>
<td><span class='<?php echo 'pri' . $run->pri?>'><?php echo $run->pri?></span></td>
<td class='a-left nobr'><?php echo html::a($this->createLink('testcase', 'view', "caseID=$run->case&version=$run->version"), $run->title, '_blank');?>
</td>
@@ -88,17 +98,22 @@ var moduleID = '<?php echo $moduleID;?>';
<td colspan='10'>
<?php if($runs):?>
<div class='f-left'>
<?php
echo html::selectAll() . html::selectReverse();
if(common::hasPriv('testcase', 'batchEdit')):
?>
<?php if($canBatchEdit or $canBatchAssign or $canBatchRun) echo html::selectAll() . html::selectReverse(); ?>
<?php if($canBatchEdit):?>
<input class='button-s' value="<?php echo $lang->edit; ?>" type="button" onclick="casesform.action='<?php echo $this->createLink('testcase', 'batchEdit', "from=testtaskCases&productID=$productID");?>';casesform.submit();">
<?php endif;?>
<?php if(common::hasPriv('testtask', 'batchAssign')):?>
<?php if($canBatchAssign):?>
<?php echo html::select('assignedTo', $users);?>
<input class='button-s' value="<?php echo $lang->testtask->assign; ?>" type="button" onclick="casesform.action='<?php echo inLink('batchAssign', "taskID=$task->id");?>';casesform.submit();">
<?php endif;?>
<?php if($canBatchRun):?>
<input class='button-s' value="<?php echo $lang->testtask->runCase; ?>" type="button" onclick="casesform.action='<?php echo inLink('batchRUN', "productID=$productID&orderBy=id_desc&from=testtask");?>';casesform.submit();">
<?php endif;?>
</div>
<?php endif;?>
<?php echo $pager->show();?>