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

This commit is contained in:
wwccss
2013-07-23 15:30:56 +08:00
14 changed files with 113 additions and 19 deletions
+7 -5
View File
@@ -342,7 +342,7 @@ class common extends control
*/
public function printRPN($backLink, $preAndNext = '')
{
global $lang;
global $lang, $app;
if(isonlybody()) return false;
echo "<span class='link-button'>";
@@ -351,18 +351,20 @@ class common extends control
if(isset($preAndNext->pre) and $preAndNext->pre)
{
$id = (!$_SESSION[$typeOnlyCondition] and $app->getModuleName() == 'testcase' and isset($preAndNext->pre->case)) ? 'case' : 'id';
$title = isset($preAndNext->pre->title) ? $preAndNext->pre->title : $preAndNext->pre->name;
$title = '#' . $preAndNext->pre->id . ' ' . $title;
$title = '#' . $preAndNext->pre->$id . ' ' . $title;
echo "<span class='link-button'>";
echo html::a($this->inLink('view', "ID={$preAndNext->pre->id}"), '&nbsp', '', "id='pre' class='icon-pre' title='{$title}'");
echo html::a($this->inLink('view', "ID={$preAndNext->pre->$id}"), '&nbsp', '', "id='pre' class='icon-pre' title='{$title}'");
echo "</span>";
}
if(isset($preAndNext->next) and $preAndNext->next)
{
$id = (!$_SESSION[$typeOnlyCondition] and $app->getModuleName() == 'testcase' and isset($preAndNext->next->case)) ? 'case' : 'id';
$title = isset($preAndNext->next->title) ? $preAndNext->next->title : $preAndNext->next->name;
$title = '#' . $preAndNext->next->id . ' ' . $title;
$title = '#' . $preAndNext->next->$id . ' ' . $title;
echo "<span class='link-button'>";
echo html::a($this->inLink('view', "ID={$preAndNext->next->id}"), '&nbsp;', '', "id='next' class='icon-next' title='$title'");
echo html::a($this->inLink('view', "ID={$preAndNext->next->$id}"), '&nbsp;', '', "id='next' class='icon-next' title='$title'");
echo "</span>";
}
}
-1
View File
@@ -627,7 +627,6 @@ class commonModel extends model
$nextID = $tmpObjectIDs[$nextKey];
$preAndNextObject->next = $objects[$objectIDs[$nextID]];
}
return $preAndNextObject;
}
+3 -3
View File
@@ -17,7 +17,7 @@ $config->testcase->editor->view = array('id' => 'comment', 'tools' => 'simpleToo
$config->testcase->exportFields = '
id, product, module, story,
title, precondition, stepDesc, stepExpect, keywords,
pri, type, stage, status, frequency,
pri, type, stage, status, lastRunResult, frequency,
openedBy, openedDate, lastEditedBy, lastEditedDate,
version,linkCase';
@@ -25,16 +25,16 @@ global $lang;
$config->testcase->search['module'] = 'testcase';
$config->testcase->search['fields']['title'] = $lang->testcase->title;
$config->testcase->search['fields']['id'] = $lang->testcase->id;
$config->testcase->search['fields']['module'] = $lang->testcase->module;
$config->testcase->search['fields']['keywords'] = $lang->testcase->keywords;
$config->testcase->search['fields']['lastEditedBy'] = $lang->testcase->lastEditedByAB;
$config->testcase->search['fields']['type'] = $lang->testcase->type;
$config->testcase->search['fields']['pri'] = $lang->testcase->pri;
$config->testcase->search['fields']['openedBy'] = $lang->testcase->openedBy;
$config->testcase->search['fields']['status'] = $lang->testcase->status;
$config->testcase->search['fields']['product'] = $lang->testcase->product;
$config->testcase->search['fields']['stage'] = $lang->testcase->stage;
$config->testcase->search['fields']['module'] = $lang->testcase->module;
$config->testcase->search['fields']['pri'] = $lang->testcase->pri;
$config->testcase->search['fields']['openedDate'] = $lang->testcase->openedDate;
$config->testcase->search['fields']['lastEditedDate'] = $lang->testcase->lastEditedDateAB;
+7 -6
View File
@@ -629,12 +629,13 @@ class testcase extends control
if(isset($relatedModules[$case->module])) $case->module = $relatedModules[$case->module];
if(isset($relatedStories[$case->story])) $case->story = $relatedStories[$case->story];
if(isset($caseLang->priList[$case->pri])) $case->pri = $caseLang->priList[$case->pri];
if(isset($caseLang->typeList[$case->type])) $case->type = $caseLang->typeList[$case->type];
if(isset($caseLang->stageList[$case->stage])) $case->stage = $caseLang->stageList[$case->stage];
if(isset($caseLang->statusList[$case->status])) $case->status = $caseLang->statusList[$case->status];
if(isset($users[$case->openedBy])) $case->openedBy = $users[$case->openedBy];
if(isset($users[$case->lastEditedBy])) $case->lastEditedBy = $users[$case->lastEditedBy];
if(isset($caseLang->priList[$case->pri])) $case->pri = $caseLang->priList[$case->pri];
if(isset($caseLang->typeList[$case->type])) $case->type = $caseLang->typeList[$case->type];
if(isset($caseLang->stageList[$case->stage])) $case->stage = $caseLang->stageList[$case->stage];
if(isset($caseLang->statusList[$case->status])) $case->status = $caseLang->statusList[$case->status];
if(isset($users[$case->openedBy])) $case->openedBy = $users[$case->openedBy];
if(isset($users[$case->lastEditedBy])) $case->lastEditedBy = $users[$case->lastEditedBy];
if(isset($caseLang->resultList[$case->lastRunResult])) $case->lastRunResult = $caseLang->resultList[$case->lastRunResult];
$case->openedDate = substr($case->openedDate, 0, 10);
$case->lastEditedDate = substr($case->lastEditedDate, 0, 10);
+1
View File
@@ -1 +1,2 @@
.w-220px{width:220px}
#featurebar .f-right .icon-green-testcase-import {padding:2px 8px; background:url(theme/default/images/main/zt-icons.png) 0px -82px;}
+1
View File
@@ -60,6 +60,7 @@ $lang->testcase->batchEdit = "Batch edit";
$lang->testcase->delete = "Delete";
$lang->testcase->browse = "Browse";
$lang->testcase->import = "Import";
$lang->testcase->exportTemplet = "Export templet";
$lang->testcase->export = "Export";
$lang->testcase->confirmStoryChange = 'Confirm story change';
+1
View File
@@ -60,6 +60,7 @@ $lang->testcase->batchEdit = "批量编辑 ";
$lang->testcase->delete = "删除";
$lang->testcase->browse = "用例列表";
$lang->testcase->import = "导入用例";
$lang->testcase->exportTemplet = "导出模板";
$lang->testcase->export = "导出";
$lang->testcase->confirmStoryChange = '确认需求变动';
+2
View File
@@ -30,6 +30,8 @@ js::set('moduleID' , $moduleID);
?>
</div>
<div class='f-right'>
<?php common::printIcon('testcase', 'import', "productID=$productID", '', 'button', '', '', 'export');?>
<?php common::printIcon('testcase', 'exportTemplet', "productID=$productID", '', 'button', 'export', '', 'export');?>
<?php if($browseType != 'needconfirm') common::printIcon('testcase', 'export', "productID=$productID&orderBy=$orderBy"); ?>
<?php common::printIcon('testcase', 'batchCreate', "productID=$productID&moduleID=$moduleID");?>
<?php common::printIcon('testcase', 'create', "productID=$productID&moduleID=$moduleID"); ?>
+50
View File
@@ -215,6 +215,7 @@ class testtask extends control
/* Set the browseType and moduleID. */
$browseType = strtolower($browseType);
$moduleID = ($browseType == 'bymodule') ? (int)$param : 0;
$queryID = ($browseType == 'bysearch') ? (int)$param : 0;
/* Get task and product info, set menu. */
$task = $this->testtask->getById($taskID);
@@ -231,6 +232,48 @@ class testtask extends control
{
$this->view->runs = $this->testtask->getUserRuns($taskID, $this->session->user->account, $orderBy, $pager);
}
/* By search. */
elseif($browseType == 'bysearch')
{
if($queryID)
{
$query = $this->loadModel('search')->getQuery($queryID);
if($query)
{
$this->session->set('testcaseQuery', $query->sql);
$this->session->set('testcaseForm', $query->form);
}
else
{
$this->session->set('testcaseQuery', ' 1 = 1');
}
}
else
{
if($this->session->testcaseQuery == false) $this->session->set('testcaseQuery', ' 1 = 1');
}
$queryProductID = $productID;
$allProduct = "`product` = 'all'";
$caseQuery = $this->session->testcaseQuery;
if(strpos($this->session->testcaseQuery, $allProduct) !== false)
{
$products = array_keys($this->loadModel('product')->getPrivProducts());
$caseQuery = str_replace($allProduct, '1', $this->session->testcaseQuery);
$caseQuery = $caseQuery . ' AND `product`' . helper::dbIN(array_keys($products));
$queryProductID = 'all';
}
$caseQuery = $this->loadModel('search')->replaceDynamic($caseQuery);
$caseQuery = preg_replace('/`(\w+)`/', 't2.`$1`', $caseQuery);
$this->view->runs = $this->dao->select('t2.*,t1.*')->from(TABLE_TESTRUN)->alias('t1')
->leftJoin(TABLE_CASE)->alias('t2')->on('t1.case = t2.id')
->where($caseQuery)
->andWhere('t1.task')->eq($taskID)
->orderBy(strpos($orderBy, 'assignedTo') !== false ? ('t1.' . $orderBy) : ('t2.' . $orderBy))
->page($pager)
->fetchAll();
}
$this->loadModel('common')->saveQueryCondition($this->dao->get(), 'testcase', false);
/* Save testcaseIDs session for get the pre and next testcase. */
@@ -238,6 +281,13 @@ class testtask extends control
foreach($this->view->runs as $run) $testcaseIDs .= ',' . $run->case;
$this->session->set('testcaseIDs', $testcaseIDs . ',');
/* Build the search form. */
$this->loadModel('testcase');
$this->config->testcase->search['params']['product']['values']= array($productID => $this->products[$productID], 'all' => $this->lang->testcase->allProduct);
$this->config->testcase->search['params']['module']['values'] = $this->loadModel('tree')->getOptionMenu($productID, $viewType = 'case');
$this->config->testcase->search['actionURL'] = inlink('cases', "taskID=$taskID&browseType=bySearch&queryID=myQueryID");
$this->loadModel('search')->setSearchParams($this->config->testcase->search);
$this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->testtask->cases;
$this->view->position[] = html::a($this->createLink('testtask', 'browse', "productID=$productID"), $this->products[$productID]);
$this->view->position[] = $this->lang->testtask->cases;
+25
View File
@@ -4,8 +4,33 @@ function browseByModule(active)
$('.divider').removeClass('hidden');
$('#bymoduleTab').addClass('active');
$('#' + active + 'Tab').removeClass('active');
$('#querybox').addClass('hidden');
}
/* Swtich to search module. */
function browseBySearch(active)
{
$('#querybox').removeClass('hidden');
$('.side').addClass('hidden');
$('.divider').addClass('hidden');
$('#' + active + 'Tab').removeClass('active');
$('#bysearchTab').addClass('active');
$('#bymoduleTab').removeClass('active');
}
function changeAction(url)
{
$('#batchForm').attr('action', url);
}
$(document).ready(function()
{
setModal4List('runCase', 'caseList', function(){$(".results").colorbox({width:900, height:550, iframe:true, transition:'none'});});
$('#' + browseType + 'Tab').addClass('active');
$('#module' + moduleID).addClass('active');
if(browseType == 'bysearch') ajaxGetSearchForm();
});
$(document).ready(function()
{
$("a.iframe").colorbox({width:900, height:550, iframe:true, transition:'none', onCleanup:function(){parent.location.href=parent.location.href;}});
+1
View File
@@ -0,0 +1 @@
$(function(){ajaxGetSearchForm();})
+2
View File
@@ -23,6 +23,7 @@ var moduleID = '<?php echo $moduleID;?>';
echo "<span id='bymoduleTab' onclick=\"browseByModule('$browseType')\"><a href='#'>" . $lang->testtask->byModule . "</a></span> ";
echo "<span id='allTab'>" . html::a($this->inlink('cases', "taskID=$taskID&browseType=all&param=0"), $lang->testtask->allCases) . "</span>";
echo "<span id='assignedtomeTab'>" . html::a($this->inlink('cases', "taskID=$taskID&browseType=assignedtome&param=0"), $lang->testtask->assignedToMe) . "</span>";
echo "<span id='bysearchTab' onclick=\"browseBySearch('$browseType')\"><a href='#'><span class='icon-search'></span>{$lang->testcase->bySearch}</a></span> ";
?>
</div>
<div class='f-right'>
@@ -33,6 +34,7 @@ var moduleID = '<?php echo $moduleID;?>';
?>
</div>
</div>
<div id='querybox'></div>
<form method='post' name='casesform'>
<table class='cont-lt1'>
-1
View File
@@ -75,5 +75,4 @@
</tfoot>
</table>
</form>
<script type='text/javascript'>ajaxGetSearchForm();</script>
<?php include '../../common/view/footer.html.php';?>
+13 -3
View File
@@ -42,11 +42,13 @@ $.extend(
/* The result.message is just a object. */
if($.type(response.message) == 'object')
{
var triggered = new Array();
$.each(response.message, function(key, value)
{
/* Define the id of the error objecjt and it's label. */
var errorOBJ = '#' + key;
var errorLabel = key + 'Label';
var i = triggered.push(false);
/* Create the error message. */
var errorMSG = '<div id="' + errorLabel + '" class="text-error">';
@@ -58,11 +60,19 @@ $.extend(
$(errorOBJ).parent().append(errorMSG);
$(errorOBJ).css('margin-bottom', 0);
$(errorOBJ).css('border-color','#953B39')
$(errorOBJ).focus(function()
$(errorOBJ).bind('keydown mousedown', function()
{
$(this).removeAttr('style')
$('#' + errorLabel).remove();
if(!triggered[i])
{
$(this).removeAttr('style')
$('#' + errorLabel).remove();
triggered[i] = true;
}
});
if(i == 1)$(errorOBJ).focus();
setTimeout(function(){$('#' + errorLabel).remove();}, 5000);
})
}