* Rewrite create page of bug.

This commit is contained in:
daitingting
2018-05-15 16:21:13 +08:00
parent e0b68dbaec
commit 73b1a29da4
4 changed files with 105 additions and 143 deletions
-4
View File
@@ -1,7 +1,3 @@
.ke-toolbar .ke-outline[data-name='savetemplate'] {display: none}
#modulemenu .nav #dropMenu #searchResult .closed{text-decoration:none;}
.nav #moreMenus{cursor: pointer;}
.input-group .control-product + .chosen-container-single .chosen-single {border-radius: 2px 0 0 2px; border-right-width: 0; padding-right: 1px;}
.input-group .control-product + .chosen-container-active .chosen-single {border-right-width: 1px; padding-right: 0;}
.input-group .control-branch + .chosen-container-single .chosen-single {border-radius: 0 2px 2px 0;}
+2 -1
View File
@@ -35,4 +35,5 @@
#branch {border-left-width: 0;}
.input-group-addon.w-90px{min-width:90px;}
.input-group-addon.w-90px{min-width:90px;}
.input-group .input-group-btn .btn{padding: 6px 12px;}
-1
View File
@@ -193,7 +193,6 @@ function loadProductModules(productID)
$('#moduleIdBox').load(link, function()
{
$(this).find('select').chosen(defaultChosenOptions)
if(typeof(bugModule) == 'string') $('#moduleIdBox').prepend("<span class='input-group-addon'>" + bugModule + "</span>")
});
}
+103 -137
View File
@@ -35,19 +35,21 @@ js::set('confirmDeleteTemplate', $lang->bug->confirmDeleteTemplate);
<table class="table table-form">
<tbody>
<tr>
<th class='w-110px'><?php echo $lang->bug->product;?></th>
<td class='w-p45-f'>
<th><?php echo $lang->bug->product;?></th>
<td>
<div class='input-group'>
<?php echo html::select('product', $products, $productID, "onchange='loadAll(this.value);' class='form-control chosen control-product' autocomplete='off'");?>
<?php if($this->session->currentProductType != 'normal'):?>
<span class='input-group-addon fix-border fix-padding'></span>
<?php echo html::select('branch', $branches, $branch, "onchange='loadBranch()' class='form-control chosen control-branch' style='width:120px'");?>
<span class='input-group-addon'></span>
<?php echo html::select('branch', $branches, $branch, "onchange='loadBranch()' class='form-control chosen control-branch'");?>
<?php endif;?>
</div>
</td>
</tr>
<tr>
<th><?php echo $lang->bug->module;?></th>
<td>
<div class='input-group' id='moduleIdBox'>
<span class="input-group-addon w-90px"><?php echo $lang->bug->module?></span>
<?php
echo html::select('module', $moduleOptionMenu, $moduleID, "onchange='loadModuleRelated()' class='form-control chosen'");
if(count($moduleOptionMenu) == 1)
@@ -63,41 +65,19 @@ js::set('confirmDeleteTemplate', $lang->bug->confirmDeleteTemplate);
</td>
</tr>
<?php $showProject = (strpos(",$showFields,", ',project,') !== false && $this->config->global->flow != 'onlyTest');?>
<?php if($showProject):?>
<tr>
<th><?php echo ($showProject) ? $lang->bug->project : $lang->bug->type;?></th>
<?php if(!$showProject):?>
<?php $showOS = strpos(",$showFields,", ',os,') !== false;?>
<?php $showBrowser = strpos(",$showFields,", ',browser,') !== false;?>
<td>
<div class='input-group' id='bugTypeInputGroup'>
<?php
/* Remove the unused types. */
unset($lang->bug->typeList['designchange']);
unset($lang->bug->typeList['newfeature']);
unset($lang->bug->typeList['trackthings']);
echo html::select('type', $lang->bug->typeList, $type, "class='form-control chosen'");
?>
<?php if($showOS):?>
<span class='input-group-addon fix-border'><?php echo $lang->bug->os?></span>
<?php echo html::select('os', $lang->bug->osList, $os, "class='form-control chosen'");?>
<?php endif;?>
<?php if($showBrowser):?>
<span class='input-group-addon fix-border'><?php echo $lang->bug->browser?></span>
<?php echo html::select('browser', $lang->bug->browserList, $browser, "class='form-control chosen'");?>
<?php endif;?>
</div>
</td>
<?php endif;?>
<?php if($showProject):?>
<th><?php echo $lang->bug->project;?></th>
<td><span id='projectIdBox'><?php echo html::select('project', $projects, $projectID, "class='form-control chosen' onchange='loadProjectRelated(this.value)' autocomplete='off'");?></span></td>
<?php endif;?>
</tr>
<?php endif;?>
<tr>
<th><?php echo $lang->bug->openedBuild?></th>
<td>
<div class='input-group'>
<span class='input-group-addon w-90px'><?php echo $lang->bug->openedBuild?></span>
<span id='buildBox'><?php echo html::select('openedBuild[]', $builds, $buildID, "size=4 multiple=multiple class='chosen form-control'");?></span>
<div class='input-group' id='buildBox'><?php echo html::select('openedBuild[]', $builds, $buildID, "size=4 multiple=multiple class='chosen form-control'");?></div>
<span class='input-group-addon fix-border' id='buildBoxActions'></span>
<span class='input-group-btn'><?php echo html::commonButton($lang->bug->allBuilds, "class='btn btn-default' data-toggle='tooltip' onclick='loadAllBuilds()'")?></span>
<div class='input-group-btn'><?php echo html::commonButton($lang->bug->allBuilds, "class='btn btn-default' data-toggle='tooltip' onclick='loadAllBuilds()'")?></div>
</div>
</td>
</tr>
@@ -105,20 +85,71 @@ js::set('confirmDeleteTemplate', $lang->bug->confirmDeleteTemplate);
<th><nobr><?php echo $lang->bug->lblAssignedTo;?></nobr></th>
<td>
<div class='input-group'>
<span id='assignedToBox'><?php echo html::select('assignedTo', $projectMembers, $assignedTo, "class='form-control chosen'");?></span>
<div class='input-group' id='assignedToBox'><?php echo html::select('assignedTo', $projectMembers, $assignedTo, "class='form-control chosen'");?></div>
<span class='input-group-btn'><?php echo html::commonButton($lang->bug->allUsers, "class='btn btn-default' onclick='loadAllUsers()' data-toggle='tooltip'");?></span>
</div>
</td>
<?php $showDeadline = strpos(",$showFields,", ',deadline,') !== false;?>
<?php if($showDeadline):?>
<td>
<div class='input-group'>
<span class='input-group-addon w-90px'><?php echo $lang->bug->deadline?></span>
<span><?php echo html::input('deadline', $deadline, "class='form-control form-date'");?></span>
</div>
</td>
<?php endif;?>
</tr>
<?php $showDeadline = strpos(",$showFields,", ',deadline,') !== false;?>
<?php if($showDeadline):?>
<tr>
<th><?php echo $lang->bug->deadline?></th>
<td><?php echo html::input('deadline', $deadline, "class='form-control form-date'");?></td>
</tr>
<?php endif;?>
<?php if(strpos(",$showFields,", ',severity,') !== false):?>
<tr>
<th><?php echo $lang->bug->severity;?></th>
<td>
<?php
$hasCustomSeverity = false;
foreach($lang->bug->severityList as $severityKey => $severityValue)
{
if(!empty($severityKey) and (string)$severityKey != (string)$severityValue)
{
$hasCustomSeverity = true;
break;
}
}
?>
<?php if($hasCustomSeverity):?>
<?php echo html::select('severity', (array)$lang->bug->severityList, $severity, "class='form-control chosen'");?>
<?php else: ?>
<?php echo html::select('severity', (array)$lang->bug->severityList, $severity, "class='form-control' data-provide='labelSelector' data-label-class='label-severity'");?>
<?php endif; ?>
</td>
</tr>
<?php endif;?>
<?php if(strpos(",$showFields,", ',pri,') !== false):?>
<tr>
<th><?php echo $lang->bug->pri;?></th>
<td>
<?php
$hasCustomPri = false;
foreach($lang->bug->priList as $priKey => $priValue)
{
if(!empty($priKey) and (string)$priKey != (string)$priValue)
{
$hasCustomPri = true;
break;
}
}
$priList = $lang->bug->priList;
if(end($priList))
{
unset($priList[0]);
$priList[0] = '';
}
?>
<?php if($hasCustomPri):?>
<?php echo html::select('pri', (array)$priList, $pri, "class='form-control chosen'");?>
<?php else: ?>
<?php echo html::select('pri', (array)$priList, $pri, "class='form-control' data-provide='labelSelector'");?>
<?php endif; ?>
</td>
</tr>
<?php endif;?>
<?php if($this->config->global->flow != 'onlyTest' && $showProject):?>
<?php $showOS = strpos(",$showFields,", ',os,') !== false;?>
<?php $showBrowser = strpos(",$showFields,", ',browser,') !== false;?>
@@ -148,64 +179,15 @@ js::set('confirmDeleteTemplate', $lang->bug->confirmDeleteTemplate);
<tr>
<th><?php echo $lang->bug->title;?></th>
<td colspan='2'>
<div class='input-group'>
<input type='hidden' id='color' name='color' data-provide='colorpicker' data-wrapper='input-group-btn' data-pull-menu-right='false' data-btn-tip='<?php echo $lang->bug->colorTag ?>' data-update-text='#title' value='<?php echo $color;?>'>
<?php echo html::input('title', $bugTitle, "class='form-control'");?>
<?php $showSeverity = strpos(",$showFields,", ',severity,') !== false;?>
<?php $showPri = strpos(",$showFields,", ',pri,') !== false;?>
<?php if($showSeverity or $showPri):?>
<?php $widthClass = (!$showSeverity or !$showPri) ? 'w-100px' : 'w-230px';?>
<?php if($showSeverity):?>
<span class='input-group-addon fix-border'><?php echo $lang->bug->severity;?></span>
<?php
$hasCustomSeverity = false;
foreach($lang->bug->severityList as $severityKey => $severityValue)
{
if(!empty($severityKey) and (string)$severityKey != (string)$severityValue)
{
$hasCustomSeverity = true;
break;
}
}
?>
<?php if($hasCustomSeverity):?>
<?php echo html::select('severity', (array)$lang->bug->severityList, $severity, "class='form-control minw-80px chosen'");?>
<?php else: ?>
<div class='input-group-btn dropdown-pris' data-prefix='severity'>
<button type='button' class='btn dropdown-toggle br-0' data-toggle='dropdown'>
<span class='pri-text'></span> &nbsp;<span class='caret'></span>
</button>
<ul class='dropdown-menu pull-right'></ul>
<?php echo html::select('severity', (array)$lang->bug->severityList, $severity, "class='hide'");?>
</div>
<?php endif; ?>
<?php endif;?>
<?php if($showPri):?>
<span class='input-group-addon fix-border'><?php echo $lang->bug->pri;?></span>
<?php
$hasCustomPri = false;
foreach($lang->bug->priList as $priKey => $priValue)
{
if(!empty($priKey) and (string)$priKey != (string)$priValue)
{
$hasCustomPri = true;
break;
}
}
?>
<?php if($hasCustomPri):?>
<?php echo html::select('pri', (array)$lang->bug->priList, $pri, "class='form-control minw-80px chosen'");?>
<?php else: ?>
<div class='input-group-btn dropdown-pris'>
<button type='button' class='btn dropdown-toggle br-0' data-toggle='dropdown'>
<span class='pri-text'></span> &nbsp;<span class='caret'></span>
</button>
<ul class='dropdown-menu pull-right'></ul>
<?php echo html::select('pri', $lang->bug->priList, $pri, "class='hide'");?>
</div>
<?php endif;?>
<?php endif;?>
<?php endif;?>
<div class="input-control has-icon-right">
<?php echo html::input('title', $bugTitle, "class='form-control' autocomplete='off' required");?>
<div class="colorpicker">
<button type="button" class="btn btn-link dropdown-toggle" data-toggle="dropdown"><span class="cp-title"></span><span class="color-bar"></span><i class="ic"></i></button>
<ul class="dropdown-menu clearfix">
<li class="heading"><?php echo $lang->story->colorTag;?><i class="icon icon-close"></i></li>
</ul>
<input type="hidden" class="colorpicker" id="color" name="color" value="" data-icon="color" data-wrapper="input-control-icon-right" data-update-color="#title" data-provide="colorpicker">
</div>
</div>
</td>
</tr>
@@ -230,36 +212,26 @@ js::set('confirmDeleteTemplate', $lang->bug->confirmDeleteTemplate);
$showStory = strpos(",$showFields,", ',story,') !== false;
$showTask = strpos(",$showFields,", ',task,') !== false;
?>
<?php if(($showStory or $showTask) and $this->config->global->flow != 'onlyTest'):?>
<?php if($showStory and $this->config->global->flow != 'onlyTest'):?>
<tr>
<th><?php echo ($showStory) ? $lang->bug->story : $lang->bug->task;?></th>
<?php if($showStory):?>
<td>
<span id='storyIdBox'><?php echo html::select('story', empty($stories) ? '' : $stories, $storyID, "class='form-control chosen'");?></span>
</td>
<?php endif;?>
<?php if($showTask):?>
<td>
<div class='input-group'>
<?php if($showStory):?>
<span class='input-group-addon w-90px'><?php echo $lang->bug->task?></span>
<?php endif;?>
<span id='taskIdBox'> <?php echo html::select('task', '', $taskID, "class='form-control chosen'") . html::hidden('oldTaskID', $taskID);?></span>
</div>
</td>
<?php endif;?>
<th><?php echo $lang->bug->story;?></th>
<td colspan='2'><div id='storyIdBox' class='input-group'><?php echo html::select('story', empty($stories) ? '' : $stories, $storyID, "class='form-control chosen'");?></div></td>
</tr>
<?php endif;?>
<?php if($showTask and $this->config->global->flow != 'onlyTest'):?>
<tr>
<th><?php echo $lang->bug->task;?></th>
<td colspan='2'><div id='taskIdBox' class='input-group'> <?php echo html::select('task', '', $taskID, "class='form-control chosen'") . html::hidden('oldTaskID', $taskID);?></div></td>
</tr>
<?php endif;?>
<?php
$showMailto = strpos(",$showFields,", ',mailto,') !== false;
$showKeywords = strpos(",$showFields,", ',keywords,') !== false;
?>
<?php if($showMailto or $showKeywords):?>
<?php $colspan = ($showMailto and $showKeywords) ? '' : "colspan='2'";?>
<?php if($showMailto):?>
<tr>
<th><?php echo ($showMailto) ? $lang->bug->lblMailto : $lang->bug->keywords;?></th>
<?php if($showMailto):?>
<td>
<th><?php echo $lang->bug->lblMailto;?></th>
<td colspan='2'>
<div class='input-group' id='contactListGroup'>
<?php
echo html::select('mailto[]', $users, str_replace(' ', '', $mailto), "class='form-control chosen' multiple");
@@ -267,17 +239,12 @@ js::set('confirmDeleteTemplate', $lang->bug->confirmDeleteTemplate);
?>
</div>
</td>
<?php endif;?>
<?php if($showKeywords):?>
<td <?php echo $colspan?>>
<div class='input-group'>
<?php if($showMailto):?>
<span class='input-group-addon w-90px' id='keywordsAddonLabel'><?php echo $lang->bug->keywords;?></span>
<?php endif;?>
<?php echo html::input('keywords', $keywords, "class='form-control'");?>
</div>
</td>
<?php endif;?>
</tr>
<?php endif;?>
<?php if($showKeywords):?>
<tr>
<th><?php echo $lang->bug->keywords;?></th>
<td colspan='2'><?php echo html::input('keywords', $keywords, "class='form-control'");?></td>
</tr>
<?php endif;?>
<tr>
@@ -318,5 +285,4 @@ js::set('confirmDeleteTemplate', $lang->bug->confirmDeleteTemplate);
</div>
</div>
</div>
<?php js::set('bugModule', $lang->bug->module);?>
<?php include '../../common/view/footer.html.php';?>