* adjust project all and import bug page.

This commit is contained in:
wangyidong
2018-04-28 09:02:34 +08:00
parent df9a873c8e
commit 843f899214
3 changed files with 154 additions and 136 deletions
+2 -2
View File
@@ -55,12 +55,12 @@
<?php $storyLink = $this->createLink('story', 'view', "id=$story->id");?>
<tr>
<td class="c-id">
<?php if($canBatchEdit or $canBatchClose):?>
<div class="checkbox-primary">
<?php if($canBatchEdit or $canBatchClose):?>
<input type='checkbox' name='storyIDList[<?php echo $story->id;?>]' value='<?php echo $story->id;?>' />
<label></label>
<?php endif;?>
</div>
<?php endif;?>
<?php printf('%03d', $story->id);?>
</td>
<td class='c-pri'><span class='label-pri <?php echo 'label-pri-' . $story->pri;?>'><?php echo zget($lang->story->priList, $story->pri, $story->pri);?></span></td>
+92 -84
View File
@@ -12,92 +12,100 @@
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/sparkline.html.php';?>
<?php include '../../common/view/sortable.html.php';?>
<div id='featurebar'>
<div class='actions'>
<?php common::printLink('project', 'export', "status=$status&productID=$productID&orderBy=$orderBy", "<i class='icon-download-alt'></i> " . $lang->export, '', "class='btn export'")?>
<?php common::printLink('project', 'create', '', "<i class='icon-plus'></i> " . $lang->project->create, '', "class='btn'")?>
<div id='mainMenu' class='clearfix'>
<div class='btn-toolbar pull-left'>
<?php echo html::a(inlink("all", "status=undone&projectID=$project->id"), "<span class='text'>{$lang->project->undone}</span>", '', "class='btn btn-link' id='undoneTab'");?>
<?php echo html::a(inlink("all", "status=all&projectID=$project->id"), "<span class='text'>{$lang->project->all}</span>", '', "class='btn btn-link' id='allTab'");?>
<?php echo html::a(inlink("all", "status=wait&projectID=$project->id"), "<span class='text'>{$lang->project->statusList['wait']}</span>", '', "class='btn btn-link' id='waitTab'");?>
<?php echo html::a(inlink("all", "status=doing&projectID=$project->id"), "<span class='text'>{$lang->project->statusList['doing']}</span>", '', "class='btn btn-link' id='doingTab'");?>
<?php echo html::a(inlink("all", "status=suspended&projectID=$project->id"), "<span class='text'>{$lang->project->statusList['suspended']}</span>", '', "class='btn btn-link' id='suspendedTab'");?>
<?php echo html::a(inlink("all", "status=done&projectID=$project->id"), "<span class='text'>{$lang->project->statusList['done']}</span>", '', "class='btn btn-link' id='doneTab'");?>
<div class='input-control space w-180px'>
<?php echo html::select('product', $products, $productID, "class='chosen form-control' onchange='byProduct(this.value, $projectID)'");?>
</div>
</div>
<div class='btn-toolbar pull-right'>
<?php common::printLink('project', 'export', "status=$status&productID=$productID&orderBy=$orderBy", "<i class='icon-download-alt'></i> " . $lang->export, '', "class='btn btn-link export'")?>
<?php common::printLink('project', 'create', '', "<i class='icon-plus'></i> " . $lang->project->create, '', "class='btn btn-link'")?>
</div>
<ul class='nav'>
<?php echo "<li id='undoneTab'>" . html::a(inlink("all", "status=undone&projectID=$project->id"), $lang->project->undone) . '</li>';?>
<?php echo "<li id='allTab'>" . html::a(inlink("all", "status=all&projectID=$project->id"), $lang->project->all) . '</li>';?>
<?php echo "<li id='waitTab'>" . html::a(inlink("all", "status=wait&projectID=$project->id"), $lang->project->statusList['wait']) . '</li>';?>
<?php echo "<li id='doingTab'>" . html::a(inlink("all", "status=doing&projectID=$project->id"), $lang->project->statusList['doing']) . '</li>';?>
<?php echo "<li id='suspendedTab'>" . html::a(inlink("all", "status=suspended&projectID=$project->id"), $lang->project->statusList['suspended']) . '</li>';?>
<?php echo "<li id='doneTab'>" . html::a(inlink("all", "status=done&projectID=$project->id"), $lang->project->statusList['done']) . '</li>';?>
<?php echo "<li>" . html::select('product', $products, $productID, "class='chosen' onchange='byProduct(this.value, $projectID)'") . '</li>';?>
</ul>
</div>
<?php $canOrder = (common::hasPriv('project', 'updateOrder') and strpos($orderBy, 'order') !== false)?>
<form id='projectsForm' class='form-condensed' method='post' action='<?php echo inLink('batchEdit', "projectID=$projectID");?>'>
<table class='table table-fixed tablesorter table-datatable table-selectable' 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='w-id'><?php common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?></th>
<th><?php common::printOrderLink('name', $orderBy, $vars, $lang->project->name);?></th>
<th class='w-100px'><?php common::printOrderLink('code', $orderBy, $vars, $lang->project->code);?></th>
<th class='w-90px'><?php common::printOrderLink('PM', $orderBy, $vars, $lang->project->PM);?></th>
<th class='w-80px'><?php common::printOrderLink('end', $orderBy, $vars, $lang->project->end);?></th>
<th class='w-80px'><?php common::printOrderLink('status', $orderBy, $vars, $lang->project->status);?></th>
<th class='w-70px'><?php echo $lang->project->totalEstimate;?></th>
<th class='w-70px'><?php echo $lang->project->totalConsumed;?></th>
<th class='w-70px'><?php echo $lang->project->totalLeft;?></th>
<th class='w-150px'><?php echo $lang->project->progress;?></th>
<th class='w-100px'><?php echo $lang->project->burn;?></th>
<?php if($canOrder):?>
<th class='w-60px sort-default'><?php common::printOrderLink('order', $orderBy, $vars, $lang->project->updateOrder);?></th>
<?php endif;?>
</tr>
</thead>
<?php $canBatchEdit = common::hasPriv('project', 'batchEdit'); ?>
<tbody class='sortable' id='projectTableList'>
<?php foreach($projectStats as $project):?>
<tr class='text-center' data-id='<?php echo $project->id ?>' data-order='<?php echo $project->order ?>'>
<td class='cell-id'>
<?php if($canBatchEdit):?>
<input type='checkbox' name='projectIDList[<?php echo $project->id;?>]' value='<?php echo $project->id;?>' />
<?php endif;?>
<?php echo html::a($this->createLink('project', 'view', 'project=' . $project->id), sprintf('%03d', $project->id));?>
</td>
<td class='text-left' title='<?php echo $project->name?>'><?php echo html::a($this->createLink('project', 'view', 'project=' . $project->id), $project->name);?></td>
<td class='text-left'><?php echo $project->code;?></td>
<td><?php echo $users[$project->PM];?></td>
<td><?php echo $project->end;?></td>
<?php if(isset($project->delay)):?>
<td class='status-delay'><?php echo $lang->project->delayed;?></td>
<?php else:?>
<td class='status-<?php echo $project->status?>'><?php echo $lang->project->statusList[$project->status];?></td>
<?php endif;?>
<td><?php echo $project->hours->totalEstimate;?></td>
<td><?php echo $project->hours->totalConsumed;?></td>
<td><?php echo $project->hours->totalLeft;?></td>
<td class='text-left w-150px'>
<img class='progressbar' src='<?php echo $webRoot;?>theme/default/images/main/green.png' alt='' height='16' width='<?php echo $project->hours->progress == 0 ? 1 : round($project->hours->progress);?>'>
<small><?php echo $project->hours->progress;?>%</small>
</td>
<td class='projectline text-left' values='<?php echo join(',', $project->burns);?>'></td>
<?php if($canOrder):?>
<td class='sort-handler'><i class="icon icon-move"></i></td>
<?php endif;?>
</tr>
<?php endforeach;?>
</tbody>
<tfoot>
<tr>
<td colspan='<?php echo $canOrder ? 12 : 11?>'>
<div class='table-actions clearfix'>
<?php if($canBatchEdit and !empty($projectStats)):?>
<?php echo html::selectButton();?>
<?php echo html::submitButton($lang->project->batchEdit);?>
<div id='mainContent' class='main-content'>
<?php $canOrder = (common::hasPriv('project', 'updateOrder') and strpos($orderBy, 'order') !== false)?>
<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'>
<div class="checkbox-primary check-all" title="<?php echo $lang->selectAll?>">
<label></label>
</div>
<?php common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?>
</th>
<th><?php common::printOrderLink('name', $orderBy, $vars, $lang->project->name);?></th>
<th class='w-100px'><?php common::printOrderLink('code', $orderBy, $vars, $lang->project->code);?></th>
<th class='w-100px'><?php common::printOrderLink('PM', $orderBy, $vars, $lang->project->PM);?></th>
<th class='w-90px'><?php common::printOrderLink('end', $orderBy, $vars, $lang->project->end);?></th>
<th class='w-90px'><?php common::printOrderLink('status', $orderBy, $vars, $lang->project->status);?></th>
<th class='w-70px'><?php echo $lang->project->totalEstimate;?></th>
<th class='w-70px'><?php echo $lang->project->totalConsumed;?></th>
<th class='w-70px'><?php echo $lang->project->totalLeft;?></th>
<th class='w-150px'><?php echo $lang->project->progress;?></th>
<th class='w-100px'><?php echo $lang->project->burn;?></th>
<?php if($canOrder):?>
<th class='w-60px sort-default'><?php common::printOrderLink('order', $orderBy, $vars, $lang->project->updateOrder);?></th>
<?php endif;?>
<?php if(!$canOrder and common::hasPriv('project', 'updateOrder')) echo html::a(inlink('all', "status=$status&projectID=$projectID&order=order_desc&productID=$productID&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}"), $lang->project->updateOrder, '', "class='btn'");?>
</div>
<?php $pager->show();?>
</td>
</tr>
</tfoot>
</table>
</form>
<script>$("#<?php echo $status;?>Tab").addClass('active');</script>
</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 ?>'>
<td class='c-id'>
<?php if($canBatchEdit):?>
<div class="checkbox-primary">
<input type='checkbox' name='projectIDList[<?php echo $project->id;?>]' value='<?php echo $project->id;?>' />
<label></label>
</div>
<?php endif;?>
<?php printf('%03d', $project->id);?>
</td>
<td class='text-left' title='<?php echo $project->name?>'><?php echo html::a($this->createLink('project', 'view', 'project=' . $project->id), $project->name);?></td>
<td class='text-left'><?php echo $project->code;?></td>
<td><?php echo $users[$project->PM];?></td>
<td><?php echo $project->end;?></td>
<?php if(isset($project->delay)):?>
<td><span class='status-delay'><span class="label label-dot"></span> <?php echo $lang->project->delayed;?></span></td>
<?php else:?>
<td><span class='status-<?php echo $project->status?>'><span class="label label-dot"></span> <?php echo $lang->project->statusList[$project->status];?></span></td>
<?php endif;?>
<td><?php echo $project->hours->totalEstimate;?></td>
<td><?php echo $project->hours->totalConsumed;?></td>
<td><?php echo $project->hours->totalLeft;?></td>
<td class='text-left w-150px'>
<img class='progressbar' src='<?php echo $webRoot;?>theme/default/images/main/green.png' alt='' height='16' width='<?php echo $project->hours->progress == 0 ? 1 : round($project->hours->progress);?>'>
<small><?php echo $project->hours->progress;?>%</small>
</td>
<td class='projectline text-left' values='<?php echo join(',', $project->burns);?>'></td>
<?php if($canOrder):?>
<td class='sort-handler'><i class="icon icon-move"></i></td>
<?php endif;?>
</tr>
<?php endforeach;?>
</tbody>
</table>
<?php if($projectStats):?>
<div class='table-footer'>
<?php if($canBatchEdit):?>
<div class="checkbox-primary check-all"><label><?php echo $lang->selectAll?></label></div>
<div class="table-actions btn-toolbar"><?php echo html::submitButton($lang->project->batchEdit);?></div>
<?php endif;?>
<?php if(!$canOrder and common::hasPriv('project', 'updateOrder')) echo html::a(inlink('all', "status=$status&projectID=$projectID&order=order_desc&productID=$productID&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}"), $lang->project->updateOrder, '', "class='btn'");?>
<?php $pager->show('right', 'pagerjs');?>
</div>
<?php endif;?>
</form>
</div>
<script>$("#<?php echo $status;?>Tab").addClass('btn-active-text');</script>
<?php js::set('orderBy', $orderBy)?>
<?php include '../../common/view/footer.html.php';?>
+60 -50
View File
@@ -17,56 +17,66 @@
$(function(){$(".preview").modalTrigger({width:1000, type:'iframe'});});
var browseType = '<?php echo $browseType;?>';
</script>
<div id='titlebar'>
<div class='heading'>
<span class='prefix'><?php echo html::icon($lang->icons['task']);?></span>
<strong><small class='text-muted'><?php echo html::icon($lang->icons['import']);?></small> <?php echo $lang->project->importBug;?></strong>
<div id='mainMenu' class='clearfix'>
<div class='btn-toolbar pull-left'>
<?php echo html::a(inlink('importBug', "projectID=$projectID"), "<span class='text'>{$lang->project->importBug}</span>", '', "class='btn btn-link btn-active-text'");?>
</div>
<div id='querybox' class='show'></div>
</div>
<form class='form-condensed' method='post' enctype='multipart/form-data' target='hiddenwin' id='importBugForm'>
<table class='table tablesorter table-fixed table-selectable'>
<thead>
<tr class='colhead'>
<th class='w-id'> <?php echo $lang->idAB;?></th>
<th class='w-severity'> <?php echo $lang->bug->severityAB;?></th>
<th class='w-pri'> <?php echo $lang->priAB;?></th>
<th><?php echo $lang->bug->title;?></th>
<th class='w-80px'><?php echo $lang->bug->statusAB;?></th>
<th class='w-80px'><?php echo $lang->task->pri;?></th>
<th class='w-150px'><?php echo $lang->task->assignedTo;?></th>
<th class='w-80px nobr {sorter:false}'><?php echo $lang->task->estimate;?></th>
<th class='w-120px {sorter:false}'><?php echo $lang->task->deadline;?></th>
</tr>
</thead>
<tbody>
<?php foreach($bugs as $bug):?>
<tr class='text-center'>
<td class='cell-id'>
<?php echo html::checkbox("import[$bug->id]", '');?>
<?php echo sprintf('%03d', $bug->id) . html::hidden("id[$bug->id]", $bug->id);?>
</td>
<td><span class='<?php echo 'severity' . zget($lang->bug->severityList, $bug->severity, $bug->severity)?>'><?php echo zget($lang->bug->severityList, $bug->severity, $bug->severity)?></span></td>
<td><span class='<?php echo 'pri' . zget($lang->bug->priList, $bug->pri, $bug->pri)?>'><?php echo zget($lang->bug->priList, $bug->pri, $bug->pri)?></span></td>
<td class='text-left nobr'><?php common::printLink('bug', 'view', "bugID=$bug->id", $bug->title, '', "class='preview'", true, true);?></td>
<td class='bug-<?php echo $bug->status?>'><?php echo $lang->bug->statusList[$bug->status];?></td>
<td class='td-has-control'><?php echo html::select("pri[$bug->id]", $lang->task->priList, 3, "class='input-sm form-control'");?></td>
<td class='td-has-control text-left' style='overflow:visible'><?php echo html::select("assignedTo[$bug->id]", $users, zget($users, $bug->assignedTo, '', $bug->assignedTo), "class='input-sm form-control chosen'");?></td>
<td class='td-has-control'><?php echo html::input("estimate[$bug->id]", '', 'size=4 class="input-sm form-control" autocomplete="off"');?></td>
<?php $deadline = ($bug->deadline > helper::today() and $bug->deadline > $project->begin) ? $bug->deadline : '0000-00-00';?>
<td class='td-has-control'><?php echo html::input("deadline[$bug->id]", $deadline, 'size=4 class="input-sm form-control form-date" autocomplete="off"');?></td>
</tr>
<?php endforeach;?>
</tbody>
<tfoot>
<tr>
<td colspan='9'>
<div class='table-actions clearfix'><?php echo html::selectButton() . html::submitButton($lang->import) . html::backButton();?>
</div>
<?php $pager->show();?>
</td>
</tr>
</tfoot>
</table>
</form>
<div id='mainContent' class='main-content'>
<div id='querybox' class='show'></div>
<form class='main-table' method='post' target='hiddenwin' id='importBugForm' data-ride='table'>
<table class='table has-sort-head table-fixed'>
<thead>
<tr>
<th class='c-id'>
<div class="checkbox-primary check-all" title="<?php echo $lang->selectAll?>">
<label></label>
</div>
<?php echo $lang->idAB;?>
</th>
<th class='w-severity'> <?php echo $lang->bug->severityAB;?></th>
<th class='w-pri'> <?php echo $lang->priAB;?></th>
<th><?php echo $lang->bug->title;?></th>
<th class='w-80px'><?php echo $lang->bug->statusAB;?></th>
<th class='w-100px'><?php echo $lang->task->pri;?></th>
<th class='w-150px'><?php echo $lang->task->assignedTo;?></th>
<th class='w-80px'><?php echo $lang->task->estimate;?></th>
<th class='w-120px'><?php echo $lang->task->deadline;?></th>
</tr>
</thead>
<tbody>
<?php foreach($bugs as $bug):?>
<tr>
<td class='c-id'>
<div class="checkbox-primary">
<input type='checkbox' name='import[<?php echo $bug->id;?>]' value='<?php echo $bug->id;?>' />
<label></label>
</div>
<?php echo sprintf('%03d', $bug->id) . html::hidden("id[$bug->id]", $bug->id);?>
</td>
<td><span class='<?php echo 'severity' . zget($lang->bug->severityList, $bug->severity, $bug->severity)?>'><?php echo zget($lang->bug->severityList, $bug->severity, $bug->severity)?></span></td>
<td><span class='label-pri <?php echo 'label-pri-' . $bug->pri;?>'><?php echo zget($lang->bug->priList, $bug->pri, $bug->pri)?></span></td>
<td class='nobr'><?php common::printLink('bug', 'view', "bugID=$bug->id", $bug->title, '', "class='preview'", true, true);?></td>
<td><span class='status-<?php echo $bug->status?>'><span class='label label-dot'></span> <?php echo $lang->bug->statusList[$bug->status];?></span></td>
<td style='overflow:visible'><?php echo html::select("pri[$bug->id]", $lang->task->priList, 3, "class='form-control chosen'");?></td>
<td style='overflow:visible'><?php echo html::select("assignedTo[$bug->id]", $users, zget($users, $bug->assignedTo, '', $bug->assignedTo), "class='form-control chosen'");?></td>
<td><?php echo html::input("estimate[$bug->id]", '', 'size=4 class="form-control" autocomplete="off"');?></td>
<?php $deadline = ($bug->deadline > helper::today() and $bug->deadline > $project->begin) ? $bug->deadline : '0000-00-00';?>
<td><?php echo html::input("deadline[$bug->id]", $deadline, 'size=4 class="form-control form-date" autocomplete="off"');?></td>
</tr>
<?php endforeach;?>
</tbody>
</table>
<?php if($bugs):?>
<div class='table-footer'>
<div class="checkbox-primary check-all"><label><?php echo $lang->selectAll?></label></div>
<div class="table-actions btn-toolbar">
<?php echo html::submitButton($lang->import);?>
</div>
<?php echo html::backButton();?>
<?php $pager->show('right', 'pagerjs');?>
</div>
<?php endif;?>
</form>
</div>
<?php include '../../common/view/footer.html.php';?>