* Merge 169 untrack file to master.

This commit is contained in:
孙广明
2021-12-08 11:07:06 +08:00
parent 87c24eae5a
commit 13f162edd2
49 changed files with 159 additions and 82 deletions

View File

@@ -90,6 +90,9 @@ class gitlab
/**
* Get files info.
*
* The API path requested is: "GET /projects/:id/repository/files/:file_path".
* Known issue of GitLab API: if a '%' in 'file_path', GitLab API will show a error 'file_path should be a valid file path'.
*
* @param string $path
* @param string $ref
* @access public

View File

@@ -69,7 +69,7 @@ class api extends control
$this->view->typeList = $this->api->getTypeList($libID);
}
$this->setMenu($libID);
$this->setMenu($libID, $moduleID);
$this->view->isRelease = $release > 0;
$this->view->release = $release;
@@ -462,6 +462,7 @@ class api extends control
{
$now = helper::now();
$params = fixer::input('post')
->trim('title,path')
->remove('type')
->skipSpecial('params,response')
->add('addedBy', $this->app->user->account)
@@ -601,10 +602,11 @@ class api extends control
* Set doc menu by method name.
*
* @param int $libID
* @param int $moduleID
* @access public
* @return void
*/
private function setMenu($libID = 0)
private function setMenu($libID = 0, $moduleID = 0)
{
common::setMenuVars('doc', $libID);
@@ -629,7 +631,7 @@ class api extends control
if(common::hasPriv('api', 'create'))
{
$menu .= "<li>";
$menu .= html::a(helper::createLink('api', 'create', "libID=$libID"), "<i class='icon-rich-text icon'></i> " . $this->lang->api->apiDoc, '', "data-app='{$this->app->tab}'");
$menu .= html::a(helper::createLink('api', 'create', "libID=$libID&moduleID=$moduleID"), "<i class='icon-rich-text icon'></i> " . $this->lang->api->apiDoc, '', "data-app='{$this->app->tab}'");
$menu .= "</li>";
}

View File

@@ -41,7 +41,7 @@ $lang->api->noUniqueName = '接口库名已存在。';
$lang->api->noUniqueVersion = '版本已存在。';
$lang->api->version = '版本';
$lang->api->createStruct = '创建数据结构';
$lang->api->editStruct = '修改数据结构';
$lang->api->editStruct = '编辑数据结构';
$lang->api->deleteStruct = '删除数据结构';
$lang->api->create = '创建接口';
$lang->api->title = '接口名称';

View File

@@ -209,20 +209,17 @@ class apiModel extends model
$now = helper::now();
$account = $this->app->user->account;
$data = fixer::input('post')
->remove('type')
->skipSpecial('params,response')
->add('editedBy', $account)
->add('editedDate', $now)
->add('version', $oldApi->version)
->setDefault('product,module', 0)
->remove('type')
->get();
$data->id = $oldApi->id;
$data->version = $oldApi->version + 1;
$apiSpec = $this->getApiSpecByData($data);
$changes = common::createChanges($oldApi, $data);
if(!empty($changes)) $data->version = $oldApi->version + 1;
$this->dao->replace(TABLE_API_SPEC)->data($apiSpec)->exec();
unset($data->id);
$this->dao->update(TABLE_API)
->data($data)
->autoCheck()
@@ -230,7 +227,11 @@ class apiModel extends model
->where('id')->eq($apiID)
->exec();
return common::createChanges($oldApi, $data);
$data->id = $apiID;
$apiSpec = $this->getApiSpecByData($data);
$this->dao->replace(TABLE_API_SPEC)->data($apiSpec)->exec();
return $changes;
}
/**

View File

@@ -1,4 +1,4 @@
<div class="main-col" data-min-width="400">
<div class="main-col" data-min-width="500">
<div id="mainContent" class="main-row in">
<div class="main-col col-8">
<div class="cell" id="content">

View File

@@ -68,7 +68,7 @@ js::set('struct_paramsType', $lang->struct->paramsType);
<tr>
<th><?php echo $lang->api->module;?></th>
<td>
<span id='moduleBox'><?php echo html::select('module', $moduleOptionMenu, '', "class='form-control chosen'");?></span>
<span id='moduleBox'><?php echo html::select('module', $moduleOptionMenu, $moduleID, "class='form-control chosen'");?></span>
</td>
<td></td>
</tr>

View File

@@ -42,8 +42,10 @@
</div>
<?php if(!$moduleTree):?>
<hr class="space">
<?php if(!$isRelease):?>
<div class="text-center text-muted tips"><?php echo $lang->api->noModule;?></div>
<?php endif;?>
<?php endif;?>
<?php echo $moduleTree;?>
</div>
</div>
@@ -71,7 +73,7 @@
</div>
</div>
<?php else:?>
<div class="cell">
<div class="cell main-col" data-min-width="400">
<div class="detail">
<ul class="list-group">
<?php foreach($apiList as $api):?>

View File

@@ -41,7 +41,7 @@
<td><?php echo zget($users, $release->addedBy, '');?></td>
<td class="c-date"><?php echo $release->addedDate;?></td>
<td class='c-actions'>
<?php echo html::a($this->createLink('api', 'deleteRelease', "libID=$libID&id=$release->id"), '<i class="icon-trash"></i>', 'hiddenwin', "title='{$lang->api->delete}' class='btn'");?>
<?php if(common::hasPriv('api', 'deleteRelease')) echo html::a($this->createLink('api', 'deleteRelease', "libID=$libID&id=$release->id"), '<i class="icon-trash"></i>', 'hiddenwin', "title='{$lang->api->deleteRelease}' class='btn'");?>
</td>
</tr>
<?php endforeach;?>

View File

@@ -49,8 +49,8 @@
<td class="c-date"><?php echo $struct->addedDate;?></td>
<td class='c-actions'>
<?php
if(common::hasPriv('api', 'editStruct')) echo html::a($this->createLink('api', 'editStruct', "libID=$libID&structID=$struct->id"), '<i class="icon-edit"></i>', '', "title='{$lang->api->edit}' class='btn'");
if(common::hasPriv('api', 'deleteStruct')) echo html::a($this->createLink('api', 'deleteStruct', "libID=$libID&structID=$struct->id"), '<i class="icon-trash"></i>', 'hiddenwin', "title='{$lang->api->delete}' class='btn'");
if(common::hasPriv('api', 'editStruct')) echo html::a($this->createLink('api', 'editStruct', "libID=$libID&structID=$struct->id"), '<i class="icon-edit"></i>', '', "title='{$lang->api->editStruct}' class='btn'");
if(common::hasPriv('api', 'deleteStruct')) echo html::a($this->createLink('api', 'deleteStruct', "libID=$libID&structID=$struct->id"), '<i class="icon-trash"></i>', 'hiddenwin', "title='{$lang->api->deleteStruct}' class='btn'");
?>
</td>
</tr>

View File

@@ -407,7 +407,16 @@ class bug extends control
if($this->app->tab == 'execution')
{
$location = $this->session->bugList ? $this->session->bugList : $this->createLink('execution', 'bug', "executionID={$output['executionID']}");
if(!preg_match("/(m=|\/)execution(&f=|-)bug(&|-|\.)?/", $this->session->bugList))
{
$location = $this->session->bugList;
}
else
{
$executionID = $this->post->execution ? $this->post->execution : $output['executionID'];
$location = $this->createLink('execution', 'bug', "executionID=$executionID");
}
}
elseif($this->app->tab == 'project')
{

View File

@@ -93,7 +93,7 @@
if($this->app->tab != 'product')
{
common::printIcon('bug', 'toStory', "product=$bug->product&branch=$bug->branch&module=0&story=0&execution=0&bugID=$bug->id", $bug, 'button', $lang->icons['story'], '', '', '', "data-app='" . $this->app->tab . "'", $lang->bug->toStory);
common::printIcon('bug', 'toStory', "product=$bug->product&branch=$bug->branch&module=0&story=0&execution=0&bugID=$bug->id", $bug, 'button', $lang->icons['story'], '', '', '', "data-app='product'", $lang->bug->toStory);
common::printIcon('bug', 'createCase', $convertParams, $bug, 'button', 'sitemap');
}

View File

@@ -54,6 +54,7 @@ class ciModel extends model
*/
public function syncCompileStatus($compile)
{
/* Max retry times is: 3. */
if($compile->times >= 3)
{
$this->dao->update(TABLE_COMPILE)->set('status')->eq('failure')->where('id')->eq($compile->id)->exec();

View File

@@ -27,5 +27,7 @@ function submitForm(type)
$('.modal-body #insert').val(type == 'insert' ? 1 : 0);
$('#importNoticeModal .form-actions .btn').addClass('disabled');
$("button[data-target='#importNoticeModal']").closest('form').submit();
setTimeout(function(){$('#importNoticeModal .form-actions .btn').removeClass('disabled');}, 1000);
}
</script>

View File

@@ -178,8 +178,8 @@ class compileModel extends model
$this->dao->update(TABLE_COMPILE)->data($compile)->where('id')->eq($compileID)->exec();
$this->dao->update(TABLE_JOB)
->set('lastStatus')->eq($build->status)
->set('lastExec')->eq($build->updateDate)
->set('lastStatus')->eq($compile->status)
->set('lastExec')->eq($compile->updateDate)
->where('id')->eq($job->id)
->exec();

View File

@@ -133,7 +133,7 @@ $(function()
$('#content').on('click', '.outline .outline-toggle i.icon-angle-right', function()
{
$('.article-content').width('85%');
$('.article-content').css('width', '85%');
$('.outline').css({'min-width' : '180px', 'border-left' : '2px solid #efefef'});
$(this).removeClass('icon-angle-right').addClass('icon-angle-left').css('left', '-9px');
$('.outline-content').show();

View File

@@ -411,7 +411,7 @@ class gitlabModel extends model
if(is_numeric($host)) $host = $this->getApiRoot($host);
if(strpos($host, 'http://') !== 0 and strpos($host, 'https://') !== 0) return false;
$url = sprintf($apiRoot, $api);
$url = sprintf($host, $api);
return json_decode(commonModel::http($url, $data, $options));
}
@@ -635,7 +635,7 @@ class gitlabModel extends model
*
* @param int $gitlabID
* @access public
* @return void
* @return array
*/
public function apiGetProjects($gitlabID)
{
@@ -1715,9 +1715,9 @@ class gitlabModel extends model
/**
* Create webhook for zentao.
*
* @param int $products
* @param int $gitlabID
* @param int $projectID
* @param array $products
* @param int $gitlabID
* @param int $projectID
* @access public
* @return bool
*/
@@ -1830,7 +1830,7 @@ class gitlabModel extends model
if($value) $issue->$field = $value;
}
if($isset($issue->assignee_id) and $issue->assignee_id == 'closed') unset($issue->assignee_id);
if(isset($issue->assignee_id) and $issue->assignee_id == 'closed') unset($issue->assignee_id);
/* issue->state is null when creating it, we should put status_event when updating it. */
if(isset($issue->state) and $issue->state == 'closed') $issue->state_event = 'close';

View File

@@ -27,4 +27,3 @@
</div>
<?php include '../../common/view/footer.html.php';?>

View File

@@ -120,7 +120,7 @@ class job extends control
$this->view->repoTypes = $repoTypes;
$this->view->products = array(0 => '') + $this->loadModel('product')->getProductPairsByProject($this->projectID);
$this->view->jenkinsServerList = $this->loadModel('jenkins')->getPairs();
$this->view->jenkinsServerList = array('' => '') + $this->loadModel('jenkins')->getPairs();
$this->display();
}
@@ -352,7 +352,7 @@ class job extends control
if($productLeft == $productRight) $matchedProducts[$productName] = $productRight;
}
}
die(json_encode($matchedProduct));
die(json_encode($matchedProducts));
}
$productName = $this->loadModel('product')->getByID($repo->product)->name;

