Merge branch 'master' of https://github.com/easysoft/zentaopms
This commit is contained in:
+1
-1
@@ -155,7 +155,7 @@ $filter->testsuite->library->cookie['libCaseModule'] = 'int';
|
||||
$filter->testsuite->library->cookie['preCaseLibID'] = 'int';
|
||||
|
||||
$filter->testtask->browse->cookie['preBranch'] = 'int';
|
||||
$filter->testtask->cases->cookie['preProductID'] = 'int';
|
||||
$filter->testtask->cases->cookie['preTaskID'] = 'int';
|
||||
$filter->testtask->cases->cookie['taskCaseModule'] = 'int';
|
||||
$filter->testtask->default->cookie['lastProduct'] = 'int';
|
||||
$filter->testtask->default->cookie['preProductID'] = 'int';
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
ALTER TABLE `zt_storyspec` CHANGE `title` `title` varchar(255) NOT NULL;
|
||||
update `zt_todo` set assignedTo = 'closed', assignedDate = closedDate where status = 'closed';
|
||||
|
||||
@@ -254,7 +254,7 @@ class bug extends control
|
||||
$this->view->users = $this->user->getPairs('devfirst|noclosed|nodeleted');
|
||||
$this->app->loadLang('release');
|
||||
|
||||
if(!empty($_POST) and !isset($_POST['stepIDList']))
|
||||
if(!empty($_POST))
|
||||
{
|
||||
$response['result'] = 'success';
|
||||
$response['message'] = '';
|
||||
@@ -332,8 +332,8 @@ class bug extends control
|
||||
$extras = str_replace(array(',', ' '), array('&', ''), $extras);
|
||||
parse_str($extras);
|
||||
|
||||
if($runID and $resultID) extract($this->bug->getBugInfoFromResult($resultID));// If set runID and resultID, get the result info by resultID as template.
|
||||
if(!$runID and $caseID) extract($this->bug->getBugInfoFromResult($resultID, $caseID, $version));// If not set runID but set caseID, get the result info by resultID and case info.
|
||||
if($runID and $resultID) extract($this->bug->getBugInfoFromResult($resultID, 0, 0, isset($stepIdList) ? $stepIdList : ''));// If set runID and resultID, get the result info by resultID as template.
|
||||
if(!$runID and $caseID) extract($this->bug->getBugInfoFromResult($resultID, $caseID, $version, isset($stepIdList) ? $stepIdList : ''));// If not set runID but set caseID, get the result info by resultID and case info.
|
||||
|
||||
/* If bugID setted, use this bug as template. */
|
||||
if(isset($bugID))
|
||||
|
||||
+17
-8
@@ -1610,11 +1610,11 @@ class bugModel extends model
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getBugInfoFromResult($resultID, $caseID = 0, $version = 0)
|
||||
public function getBugInfoFromResult($resultID, $caseID = 0, $version = 0, $stepIdList = '')
|
||||
{
|
||||
$title = '';
|
||||
$bugSteps = '';
|
||||
$steps = zget($_POST, 'stepIDList', array());
|
||||
$steps = explode('_', trim($stepIdList, '_'));
|
||||
|
||||
$result = $this->dao->findById($resultID)->from(TABLE_TESTRESULT)->fetch();
|
||||
if($caseID > 0)
|
||||
@@ -1635,38 +1635,47 @@ class bugModel extends model
|
||||
$bugSteps = "<p>[" . $this->lang->testcase->precondition . "]</p>" . "\n" . $run->case->precondition;
|
||||
}
|
||||
|
||||
$bugSteps .= $this->lang->bug->tplStep;
|
||||
if(!empty($stepResults))
|
||||
{
|
||||
$i = 1;
|
||||
$bugStep = '';
|
||||
foreach($steps as $stepId)
|
||||
{
|
||||
if(!isset($caseSteps[$stepId])) continue;
|
||||
|
||||
$step = $caseSteps[$stepId];
|
||||
$bugSteps .= $i . '. ' . $step->desc . "<br />";
|
||||
$bugStep .= $i . '. ' . $step->desc . "<br />";
|
||||
$i++;
|
||||
}
|
||||
$bugSteps .= $bugStep ? str_replace('<br/>', '', $this->lang->bug->tplStep) . $bugStep : $this->lang->bug->tplStep;
|
||||
|
||||
$bugSteps .= $this->lang->bug->tplResult;
|
||||
$i = 1;
|
||||
$bugResult = '';
|
||||
foreach($steps as $stepId)
|
||||
{
|
||||
if(!isset($stepResults[$stepId]) or empty($stepResults[$stepId]['real'])) continue;
|
||||
$bugSteps .= $i . '. ' . $stepResults[$stepId]['real'] . "<br />";
|
||||
$bugResult .= $i . '. ' . $stepResults[$stepId]['real'] . "<br />";
|
||||
$i++;
|
||||
}
|
||||
$bugSteps .= $bugResult ? str_replace('<br/>', '', $this->lang->bug->tplResult) . $bugResult : $this->lang->bug->tplResult;
|
||||
|
||||
$bugSteps .= $this->lang->bug->tplExpect;
|
||||
$i = 1;
|
||||
$bugExpect = '';
|
||||
foreach($steps as $stepId)
|
||||
{
|
||||
if(!isset($caseSteps[$stepId])) continue;
|
||||
|
||||
$step = $caseSteps[$stepId];
|
||||
if($step->expect) $bugSteps .= $i . '. ' . $step->expect . "<br />";
|
||||
if($step->expect) $bugExpect .= $i . '. ' . $step->expect . "<br />";
|
||||
$i++;
|
||||
}
|
||||
$bugSteps .= $bugExpect ? str_replace('<br/>', '', $this->lang->bug->tplExpect) . $bugExpect : $this->lang->bug->tplExpect;
|
||||
}
|
||||
else
|
||||
{
|
||||
$bugSteps .= $this->lang->bug->tplStep;
|
||||
$bugSteps .= $this->lang->bug->tplResult;
|
||||
$bugSteps .= $this->lang->bug->tplExpect;
|
||||
}
|
||||
|
||||
return array('title' => $title, 'steps' => $bugSteps, 'storyID' => $run->case->story, 'moduleID' => $run->case->module, 'version' => $run->case->version);
|
||||
|
||||
@@ -95,8 +95,8 @@ $lang->doc->search = 'Search';
|
||||
$lang->doc->allProduct = 'All' . $lang->productCommon;
|
||||
$lang->doc->allProject = 'All' . $lang->projectCommon;
|
||||
|
||||
$lang->doc->libTypeList['product'] = $lang->productCommon . ' Scope';
|
||||
$lang->doc->libTypeList['project'] = $lang->projectCommon . ' Scope';
|
||||
$lang->doc->libTypeList['product'] = $lang->productCommon . ' Library';
|
||||
$lang->doc->libTypeList['project'] = $lang->projectCommon . ' Library';
|
||||
$lang->doc->libTypeList['custom'] = 'Custom Library';
|
||||
|
||||
$lang->doc->systemLibs['product'] = $lang->productCommon . 'Doc Lib';
|
||||
|
||||
@@ -562,12 +562,12 @@ class docModel extends model
|
||||
->add('version', 1)
|
||||
->setDefault('product,project,module', 0)
|
||||
->stripTags($this->config->doc->editor->create['id'], $this->config->allowedTags)
|
||||
->stripTags($this->config->doc->markdown->create['id'], $this->config->allowedTags)
|
||||
->cleanInt('product,project,module')
|
||||
->join('groups', ',')
|
||||
->join('users', ',')
|
||||
->remove('files,labels,uid')
|
||||
->get();
|
||||
$doc->contentMarkdown = strip_tags($this->post->contentMarkdown, $this->config->allowedTags);
|
||||
if($doc->acl == 'private') $doc->users = $this->app->user->account;
|
||||
$condition = "lib = '$doc->lib' AND module = $doc->module";
|
||||
|
||||
@@ -638,6 +638,7 @@ class docModel extends model
|
||||
->join('users', ',')
|
||||
->remove('comment,files,labels,uid')
|
||||
->get();
|
||||
if($doc->contentType == 'markdown') $doc->content = strip_tags($this->post->content, $this->config->allowedTags);
|
||||
if($doc->acl == 'private') $doc->users = $oldDoc->addedBy;
|
||||
|
||||
$oldDocContent = $this->dao->select('*')->from(TABLE_DOCCONTENT)->where('doc')->eq($docID)->andWhere('version')->eq($oldDoc->version)->fetch();
|
||||
|
||||
@@ -214,6 +214,7 @@ class product extends control
|
||||
}
|
||||
|
||||
$rootID = key($this->products);
|
||||
if($this->session->product) $rootID = $this->session->product;
|
||||
$this->product->setMenu($this->products, $rootID);
|
||||
|
||||
$this->view->title = $this->lang->product->create;
|
||||
|
||||
@@ -352,11 +352,11 @@ class productModel extends model
|
||||
public function create()
|
||||
{
|
||||
$product = fixer::input('post')
|
||||
->setIF($this->post->acl != 'custom', 'whitelist', '')
|
||||
->setDefault('status', 'normal')
|
||||
->setDefault('createdBy', $this->app->user->account)
|
||||
->setDefault('createdDate', helper::now())
|
||||
->setDefault('createdVersion', $this->config->version)
|
||||
->setIF($this->post->acl != 'custom', 'whitelist', '')
|
||||
->setDefault('status', 'normal')
|
||||
->setDefault('createdBy', $this->app->user->account)
|
||||
->setDefault('createdDate', helper::now())
|
||||
->setDefault('createdVersion', $this->config->version)
|
||||
->join('whitelist', ',')
|
||||
->stripTags($this->config->product->editor->create['id'], $this->config->allowedTags)
|
||||
->remove('uid')
|
||||
|
||||
@@ -46,16 +46,13 @@
|
||||
else
|
||||
{
|
||||
echo "<div class='btn-group dropdown-hover' id='createActionMenu'>";
|
||||
if(common::hasPriv('project', 'importPlanStories'))
|
||||
{
|
||||
echo "<button type='button' class='btn btn-link dropdown-toggle btn-icon'>";
|
||||
echo "<i class='icon-link muted'></i> {$lang->project->linkStory} <span class='caret'></span>";
|
||||
echo '</button>';
|
||||
echo "<ul class='dropdown-menu pull-right'>";
|
||||
echo "<li>" . html::a($this->createLink('project', 'linkStory', "project=$project->id"), $lang->project->linkStory). "</li>";
|
||||
echo "<li>" . html::a('#linkStoryByPlan', $lang->project->linkStoryByPlan, '', 'data-toggle="modal"') . "</li>";
|
||||
echo '</ul>';
|
||||
}
|
||||
echo "<button type='button' class='btn btn-link dropdown-toggle btn-icon'>";
|
||||
echo "<i class='icon-link muted'></i> {$lang->project->linkStory} <span class='caret'></span>";
|
||||
echo '</button>';
|
||||
echo "<ul class='dropdown-menu pull-right'>";
|
||||
if(common::hasPriv('project', 'linkStory')) echo "<li>" . html::a($this->createLink('project', 'linkStory', "project=$project->id"), $lang->project->linkStory). "</li>";
|
||||
if(common::hasPriv('project', 'importPlanStories')) echo "<li>" . html::a('#linkStoryByPlan', $lang->project->linkStoryByPlan, '', 'data-toggle="modal"') . "</li>";
|
||||
echo '</ul>';
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
|
||||
@@ -822,6 +822,11 @@ class taskModel extends model
|
||||
->setDefault('assignedDate', $now)
|
||||
->remove('comment,showModule')
|
||||
->get();
|
||||
if($oldTask->status != 'done' and $oldTask->status != 'closed' and $task->left == 0)
|
||||
{
|
||||
dao::$errors[] = sprintf($this->lang->error->notempty, $this->lang->task->left);
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!empty($oldTask->team))
|
||||
{
|
||||
|
||||
@@ -39,10 +39,12 @@
|
||||
<th class='w-80px'><?php echo empty($task->team) ? $lang->task->assign : $lang->task->transferTo;?></th>
|
||||
<td class='w-p25-f'><?php echo html::select('assignedTo', $members, empty($task->team) ? $task->assignedTo : $task->nextUser, "class='form-control chosen'");?></td><td></td>
|
||||
</tr>
|
||||
<?php if($task->status != 'done' and $task->status != 'closed'):?>
|
||||
<tr>
|
||||
<th><?php echo $lang->task->left;?></th>
|
||||
<td><div class='input-group'><?php echo html::input('left', $task->left, "class='form-control' autocomplete='off'");?> <span class='input-group-addon'><?php echo $lang->task->hour;?></span></div></td><td></td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
<tr>
|
||||
<th><?php echo $lang->comment;?></th>
|
||||
<td colspan='2'><?php echo html::textarea('comment', '', "rows='6' class='form-control w-p98'");?></td>
|
||||
|
||||
@@ -321,7 +321,7 @@ class testreportModel extends model
|
||||
*/
|
||||
public function getTaskCases($tasks, $idList = '')
|
||||
{
|
||||
return $this->dao->select('t2.*,t1.assignedTo,t1.lastRunner,t1.lastRunDate,t1.lastRunResult,t1.status')->from(TABLE_TESTRUN)->alias('t1')
|
||||
return $this->dao->select('t2.*,t1.task,t1.assignedTo,t1.lastRunner,t1.lastRunDate,t1.lastRunResult,t1.status')->from(TABLE_TESTRUN)->alias('t1')
|
||||
->leftJoin(TABLE_CASE)->alias('t2')->on('t1.case=t2.id')
|
||||
->where('t1.task')->in(array_keys($tasks))
|
||||
->beginIF($idList)->andWhere('t2.id')->in($idList)->fi()
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<tr>
|
||||
<td><?php echo sprintf('%03d', $case->id) . html::hidden('cases[]', $case->id)?></td>
|
||||
<td><span class='label-pri label-pri-<?php echo $case->pri?>' title='<?php echo zget($lang->testcase->priList, $case->pri);?>'><?php echo zget($lang->testcase->priList, $case->pri);?></span></td>
|
||||
<td class='text-left' title='<?php echo $case->title?>'><?php echo html::a($sysURL . $this->createLink('testcase', 'view', "caseID=$case->id", '', true), $case->title, '', "data-toggle='modal' data-type='iframe' data-width='90%'");?></td>
|
||||
<td class='text-left' title='<?php echo $case->title?>'><?php echo html::a($sysURL . $this->createLink('testcase', 'view', "caseID=$case->id&version=$case->version&from=testtask&taskID=$case->task", '', true), $case->title, '', "data-toggle='modal' data-type='iframe' data-width='90%'");?></td>
|
||||
<td><?php echo zget($lang->testcase->typeList, $case->type);?></td>
|
||||
<td><?php echo zget($users, $case->assignedTo);?></td>
|
||||
<td><?php echo zget($users, $case->lastRunner);?></td>
|
||||
|
||||
@@ -260,9 +260,9 @@ class testtask extends control
|
||||
if(!$task) die(js::error($this->lang->notFound) . js::locate('back'));
|
||||
$productID = $task->product;
|
||||
$this->testtask->setMenu($this->products, $productID, $task->branch, $taskID);
|
||||
setcookie('preProductID', $productID, $this->config->cookieLife, $this->config->webRoot);
|
||||
setcookie('preTaskID', $taskID, $this->config->cookieLife, $this->config->webRoot);
|
||||
|
||||
if($this->cookie->preProductID != $productID)
|
||||
if($this->cookie->preTaskID != $taskID)
|
||||
{
|
||||
$_COOKIE['taskCaseModule'] = 0;
|
||||
setcookie('taskCaseModule', 0, $this->config->cookieLife, $this->config->webRoot);
|
||||
|
||||
@@ -28,3 +28,19 @@ function adjustPriBoxWidth()
|
||||
var addonWidth = $('#ownerAndPriBox .input-group-addon').outerWidth();
|
||||
$('#pri,#pri_chosen .chosen-single').css('width', boxWidth - beginWidth -addonWidth);
|
||||
}
|
||||
|
||||
function createBug(obj)
|
||||
{
|
||||
var $form = $(obj).closest('form');
|
||||
var params = $form.data('params');
|
||||
var stepIdList = '';
|
||||
$form.find('.step .step-id :checkbox').each(function()
|
||||
{
|
||||
if($(this).prop('checked')) stepIdList += $(this).val() + '_';
|
||||
});
|
||||
|
||||
var onlybody = config.onlybody;
|
||||
config.onlybody = 'no';
|
||||
window.open(createLink('bug', 'create', params + ',stepIdList=' + stepIdList), '_blank');
|
||||
config.onlybody = onlybody;
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
<?php $params = isset($testtask) ? ",testtask=$testtask->id,projectID=$testtask->project,buildID=$testtask->build" : '';?>
|
||||
<tr class='result-detail hide' id='tr-detail_<?php echo $trCount++; ?>'>
|
||||
<td colspan='7' class='pd-0'>
|
||||
<form action='<?php echo $this->createLink('bug', 'create', "product=$case->product&branch=$case->branch&extras=caseID=$case->id,version=$case->version,resultID=$result->id,runID=$runID" . $params)?>' target='_blank' method='post'>
|
||||
<form data-params='<?php echo "product=$case->product&branch=$case->branch&extras=caseID=$case->id,version=$case->version,resultID=$result->id,runID=$runID" . $params?>' method='post'>
|
||||
<table class='table table-condensed resultSteps'>
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -82,7 +82,7 @@
|
||||
<tr class='step <?php echo $stepClass?>'>
|
||||
<td class='step-id'>
|
||||
<?php if($result->caseResult == 'fail'):?>
|
||||
<?php $inputName = $stepResult['type'] != 'group' ? 'stepIDList[]' : '';?>
|
||||
<?php $inputName = $stepResult['type'] != 'group' ? 'stepIdList[]' : '';?>
|
||||
<div class='checkbox-primary'>
|
||||
<input type='checkbox' id='<?php echo $inputName;?>' name='<?php echo $inputName;?>' value='<?php echo $key;?>'/>
|
||||
<label><?php echo $stepId;?></label>
|
||||
@@ -113,7 +113,7 @@
|
||||
<?php if($result->caseResult == 'fail'):?>
|
||||
<tr>
|
||||
<td></td><td></td><td></td><td></td><td></td><td></td>
|
||||
<td><?php echo html::submitButton($lang->testcase->createBug);?></td>
|
||||
<td><?php echo html::commonButton($lang->testcase->createBug, "onclick='createBug(this)'", "btn btn-primary createBtn");?></td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
</tbody>
|
||||
|
||||
@@ -530,10 +530,13 @@ class todoModel extends model
|
||||
*/
|
||||
public function close($todoID)
|
||||
{
|
||||
$now = helper::now();
|
||||
$this->dao->update(TABLE_TODO)
|
||||
->set('status')->eq('closed')
|
||||
->set('closedBy')->eq($this->app->user->account)
|
||||
->set('closedDate')->eq(helper::now())
|
||||
->set('closedDate')->eq($now)
|
||||
->set('assignedTo')->eq('closed')
|
||||
->set('assignedDate')->eq($now)
|
||||
->where('id')->eq((int)$todoID)
|
||||
->exec();
|
||||
$this->loadModel('action')->create('todo', $todoID, 'closed', '', 'closed');
|
||||
|
||||
@@ -1,13 +1,5 @@
|
||||
.adbox{margin-top:20px;}
|
||||
|
||||
.card.ad{margin-bottom:0px;}
|
||||
.card.ad > .img-wrapper {
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
height: 115px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.card {
|
||||
position: relative;
|
||||
display: block;
|
||||
@@ -61,6 +53,9 @@
|
||||
height: 115px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.card.ad.ad-ranzhi > .img-wrapper {background-size: 100%;}
|
||||
|
||||
.card.ad > .img-wrapper > img{display: none;}
|
||||
.card.ad > .card-heading {text-align: center;}
|
||||
.card.ad > .card-reveal > .card-heading { padding: 12px 10px 10px 15px;}
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
$(function(){$.ajustModalPosition('fit', $('.modal-dialog'))});
|
||||
@@ -337,6 +337,7 @@ class upgradeModel extends model
|
||||
case '9_8_3': $confirmContent .= file_get_contents($this->getUpgradeFile('9.8.3'));
|
||||
case '10_0_alpha': $confirmContent .= file_get_contents($this->getUpgradeFile('10.0.alpha'));
|
||||
case '10_0_beta': $confirmContent .= file_get_contents($this->getUpgradeFile('10.0.beta'));
|
||||
case '10_0': $confirmContent .= file_get_contents($this->getUpgradeFile('10.0'));
|
||||
}
|
||||
return str_replace('zt_', $this->config->db->prefix, $confirmContent);
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
<div class='panel-body row'>
|
||||
<?php foreach($lang->install->product as $product):?>
|
||||
<div class='col-md-<?php echo ceil(12 / count($lang->install->product));?>'>
|
||||
<a class="card ad" href="<?php echo $lang->install->{$product}->url;?>" target="_blank">
|
||||
<a class="card ad ad-<?php echo $product;?>" href="<?php echo $lang->install->{$product}->url;?>" target="_blank">
|
||||
<div class="img-wrapper" style="background-image:url(<?php echo $defaultTheme . $lang->install->{$product}->logo;?>)"><img src="<?php echo $defaultTheme . $lang->install->{$product}->logo;?>" alt=""></div>
|
||||
<div class="card-reveal">
|
||||
<h5 class="card-heading"><?php echo $lang->install->{$product}->name?></h5>
|
||||
|
||||
+2
-2
File diff suppressed because one or more lines are too long
@@ -9,3 +9,4 @@
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
.divider + .divider{display:none;}
|
||||
.body-modal .main-header > h2{width: 100%; overflow:hidden; text-overflow: ellipsis; white-space: nowrap;}
|
||||
|
||||
Reference in New Issue
Block a user