* adjust for testtask create and edit page.

This commit is contained in:
wangyidong
2018-05-14 17:25:01 +08:00
parent b37ba6bd81
commit 00aa64c979
6 changed files with 156 additions and 151 deletions
+1 -1
View File
@@ -23,7 +23,7 @@
$fileContent = file_get_contents($file->realPath);
if($charset != $config->charset)
{
$fileContent = helper::convertEncoding($fileContent, $charset, $config->charset);
$fileContent = helper::convertEncoding($fileContent, $charset . "//IGNORE", $config->charset);
}
else
{
+8
View File
@@ -20,3 +20,11 @@ $(document).ready(function()
}
});
})
function adjustPriBoxWidth()
{
var boxWidth = $('#ownerAndPriBox').width();
var beginWidth = $("input[name='begin']").outerWidth();
var addonWidth = $('#ownerAndPriBox .input-group-addon').outerWidth();
$('#pri,#pri_chosen .chosen-single').css('width', boxWidth - beginWidth -addonWidth);
}
+1 -1
View File
@@ -61,5 +61,5 @@ function suitEndDate()
/* If the mouse hover over the manage contacts button, give tip. */
$(function()
{
$('[data-toggle=tooltip]').tooltip();
adjustPriBoxWidth();
});
+1 -8
View File
@@ -27,12 +27,5 @@ function loadProjectBuilds(projectID)
$(function()
{
var adjustPriBoxWidth = function()
{
var boxWidth = $('#ownerAndPriBox').width();
var beginWidth = $("input[name='begin']").outerWidth();
var addonWidth = $('#ownerAndPriBox .input-group-addon').outerWidth();
$('#pri').css('width', boxWidth - beginWidth -addonWidth);
};
adjustPriBoxWidth();//Adjust testtask pri box width.
adjustPriBoxWidth();
})
+76 -73
View File
@@ -14,80 +14,83 @@
<?php include '../../common/view/datepicker.html.php';?>
<?php include '../../common/view/kindeditor.html.php';?>
<?php js::import($jsRoot . 'misc/date.js');?>
<div class='container mw-1400px'>
<div id='titlebar'>
<div class='heading'>
<span class='prefix'><?php echo html::icon($lang->icons['testtask']);?></span>
<strong><small class='text-muted'><?php echo html::icon($lang->icons['create']);?></small> <?php echo $lang->testtask->create;?></strong>
<div id='mainContent' class='main-content'>
<div class='center-block mw-1400px'>
<div class='main-header'>
<h2><?php echo $lang->testtask->create;?></h2>
</div>
<form method='post' target='hiddenwin' id='dataform'>
<table class='table table-form'>
<?php if(isset($projectID)):?>
<tr>
<th class='w-80px'><?php echo $lang->testtask->product;?></th>
<td class='w-p35-f'><?php echo html::select('product', $products, $productID, "class='form-control chosen'");?></td><td></td>
</tr>
<?php else:?>
<tr class='hide'>
<th class='w-80px'><?php echo $lang->testtask->product;?></th>
<td class='w-p35-f'><?php echo html::input('product', $productID, "class='form-control'");?></td><td></td>
</tr>
<?php endif;?>
<?php if($this->config->global->flow != 'onlyTest'):?>
<tr>
<th class='w-80px'><?php echo $lang->testtask->project;?></th>
<td class='w-p35-f'><?php echo html::select('project', $projects, '', "class='form-control chosen' onchange='loadProjectRelated(this.value)'");?></td><td></td>
</tr>
<?php endif;?>
<tr>
<th class='w-80px'><?php echo $lang->testtask->build;?></th>
<td class='w-p35-f'><span id='buildBox'><?php echo html::select('build', $builds, $build, "class='form-control chosen'");?></span></td>
<td></td>
</tr>
<tr>
<th><?php echo $lang->testtask->owner;?></th>
<td>
<div id='ownerAndPriBox' class='input-group'>
<?php echo html::select('owner', $users, '', "class='form-control chosen'");?>
<span class='input-group-addon fix-border'><?php echo $lang->testtask->pri;?></span>
<?php echo html::select('pri', $lang->testtask->priList, 0, "class='form-control chosen'");?>
</div>
</td>
</tr>
<tr>
<th><?php echo $lang->testtask->begin;?></th>
<td>
<div class='input-group'>
<?php echo html::input('begin', '', "class='form-control form-date' onchange='suitEndDate()'");?>
<span class='input-group-addon fix-border'><?php echo $lang->testtask->end;?></span>
<?php echo html::input('end', '', "class='form-control form-date'");?>
</div>
</td>
</tr>
<tr>
<th><?php echo $lang->testtask->status;?></th>
<td><?php echo html::select('status', $lang->testtask->statusList, '', "class='form-control chosen'");?></td>
</tr>
<tr>
<th><?php echo $lang->testtask->name;?></th>
<td colspan='2'><?php echo html::input('name', '', "class='form-control' autocomplete='off'");?></td>
</tr>
<tr>
<th><?php echo $lang->testtask->desc;?></th>
<td colspan='2'><?php echo html::textarea('desc', '', "rows=10 class='form-control'");?></td>
</tr>
<tr>
<th><?php echo $lang->testtask->mailto;?></th>
<td colspan='2'>
<div id='mailtoGroup' class='input-group'>
<?php
echo html::select('mailto[]', $users, '', "multiple class='form-control'");
echo $this->fetch('my', 'buildContactLists');
?>
</div>
</td>
</tr>
<tr>
<td></td><td colspan='2'><?php echo html::submitButton() . html::backButton();?> </td>
</tr>
</table>
</form>
</div>
<form class='form-condensed' method='post' target='hiddenwin' id='dataform'>
<table class='table table-form'>
<?php if(isset($projectID)):?>
<tr>
<th class='w-90px'><?php echo $lang->testtask->product;?></th>
<td class='w-p25-f'><?php echo html::select('product', $products, $productID, "class='form-control chosen'");?></td><td></td>
</tr>
<?php else:?>
<tr class='hide'>
<th class='w-90px'><?php echo $lang->testtask->product;?></th>
<td class='w-p25-f'><?php echo html::input('product', $productID, "class='form-control'");?></td><td></td>
</tr>
<?php endif;?>
<?php if($this->config->global->flow != 'onlyTest'):?>
<tr>
<th class='w-90px'><?php echo $lang->testtask->project;?></th>
<td class='w-p25-f'><?php echo html::select('project', $projects, '', "class='form-control chosen' onchange='loadProjectRelated(this.value)'");?></td><td></td>
</tr>
<?php endif;?>
<tr>
<th class='w-90px'><?php echo $lang->testtask->build;?></th>
<td class='w-p25-f'><span id='buildBox'><?php echo html::select('build', $builds, $build, "class='form-control chosen'");?></span></td>
<td></td>
</tr>
<tr>
<th><?php echo $lang->testtask->owner;?></th>
<td><?php echo html::select('owner', $users, '', "class='form-control chosen'");?></td>
</tr>
<tr>
<th><?php echo $lang->testtask->pri;?></th>
<td><?php echo html::select('pri', $lang->testtask->priList, 0, "class='form-control'");?></td>
</tr>
<tr>
<th><?php echo $lang->testtask->begin;?></th>
<td><?php echo html::input('begin', '', "class='form-control form-date' onchange='suitEndDate()'");?></td>
</tr>
<tr>
<th><?php echo $lang->testtask->end;?></th>
<td><?php echo html::input('end', '', "class='form-control form-date'");?></td>
</tr>
<tr>
<th><?php echo $lang->testtask->status;?></th>
<td><?php echo html::select('status', $lang->testtask->statusList, '', "class='form-control'");?></td>
</tr>
<tr>
<th><?php echo $lang->testtask->name;?></th>
<td colspan='2'><?php echo html::input('name', '', "class='form-control' autocomplete='off'");?></td>
</tr>
<tr>
<th><?php echo $lang->testtask->desc;?></th>
<td colspan='2'><?php echo html::textarea('desc', '', "rows=10 class='form-control'");?></td>
</tr>
<tr>
<th><?php echo $lang->testtask->mailto;?></th>
<td colspan='2'>
<div id='mailtoGroup' class='input-group'>
<?php
echo html::select('mailto[]', $users, '', "multiple class='form-control'");
echo $this->fetch('my', 'buildContactLists');
?>
</div>
</td>
</tr>
<tr>
<td></td><td colspan='2'><?php echo html::submitButton() . html::backButton();?> </td>
</tr>
</table>
</form>
</div>
<?php include '../../common/view/footer.html.php';?>
+69 -68
View File
@@ -13,75 +13,76 @@
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/datepicker.html.php';?>
<?php include '../../common/view/kindeditor.html.php';?>
<div class='container mw-1400px'>
<div id='titlebar'>
<div class='heading'>
<span class='prefix' title='TESTTASK'><?php echo html::icon($lang->icons['testtask']);?></span>
<strong><?php echo html::a($this->createLink('testtask', 'view', 'taskID=' . $task->id), $task->name, '_blank');?></strong>
<small class='text-muted'> <?php echo $lang->testtask->edit;?> <?php echo html::icon($lang->icons['edit']);?></small>
<div id='mainContent' class='main-content'>
<div class='center-block mw-1400px'>
<div class='main-header'>
<h2>
<?php echo html::a($this->createLink('testtask', 'view', 'taskID=' . $task->id), $task->name, '_blank');?>
<small class='text-muted'><?php echo $lang->arrow . $lang->testtask->edit;?></small>
</h2>
</div>
<form method='post' target='hiddenwin' id='dataform'>
<table class='table table-form'>
<?php if($this->config->global->flow != 'onlyTest'):?>
<tr>
<th class='w-80px'><?php echo $lang->testtask->project;?></th>
<td class='w-p35-f'>
<?php echo html::select('project', $projects, $task->project, "class='form-control chosen' onchange='loadProjectRelated(this.value)'");?>
</td>
<td></td>
</tr>
<?php endif;?>
<tr>
<th class='w-80px'><?php echo $lang->testtask->build;?></th>
<td class='w-p35-f'><span id='buildBox'><?php echo html::select('build', $builds, $task->build, "class='form-control chosen'");?></span></td>
<td></td>
</tr>
<tr>
<th><?php echo $lang->testtask->owner;?></th>
<td>
<div id='ownerAndPriBox' class='input-group'>
<?php echo html::select('owner', $users, $task->owner, "class='form-control chosen'");?>
<span class='input-group-addon fix-border'><?php echo $lang->testtask->pri;?></span>
<?php echo html::select('pri', $lang->testtask->priList, $task->pri, "class='form-control chosen'");?>
</div>
</td>
</tr>
<tr>
<th><?php echo $lang->testtask->begin;?></th>
<td>
<div class='input-group'>
<?php echo html::input('begin', $task->begin, "class='form-control form-date'");?>
<span class='input-group-addon fix-border'><?php echo $lang->testtask->end;?></span>
<?php echo html::input('end', $task->end, "class='form-control form-date'");?>
</div>
</td>
</tr>
<tr>
<th><?php echo $lang->testtask->status;?></th>
<td><?php echo html::select('status', $lang->testtask->statusList, $task->status, "class='form-control chosen'");?></td>
</tr>
<tr>
<th><?php echo $lang->testtask->name;?></th>
<td colspan='2'><?php echo html::input('name', $task->name, "class='form-control' autocomplete='off'");?></td>
</tr>
<tr>
<th><?php echo $lang->testtask->desc;?></th>
<td colspan='2'><?php echo html::textarea('desc', htmlspecialchars($task->desc), "rows=10 class='form-control'");?></td>
</tr>
<tr>
<th><?php echo $lang->testtask->mailto;?></th>
<td colspan='2'>
<div class='input-group'>
<?php echo html::select('mailto[]', $users, str_replace(' ' , '', $task->mailto), "multiple class='form-control'");?>
<?php if($contactLists) echo html::select('', $contactLists, '', "class='form-control chosen' onchange=\"setMailto('mailto', this.value)\"");?>
</div>
</td>
</tr>
<tr>
<td></td><td colspan='2'><?php echo html::submitButton() . html::backButton() . html::hidden('product', $task->product);?></td>
</tr>
</table>
</form>
</div>
<form class='form-condensed' method='post' target='hiddenwin' id='dataform'>
<table class='table table-form'>
<?php if($this->config->global->flow != 'onlyTest'):?>
<tr>
<th class='w-80px'><?php echo $lang->testtask->project;?></th>
<td class='w-p35-f'>
<?php echo html::select('project', $projects, $task->project, "class='form-control chosen' onchange='loadProjectRelated(this.value)'");?>
</td>
<td></td>
</tr>
<?php endif;?>
<tr>
<th class='w-80px'><?php echo $lang->testtask->build;?></th>
<td class='w-p35-f'><span id='buildBox'><?php echo html::select('build', $builds, $task->build, "class='form-control chosen'");?></span></td>
<td></td>
</tr>
<tr>
<th><?php echo $lang->testtask->owner;?></th>
<td>
<div id='ownerAndPriBox' class='input-group'>
<?php echo html::select('owner', $users, $task->owner, "class='form-control chosen'");?>
<span class='input-group-addon fix-border'><?php echo $lang->testtask->pri;?></span>
<?php echo html::select('pri', $lang->testtask->priList, $task->pri, "class='form-control'");?>
</div>
</td>
</tr>
<tr>
<th><?php echo $lang->testtask->begin;?></th>
<td>
<div class='input-group'>
<?php echo html::input('begin', $task->begin, "class='form-control form-date'");?>
<span class='input-group-addon fix-border'><?php echo $lang->testtask->end;?></span>
<?php echo html::input('end', $task->end, "class='form-control form-date'");?>
</div>
</td>
</tr>
<tr>
<th><?php echo $lang->testtask->status;?></th>
<td><?php echo html::select('status', $lang->testtask->statusList, $task->status, "class='form-control'");?></td>
</tr>
<tr>
<th><?php echo $lang->testtask->name;?></th>
<td colspan='2'><?php echo html::input('name', $task->name, "class='form-control' autocomplete='off'");?></td>
</tr>
<tr>
<th><?php echo $lang->testtask->desc;?></th>
<td colspan='2'><?php echo html::textarea('desc', htmlspecialchars($task->desc), "rows=10 class='form-control'");?></td>
</tr>
<tr>
<th><?php echo $lang->testtask->mailto;?></th>
<td colspan='2'>
<div class='input-group'>
<?php echo html::select('mailto[]', $users, str_replace(' ' , '', $task->mailto), "multiple class='form-control'");?>
<?php if($contactLists) echo html::select('', $contactLists, '', "class='form-control chosen' onchange=\"setMailto('mailto', this.value)\"");?>
</div>
</td>
</tr>
<tr>
<td></td><td colspan='2'><?php echo html::submitButton() . html::backButton() . html::hidden('product', $task->product);?></td>
</tr>
</table>
</form>
</div>
<?php include '../../common/view/footer.html.php';?>