View File

@@ -378,7 +378,7 @@ class jobModel extends model
if($job->triggerType == 'tag')
{
$lastTag = $this->getLastTagByRepo($repo);
$lastTag = $this->getLastTagByRepo($repo, $job);
if($lastTag)
{
$build->tag = $lastTag;
@@ -444,7 +444,7 @@ class jobModel extends model
/**
* Exec gitlab pipeline.
*
* @param int $job
* @param object $job
* @access public
* @return void
*/
@@ -486,11 +486,12 @@ class jobModel extends model
/**
* Get last tag of one repo.
*
* @param object $repo
* @param object $repo
* @param object $job
* @access public
* @return void
*/
public function getLastTagByRepo($repo)
public function getLastTagByRepo($repo, $job)
{
if($repo->SCM == 'Subversion')
{

View File

@@ -47,10 +47,7 @@ class messageModel extends model
$objectActions = array();
foreach($this->config->message->objectTypes as $objectType => $actions)
{
foreach($actions as $action)
{
$objectActions[$objectType][$action] = str_replace($this->lang->webhook->trimWords, '', $this->lang->action->label->$action);
}
foreach($actions as $action) $objectActions[$objectType][$action] = $this->lang->message->label->$action;
}
return $objectActions;
}

View File

@@ -96,7 +96,7 @@
}
else
{
echo html::a($this->createLink('task', 'view', "taskID=$task->id", '', '', $task->project), $task->name, null, "style='color: $task->color' data-group='execution'");
echo html::a($this->createLink('task', 'view', "taskID=$task->id", '', '', $task->project), $task->name, null, "style='color: $task->color'");
}
?>
<?php if(!empty($task->children)) echo '<a class="task-toggle" data-id="' . $task->id . '"><i class="icon icon-angle-double-right"></i></a>';?>
@@ -104,7 +104,7 @@
<?php if($config->systemMode == 'new'):?>
<td class='c-project' title="<?php echo $task->projectName;?>"><?php echo html::a($this->createLink('project', 'index', "projectID=$task->project"), $task->projectName);?></td>
<?php endif;?>
<td class='c-project' title="<?php echo $task->executionName;?>"><?php echo html::a($this->createLink('execution', 'task', "executionID=$task->execution"), $task->executionName, '', "data-group='execution'");?></td>
<td class='c-project' title="<?php echo $task->executionName;?>"><?php echo html::a($this->createLink('execution', 'task', "executionID=$task->execution"), $task->executionName, '');?></td>
<?php if($type != 'openedBy'): ?>
<td class='c-user'><?php echo zget($users, $task->openedBy);?></td>
<?php endif;?>
@@ -171,7 +171,7 @@
<?php if($config->systemMode == 'new'):?>
<td class='c-project' title="<?php echo $child->projectName;?>"><?php echo html::a($this->createLink('project', 'view', "projectID=$child->project"), $child->projectName);?></td>
<?php endif;?>
<td class='c-project' title="<?php echo $child->projectName;?>"><?php echo html::a($this->createLink('execution', 'task', "executionID=$child->project"), $child->executionName, '', "data-group='execution'");?></td>
<td class='c-project' title="<?php echo $child->projectName;?>"><?php echo html::a($this->createLink('execution', 'task', "executionID=$child->project"), $child->executionName, '');?></td>
<?php if($type != 'openedBy'): ?>
<td class='c-user'><?php echo zget($users, $child->openedBy);?></td>
<?php endif;?>
@@ -208,8 +208,8 @@
common::printIcon('task', 'finish', "taskID=$child->id", $child, 'list', '', '', 'iframe', true, '', '', $child->project);
common::printIcon('task', 'recordEstimate', "taskID=$child->id", $child, 'list', 'time', '', 'iframe', true, '', '', $child->project);
common::printIcon('task', 'edit', "taskID=$child->id", $child, 'list', '', '', '', '', 'data-group="execution"', '', $child->project);
common::printIcon('task', 'batchCreate', "executionID=$child->execution&storyID=$child->story&moduleID=$child->module&taskID=$child->id&iframe=true", $child, 'list', 'split', '', 'iframe', true, 'data-group="execution"', $this->lang->task->children, $child->project);
common::printIcon('task', 'edit', "taskID=$child->id", $child, 'list', '', '', '', '', '', '', $child->project);
common::printIcon('task', 'batchCreate', "executionID=$child->execution&storyID=$child->story&moduleID=$child->module&taskID=$child->id&iframe=true", $child, 'list', 'split', '', 'iframe', true, '', $this->lang->task->children, $child->project);
}
}
?>

