Merge branch 'master' of github.com:easysoft/zentaopms

*deleted feedback and repo
This commit is contained in:
tengfei
2017-03-16 09:26:33 +08:00
89 changed files with 1083 additions and 656 deletions
+1 -1
View File
@@ -195,7 +195,7 @@ $config->objectTables['todo'] = TABLE_TODO;
$config->objectTables['custom'] = TABLE_LANG;
$config->objectTables['branch'] = TABLE_BRANCH;
$config->objectTables['module'] = TABLE_MODULE;
$config->objectTables['testlib'] = TABLE_TESTSUITE;
$config->objectTables['caselib'] = TABLE_TESTSUITE;
/* Include extension config files. */
$extConfigFiles = glob($configRoot . 'ext/*.php');
+1 -1
View File
@@ -46,4 +46,4 @@ CREATE TABLE `zt_testreport` (
`deleted` enum('0','1') NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
ALTER TABLE `zt_bug` ADD `deadline` date NOT NULL;
ALTER TABLE `zt_bug` ADD `deadline` date NOT NULL AFTER `assignedDate`;
+1 -1
View File
@@ -17,7 +17,7 @@ $config->action->objectNameFields['todo'] = 'name';
$config->action->objectNameFields['branch'] = 'name';
$config->action->objectNameFields['module'] = 'name';
$config->action->objectNameFields['testsuite'] = 'name';
$config->action->objectNameFields['testlib'] = 'name';
$config->action->objectNameFields['caselib'] = 'name';
$config->action->objectNameFields['testreport'] = 'title';
$config->action->commonImgSize = 870;
+2 -2
View File
@@ -62,7 +62,7 @@ $lang->action->objectTypes['todo'] = 'To-Dos';
$lang->action->objectTypes['branch'] = 'Branch';
$lang->action->objectTypes['module'] = 'Module';
$lang->action->objectTypes['testsuite'] = 'Suite';
$lang->action->objectTypes['testlib'] = 'Library';
$lang->action->objectTypes['caselib'] = 'Library';
$lang->action->objectTypes['testreport'] = 'Report';
/* 用来描述操作历史记录。*/
@@ -200,7 +200,7 @@ $lang->action->search->objectTypeList['release'] = 'Release';
$lang->action->search->objectTypeList['productplan'] = 'Plan';
$lang->action->search->objectTypeList['branch'] = 'Branch';
$lang->action->search->objectTypeList['testsuite'] = 'Suite';
$lang->action->search->objectTypeList['testlib'] = 'Library';
$lang->action->search->objectTypeList['caselib'] = 'Library';
/* 用来在动态显示中显示动作 */
$lang->action->search->label[''] = '';
+3 -3
View File
@@ -62,8 +62,8 @@ $lang->action->objectTypes['todo'] = '待办';
$lang->action->objectTypes['branch'] = '分支';
$lang->action->objectTypes['module'] = '模块';
$lang->action->objectTypes['testsuite'] = '套件';
$lang->action->objectTypes['testlib'] = '公共库';
$lang->action->objectTypes['testreport'] = '总结报告';
$lang->action->objectTypes['caselib'] = '用例库';
$lang->action->objectTypes['testreport'] = '测试报告';
/* 用来描述操作历史记录。*/
$lang->action->desc = new stdclass();
@@ -200,7 +200,7 @@ $lang->action->search->objectTypeList['release'] = '发布';
$lang->action->search->objectTypeList['productplan'] = '计划';
$lang->action->search->objectTypeList['branch'] = '分支';
$lang->action->search->objectTypeList['testsuite'] = '套件';
$lang->action->search->objectTypeList['testlib'] = '公共库';
$lang->action->search->objectTypeList['caselib'] = '公共库';
/* 用来在动态显示中显示动作 */
$lang->action->search->label[''] = '';
+5 -5
View File
@@ -373,7 +373,7 @@ class actionModel extends model
->andWhere('extra')->eq($extra)
->orderBy($orderBy)->page($pager)->fetchAll();
if(!$trashes) return array();
/* Group trashes by objectType, and get there name field. */
foreach($trashes as $object)
{
@@ -529,7 +529,7 @@ class actionModel extends model
$condition = "(product =',0,' AND project = '0')";
if($projectCondition) $condition .= ' OR ' . $projectCondition;
if($productCondition) $condition .= ' OR ' . $productCondition;
if(strpos($this->app->company->admins, ',' . $this->app->user->account . ',') !== false) $condition = 1;
if($this->app->user->admin) $condition = 1;
}
$this->loadModel('doc');
@@ -627,7 +627,7 @@ class actionModel extends model
*/
public function getBySQL($sql, $orderBy, $pager = null)
{
return $actions = $this->dao->select('*')->from(TABLE_ACTION)
return $actions = $this->dao->select('*')->from(TABLE_ACTION)
->where($sql)
->orderBy($orderBy)
->page($pager)
@@ -669,11 +669,11 @@ class actionModel extends model
if($todo->type == 'bug') $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_BUG)->fetch('title');
if($todo->private == 1 and $todo->account != $this->app->user->account)
{
$objectNames[$objectType][$id] = $this->lang->todo->thisIsPrivate;
$objectNames[$objectType][$id] = $this->lang->todo->thisIsPrivate;
}
else
{
$objectNames[$objectType][$id] = $todo->name;
$objectNames[$objectType][$id] = $todo->name;
}
}
}
+7 -1
View File
@@ -37,7 +37,13 @@
<tr class='text-center'>
<td><?php echo zget($lang->action->objectTypes, $action->objectType, '');?></td>
<td><?php echo $action->objectID;?></td>
<td class='text-left'><?php echo html::a($this->createLink($module, $module == 'testlib' ? 'libview' : 'view', $action->objectType == 'user' ? "account={$action->objectName}" : "id={$action->objectID}"), $action->objectName);?></td>
<td class='text-left'>
<?php
$methodName = $module == 'caselib' ? 'libview' : 'view';
$params = $action->objectType == 'user' ? "account={$action->objectName}" : "id={$action->objectID}";
echo html::a($this->createLink($module, $moduleName, $params), $action->objectName);
?>
</td>
<td><?php echo $users[$action->actor];?></td>
<td><?php echo $action->date;?></td>
<td>
+2 -2
View File
@@ -31,8 +31,8 @@ $lang->block->createBlock = 'Create Widget';
$lang->block->editBlock = 'Edit';
$lang->block->ordersSaved = 'Ranking is saved.';
$lang->block->confirmRemoveBlock = 'Do you want to remove Widget【{0}】?';
$lang->block->foreverClose = '永久关闭';
$lang->block->confirmClose = '确定永久关闭该区块吗?关闭后,所有人将都不会显示该区块';
$lang->block->closeForever = '永久关闭';
$lang->block->confirmClose = '确定永久关闭该区块吗?闭后所有人都将无法使用该区块,可以在后台自定义中打开';
$lang->block->remove = '移除';
$lang->block->refresh = 'Refresh';
$lang->block->hidden = 'Hide';
+3 -3
View File
@@ -31,8 +31,8 @@ $lang->block->createBlock = '添加区块';
$lang->block->editBlock = '编辑区块';
$lang->block->ordersSaved = '排序已保存';
$lang->block->confirmRemoveBlock = '确定移除区块【{0}】吗?';
$lang->block->foreverClose = '永久关闭';
$lang->block->confirmClose = '确定永久关闭该区块吗?关闭后,所有人将都不会显示该区块';
$lang->block->closeForever = '永久关闭';
$lang->block->confirmClose = '确定永久关闭该区块吗?闭后所有人都将无法使用该区块,可以在后台自定义中打开';
$lang->block->remove = '移除';
$lang->block->refresh = '刷新';
$lang->block->hidden = '隐藏';
@@ -230,7 +230,7 @@ $lang->block->typeList->project['isdoing'] = '进行中';
$lang->block->typeList->project['all'] = '全部';
$lang->block->typeList->testtask['wait'] = '待测版本';
$lang->block->typeList->testtask['doing'] = '进行中版本';
$lang->block->typeList->testtask['doing'] = '测试中版本';
$lang->block->typeList->testtask['blocked'] = '阻塞版本';
$lang->block->typeList->testtask['done'] = '已测版本';
$lang->block->typeList->testtask['all'] = '全部';
+2 -2
View File
@@ -45,8 +45,8 @@ $useGuest = $this->app->user->account == 'guest';
<?php endif;?>
<li><a href='javascript:;' class='remove-panel'><i class='icon-remove'></i> <?php echo $lang->block->remove; ?></a></li>
<?php endif;?>
<?php if(strpos($this->app->company->admins, ",{$this->app->user->account},") !== false):?>
<li><?php echo html::a($this->createLink('block', 'close', "blockID={$block->id}"), "<i class='icon-eye-close'></i> {$lang->block->foreverClose}", 'hiddenwin', "class='close-block' onclick=\"return confirm('{$lang->block->confirmClose}')\"")?>
<?php if($this->app->user->admin):?>
<li><?php echo html::a($this->createLink('block', 'close', "blockID={$block->id}"), "<i class='icon-eye-close'></i> {$lang->block->closeForever}", 'hiddenwin', "class='close-block' onclick=\"return confirm('{$lang->block->confirmClose}')\"")?>
<?php endif;?>
</ul>
</div>
+7 -2
View File
@@ -36,9 +36,9 @@ $config->bug->list->exportFields = 'id, product, branch, module, project, story,
lastEditedBy,
lastEditedDate, files';
$config->bug->list->customCreateFields = 'project,story,task,pri,severity,os,browser,mailto,keywords';
$config->bug->list->customCreateFields = 'project,story,task,pri,severity,os,browser,deadline,mailto,keywords';
$config->bug->list->customBatchCreateFields = 'module,project,steps,type,pri,severity,os,browser,keywords';
$config->bug->list->customBatchEditFields = 'type,severity,pri,productplan,assignedTo,status,resolvedBy,resolution,os,browser,keywords';
$config->bug->list->customBatchEditFields = 'type,severity,pri,productplan,assignedTo,deadline,status,resolvedBy,resolution,os,browser,keywords';
$config->bug->custom = new stdclass();
$config->bug->custom->createFields = $config->bug->list->customCreateFields;
@@ -207,6 +207,11 @@ $config->bug->datatable->fieldList['assignedDate']['fixed'] = 'no';
$config->bug->datatable->fieldList['assignedDate']['width'] = '90';
$config->bug->datatable->fieldList['assignedDate']['required'] = 'no';
$config->bug->datatable->fieldList['deadline']['title'] = 'deadline';
$config->bug->datatable->fieldList['deadline']['fixed'] = 'no';
$config->bug->datatable->fieldList['deadline']['width'] = '90';
$config->bug->datatable->fieldList['deadline']['required'] = 'no';
$config->bug->datatable->fieldList['resolvedBy']['title'] = 'resolvedByAB';
$config->bug->datatable->fieldList['resolvedBy']['fixed'] = 'no';
$config->bug->datatable->fieldList['resolvedBy']['width'] = '80';
+3
View File
@@ -250,6 +250,7 @@ class bug extends control
$os = '';
$browser = '';
$assignedTo = '';
$deadline = '';
$mailto = '';
$keywords = '';
$severity = 3;
@@ -283,6 +284,7 @@ class bug extends control
$severity = $bug->severity;
$type = $bug->type;
$assignedTo = $bug->assignedTo;
$deadline = $bug->deadline;
}
/* If projectID is setted, get builds and stories of this project. */
@@ -338,6 +340,7 @@ class bug extends control
$this->view->browser = $browser;
$this->view->projectMembers = $projectMembers;
$this->view->assignedTo = $assignedTo;
$this->view->deadline = $deadline;
$this->view->mailto = $mailto;
$this->view->keywords = $keywords;
$this->view->severity = $severity;
+1 -1
View File
@@ -75,7 +75,7 @@ function setTemplate(templateID)
function deleteTemplate(templateID)
{
if(!templateID) return;
if (confirm(TemplateDelete)){
if (confirm(templateDelete)){
hiddenwin.location.href = createLink('bug', 'deleteTemplate', 'templateID=' + templateID);
$('#tplBox' + templateID).addClass('hidden');
}
+1 -1
View File
@@ -367,5 +367,5 @@ $lang->bug->featureBar['browse']['unresolved'] = $lang->bug->unResolved;
$lang->bug->featureBar['browse']['toclosed'] = $lang->bug->toClosed;
$lang->bug->featureBar['browse']['longlifebugs'] = $lang->bug->longLifeBugs;
$lang->bug->featureBar['browse']['postponedbugs'] = $lang->bug->postponedBugs;
$lang->bug->featureBar['browse']['overdueBugs'] = $lang->bug->overdueBugs;
$lang->bug->featureBar['browse']['overduebugs'] = $lang->bug->overdueBugs;
$lang->bug->featureBar['browse']['needconfirm'] = $lang->bug->needConfirm;
+2 -2
View File
@@ -145,7 +145,7 @@ $lang->bug->setTemplateTitle = '请输入bug模板标题';
$lang->bug->remindTask = '该Bug已经转化为任务,是否更新任务(编号:%s)状态 ?';
$lang->bug->skipClose = 'Bug %s 不是已解决状态,不能关闭。';
$lang->bug->applyTemplate = '应用模板';
$lang->bug->TemplateDelete = '您确认要删除该模板吗?';
$lang->bug->templateDelete = '您确认要删除该模板吗?';
/* 模板。*/
$lang->bug->tplStep = "<p>[步骤]</p>\n";
@@ -367,5 +367,5 @@ $lang->bug->featureBar['browse']['unresolved'] = $lang->bug->unResolved;
$lang->bug->featureBar['browse']['toclosed'] = $lang->bug->toClosed;
$lang->bug->featureBar['browse']['longlifebugs'] = $lang->bug->longLifeBugs;
$lang->bug->featureBar['browse']['postponedbugs'] = $lang->bug->postponedBugs;
$lang->bug->featureBar['browse']['overdueBugs'] = $lang->bug->overdueBugs;
$lang->bug->featureBar['browse']['overduebugs'] = $lang->bug->overdueBugs;
$lang->bug->featureBar['browse']['needconfirm'] = $lang->bug->needConfirm;
+9 -1
View File
@@ -46,6 +46,7 @@ class bugModel extends model
->add('openedDate', $now)
->setDefault('project,story,task', 0)
->setDefault('openedBuild', '')
->setDefault('deadline', '0000-00-00')
->setIF($this->post->assignedTo != '', 'assignedDate', $now)
->setIF($this->post->story != false, 'storyVersion', $this->loadModel('story')->getVersion($this->post->story))
->stripTags($this->config->bug->editor->create['id'], $this->config->allowedTags)
@@ -465,6 +466,7 @@ class bugModel extends model
->setDefault('project,module,project,story,task,duplicateBug,branch', 0)
->setDefault('openedBuild', '')
->setDefault('plan', 0)
->setDefault('deadline', '0000-00-00')
->add('lastEditedBy', $this->app->user->account)
->add('lastEditedDate', $now)
->join('openedBuild', ',')
@@ -563,6 +565,7 @@ class bugModel extends model
$bug->title = $data->titles[$bugID];
$bug->plan = empty($data->plans[$bugID]) ? 0 : $data->plans[$bugID];
$bug->assignedTo = $data->assignedTos[$bugID];
$bug->deadline = $data->deadlines[$bugID];
$bug->resolvedBy = $data->resolvedBys[$bugID];
$bug->keywords = $data->keywords[$bugID];
$bug->os = $data->os[$bugID];
@@ -1188,6 +1191,7 @@ class bugModel extends model
$bugs = $this->dao->select('*')->from(TABLE_BUG)
->where($bugQuery)
->andWhere('project')->eq((int)$projectID)
->andWhere('deleted')->eq(0)
->orderBy($orderBy)
->page($pager)
->fetchAll('id');
@@ -1330,15 +1334,17 @@ class bugModel extends model
* Get counts of some stories' bugs.
*
* @param array $stories
* @param int $projectID
* @access public
* @return int
*/
public function getStoryBugCounts($stories)
public function getStoryBugCounts($stories, $projectID = 0)
{
$bugCounts = $this->dao->select('story, COUNT(*) AS bugs')
->from(TABLE_BUG)
->where('story')->in($stories)
->andWhere('deleted')->eq(0)
->beginIF($projectID)->andWhere('project')->eq($projectID)->fi()
->groupBy('story')
->fetchPairs();
foreach($stories as $storyID) if(!isset($bugCounts[$storyID])) $bugCounts[$storyID] = 0;
@@ -2264,6 +2270,8 @@ class bugModel extends model
case 'assignedDate':
echo substr($bug->assignedDate, 5, 11);
break;
case 'deadline':
echo $bug->deadline;
case 'resolvedBy':
echo zget($users, $bug->resolvedBy, $bug->resolvedBy);
break;
+3
View File
@@ -11,6 +11,7 @@
*/
?>
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/datepicker.html.php';?>
<?php js::set('dittoNotice', $this->lang->bug->dittoNotice);?>
<div id='titlebar'>
<div class='heading'>
@@ -40,6 +41,7 @@ $columns = count($visibleFields) + 2;
<th <?php if(count($visibleFields) >= 10) echo "class='w-150px'"?>><?php echo $lang->bug->title;?> <span class='required'></span></th>
<th class='w-150px<?php echo zget($visibleFields, 'productplan', ' hidden')?>'><?php echo $lang->bug->productplan;?></th>
<th class='w-150px<?php echo zget($visibleFields, 'assignedTo', ' hidden')?>'><?php echo $lang->bug->assignedTo;?></th>
<th class='w-100px<?php echo zget($visibleFields, 'deadline', ' hidden')?>'><?php echo $lang->bug->deadline;?></th>
<th class='w-90px<?php echo zget($visibleFields, 'status', ' hidden')?>'><?php echo $lang->bug->status;?></th>
<th class='w-100px<?php echo zget($visibleFields, 'os', ' hidden')?>'><?php echo $lang->bug->os;?></th>
<th class='w-100px<?php echo zget($visibleFields, 'browser', ' hidden')?>'><?php echo $lang->bug->browser;?></th>
@@ -77,6 +79,7 @@ $columns = count($visibleFields) + 2;
</td>
<td class='text-left<?php echo zget($visibleFields, 'productplan', ' hidden')?>' style='overflow:visible'><?php echo html::select("plans[$bugID]", $plans, $bugs[$bugID]->plan, "class='form-control chosen'");?></td>
<td class='text-left<?php echo zget($visibleFields, 'assignedTo', ' hidden')?>' style='overflow:visible'><?php echo html::select("assignedTos[$bugID]", $users, $bugs[$bugID]->assignedTo, "class='form-control chosen'");?></td>
<td class='<?php echo zget($visibleFields, 'deadline', ' hidden')?>' style='overflow:visible'><?php echo html::input("deadlines[$bugID]", $bugs[$bugID]->deadline, "class='form-control form-date'");?></td>
<td <?php echo zget($visibleFields, 'status', "class='hidden'")?>><?php echo html::select("statuses[$bugID]", $statusList, $bugs[$bugID]->status, 'class=form-control');?></td>
<td <?php echo zget($visibleFields, 'os', "class='hidden'")?>><?php echo html::select("os[$bugID]", $osList, $bugs[$bugID]->os, 'class=form-control');?></td>
<td <?php echo zget($visibleFields, 'browser', "class='hidden'")?>><?php echo html::select("browsers[$bugID]", $browserList, $bugs[$bugID]->browser, 'class=form-control');?></td>
+11 -1
View File
@@ -14,12 +14,13 @@
include '../../common/view/header.html.php';
include '../../common/view/form.html.php';
include '../../common/view/kindeditor.html.php';
include '../../common/view/datepicker.html.php';
js::set('holders', $lang->bug->placeholder);
js::set('page', 'create');
js::set('createRelease', $lang->release->create);
js::set('createBuild', $lang->build->create);
js::set('refresh', $lang->refresh);
js::set('TemplateDelete',$lang->bug->TemplateDelete);
js::set('templateDelete',$lang->bug->templateDelete);
?>
<div class='container mw-1400px'>
<div id='titlebar'>
@@ -84,6 +85,15 @@ js::set('TemplateDelete',$lang->bug->TemplateDelete);
<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'><?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 $showOS = strpos(",$showFields,", ',os,') !== false;?>
<?php $showBrowser = strpos(",$showFields,", ',browser,') !== false;?>
+4
View File
@@ -143,6 +143,10 @@ js::set('oldResolvedBuild' , $bug->resolvedBuild);
<th><?php echo $lang->bug->assignedTo;?></th>
<td><?php echo html::select('assignedTo', $users, $bug->assignedTo, "class='form-control chosen'");?></td>
</tr>
<tr>
<th><?php echo $lang->bug->deadline;?></th>
<td><?php echo html::input('deadline', $bug->deadline, "class='form-control form-date'");?></td>
</tr>
<tr>
<th><?php echo $lang->bug->os;?></th>
<td><?php echo html::select('os', $lang->bug->osList, $bug->os, "class='form-control'");?></td>
+13 -13
View File
@@ -238,7 +238,7 @@ $lang->qa->menu->testcase = array('link' => 'Case|testcase|browse|productID=%s'
$lang->qa->menu->testtask = array('link' => 'Build|testtask|browse|productID=%s');
$lang->qa->menu->testsuite = array('link' => '套件|testsuite|browse|productID=%s');
$lang->qa->menu->report = array('link' => '总结报告|testreport|browse|productID=%s');
$lang->qa->menu->testlib = array('link' => '公共库|testsuite|library');
$lang->qa->menu->caselib = array('link' => '公共库|testsuite|library');
$lang->qa->menu->index = array('link' => "<i class='icon-home'></i>TestingHomepage|qa|index|locate=no&productID=%s", 'float' => 'right');
$lang->bug = new stdclass();
@@ -250,7 +250,7 @@ $lang->bug->menu->testcase = array('link' => 'Case|testcase|browse|productID=%s
$lang->bug->menu->testtask = array('link' => 'Build|testtask|browse|productID=%s');
$lang->bug->menu->testsuite = array('link' => '套件|testsuite|browse|productID=%s');
$lang->bug->menu->report = array('link' => '总结报告|testreport|browse|productID=%s');
$lang->bug->menu->testlib = array('link' => '公共库|testsuite|library');
$lang->bug->menu->caselib = array('link' => '公共库|testsuite|library');
$lang->bug->menu->index = array('link' => "<i class='icon-home'></i>TestingHomepage|qa|index|locate=no&productID=%s", 'float' => 'right');
$lang->testcase = new stdclass();
@@ -262,7 +262,7 @@ $lang->testcase->menu->testcase = array('link' => 'Case|testcase|browse|product
$lang->testcase->menu->testtask = array('link' => 'Build|testtask|browse|productID=%s', 'alias' => 'view,create,edit,linkcase,cases,start,close,batchrun,groupcase');
$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');
$lang->testcase->menu->testlib = array('link' => '公共库|testsuite|library');
$lang->testcase->menu->caselib = array('link' => '公共库|testsuite|library');
$lang->testcase->menu->index = array('link' => "<i class='icon-home'></i>TestingHomepage|qa|index|locate=no&productID=%s", 'float' => 'right');
$lang->testtask = new stdclass();
@@ -272,16 +272,16 @@ $lang->testsuite->menu = $lang->testcase->menu;
$lang->testreport = new stdclass();
$lang->testreport->menu = $lang->testcase->menu;
$lang->testlib = new stdclass();
$lang->testlib->menu = new stdclass();
$lang->testlib->menu->lib = array('link' => '%s', 'fixed' => true);
$lang->testlib->menu->bug = array('link' => 'Bug|bug|browse|productID=%s');
$lang->testlib->menu->testcase = array('link' => '用例|testcase|browse|productID=%s');
$lang->testlib->menu->testtask = array('link' => '版本|testtask|browse|productID=%s');
$lang->testlib->menu->testsuite = array('link' => '套件|testsuite|browse|productID=%s');
$lang->testlib->menu->testlib = array('link' => '公共库|testsuite|library', 'alias' => 'createlib,createcase,libview,edit', 'subModule' => 'tree,testcase');
$lang->testlib->menu->create = array('link' => "<i class='icon-plus'></i>创建库|testsuite|createLib|", 'float' => 'right');
$lang->testlib->menu->index = array('link' => "<i class='icon-home'></i>测试主页|qa|index|locate=no&productID=%s", 'float' => 'right');
$lang->caselib = new stdclass();
$lang->caselib->menu = new stdclass();
$lang->caselib->menu->lib = array('link' => '%s', 'fixed' => true);
$lang->caselib->menu->bug = array('link' => 'Bug|bug|browse|productID=%s');
$lang->caselib->menu->testcase = array('link' => '用例|testcase|browse|productID=%s');
$lang->caselib->menu->testtask = array('link' => '版本|testtask|browse|productID=%s');
$lang->caselib->menu->testsuite = array('link' => '套件|testsuite|browse|productID=%s');
$lang->caselib->menu->caselib = array('link' => '公共库|testsuite|library', 'alias' => 'createlib,createcase,libview,edit', 'subModule' => 'tree,testcase');
$lang->caselib->menu->create = array('link' => "<i class='icon-plus'></i>创建库|testsuite|createLib|", 'float' => 'right');
$lang->caselib->menu->index = array('link' => "<i class='icon-home'></i>测试主页|qa|index|locate=no&productID=%s", 'float' => 'right');
/* 文档视图菜单设置。*/
$lang->doc = new stdclass();
+16 -16
View File
@@ -237,8 +237,8 @@ $lang->qa->menu->bug = array('link' => 'Bug|bug|browse|productID=%s');
$lang->qa->menu->testcase = array('link' => '用例|testcase|browse|productID=%s');
$lang->qa->menu->testtask = array('link' => '版本|testtask|browse|productID=%s');
$lang->qa->menu->testsuite = array('link' => '套件|testsuite|browse|productID=%s');
$lang->qa->menu->report = array('link' => '总结报告|testreport|browse|productID=%s');
$lang->qa->menu->testlib = array('link' => '公共库|testsuite|library');
$lang->qa->menu->report = array('link' => '测试报告|testreport|browse|productID=%s');
$lang->qa->menu->caselib = array('link' => '用例库|testsuite|library');
$lang->qa->menu->index = array('link' => "<i class='icon-home'></i>测试主页|qa|index|locate=no&productID=%s", 'float' => 'right');
$lang->bug = new stdclass();
@@ -249,8 +249,8 @@ $lang->bug->menu->bug = array('link' => 'Bug|bug|browse|productID=%s', 'al
$lang->bug->menu->testcase = array('link' => '用例|testcase|browse|productID=%s');
$lang->bug->menu->testtask = array('link' => '版本|testtask|browse|productID=%s');
$lang->bug->menu->testsuite = array('link' => '套件|testsuite|browse|productID=%s');
$lang->bug->menu->report = array('link' => '总结报告|testreport|browse|productID=%s');
$lang->bug->menu->testlib = array('link' => '公共库|testsuite|library');
$lang->bug->menu->report = array('link' => '测试报告|testreport|browse|productID=%s');
$lang->bug->menu->caselib = array('link' => '用例库|testsuite|library');
$lang->bug->menu->index = array('link' => "<i class='icon-home'></i>测试主页|qa|index|locate=no&productID=%s", 'float' => 'right');
$lang->testcase = new stdclass();
@@ -261,8 +261,8 @@ $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,importlib,report', 'subModule' => 'tree');
$lang->testcase->menu->testtask = array('link' => '版本|testtask|browse|productID=%s', 'alias' => 'view,create,edit,linkcase,cases,start,close,batchrun,groupcase');
$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');
$lang->testcase->menu->testlib = array('link' => '公共库|testsuite|library');
$lang->testcase->menu->report = array('link' => '测试报告|testreport|browse|productID=%s', 'alias' => 'view,create');
$lang->testcase->menu->caselib = array('link' => '用例库|testsuite|library');
$lang->testcase->menu->index = array('link' => "<i class='icon-home'></i>测试主页|qa|index|locate=no&productID=%s", 'float' => 'right');
$lang->testtask = new stdclass();
@@ -272,16 +272,16 @@ $lang->testsuite->menu = $lang->testcase->menu;
$lang->testreport = new stdclass();
$lang->testreport->menu = $lang->testcase->menu;
$lang->testlib = new stdclass();
$lang->testlib->menu = new stdclass();
$lang->testlib->menu->lib = array('link' => '%s', 'fixed' => true);
$lang->testlib->menu->bug = array('link' => 'Bug|bug|browse|productID=%s');
$lang->testlib->menu->testcase = array('link' => '用例|testcase|browse|productID=%s');
$lang->testlib->menu->testtask = array('link' => '版本|testtask|browse|productID=%s');
$lang->testlib->menu->testsuite = array('link' => '套件|testsuite|browse|productID=%s');
$lang->testlib->menu->testlib = array('link' => '公共库|testsuite|library', 'alias' => 'createlib,createcase,libview,edit', 'subModule' => 'tree,testcase');
$lang->testlib->menu->create = array('link' => "<i class='icon-plus'></i>创建库|testsuite|createLib|", 'float' => 'right');
$lang->testlib->menu->index = array('link' => "<i class='icon-home'></i>测试主页|qa|index|locate=no&productID=%s", 'float' => 'right');
$lang->caselib = new stdclass();
$lang->caselib->menu = new stdclass();
$lang->caselib->menu->lib = array('link' => '%s', 'fixed' => true);
$lang->caselib->menu->bug = array('link' => 'Bug|bug|browse|productID=%s');
$lang->caselib->menu->testcase = array('link' => '用例|testcase|browse|productID=%s');
$lang->caselib->menu->testtask = array('link' => '版本|testtask|browse|productID=%s');
$lang->caselib->menu->testsuite = array('link' => '套件|testsuite|browse|productID=%s');
$lang->caselib->menu->caselib = array('link' => '用例库|testsuite|library', 'alias' => 'createlib,createcase,libview,edit', 'subModule' => 'tree,testcase');
$lang->caselib->menu->create = array('link' => "<i class='icon-plus'></i>创建库|testsuite|createLib|", 'float' => 'right');
$lang->caselib->menu->index = array('link' => "<i class='icon-home'></i>测试主页|qa|index|locate=no&productID=%s", 'float' => 'right');
/* 文档视图菜单设置。*/
$lang->doc = new stdclass();
+1 -2
View File
@@ -1182,8 +1182,7 @@ class commonModel extends model
global $app, $lang;
/* Check is the super admin or not. */
$account = ',' . $app->user->account . ',';
if(strpos($app->company->admins, $account) !== false) return true;
if($app->user->admin) return true;
/* If not super admin, check the rights. */
$rights = $app->user->rights['rights'];
+1 -1
View File
@@ -78,7 +78,7 @@ js::set('confirmDelete', $lang->user->confirmDelete);
<td class='text-left'>
<?php
common::printIcon('user', 'edit', "userID=$user->id&from=company", '', 'list');
if(strpos($this->app->company->admins, ",{$user->account},") === false and common::hasPriv('user', 'delete'))
if($this->app->user->admin and common::hasPriv('user', 'delete'))
{
echo html::a($this->createLink('user', 'delete', "userID=$user->id"), '<i class="icon-remove"></i>', '', "title='{$lang->user->delete}' class='btn-icon iframe'");
}
+2 -2
View File
@@ -604,7 +604,7 @@ class docModel extends model
$account = ',' . $this->app->user->account . ',';
if(isset($object->addedBy) and $object->addedBy == $this->app->user->account) return true;
if(strpos($this->app->company->admins, $account) !== false) return true;
if($this->app->user->admin) return true;
if($object->acl == 'private' and strpos(",$object->users,", $account) !== false) return true;
if($object->acl == 'custom')
{
@@ -915,7 +915,7 @@ class docModel extends model
if($table) $table .= '.';
$condition = '';
$account = ',' . $this->app->user->account . ',';
if(strpos($this->app->company->admins, $account) === false)
if(!$this->app->user->admin)
{
$condition .= "{$table}acl='open'";
if($type == 'doc') $condition .= " OR {$table}addedBy = '{$this->app->user->account}'";
+3 -3
View File
@@ -128,7 +128,7 @@ class productModel extends model
{
/* Is admin? */
$account = ',' . $this->app->user->account . ',';
if(strpos($this->app->company->admins, $account) !== false) return true;
if($this->app->user->admin) return true;
$acls = $this->app->user->rights['acls'];
if(!empty($acls['products']) and !in_array($product->id, $acls['products'])) return false;
@@ -746,8 +746,8 @@ class productModel extends model
->leftJoin(TABLE_PROJECTPRODUCT)->alias('t2')->on('t1.id = t2.product')
->leftJoin(TABLE_TEAM)->alias('t3')->on('t2.project = t3.project')
->leftJoin(TABLE_PROJECT)->alias('t4')->on('t2.project = t4.id')
->beginIF(strpos($this->app->company->admins, $account) !== false)->where('t1.deleted')->eq(0)->fi()
->beginIF(strpos($this->app->company->admins, $account) === false)
->beginIF($this->app->user->admin)->where('t1.deleted')->eq(0)->fi()
->beginIF(!$this->app->user->admin)
->where('t1.acl')->eq('open')
->orWhere("(t1.acl = 'custom' AND $groupSql)")
->orWhere('t1.PO')->eq($this->app->user->account)
+2 -2
View File
@@ -585,8 +585,8 @@ class project extends control
/* Count T B C */
$storyIdList = array();
foreach($stories as $story) $storyIdList[$story->id] = $story->id;
$storyTasks = $this->loadModel('task')->getStoryTaskCounts($storyIdList);
$storyBugs = $this->loadModel('bug')->getStoryBugCounts($storyIdList);
$storyTasks = $this->loadModel('task')->getStoryTaskCounts($storyIdList,$projectID);
$storyBugs = $this->loadModel('bug')->getStoryBugCounts($storyIdList,$projectID);
$storyCases = $this->loadModel('testcase')->getStoryCaseCounts($storyIdList);
/* Assign. */
+1 -2
View File
@@ -26,8 +26,7 @@ class projectModel extends model
public function checkPriv($project)
{
/* If is admin, return true. */
$account = ',' . $this->app->user->account . ',';
if(strpos($this->app->company->admins, $account) !== false) return true;
if($this->app->user->admin) return true;
$acls = $this->app->user->rights['acls'];
if(!empty($acls['projects']) and !in_array($project->id, $acls['projects'])) return false;
+1 -1
View File
@@ -150,7 +150,7 @@
</tbody>
<tfoot>
<tr>
<td colspan='10'>
<td colspan='12'>
<div class='table-actions clearfix'>
<?php
$storyInfo = sprintf($lang->project->productStories, inlink('linkStory', "project={$project->id}"));
+1 -1
View File
@@ -128,7 +128,7 @@ class report extends control
$this->app->loadConfig('project');
$begin = $begin ? strtotime($begin) : time();
$end = $end ? strtotime($end) : time() + (7 * 24 * 3600);
$end += 24 * 2600;
$end += 24 * 3600;
$beginWeekDay = date('w', $begin);
$begin = date('Y-m-d', $begin);
$end = date('Y-m-d', $end);
+1 -1
View File
@@ -128,7 +128,7 @@ class sso extends control
*/
public function ajaxSetConfig()
{
if(strpos($this->app->company->admins, $this->app->user->account) === false) die('deny');
if(!$this->app->user->admin) die('deny');
if($_POST)
{
+1 -1
View File
@@ -25,7 +25,7 @@ $config->testcase->exportFields = '
$config->testcase->customCreateFields = 'story,stage,pri,keywords';
$config->testcase->customBatchCreateFields = 'module,stage,story,pri,precondition,keywords';
$config->testcase->customBatchEditFields = 'module,stage,precondition,status,pri,keywords';
$config->testcase->customBatchEditFields = 'module,story,stage,precondition,status,pri,keywords';
$config->testcase->custom = new stdclass();
$config->testcase->custom->createFields = $config->testcase->customCreateFields;
+30 -8
View File
@@ -119,7 +119,7 @@ class testcase extends control
$this->view->modulePairs = $showModule ? $this->tree->getModulePairs($productID, 'case', $showModule, $linkedLibs) : array();
$moduleTree = $this->tree->getTreeMenu($productID, $viewType = 'case', $startModuleID = 0, array('treeModel', 'createCaseLink'), '', $branch);
$libModuleTree = $this->tree->getTestLibTreeInCase('case', $productID, array('treeModel', 'createCaseLink'));
$libModuleTree = $this->tree->getCaseLibTreeInCase('case', $productID, array('treeModel', 'createCaseLink'));
if($libModuleTree) $moduleTree = substr($moduleTree, 0, strrpos($moduleTree, '</ul>')) . $libModuleTree . '</ul>';
/* Assign. */
@@ -190,6 +190,7 @@ class testcase extends control
$this->view->users = $this->user->getPairs('noletter');
$this->view->browseType = 'group';
$this->view->groupBy = $groupBy;
$this->view->orderBy = $groupBy;
$this->view->groupByList = $groupByList;
$this->view->cases = $groupCases;
$this->view->suiteList = $this->loadModel('testsuite')->getSuites($productID);
@@ -620,7 +621,7 @@ class testcase extends control
$this->view->libID = $case->lib;
$this->view->libName = $libraries[$case->lib];
$this->view->libraries = $libraries;
$this->view->moduleOptionMenu = $this->tree->getOptionMenu($case->lib, $viewType = 'testlib', $startModuleID = 0);
$this->view->moduleOptionMenu = $this->tree->getOptionMenu($case->lib, $viewType = 'caselib', $startModuleID = 0);
}
else
{
@@ -635,7 +636,7 @@ class testcase extends control
if($case->lib and $case->fromLib)
{
$libName = $this->loadModel('testsuite')->getById($case->lib)->name;
$libModules = $this->tree->getOptionMenu($case->lib, 'testlib');
$libModules = $this->tree->getOptionMenu($case->lib, 'caselib');
foreach($libModules as $moduleID => $moduleName)
{
if($moduleID == 0) continue;
@@ -693,7 +694,7 @@ class testcase extends control
$caseIDList = $this->post->caseIDList ? $this->post->caseIDList : die(js::locate($this->session->caseList));
/* Get the edited cases. */
$cases = $this->dao->select('*')->from(TABLE_CASE)->where('id')->in($caseIDList)->fetchAll('id');
$cases = $this->testcase->getByList($caseIDList);
/* The cases of a product. */
if($productID)
@@ -706,7 +707,7 @@ class testcase extends control
$this->lang->testcase->menu = $this->lang->testsuite->menu;
/* Set modules. */
$modules = $this->tree->getOptionMenu($libID, $viewType = 'testlib', $startModuleID = 0, $branch);
$modules = $this->tree->getOptionMenu($libID, $viewType = 'caselib', $startModuleID = 0, $branch);
$modules = array('ditto' => $this->lang->testcase->ditto) + $modules;
$this->view->modules = $modules;
@@ -744,8 +745,29 @@ class testcase extends control
$this->loadModel('my')->setMenu();
$this->view->position[] = html::a($this->server->http_referer, $this->lang->my->testCase);
$this->view->title = $this->lang->testcase->batchEdit;
/* Set modules. */
$productIdList = array();
$libs = array();
$existModules = array();
foreach($cases as $case)
{
if($case->lib and $case->fromLib) $libs[$case->lib] = $case->lib;
$productIdList[$case->product] = $case->product;
$existModules[$case->module] = $case->module;
}
$products = $this->product->getByIdList($productIdList);
$modules = array();
foreach($products as $product)
{
$productModules = $this->tree->getOptionMenu($product->id, $viewType = 'case', $startModuleID = 0);
foreach($productModules as $moduleID => $moduleName) $modules[$moduleID] = '/' . $product->name . $moduleName;
}
if($libs) $modules += $this->tree->getExistLibModules($libs, $existModules);
$this->view->modules = array('ditto' => $this->lang->testcase->ditto) + $modules;
}
if(!$this->config->testcase->needReview) unset($this->lang->testcase->statusList['wait']);
/* Judge whether the editedTasks is too large and set session. */
$showSuhosinInfo = false;
@@ -754,7 +776,7 @@ class testcase extends control
if($showSuhosinInfo) $this->view->suhosinInfo = extension_loaded('suhosin') ? $this->lang->suhosinInfo : $this->lang->maxVarsInfo;
$this->loadModel('story');
$this->view->stories = $this->story->getProductStoryPairs($productID, $case->branch);
$this->view->stories = $this->story->getProductStoryPairs($productID, $branch);
/* Set custom. */
foreach(explode(',', $this->config->testcase->customBatchEditFields) as $field) $customFields[$field] = $this->lang->testcase->$field;
@@ -1536,7 +1558,7 @@ class testcase extends control
$modules = $this->loadModel('tree')->getOptionMenu($productID, 'case', 0, $branch);
$libName = $libraries[$libID];
$libModules = $this->tree->getOptionMenu($libID, 'testlib');
$libModules = $this->tree->getOptionMenu($libID, 'caselib');
foreach($libModules as $moduleID => $moduleName)
{
if($moduleID == 0) continue;
+1
View File
@@ -1,3 +1,4 @@
.w-340px {width:340px}
.chosen {z-index:99}
.chosen-container[id^="module"] .chosen-drop {min-width: 400px; border-top: 1px solid #ddd!important}
.chosen-container[id^="stories"] .chosen-drop {min-width: 400px; border-top: 1px solid #ddd!important}
+3
View File
@@ -0,0 +1,3 @@
.table-bordered caption {border: 1px solid #ddd;}
.table-bordered tr > th:first-child, .table-bordered tr > td:first-child {border-left: 1px solid #ddd!important}
.table-bordered tr > th:last-child, .table-bordered tr > td:last-child {border-right: 1px solid #ddd!important}
+4
View File
@@ -1 +1,5 @@
#steps {margin-bottom: 15px}
.outer .col-side{transition: all 0.1s;position: relative;}
.outer.hide-side .col-side{width:0px;}
.outer .col-side .side-handle{right:0px;top:10px;}
.outer.hide-side .main-side{display:none;}
+1 -1
View File
@@ -53,7 +53,7 @@ function loadLinkCases(caseID)
function loadLibModules(libID)
{
link = createLink('tree', 'ajaxGetOptionMenu', 'libID=' + libID + '&viewtype=testlib&branch=0&rootModuleID=0&returnType=html&needManage=true');
link = createLink('tree', 'ajaxGetOptionMenu', 'libID=' + libID + '&viewtype=caselib&branch=0&rootModuleID=0&returnType=html&needManage=true');
$('#moduleIdBox').load(link, function()
{
$(this).find('select').chosen(defaultChosenOptions)
+1 -1
View File
@@ -147,7 +147,7 @@ $lang->testcase->stageList['bvt'] = '版本验证阶段';
$lang->testcase->reviewResultList[''] = '';
$lang->testcase->reviewResultList['pass'] = '确认通过';
$lang->testcase->reviewResultList['clarify'] = '有待明确';
$lang->testcase->reviewResultList['clarify'] = '继续完善';
$lang->testcase->groups[''] = '分组查看';
$lang->testcase->groups['story'] = '需求分组';
+10 -8
View File
@@ -382,7 +382,7 @@ class testcaseModel extends model
$cases = $this->dao->select('*')->from(TABLE_CASE)->where($caseQuery)
->beginIF($queryProductID != 'all')->andWhere('product')->eq($productID)->fi()
->andWhere('deleted')->eq(0)
->orderBy($orderBy)->page($pager)->fetchAll();
->orderBy($orderBy)->page($pager)->fetchAll('id');
return $cases;
}
@@ -401,7 +401,7 @@ class testcaseModel extends model
return $this->dao->select('t1.assignedTo AS assignedTo, t2.*')->from(TABLE_TESTRUN)->alias('t1')
->leftJoin(TABLE_CASE)->alias('t2')->on('t1.case = t2.id')
->leftJoin(TABLE_TESTTASK)->alias('t3')->on('t1.task = t3.id')
->Where('t1.assignedTo')->eq($account)
->where('t1.assignedTo')->eq($account)
->andWhere('t1.status')->ne('done')
->andWhere('t3.status')->ne('done')
->andWhere('t3.deleted')->eq(0)
@@ -421,6 +421,7 @@ class testcaseModel extends model
public function getByOpenedBy($account, $orderBy = 'id_desc', $pager = null)
{
return $this->dao->findByOpenedBy($account)->from(TABLE_CASE)
->andWhere('product')->ne(0)
->andWhere('deleted')->eq(0)
->orderBy($orderBy)->page($pager)->fetchAll();
}
@@ -720,6 +721,7 @@ class testcaseModel extends model
if($data->pris[$caseID] == 'ditto') $data->pris[$caseID] = isset($prev['pri']) ? $prev['pri'] : 3;
if($data->modules[$caseID] == 'ditto') $data->modules[$caseID] = isset($prev['module']) ? $prev['module'] : 0;
if($data->types[$caseID] == 'ditto') $data->types[$caseID] = isset($prev['type']) ? $prev['type'] : '';
if($data->stories[$caseID] == '') $data->stories[$caseID] = 0;
$prev['pri'] = $data->pris[$caseID];
$prev['module'] = $data->modules[$caseID];
@@ -1264,7 +1266,7 @@ class testcaseModel extends model
{
$caseBugs = $this->dao->select('count(*) as count, `case`')->from(TABLE_BUG)->where('`case`')->in($caseIdList)->andWhere('deleted')->eq(0)->groupBy('`case`')->fetchPairs('case', 'count');
$results = $this->dao->select('count(*) as count, `case`')->from(TABLE_TESTRESULT)->where('`case`')->in($caseIdList)->groupBy('`case`')->fetchPairs('case', 'count');
$caseFailCount = $this->dao->select('`case` AS name, COUNT(*) AS value')->from(TABLE_TESTRESULT)->where('caseResult')->eq('fail')->andwhere('`case`')->in($caseIdList)->groupBy('name')->orderBy('value DESC')->fetchAll('name');
$caseFailCount = $this->dao->select('`case` AS name, COUNT(*) AS value')->from(TABLE_TESTRESULT)->where('caseResult')->eq('fail')->andwhere('`case`')->in($caseIdList)->groupBy('name')->orderBy('value DESC')->fetchPairs('name','value');
$stepNumber = $this->dao->select('count(distinct t1.id) as count, t1.`case`')->from(TABLE_CASESTEP)->alias('t1')
->leftJoin(TABLE_CASE)->alias('t2')->on('t1.`case`=t2.`id`')
->where('t1.`case`')->in($caseIdList)
@@ -1284,13 +1286,13 @@ class testcaseModel extends model
->fetchPairs('case', 'count');
}
foreach($cases as $case)
foreach($cases as $key => $case)
{
$caseID = $type == 'case' ? $case->id : $case->case;
$case->bugs = isset($caseBugs[$caseID]) ? $caseBugs[$caseID] : 0;
$case->results = isset($results[$caseID]) ? $results[$caseID] : 0;
$case->caseFailCount = isset($results[$caseID]) ? $caseFailCount[$caseID]->value : 0;
$case->stepNumber = isset($stepNumber[$caseID]) ? $stepNumber[$caseID] : 0;
$case->bugs = isset($caseBugs[$caseID]) ? $caseBugs[$caseID] : 0;
$case->results = isset($results[$caseID]) ? $results[$caseID] : 0;
$case->caseFailCount = isset($caseFailCount[$caseID])? $caseFailCount[$caseID] : 0;
$case->stepNumber = isset($stepNumber[$caseID]) ? $stepNumber[$caseID] : 0;
}
return $cases;
+1 -1
View File
@@ -36,7 +36,7 @@ foreach(explode(',', $showFields) as $field)
<th class='w-70px<?php echo zget($visibleFields, 'pri', ' hidden')?>'> <?php echo $lang->priAB;?></th>
<th class='w-100px<?php echo zget($visibleFields, 'status', ' hidden')?>'><?php echo $lang->statusAB;?></th>
<th class='w-150px<?php echo zget($visibleFields, 'module', ' hidden')?>'><?php echo $lang->testcase->module;?></th>
<th><?php echo $lang->testcase->story;?></th>
<th class='w-150px<?php echo zget($visibleFields, 'story', ' hidden')?>'><?php echo $lang->testcase->story;?></th>
<th><?php echo $lang->testcase->title;?></th>
<th class='w-120px'><?php echo $lang->testcase->type;?></th>
<th class='<?php echo zget($visibleFields, 'precondition', 'hidden')?>'> <?php echo $lang->testcase->precondition;?></th>
+12 -1
View File
@@ -11,7 +11,7 @@
*/
?>
<?php include '../../common/view/header.lite.html.php';?>
<form action='<?php echo $this->createLink('bug', 'create', "product=$case->product&branch=$case->branch&extras=caseID=$case->id,version=$case->version,runID=")?>' target='_parent' method='post'>
<form target='_parent' method='post'>
<div class='main' id='resultsContainer'>
</div>
</form>
@@ -29,6 +29,17 @@ $(function()
$this.find('.collapse-handle').toggleClass('icon-chevron-down', !show).toggleClass('icon-chevron-up', show);;
});
$(".step-group input[type='checkbox']").click(function()
{
var $next = $(this).closest('tr').next();
while($next.length && $next.hasClass('step-item'))
{
var isChecked = $(this).prop('checked');
$next.find("input[type='checkbox']").prop('checked', isChecked);
$next = $next.next();
}
});
$('#casesResults table caption .result-tip').html($('#resultTip').html());
$('tr').remove('#result-success');
+1 -1
View File
@@ -17,7 +17,7 @@
<strong class='pull-left'><small class='text-muted'><?php echo html::icon($lang->icons['import']);?></small> <?php echo $lang->testcase->importFromLib;?></strong>
<div class='input-group pull-left' style='font-weight:normal;'>
<span class='input-group-addon'><?php echo $lang->testcase->selectLib;?></span>
<?php echo html::select('fromlib', $libraries, $libID, "onchange='reload(this.value)' class='form-control chosen'");?>
<?php echo html::select('fromlib', $libraries, $libID, "onchange='reload(this.value)' class='form-control chosen'");?>
</div>
</div>
</div>
+2 -1
View File
@@ -48,7 +48,7 @@
common::printIcon('testtask', 'runCase', "runID=$runID&caseID=$case->id&version=$case->currentVersion", '', 'button', '', '', 'runCase', false, "data-width='95%'");
common::printIcon('testtask', 'results', "runID=$runID&caseID=$case->id&version=$case->version", '', 'button', '', '', 'results', false, "data-width='95%'");
if($caseFailCount > 0) common::printIcon('testcase', 'createBug', "product=$case->product&branch=$case->branch&extra=caseID=$case->id,version=$case->version,runID=$runID", '', 'button', 'bug', '', 'iframe');
if($caseFailCount > 0) common::printIcon('testcase', 'createBug', "product=$case->product&branch=$case->branch&extra=caseID=$case->id,version=$case->version,runID=$runID", '', 'button', 'bug', '', 'iframe', '', "data-width='90%'");
}
if($config->testcase->needReview) common::printIcon('testcase', 'review', "caseID=$case->id", $case, 'button', 'review', '', 'iframe');
echo '</div>';
@@ -127,6 +127,7 @@
</div>
</div>
<div class='col-side'>
<a class='side-handle' data-id='caseSide'><i class='icon-caret-right'></i></a>
<div class='main main-side'>
<fieldset>
<legend><?php echo $lang->testcase->legendBasicInfo;?></legend>
+20 -44
View File
@@ -31,6 +31,7 @@ class testreport extends control
$this->loadModel('testcase');
$this->loadModel('testtask');
$this->loadModel('user');
$this->app->loadLang('report');
}
/**
@@ -190,15 +191,9 @@ class testreport extends control
$this->view->cases = $cases;
$this->view->caseSummary = $this->testreport->getResultSummary($tasks, $cases);
$this->view->legacyBugs = $bugInfo['legacyBugs'];
$this->view->bugSeverityGroups = $bugInfo['bugSeverityGroups'];
$this->view->bugStatusGroups = $bugInfo['bugStatusGroups'];
$this->view->bugOpenedByGroups = $bugInfo['bugOpenedByGroups'];
$this->view->bugResolvedByGroups = $bugInfo['bugResolvedByGroups'];
$this->view->bugResolutionGroups = $bugInfo['bugResolutionGroups'];
$this->view->bugModuleGroups = $bugInfo['bugModuleGroups'];
$this->view->bugConfirmedRate = $bugInfo['bugConfirmedRate'];
$this->view->bugCreateByCaseRate = $bugInfo['bugCreateByCaseRate'];
$this->view->legacyBugs = $bugInfo['legacyBugs'];
unset($bugInfo['legacyBugs']);
$this->view->bugInfo = $bugInfo;
$this->view->objectID = $objectID;
$this->view->objectType = $objectType;
@@ -212,22 +207,22 @@ class testreport extends control
* @access public
* @return void
*/
public function view($reportID)
public function view($reportID, $from = 'product')
{
$report = $this->testreport->getById($reportID);
$project = $this->project->getById($report->project);
if($report->objectType == 'testtask')
if($from == 'product' and is_numeric($report->product))
{
$task = $this->testtask->getById($report->objectID);
$productID = $this->commonAction($task->product, 'product');
if($productID != $task->product) die('deny access');
$product = $this->product->getById($report->product);
$productID = $this->commonAction($report->product, 'product');
if($productID != $report->product) die('deny access');
$browseLink = inlink('browse', "objectID=$productID&objectType=product&extra={$report->objectID}");
$this->view->position[] = html::a($browseLink, $task->name);
$browseLink = inlink('browse', "objectID=$productID&objectType=product");
$this->view->position[] = html::a($browseLink, $product->name);
}
elseif($report->objectType == 'project')
else
{
$projectID = $this->commonAction($report->objectID, 'project');
$projectID = $this->commonAction($report->project, 'project');
if($projectID != $report->objectID) die('deny access');
$browseLink = inlink('browse', "objectID=$projectID&objectType=project");
@@ -268,15 +263,9 @@ class testreport extends control
$this->view->storySummary = $this->product->summary($stories);
$this->view->caseSummary = $this->testreport->getResultSummary($tasks, $cases);
$this->view->legacyBugs = $bugInfo['legacyBugs'];
$this->view->bugSeverityGroups = $bugInfo['bugSeverityGroups'];
$this->view->bugStatusGroups = $bugInfo['bugStatusGroups'];
$this->view->bugOpenedByGroups = $bugInfo['bugOpenedByGroups'];
$this->view->bugResolvedByGroups = $bugInfo['bugResolvedByGroups'];
$this->view->bugResolutionGroups = $bugInfo['bugResolutionGroups'];
$this->view->bugModuleGroups = $bugInfo['bugModuleGroups'];
$this->view->bugConfirmedRate = $bugInfo['bugConfirmedRate'];
$this->view->bugCreateByCaseRate = $bugInfo['bugCreateByCaseRate'];
$this->view->legacyBugs = $bugInfo['legacyBugs'];
unset($bugInfo['legacyBugs']);
$this->view->bugInfo = $bugInfo;
$this->display();
}
@@ -318,23 +307,10 @@ class testreport extends control
$this->session->set('notHead', true);
$output = $this->fetch('testreport', 'view', array('reportID' =>$reportID));
$this->session->set('notHead', false);
$style = <<<EOD
<style>
body{font-size:14px}h1{font-size:16px;text-align:center}
.w-100px{width:100px}.w-p50{width:50%}.w-id{width:70px}.w-pri{width:40px}.w-user{width:80px}.w-80px{width:80px}.w-70px{width:70px}.w-hour[width:57px].w-status{width:60px}.w-130px{width:130px;}.w-type{width:80px}.w-150px{width:150px;}
.text-center{text-align:center}.text-top{vertical-align:top;}.text-left{text-align:left}.text-right{text-align:right;}
.table{width:100%;margin-bottom:5px;border:1px solid #ddd;border-collapse:collapse;border-spacing:0;}
.table caption{padding:8px 20px;border:1px solid #DDD;border-bottom:0;background:#fafafa;text-align:left}.table td, .table th{border-bottom:1px solid #ddd;padding:5px;}
.table>thead>tr>th{text-align:center;vertical-align:middle;background-color:#f1f1f1;border-bottom:1px solid #ddd;}
.table-form{border: none;}.table-form>tbody>tr>th,.table-form>tbody>tr>td{border-bottom:none;}.table-form>tbody>tr>th{text-align:right;}
.input-group{width:100%;}.input-group{position:relative;display:table;border-collapse:separate;}
.input-group-addon:first-child {border-right:0;}
.input-group-addon{background-color:#f5f5f5;padding:6px 12px;font-size:13px;font-weight:400;line-height:1;color:#222;text-align:center;background-color:#e5e5e5;border:1px solid #ccc;border-radius:0;display:table-cell;}
.input-group-addon:first-child{border-top-right-radius:0;border-bottom-right-radius:0;}
fieldset{margin-bottom:15px;border:1px solid #e5e5e5;padding:10px 15px 15px;}fieldset>legend{width:auto;margin:0 0 0 -5px;font-weight:bold;border-bottom:none;padding:0 5px;display:block;}
</style>
EOD;
$content = "<!DOCTYPE html>\n<html lang='zh-cn'>\n<head>\n<meta charset='utf-8'>\n<title>{$report->title}</title>\n$style</head>\n<body>\n<h1>{$report->title}</h1>\n$output</body></html>";
$css = '<style>' . $this->getCSS('testreport', 'export') . '</style>';
$js = '<script>' . $this->getJS('testreport', 'export') . '</script>';
$exportNotice = "<p style='text-align:right;color:grey'>" . $this->lang->testreport->exportNotice . '</p>';
$content = "<!DOCTYPE html>\n<html lang='zh-cn'>\n<head>\n<meta charset='utf-8'>\n<title>{$report->title}</title>\n$css\n$js\n</head>\n<body onload='tab()'>\n<h1>{$report->title}</h1>\n$output\n$exportNotice</body></html>";
$this->fetch('file', 'sendDownHeader', array('fileName' => $data->fileName, 'fileType' => $data->fileType, 'content' =>$content));
}
$this->view->customExport = false;
+3
View File
@@ -0,0 +1,3 @@
.none-data{padding:8px !important;}
.main #stories{margin-bottom:10px}
.main .table-report{border:0px;}
+13
View File
@@ -0,0 +1,13 @@
body{font-size:14px}h1{font-size:16px;text-align:center}
.w-100px{width:100px}.w-p50{width:50%}.w-p70{width:70%}.w-id{width:70px}.w-pri{width:40px}.w-user{width:80px}.w-80px{width:80px}.w-70px{width:70px}.w-hour[width:57px].w-status{width:60px}.w-130px{width:130px;}.w-type{width:80px}.w-150px{width:150px;}
.text-center{text-align:center}.text-top{vertical-align:top;}.text-left{text-align:left}.text-right{text-align:right;}
.table{width:100%;margin-bottom:5px;border:1px solid #ddd;border-collapse:collapse;border-spacing:0;}
.table caption{padding:8px 20px;border:1px solid #DDD;border-bottom:0;background:#fafafa;text-align:left}.table td, .table th{border-bottom:1px solid #ddd;padding:5px;}
.table>thead>tr>th{text-align:center;vertical-align:middle;background-color:#f1f1f1;border-bottom:1px solid #ddd;}
.main .nav-tabs{padding-left: 20px;padding-top:10px;margin-bottom:0;list-style:none;}
.main .nav-tabs:after{clear:both;display:table;content:" ";}
.nav-tabs > li{float:left;margin-bottom:-1px;position:relative;display:block;}
.nav-tabs > li > a{padding:5px 10px;color:#333;line-height:20px;max-height:32px;margin-right:2px;border:1px solid transparent;border-radius:0;position:relative;display:block;text-decoration:none;outline:none;}
.nav-tabs > li.active > a,.nav-tabs > li.active > a:hover,.nav-tabs > li.active > a:focus{color:#333;font-weight:bold;line-height: 20px;cursor:default;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent;}
.tab-pane{display:none}
.tab-pane.active{display:block}
+4
View File
@@ -0,0 +1,4 @@
.main{padding:0px !important;}
.main .nav-tabs{padding-left:20px; padding-top:10px;}
.main .tab-content{border:0px;}
.tab-content #builds tr:last-child td, .tab-content #cases tr:last-child td,.tab-content #bugs tr:last-child td,.tab-content #legacyBugs tr:last-child td{border-bottom:0px;}
+16
View File
@@ -0,0 +1,16 @@
$(function()
{
var resizeChartTable = function()
{
$('.table-wrapper').each(function()
{
var $this = $(this);
$this.css('max-height', $this.closest('.table').find('.chart-wrapper').outerHeight());
});
};
resizeChartTable();
fixedTableHead('.table-wrapper');
$('.tab-pane').removeClass('active');
$('.tab-pane:first').addClass('active');
});
+33
View File
@@ -0,0 +1,33 @@
function tab()
{
tabContent = new Array();
var divTags=document.getElementsByTagName("div");
for(var divKey in divTags)
{
if(typeof(divTags[divKey]) == 'object' && divTags[divKey].getAttribute('class').indexOf('tab-pane') >= 0)
{
tabContent.push(divTags[divKey]);
divTags[divKey].setAttribute('class', 'tab-pane');
}
}
tabContent[0].setAttribute('class', 'tab-pane active');
var aTags=document.getElementsByTagName("a");
for(var i = 0;i<aTags.length;i++)
{
if(aTags[i].getAttribute("data-toggle") == 'tab')
{
aTags[i].onclick = function()
{
var liTags=document.getElementsByTagName("li");
for(var liKey in liTags)
{
if(typeof(liTags[liKey]) == 'object' && liTags[liKey].parentNode.getAttribute('class') == 'nav nav-tabs') liTags[liKey].removeAttribute('class');
}
this.parentNode.setAttribute('class', 'active');
for(var divKey in tabContent) tabContent[divKey].setAttribute('class', 'tab-pane');
document.getElementById(this.getAttribute('data-target').replace(/#/, '')).setAttribute('class', 'tab-pane active');
}
}
}
}
+16
View File
@@ -0,0 +1,16 @@
$(function()
{
var resizeChartTable = function()
{
$('.table-wrapper').each(function()
{
var $this = $(this);
$this.css('max-height', $this.closest('.table').find('.chart-wrapper').outerHeight());
});
};
resizeChartTable();
fixedTableHead('.table-wrapper');
$('.tab-pane').removeClass('active');
$('.tab-pane:first').addClass('active');
});
+17 -11
View File
@@ -19,25 +19,31 @@ $lang->testreport->report = '总结';
$lang->testreport->legacyBugs = '遗留的Bug';
$lang->testreport->createdDate = '创建时间';
$lang->testreport->objectID = '所属对象';
$lang->testreport->profile = '概况';
$lang->testreport->value = '值';
$lang->testreport->none = '无';
$lang->testreport->all = '所有报告';
$lang->testreport->legendBasic = '基本信息';
$lang->testreport->legendStoryAndBug = '测试的需求和Bug';
$lang->testreport->legendBuild = '版本信息';
$lang->testreport->legendCase = '执行的用例的信息';
$lang->testreport->legendBug = '缺陷信息';
$lang->testreport->legendStoryAndBug = '测试范围';
$lang->testreport->legendBuild = '测试轮次';
$lang->testreport->legendCase = '执行的用例';
$lang->testreport->legendLegacyBugs = '遗留的Bug';
$lang->testreport->legendReport = '报表';
$lang->testreport->legendMore = '更多功能';
$lang->testreport->bugSeverityGroups = '产生Bug严重级别分布';
$lang->testreport->bugStatusGroups = '产生Bug状态分布';
$lang->testreport->bugOpenedByGroups = '产生Bug创建者分布';
$lang->testreport->bugResolvedByGroups = '产生Bug解决者分布';
$lang->testreport->bugResolutionGroups = '产生Bug解决方案分布';
$lang->testreport->bugModuleGroups = '产生Bug模块分布';
$lang->testreport->bugSeverityGroups = 'Bug严重级别分布';
$lang->testreport->bugStatusGroups = 'Bug状态分布';
$lang->testreport->bugOpenedByGroups = 'Bug创建者分布';
$lang->testreport->bugResolvedByGroups = 'Bug解决者分布';
$lang->testreport->bugResolutionGroups = 'Bug解决方案分布';
$lang->testreport->bugModuleGroups = 'Bug模块分布';
$lang->testreport->legacyBugs = '遗留的Bug';
$lang->testreport->bugConfirmedRate = '有效Bug率 (确认的Bug / 测试创建的Bug)';
$lang->testreport->bugCreateByCaseRate = '用例发现Bug率 (用例创建的Bug / 时间区间中新增的Bug)';
$lang->testreport->caseSummary = '共有%s个用例,共执行%s个用例,产生了%s个结果,失败的用例有%s个';
$lang->testreport->caseSummary = '共有<strong>%s</strong>个用例,共执行<strong>%s</strong>个用例,产生了<strong>%s</strong>个结果,失败的用例有<strong>%s</strong>个。';
$lang->testreport->buildSummary = '共测试了<strong>%s</strong>个版本。';
$lang->testreport->bugSummary = '共产生<strong>%s</strong>个Bug,遗留<strong>%s</strong>个Bug。有效Bug率(确认的Bug / 产生的Bug):<strong>%s</strong>,用例发现Bug率(用例创建的Bug / 时间区间中新增的Bug):<strong>%s</strong>';
$lang->testreport->confirmDelete = '是否删除该报告?';
$lang->testreport->exportNotice = "由<a href='http://www.zentao.net' target='_blank' style='color:grey'>禅道项目管理软件</a>导出";
+11 -6
View File
@@ -93,7 +93,7 @@ class testreportModel extends model
return $this->dao->select('*')->from(TABLE_TESTREPORT)->where('deleted')->eq(0)
->beginIF($objectType == 'project')->andWhere('objectID')->eq($objectID)->andWhere('objectType')->eq('project')->fi()
->beginIF($objectType == 'product' and $extra)->andWhere('objectID')->eq((int)$extra)->andWhere('objectType')->eq('testtask')->fi()
->beginIF($objectType == 'product' and empty($extra))->andWhere("CONCAT(',', product, ',') like '%,$objectID,%'")->fi()
->beginIF($objectType == 'product' and empty($extra))->andWhere('product')->eq($objectID)->fi()
->orderBy($orderBy)
->page($pager)
->fetchAll('id');
@@ -136,12 +136,13 @@ class testreportModel extends model
if($bug->case) $byCaseNum ++;
}
$bugInfo['legacyBugs'] = $legacyBugs;
$bugInfo['countBugByTask'] = count($bugsByTask);
$bugInfo['bugSeverityGroups'] = $severityGroups;
$bugInfo['bugStatusGroups'] = $statusGroups;
$bugInfo['bugOpenedByGroups'] = $openedByGroups;
$bugInfo['bugResolvedByGroups'] = $resolvedByGroups;
$bugInfo['bugResolutionGroups'] = $resolutionGroups;
$bugInfo['bugOpenedByGroups'] = $openedByGroups;
$bugInfo['bugModuleGroups'] = $moduleGroups;
$bugInfo['bugResolvedByGroups'] = $resolvedByGroups;
$bugInfo['bugConfirmedRate'] = round($confirmedNum / count($bugsByTask) * 100, 2);
$bugInfo['bugCreateByCaseRate'] = empty($byCaseNum) ? 0 : round($byCaseNum / count($newBugs) * 100, 2);
return $bugInfo;
@@ -175,15 +176,19 @@ class testreportModel extends model
*/
public function getResultSummary($tasks, $cases)
{
$results = $this->dao->select('*')->from(TABLE_TESTRESULT)->where('run')->in(array_keys($tasks))->andWhere('`case`')->in(array_keys($cases))->fetchAll();
$results = $this->dao->select('t1.*')->from(TABLE_TESTRESULT)->alias('t1')
->leftJoin(TABLE_TESTRUN)->alias('t2')->on('t1.run=t2.id')
->where('t2.task')->in(array_keys($tasks))
->andWhere('t1.`case`')->in(array_keys($cases))
->fetchAll();
$failResults = array();
$runCasesNum = array();
foreach($results as $result)
{
$runCases[$result->case] = $result->case;
$runCasesNum[$result->case] = $result->case;
if($result->caseResult == 'fail') $failResults[$result->case] = $result->case;
}
return sprintf($this->lang->testreport->caseSummary, count($cases), count($results), count($runCasesNum), count($failResults));
return sprintf($this->lang->testreport->caseSummary, count($cases), count($runCasesNum), count($results), count($failResults));
}
/**
@@ -1,109 +0,0 @@
<tr>
<th class='text-top w-80px'><?php echo $lang->testreport->bugInfo?></th>
<td class='text-top' colspan='2'>
<div class='input-group' id='bugConfirmedRate'>
<span class='input-group-addon'><?php echo $lang->testreport->bugConfirmedRate?></span>
<span class='input-group-addon'><?php echo $bugConfirmedRate . '%'?></span>
<span class='input-group-addon'><?php echo $lang->testreport->bugCreateByCaseRate?></span>
<span class='input-group-addon'><?php echo $bugCreateByCaseRate . '%'?></span>
</div>
<table class='table table-form'>
<tr>
<td class='text-top' width='33%'>
<table class='table table-condensed' id='bugSeverityGroups'>
<caption><?php echo $lang->testreport->bugSeverityGroups?></caption>
<tr>
<th class='text-right w-100px'><?php echo $lang->bug->severity?></th>
<th><?php echo $lang->testreport->value?></th>
</tr>
<?php foreach($lang->bug->severityList as $severityKey => $severityValue):?>
<tr>
<td class='text-right'><?php echo $severityValue === '' ? 'null' : $severityValue?></td>
<td><?php echo zget($bugSeverityGroups, $severityKey, 0);?></td>
</tr>
<?php endforeach?>
</table>
</td>
<td class='text-top' width='33%'>
<table class='table table-condensed' id='bugStatusGroups'>
<caption><?php echo $lang->testreport->bugStatusGroups?></caption>
<tr>
<th class='text-right w-100px'><?php echo $lang->bug->status?></th>
<th><?php echo $lang->testreport->value?></th>
</tr>
<?php foreach($lang->bug->statusList as $statusKey => $statusValue):?>
<?php if(!isset($bugStatusGroups['']) and $statusValue === '') continue;?>
<tr>
<td class='text-right'><?php echo $statusValue === '' ? 'null' : $statusValue?></td>
<td><?php echo zget($bugStatusGroups, $statusKey, 0);?></td>
</tr>
<?php endforeach?>
</table>
</td>
<td class='text-top' width='33%'>
<table class='table table-condensed' id='bugResolutionGroups'>
<caption><?php echo $lang->testreport->bugResolutionGroups?></caption>
<tr>
<th class='text-right w-100px'><?php echo $lang->bug->resolution?></th>
<th><?php echo $lang->testreport->value?></th>
</tr>
<?php foreach($lang->bug->resolutionList as $resolutionKey => $resolutionValue):?>
<tr>
<td class='text-right'><?php echo $resolutionValue === '' ? 'null' : $resolutionValue?></td>
<td><?php echo zget($bugResolutionGroups, $resolutionKey, 0);?></td>
</tr>
<?php endforeach?>
</table>
</td>
</tr>
<tr>
<td class='text-top'>
<table class='table table-condensed' id='bugOpenedByGroups'>
<caption><?php echo $lang->testreport->bugOpenedByGroups?></caption>
<tr>
<th class='text-right w-100px'><?php echo $lang->bug->openedBy?></th>
<th><?php echo $lang->testreport->value?></th>
</tr>
<?php foreach($bugOpenedByGroups as $account => $num):?>
<tr>
<td class='text-right'><?php echo zget($users, $account)?></td>
<td><?php echo $num;?></td>
</tr>
<?php endforeach?>
</table>
</td>
<td class='text-top'>
<table class='table table-condensed' id='bugModuleGroups'>
<caption><?php echo $lang->testreport->bugModuleGroups?></caption>
<tr>
<th class='text-right w-100px'><?php echo $lang->bug->module?></th>
<th><?php echo $lang->testreport->value?></th>
</tr>
<?php ksort($bugModuleGroups)?>
<?php foreach($bugModuleGroups as $moduleKey => $num):?>
<tr>
<td class='text-right'><?php echo zget($modules, $moduleKey);?></td>
<td><?php echo $num;?></td>
</tr>
<?php endforeach?>
</table>
</td>
<td class='text-top'>
<table class='table table-condensed' id='bugResolvedByGroups'>
<caption><?php echo $lang->testreport->bugResolvedByGroups?></caption>
<tr>
<th class='text-right w-100px'><?php echo $lang->bug->resolvedBy?></th>
<th><?php echo $lang->testreport->value?></th>
</tr>
<?php foreach($bugResolvedByGroups as $account => $num):?>
<tr>
<td class='text-right'><?php echo zget($users, $account)?></td>
<td><?php echo $num;?></td>
</tr>
<?php endforeach?>
</table>
</td>
</tr>
</table>
</td>
</tr>
@@ -0,0 +1,70 @@
<table class='table table-form'>
<?php $row = 0;?>
<?php foreach($bugInfo as $infoKey => $infoValue):?>
<?php if(($row % 1) == 0) echo '<tr>';?>
<?php $row++;?>
<td class='text-top'>
<?php $sum = array_sum($infoValue);?>
<table class='table table-condensed table-report' id='bugSeverityGroups'>
<?php if($sum == 0):?>
<tr>
<td class='none-data'>
<h5><?php echo $lang->testreport->$infoKey?></h5>
<?php echo $lang->testreport->none;?>
</td>
</tr>
<?php else:?>
<tr class='text-top'>
<td class='w-p70'>
<div class='chart-wrapper text-center'>
<h5><?php echo $lang->testreport->$infoKey?></h5>
<div class='chart-canvas'>
<?php if(isset($_POST["chart-{$infoKey}"])):?>
<img src='<?php echo $_POST["chart-{$infoKey}"]?>' />
<?php else:?>
<canvas id='chart-<?php echo $infoKey?>' width='100' height='14' data-responsive='true'></canvas>
<?php endif;?>
</div>
</div>
</td>
<td>
<div class='table-wrapper' style='overflow:auto'>
<table class='table table-condensed table-hover table-striped table-bordered table-chart' data-chart='pie' data-target='#chart-<?php echo $infoKey?>' data-animation='false'>
<thead>
<tr>
<th class='chart-label' colspan='2'><?php echo $lang->report->item;?></th>
<th><?php echo $lang->report->value;?></th>
<th><?php echo $lang->report->percent;?></th>
</tr>
</thead>
<?php
$list = $infoValue;
if($infoKey == 'bugSeverityGroups') $list = $lang->bug->severityList;
if($infoKey == 'bugStatusGroups') $list = $lang->bug->statusList;
if($infoKey == 'bugResolutionGroups') $list = $lang->bug->resolutionList;
?>
<?php foreach($list as $listKey => $listValue):?>
<?php
$label = $listValue;
if($infoKey == 'bugOpenedByGroups' or $infoKey == 'bugResolvedByGroups') $label = zget($users, $listKey);
if($infoKey == 'bugModuleGroups') $label = zget($modules, $listKey);
if(empty($label)) continue;
$data = zget($infoValue, $listKey, 0);
?>
<tr class='text-center'>
<td class='chart-color w-20px'><i class='chart-color-dot icon-circle'></i></td>
<td class='chart-label'><?php echo $label;?></td>
<td class='chart-value'><?php echo $data;?></td>
<td><?php echo ($data / $sum * 100) . '%';?></td>
</tr>
<?php endforeach?>
</table>
</div>
</td>
</tr>
<?php endif;?>
</table>
</td>
<?php if(($row % 1) == 0) echo '<tr>';?>
<?php endforeach;?>
</table>
+30 -35
View File
@@ -1,35 +1,30 @@
<tr>
<th class='text-top w-80px'><?php echo $lang->testreport->bugs?></th>
<td colspan='2'>
<?php if($bugs):?>
<table class='table' id='bugs'>
<thead>
<tr>
<th class='w-id'> <?php echo $lang->idAB;?></th>
<th class='w-pri'> <?php echo $lang->priAB;?></th>
<th> <?php echo $lang->bug->title;?></th>
<th class='w-user'> <?php echo $lang->openedByAB;?></th>
<th class='w-user'><?php echo $lang->bug->resolvedBy;?></th>
<th class='w-130px'><?php echo $lang->bug->resolvedDate;?></th>
<th class='w-80px'> <?php echo $lang->statusAB;?></th>
</tr>
</thead>
<tbody class='text-center'>
<?php foreach($bugs as $bug):?>
<tr>
<td><?php echo $bug->id . html::hidden('bugs[]', $bug->id)?></td>
<td><span class='pri<?php echo $bug->pri?>'><?php echo zget($lang->bug->priList, $bug->pri);?></span></td>
<td class='text-left' title='<?php echo $bug->title?>'><?php echo $bug->title?></td>
<td><?php echo zget($users, $bug->openedBy);?></td>
<td><?php echo zget($users, $bug->resolvedBy);?></td>
<td><?php if($bug->resolvedDate != '0000-00-00 00:00:00') echo substr($bug->resolvedDate, 2);?></td>
<td><?php echo zget($lang->bug->statusList, $bug->status);?></td>
</tr>
<?php endforeach;?>
</tbody>
</table>
<?php else:?>
<?php echo $lang->testreport->none;?>
<?php endif?>
</td>
</tr>
<table class='table' id='bugs'>
<thead>
<tr>
<th class='w-id'> <?php echo $lang->idAB;?></th>
<th class='w-pri'> <?php echo $lang->priAB;?></th>
<th> <?php echo $lang->bug->title;?></th>
<th class='w-user'> <?php echo $lang->openedByAB;?></th>
<th class='w-user'><?php echo $lang->bug->resolvedBy;?></th>
<th class='w-130px'><?php echo $lang->bug->resolvedDate;?></th>
<th class='w-80px'> <?php echo $lang->statusAB;?></th>
</tr>
</thead>
<?php if($bugs):?>
<tbody class='text-center'>
<?php foreach($bugs as $bug):?>
<tr>
<td><?php echo $bug->id . html::hidden('bugs[]', $bug->id)?></td>
<td><span class='pri<?php echo $bug->pri?>'><?php echo zget($lang->bug->priList, $bug->pri);?></span></td>
<td class='text-left' title='<?php echo $bug->title?>'><?php echo $bug->title?></td>
<td><?php echo zget($users, $bug->openedBy);?></td>
<td><?php echo zget($users, $bug->resolvedBy);?></td>
<td><?php if($bug->resolvedDate != '0000-00-00 00:00:00') echo substr($bug->resolvedDate, 2);?></td>
<td><?php echo zget($lang->bug->statusList, $bug->status);?></td>
</tr>
<?php endforeach;?>
</tbody>
<?php else:?>
<tr><td class='none-data'><?php echo $lang->testreport->none;?></td></tr>
<?php endif?>
</table>
+4 -4
View File
@@ -1,4 +1,3 @@
<?php if($builds):?>
<table class='table' id='builds'>
<thead>
<tr>
@@ -8,6 +7,7 @@
<th class='w-date'><?php echo $lang->build->date;?></th>
</tr>
</thead>
<?php if($builds):?>
<tbody class='text-center'>
<?php foreach($builds as $build):?>
<tr>
@@ -18,7 +18,7 @@
</tr>
<?php endforeach;?>
</tbody>
<?php else:?>
<tr><td class='none-data'><?php echo 'Trunk'?></td></tr>
<?php endif;?>
</table>
<?php else:?>
<?php echo 'Trunk'?>
<?php endif;?>
+4 -5
View File
@@ -1,4 +1,3 @@
<?php if($cases):?>
<table class='table' id='cases'>
<thead>
<tr>
@@ -13,6 +12,7 @@
<th class='w-status'><?php echo $lang->statusAB;?></th>
</tr>
</thead>
<?php if($cases):?>
<tbody class='text-center'>
<?php foreach($cases as $case):?>
<tr>
@@ -28,8 +28,7 @@
</tr>
<?php endforeach;?>
</tbody>
<tfoot><tr><td colspan='9'><?php echo $caseSummary;?></td></tr></tfoot>
<?php else:?>
<tr><td class='none-data'><?php echo $lang->testreport->none;?></td></tr>
<?php endif;?>
</table>
<?php else:?>
<?php echo $lang->testreport->none;?>
<?php endif;?>
+30 -35
View File
@@ -1,35 +1,30 @@
<tr>
<th class='text-top w-80px'><?php echo $lang->testreport->legacyBugs?></th>
<td colspan='2'>
<?php if($legacyBugs):?>
<table class='table' id='bugs'>
<thead>
<tr>
<th class='w-id'> <?php echo $lang->idAB;?></th>
<th class='w-pri'> <?php echo $lang->priAB;?></th>
<th> <?php echo $lang->bug->title;?></th>
<th class='w-user'> <?php echo $lang->openedByAB;?></th>
<th class='w-user'><?php echo $lang->bug->resolvedBy;?></th>
<th class='w-130px'><?php echo $lang->bug->resolvedDate;?></th>
<th class='w-80px'> <?php echo $lang->statusAB;?></th>
</tr>
</thead>
<tbody class='text-center'>
<?php foreach($legacyBugs as $bug):?>
<tr>
<td><?php echo $bug->id?></td>
<td><span class='pri<?php echo $bug->pri?>'><?php echo zget($lang->bug->priList, $bug->pri);?></span></td>
<td class='text-left' title='<?php echo $bug->title?>'><?php echo $bug->title?></td>
<td><?php echo zget($users, $bug->openedBy);?></td>
<td><?php echo zget($users, $bug->resolvedBy);?></td>
<td><?php if($bug->resolvedDate != '0000-00-00 00:00:00') echo substr($bug->resolvedDate, 2);?></td>
<td><?php echo zget($lang->bug->statusList, $bug->status);?></td>
</tr>
<?php endforeach;?>
</tbody>
</table>
<?php else:?>
<?php echo $lang->testreport->none;?>
<?php endif?>
</td>
</tr>
<table class='table' id='legacyBugs'>
<thead>
<tr>
<th class='w-id'> <?php echo $lang->idAB;?></th>
<th class='w-pri'> <?php echo $lang->priAB;?></th>
<th> <?php echo $lang->bug->title;?></th>
<th class='w-user'> <?php echo $lang->openedByAB;?></th>
<th class='w-user'><?php echo $lang->bug->resolvedBy;?></th>
<th class='w-130px'><?php echo $lang->bug->resolvedDate;?></th>
<th class='w-80px'> <?php echo $lang->statusAB;?></th>
</tr>
</thead>
<?php if($legacyBugs):?>
<tbody class='text-center'>
<?php foreach($legacyBugs as $bug):?>
<tr>
<td><?php echo $bug->id?></td>
<td><span class='pri<?php echo $bug->pri?>'><?php echo zget($lang->bug->priList, $bug->pri);?></span></td>
<td class='text-left' title='<?php echo $bug->title?>'><?php echo $bug->title?></td>
<td><?php echo zget($users, $bug->openedBy);?></td>
<td><?php echo zget($users, $bug->resolvedBy);?></td>
<td><?php if($bug->resolvedDate != '0000-00-00 00:00:00') echo substr($bug->resolvedDate, 2);?></td>
<td><?php echo zget($lang->bug->statusList, $bug->status);?></td>
</tr>
<?php endforeach;?>
</tbody>
<?php else:?>
<tr><td class='none-data'><?php echo $lang->testreport->none;?></td></tr>
<?php endif?>
</table>
+32 -38
View File
@@ -1,38 +1,32 @@
<tr>
<th class='text-top w-80px'><?php echo $lang->testreport->stories?></th>
<td colspan='2'>
<?php if($stories):?>
<table class='table' id='stories'>
<thead>
<tr>
<th class='w-id'> <?php echo $lang->idAB;?></th>
<th class='w-pri'> <?php echo $lang->priAB;?></th>
<th> <?php echo $lang->story->title;?></th>
<th class='w-user'><?php echo $lang->openedByAB;?></th>
<th class='w-80px'><?php echo $lang->assignedToAB;?></th>
<th class='w-hour'><?php echo $lang->story->estimateAB;?></th>
<th class='w-hour'><?php echo $lang->statusAB;?></th>
<th class='w-70px'><?php echo $lang->story->stageAB;?></th>
</tr>
</thead>
<tbody class='text-center'>
<?php foreach($stories as $story):?>
<tr>
<td><?php echo $story->id . html::hidden('stories[]', $story->id)?></td>
<td><span class='pri<?php echo $story->pri?>'><?php echo zget($lang->story->priList, $story->pri);?></span></td>
<td class='text-left' title='<?php echo $story->title?>'><?php echo $story->title?></td>
<td><?php echo zget($users, $story->openedBy);?></td>
<td><?php echo zget($users, $story->assignedTo);?></td>
<td><?php echo $story->estimate?></td>
<td><?php echo zget($lang->story->statusList, $story->status);?></td>
<td><?php echo zget($lang->story->stageList, $story->stage);?></td>
</tr>
<?php endforeach;?>
</tbody>
<tfoot><tr><td colspan='8'><?php echo $storySummary?></td></tr></tfoot>
</table>
<?php else:?>
<?php echo $lang->testreport->none;?>
<?php endif?>
</td>
</tr>
<table class='table' id='stories'>
<thead>
<tr>
<th class='w-id'> <?php echo $lang->idAB;?></th>
<th class='w-pri'> <?php echo $lang->priAB;?></th>
<th> <?php echo $lang->story->title;?></th>
<th class='w-user'><?php echo $lang->openedByAB;?></th>
<th class='w-80px'><?php echo $lang->assignedToAB;?></th>
<th class='w-hour'><?php echo $lang->story->estimateAB;?></th>
<th class='w-hour'><?php echo $lang->statusAB;?></th>
<th class='w-70px'><?php echo $lang->story->stageAB;?></th>
</tr>
</thead>
<?php if($stories):?>
<tbody class='text-center'>
<?php foreach($stories as $story):?>
<tr>
<td><?php echo $story->id . html::hidden('stories[]', $story->id)?></td>
<td><span class='pri<?php echo $story->pri?>'><?php echo zget($lang->story->priList, $story->pri);?></span></td>
<td class='text-left' title='<?php echo $story->title?>'><?php echo $story->title?></td>
<td><?php echo zget($users, $story->openedBy);?></td>
<td><?php echo zget($users, $story->assignedTo);?></td>
<td><?php echo $story->estimate?></td>
<td><?php echo zget($lang->story->statusList, $story->status);?></td>
<td><?php echo zget($lang->story->stageList, $story->stage);?></td>
</tr>
<?php endforeach;?>
</tbody>
<?php else:?>
<tr><td class='none-data'><?php echo $lang->testreport->none;?></td></tr>
<?php endif?>
</table>
+1 -1
View File
@@ -34,7 +34,7 @@
<?php foreach($reports as $report):?>
<tr>
<td><?php echo $report->id?></td>
<td class='text-left' title='<?php $report->title?>'><?php echo html::a(inlink('view', "reportID=$report->id"), $report->title)?></td>
<td class='text-left' title='<?php $report->title?>'><?php echo html::a(inlink('view', "reportID=$report->id&from=$objectType"), $report->title)?></td>
<td><?php echo zget($users, $report->createdBy);?></td>
<td><?php echo substr($report->createdDate, 2);?></td>
<?php
+56 -45
View File
@@ -13,6 +13,7 @@
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/datepicker.html.php';?>
<?php include '../../common/view/kindeditor.html.php';?>
<?php include '../../common/view/chart.html.php';?>
<div class='container mw-1400px'>
<div id='titlebar'>
<div class='heading'>
@@ -35,47 +36,64 @@
<form class='form-condensed' method='post' enctype='multipart/form-data' target='hiddenwin'>
<fieldset>
<legend><?php echo $lang->testreport->legendBasic?></legend>
<table class='table table-form'>
<tr>
<th class='w-80px'><?php echo $lang->testreport->startEnd?></th>
<td class='w-p50'>
<div class='input-group'>
<?php echo html::input('begin', $begin, "class='form-control form-date'")?>
<span class='input-group-addon'> ~ </span>
<?php echo html::input('end', $end, "class='form-control form-date'")?>
<?php
echo html::hidden('product', $productIdList) . html::hidden('project', $project->id) . html::hidden('tasks', $tasks);
echo html::hidden('objectID', $objectID) . html::hidden('objectType', $objectType);
?>
</div>
</td>
<td>
<div class='input-group'>
<span class='input-group-addon'><?php echo $lang->testreport->owner?></span>
<?php echo html::select('owner', $users, $owner, "class='form-control chosen'")?>
</div>
</td>
</tr>
<tr>
<th><?php echo $lang->testreport->member?></th>
<td colspan='2'><?php echo html::select('members', $users, $members, "class='form-control chosen' multiple")?></td>
</tr>
<tr>
<th><?php echo $lang->testreport->title?></th>
<td colspan='2'><?php echo html::input('title', $reportTitle, "class='form-control'")?></td>
</tr>
<tr>
<th><?php echo $lang->testreport->goal?></th>
<td colspan='2'><?php echo $project->desc?></td>
</tr>
<table class='table table-form'>
<tr>
<th class='w-80px'><?php echo $lang->testreport->startEnd?></th>
<td class='w-p50'>
<div class='input-group'>
<?php echo html::input('begin', $begin, "class='form-control form-date'")?>
<span class='input-group-addon'> ~ </span>
<?php echo html::input('end', $end, "class='form-control form-date'")?>
<?php
echo html::hidden('product', $productIdList) . html::hidden('project', $project->id) . html::hidden('tasks', $tasks);
echo html::hidden('objectID', $objectID) . html::hidden('objectType', $objectType);
?>
</div>
</td>
<td>
<div class='input-group'>
<span class='input-group-addon'><?php echo $lang->testreport->owner?></span>
<?php echo html::select('owner', $users, $owner, "class='form-control chosen'")?>
</div>
</td>
</tr>
<tr>
<th><?php echo $lang->testreport->member?></th>
<td colspan='2'><?php echo html::select('members', $users, $members, "class='form-control chosen' multiple")?></td>
</tr>
<tr>
<th><?php echo $lang->testreport->title?></th>
<td colspan='2'><?php echo html::input('title', $reportTitle, "class='form-control'")?></td>
</tr>
<tr>
<th><?php echo $lang->testreport->goal?></th>
<td colspan='2'><?php echo $project->desc?></td>
</tr>
<tr>
<th><?php echo $lang->testreport->profile?></th>
<td colspan='2'>
<?php
echo '<p>' . $storySummary . '</p>';
echo '<p>' . sprintf($lang->testreport->buildSummary, empty($builds) ? 1 : count($builds)) . $caseSummary . '</p>';
echo '<p>' . sprintf($lang->testreport->bugSummary, $bugInfo['countBugByTask'], count($legacyBugs), $bugInfo['bugConfirmedRate'] . '%', $bugInfo['bugCreateByCaseRate'] . '%') . '</p>';
unset($bugInfo['countBugByTask']); unset($bugInfo['bugConfirmedRate']); unset($bugInfo['bugCreateByCaseRate']);
?>
</td>
</tr>
<tr>
<th><?php echo $lang->testreport->report?></th>
<td colspan='2'><?php echo html::textarea('report', '', "class='form-control'")?></td>
</tr>
<tr>
<th><?php echo $lang->files?></th>
<td colspan='2'><?php echo $this->fetch('file', 'buildform');?></td>
</tr>
</table>
</fieldset>
<fieldset>
<legend><?php echo $lang->testreport->legendStoryAndBug?></legend>
<table class='table table-form'>
<?php include './blockstories.html.php'?>
<?php include './blockbugs.html.php'?>
</table>
</fieldset>
<fieldset>
<legend><?php echo $lang->testreport->legendBuild?></legend>
@@ -86,19 +104,12 @@
<?php include './blockcases.html.php'?>
</fieldset>
<fieldset>
<legend><?php echo $lang->testreport->legendBug?></legend>
<table class='table table-form'>
<legend><?php echo $lang->testreport->legendLegacyBugs?></legend>
<?php include './blocklegacybugs.html.php'?>
<?php include './blockbuginfo.html.php'?>
</table>
</fieldset>
<fieldset>
<legend><?php echo $lang->testreport->report?></legend>
<?php echo html::textarea('report', '', "class='form-control'")?>
</fieldset>
<fieldset>
<legend><?php echo $lang->files?></legend>
<?php echo $this->fetch('file', 'buildform');?>
<legend><?php echo $lang->testreport->legendReport?></legend>
<?php include './blockbugreport.html.php'?>
</fieldset>
<div><?php echo html::submitButton() . html::backButton();?></div>
</form>
+58 -1
View File
@@ -10,8 +10,65 @@
* @link http://www.zentao.net
*/
?>
<?php include '../../common/view/header.lite.html.php';?>
<?php
unset($lang->exportFileTypeList);
$lang->exportFileTypeList['html'] = 'html';
include '../../file/view/export.html.php';
?>
<script>
function setDownloading()
{
if($.browser.opera) return true; // Opera don't support, omit it.
$.cookie('downloading', 0);
time = setInterval("closeWindow()", 300);
return true;
}
function closeWindow()
{
if($.cookie('downloading') == 1)
{
parent.$.closeModal();
$.cookie('downloading', null);
clearInterval(time);
}
}
$(function()
{
parent.$('.chart-canvas canvas').each(function()
{
chartImgData = $(this).get(0).toDataURL("image/png");
chartID = $(this).attr('id');
$('#submit').after("<input type='hidden' name='" + chartID +"' id='" + chartID + "' />");
$('#' + chartID).val(chartImgData);
});
})
</script>
<div id='titlebar'>
<div class='heading'>
<span class='prefix'><?php echo html::icon($lang->icons['export']);?></span>
<strong><?php echo $lang->export;?></strong>
</div>
</div>
<form class='form-condensed' method='post' target='hiddenwin' style='padding: 40px 1% 50px'>
<table class='w-p100 table-fixed'>
<tr>
<td>
<div class='input-group'>
<span class='input-group-addon'><?php echo $lang->setFileName;?></span>
<?php echo html::input('fileName', '', "class='form-control' autocomplete='off'");?>
</div>
</td>
<td class='w-60px'>
<?php echo html::select('fileType', $lang->exportFileTypeList, '', 'onchange=switchEncode(this.value) class="form-control"');?>
</td>
<td style='width:70px'>
<div class='input-group'>
<?php echo html::submitButton($lang->export, "onclick='setDownloading();' ");?>
</div>
</td>
</tr>
</table>
</form>
<?php include '../../common/view/footer.lite.html.php';?>
+62 -49
View File
@@ -12,6 +12,7 @@
?>
<?php if(!$this->session->notHead):?>
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/chart.html.php';?>
<div class='container mw-1400px'>
<div id='titlebar'>
<div class='heading'>
@@ -26,6 +27,9 @@
echo "<div class='btn-group'>";
common::printIcon('testreport', 'export', "reportID=$report->id", '', 'button', 'download-alt', '', 'iframe');
echo '</div>';
echo "<div class='btn-group'>";
if(common::hasPriv('testreport', 'create')) echo html::a(inLink('create', "objectID=$report->objectID&objectType=$report->objectType"), "<i class='icon-refresh'></i>", '', "class='btn' title='{$lang->testreport->recreate}'");
common::printIcon('testreport', 'delete', "reportID=$report->id", '', 'button', '', 'hiddenwin');
echo '</div>';
@@ -42,57 +46,66 @@
</div>
<?php endif;?>
<div class='main'>
<fieldset>
<legend><?php echo $lang->testreport->legendBasic?></legend>
<table class='table table-form'>
<tr>
<th class='w-100px'><?php echo $lang->testreport->startEnd?></th>
<td class='w-p50'> <?php echo $report->begin . ' ~ ' . $report->end;?></td>
<td></td>
</tr>
<tr>
<th><?php echo $lang->testreport->owner?></th>
<td><?php echo zget($users, $report->owner);?></td>
</tr>
<tr>
<th><?php echo $lang->testreport->member?></th>
<td colspan='2'><?php foreach(explode(',', $report->members) as $member)echo zget($users, $member) . ' &nbsp; ';?></td>
</tr>
<tr>
<th><?php echo $lang->testreport->goal?></th>
<td colspan='2'><?php echo $project->desc?></td>
</tr>
</table>
</fieldset>
<fieldset>
<legend><?php echo $lang->testreport->legendStoryAndBug?></legend>
<table class='table table-form'>
<ul class='nav nav-tabs'>
<li class='active'><?php echo html::a('###', $lang->testreport->legendBasic, '', "data-toggle='tab' data-target='#basic'")?></li>
<li><?php echo html::a('###', $lang->testreport->legendStoryAndBug, '', "data-toggle='tab' data-target='#storyAndBug'")?></li>
<li><?php echo html::a('###', $lang->testreport->legendBuild, '', "data-toggle='tab' data-target='#tabBuild'")?></li>
<li><?php echo html::a('###', $lang->testreport->legendCase, '', "data-toggle='tab' data-target='#tabCase'")?></li>
<li><?php echo html::a('###', $lang->testreport->legendLegacyBugs, '', "data-toggle='tab' data-target='#tabLegacyBugs'")?></li>
<li><?php echo html::a('###', $lang->testreport->legendReport, '', "data-toggle='tab' data-target='#tabReport'")?></li>
</ul>
<div class='tab-content'>
<div class='tab-pane' id='basic'>
<table class='table table-form'>
<tr>
<th class='w-100px'><?php echo $lang->testreport->startEnd?></th>
<td class='w-p50'> <?php echo $report->begin . ' ~ ' . $report->end;?></td>
<td></td>
</tr>
<tr>
<th><?php echo $lang->testreport->owner?></th>
<td><?php echo zget($users, $report->owner);?></td>
</tr>
<tr>
<th><?php echo $lang->testreport->member?></th>
<td colspan='2'><?php foreach(explode(',', $report->members) as $member)echo zget($users, $member) . ' &nbsp; ';?></td>
</tr>
<tr>
<th><?php echo $lang->testreport->goal?></th>
<td colspan='2'><?php echo $project->desc?></td>
</tr>
<tr>
<th><?php echo $lang->testreport->profile?></th>
<td colspan='2'>
<?php
echo '<p>' . $storySummary . '</p>';
echo '<p>' . sprintf($lang->testreport->buildSummary, empty($builds) ? 1 : count($builds)) . $caseSummary . '</p>';
echo '<p>' . sprintf($lang->testreport->bugSummary, $bugInfo['countBugByTask'], count($legacyBugs), $bugInfo['bugConfirmedRate'] . '%', $bugInfo['bugCreateByCaseRate'] . '%') . '</p>';
unset($bugInfo['countBugByTask']); unset($bugInfo['bugConfirmedRate']); unset($bugInfo['bugCreateByCaseRate']);
?>
</td>
</tr>
<tr>
<th><?php echo $lang->testreport->report?></th>
<td><?php echo $report->report;?></td>
</tr>
<?php if(!$this->session->notHead):?>
<tr>
<th><?php echo $lang->files?></th>
<td><?php echo $this->fetch('file', 'printFiles', array('files' => $report->files, 'fieldset' => 'false'));?></td>
</tr>
<?php endif;?>
</table>
</div>
<div class='tab-pane' id='storyAndBug'>
<?php include './blockstories.html.php'?>
<?php include './blockbugs.html.php'?>
</table>
</fieldset>
<fieldset>
<legend><?php echo $lang->testreport->legendBuild?></legend>
<?php include './blockbuilds.html.php'?>
</fieldset>
<fieldset>
<legend><?php echo $lang->testreport->legendCase?></legend>
<?php include './blockcases.html.php'?>
</fieldset>
<fieldset>
<legend><?php echo $lang->testreport->legendBug?></legend>
<table class='table table-form'>
<?php include './blocklegacybugs.html.php'?>
<?php include './blockbuginfo.html.php'?>
</table>
</fieldset>
<fieldset>
<legend><?php echo $lang->testreport->report?></legend>
<div><?php echo $report->report;?></div>
</fieldset>
<?php if(!$this->session->notHead):?>
<?php echo $this->fetch('file', 'printFiles', array('files' => $report->files, 'fieldset' => 'true'));?>
<?php endif;?>
</div>
<div class='tab-pane' id='tabBuild'><?php include './blockbuilds.html.php'?></div>
<div class='tab-pane' id='tabCase'><?php include './blockcases.html.php'?></div>
<div class='tab-pane' id='tabLegacyBugs'><?php include './blocklegacybugs.html.php'?></div>
<div class='tab-pane active' id='tabReport'><?php include './blockbugreport.html.php'?></div>
</div>
</div>
<?php if(!$this->session->notHead):?>
</div>
+14 -14
View File
@@ -161,7 +161,7 @@ class testsuite extends control
if(dao::isError()) die(js::error(dao::getError()));
if($changes)
{
$objectType = $suite->type == 'library' ? 'testlib' : 'testsuite';
$objectType = $suite->type == 'library' ? 'caselib' : 'testsuite';
$actionID = $this->loadModel('action')->create($objectType, $suiteID, 'edited');
$this->action->logHistory($actionID, $changes);
}
@@ -178,7 +178,7 @@ class testsuite extends control
$this->view->title = $libraries[$suiteID] . $this->lang->colon . $this->lang->testsuite->edit;
$this->view->position[] = html::a($this->createLink('testsuite', 'library', "libID=$suiteID"), $libraries[$suiteID]);
$this->view->position[] = $this->lang->testlib->common;
$this->view->position[] = $this->lang->caselib->common;
}
else
{
@@ -381,8 +381,8 @@ class testsuite extends control
/* Set menu. */
$libID = $this->testsuite->saveLibState($libID, $libraries);
setcookie('preTestLibID', $libID, $this->config->cookieLife, $this->config->webRoot);
if($this->cookie->preTestLibID != $libID)
setcookie('preCaseLibID', $libID, $this->config->cookieLife, $this->config->webRoot);
if($this->cookie->preCaseLibID != $libID)
{
$_COOKIE['libCaseModule'] = 0;
setcookie('libCaseModule', 0, $this->config->cookieLife, $this->config->webRoot);
@@ -415,9 +415,9 @@ class testsuite extends control
$this->loadModel('datatable');
$this->loadModel('tree');
$showModule = !empty($this->config->datatable->testsuiteLibrary->showModule) ? $this->config->datatable->testsuiteLibrary->showModule : '';
$this->view->modulePairs = $showModule ? $this->tree->getModulePairs($libID, 'testlib', $showModule) : array();
$this->view->modulePairs = $showModule ? $this->tree->getModulePairs($libID, 'caselib', $showModule) : array();
$this->view->title = $this->lang->testlib->common . $this->lang->colon . $libraries[$libID];
$this->view->title = $this->lang->caselib->common . $this->lang->colon . $libraries[$libID];
$this->view->position[] = html::a($this->createLink('testsuite', 'library', "libID=$libID"), $libraries[$libID]);
$this->view->libID = $libID;
@@ -425,8 +425,8 @@ class testsuite extends control
$this->view->cases = $cases;
$this->view->orderBy = $orderBy;
$this->view->users = $this->loadModel('user')->getPairs('noclosed|noletter');
$this->view->modules = $this->tree->getOptionMenu($libID, $viewType = 'testlib', $startModuleID = 0);
$this->view->moduleTree = $this->tree->getTreeMenu($libID, $viewType = 'testlib', $startModuleID = 0, array('treeModel', 'createTestLibLink'), '');
$this->view->modules = $this->tree->getOptionMenu($libID, $viewType = 'caselib', $startModuleID = 0);
$this->view->moduleTree = $this->tree->getTreeMenu($libID, $viewType = 'caselib', $startModuleID = 0, array('treeModel', 'createCaseLibLink'), '');
$this->view->pager = $pager;
$this->view->browseType = $browseType;
$this->view->moduleID = $moduleID;
@@ -449,7 +449,7 @@ class testsuite extends control
{
$libID = $this->testsuite->createLib();
if(dao::isError()) die(js::error(dao::getError()));
$this->loadModel('action')->create('testlib', $libID, 'opened');
$this->loadModel('action')->create('caselib', $libID, 'opened');
die(js::locate($this->createLink('testsuite', 'library', "libID=$libID"), 'parent'));
}
@@ -458,9 +458,9 @@ class testsuite extends control
$libID = $this->testsuite->saveLibState(0, $libraries);
$this->testsuite->setLibMenu($libraries, $libID);
$this->view->title = $this->lang->testlib->common . $this->lang->colon . $this->lang->testlib->create;
$this->view->position[] = $this->lang->testlib->common;
$this->view->position[] = $this->lang->testlib->create;
$this->view->title = $this->lang->caselib->common . $this->lang->colon . $this->lang->caselib->create;
$this->view->position[] = $this->lang->caselib->common;
$this->view->position[] = $this->lang->caselib->create;
$this->display();
}
@@ -544,7 +544,7 @@ class testsuite extends control
$this->view->precondition = $precondition;
$this->view->keywords = $keywords;
$this->view->steps = $steps;
$this->view->moduleOptionMenu = $this->loadModel('tree')->getOptionMenu($libID, $viewType = 'testlib', $startModuleID = 0);
$this->view->moduleOptionMenu = $this->loadModel('tree')->getOptionMenu($libID, $viewType = 'caselib', $startModuleID = 0);
$this->display();
}
@@ -570,7 +570,7 @@ class testsuite extends control
$this->view->position[] = $this->lang->testsuite->view;
$this->view->lib = $lib;
$this->view->actions = $this->loadModel('action')->getList('testlib', $libID);
$this->view->actions = $this->loadModel('action')->getList('caselib', $libID);
$this->display();
}
+1 -1
View File
@@ -2,7 +2,7 @@ var newRowID = 0;
function loadLibModules(libID)
{
link = createLink('tree', 'ajaxGetOptionMenu', 'libID=' + libID + '&viewtype=testlib&branch=0&rootModuleID=0&returnType=html&needManage=true');
link = createLink('tree', 'ajaxGetOptionMenu', 'libID=' + libID + '&viewtype=caselib&branch=0&rootModuleID=0&returnType=html&needManage=true');
$('#moduleIdBox').load(link, function()
{
$(this).find('select').chosen(defaultChosenOptions)
+4 -4
View File
@@ -43,7 +43,7 @@ $lang->testsuite->lblUnlinkCase = 'Unlink Case';
$lang->testsuite->authorList['private'] = 'Private';
$lang->testsuite->authorList['public'] = 'Public';
$lang->testlib->common = 'Test Library';
$lang->testlib->create = 'Create';
$lang->testlib->edit = 'Edit';
$lang->testlib->all = 'All';
$lang->caselib->common = 'Test Library';
$lang->caselib->create = 'Create';
$lang->caselib->edit = 'Edit';
$lang->caselib->all = 'All';
+4 -4
View File
@@ -43,7 +43,7 @@ $lang->testsuite->lblUnlinkCase = '移除用例';
$lang->testsuite->authorList['private'] = '私有';
$lang->testsuite->authorList['public'] = '公开';
$lang->testlib->common = '公共用例库';
$lang->testlib->create = '创建库';
$lang->testlib->edit = '编辑';
$lang->testlib->all = '所有公共库';
$lang->caselib->common = '公共用例库';
$lang->caselib->create = '创建库';
$lang->caselib->edit = '编辑';
$lang->caselib->all = '所有公共库';
+23 -23
View File
@@ -76,26 +76,26 @@ class testsuiteModel extends model
{
$currentLibName = zget($libraries, $libID, '');
$selectHtml = empty($libraries) ? '' : "<a id='currentItem' href=\"javascript:showDropMenu('testsuite', '$libID', 'testsuite', 'library', '')\">{$currentLibName} <span class='icon-caret-down'></span></a><div id='dropMenu'><i class='icon icon-spin icon-spinner'></i></div>";
setCookie("lastTestLib", $libID, $this->config->cookieLife, $this->config->webRoot);
foreach($this->lang->testlib->menu as $key => $value)
setCookie("lastCaseLib", $libID, $this->config->cookieLife, $this->config->webRoot);
foreach($this->lang->caselib->menu as $key => $value)
{
$replace = ($key == 'lib') ? $selectHtml : '';
common::setMenuVars($this->lang->testlib->menu, $key, $replace);
common::setMenuVars($this->lang->caselib->menu, $key, $replace);
}
$this->lang->testsuite->menu = $this->lang->testlib->menu;
$this->lang->testsuite->menu = $this->lang->caselib->menu;
}
public function saveLibState($libID = 0, $libraries = array())
{
if($libID > 0) $this->session->set('testLib', (int)$libID);
if($libID == 0 and $this->cookie->lastTestLib) $this->session->set('testLib', $this->cookie->lastTestLib);
if($libID == 0 and $this->session->testLib == '') $this->session->set('testLib', key($libraries));
if(!isset($libraries[$this->session->testLib]))
if($libID > 0) $this->session->set('caseLib', (int)$libID);
if($libID == 0 and $this->cookie->lastCaseLib) $this->session->set('caseLib', $this->cookie->lastCaseLib);
if($libID == 0 and $this->session->caseLib == '') $this->session->set('caseLib', key($libraries));
if(!isset($libraries[$this->session->caseLib]))
{
$this->session->set('testLib', key($libraries));
$libID = $this->session->testLib;
$this->session->set('caseLib', key($libraries));
$libID = $this->session->caseLib;
}
return $this->session->testLib;
return $this->session->caseLib;
}
/**
@@ -292,7 +292,7 @@ class testsuiteModel extends model
parent::delete(TABLE_TESTSUITE, $suiteID);
if($suite->type == 'library')
{
$this->dao->update(TABLE_ACTION)->set('objectType')->eq('testlib')->where('objectID')->eq($suiteID)->andWhere('objectType')->eq('testsuite')->exec();
$this->dao->update(TABLE_ACTION)->set('objectType')->eq('caselib')->where('objectID')->eq($suiteID)->andWhere('objectType')->eq('testsuite')->exec();
}
else
{
@@ -339,7 +339,7 @@ class testsuiteModel extends model
if(!dao::isError())
{
$libID = $this->dao->lastInsertID();
$this->file->updateObjectID($this->post->uid, $libID, 'testlib');
$this->file->updateObjectID($this->post->uid, $libID, 'caselib');
return $libID;
}
return false;
@@ -379,22 +379,22 @@ class testsuiteModel extends model
if($queryID)
{
$query = $this->loadModel('search')->getQuery($queryID);
$this->session->set('testlibQuery', ' 1 = 1');
$this->session->set('caselibQuery', ' 1 = 1');
if($query)
{
$this->session->set('testlibQuery', $query->sql);
$this->session->set('testlibForm', $query->form);
$this->session->set('caselibQuery', $query->sql);
$this->session->set('caselibForm', $query->form);
}
}
else
{
if($this->session->testlibQuery == false) $this->session->set('testlibQuery', ' 1 = 1');
if($this->session->caselibQuery == false) $this->session->set('caselibQuery', ' 1 = 1');
}
$queryLibID = $libID;
$allLib = "`lib` = 'all'";
$caseQuery = '(' . $this->session->testlibQuery;
if(strpos($this->session->testlibQuery, $allLib) !== false)
$caseQuery = '(' . $this->session->caselibQuery;
if(strpos($this->session->caselibQuery, $allLib) !== false)
{
$caseQuery = str_replace($allLib, '1', $caseQuery);
$queryLibID = 'all';
@@ -452,10 +452,10 @@ class testsuiteModel extends model
public function buildSearchForm($libID, $libraries, $queryID, $actionURL)
{
$this->config->testcase->search['fields']['lib'] = $this->lang->testcase->lib;
$this->config->testcase->search['params']['lib']['values'] = array('' => '', $libID => $libraries[$libID], 'all' => $this->lang->testlib->all);
$this->config->testcase->search['params']['lib']['values'] = array('' => '', $libID => $libraries[$libID], 'all' => $this->lang->caselib->all);
$this->config->testcase->search['params']['lib']['operator'] = '=';
$this->config->testcase->search['params']['lib']['control'] = 'select';
$this->config->testcase->search['params']['module']['values'] = $this->loadModel('tree')->getOptionMenu($libID, $viewType = 'testlib');
$this->config->testcase->search['params']['module']['values'] = $this->loadModel('tree')->getOptionMenu($libID, $viewType = 'caselib');
if(!$this->config->testcase->needReview) unset($this->config->testcase->search['params']['status']['values']['wait']);
unset($this->config->testcase->search['fields']['product']);
unset($this->config->testcase->search['params']['product']);
@@ -468,7 +468,7 @@ class testsuiteModel extends model
unset($this->config->testcase->search['fields']['lastRunDate']);
unset($this->config->testcase->search['params']['lastRunDate']);
$this->config->testcase->search['module'] = 'testlib';
$this->config->testcase->search['module'] = 'caselib';
$this->config->testcase->search['actionURL'] = $actionURL;
$this->config->testcase->search['queryID'] = $queryID;
@@ -500,7 +500,7 @@ class testsuiteModel extends model
}
else if($module == 'tree')
{
$link = helper::createLink($module, $method, "libID=%s&type=testlib&currentModuleID=0");
$link = helper::createLink($module, $method, "libID=%s&type=caselib&currentModuleID=0");
}
else
{
+1 -1
View File
@@ -38,7 +38,7 @@
if(count($moduleOptionMenu) == 1)
{
echo "<span class='input-group-btn'>";
echo html::a($this->createLink('tree', 'browse', "rootID=$libID&view=testlib&currentModuleID=0"), "<i class='icon icon-cog'></i>", '_blank', "data-toggle='tooltip' class='btn' title='{$lang->tree->manage}'");
echo html::a($this->createLink('tree', 'browse', "rootID=$libID&view=caselib&currentModuleID=0"), "<i class='icon icon-cog'></i>", '_blank', "data-toggle='tooltip' class='btn' title='{$lang->tree->manage}'");
echo '</span>';
echo "<span class='input-group-btn'>";
echo html::a("javascript:loadLibModules($libID)", "<i class='icon icon-refresh'></i>", '', "data-toggle='tooltip' class='btn' title='{$lang->refresh}'");
+1 -1
View File
@@ -16,7 +16,7 @@
<div class='container mw-1400px'>
<div id='titlebar'>
<div class='heading'>
<strong><small class='text-muted'><?php echo html::icon($lang->icons['create']);?></small> <?php echo $lang->testlib->create;?></strong>
<strong><small class='text-muted'><?php echo html::icon($lang->icons['create']);?></small> <?php echo $lang->caselib->create;?></strong>
</div>
</div>
<form class='form-condensed' method='post' target='hiddenwin' id='dataform'>
+1 -1
View File
@@ -65,7 +65,7 @@ js::set('batchDelete', $lang->testcase->confirmBatchDelete);
<div class='panel-body'>
<?php echo $moduleTree;?>
<div class='text-right'>
<?php common::printLink('tree', 'browse', "libID=$libID&view=testlib", $lang->tree->manage);?>
<?php common::printLink('tree', 'browse', "libID=$libID&view=caselib", $lang->tree->manage);?>
</div>
</div>
</div>
+1 -1
View File
@@ -13,7 +13,7 @@
<?php include '../../common/view/header.html.php';?>
<div id='titlebar'>
<div class='heading'>
<span class='prefix' title='TESTLIB'> <strong><?php echo $lib->id;?></strong></span>
<span class='prefix' title='CASELIB'> <strong><?php echo $lib->id;?></strong></span>
<strong><?php echo $lib->name;?></strong>
<?php if($lib->deleted):?>
<span class='label label-danger'><?php echo $lang->testsuite->deleted;?></span>
+9 -69
View File
@@ -270,7 +270,7 @@ class testtask extends control
$runs = $this->testcase->appendBugAndResults($runs, 'run');
$moduleTree = $this->loadModel('tree')->getTreeMenu($productID, $viewType = 'case', $startModuleID = 0, array('treeModel', 'createTestTaskLink'), $extra = $taskID);
$libModuleTree = $this->tree->getTestLibTreeInCase('testtask', $taskID, array('treeModel', 'createTestTaskLink'));
$libModuleTree = $this->tree->getCaseLibTreeInCase('testtask', $taskID, array('treeModel', 'createTestTaskLink'));
if($libModuleTree) $moduleTree = substr($moduleTree, 0, strrpos($moduleTree, '</ul>')) . $libModuleTree . '</ul>';
$this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->testtask->cases;
@@ -438,19 +438,19 @@ class testtask extends control
}
/**
* doing testtask.
* activate testtask.
*
* @param int $taskID
* @access public
* @return void
*/
public function doing($taskID)
public function activate($taskID)
{
$actions = $this->loadModel('action')->getList('testtask', $taskID);
if(!empty($_POST))
{
$changes = $this->testtask->doing($taskID);
$changes = $this->testtask->activate($taskID);
if(dao::isError()) die(js::error(dao::getError()));
if($this->post->comment != '' or !empty($changes))
@@ -473,7 +473,7 @@ class testtask extends control
$this->view->testtask = $testtask;
$this->view->title = $testtask->name . $this->lang->colon . $this->lang->testtask->start;
$this->view->position[] = $this->lang->testtask->common;
$this->view->position[] = $this->lang->testtask->doing;
$this->view->position[] = $this->lang->testtask->activate;
$this->view->actions = $actions;
$this->display();
}
@@ -655,75 +655,15 @@ class testtask extends control
$this->view->position[] = $this->lang->testtask->common;
$this->view->position[] = $this->lang->testtask->linkCase;
$testTask = $this->testtask->getRelatedTestTasks($productID, $param);
/* Get cases. */
if($this->session->testcaseQuery == false) $this->session->set('testcaseQuery', ' 1 = 1');
$query = $this->session->testcaseQuery;
$allProduct = "`product` = 'all'";
if(strpos($query, '`product` =') === false) $query .= " AND `product` = $productID";
if(strpos($query, $allProduct) !== false) $query = str_replace($allProduct, '1', $query);
$cases = $this->testtask->getLinkableCases($productID, $task, $taskID, $type, $param, $pager);
$linkedCases = $this->dao->select('`case`')->from(TABLE_TESTRUN)->where('task')->eq($taskID)->fetchPairs('case');
if($type == 'all')
{
$cases = $this->dao->select('*')->from(TABLE_CASE)->where($query)
->andWhere('id')->notIN($linkedCases)
->beginIF($task->branch)->andWhere('branch')->in("0,$task->branch")->fi()
->andWhere('deleted')->eq(0)
->orderBy('id desc')
->page($pager)
->fetchAll();
}
elseif($type == 'bystory')
{
$stories = $this->dao->select('stories')->from(TABLE_BUILD)->where('id')->eq($task->build)->fetch('stories');
$cases = array();
if($stories)
{
$cases = $this->dao->select('*')->from(TABLE_CASE)->where($query)
->andWhere('product')->eq($productID)
->beginIF($linkedCases)->andWhere('id')->notIN($linkedCases)->fi()
->beginIF($task->branch)->andWhere('branch')->in("0,$task->branch")->fi()
->andWhere('story')->in(trim($stories, ','))
->andWhere('deleted')->eq(0)
->orderBy('id desc')
->page($pager)
->fetchAll();
}
}
elseif($type == 'bybug')
{
$bugs = $this->dao->select('bugs')->from(TABLE_BUILD)->where('id')->eq($task->build)->fetch('bugs');
$cases = array();
if($bugs)
{
$cases = $this->dao->select('*')->from(TABLE_CASE)->where($query)
->andWhere('product')->eq($productID)
->beginIF($linkedCases)->andWhere('id')->notIN($linkedCases)->fi()
->beginIF($task->branch)->andWhere('branch')->in("0,$task->branch")->fi()
->andWhere('fromBug')->in(trim($bugs, ','))
->andWhere('deleted')->eq(0)
->orderBy('id desc')
->page($pager)
->fetchAll();
}
}
if($type == 'bysuite')
{
$cases = $this->dao->select('t1.*,t2.version as version')->from(TABLE_CASE)->alias('t1')
->leftJoin(TABLE_SUITECASE)->alias('t2')->on('t1.id=t2.case')
->where($query)
->andWhere('t2.suite')->eq((int)$param)
->andWhere('t1.product')->eq($productID)
->beginIF($linkedCases)->andWhere('t1.id')->notIN($linkedCases)->fi()
->beginIF($task->branch)->andWhere('t1.branch')->in("0,$task->branch")->fi()
->andWhere('deleted')->eq(0)
->orderBy('id_desc')
->page($pager)
->fetchAll();
}
$this->view->users = $this->loadModel('user')->getPairs('noletter');
$this->view->cases = $cases;
$this->view->taskID = $taskID;
$this->view->testTask = $testTask;
$this->view->pager = $pager;
$this->view->task = $task;
$this->view->type = $type;
+11
View File
@@ -9,5 +9,16 @@ $(function()
$this.find('.collapse-handle').toggleClass('icon-chevron-down', !show).toggleClass('icon-chevron-up', show);;
});
$(".step-group input[type='checkbox']").click(function()
{
var $next = $(this).closest('tr').next();
while($next.length && $next.hasClass('step-item'))
{
var isChecked = $(this).prop('checked');
$next.find("input[type='checkbox']").prop('checked', isChecked);
$next = $next.next();
}
});
$('#casesResults table caption .result-tip').html($('#resultTip').html());
});
+4 -2
View File
@@ -16,6 +16,7 @@ $lang->testtask->view = "概况";
$lang->testtask->edit = "编辑版本";
$lang->testtask->browse = "版本列表";
$lang->testtask->linkCase = "关联用例";
$lang->testtask->selectVersion = "选择版本";
$lang->testtask->unlinkCase = "移除";
$lang->testtask->batchUnlinkCases = "批量移除用例";
$lang->testtask->batchAssign = "批量指派";
@@ -32,8 +33,8 @@ $lang->testtask->start = "开始";
$lang->testtask->close = "关闭";
$lang->testtask->wait = "待测版本";
$lang->testtask->blocked = "阻塞";
$lang->testtask->doing = "激活";
$lang->testtask->doingA = "进行中版本";
$lang->testtask->activate = "激活";
$lang->testtask->testing = "测试中版本";
$lang->testtask->blockedA = "被阻塞版本";
$lang->testtask->done = "已测版本";
@@ -73,6 +74,7 @@ $lang->testtask->priList[2] = '2';
$lang->testtask->priList[4] = '4';
$lang->testtask->unlinkedCases = '未关联';
$lang->testtask->linkByVersion = '按版本复制';
$lang->testtask->linkByStory = '按需求关联';
$lang->testtask->linkByBug = '按Bug关联';
$lang->testtask->linkBySuite = '按套件关联';
+198 -31
View File
@@ -141,31 +141,6 @@ class testtaskModel extends model
return $task;
}
/**
* Bet tasks by project.
*
* @param int $projectID
* @access public
* @return array
*/
public function getByProject($projectID)
{
return $this->dao->select('*')->from(TABLE_TESTTASK)->where('project')->eq((int)$projectID)->andWhere('deleted')->eq(0)->fetchAll('id');
}
/**
* Get taskrun by case id.
*
* @param int $taskID
* @param int $caseID
* @access public
* @return void
*/
public function getRunByCase($taskID, $caseID)
{
return $this->dao->select('*')->from(TABLE_TESTRUN)->where('task')->eq($taskID)->andWhere('`case`')->eq($caseID)->fetch();
}
/**
* Get test tasks by user.
*
@@ -188,6 +163,198 @@ class testtaskModel extends model
->fetchAll();
}
/**
* Get taskrun by case id.
*
* @param int $taskID
* @param int $caseID
* @access public
* @return void
*/
public function getRunByCase($taskID, $caseID)
{
return $this->dao->select('*')->from(TABLE_TESTRUN)->where('task')->eq($taskID)->andWhere('`case`')->eq($caseID)->fetch();
}
/**
* Get linkable casses.
*
* @param int $productID
* @param object $task
* @param int $taskID
* @param string $type
* @param string $param
* @param object $pager
* @access public
* @return array
*/
public function getLinkableCases($productID, $task, $taskID, $type, $param, $pager)
{
if($this->session->testcaseQuery == false) $this->session->set('testcaseQuery', ' 1 = 1');
$query = $this->session->testcaseQuery;
$allProduct = "`product` = 'all'";
if(strpos($query, '`product` =') === false && $type != 'bysuite') $query .= " AND `product` = $productID";
if(strpos($query, $allProduct) !== false) $query = str_replace($allProduct, '1', $query);
$cases = array();
$linkedCases = $this->dao->select('`case`')->from(TABLE_TESTRUN)->where('task')->eq($taskID)->fetchPairs('case');
if($type == 'all') $cases = $this->getAllLinkableCases($task, $query, $linkedCases, $pager);
if($type == 'bystory') $cases = $this->getLinkableCasesByStory($productID, $task, $query, $linkedCases, $pager);
if($type == 'bybug') $cases = $this->getLinkableCasesByBug($productID, $task, $query, $linkedCases, $pager);
if($type == 'bysuite') $cases = $this->getLinkableCasesBySuite($productID, $query, $param, $linkedCases, $pager);
if($type == 'bybuild') $cases = $this->getLinkableCasesByTestTask($param, $linkedCases, $pager);
return $cases;
}
/**
* Get all linkable cases.
*
* @param object $task
* @param string $query
* @param array $linkedCases
* @param object $pager
* @access public
* @return array
*/
public function getAllLinkableCases($task, $query, $linkedCases, $pager)
{
return $this->dao->select('*')->from(TABLE_CASE)->where($query)
->andWhere('id')->notIN($linkedCases)
->beginIF($task->branch)->andWhere('branch')->in("0,$task->branch")->fi()
->andWhere('deleted')->eq(0)
->orderBy('id desc')
->page($pager)
->fetchAll();
}
/**
* Get linkable cases by story.
*
* @param int $productID
* @param object $task
* @param string $query
* @param array $linkedCases
* @param object $pager
* @access public
* @return array
*/
public function getLinkableCasesByStory($productID, $task, $query, $linkedCases, $pager)
{
$stories = $this->dao->select('stories')->from(TABLE_BUILD)->where('id')->eq($task->build)->fetch('stories');
$cases = array();
if($stories)
{
$cases = $this->dao->select('*')->from(TABLE_CASE)->where($query)
->andWhere('product')->eq($productID)
->beginIF($linkedCases)->andWhere('id')->notIN($linkedCases)->fi()
->beginIF($task->branch)->andWhere('branch')->in("0,$task->branch")->fi()
->andWhere('story')->in(trim($stories, ','))
->andWhere('deleted')->eq(0)
->orderBy('id desc')
->page($pager)
->fetchAll();
}
return $cases;
}
/**
* Get linkable cases by bug.
*
* @param int $productID
* @param object $task
* @param string $query
* @param array $linkedCases
* @param object $pager
* @access public
* @return array
*/
public function getLinkableCasesByBug($productID, $task, $query, $linkedCases, $pager)
{
$bugs = $this->dao->select('bugs')->from(TABLE_BUILD)->where('id')->eq($task->build)->fetch('bugs');
$cases = array();
if($bugs)
{
$cases = $this->dao->select('*')->from(TABLE_CASE)->where($query)
->andWhere('product')->eq($productID)
->beginIF($linkedCases)->andWhere('id')->notIN($linkedCases)->fi()
->beginIF($task->branch)->andWhere('branch')->in("0,$task->branch")->fi()
->andWhere('fromBug')->in(trim($bugs, ','))
->andWhere('deleted')->eq(0)
->orderBy('id desc')
->page($pager)
->fetchAll();
}
return $cases;
}
/**
* Get linkable cases by suite.
*
* @param int $productID
* @param string $query
* @param string $suite
* @param array $linkedCases
* @param object $pager
* @access public
* @return array
*/
public function getLinkableCasesBySuite($productID, $query, $suite, $linkedCases, $pager)
{
return $this->dao->select('t1.*,t2.version as version')->from(TABLE_CASE)->alias('t1')
->leftJoin(TABLE_SUITECASE)->alias('t2')->on('t1.id=t2.case')
->where($query)
->andWhere('t2.suite')->eq((int)$suite)
->andWhere('t1.product')->eq($productID)
->beginIF($linkedCases)->andWhere('t1.id')->notIN($linkedCases)->fi()
->beginIF($task->branch)->andWhere('t1.branch')->in("0,$task->branch")->fi()
->andWhere('deleted')->eq(0)
->orderBy('id desc')
->page($pager)
->fetchAll();
}
/**
* Get linkeable cases by test task.
*
* @param string $testTask
* @param array $linkedCases
* @param object $pager
* @access public
* @return array
*/
public function getLinkableCasesByTestTask($testTask, $linkedCases, $pager)
{
$caseList = $this->dao->select("`case`")->from(TABLE_TESTRUN)->where('task')->eq($testTask)->andWhere('id')->notin($linkedCases)->fetchPairs('case');
return $this->dao->select("*")->from(TABLE_CASE)->where('id')->in($caseList)->page($pager)->fetchAll();
}
/**
* Get related test tasks.
*
* @param int $productID
* @param int $taskID
* @access public
* @return array
*/
public function getRelatedTestTasks($productID, $testTaskID)
{
$beginDate = $this->dao->select('begin')->from(TABLE_TESTTASK)->where('id')->eq($testTaskID)->fetch('begin');
return $this->dao->select('id, name')->from(TABLE_TESTTASK)
->where('product')->eq($productID)
->beginIF($beginDate)->andWhere('begin')->le($beginDate)->fi()
->andWhere('deleted')->eq('0')
->andWhere('id')->notin($testTaskID)
->orderBy('begin desc')
->fetchPairs('id', 'name');
}
/**
* Update a test task.
*
@@ -265,13 +432,13 @@ class testtaskModel extends model
}
/**
* blocked testtask.
* update block testtask.
*
* @param int $taskID
* @access public
* @access public
* @return void
*/
public function blocked($taskID)
public function block($taskID)
{
$oldTesttask = $this->getById($taskID);
$testtask = fixer::input('post')
@@ -287,13 +454,13 @@ class testtaskModel extends model
}
/**
* doing testtask.
* update activate testtask.
*
* @param int $taskID
* @access public
* @return void
*/
public function doing($taskID)
public function activate($taskID)
{
$oldTesttask = $this->getById($taskID);
$testtask = fixer::input('post')
@@ -560,7 +727,7 @@ class testtaskModel extends model
{
$runs = $this->dao->select('id, `case`')->from(TABLE_TESTRUN)
->where('`case`')->in($caseIdList)
->beginIF($taskID)->andWhere('task')->eq($taskID)
->beginIF($taskID)->andWhere('task')->eq($taskID)->fi()
->fetchPairs('case', 'id');
}
+42
View File
@@ -0,0 +1,42 @@
<?php
/**
* The start file of testtask module of ZenTaoPMS.
*
* @copyright Copyright 2009-2015 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
* @license ZPL (http://zpl.pub/page/zplv12.html)
* @author Chunsheng Wang<wwccss@gmail.com>
* @package testtask
* @version $Id: start.html.php 935 2013-01-16 07:49:24Z wwccss@gmail.com $
* @link http://www.zentao.net
*/
?>
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/kindeditor.html.php';?>
<?php include '../../common/view/datepicker.html.php';?>
<div class='container mw-800px'>
<div id='titlebar'>
<div class='heading'>
<span class='prefix'><?php echo html::icon($lang->icons['testtask']);?> <strong><?php echo $testtask->id;?></strong></span>
<strong><?php echo html::a($this->createLink('testtask', 'view', 'taskID=' . $testtask->id), $testtask->name, '_blank');?></strong>
<small class='text-success'> <?php echo $lang->testtask->blocked;?> <?php echo html::icon($lang->icons['pause']);?></small>
</div>
</div>
<form class='form-condensed' method='post' target='hiddenwin'>
<table class='table table-form'>
<tr>
<th class='text-left'><?php echo $lang->comment;?></th>
</tr>
<tr>
<td><?php echo html::textarea('comment', '', "rows='6' class='form-control'");?></td>
</tr>
<tr>
<td class='text-center'><?php echo html::submitButton() . html::linkButton($lang->goback, $this->session->taskList); ?></td>
</tr>
</table>
</form>
<div class='main'>
<?php include '../../common/view/action.html.php';?>
</div>
</div>
<?php include '../../common/view/footer.html.php';?>
+1 -1
View File
@@ -15,7 +15,7 @@
<div id="featurebar">
<ul class="nav">
<li id='waitTab'><?php echo html::a(inlink('browse', "productID=$productID&branch=$branch&type=wait"), $lang->testtask->wait);?></li>
<li id='doingTab'><?php echo html::a(inlink('browse', "productID=$productID&branch=$branch&type=doing"), $lang->testtask->doingA);?></li>
<li id='doingTab'><?php echo html::a(inlink('browse', "productID=$productID&branch=$branch&type=doing"), $lang->testtask->testing);?></li>
<li id='blockedTab'><?php echo html::a(inlink('browse', "productID=$productID&branch=$branch&type=blocked"), $lang->testtask->blockedA);?></li>
<li id='doneTab'><?php echo html::a(inlink('browse', "productID=$productID&branch=$branch&type=done"), $lang->testtask->done);?></li>
</ul>
+1 -1
View File
@@ -48,7 +48,7 @@
<div class='actions'>
<?php
echo "<div class='btn-group'>";
common::printIcon('testtask', 'linkCase', "taskID=$task->id", '', 'button', 'link');
common::printIcon('testtask', 'linkCase', "taskID=$task->id&type=all&param=$taskID", '', 'button', 'link');
common::printIcon('testcase', 'export', "productID=$productID&orderBy=`case`_desc&taskID=$task->id", '', 'button', '', '', 'iframe export');
echo '</div>';
echo "<div class='btn-group'>";
+42
View File
@@ -0,0 +1,42 @@
<?php
/**
* The start file of testtask module of ZenTaoPMS.
*
* @copyright Copyright 2009-2015 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
* @license ZPL (http://zpl.pub/page/zplv12.html)
* @author Chunsheng Wang<wwccss@gmail.com>
* @package testtask
* @version $Id: start.html.php 935 2013-01-16 07:49:24Z wwccss@gmail.com $
* @link http://www.zentao.net
*/
?>
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/kindeditor.html.php';?>
<?php include '../../common/view/datepicker.html.php';?>
<div class='container mw-800px'>
<div id='titlebar'>
<div class='heading'>
<span class='prefix'><?php echo html::icon($lang->icons['testtask']);?> <strong><?php echo $testtask->id;?></strong></span>
<strong><?php echo html::a($this->createLink('testtask', 'view', 'taskID=' . $testtask->id), $testtask->name, '_blank');?></strong>
<small class='text-success'> <?php echo $lang->testtask->doing;?> <?php echo html::icon($lang->icons['start']);?></small>
</div>
</div>
<form class='form-condensed' method='post' target='hiddenwin'>
<table class='table table-form'>
<tr>
<th class='text-left'><?php echo $lang->comment;?></th>
</tr>
<tr>
<td><?php echo html::textarea('comment', '', "rows='6' class='form-control'");?></td>
</tr>
<tr>
<td class='text-center'><?php echo html::submitButton() . html::linkButton($lang->goback, $this->session->taskList); ?></td>
</tr>
</table>
</form>
<div class='main'>
<?php include '../../common/view/action.html.php';?>
</div>
</div>
<?php include '../../common/view/footer.html.php';?>
+23 -2
View File
@@ -21,6 +21,17 @@
<div class='actions'>
<?php
echo "<div class='btn-group'>";
echo "<span class='dropdown'>";
echo "<button class='btn' type='button' data-toggle='dropdown'><i class='icon icon-link'></i> {$lang->testtask->linkByVersion} <span class='caret'></span></button>";
echo "<ul class='dropdown-menu' style='max-height:240px;overflow-y:auto'>";
foreach($testTask as $tmpID => $tmpTitle)
{
$active = ($type == 'bybuild' and (int)$param == $tmpID) ? "class='active'" : '';
echo "<li $active>" . html::a(inlink('linkCase', "taskID=$taskID&type=bybuild&param=$tmpID"), $tmpTitle) . "</li>";
}
echo "</ul></span>";
echo "<span class='dropdown'>";
echo "<button class='btn' type='button' data-toggle='dropdown'><i class='icon icon-link'></i> {$lang->testtask->linkBySuite} <span class='caret'></span></button>";
echo "<ul class='dropdown-menu' style='max-height:240px;overflow-y:auto'>";
@@ -32,10 +43,14 @@
echo "<li $active>" . html::a(inlink('linkCase', "taskID=$taskID&type=bysuite&param=$suiteID"), $suiteName) . "</li>";
}
echo "</ul></span>";
$lang->testtask->linkCase = $lang->testtask->linkByStory;
common::printIcon('testtask', 'linkCase', "taskID=$taskID&type=bystory", '', 'button', 'link');
//Temporary hiding, add 'hidden'. 暂时隐藏
$lang->testtask->linkCase = $lang->testtask->linkByBug;
common::printIcon('testtask', 'linkCase', "taskID=$taskID&type=bybug", '', 'button', 'link');
common::printIcon('testtask', 'linkCase', "taskID=$taskID&type=bybug", '', 'button', 'link', '', 'hidden');
echo '</div>';
echo "<div class='btn-group'>";
common::printRPN($this->session->testtaskList);
@@ -57,6 +72,9 @@
<th><?php echo $lang->testcase->title;?></th>
<th class='w-type'><?php echo $lang->testcase->type;?></th>
<th class='w-user'><?php echo $lang->openedByAB;?></th>
<th class='w-80px'><?php echo $lang->testtask->lastRunAccount;?></th>
<th class='w-120px'><?php echo $lang->testtask->lastRunTime;?></th>
<th class='w-80px'><?php echo $lang->testtask->lastRunResult;?></th>
<th class='w-status'><?php echo $lang->statusAB;?></th>
</tr>
</thead>
@@ -81,13 +99,16 @@
</td>
<td><?php echo $lang->testcase->typeList[$case->type];?></td>
<td><?php echo $users[$case->openedBy];?></td>
<td><?php echo $case->lastRunner;?></td>
<td><?php if(!helper::isZeroDate($case->lastRunDate)) echo date(DT_MONTHTIME1, strtotime($case->lastRunDate));?></td>
<td class='<?php echo $case->lastRunResult;?>'><?php if($case->lastRunResult) echo $lang->testcase->resultList[$case->lastRunResult];?></td>
<td class='case-<?php echo $case->status?>'><?php echo $lang->testcase->statusList[$case->status];?></td>
</tr>
<?php endforeach;?>
</tbody>
<tfoot>
<tr>
<td colspan='7'>
<td colspan='10'>
<?php if($cases):?>
<div class='table-actions pd-0 clearfix'><?php echo html::selectButton() . html::submitButton();?></div>
<?php endif;?>
+2 -1
View File
@@ -82,7 +82,8 @@
<tr class='step <?php echo $stepClass?>'>
<td class='step-id'>
<?php if($result->caseResult == 'fail'):?>
<input type='checkbox' name='stepIDList[]' value='<?php echo $key;?>'/>
<?php $inputName = $stepClass == 'step-item' ? 'stepIDList[]' : 'stepGroup[]';?>
<input type='checkbox' name='<?php echo $inputName;?>' value='<?php echo $key;?>'/>
<?php endif;?>
<?php echo $stepId;?>
</td>
+1 -1
View File
@@ -32,7 +32,7 @@
common::printIcon('testtask', 'start', "taskID=$task->id", $task, 'button', '', '', 'iframe', true);
common::printIcon('testtask', 'close', "taskID=$task->id", $task, 'button', '', '', 'iframe', true);
common::printIcon('testtask', 'blocked', "taskID=$task->id", $task, 'button', 'pause', '', 'iframe', true);
common::printIcon('testtask', 'doing', "taskID=$task->id", $task, 'button', 'magic', '', 'iframe', true);
common::printIcon('testtask', 'activate', "taskID=$task->id", $task, 'button', 'magic', '', 'iframe', true);
common::printIcon('testtask', 'cases', "taskID=$task->id", $task, 'button', 'sitemap');
common::printIcon('testtask', 'linkCase', "taskID=$task->id", $task, 'button', 'link');
echo '</div>';
+4 -4
View File
@@ -49,7 +49,7 @@ class tree extends control
$lib = $this->doc->getLibById($rootID);
$this->view->root = $lib;
}
elseif(strpos($viewType, 'testlib') !== false)
elseif(strpos($viewType, 'caselib') !== false)
{
$this->loadModel('testsuite');
$lib = $this->testsuite->getById($rootID);
@@ -97,16 +97,16 @@ class tree extends control
$position[] = html::a($this->createLink('testcase', 'browse', "product=$rootID"), $product->name);
$position[] = $this->lang->tree->manageCase;
}
elseif($viewType == 'testlib')
elseif($viewType == 'caselib')
{
$this->testsuite->setLibMenu($this->testsuite->getLibraries(), $rootID);
$this->lang->tree->menu = $this->lang->testsuite->menu;
$this->lang->tree->menuOrder = $this->lang->testsuite->menuOrder;
$this->lang->set('menugroup.tree', 'qa');
$title = $lib->name . $this->lang->colon . $this->lang->tree->manageTestLib;
$title = $lib->name . $this->lang->colon . $this->lang->tree->manageCaseLib;
$position[] = html::a($this->createLink('testsuite', 'library', "libID=$rootID"), $lib->name);
$position[] = $this->lang->tree->manageTestLib;
$position[] = $this->lang->tree->manageCaseLib;
}
elseif(strpos($viewType, 'doc') !== false)
{
+2 -2
View File
@@ -21,14 +21,14 @@ $lang->tree->manageProduct = "Manage {$lang->productCommon}";
$lang->tree->manageProject = "Manage {$lang->projectCommon}";
$lang->tree->manageBug = 'Manage Bug';
$lang->tree->manageCase = 'Manage Case';
$lang->tree->manageTestLib = 'Manage Library';
$lang->tree->manageCaseLib = 'Manage Library';
$lang->tree->manageCustomDoc = 'Manage DocLib';
$lang->tree->updateOrder = 'Update Order';
$lang->tree->manageChild = 'Manage Child Module';
$lang->tree->manageStoryChild = 'Manage Child Story';
$lang->tree->manageBugChild = 'Manage Child Bug';
$lang->tree->manageCaseChild = 'Manage Child Case';
$lang->tree->manageTestlibChild = 'Manage Child Library';
$lang->tree->manageCaselibChild = 'Manage Child Library';
$lang->tree->manageTaskChild = "Manage Child {$lang->projectCommon}";
$lang->tree->syncFromProduct = 'Copy';
$lang->tree->dragAndSort = "Drag and Sort";
+2 -2
View File
@@ -21,14 +21,14 @@ $lang->tree->manageProduct = "维护{$lang->productCommon}视图模块";
$lang->tree->manageProject = "维护{$lang->projectCommon}视图模块";
$lang->tree->manageBug = '维护测试视图模块';
$lang->tree->manageCase = '维护用例视图模块';
$lang->tree->manageTestLib = '维护公共库模块';
$lang->tree->manageCaseLib = '维护测试库模块';
$lang->tree->manageCustomDoc = '维护文档库分类';
$lang->tree->updateOrder = '更新排序';
$lang->tree->manageChild = '维护子模块';
$lang->tree->manageStoryChild = '维护子模块';
$lang->tree->manageBugChild = '维护Bug子模块';
$lang->tree->manageCaseChild = '维护用例子模块';
$lang->tree->manageTestlibChild = '维护公共库子模块';
$lang->tree->manageCaselibChild = '维护测试库子模块';
$lang->tree->manageTaskChild = "维护{$lang->projectCommon}子模块";
$lang->tree->syncFromProduct = '复制';
$lang->tree->dragAndSort = "拖放排序";
+24 -6
View File
@@ -155,7 +155,7 @@ class treeModel extends model
$modules = array();
if($viewType == 'case' and $extra)
{
$modules += $this->dao->select('id,name,path,short')->from(TABLE_MODULE)->where('root')->in($extra)->andWhere('type')->eq('testlib')->andWhere('deleted')->eq(0)->fetchAll('id');
$modules += $this->dao->select('id,name,path,short')->from(TABLE_MODULE)->where('root')->in($extra)->andWhere('type')->eq('caselib')->andWhere('deleted')->eq(0)->fetchAll('id');
}
if($this->isMergeModule($rootID, $viewType)) $viewType .= ',story';
$modules += $this->dao->select('id,name,path,short')->from(TABLE_MODULE)->where('root')->eq($rootID)->andWhere('type')->in($viewType)->andWhere('deleted')->eq(0)->fetchAll('id');
@@ -886,12 +886,30 @@ class treeModel extends model
return $linkHtml;
}
public function createTestlibLink($type, $module)
/**
* Create case lib link
*
* @param string $type
* @param string $module
* @access public
* @return string
*/
public function createCaseLibLink($type, $module)
{
$linkHtml = html::a(helper::createLink('testsuite', 'library', "root={$module->root}&type=byModule&param={$module->id}"), $module->name, '_self', "id='module{$module->id}'");
return $linkHtml;
}
/**
* Create branch link
*
* @param string $type
* @param int $rootID
* @param int $branchID
* @param string $branch
* @access public
* @return string
*/
public function createBranchLink($type, $rootID, $branchID, $branch)
{
if($type == 'story') return html::a(helper::createLink('product', 'browse', "productID={$rootID}&branch=$branchID"), $branch, '_self', "id='branch{$branchID}'");
@@ -1498,7 +1516,7 @@ class treeModel extends model
}
/**
* Get testlib tree in case view.
* Get caselib tree in case view.
*
* @param string $objectType
* @param int $objectID
@@ -1506,7 +1524,7 @@ class treeModel extends model
* @access public
* @return string
*/
public function getTestLibTreeInCase($objectType, $objectID, $userFunc)
public function getCaseLibTreeInCase($objectType, $objectID, $userFunc)
{
if($objectType == 'case')
{
@@ -1530,7 +1548,7 @@ class treeModel extends model
if(empty($libs)) return null;
$libs = $this->dao->select('*')->from(TABLE_TESTSUITE)->where('type')->eq('library')->andWhere('id')->in($libs)->andWhere('deleted')->eq(0)->fetchAll('id');
$moduleGroup = $this->dao->select('*')->from(TABLE_MODULE)->where('root')->in(array_keys($libs))->andWhere('type')->eq('testlib')->andWhere('deleted')->eq(0)->orderBy('grade desc, `order`')->fetchGroup('root');
$moduleGroup = $this->dao->select('*')->from(TABLE_MODULE)->where('root')->in(array_keys($libs))->andWhere('type')->eq('caselib')->andWhere('deleted')->eq(0)->orderBy('grade desc, `order`')->fetchGroup('root');
$lastMenu = '';
$keepModules = array();
foreach($libs as $lib)
@@ -1576,7 +1594,7 @@ class treeModel extends model
public function getExistLibModules($libs, $modules)
{
$libs = $this->dao->select('*')->from(TABLE_TESTSUITE)->where('type')->eq('library')->andWhere('id')->in($libs)->andWhere('deleted')->eq(0)->fetchAll('id');
$libModules = $this->dao->select('*')->from(TABLE_MODULE)->where('root')->in(array_keys($libs))->andWhere('type')->eq('testlib')->andWhere('deleted')->eq(0)->andWhere('id')->in($modules)->orderBy('grade,`order`')->fetchAll();
$libModules = $this->dao->select('*')->from(TABLE_MODULE)->where('root')->in(array_keys($libs))->andWhere('type')->eq('caselib')->andWhere('deleted')->eq(0)->andWhere('id')->in($modules)->orderBy('grade,`order`')->fetchAll();
$modulePath = array();
foreach($libModules as $module)
{
+1 -1
View File
@@ -537,7 +537,7 @@ class user extends control
public function delete($userID)
{
$user = $this->user->getByID($userID, 'id');
if(strpos($this->app->company->admins, ",{$this->app->user->account},") !== false and $this->app->user->account == $user->account) return;
if($this->app->user->admin and $this->app->user->account == $user->account) return;
if($_POST)
{
if(md5($this->post->verifyPassword) != $this->app->user->password) die(js::alert($this->lang->user->error->verifyPassword));
+3 -1
View File
@@ -612,8 +612,10 @@ class userModel extends model
{
$ip = $this->server->remote_addr;
$last = $this->server->request_time;
$user->last = date(DT_DATETIME1, $last);
$user->last = date(DT_DATETIME1, $last);
$user->admin = strpos($this->app->company->admins, ",{$user->account},") !== false;
$user->modifyPassword = ($user->visits == 0 and !empty($this->config->safe->modifyPasswordFirstLogin));
$this->dao->update(TABLE_USER)->set('visits = visits + 1')->set('ip')->eq($ip)->set('last')->eq($last)->where('account')->eq($account)->exec();
}
return $user;
+6 -3
View File
@@ -368,7 +368,8 @@ function hideTreeBox(treeType)
{
$.cookie(treeType, 'hide', {expires:config.cookieLife, path:config.webRoot});
$('.outer').addClass('hide-side');
$('.side-handle .icon-caret-left').removeClass('icon-caret-left').addClass('icon-caret-right');
var direction = $('.side-handle .icon-caret-left').size() > 0 ? 'left' : 'right';
$('.side-handle .icon-caret-' + direction).removeClass('icon-caret-' + direction).addClass('icon-caret-' + (direction == 'left' ? 'right' : 'left'));
}
/**
@@ -382,7 +383,8 @@ function showTreeBox(treeType)
{
$.cookie(treeType, 'show', {expires:config.cookieLife, path:config.webRoot});
$('.outer').removeClass('hide-side');
$('.side-handle .icon-caret-right').removeClass('icon-caret-right').addClass('icon-caret-left');
var direction = $('.side-handle .icon-caret-left').size() > 0 ? 'left' : 'right';
$('.side-handle .icon-caret-' + direction).removeClass('icon-caret-' + direction).addClass('icon-caret-' + (direction == 'left' ? 'right' : 'left'));
}
/**
@@ -659,7 +661,8 @@ function checkTable($table)
{
var $checkbox = $(this);
var $datatable = $checkbox.closest('.datatable');
if($datatable.length) {
if($datatable.length)
{
var $checkAll = $datatable.find('.check-all.check-btn:first').trigger('click');
$checkbox.prop('checked', $checkAll.hasClass('checked'))
return;