This commit is contained in:
tianshujie98
2020-08-13 09:38:57 +08:00
parent ada770c792
commit 595e3e35c4
18 changed files with 194 additions and 81 deletions
+1 -1
View File
@@ -2494,7 +2494,7 @@ class bugModel extends model
$canBatchResolve = common::hasPriv('bug', 'batchResolve');
$canBatchAssignTo = common::hasPriv('bug', 'batchAssignTo');
$canBatchAction = $canBatchEdit or $canBatchConfirm or $canBatchClose or $canBatchActivate or $canBatchChangeBranch or $canBatchChangeModule or $canBatchResolve or $canBatchAssignTo;
$canBatchAction = ($canBatchEdit or $canBatchConfirm or $canBatchClose or $canBatchActivate or $canBatchChangeBranch or $canBatchChangeModule or $canBatchResolve or $canBatchAssignTo);
$canView = common::hasPriv('bug', 'view');
+25 -12
View File
@@ -206,6 +206,17 @@ $currentBrowseType = isset($lang->bug->mySelects[$browseType]) && in_array($brow
$setting = $this->datatable->getSetting('bug');
$widths = $this->datatable->setFixedFieldWidth($setting);
$columns = 0;
$canBatchEdit = common::hasPriv('bug', 'batchEdit');
$canBatchConfirm = common::hasPriv('bug', 'batchConfirm');
$canBatchClose = common::hasPriv('bug', 'batchClose');
$canBatchActivate = common::hasPriv('bug', 'batchActivate');
$canBatchChangeBranch = common::hasPriv('bug', 'batchChangeBranch');
$canBatchChangeModule = common::hasPriv('bug', 'batchChangeModule');
$canBatchResolve = common::hasPriv('bug', 'batchResolve');
$canBatchAssignTo = common::hasPriv('bug', 'batchAssignTo');
$canBatchAction = ($canBatchEdit or $canBatchConfirm or $canBatchClose or $canBatchActivate or $canBatchChangeBranch or $canBatchChangeModule or $canBatchResolve or $canBatchAssignTo);
?>
<?php if(!$useDatatable) echo '<div class="table-responsive">';?>
<table class='table has-sort-head<?php if($useDatatable) echo ' datatable';?>' id='bugList' data-fixed-left-width='<?php echo $widths['leftWidth']?>' data-fixed-right-width='<?php echo $widths['rightWidth']?>'>
@@ -219,7 +230,7 @@ $currentBrowseType = isset($lang->bug->mySelects[$browseType]) && in_array($brow
if(common::checkNotCN() and $value->id == 'severity') $value->name = $lang->bug->severity;
if(common::checkNotCN() and $value->id == 'pri') $value->name = $lang->bug->pri;
if(common::checkNotCN() and $value->id == 'confirmed') $value->name = $lang->bug->confirmed;
$this->datatable->printHead($value, $orderBy, $vars);
$this->datatable->printHead($value, $orderBy, $vars, $canBatchAction);
$columns ++;
}
}
@@ -236,33 +247,35 @@ $currentBrowseType = isset($lang->bug->mySelects[$browseType]) && in_array($brow
</table>
<?php if(!$useDatatable) echo '</div>';?>
<div class='table-footer'>
<?php if($canBatchAction):?>
<div class="checkbox-primary check-all"><label><?php echo $lang->selectAll?></label></div>
<?php endif;?>
<div class="table-actions btn-toolbar">
<div class='btn-group dropup'>
<?php
$actionLink = $this->createLink('bug', 'batchEdit', "productID=$productID&branch=$branch");
$misc = common::hasPriv('bug', 'batchEdit') ? "onclick=\"setFormAction('$actionLink')\"" : "disabled='disabled'";
$misc = $canBatchEdit ? "onclick=\"setFormAction('$actionLink')\"" : "disabled='disabled'";
echo html::commonButton($lang->edit, $misc);
?>
<button type='button' class='btn dropdown-toggle' data-toggle='dropdown'><span class='caret'></span></button>
<ul class='dropdown-menu'>
<?php
$class = common::hasPriv('bug', 'batchConfirm') ? '' : "class='disabled'";
$class = $canBatchConfirm ? '' : "class='disabled'";
$actionLink = $this->createLink('bug', 'batchConfirm');
$misc = common::hasPriv('bug', 'batchConfirm') ? "onclick=\"setFormAction('$actionLink', 'hiddenwin')\"" : '';
$misc = $canBatchConfirm ? "onclick=\"setFormAction('$actionLink', 'hiddenwin')\"" : '';
echo "<li $class>" . html::a('javascript:;', $lang->bug->confirmBug, '', $misc) . "</li>";
$class = common::hasPriv('bug', 'batchClose') ? '' : "class='disabled'";
$class = $canBatchClose ? '' : "class='disabled'";
$actionLink = $this->createLink('bug', 'batchClose');
$misc = common::hasPriv('bug', 'batchClose') ? "onclick=\"setFormAction('$actionLink', 'hiddenwin')\"" : '';
$misc = $canBatchClose ? "onclick=\"setFormAction('$actionLink', 'hiddenwin')\"" : '';
echo "<li $class>" . html::a('javascript:;', $lang->bug->close, '', $misc) . "</li>";
$class = common::hasPriv('bug', 'batchActivate') ? '' : "class='disabled'";
$class = $canBatchActivate ? '' : "class='disabled'";
$actionLink = $this->createLink('bug', 'batchActivate', "productID=$productID&branch=$branch");
$misc = common::hasPriv('bug', 'batchActivate') ? "onclick=\"setFormAction('$actionLink')\"" : '';
$misc = $canBatchActivate ? "onclick=\"setFormAction('$actionLink')\"" : '';
echo "<li $class>" . html::a('javascript:;', $lang->bug->activate, '', $misc) . "</li>";
$misc = common::hasPriv('bug', 'batchResolve') ? "id='resolveItem'" : '';
$misc = $canBatchResolve ? "id='resolveItem'" : '';
if($misc)
{
echo "<li class='dropdown-submenu'>" . html::a('javascript:;', $lang->bug->resolve, '', $misc);
@@ -302,7 +315,7 @@ $currentBrowseType = isset($lang->bug->mySelects[$browseType]) && in_array($brow
?>
</ul>
</div>
<?php if(common::hasPriv('bug', 'batchChangeBranch') and $this->session->currentProductType != 'normal'):?>
<?php if($canBatchChangeBranch and $this->session->currentProductType != 'normal'):?>
<div class="btn-group dropup">
<button data-toggle="dropdown" type="button" class="btn"><?php echo $lang->product->branchName[$this->session->currentProductType];?> <span class="caret"></span></button>
<?php $withSearch = count($branches) > 8;?>
@@ -330,7 +343,7 @@ $currentBrowseType = isset($lang->bug->mySelects[$browseType]) && in_array($brow
</div>
</div>
<?php endif;?>
<?php if(common::hasPriv('bug', 'batchChangeModule')):?>
<?php if($canBatchChangeModule):?>
<div class="btn-group dropup">
<button data-toggle="dropdown" type="button" class="btn"><?php echo $lang->bug->moduleAB;?> <span class="caret"></span></button>
<?php $withSearch = count($modules) > 8;?>
@@ -358,7 +371,7 @@ $currentBrowseType = isset($lang->bug->mySelects[$browseType]) && in_array($brow
</div>
</div>
<?php endif;?>
<?php if(common::hasPriv('bug', 'batchAssignTo')):?>
<?php if($canBatchAssignTo):?>
<div class="btn-group dropup">
<button data-toggle="dropdown" type="button" class="btn"><?php echo $lang->bug->assignedTo;?> <span class="caret"></span></button>
<?php $withSearch = count($memberPairs) > 10;?>
+3 -1
View File
@@ -97,7 +97,7 @@ js::set('flow', $config->global->flow);
<?php $canBatchDelete = common::hasPriv('testcase', 'batchDelete');?>
<?php $canBatchReview = common::hasPriv('testcase', 'batchReview') and ($config->testcase->needReview or !empty($config->testcase->forceReview));?>
<?php $canBatchChangeModule = common::hasPriv('testcase', 'batchChangeModule');?>
<?php $canBatchAction = $canBatchEdit or $canBatchDelete or $canBatchReview or $canBatchChangeModule;?>
<?php $canBatchAction = ($canBatchEdit or $canBatchDelete or $canBatchReview or $canBatchChangeModule);?>
<?php $vars = "libID=$libID&browseType=$browseType&param=$param&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}";?>
<div class="table-responsive">
<table class='table has-sort-head' id='caseList'>
@@ -155,7 +155,9 @@ js::set('flow', $config->global->flow);
</table>
</div>
<div class='table-footer'>
<?php if($canBatchAction):?>
<div class="checkbox-primary check-all"><label><?php echo $lang->selectAll?></label></div>
<?php endif;?>
<div class="table-actions btn-toolbar">
<div class='btn-group dropup'>
<?php $actionLink = $this->createLink('testcase', 'batchEdit', "libID=$libID&branch=0&type=lib");?>
+14 -8
View File
@@ -29,13 +29,20 @@
</div>
<?php else:?>
<form id='myBugForm' class="main-table table-bug" data-ride="table" method="post" action='<?php echo $this->createLink('bug', 'batchEdit', "productID=0");?>'>
<?php $canBatchEdit = common::hasPriv('bug', 'batchEdit');?>
<?php
$canBatchEdit = common::hasPriv('bug', 'batchEdit');
$canBatchConfirm = common::hasPriv('bug', 'batchConfirm');
$canBatchClose = (common::hasPriv('bug', 'batchClose') and strtolower($type) != 'closedby');
$canBatchAssignTo = common::hasPriv('bug', 'batchAssignTo');
$canBatchAction = ($canBatchEdit or $canBatchConfirm or $canBatchClose or $canBatchAssignTo);
?>
<table class="table has-sort-head table-fixed" id='bugList'>
<?php $vars = "type=$type&orderBy=%s&recTotal=$recTotal&recPerPage=$recPerPage&pageID=$pageID"; ?>
<thead>
<tr>
<th class="w-100px">
<?php if($canBatchEdit):?>
<?php if($canBatchAction):?>
<div class="checkbox-primary check-all" title="<?php echo $lang->selectAll?>">
<label></label>
</div>
@@ -68,7 +75,7 @@
<?php foreach($bugs as $bug):?>
<tr>
<td class="c-id">
<?php if($canBatchEdit):?>
<?php if($canBatchAction):?>
<div class="checkbox-primary">
<input type='checkbox' name='bugIDList[]' value='<?php echo $bug->id;?>' />
<label></label>
@@ -105,23 +112,23 @@
</tbody>
</table>
<div class="table-footer">
<?php if($canBatchEdit):?>
<?php if($canBatchAction):?>
<div class="checkbox-primary check-all"><label><?php echo $lang->selectAll?></label></div>
<?php endif;?>
<div class="table-actions btn-toolbar">
<?php
$actionLink = $this->createLink('bug', 'batchEdit');
$misc = common::hasPriv('bug', 'batchEdit') ? "onclick=\"setFormAction('$actionLink')\"" : "disabled='disabled'";
$misc = $canBatchEdit ? "onclick=\"setFormAction('$actionLink')\"" : "disabled='disabled'";
echo html::commonButton($lang->edit, $misc);
?>
<?php
if(common::hasPriv('bug', 'batchConfirm'))
if($canBatchConfirm)
{
$actionLink = $this->createLink('bug', 'batchConfirm');
$misc = "onclick=\"setFormAction('$actionLink', 'hiddenwin')\"";
echo html::commonButton($lang->bug->confirmBug, $misc);
}
if(common::hasPriv('bug', 'batchClose'))
if($canBatchClose)
{
$actionLink = $this->createLink('bug', 'batchClose');
$misc = "onclick=\"setFormAction('$actionLink', 'hiddenwin')\"";
@@ -129,7 +136,6 @@
}
?>
<?php
$canBatchAssignTo = common::hasPriv('bug', 'batchAssignTo');
if($canBatchAssignTo && count($bugs)):?>
<div class="btn-group dropup">
<button data-toggle="dropdown" type="button" class="btn"><?php echo $lang->bug->assignedTo?> <span class="caret"></span></button>
+12 -8
View File
@@ -32,13 +32,17 @@
<table class="table has-sort-head table-fixed">
<?php $vars = "type=$type&orderBy=%s&recTotal=$recTotal&recPerPage=$recPerPage&pageID=$pageID"; ?>
<?php
$canBatchEdit = common::hasPriv('story', 'batchEdit');
$canBatchClose = (common::hasPriv('story', 'batchClose') && strtolower($type) != 'closedbyme');
$canBatchEdit = common::hasPriv('story', 'batchEdit');
$canBatchClose = (common::hasPriv('story', 'batchClose') and strtolower($type) != 'closedby');
$canBatchReview = common::hasPriv('story', 'batchReview');
$canBatchAssignTo = common::hasPriv('story', 'batchAssignTo');
$canBatchAction = ($canBatchEdit or $canBatchClose or $canBatchReview or $canBatchAssignTo);
?>
<thead>
<tr>
<th class="c-id">
<?php if($canBatchEdit or $canBatchClose):?>
<?php if($canBatchAction):?>
<div class="checkbox-primary check-all" title="<?php echo $lang->selectAll?>">
<label></label>
</div>
@@ -61,7 +65,7 @@
<?php $storyLink = $this->createLink('story', 'view', "id=$story->id");?>
<tr>
<td class="c-id">
<?php if($canBatchEdit or $canBatchClose):?>
<?php if($canBatchAction):?>
<div class="checkbox-primary">
<input type='checkbox' name='storyIdList[<?php echo $story->id;?>]' value='<?php echo $story->id;?>' />
<label></label>
@@ -92,7 +96,7 @@
</tbody>
</table>
<div class="table-footer">
<?php if($canBatchEdit or $canBatchClose):?>
<?php if($canBatchAction):?>
<div class="checkbox-primary check-all"><label><?php echo $lang->selectAll?></label></div>
<?php endif;?>
<div class="table-actions btn-toolbar">
@@ -104,7 +108,7 @@
echo html::commonButton($lang->edit, $misc);
}
?>
<?php if(common::hasPriv('story', 'batchReview')):?>
<?php if($canBatchReview):?>
<div class="btn-group dropup">
<button type='button' class='btn' data-toggle='dropdown'><?php echo $lang->story->review;?> <span class='caret'></span></button>
<ul class='dropdown-menu'>
@@ -141,7 +145,7 @@
</ul>
</div>
<?php endif;?>
<?php if(common::hasPriv('story', 'batchAssignTo')):?>
<?php if($canBatchAssignTo):?>
<div class="btn-group dropup">
<button data-toggle="dropdown" type="button" class="btn"><?php echo $lang->story->assignedTo?> <span class="caret"></span></button>
<?php
@@ -174,7 +178,7 @@
?>
</div>
<?php endif;?>
<?php if($canBatchClose and $type != 'closedBy'):?>
<?php if($canBatchClose):?>
<?php
$actionLink = $this->createLink('story', 'batchClose');
$misc = "data-form-action=\"$actionLink\"";
+13 -8
View File
@@ -52,12 +52,19 @@
</div>
<?php else:?>
<form class="main-table table-todo" data-ride="table" method="post">
<?php
$canBatchEdit = common::hasPriv('todo', 'batchEdit');
$canBatchFinish = common::hasPriv('todo', 'batchFinish');
$canBatchClose = common::hasPriv('todo', 'batchClose');
$canbatchAction = ($type != 'cycle' and ($canBatchEdit or $canBatchFinish or $canBatchClose or (common::hasPriv('todo', 'import2Today') and $importFuture)));
?>
<table class="table has-sort-head" id='todoList'>
<?php $vars = "type=$type&account=$account&status=$status&orderBy=%s&recTotal=$recTotal&recPerPage=$recPerPage&pageID=$pageID"; ?>
<thead>
<tr>
<th class="w-100px">
<?php if($type != 'cycle' and (common::hasPriv('todo', 'batchEdit') or (common::hasPriv('todo', 'import2Today') and $importFuture))):?>
<?php if($canbatchAction):?>
<div class="checkbox-primary check-all" title="<?php echo $lang->selectAll?>">
<label></label>
</div>
@@ -79,7 +86,7 @@
<?php foreach($todos as $todo):?>
<tr>
<td class="c-id">
<?php if($type != 'cycle' and (common::hasPriv('todo', 'batchEdit') or (common::hasPriv('todo', 'import2Today') and $importFuture))):?>
<?php if($canbatchAction):?>
<div class="checkbox-primary">
<input type='checkbox' name='todoIDList[<?php echo $todo->id;?>]' value='<?php echo $todo->id;?>' />
<label></label>
@@ -128,23 +135,22 @@
</tbody>
</table>
<div class="table-footer">
<?php if($type != 'cycle'):?>
<?php if(common::hasPriv('todo', 'batchEdit') or (common::hasPriv('todo', 'import2Today') and $importFuture)):?>
<?php if($canbatchAction):?>
<div class="checkbox-primary check-all"><label><?php echo $lang->selectAll?></label></div>
<?php endif;?>
<div class="table-actions btn-toolbar">
<?php
if(common::hasPriv('todo', 'batchEdit'))
if($canBatchEdit)
{
$actionLink = $this->createLink('todo', 'batchEdit', "from=myTodo&type=$type&account=$account&status=$status");
echo html::commonButton($lang->edit, "onclick=\"setFormAction('$actionLink')\"");
}
if(common::hasPriv('todo', 'batchFinish'))
if($canBatchFinish)
{
$actionLink = $this->createLink('todo', 'batchFinish');
echo html::commonButton($lang->todo->finish, "onclick=\"setFormAction('$actionLink', 'hiddenwin')\"");
}
if(common::hasPriv('todo', 'batchClose'))
if($canBatchClose)
{
$actionLink = $this->createLink('todo', 'batchClose');
echo html::commonButton($lang->todo->close, "onclick=\"setFormAction('$actionLink', 'hiddenwin')\"");
@@ -160,7 +166,6 @@
}
?>
</div>
<?php endif;?>
<?php $pager->show('right', 'pagerjs');?>
</div>
</form>
+20 -9
View File
@@ -186,6 +186,17 @@ js::set('foldAll', $lang->project->treeLevel['root']);
$setting = $this->datatable->getSetting('product');
$widths = $this->datatable->setFixedFieldWidth($setting);
$columns = 0;
$canBatchEdit = common::hasPriv('story', 'batchEdit');
$canBatchClose = common::hasPriv('story', 'batchClose') and strtolower($browseType) != 'closedbyme' and strtolower($browseType) != 'closedstory';
$canBatchReview = common::hasPriv('story', 'batchReview');
$canBatchChangeStage = common::hasPriv('story', 'batchChangeStage');
$canBatchChangeBranch = common::hasPriv('story', 'batchChangeBranch');
$canBatchChangeModule = common::hasPriv('story', 'batchChangeModule');
$canBatchChangePlan = common::hasPriv('story', 'batchChangePlan');
$canBatchAssignTo = common::hasPriv('story', 'batchAssignTo');
$canBatchAction = ($canBatchEdit or $canBatchClose or $canBatchReview or $canBatchChangeStage or $canBatchChangeModule or $canBatchChangePlan or $canBatchAssignTo);
?>
<?php if(!$useDatatable) echo '<div class="table-responsive">';?>
<table class='table has-sort-head<?php if($useDatatable) echo ' datatable';?>' id='storyList' data-fixed-left-width='<?php echo $widths['leftWidth']?>' data-fixed-right-width='<?php echo $widths['rightWidth']?>'>
@@ -196,7 +207,7 @@ js::set('foldAll', $lang->project->treeLevel['root']);
{
if($value->show)
{
$this->datatable->printHead($value, $orderBy, $vars);
$this->datatable->printHead($value, $orderBy, $vars, $canBatchAction);
$columns ++;
}
}
@@ -224,11 +235,12 @@ js::set('foldAll', $lang->project->treeLevel['root']);
</table>
<?php if(!$useDatatable) echo '</div>';?>
<div class="table-footer">
<?php if($canBatchAction):?>
<div class="checkbox-primary check-all"><label><?php echo $lang->selectAll?></label></div>
<?php endif;?>
<div class="table-actions btn-toolbar">
<div class='btn-group dropup'>
<?php
$canBatchEdit = common::hasPriv('story', 'batchEdit');
$disabled = $canBatchEdit ? '' : "disabled='disabled'";
$actionLink = $this->createLink('story', 'batchEdit', "productID=$productID&projectID=0&branch=$branch");
?>
@@ -236,13 +248,12 @@ js::set('foldAll', $lang->project->treeLevel['root']);
<button type='button' class='btn dropdown-toggle' data-toggle='dropdown'><span class='caret'></span></button>
<ul class='dropdown-menu'>
<?php
$canBatchClose = common::hasPriv('story', 'batchClose') && strtolower($browseType) != 'closedbyme' && strtolower($browseType) != 'closedstory';
$class = $canBatchClose ? '' : "class='disabled'";
$actionLink = $this->createLink('story', 'batchClose', "productID=$productID&projectID=0");
$misc = $canBatchClose ? "onclick=\"setFormAction('$actionLink')\"" : '';
echo "<li $class>" . html::a('#', $lang->close, '', $misc) . "</li>";
if(common::hasPriv('story', 'batchReview'))
if($canBatchReview)
{
echo "<li class='dropdown-submenu'>";
echo html::a('javascript:;', $lang->story->review, '', "id='reviewItem'");
@@ -283,7 +294,7 @@ js::set('foldAll', $lang->project->treeLevel['root']);
echo "<li $class>" . html::a('javascript:;', $lang->story->review, '', $class) . '</li>';
}
if(common::hasPriv('story', 'batchChangeBranch') and $this->session->currentProductType != 'normal')
if($canBatchChangeBranch and $this->session->currentProductType != 'normal')
{
$withSearch = count($branches) > 8;
echo "<li class='dropdown-submenu'>";
@@ -300,7 +311,7 @@ js::set('foldAll', $lang->project->treeLevel['root']);
echo '</div></li>';
}
if(common::hasPriv('story', 'batchChangeStage'))
if($canBatchChangeStage)
{
echo "<li class='dropdown-submenu'>";
echo html::a('javascript:;', $lang->story->stageAB, '', "id='stageItem'");
@@ -323,7 +334,7 @@ js::set('foldAll', $lang->project->treeLevel['root']);
</ul>
</div>
<?php if(common::hasPriv('story', 'batchChangeModule')):?>
<?php if($canBatchChangeModule):?>
<div class="btn-group dropup">
<button data-toggle="dropdown" type="button" class="btn"><?php echo $lang->story->moduleAB;?> <span class="caret"></span></button>
<?php $withSearch = count($modules) > 8;?>
@@ -350,7 +361,7 @@ js::set('foldAll', $lang->project->treeLevel['root']);
</div>
</div>
<?php endif;?>
<?php if(common::hasPriv('story', 'batchChangePlan')):?>
<?php if($canBatchChangePlan):?>
<div class="btn-group dropup">
<button data-toggle="dropdown" type="button" class="btn"><?php echo $lang->story->planAB;?> <span class="caret"></span></button>
<?php
@@ -381,7 +392,7 @@ js::set('foldAll', $lang->project->treeLevel['root']);
</div>
<?php endif;?>
<?php if(common::hasPriv('story', 'batchAssignTo')):?>
<?php if($canBatchAssignTo):?>
<div class="btn-group dropup">
<button data-toggle="dropdown" type="button" class="btn"><?php echo $lang->story->assignedTo;?> <span class="caret"></span></button>
<?php
+1 -1
View File
@@ -98,7 +98,7 @@
$canBatchChangeStage = common::hasPriv('story', 'batchChangeStage');
$canBatchAssignTo = common::hasPriv('story', 'batchAssignTo');
$canBatchAction = $canBatchUnlink or $canBatchClose or $canBatchEdit or $canBatchReview or $canBatchChangeBranch or $canBatchChangeModule or $canBatchChangePlan or $canBatchChangeStage or $canBatchAssignTo;
$canBatchAction = ($canBatchUnlink or $canBatchClose or $canBatchEdit or $canBatchReview or $canBatchChangeBranch or $canBatchChangeModule or $canBatchChangePlan or $canBatchChangeStage or $canBatchAssignTo);
$vars = "planID={$plan->id}&type=story&orderBy=%s&link=$link&param=$param";
?>
<thead>
+3 -1
View File
@@ -27,15 +27,18 @@
</div>
<div id='mainContent'>
<?php $canOrder = (common::hasPriv('project', 'updateOrder') and strpos($orderBy, 'order') !== false)?>
<?php $canBatchEdit = common::hasPriv('project', 'batchEdit'); ?>
<form class='main-table' id='projectsForm' method='post' action='<?php echo inLink('batchEdit', "projectID=$projectID");?>' data-ride='table'>
<table class='table has-sort-head table-fixed' id='projectList'>
<?php $vars = "status=$status&projectID=$projectID&orderBy=%s&productID=$productID&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";?>
<thead>
<tr>
<th class='c-id'>
<?php if($canBatchEdit):?>
<div class="checkbox-primary check-all" title="<?php echo $lang->selectAll?>">
<label></label>
</div>
<?php endif;?>
<?php common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?>
</th>
<th><?php common::printOrderLink('name', $orderBy, $vars, $lang->project->name);?></th>
@@ -53,7 +56,6 @@
<?php endif;?>
</tr>
</thead>
<?php $canBatchEdit = common::hasPriv('project', 'batchEdit'); ?>
<tbody class='sortable' id='projectTableList'>
<?php foreach($projectStats as $project):?>
<tr data-id='<?php echo $project->id ?>' data-order='<?php echo $project->order ?>'>
+9 -5
View File
@@ -110,12 +110,16 @@
<tr>
<?php
$totalEstimate = 0;
$canBatchEdit = common::hasPriv('story', 'batchEdit');
$canBatchClose = common::hasPriv('story', 'batchClose');
$canBatchEdit = common::hasPriv('story', 'batchEdit');
$canBatchClose = common::hasPriv('story', 'batchClose');
$canBatchChangeStage = common::hasPriv('story', 'batchChangeStage');
$canBatchUnlink = common::hasPriv('project', 'batchUnlinkStory');
$canBatchAction = ($canBatchEdit or $canBatchClose or $canBatchChangeStage or $canBatchUnlink);
?>
<?php $vars = "projectID={$project->id}&orderBy=%s&type=$type&param=$param&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}"; ?>
<th class='c-id {sorter:false}'>
<?php if($canBatchEdit or $canBatchClose):?>
<?php if($canBatchAction):?>
<div class="checkbox-primary check-all" title="<?php echo $lang->selectAll?>">
<label></label>
</div>
@@ -146,7 +150,7 @@
?>
<tr id="story<?php echo $story->id;?>" data-id='<?php echo $story->id;?>' data-order='<?php echo $story->order ?>' data-estimate='<?php echo $story->estimate?>' data-cases='<?php echo zget($storyCases, $story->id, 0)?>'>
<td class='cell-id'>
<?php if($canBatchEdit or $canBatchClose):?>
<?php if($canBatchAction):?>
<?php echo html::checkbox('storyIdList', array($story->id => '')) . html::a(helper::createLink('story', 'view', "storyID=$story->id"), sprintf('%03d', $story->id));?>
<?php else:?>
<?php printf('%03d', $story->id);?>
@@ -220,7 +224,7 @@
</tbody>
</table>
<div class='table-footer'>
<?php if($canBatchEdit or $canBatchClose):?>
<?php if($canBatchAction):?>
<div class="checkbox-primary check-all"><label><?php echo $lang->selectAll?></label></div>
<?php endif;?>
<div class='table-actions btn-toolbar'>
+11 -8
View File
@@ -209,6 +209,14 @@ js::set('foldAll', $lang->project->treeLevel['root']);
}
$widths = $this->datatable->setFixedFieldWidth($customFields);
$columns = 0;
$canBatchEdit = common::hasPriv('task', 'batchEdit', !empty(reset($tasks)) ? reset($tasks) : null);
$canBatchClose = (common::hasPriv('task', 'batchClose', !empty(reset($tasks)) ? reset($tasks) : null) and strtolower($browseType) != 'closed');
$canBatchCancel = common::hasPriv('task', 'batchCancel', !empty(reset($tasks)) ? reset($tasks) : null);
$canBatchChangeModule = common::hasPriv('task', 'batchChangeModule', !empty(reset($tasks)) ? reset($tasks) : null);
$canBatchAssignTo = common::hasPriv('task', 'batchAssignTo', !empty(reset($tasks)) ? reset($tasks) : null);
$canBatchAction = ($canBatchEdit or $canBatchClose or $canBatchCancel or $canBatchChangeModule or $canBatchAssignTo);
?>
<?php if(!$useDatatable) echo '<div class="table-responsive">';?>
<table class='table has-sort-head<?php if($useDatatable) echo ' datatable';?>' id='taskList' data-fixed-left-width='<?php echo $widths['leftWidth']?>' data-fixed-right-width='<?php echo $widths['rightWidth']?>'>
@@ -219,7 +227,7 @@ js::set('foldAll', $lang->project->treeLevel['root']);
{
if($field->show)
{
$this->datatable->printHead($field, $orderBy, $vars);
$this->datatable->printHead($field, $orderBy, $vars, $canBatchAction);
$columns++;
}
}
@@ -248,15 +256,10 @@ js::set('foldAll', $lang->project->treeLevel['root']);
<?php if(!$useDatatable) echo '</div>';?>
<div class="table-footer">
<?php if($canBatchAction):?>
<div class="checkbox-primary check-all"><label><?php echo $lang->selectAll?></label></div>
<?php endif;?>
<div class="table-actions btn-toolbar">
<?php
$canBatchEdit = common::hasPriv('task', 'batchEdit', !empty($task) ? $task : null);
$canBatchClose = (common::hasPriv('task', 'batchClose', !empty($task) ? $task : null) && strtolower($browseType) != 'closedBy');
$canBatchCancel = common::hasPriv('task', 'batchCancel', !empty($task) ? $task : null);
$canBatchChangeModule = common::hasPriv('task', 'batchChangeModule', !empty($task) ? $task : null);
$canBatchAssignTo = common::hasPriv('task', 'batchAssignTo', !empty($task) ? $task : null);
?>
<div class='btn-group dropup'>
<?php
$actionLink = $this->createLink('task', 'batchEdit', "projectID=$projectID");
+7 -4
View File
@@ -70,12 +70,15 @@
<?php endif;?>
<form class='main-table table-story' method='post' id='linkedStoriesForm' data-ride="table">
<table class='table has-sort-head' id='storyList'>
<?php $canBatchUnlink = common::hasPriv('release', 'batchUnlinkStory');?>
<?php
$canBatchUnlink = common::hasPriv('release', 'batchUnlinkStory');
$canBatchClose = common::hasPriv('story', 'batchClose');
?>
<?php $vars = "releaseID={$release->id}&type=story&link=$link&param=$param&orderBy=%s";?>
<thead>
<tr class='text-center'>
<th class='c-id text-left'>
<?php if($canBatchUnlink):?>
<?php if($canBatchUnlink or $canBatchClose):?>
<div class="checkbox-primary check-all" title="<?php echo $lang->selectAll?>">
<label></label>
</div>
@@ -96,7 +99,7 @@
<?php $storyLink = $this->createLink('story', 'view', "storyID=$story->id", '', true);?>
<tr>
<td class='c-id text-left'>
<?php if($canBatchUnlink):?>
<?php if($canBatchUnlink or $canBatchClose):?>
<div class="checkbox-primary">
<input type='checkbox' name='storyIdList[]' value='<?php echo $story->id;?>'/>
<label></label>
@@ -131,7 +134,7 @@
</tbody>
</table>
<div class='table-footer'>
<?php if($countStories and $canBatchUnlink):?>
<?php if($countStories and ($canBatchUnlink or $canBatchClose)):?>
<div class="checkbox-primary check-all"><label><?php echo $lang->selectAll?></label></div>
<div class="table-actions btn-toolbar">
<?php
+19 -1
View File
@@ -2817,6 +2817,17 @@ class storyModel extends model
*/
public function printCell($col, $story, $users, $branches, $storyStages, $modulePairs = array(), $storyTasks = array(), $storyBugs = array(), $storyCases = array(), $mode = 'datatable', $storyType = 'story')
{
$canBatchEdit = common::hasPriv('story', 'batchEdit');
$canBatchClose = common::hasPriv('story', 'batchClose');
$canBatchReview = common::hasPriv('story', 'batchReview');
$canBatchChangeStage = common::hasPriv('story', 'batchChangeStage');
$canBatchChangeBranch = common::hasPriv('story', 'batchChangeBranch');
$canBatchChangeModule = common::hasPriv('story', 'batchChangeModule');
$canBatchChangePlan = common::hasPriv('story', 'batchChangePlan');
$canBatchAssignTo = common::hasPriv('story', 'batchAssignTo');
$canBatchAction = ($canBatchEdit or $canBatchClose or $canBatchReview or $canBatchChangeStage or $canBatchChangeBranch or $canBatchChangeModule or $canBatchChangePlan or $canBatchAssignTo);
$canView = common::hasPriv('story', 'view');
$storyLink = helper::createLink('story', 'view', "storyID=$story->id");
$account = $this->app->user->account;
@@ -2877,7 +2888,14 @@ class storyModel extends model
switch($id)
{
case 'id':
echo html::checkbox('storyIdList', array($story->id => '')) . html::a(helper::createLink('story', 'view', "storyID=$story->id"), sprintf('%03d', $story->id));
if($canBatchAction)
{
echo html::checkbox('storyIdList', array($story->id => '')) . html::a(helper::createLink('story', 'view', "storyID=$story->id"), sprintf('%03d', $story->id));
}
else
{
printf('%03d', $story->id);
}
break;
case 'pri':
echo "<span class='label-pri label-pri-" . $story->pri . "' title='" . zget($this->lang->story->priList, $story->pri, $story->pri) . "'>";
+2 -2
View File
@@ -2757,12 +2757,12 @@ class taskModel extends model
public function printCell($col, $task, $users, $browseType, $branchGroups, $modulePairs = array(), $mode = 'datatable', $child = false)
{
$canBatchEdit = common::hasPriv('task', 'batchEdit', !empty($task) ? $task : null);
$canBatchClose = (common::hasPriv('task', 'batchClose', !empty($task) ? $task : null) && strtolower($browseType) != 'closedBy');
$canBatchClose = (common::hasPriv('task', 'batchClose', !empty($task) ? $task : null) and strtolower($browseType) != 'closed');
$canBatchCancel = common::hasPriv('task', 'batchCancel', !empty($task) ? $task : null);
$canBatchChangeModule = common::hasPriv('task', 'batchChangeModule', !empty($task) ? $task : null);
$canBatchAssignTo = common::hasPriv('task', 'batchAssignTo', !empty($task) ? $task : null);
$canBatchAction = $canBatchEdit or $canBatchClose or $canBatchCancel or $canBatchChangeModule or $canBatchAssignTo;
$canBatchAction = ($canBatchEdit or $canBatchClose or $canBatchCancel or $canBatchChangeModule or $canBatchAssignTo);
$storyChanged = (!empty($task->storyStatus) and $task->storyStatus == 'active' and $task->latestStoryVersion > $task->storyVersion and !in_array($task->status, array('cancel', 'closed')));
$canView = common::hasPriv('task', 'view');
+17 -1
View File
@@ -1392,6 +1392,15 @@ class testcaseModel extends model
*/
public function printCell($col, $case, $users, $branches, $modulePairs = array(), $browseType = '', $mode = 'datatable')
{
$canBatchRun = common::hasPriv('testtask', 'batchRun');
$canBatchEdit = common::hasPriv('testcase', 'batchEdit');
$canBatchDelete = common::hasPriv('testcase', 'batchDelete');
$canBatchCaseTypeChange = common::hasPriv('testcase', 'batchCaseTypeChange');
$canBatchConfirmStoryChange = common::hasPriv('testcase', 'batchConfirmStoryChange');
$canBatchChangeModule = common::hasPriv('testcase', 'batchChangeModule');
$canBatchAction = ($canBatchRun or $canBatchEdit or $canBatchDelete or $canBatchCaseTypeChange or $canBatchConfirmStoryChange or $canBatchChangeModule);
$canView = common::hasPriv('testcase', 'view');
$caseLink = helper::createLink('testcase', 'view', "caseID=$case->id&version=$case->version");
$account = $this->app->user->account;
@@ -1420,7 +1429,14 @@ class testcaseModel extends model
switch($id)
{
case 'id':
echo html::checkbox('caseIDList', array($case->id => '')) . html::a(helper::createLink('testcase', 'view', "caseID=$case->id"), sprintf('%03d', $case->id));
if($canBatchAction)
{
echo html::checkbox('caseIDList', array($case->id => '')) . html::a(helper::createLink('testcase', 'view', "caseID=$case->id"), sprintf('%03d', $case->id));
}
else
{
printf('%03d', $case->id);
}
break;
case 'pri':
echo "<span class='label-pri label-pri-" . $case->pri . "' title='" . zget($this->lang->testcase->priList, $case->pri, $case->pri) . "'>";
+18 -7
View File
@@ -72,6 +72,15 @@ js::set('suiteID', $suiteID);
$setting = $this->datatable->getSetting('testcase');
$widths = $this->datatable->setFixedFieldWidth($setting);
$columns = 0;
$canBatchRun = common::hasPriv('testtask', 'batchRun');
$canBatchEdit = common::hasPriv('testcase', 'batchEdit');
$canBatchDelete = common::hasPriv('testcase', 'batchDelete');
$canBatchCaseTypeChange = common::hasPriv('testcase', 'batchCaseTypeChange');
$canBatchConfirmStoryChange = common::hasPriv('testcase', 'batchConfirmStoryChange');
$canBatchChangeModule = common::hasPriv('testcase', 'batchChangeModule');
$canBatchAction = ($canBatchRun or $canBatchEdit or $canBatchDelete or $canBatchCaseTypeChange or $canBatchConfirmStoryChange or $canBatchChangeModule);
?>
<?php if(!$useDatatable) echo '<div class="table-responsive">';?>
<table class='table has-sort-head<?php if($useDatatable) echo ' datatable';?>' id='caseList' data-fixed-left-width='<?php echo $widths['leftWidth']?>' data-fixed-right-width='<?php echo $widths['rightWidth']?>' data-checkbox-name='caseIDList[]'>
@@ -82,7 +91,7 @@ js::set('suiteID', $suiteID);
{
if($value->show)
{
$this->datatable->printHead($value, $orderBy, $vars);
$this->datatable->printHead($value, $orderBy, $vars, $canBatchAction);
$columns ++;
}
}
@@ -99,16 +108,18 @@ js::set('suiteID', $suiteID);
</table>
<?php if(!$useDatatable) echo '</div>';?>
<div class='table-footer'>
<?php if($canBatchAction):?>
<div class="checkbox-primary check-all"><label><?php echo $lang->selectAll?></label></div>
<?php endif;?>
<div class='table-actions btn-toolbar'>
<div class='btn-group dropup'>
<?php
$actionLink = $this->createLink('testtask', 'batchRun', "productID=$productID&orderBy=$orderBy");
$misc = common::hasPriv('testtask', 'batchRun') ? "onclick=\"setFormAction('$actionLink')\"" : "disabled='disabled'";
$misc = $canBatchRun ? "onclick=\"setFormAction('$actionLink')\"" : "disabled='disabled'";
echo html::commonButton($lang->testtask->runCase, $misc);
$actionLink = $this->createLink('testcase', 'batchEdit', "productID=$productID&branch=$branch");
$misc = common::hasPriv('testcase', 'batchEdit') ? "onclick=\"setFormAction('$actionLink')\"" : "disabled='disabled'";
$misc = $canBatchEdit ? "onclick=\"setFormAction('$actionLink')\"" : "disabled='disabled'";
echo html::commonButton($lang->edit, $misc);
?>
<button type='button' class='btn dropdown-toggle' data-toggle='dropdown'><span class='caret'></span></button>
@@ -128,14 +139,14 @@ js::set('suiteID', $suiteID);
echo '</ul></li>';
}
if(common::hasPriv('testcase', 'batchDelete'))
if($canBatchDelete)
{
$actionLink = $this->createLink('testcase', 'batchDelete', "productID=$productID");
$misc = "onclick=\"confirmBatchDelete('$actionLink')\"";
echo "<li>" . html::a('#', $lang->delete, '', $misc) . "</li>";
}
if(common::hasPriv('testcase', 'batchCaseTypeChange'))
if($canBatchCaseTypeChange)
{
echo "<li class='dropdown-submenu'>";
echo html::a('javascript:;', $lang->testcase->type, '', "id='typeChangeItem'");
@@ -149,7 +160,7 @@ js::set('suiteID', $suiteID);
echo '</ul></li>';
}
if(common::hasPriv('testcase', 'batchConfirmStoryChange'))
if($canBatchConfirmStoryChange)
{
$actionLink = $this->createLink('testcase', 'batchConfirmStoryChange', "productID=$productID");
$misc = "onclick=\"setFormAction('$actionLink')\"";
@@ -186,7 +197,7 @@ js::set('suiteID', $suiteID);
</div>
</div>
<?php endif;?>
<?php if(common::hasPriv('testcase', 'batchChangeModule')):?>
<?php if($canBatchChangeModule):?>
<div class="btn-group dropup">
<button data-toggle="dropdown" type="button" class="btn"><?php echo $lang->story->moduleAB;?> <span class="caret"></span></button>
<?php $withSearch = count($modules) > 10;?>
+15 -1
View File
@@ -1437,6 +1437,13 @@ class testtaskModel extends model
*/
public function printCell($col, $run, $users, $task, $branches, $mode = 'datatable')
{
$canBatchEdit = common::hasPriv('testcase', 'batchEdit');
$canBatchUnlink = common::hasPriv('testtask', 'batchUnlinkCases');
$canBatchAssign = common::hasPriv('testtask', 'batchAssign');
$canBatchRun = common::hasPriv('testtask', 'batchRun');
$canBatchAction = ($canBatchEdit or $canBatchUnlink or $canBatchAssign or $canBatchRun);
$canView = common::hasPriv('testcase', 'view');
$caseLink = helper::createLink('testcase', 'view', "caseID=$run->case&version=$run->version&from=testtask&taskID=$run->task");
$account = $this->app->user->account;
@@ -1457,7 +1464,14 @@ class testtaskModel extends model
switch ($id)
{
case 'id':
echo html::checkbox('caseIDList', array($run->case => sprintf('%03d', $run->case)));
if($canBatchAction)
{
echo html::checkbox('caseIDList', array($run->case => sprintf('%03d', $run->case)));
}
else
{
printf('%03d', $run->case);
}
break;
case 'pri':
echo "<span class='label-pri label-pri-" . $run->pri . "' title='" . zget($this->lang->testcase->priList, $run->pri, $run->pri) . "'>";
+4 -3
View File
@@ -39,7 +39,8 @@
$canBatchUnlink = common::hasPriv('testtask', 'batchUnlinkCases');
$canBatchAssign = common::hasPriv('testtask', 'batchAssign');
$canBatchRun = common::hasPriv('testtask', 'batchRun');
$hasCheckbox = ($canBatchEdit or $canBatchUnlink or $canBatchAssign or $canBatchRun);
$canBatchAction = ($canBatchEdit or $canBatchUnlink or $canBatchAssign or $canBatchRun);
if($useDatatable) include '../../common/view/datatable.html.php';
if(!$useDatatable) include '../../common/view/tablesorter.html.php';
@@ -60,7 +61,7 @@
{
if($value->show)
{
$this->datatable->printHead($value, $orderBy, $vars);
$this->datatable->printHead($value, $orderBy, $vars, $canBatchAction);
$columns ++;
}
}
@@ -78,7 +79,7 @@
<?php if(!$useDatatable) echo '</div>';?>
<?php if($runs):?>
<div class='table-footer'>
<?php if($hasCheckbox):?>
<?php if($canBatchAction):?>
<div class="checkbox-primary check-all"><label><?php echo $lang->selectAll?></label></div>
<div class='table-actions btn-toolbar'>
<div class='btn-group dropup'>