View File

@@ -1266,6 +1266,7 @@ class product extends control
if($_POST)
{
$this->product->manageLine();
if(dao::isError()) die(js::error(dao::getError()));
die(js::reload('parent'));
}

View File

@@ -6,5 +6,5 @@ td.normal {color: #00da88;}
td.acl {white-space: nowrap;}
.row > .col-sm-12:first-child {padding-bottom: 20px;}
.c-product ,.c-release ,.c-code {width: 100px !important;}
.c-openedBy ,.c-acl ,.c-common {width:110px !important;}
.c-bugs {width:120px !important;}
.c-openedBy ,.c-acl ,.c-prs ,.c-common {width:110px !important;}
.c-bugs ,.c-type {width:120px !important;}

View File

@@ -61,12 +61,14 @@ function toggleLine(obj)
{
$('form .line-no-exist').removeClass('hidden');
$('form .line-exist').addClass('hidden');
$('#line_chosen').addClass('hidden');
$line.attr('disabled', 'disabled');
}
else
{
$('form .line-exist').removeClass('hidden');
$('#line').removeClass('hidden');
$('form .line-no-exist').addClass('hidden');
$('#line_chosen').removeClass('hidden');
$line.removeAttr('disabled');
}
}

View File

@@ -87,6 +87,7 @@ $lang->product->programChangeTip = "The projects linked with this {$lang->pr
$lang->product->notChangeProgramTip = "The {$lang->SRCommon} of {$lang->productCommon} has been linked to the following projects, please cancel the link before proceeding";
$lang->product->confirmChangeProgram = "The projects linked with this {$lang->productCommon}: %s is also linked with other products, whether to transfer projects to the modified program set.";
$lang->product->changeProgramError = "The {$lang->SRCommon} of this {$lang->productCommon} has been linked to the project, please unlink it before proceeding";
$lang->product->programEmpty = 'Program should not be empty!';
$lang->product->id = 'ID';
$lang->product->program = "Program";

