This commit is contained in:
Catouse
2018-05-14 18:41:59 +08:00
16 changed files with 379 additions and 310 deletions
+16 -16
View File
@@ -244,6 +244,11 @@ class block extends control
{
if($module == 'product' && common::hasPriv('product', 'create')) $block->actionLink = html::a($this->createLink('product', 'create'), "<i class='icon icon-sm icon-plus'></i> " . $this->lang->product->create, '', "class='btn btn-sm'");
if($module == 'project' && common::hasPriv('project', 'create')) $block->actionLink = html::a($this->createLink('project', 'create'), "<i class='icon icon-sm icon-plus'></i> " . $this->lang->project->create, '', "class='btn btn-sm'");
if($module == 'qa' && common::hasPriv('testcase', 'create'))
{
$this->app->loadLang('testcase');
$block->actionLink = html::a($this->createLink('testcase', 'create', 'productID='), "<i class='icon icon-sm icon-plus'></i> " . $this->lang->testcase->create, '', "class='btn btn-sm'");
}
}
if($this->block->isLongBlock($block))
@@ -1075,29 +1080,24 @@ class block extends control
*/
public function printQaOverviewBlock()
{
$projects = $this->loadModel('project')->getList();
$casePairs = $this->dao->select('lastRunResult, COUNT(*) AS count')->from(TABLE_CASE)->groupBy('lastRunResult')->fetchPairs();
$total = array_sum($casePairs);
$total = 0;
foreach($projects as $project)
$this->app->loadLang('testcase');
foreach($this->lang->testcase->resultList as $result => $label)
{
if(!$this->project->checkPriv($project)) continue;
if(!isset($overview[$project->status])) $overview[$project->status] = 0;
$overview[$project->status]++;
$total++;
if(!isset($casePairs[$result])) $casePairs[$result] = 0;
}
$overviewPercent = array();
foreach($this->lang->project->statusList as $statusKey => $statusName)
$casePercents = array();
foreach($casePairs as $result => $count)
{
if(!isset($overview[$statusKey])) $overview[$statusKey] = 0;
$overviewPercent[$statusKey] = round($overview[$statusKey] / $total, 2) * 100 . '%';
$casePercents[$result] = $total ? round($count / $total * 100, 2) : 0;
}
$this->view->total = $total;
$this->view->overview = $overview;
$this->view->overviewPercent = $overviewPercent;
$this->view->total = $total;
$this->view->casePairs = $casePairs;
$this->view->casePercents = $casePercents;
}
/**
+24 -2
View File
@@ -403,6 +403,7 @@ class blockModel extends model
{
if($module == 'product') return $this->getProductStatisticParams($module);
if($module == 'project') return $this->getProjectStatisticParams($module);
if($module == 'qa') return $this->getQaStatisticParams($module);
$params = new stdclass();
$params = $this->onlyNumParams($params);
@@ -427,7 +428,7 @@ class blockModel extends model
$params->orderBy['options'] = $this->lang->block->orderByList->product;
$params->orderBy['control'] = 'select';
return json_encode($this->onlyNumParams($params));
return json_encode($params);
}
/**
@@ -448,7 +449,28 @@ class blockModel extends model
$params->orderBy['options'] = $this->lang->block->orderByList->project;
$params->orderBy['control'] = 'select';
return json_encode($this->onlyNumParams($params));
return json_encode($params);
}
/**
* Get qa statistic params.
*
* @access public
* @return void
*/
public function getQaStatisticParams()
{
$params = new stdclass();
$params->type['name'] = $this->lang->block->type;
$params->type['options'] = $this->lang->block->typeList->product;
$params->type['control'] = 'select';
$params->orderBy['name'] = $this->lang->block->orderBy;
$params->orderBy['default'] = 'id_desc';
$params->orderBy['options'] = $this->lang->block->orderByList->product;
$params->orderBy['control'] = 'select';
return json_encode($params);
}
/**
+9 -11
View File
@@ -14,21 +14,19 @@
.block-overview .tile-amount {font-size: 48px; margin-bottom: 10px;}
</style>
<div class="panel-body table-row">
<div class="col-4 text-middle text-center">
<div class="col-6 text-middle text-center">
<div class="tile">
<div class="tile-title"><?php echo $lang->project->allProject;?></div>
<div class="tile-title"><?php echo $lang->testcase->allTestcases;?></div>
<div class="tile-amount"><?php echo $total;?></div>
<a class="btn btn-primary btn-circle btn-icon-right btn-sm" href="<?php echo $this->createLink('project', 'all');?>"><?php echo $lang->project->viewAll;?> <span class="label label-badge label-icon"><i class="icon icon-arrow-right"></i></span></a>
<?php if(common::hasPriv('testcase', 'browse')):?>
<a href='<?php echo $this->createLink('testcase', 'browse');?>' class="btn btn-primary btn-circle btn-icon-right btn-sm"><?php echo $lang->testcase->viewAll;?><span class="label label-badge label-icon"><i class="icon icon-arrow-right"></i></span></a>
<?php endif;?>
</div>
</div>
<div class="col-8 text-middle">
<ul class="status-bars">
<?php foreach($lang->project->statusList as $statusKey => $statusName):?>
<li>
<span class="value"><?php echo $overview[$statusKey];?></span>
<span class="bar" style="height: <?php echo $overviewPercent[$statusKey];?>"></span>
<span class="title"><?php echo $statusName;?></span>
</li>
<div class="col-6 text-middle">
<ul class="status-bars-h">
<?php foreach(array('pass', 'fail', 'blocked') as $result):?>
<li><span class="bar" style="width: <?php echo $casePercents[$result];?>%"><span class="title"><?php echo $lang->testcase->resultList[$result];?></span><span class="value"><?php echo $casePairs[$result];?></span></span></li>
<?php endforeach;?>
</ul>
</div>
+1
View File
@@ -129,6 +129,7 @@ $lang->bug->resolvedByMeAB = '由我解決';
$lang->bug->ditto = '同上';
$lang->bug->dittoNotice = '該bug與上一bug不屬於同一產品!';
$lang->bug->noAssigned = '未指派';
$lang->bug->noBug = '暫時沒有BUG,您現在可以';
/* 頁面標籤。*/
$lang->bug->lblAssignedTo = '當前指派';
+30 -12
View File
@@ -279,20 +279,39 @@ $lang->bug->menu->caselib = array('link' => '用例庫|testsuite|library');
$lang->testcase = new stdclass();
$lang->testcase->menu = new stdclass();
$lang->testcase->menu->bug = array('link' => 'Bug|bug|browse|productID=%s');
$lang->testcase->menu->testcase = array('link' => '用例|testcase|browse|productID=%s', 'alias' => 'view,create,batchcreate,edit,batchedit,showimport,groupcase,importfromlib', 'subModule' => 'tree');
$lang->testcase->menu->testtask = array('link' => '測試單|testtask|browse|productID=%s', 'alias' => 'view,create,edit,linkcase,cases,start,close,batchrun,groupcase,report');
$lang->testcase->menu->testsuite = array('link' => '套件|testsuite|browse|productID=%s', 'alias' => 'view,create,edit,linkcase');
$lang->testcase->menu->report = array('link' => '報告|testreport|browse|productID=%s', 'alias' => 'view,create,edit');
$lang->testcase->menu->testtask = array('link' => '測試單|testtask|browse|productID=%s');
$lang->testcase->menu->testsuite = array('link' => '套件|testsuite|browse|productID=%s');
$lang->testcase->menu->report = array('link' => '報告|testreport|browse|productID=%s');
$lang->testcase->menu->caselib = array('link' => '用例庫|testsuite|library');
$lang->testtask = new stdclass();
$lang->testtask->menu = $lang->testcase->menu;
$lang->testtask->menu = new stdclass();
$lang->testtask->menu->bug = array('link' => 'Bug|bug|browse|productID=%s');
$lang->testtask->menu->testcase = array('link' => '用例|testcase|browse|productID=%s');
$lang->testtask->menu->testtask = array('link' => '測試單|testtask|browse|productID=%s', 'alias' => 'view,create,edit,linkcase,cases,start,close,batchrun,groupcase,report');
$lang->testtask->menu->testsuite = array('link' => '套件|testsuite|browse|productID=%s');
$lang->testtask->menu->report = array('link' => '報告|testreport|browse|productID=%s');
$lang->testtask->menu->caselib = array('link' => '用例庫|testsuite|library');
$lang->testsuite = new stdclass();
$lang->testsuite->menu = $lang->testcase->menu;
$lang->testsuite->menu = new stdclass();
$lang->testsuite->menu->bug = array('link' => 'Bug|bug|browse|productID=%s');
$lang->testsuite->menu->testcase = array('link' => '用例|testcase|browse|productID=%s');
$lang->testsuite->menu->testtask = array('link' => '測試單|testtask|browse|productID=%s');
$lang->testsuite->menu->testsuite = array('link' => '套件|testsuite|browse|productID=%s', 'alias' => 'view,create,edit,linkcase');
$lang->testsuite->menu->report = array('link' => '報告|testreport|browse|productID=%s');
$lang->testsuite->menu->caselib = array('link' => '用例庫|testsuite|library');
$lang->testreport = new stdclass();
$lang->testreport->menu = $lang->testcase->menu;
$lang->testreport->menu = new stdclass();
$lang->testreport->menu->bug = array('link' => 'Bug|bug|browse|productID=%s');
$lang->testreport->menu->testcase = array('link' => '用例|testcase|browse|productID=%s');
$lang->testreport->menu->testtask = array('link' => '測試單|testtask|browse|productID=%s');
$lang->testreport->menu->testsuite = array('link' => '套件|testsuite|browse|productID=%s');
$lang->testreport->menu->report = array('link' => '報告|testreport|browse|productID=%s', 'alias' => 'view,create,edit');
$lang->testreport->menu->caselib = array('link' => '用例庫|testsuite|library');
$lang->caselib = new stdclass();
$lang->caselib->menu = new stdclass();
@@ -765,11 +784,10 @@ if(isset($config->global->flow) and $config->global->flow == 'onlyTest')
/* Adjust sub menu of caselib module. */
$lang->caselib->menu = new stdclass();
$lang->caselib->menu->lib = array('link' => '%s', 'fixed' => true);
$lang->caselib->menu->all = '所有|testsuite|library|libID=%s&browseType=all';
$lang->caselib->menu->wait = '待評審|testsuite|library|libID=%s&browseType=wait';
$lang->caselib->menu->view = '概況|testsuite|libview|libID=%s';
$lang->caselib->menu->create = array('link' => "<i class='icon-plus'></i> 創建庫|testsuite|createLib", 'float' => 'right');
$lang->caselib->menu->lib = array('link' => '%s', 'fixed' => true);
$lang->caselib->menu->all = '所有|testsuite|library|libID=%s&browseType=all';
$lang->caselib->menu->wait = '待評審|testsuite|library|libID=%s&browseType=wait';
$lang->caselib->menu->view = '概況|testsuite|libview|libID=%s';
$lang->caselib->menuOrder[5] = 'lib';
$lang->caselib->menuOrder[10] = 'all';
+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
{
+7 -5
View File
@@ -102,6 +102,7 @@ $lang->testcase->group = 'Group';
$lang->testcase->groupName = 'Group Name';
$lang->testcase->step = 'Step';
$lang->testcase->stepChild = 'Child';
$lang->testcase->viewAll = 'View All';
$lang->testcase->new = 'New';
@@ -111,11 +112,12 @@ $lang->testcase->deleteStep = 'Delete';
$lang->testcase->insertBefore = 'Inserted Before';
$lang->testcase->insertAfter = 'Inserted After';
$lang->testcase->assignToMe = 'AssignedToMe';
$lang->testcase->openedByMe = 'CreatedByMe';
$lang->testcase->allCases = 'All';
$lang->testcase->needConfirm = 'StoryChanged';
$lang->testcase->bySearch = 'Search';
$lang->testcase->assignToMe = 'AssignedToMe';
$lang->testcase->openedByMe = 'CreatedByMe';
$lang->testcase->allCases = 'All';
$lang->testcase->allTestcases = 'All Cases';
$lang->testcase->needConfirm = 'StoryChanged';
$lang->testcase->bySearch = 'Search';
$lang->testcase->lblStory = 'Story';
$lang->testcase->lblLastEdited = 'Last Edit';
+7 -6
View File
@@ -102,6 +102,7 @@ $lang->testcase->group = '分组';
$lang->testcase->groupName = '分组名称';
$lang->testcase->step = '步骤';
$lang->testcase->stepChild = '子步骤';
$lang->testcase->viewAll = '查看所有';
$lang->testcase->new = '新增';
@@ -111,11 +112,12 @@ $lang->testcase->deleteStep = '删除';
$lang->testcase->insertBefore = '之前添加';
$lang->testcase->insertAfter = '之后添加';
$lang->testcase->assignToMe = '给我的用例';
$lang->testcase->openedByMe = '我建的用例';
$lang->testcase->allCases = '所有';
$lang->testcase->needConfirm = '需求变动';
$lang->testcase->bySearch = '搜索';
$lang->testcase->assignToMe = '给我的用例';
$lang->testcase->openedByMe = '我建的用例';
$lang->testcase->allCases = '所有';
$lang->testcase->allTestcases = '所有用例';
$lang->testcase->needConfirm = '需求变动';
$lang->testcase->bySearch = '搜索';
$lang->testcase->lblStory = '相关需求';
$lang->testcase->lblLastEdited = '最后编辑';
@@ -201,4 +203,3 @@ $lang->testcase->featureBar['browse']['group'] = '分组查看';
$lang->testcase->featureBar['browse']['suite'] = '套件';
$lang->testcase->featureBar['browse']['zerocase'] = '零用例需求';
$lang->testcase->featureBar['groupcase'] = $lang->testcase->featureBar['browse'];
+7 -6
View File
@@ -102,6 +102,7 @@ $lang->testcase->group = '分組';
$lang->testcase->groupName = '分組名稱';
$lang->testcase->step = '步驟';
$lang->testcase->stepChild = '子步驟';
$lang->testcase->viewAll = '查看所有';
$lang->testcase->new = '新增';
@@ -111,11 +112,12 @@ $lang->testcase->deleteStep = '刪除';
$lang->testcase->insertBefore = '之前添加';
$lang->testcase->insertAfter = '之後添加';
$lang->testcase->assignToMe = '給我的用例';
$lang->testcase->openedByMe = '我建的用例';
$lang->testcase->allCases = '所有';
$lang->testcase->needConfirm = '需求變動';
$lang->testcase->bySearch = '搜索';
$lang->testcase->assignToMe = '給我的用例';
$lang->testcase->openedByMe = '我建的用例';
$lang->testcase->allCases = '所有';
$lang->testcase->allTestcases = '所有用例';
$lang->testcase->needConfirm = '需求變動';
$lang->testcase->bySearch = '搜索';
$lang->testcase->lblStory = '相關需求';
$lang->testcase->lblLastEdited = '最後編輯';
@@ -201,4 +203,3 @@ $lang->testcase->featureBar['browse']['group'] = '分組查看';
$lang->testcase->featureBar['browse']['suite'] = '套件';
$lang->testcase->featureBar['browse']['zerocase'] = '零用例需求';
$lang->testcase->featureBar['groupcase'] = $lang->testcase->featureBar['browse'];
+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';?>
+2
View File
@@ -1,3 +1,5 @@
#begin_chosen{width:50% !important;}
.switchDate{border-left: none;}
#end_chosen .chosen-single{border-left: none;}
.cycleConfig .checkbox-primary{float:left; width:100px;}
.cycleConfig .tab-pane{padding:8px 0px;}
+120 -101
View File
@@ -14,112 +14,131 @@
<?php include '../../common/view/datepicker.html.php';?>
<?php include '../../common/view/kindeditor.html.php';?>
<?php js::set('noTodo', $lang->todo->noTodo);?>
<div class='container mw-1400px'>
<div id='titlebar'>
<div class='heading'>
<span class='prefix'><?php echo html::icon($lang->icons['todo']);?></span>
<strong><small class='text-muted'><?php echo html::icon($lang->icons['create']);?></small> <?php echo $lang->todo->create;?></strong>
<div id='mainContent' class='main-content'>
<div class='center-block mw-1400px'>
<div class='main-header'>
<h2><?php echo $lang->todo->create;?></h2>
</div>
</div>
<form class='form-condensed' method='post' target='hiddenwin' id='dataform'>
<table class='table table-form'>
<tr>
<th class='w-80px'><?php echo $lang->todo->date;?></th>
<td class='w-p25-f'>
<div class='input-group'>
<?php echo html::input('date', $date, "class='form-control form-date'");?>
<span class='input-group-addon switchDate'><input type='checkbox' id='switchDate' onclick='switchDateTodo(this);'> <?php echo $lang->todo->periods['future'];?></span>
<span class='input-group-addon'><input type='checkbox' id='cycle' name='cycle' value='1'> <?php echo $lang->todo->cycle;?></span>
</div>
</td><td></td>
</tr>
<tr class='cycleConfig hidden'>
<th><?php echo $lang->todo->cycleConfig;?></th>
<td colspan='2'>
<ul class="nav nav-tabs">
<li class="active"><a data-tab data-type='day' href="#day"><?php echo $lang->todo->cycleDay;?></a></li>
<li><a data-tab data-type='week' href="#week"><?php echo $lang->todo->cycleWeek;?></a></li>
<li><a data-tab data-type='month' href="#month"><?php echo $lang->todo->cycleMonth;?></a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="day">
<div class='input-group w-150px'>
<span class='input-group-addon'><?php echo $lang->todo->every;?></span>
<?php echo html::input('config[day]', 1, "class='form-control'")?>
<span class='input-group-addon'><?php echo $lang->todo->cycleDay;?></span>
<form method='post' target='hiddenwin' id='dataform'>
<table class='table table-form'>
<tr>
<th class='w-80px'><?php echo $lang->todo->date;?></th>
<td class='w-p25-f'>
<div class='input-group'>
<?php echo html::input('date', $date, "class='form-control form-date'");?>
<span class='input-group-addon switchDate'>
<div class='checkbox-primary'>
<input type='checkbox' id='switchDate' onclick='switchDateTodo(this);' />
<label for='switchDate'><?php echo $lang->todo->periods['future'];?></label>
</div>
</span>
<span class='input-group-addon'>
<div class='checkbox-primary'>
<input type='checkbox' id='cycle' name='cycle' value='1' />
<label for='cycle'><?php echo $lang->todo->cycle;?></label>
</div>
</span>
</div>
</td><td></td>
</tr>
<tr class='cycleConfig hidden'>
<th><?php echo $lang->todo->cycleConfig;?></th>
<td colspan='2'>
<ul class="nav nav-tabs">
<li class="active"><a data-tab data-type='day' href="#day"><?php echo $lang->todo->cycleDay;?></a></li>
<li><a data-tab data-type='week' href="#week"><?php echo $lang->todo->cycleWeek;?></a></li>
<li><a data-tab data-type='month' href="#month"><?php echo $lang->todo->cycleMonth;?></a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="day">
<div class='input-group w-150px'>
<span class='input-group-addon'><?php echo $lang->todo->every;?></span>
<?php echo html::input('config[day]', 1, "class='form-control'")?>
<span class='input-group-addon'><?php echo $lang->todo->cycleDay;?></span>
</div>
</div>
<div class="tab-pane clearfix" id="week">
<?php echo html::checkbox('config[week]', $lang->todo->dayNames)?>
</div>
<div class="tab-pane clearfix" id="month">
<?php
$days = array();
for($i = 1; $i <= 10; $i ++) $days[$i] = $i;
echo html::checkbox('config[month]', $days);
$days = array();
for($i = 11; $i <= 20; $i ++) $days[$i] = $i;
echo html::checkbox('config[month]', $days);
$days = array();
for($i = 21; $i <= 31; $i ++) $days[$i] = $i;
echo html::checkbox('config[month]', $days);
?>
</div>
</div>
<div class="tab-pane" id="week">
<?php echo html::checkbox('config[week]', $lang->todo->dayNames)?>
<?php echo html::hidden('config[type]', 'day')?>
<div class='input-group' style='width:200px; padding-top:5px;'>
<?php printf($lang->todo->beforeDays, html::input('config[beforeDays]', 0, "class='form-control'"));?>
</div>
<div class="tab-pane" id="month">
<?php
$days = array();
for($i = 1; $i <= 10; $i ++) $days[$i] = $i;
echo "<p class='box1-10'>" . html::checkbox('config[month]', $days) . '</p>';
$days = array();
for($i = 11; $i <= 20; $i ++) $days[$i] = $i;
echo "<p class='box11-20'>" . html::checkbox('config[month]', $days) . '</p>';
$days = array();
for($i = 21; $i <= 31; $i ++) $days[$i] = $i;
echo "<p class='box21-31'>" . html::checkbox('config[month]', $days) . '</p>';
?>
</td>
</tr>
<tr class='cycleConfig hidden'>
<th><?php echo $lang->todo->deadline;?></th>
<td><?php echo html::input("config[end]", '', "class='form-control form-date'");?></td>
</tr>
<tr>
<th><?php echo $lang->todo->type;?></th>
<td><?php echo html::select('type', $lang->todo->typeList, '', 'onchange=loadList(this.value); class=form-control');?></td>
</tr>
<tr>
<th><?php echo $lang->todo->pri;?></th>
<td><?php echo html::select('pri', $lang->todo->priList, '', "class='form-control chosen'");?></td>
</tr>
<tr>
<th><?php echo $lang->todo->name;?></th>
<td colspan='2'>
<div id='nameBox' class='hidden'><?php echo html::input('name', '', "class='form-control' autocomplete='off'");?></div>
<div class='nameBox'><?php echo html::input('name', '', "class='form-control' autocomplete='off'");?></div>
</td>
</tr>
<tr>
<th><?php echo $lang->todo->desc;?></th>
<td colspan='2'><?php echo html::textarea('desc', '', "rows='8' class='form-control'");?></td>
</tr>
<tr>
<th><?php echo $lang->todo->status;?></th>
<td><?php echo html::select('status', $lang->todo->statusList, '', "class='form-control chosen'");?></td>
</tr>
<tr>
<th><?php echo $lang->todo->beginAndEnd;?></th>
<td>
<div class='input-group'>
<?php echo html::select('begin', $times, date('Y-m-d') != $date ? key($times) : $time, 'onchange=selectNext(); class="form-control chosen" style="width: 50%;"') . html::select('end', $times, '', 'class="form-control chosen" style="width: 50%; margin-left:-1px"');?>
</div>
</div>
<?php echo html::hidden('config[type]', 'day')?>
<div class='input-group' style='width:200px; padding-top:5px;'>
<?php printf($lang->todo->beforeDays, html::input('config[beforeDays]', 0, "class='form-control'"));?>
</div>
</td>
</tr>
<tr class='cycleConfig hidden'>
<th><?php echo $lang->todo->deadline;?></th>
<td><?php echo html::input("config[end]", '', "class='form-control form-date'");?></td>
</tr>
<tr>
<th><?php echo $lang->todo->type;?></th>
<td><?php echo html::select('type', $lang->todo->typeList, '', 'onchange=loadList(this.value); class=form-control');?></td>
</tr>
<tr>
<th><?php echo $lang->todo->pri;?></th>
<td><?php echo html::select('pri', $lang->todo->priList, '', "class='form-control chosen'");?></td>
</tr>
<tr>
<th><?php echo $lang->todo->name;?></th>
<td colspan='2'>
<div id='nameBox' class='hidden'><?php echo html::input('name', '', "class='form-control' autocomplete='off'");?></div>
<div class='nameBox'><?php echo html::input('name', '', "class='form-control' autocomplete='off'");?></div>
</td>
</tr>
<tr>
<th><?php echo $lang->todo->desc;?></th>
<td colspan='2'><?php echo html::textarea('desc', '', "rows='8' class='form-control'");?></td>
</tr>
<tr>
<th><?php echo $lang->todo->status;?></th>
<td><?php echo html::select('status', $lang->todo->statusList, '', "class='form-control chosen'");?></td>
</tr>
<tr>
<th><?php echo $lang->todo->beginAndEnd;?></th>
<td>
<div class='input-group'>
<?php echo html::select('begin', $times, date('Y-m-d') != $date ? key($times) : $time, 'onchange=selectNext(); class="form-control chosen" style="width: 50%;"') . html::select('end', $times, '', 'class="form-control chosen" style="width: 50%; margin-left:-1px"');?>
</div>
</td>
<td><input type='checkbox' id='switchDate' onclick='switchDateFeature(this);'> <?php echo $lang->todo->lblDisableDate;?></td>
</tr>
<tr>
<th><?php echo $lang->todo->private;?></th>
<td><input type='checkbox' name='private' id='private' value='1'></td>
</tr>
<tr>
<td></td>
<td colspan='2' class='text-center'>
<?php echo html::submitButton() . html::backButton();?>
</td>
</tr>
</table>
</form>
</td>
<td>
<div class='checkbox-primary'>
<input type='checkbox' id='switchDate' onclick='switchDateFeature(this);' />
<label for='switchDate'><?php echo $lang->todo->lblDisableDate;?></label>
</div>
</td>
</tr>
<tr>
<th><?php echo $lang->todo->private;?></th>
<td>
<div class='checkbox-primary'>
<input type='checkbox' name='private' id='private' value='1' />
<label for='private'></label>
</div>
</td>
</tr>
<tr>
<td></td>
<td colspan='2' class='text-center'>
<?php echo html::submitButton() . html::backButton();?>
</td>
</tr>
</table>
</form>
</div>
</div>
<script language='Javascript'>