Merge branch 'master' of https://gitlab.zcorp.cc/easycorp/zentaopms
This commit is contained in:
@@ -174,14 +174,21 @@ class baseEntry
|
||||
* 发送请求的响应数据
|
||||
* Send response data
|
||||
*
|
||||
* @param int $code
|
||||
* @param mixed $data
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function send($code, $data)
|
||||
public function send($code, $data = '')
|
||||
{
|
||||
header("Access-Control-Allow-Origin: *");
|
||||
header("Access-Control-Allow-Credentials: true");
|
||||
header("Access-Control-Allow-Headers: Origin,X-Requested-With,Content-Type,Accept,Authorization,Token,Referer,User-Agent");
|
||||
header('Access-Control-Allow-Methods: GET,POST,PUT,DELETE,OPTIONS,PATCH');
|
||||
header("Content-type: application/json");
|
||||
header("HTTP/1.1 {$this->statusCode[$code]}");
|
||||
echo json_encode($data, JSON_HEX_TAG);
|
||||
|
||||
if($data) echo json_encode($data, JSON_HEX_TAG);
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
@@ -198,6 +198,7 @@ class api extends router
|
||||
$entryName = $this->entry . 'Entry';
|
||||
$entry = new $entryName();
|
||||
|
||||
if($this->action == 'options') return $entry->send(204);
|
||||
call_user_func_array(array($entry, $this->action), $this->params);
|
||||
}
|
||||
|
||||
|
||||
@@ -1823,6 +1823,8 @@ class bugModel extends model
|
||||
if(!empty($run->task)) $testtask = $this->loadModel('testtask')->getById($run->task);
|
||||
$executionID = isset($testtask->execution) ? $testtask->execution : 0;
|
||||
|
||||
if(!$executionID and $this->app->tab == 'execution') $executionID = $this->session->execution;
|
||||
|
||||
return array('title' => $title, 'steps' => $bugSteps, 'storyID' => $run->case->story, 'moduleID' => $run->case->module, 'version' => $run->case->version, 'executionID' => $executionID);
|
||||
}
|
||||
|
||||
|
||||
@@ -1352,7 +1352,7 @@ EOD;
|
||||
$executionPairs = array();
|
||||
$object = $app->dbh->query('SELECT project,type FROM ' . TABLE_EXECUTION . " WHERE `id` = '$executionID'")->fetch();
|
||||
$orderBy = $object->type == 'stage' ? 'ORDER BY `id` ASC' : 'ORDER BY `id` DESC';
|
||||
$executionList = $app->dbh->query("SELECT id,name FROM " . TABLE_EXECUTION . " WHERE `project` = '{$object->project}' $orderBy")->fetchAll();
|
||||
$executionList = $app->dbh->query("SELECT id,name FROM " . TABLE_EXECUTION . " WHERE `project` = '{$object->project}' AND `deleted` = '0' $orderBy")->fetchAll();
|
||||
foreach($executionList as $execution)
|
||||
{
|
||||
if($execution->id == $executionID) continue;
|
||||
|
||||
@@ -39,7 +39,7 @@ js::set('confirmDelete', $lang->user->confirmDelete);
|
||||
}
|
||||
else
|
||||
{
|
||||
common::printLink('user', 'create', "dept={$deptID}", "<i class='icon icon-plus'></i> " . $lang->user->create, '', "class='btn btn-primary'");
|
||||
common::printLink('user', 'create', "dept={$deptID}", "<i class='icon icon-plus'></i> " . $lang->user->create, '', "class='btn btn-primary create-user-btn'");
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
$(function()
|
||||
{
|
||||
$('[name=mode]').change(function()
|
||||
{
|
||||
var mode = $(this).val();
|
||||
if(mode == 'new') $('#modeTips').html(newTips);
|
||||
if(mode == 'classic') $('#modeTips').html(classicTips);
|
||||
})
|
||||
})
|
||||
|
||||
@@ -11,8 +11,6 @@
|
||||
*/
|
||||
?>
|
||||
<?php include 'header.html.php';?>
|
||||
<?php js::set('newTips', $lang->upgrade->selectedModeTips['new'])?>
|
||||
<?php js::set('classicTips', $lang->custom->changeClassicTip)?>
|
||||
<div id='mainContent' class='main-content'>
|
||||
<form class="load-indicator main-form" method='post'>
|
||||
<div class='main-header'>
|
||||
@@ -29,7 +27,7 @@
|
||||
<label class="radio-inline"><input type="radio" name="mode" value="classic" <?php echo $mode == 'classic'? "checked='checked'" : ''; echo $isDisabled;?> id="modeclassic"><?php echo $lang->upgrade->to15Mode['classic'];?></label>
|
||||
<label class="radio-inline"><input type="radio" name="mode" value="new" <?php echo $mode == 'new'? "checked='checked'" : ''; echo $isDisabled;?> id="modenew"><?php echo $lang->upgrade->to15Mode['new'];?></label>
|
||||
</p>
|
||||
<p class='text-info' id='modeTips'><?php echo $mode == 'classic' ? $lang->custom->changeClassicTip : $lang->upgrade->selectedModeTips['new'];?></p>
|
||||
<p class='text-info' id='modeTips'><?php echo $lang->upgrade->selectedModeTips['new'];?></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
@@ -220,6 +220,12 @@
|
||||
|
||||
/* If first show without url, then use the default url */
|
||||
if(!url) url = appsMap[appCode].url;
|
||||
|
||||
var iframe = $iframe.get(0);
|
||||
iframe.onload = iframe.onreadystatechange = function(e)
|
||||
{
|
||||
$app.trigger('loadapp', app);
|
||||
};
|
||||
}
|
||||
|
||||
/* Set tab cookie */
|
||||
@@ -278,7 +284,7 @@
|
||||
updateAppUrl(appCode, null, null, true);
|
||||
}
|
||||
|
||||
app.$app.trigger('show.zentaoapp', app);
|
||||
app.$app.trigger('showapp', app);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -318,7 +324,7 @@
|
||||
app.show = false;
|
||||
lastOpenedApp = null;
|
||||
|
||||
app.$app.trigger('hide.zentaoapp', app);
|
||||
app.$app.trigger('hideapp', app);
|
||||
|
||||
/* Active last app */
|
||||
var lastApp = getLastApp(true) || getLastApp();
|
||||
@@ -388,7 +394,7 @@
|
||||
var firstClass = $("#bars li:first").attr('class');
|
||||
if(firstClass == 'divider') $("#bars li.divider:first").remove();
|
||||
|
||||
app.$app.trigger('close.zentaoapp', app);
|
||||
app.$app.trigger('closeapp', app);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -416,7 +422,7 @@
|
||||
iframe.src = url || app.url || iframe.src;
|
||||
}
|
||||
|
||||
if(!notTriggerEvent) app.$app.trigger('reload.zentaoapp', app);
|
||||
if(!notTriggerEvent) app.$app.trigger('reloadapp', app);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -72,6 +72,8 @@ function loadExecutionStories(executionID)
|
||||
else
|
||||
{
|
||||
$('#storyBox').removeClass('hidden');
|
||||
$('#storyBox > a:first').attr('href', createLink('execution', 'linkStory', 'executionID=' + executionID));
|
||||
$('#storyBox > a:nth-child(2)').attr('href', "javascript:loadStories(" + executionID + ")");
|
||||
$('#story').parent().addClass('hidden');
|
||||
}
|
||||
|
||||
|
||||
@@ -3027,7 +3027,7 @@ class taskModel extends model
|
||||
if(!empty($task->team)) echo '<span class="label label-badge label-light" title="' . $this->lang->task->multiple . '">' . $this->lang->task->multipleAB . '</span> ';
|
||||
echo $canView ? html::a($taskLink, $task->name, null, "style='color: $task->color'") : "<span style='color: $task->color'>$task->name</span>";
|
||||
if(!empty($task->children)) echo '<a class="task-toggle" data-id="' . $task->id . '"><i class="icon icon-angle-double-right"></i></a>';
|
||||
if($task->fromBug) echo html::a(helper::createLink('bug', 'view', "id=$task->fromBug"), "[BUG#$task->fromBug]", '_blank', "class='bug'");
|
||||
if($task->fromBug) echo html::a(helper::createLink('bug', 'view', "id=$task->fromBug"), "[BUG#$task->fromBug]", '', "class='bug'");
|
||||
break;
|
||||
case 'type':
|
||||
echo $this->lang->task->typeList[$task->type];
|
||||
|
||||
@@ -51,7 +51,8 @@
|
||||
<td class='w-60px'><?php if(!empty($result->files)) echo html::a("#caseResult{$result->id}", $lang->files . $fileCount, '', "data-toggle='modal' data-type='iframe'")?></td>
|
||||
<td class='w-50px text-center'><i class='collapse-handle icon-angle-down text-muted'></i></td>
|
||||
</tr>
|
||||
<?php $executionParam = ($this->app->tab == 'execution' and isset($testtask)) ? "executionID=$testtask->execution" : "";?>
|
||||
<?php $executionParam = $this->app->tab == 'execution' ? "executionID={$this->session->execution}" : "";?>
|
||||
<?php $executionParam = isset($testtask) ? "executionID=$testtask->execution" : $executionParam;?>
|
||||
<?php $params = isset($testtask) ? ",testtask=$testtask->id" : "";?>
|
||||
<?php $params = $params . ",buildID=" . (isset($testtask->build) ? $testtask->build : $result->build);?>
|
||||
<?php if($executionParam) $params .= ',' . $executionParam;?>
|
||||
|
||||
+20
-12
@@ -414,14 +414,20 @@ $(function()
|
||||
|
||||
var checkTutorialState = function()
|
||||
{
|
||||
var iWindow = getAppWindow();
|
||||
iWindow = window.frames['iframePage'];
|
||||
tryCheckTask();
|
||||
var iWindow = getAppWindow();
|
||||
var title = (iWindow.$ ? iWindow.$('head > title').text() : '') + $('head > title').text();
|
||||
var url = createLink('tutorial', 'index', 'referer=' + Base64.encode(iWindow.location.href) + '&task=' + current);
|
||||
try{window.history.replaceState({}, title, url);}catch(e){}
|
||||
};
|
||||
|
||||
var checkTimer = 0;
|
||||
var tryCheckTutorialState = function(delay)
|
||||
{
|
||||
clearTimeout(checkTimer);
|
||||
checkTimer = setTimeout(checkTutorialState, delay || 200);
|
||||
};
|
||||
|
||||
var showTask = function(taskName)
|
||||
{
|
||||
clearTips();
|
||||
@@ -472,7 +478,6 @@ $(function()
|
||||
var progress = Math.round(100*finishCount/totalCount);
|
||||
$progress.toggleClass('finish', isFinishAll).find('.progress-bar').css('width', (100*finishCount/totalCount) + '%');
|
||||
$progress.find('.progress-text').text(progress + '%');
|
||||
if(progress == 100) $.getJSON(createLink('tutorial', 'ajaxFinish'));
|
||||
showTask(current);
|
||||
};
|
||||
|
||||
@@ -482,7 +487,10 @@ $(function()
|
||||
var appsIframe = $('#iframePage').get(0);
|
||||
appsIframe.onload = appsIframe.onreadystatechange = function()
|
||||
{
|
||||
appsWindow.$(appsWindow.document).on('show.zentaoapp close.zentaoapp hide.zentaoapp', checkTutorialState);
|
||||
appsWindow.$(appsWindow.document).on('reloadapp loadapp showapp closeapp hideapp', function()
|
||||
{
|
||||
tryCheckTutorialState(1000);
|
||||
});
|
||||
|
||||
/* Open referer page in app tab */
|
||||
if(tutorialReferer) appsWindow.$.apps.open(tutorialReferer);
|
||||
@@ -491,17 +499,17 @@ $(function()
|
||||
};
|
||||
}
|
||||
|
||||
/* Quit tutorial mode */
|
||||
function quitTutorial()
|
||||
{
|
||||
var url = createLink('tutorial', 'quit');
|
||||
if(typeof navigator.sendBeacon === 'function') navigator.sendBeacon(url);
|
||||
else $.ajax({url: url, dataType: 'json', async: false});
|
||||
}
|
||||
|
||||
/** Init current tutorial page */
|
||||
function initTutorial()
|
||||
{
|
||||
/* Quit tutorial mode on unload page */
|
||||
window.onbeforeunload = function()
|
||||
{
|
||||
var url = createLink('tutorial', 'quit');
|
||||
if(typeof navigator.sendBeacon === 'function') navigator.sendBeacon(url);
|
||||
else $.ajax({url: url, dataType: 'json', async: false});
|
||||
}
|
||||
|
||||
if(finishCount >= totalCount) showModal(true);
|
||||
|
||||
$(document).on('click', '.btn-task', function()
|
||||
|
||||
@@ -66,7 +66,7 @@ if($config->global->flow == 'full' or $config->global->flow == 'onlyTask')
|
||||
$lang->tutorial->tasks['createProject']['desc'] = "<p>Create a {$lang->projectCommon}: </p><ul><li data-target='nav'>Open <span class='task-nav'> {$lang->projectCommon} <i class='icon icon-angle-right'></i> New</span> Page;</li><li data-target='form'>Fill the form with {$lang->projectCommon} information;</li><li data-target='submit'>Save</li></ul>";
|
||||
|
||||
$lang->tutorial->tasks['manageTeam'] = array('title' => "Manage {$lang->projectCommon} Team");
|
||||
$lang->tutorial->tasks['manageTeam']['nav'] = array('app' => 'project', 'module' => 'project', 'method' => 'managemembers', 'menuModule' => 'settings', 'menu' => '#navbar>.nav>li[data-id="all"],#cards>.col>.panel:first .project-name,#navbar>.nav>li[data-id="settings"],#subNavbar>.nav>li[data-id="members"],.manage-team-btn', 'target' => '.manage-team-btn', 'form' => '#teamForm', 'requiredFields' => 'account1', 'submit' => '#submit', 'targetPageName' => 'Manage team members');
|
||||
$lang->tutorial->tasks['manageTeam']['nav'] = array('app' => 'project', 'module' => 'project', 'method' => 'managemembers', 'menuModule' => 'settings', 'menu' => '#navbar>.nav>li[data-id="browse"],#cards>.col>.panel:first .project-name,#projectTableList>tr:first>.c-name>a,#navbar>.nav>li[data-id="settings"],#subNavbar>.nav>li[data-id="members"],.manage-team-btn', 'target' => '.manage-team-btn', 'form' => '#teamForm', 'requiredFields' => 'account1', 'submit' => '#submit', 'targetPageName' => 'Manage team members');
|
||||
$lang->tutorial->tasks['manageTeam']['desc'] = "<p>Manage {$lang->projectCommon} team members: </p><ul><li data-target='nav'>Open <span class='task-nav'> {$lang->projectCommon} <i class='icon icon-angle-right'></i> Team <i class='icon icon-angle-right'></i> Manage Team Members</span> Page;</li><li data-target='form'>Choose users for the team.</li><li data-target='submit'>Save</li></ul>";
|
||||
|
||||
$lang->tutorial->tasks['createExecution'] = array('title' => 'Create a ' . $lang->executionCommon);
|
||||
|
||||
@@ -65,7 +65,7 @@ if($config->global->flow == 'full' or $config->global->flow == 'onlyTask')
|
||||
$lang->tutorial->tasks['createProject']['desc'] = "<p>在系统创建一个新的{$lang->projectCommon}:</p><ul><li data-target='nav'>打开 <span class='task-nav'> {$lang->projectCommon} <i class='icon icon-angle-right'></i> {$lang->projectCommon}列表 <i class='icon icon-angle-right'></i> 创建{$lang->projectCommon}</span> 页面;</li><li data-target='form'>在表单中填写要创建的{$lang->projectCommon}信息;</li><li data-target='submit'>保存{$lang->projectCommon}信息。</li></ul>";
|
||||
|
||||
$lang->tutorial->tasks['manageTeam'] = array('title' => "管理{$lang->projectCommon}团队");
|
||||
$lang->tutorial->tasks['manageTeam']['nav'] = array('app' => 'project', 'module' => 'project', 'method' => 'managemembers', 'menuModule' => 'settings', 'menu' => '#navbar>.nav>li[data-id="all"],#cards>.col>.panel:first .project-name,#navbar>.nav>li[data-id="settings"],#subNavbar>.nav>li[data-id="members"],.manage-team-btn', 'target' => '.manage-team-btn', 'form' => '#teamForm', 'requiredFields' => 'account1', 'submit' => '#submit', 'targetPageName' => '团队管理');
|
||||
$lang->tutorial->tasks['manageTeam']['nav'] = array('app' => 'project', 'module' => 'project', 'method' => 'managemembers', 'menuModule' => 'settings', 'menu' => '#navbar>.nav>li[data-id="browse"],#cards>.col>.panel:first .project-name,#projectTableList>tr:first>.c-name>a,#navbar>.nav>li[data-id="settings"],#subNavbar>.nav>li[data-id="members"],.manage-team-btn', 'target' => '.manage-team-btn', 'form' => '#teamForm', 'requiredFields' => 'account1', 'submit' => '#submit', 'targetPageName' => '团队管理');
|
||||
$lang->tutorial->tasks['manageTeam']['desc'] = "<p>管理{$lang->projectCommon}团队成员:</p><ul><li data-target='nav'>打开 <span class='task-nav'> {$lang->projectCommon} <i class='icon icon-angle-right'></i> 设置 <i class='icon icon-angle-right'></i> 团队 <i class='icon icon-angle-right'></i> 团队管理</span> 页面;</li><li data-target='form'>选择要加入团队的成员;</li><li data-target='submit'>保存团队成员信息。</li></ul>";
|
||||
|
||||
$lang->tutorial->tasks['createExecution'] = array('title' => '创建' . $lang->executionCommon);
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user