View File

@@ -24,7 +24,7 @@ $lang->product->mine = '我负责';
$lang->product->other = '其他';
$lang->product->closed = '已关闭';
$lang->product->updateOrder = '排序';
$lang->product->all = "{$lang->productCommon}列表";
$lang->product->all = "所有{$lang->productCommon}";
$lang->product->manageLine = "维护{$lang->productCommon}线";
$lang->product->newLine = "新建{$lang->productCommon}线";
$lang->product->export = '导出数据';
@@ -87,6 +87,7 @@ $lang->product->programChangeTip = "如下项目只关联了该{$lang->produ
$lang->product->notChangeProgramTip = "{$lang->productCommon}{$lang->SRCommon}已经关联到如下项目,请取消关联后再操作";
$lang->product->confirmChangeProgram = "如下项目既关联了该{$lang->productCommon}又关联了其他{$lang->productCommon},请确认是否继续关联该{$lang->productCommon},勾选后将取消与其他{$lang->productCommon}的关联关系,同时转移至新项目集下。";
$lang->product->changeProgramError = "{$lang->productCommon}{$lang->SRCommon}已经关联到项目,请取消关联后再操作";
$lang->product->programEmpty = '项目集不能为空';
$lang->product->id = '编号';
$lang->product->program = "所属项目集";

View File

@@ -810,7 +810,13 @@ class productModel extends model
$maxOrder = $maxOrder ? $maxOrder : 0;
foreach($data->modules as $id => $name)
{
if(!$name) continue;
if(empty($name)) continue;
if($this->config->systemMode == 'new' and empty($data->programs[$id]))
{
dao::$errors[] = $this->lang->product->programEmpty;
return false;
}
$line->name = strip_tags(trim($name));
$line->root = $data->programs[$id];

View File

@@ -132,7 +132,7 @@ $projectIDParam = $isProjectStory ? "projectID=$projectID&" : '';
<div class="btn-toolbar pull-right">
<?php if($this->app->rawModule != 'projectstory') common::printIcon('story', 'report', "productID=$productID&branchID=$branch&storyType=$storyType&browseType=$browseType&moduleID=$moduleID&chartType=pie", '', 'button', 'bar-chart muted'); ?>
<div class="btn-group">
<button class="btn btn-link" data-toggle="dropdown"><i class="icon icon-export muted"></i> <span class="text"><?php echo $lang->export ?></span> <span class="caret"></span></button>
<button class="btn pull-right btn-link" data-toggle="dropdown"><i class="icon icon-export muted"></i> <span class="text"><?php echo $lang->export ?></span> <span class="caret"></span></button>
<ul class="dropdown-menu" id='exportActionMenu'>
<?php
$tab = $isProjectStory ? 'project' : 'product';

View File

@@ -34,7 +34,7 @@
<?php if($config->systemMode == 'classic' or $programID):?>
<td>
<div class='input-group'>
<?php echo html::select("line", $lines, '', "class='form-control hidden line-exist'");?>
<?php echo html::select("line", $lines, '', "class='form-control hidden line-exist chosen'");?>
<?php echo html::input("lineName", '', "class='form-control line-no-exist'");?>
<?php if(count($lines)):?>
<span class='input-group-addon'>
@@ -56,23 +56,23 @@
</tr>
<tr>
<th><?php echo $lang->product->code;?></th>
<td><?php echo html::input('code', '', "class='form-control' required");?></td><td></td>
<td><?php echo html::input('code', '', "class='form-control' required");?></td>
</tr>
<tr>
<th><?php echo $lang->product->PO;?></th>
<td><?php echo html::select('PO', $poUsers, $this->app->user->account, "class='form-control chosen'");?></td><td></td>
<td><?php echo html::select('PO', $poUsers, $this->app->user->account, "class='form-control chosen'");?></td>
</tr>
<tr>
<th><?php echo $lang->product->QD;?></th>
<td><?php echo html::select('QD', $qdUsers, '', "class='form-control chosen'");?></td><td></td>
<td><?php echo html::select('QD', $qdUsers, '', "class='form-control chosen'");?></td>
</tr>
<tr>
<th><?php echo $lang->product->RD;?></th>
<td><?php echo html::select('RD', $rdUsers, '', "class='form-control chosen'");?></td><td></td>
<td><?php echo html::select('RD', $rdUsers, '', "class='form-control chosen'");?></td>
</tr>
<tr>
<th><?php echo $lang->product->reviewer;?></th>
<td><?php echo html::select('reviewer[]', $users, '', "class='form-control chosen' multiple");?></td><td></td>
<td><?php echo html::select('reviewer[]', $users, '', "class='form-control chosen' multiple");?></td>
</tr>
<tr>
<th><?php echo $lang->product->type;?></th>

View File

@@ -32,9 +32,11 @@
<thead>
<tr>
<th class='c-id'><?php echo $lang->idAB;?></th>
<th><?php echo $lang->project->name;?></th>
<?php if($config->systemMode == 'new'):?>
<th class='c-program'><?php echo $lang->program->common;?></th>
<th><?php echo $lang->project->name;?></th>
<?php else:?>
<th><?php echo $lang->execution->name;?></th>
<?php endif;?>
<th class='c-user text-left'><?php echo $lang->project->PM;?></th>
<th class='c-date'><?php echo $lang->project->begin;?></th>
@@ -51,6 +53,9 @@
<?php foreach($projectStats as $project):?>
<tr>
<td><?php printf('%03d', $project->id);?></td>
<?php if($config->systemMode == 'new'):?>
<td title='<?php echo $project->programName;?>' class='text-ellipsis'><?php echo $project->programName;?></td>
<?php endif;?>
<td class='text-left'>
<?php
if($config->systemMode == 'new')
@@ -63,9 +68,6 @@
}
?>
</td>
<?php if($config->systemMode == 'new'):?>
<td title='<?php echo $project->programName;?>' class='text-ellipsis'><?php echo $project->programName;?></td>
<?php endif;?>
<td class='padding-right'>
<?php $userID = isset($PMList[$project->PM]) ? $PMList[$project->PM]->id : ''?>
<?php if(!empty($project->PM)) echo html::a($this->createLink('user', 'profile', "userID=$userID", '', true), zget($users, $project->PM), '', "data-toggle='modal' data-type='iframe' data-width='800'");?>

View File

@@ -18,5 +18,5 @@ td.c-branch {overflow: hidden; text-align: left !important; text-overflow: ellip
.c-title {width: 160px;}
.c-branch {width: 100px;}
.c-story {width: 80px;}
.c-execution {width: 70px;}
.c-execution {width: 120px;}
.c-bug, .c-hour {width: 60px;}

View File

@@ -8,6 +8,7 @@ $(document).on('click', '.task-toggle', function(e)
e.stopPropagation();
e.preventDefault();
});
$(function()
{
$('#productplanList tbody tr').each(function()
@@ -24,10 +25,19 @@ $(function()
{
var projectID = $('#project').val();
var planID = $('#planID').val();
$.apps.open(createLink('execution', 'create', 'projectID=' + projectID + '&executionID=&copyExecutionID=&planID=' + planID + '&confirm=&productID=' + productID), 'project')
if(!projectID)
{
alert(projectNotEmpty);
return false;
}
else
{
$.apps.open(createLink('execution', 'create', 'projectID=' + projectID + '&executionID=&copyExecutionID=&planID=' + planID + '&confirm=&productID=' + productID), 'project')
}
$('#projects').modal('hide');
});
});
$(document).on('click', 'td.content .more', function(e)
{
var $toggle = $(this);

View File

@@ -41,7 +41,6 @@ function computeEndDate(delta)
$('#begin').on('change', function()
{
$("#end").val('');
$("input:radio[name='delta']").attr("checked",false);
});
@@ -54,13 +53,13 @@ $('#future').on('change', function()
{
if($(this).prop('checked'))
{
$('#begin').val('').attr('disabled', 'disabled');
$('#end').val('').parents('tr').hide();
$('#begin').attr('disabled', 'disabled');
$('#end').attr('disabled', 'disabled').parents('tr').hide();
}
else
{
$('#begin').removeAttr('disabled');
$('#end').val('').parents('tr').show();
$('#end').removeAttr('disabled').parents('tr').show();
}
});

View File

@@ -43,11 +43,14 @@ $('#future').on('change', function()
{
if($(this).prop('checked'))
{
$('#begin').val('').attr('disabled', 'disabled');
$('#begin').attr('disabled', 'disabled');
$('#end').val('').parents('tr').hide();
}
else
{
var begin = $('#begin').val();
if(begin == '') $('#begin').val(today);
$('#begin').removeAttr('disabled');
$('#end').parents('tr').show();
}

View File

@@ -32,7 +32,7 @@ $lang->productplan->linkedStories = 'Linked Stories';
$lang->productplan->unlinkedStories = 'Unlinked Stories';
$lang->productplan->updateOrder = 'Order';
$lang->productplan->createChildren = "Create Child Plans";
$lang->productplan->createExecution = "Create {$lang->executionCommon}";
$lang->productplan->createExecution = "Create {$lang->execution->common}";
$lang->productplan->linkBug = "Link Bug";
$lang->productplan->unlinkBug = "Unlink Bug";
@@ -48,6 +48,7 @@ $lang->productplan->confirmUnlinkBug = "Do you want to unlink this bug?";
$lang->productplan->noPlan = 'No plans yet. ';
$lang->productplan->cannotDeleteParent = 'Cannot delete parent plan';
$lang->productplan->selectProjects = "Please select the project";
$lang->productplan->projectNotEmpty = 'Project cannot be empty.';
$lang->productplan->nextStep = "Next step";
$lang->productplan->id = 'ID';
@@ -62,7 +63,7 @@ $lang->productplan->future = 'TBD';
$lang->productplan->stories = 'Story';
$lang->productplan->bugs = 'Bug';
$lang->productplan->hour = $lang->hourCommon;
$lang->productplan->execution = $lang->executionCommon;
$lang->productplan->execution = $lang->execution->common;
$lang->productplan->parent = "Parent Plan";
$lang->productplan->parentAB = "Parent";
$lang->productplan->children = "Child Plan";

View File

@@ -32,7 +32,7 @@ $lang->productplan->linkedStories = $lang->SRCommon;
$lang->productplan->unlinkedStories = "未关联{$lang->SRCommon}";
$lang->productplan->updateOrder = '排序';
$lang->productplan->createChildren = "创建子计划";
$lang->productplan->createExecution = "创建{$lang->executionCommon}";
$lang->productplan->createExecution = "创建{$lang->execution->common}";
$lang->productplan->linkBug = "关联Bug";
$lang->productplan->unlinkBug = "移除Bug";
@@ -48,6 +48,7 @@ $lang->productplan->confirmUnlinkBug = "您确认移除该Bug吗";
$lang->productplan->noPlan = "暂时没有计划。";
$lang->productplan->cannotDeleteParent = "不能删除父计划";
$lang->productplan->selectProjects = "请选择所属项目";
$lang->productplan->projectNotEmpty = '所属项目不能为空。';
$lang->productplan->nextStep = "下一步";
$lang->productplan->id = '编号';
@@ -62,7 +63,7 @@ $lang->productplan->future = '待定';
$lang->productplan->stories = "{$lang->SRCommon}";
$lang->productplan->bugs = 'Bug数';
$lang->productplan->hour = $lang->hourCommon;
$lang->productplan->execution = $lang->executionCommon;
$lang->productplan->execution = $lang->execution->common;
$lang->productplan->parent = "父计划";
$lang->productplan->parentAB = "";
$lang->productplan->children = "子计划";

View File

@@ -382,6 +382,18 @@ class productplanModel extends model
->setIF($this->post->future || empty($_POST['end']), 'end', '2030-01-01')
->remove('delta,uid,future')
->get();
if(!empty($plan->parentBegin))
{
if($plan->begin < $plan->parentBegin) dao::$errors['begin'] = sprintf($this->lang->productplan->beginLetterParent, $plan->parentBegin);
}
if(!empty($plan->parentEnd))
{
if($plan->end !=='2030-01-01' and $plan->end > $plan->parentEnd) dao::$errors['end'] = sprintf($this->lang->productplan->endGreaterParent, $plan->parentEnd);
}
unset($plan->parentBegin);
unset($plan->parentEnd);
if(!$this->post->future and strpos($this->config->productplan->create->requiredFields, 'begin') !== false and empty($_POST['begin']))
{
dao::$errors['begin'] = sprintf($this->lang->error->notempty, $this->lang->productplan->begin);

View File

@@ -203,4 +203,5 @@
</div>
</div>
</div>
<?php js::set('projectNotEmpty', $lang->productplan->projectNotEmpty)?>
<?php include '../../common/view/footer.html.php';?>

View File

@@ -27,7 +27,10 @@
<?php if($parent):?>
<tr>
<th><?php echo $lang->productplan->parent;?></th>
<td class='muted'><?php echo $parentPlan->title;?></td><td></td><td></td>
<td class='muted'><?php echo $parentPlan->title;?>
<?php echo html::hidden('parentBegin', $parentPlan->begin);?>
<?php echo html::hidden('parentEnd', $parentPlan->end);?>
</td><td></td><td></td>
</tr>
<?php else:?>
<tr>
@@ -50,7 +53,7 @@
<th><?php echo $lang->productplan->begin;?></th>
<td><?php echo html::input('begin', formatTime($begin), "class='form-control form-date'");?></td>
<td>
<div class='checkbox-primary'>
<div class='checkbox-primary'>
<input type='checkbox' id='future' name='future' value='1' />
<label for='future'><?php echo $lang->productplan->future;?></label>
</div>

View File

@@ -14,6 +14,7 @@
<?php include '../../common/view/kindeditor.html.php';?>
<?php js::set('weekend', $config->execution->weekend);?>
<?php js::import($jsRoot . 'misc/date.js');?>
<?php js::set('today', helper::today());?>
<div id='mainContent' class='main-content'>
<div class='center-block'>
<div class='main-header'>

View File

@@ -85,7 +85,7 @@
</tr>
<tr>
<th><?php echo $lang->project->realBegan;?></th>
<td><?php echo html::input('realBegan', $program->realBegan, "class='form-control form-date'");?></td><td></td><td></td>
<td><?php echo html::input('realBegan', helper::isZeroDate($program->realBegan) ? '' : $program->realBegan, "class='form-control form-date'");?></td>
</tr>
<tr>
<th><?php echo $lang->program->desc;?></th>

View File

@@ -172,7 +172,7 @@ $lang->project->laneColorList = array('#32C5FF', '#006AF1', '#9D28B2', '#FF8F26'
$lang->project->productNotEmpty = 'Please link products or create products.';
$lang->project->existProductName = 'Product name already exists.';
$lang->project->changeProgram = '%s > Change project';
$lang->project->changeProgramTip = 'After modifying the project set, the products linked with the project will also modify the project set to which it belongs. Please confirm whether to modify it.';
$lang->project->changeProgramTip = 'Once the program is edited, the product that is linked to this program will be changed. Do you want to edit it?';
$lang->project->linkedProjectsTip = 'Linked projects are as follows';
$lang->project->multiLinkedProductsTip = 'The following products linked to this project are also linked to other projects, please unlink before proceeding.';
$lang->project->linkStoryByPlanTips = "This action will associate all {$lang->SRCommon} under the selected plan to this project";

View File

@@ -172,7 +172,7 @@ $lang->project->laneColorList = array('#32C5FF', '#006AF1', '#9D28B2', '#FF8F26'
$lang->project->productNotEmpty = '请关联产品或创建产品。';
$lang->project->existProductName = '产品名称已存在。';
$lang->project->changeProgram = '%s > 修改项目集';
$lang->project->changeProgramTip = '修改项目集后,该项目关联产品也会同时修改所属项目集,请确认是否修改。';
$lang->project->changeProgramTip = '修改项目集后,该项目关联产品的项目集也会被修改,请确认是否修改。';
$lang->project->linkedProjectsTip = '关联的项目如下';
$lang->project->multiLinkedProductsTip = '该项目关联的如下产品还关联了其他项目,请取消关联后再操作';
$lang->project->linkStoryByPlanTips = "此操作会将所选计划下面的{$lang->SRCommon}全部关联到此项目中";

View File

@@ -84,6 +84,7 @@ $lang->testreport->noTestTask = "No test requests for this {$lang->productCo
$lang->testreport->noObjectID = "No test request or {$lang->executionCommon} is selected, so no report can be generated.";
$lang->testreport->moreProduct = "Testing reports can only be generated for the same {$lang->productCommon}.";
$lang->testreport->hiddenCase = "Hide %s use cases";
$lang->testreport->goalTip = "Descriptive information about the {$lang->execution->common} of this build";
$lang->testreport->bugSummary = <<<EOD
Total <strong>%s</strong> Bugs reported <a data-toggle='tooltip' class='text-warning' title='{$lang->testreport->foundBugTip}'><i class='icon-help'></i></a>,

View File

@@ -84,6 +84,7 @@ $lang->testreport->noTestTask = "该{$lang->productCommon}下还没有关联
$lang->testreport->noObjectID = "没有选定测试单或{$lang->executionCommon},无法创建测试报告!";
$lang->testreport->moreProduct = "只能对同一个{$lang->productCommon}生成测试报告。";
$lang->testreport->hiddenCase = "隐藏 %s 个用例";
$lang->testreport->goalTip = "该版本所属{$lang->execution->common}的描述信息";
$lang->testreport->bugSummary = <<<EOD
共发现<strong>%s</strong>个Bug <a data-toggle='tooltip' class='text-warning' title='{$lang->testreport->foundBugTip}'><i class='icon-help'></i></a>

View File

@@ -67,11 +67,16 @@
<td colspan='2'><?php echo html::input('title', $reportTitle, "class='form-control'")?></td>
<td></td>
</tr>
<?php if(!empty($execution->desc)):?>
<tr>
<th><?php echo $lang->testreport->goal?></th>
<td colspan='2'><?php echo isset($execution->desc) ? $execution->desc : '';?></td>
<td colspan='2'>
<?php echo $execution->desc;?>
<a data-toggle='tooltip' class='text-warning' title='<?php echo $lang->testreport->goalTip;?>'><i class='icon-help'></i></a>
</td>
<td></td>
</tr>
<?php endif;?>
<tr>
<th><?php echo $lang->testreport->profile?></th>
<td colspan='2'>

View File

@@ -55,11 +55,16 @@
<td colspan='2'><?php echo html::input('title', $report->title, "class='form-control'")?></td>
<td></td>
</tr>
<?php if(!empty($execution->desc)):?>
<tr>
<th><?php echo $lang->testreport->goal?></th>
<td colspan='2'><?php echo $execution->desc?></td>
<td colspan='2'>
<?php echo $execution->desc?>
<a data-toggle='tooltip' class='text-warning' title='<?php echo $lang->testreport->goalTip;?>'><i class='icon-help'></i></a>
</td>
<td></td>
</tr>
<?php endif;?>
<tr>
<th><?php echo $lang->testreport->profile?></th>
<td colspan='2'>

View File

@@ -63,10 +63,13 @@
<th><?php echo $lang->testreport->members?></th>
<td colspan='2'><?php foreach(explode(',', $report->members) as $member)echo zget($users, $member) . ' &nbsp; ';?></td>
</tr>
<?php if(!empty($execution)):?>
<?php if(!empty($execution->desc)):?>
<tr>
<th><?php echo $lang->testreport->goal?></th>
<td colspan='2'><?php echo $execution->desc?></td>
<td colspan='2'>
<?php echo $execution->desc?>
<a data-toggle='tooltip' class='text-warning' title='<?php echo $lang->testreport->goalTip;?>'><i class='icon-help'></i></a>
</td>
</tr>
<?php endif;?>
<tr>

View File

@@ -515,7 +515,8 @@ class todoModel extends model
$stmt = $this->dao->select('*')->from(TABLE_TODO)
->where('deleted')->eq('0')
->andWhere('assignedTo', true)->eq($account)
->beginIF($type == 'assignedtoother')->andWhere('account', true)->eq($account)->fi()
->beginIF($type != 'assignedtoother')->andWhere('assignedTo', true)->eq($account)->fi()
->orWhere('finishedBy')->eq($account)
->markRight(1)
->beginIF($begin)->andWhere('date')->ge($begin)->fi()