This commit is contained in:
wangyidong
2022-04-27 13:41:02 +08:00
15 changed files with 107 additions and 28 deletions
+1
View File
@@ -319,6 +319,7 @@ class api extends control
/* Record action for create api library. */
$this->action->create('docLib', $libID, 'Created');
if(!helper::isAjaxRequest()) return print(js::locate($this->createLink('api', 'index', "libID=$libID"), 'parent.parent'));
return $this->sendSuccess(array('locate' => $this->createLink('api', 'index', "libID=$libID")));
}
+14 -1
View File
@@ -94,10 +94,22 @@
color: #a41e22;
}
.detail .list-group-item a {
display: flex;
align-items: center;
}
.detail .list-group-item .path, .detail .list-group-item .desc {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.detail .list-group-item .path {
padding-left: 10px;
font-size: 14px;
color: black
color: black;
flex: 1;
}
.detail .list-group-item .desc {
width: auto;
@@ -105,6 +117,7 @@
line-height: 38px;
float: right;
padding-right: 10px;
max-width: 200px;
}
.detail .list-group-item {list-style: none; font-size: 14px; margin-bottom: 10px; line-height: 30px}
.detail .list-group-item span {line-height: 30px; width: 65px;}
-3
View File
@@ -199,9 +199,6 @@ $lang->api->structParamsOptons = array_merge($lang->api->paramsTypeOptions, ar
$lang->api->allParamsTypeOptions = array_merge($lang->api->paramsTypeOptions, $lang->api->paramsTypeCustomOptions);
$lang->api->requiredOptions = array(0 => 'No', 1 => 'Yes');
$lang->doclib = new stdclass();
$lang->doclib->name = 'API Library Name';
$lang->apistruct = new stdClass();
$lang->apistruct->name = 'Name';
-3
View File
@@ -199,9 +199,6 @@ $lang->api->structParamsOptons = array_merge($lang->api->paramsTypeOptions, ar
$lang->api->allParamsTypeOptions = array_merge($lang->api->paramsTypeOptions, $lang->api->paramsTypeCustomOptions);
$lang->api->requiredOptions = array(0 => '否', 1 => '是');
$lang->doclib = new stdclass();
$lang->doclib->name = '接口库名称';
$lang->apistruct = new stdClass();
$lang->apistruct->name = '结构名';
-3
View File
@@ -199,9 +199,6 @@ $lang->api->structParamsOptons = array_merge($lang->api->paramsTypeOptions, ar
$lang->api->allParamsTypeOptions = array_merge($lang->api->paramsTypeOptions, $lang->api->paramsTypeCustomOptions);
$lang->api->requiredOptions = array(0 => '否', 1 => '是');
$lang->doclib = new stdclass();
$lang->doclib->name = '介面庫名稱';
$lang->apistruct = new stdClass();
$lang->apistruct->name = '結構名';
-12
View File
@@ -65,17 +65,5 @@
</div>
</div>
</div>
<div class='hidden'>
<table>
<tr id='aclBoxA'>
<th><?php echo $lang->api->control;?></th>
<td><?php echo html::radio('acl', $lang->api->aclListA, 'default', "onchange='toggleAcl(this.value, \"lib\")'")?></td>
</tr>
<tr id='aclBoxB'>
<th><?php echo $lang->api->control;?></th>
<td><?php echo html::radio('acl', $lang->api->aclListB, 'open', "onchange='toggleAcl(this.value, \"lib\")'")?></td>
</tr>
</table>
</div>
<?php js::set('noticeAcl', $lang->api->noticeAcl);?>
<?php include '../../common/view/footer.lite.html.php';?>
+2
View File
@@ -171,6 +171,8 @@ class doc extends control
if(empty($projects)) unset($libTypeList['project']);
if(empty($executions)) unset($libTypeList['execution']);
$this->app->loadLang('api');
$this->view->groups = $this->loadModel('group')->getPairs();
$this->view->users = $this->user->getPairs('nocode|noclosed');
$this->view->products = $products;
+1 -1
View File
@@ -42,7 +42,7 @@ function toggleAcl(acl, type)
var notice = typeof(noticeAcl[libType][acl]) != 'undefined' ? noticeAcl[libType][acl] : '';
$('#noticeAcl').html(notice);
if(libType == 'custom' && acl == 'private') $('#whiteListBox').addClass('hidden');
if((libType == 'custom' || libType == 'api') && acl == 'private') $('#whiteListBox').addClass('hidden');
if(libType == 'project' && typeof(doclibID) != 'undefined')
{
+53
View File
@@ -29,6 +29,14 @@ function changeByLibType(libType)
$('table tr.execution').addClass('hidden');
$('#execution').attr('disabled', true);
$('.normalLib').removeClass('hidden');
$('.normalLib input').attr('disabled', false);
$('table tr.apilib').addClass('hidden');
$('.apilib input, #desc, #baseUrl').attr('disabled', true);
$('form').removeAttr('action');
changeDoclibAcl(libType);
}
else if(libType == 'project')
@@ -42,6 +50,14 @@ function changeByLibType(libType)
$('table tr.execution').addClass('hidden');
$('#execution').attr('disabled', true);
$('.normalLib').removeClass('hidden');
$('.normalLib input').attr('disabled', false);
$('table tr.apilib').addClass('hidden');
$('.apilib input, #desc, #baseUrl').attr('disabled', true);
$('form').removeAttr('action');
changeDoclibAcl(libType);
}
else if(libType == 'execution')
@@ -55,6 +71,35 @@ function changeByLibType(libType)
$('table tr.project').addClass('hidden');
$('#project').attr('disabled', true);
$('.normalLib').removeClass('hidden');
$('.normalLib input').attr('disabled', false);
$('table tr.apilib').addClass('hidden');
$('.apilib input, #desc, #baseUrl').attr('disabled', true);
$('form').removeAttr('action');
changeDoclibAcl(libType);
}
else if(libType == 'api')
{
$('table tr.product').addClass('hidden');
$('#product').attr('disabled', true);
$('table tr.project').addClass('hidden');
$('#project').attr('disabled', true);
$('table tr.execution').addClass('hidden');
$('#execution').attr('disabled', true);
$('.normalLib').addClass('hidden');
$('.normalLib input').attr('disabled', true);
$('table tr.apilib').removeClass('hidden');
$('.apilib input, #desc, #baseUrl').attr('disabled', false);
$('form').attr('action', createLink('api', 'createLib'));
changeDoclibAcl(libType);
}
else
@@ -68,6 +113,14 @@ function changeByLibType(libType)
$('table tr.execution').addClass('hidden');
$('#execution').attr('disabled', true);
$('.normalLib').removeClass('hidden');
$('.normalLib input').attr('disabled', false);
$('table tr.apilib').addClass('hidden');
$('.apilib input, #desc, #baseUrl').attr('disabled', true);
$('form').removeAttr('action');
changeDoclibAcl(libType);
}
+4
View File
@@ -158,6 +158,7 @@ $lang->doc->allExecutions = 'All' . $lang->executionCommon . 's';
$lang->doc->libTypeList['product'] = $lang->productCommon . ' Library';
if($config->systemMode == 'new') $lang->doc->libTypeList['project'] = 'Project Library';
$lang->doc->libTypeList['execution'] = $lang->execution->common . ' Library';
$lang->doc->libTypeList['api'] = 'API Library';
$lang->doc->libTypeList['custom'] = 'Custom Library';
$lang->doc->libGlobalList['api'] = 'Api Libray';
@@ -248,6 +249,9 @@ $lang->doc->noticeAcl['lib']['project']['private'] = 'Users who can access the
$lang->doc->noticeAcl['lib']['project']['custom'] = 'Users in the whiltelist can access it.';
$lang->doc->noticeAcl['lib']['execution']['default'] = "Users who can access the selected {$lang->executionCommon} can access it.";
$lang->doc->noticeAcl['lib']['execution']['custom'] = "Users who can access the selected {$lang->executionCommon} or users in the whiltelist can access it.";
$lang->doc->noticeAcl['lib']['api']['open'] = 'All users can access it.';
$lang->doc->noticeAcl['lib']['api']['custom'] = 'Users in the whitelist can access it.';
$lang->doc->noticeAcl['lib']['api']['private'] = 'Only the one who created it can access it.';
$lang->doc->noticeAcl['lib']['custom']['open'] = 'All users can access it.';
$lang->doc->noticeAcl['lib']['custom']['custom'] = 'Users in the whitelist can access it.';
$lang->doc->noticeAcl['lib']['custom']['private'] = 'Only the one who created it can access it.';
+5
View File
@@ -21,6 +21,7 @@ $lang->doclib->execution = $lang->executionCommon . '库';
$lang->doclib->product = $lang->productCommon . '库';
$lang->doclib->apiLibName = '接口库名称';
$lang->doclib->aclListA = array();
$lang->doclib->aclListA['default'] = '默认';
$lang->doclib->aclListA['custom'] = '自定义';
@@ -158,6 +159,7 @@ $lang->doc->allExecutions = '所有' . $lang->executionCommon;
$lang->doc->libTypeList['product'] = $lang->productCommon . '文档库';
if($config->systemMode == 'new') $lang->doc->libTypeList['project'] = '项目文档库';
$lang->doc->libTypeList['execution'] = $lang->execution->common . '文档库';
$lang->doc->libTypeList['api'] = '接口库';
$lang->doc->libTypeList['custom'] = '自定义文档库';
$lang->doc->libGlobalList['api'] = '接口文档库';
@@ -248,6 +250,9 @@ $lang->doc->noticeAcl['lib']['project']['private'] = "有所选项目访问权
$lang->doc->noticeAcl['lib']['project']['custom'] = "白名单的用户可以访问。";
$lang->doc->noticeAcl['lib']['execution']['default'] = "有所选{$lang->executionCommon}访问权限的用户可以访问。";
$lang->doc->noticeAcl['lib']['execution']['custom'] = "有所选{$lang->executionCommon}访问权限或白名单里的用户可以访问。";
$lang->doc->noticeAcl['lib']['api']['open'] = '所有人都可以访问。';
$lang->doc->noticeAcl['lib']['api']['custom'] = '白名单的用户可以访问。';
$lang->doc->noticeAcl['lib']['api']['private'] = '只有创建者自己可以访问。';
$lang->doc->noticeAcl['lib']['custom']['open'] = '所有人都可以访问。';
$lang->doc->noticeAcl['lib']['custom']['custom'] = '白名单的用户可以访问。';
$lang->doc->noticeAcl['lib']['custom']['private'] = '只有创建者自己可以访问。';
+16 -2
View File
@@ -19,7 +19,7 @@
<div class='main-header'>
<h2><?php echo $lang->doc->createLib;?></h2>
</div>
<form method='post' target='hiddenwin' >
<form method='post' target='hiddenwin'>
<table class='table table-form'>
<tr>
<th class='w-110px'><?php echo $lang->doc->libType?></th>
@@ -45,10 +45,18 @@
<th><?php echo $lang->doc->execution?></th>
<td><?php echo html::select('execution', $executions, $type == 'execution' ? $objectID : '', "class='form-control chosen' data-drop_direction='down'")?></td>
</tr>
<tr>
<tr class="normalLib">
<th><?php echo $lang->doclib->name?></th>
<td><?php echo html::input('name', '', "class='form-control'")?></td>
</tr>
<tr class='apilib hidden'>
<th><?php echo $lang->api->name?></th>
<td><?php echo html::input('name', '', "class='form-control'")?></td>
</tr>
<tr class="apilib hidden">
<th><?php echo $lang->api->baseUrl?></th>
<td><?php echo html::input('baseUrl', '', "class='form-control' placeholder='" . $lang->api->baseUrlDesc . "'");?></td>
</tr>
<tr>
<th><?php echo $lang->doclib->control;?></th>
<td>
@@ -69,6 +77,12 @@
</div>
</td>
</tr>
<tr class="apilib hidden">
<th><?php echo $lang->api->desc;?></th>
<td>
<?php echo html::textarea('desc', '', "rows='8' class='form-control kindeditor' hidefocus='true' tabindex=''");?>
</td>
</tr>
<tr>
<td class='text-center form-actions' colspan='2'><?php echo html::submitButton();?></td>
</tr>
+10 -1
View File
@@ -1732,7 +1732,16 @@ class storyModel extends model
if($oldStory->branch) $story->plan = $planID;
/* Append the plan id to plan field if product is multi and story is all branch. */
if($this->session->currentProductType != 'normal' and empty($story->branch) and $planID != 0) $story->plan = $oldStory->plan ? $oldStory->plan . ",$planID" : ",$planID";
if($this->session->currentProductType != 'normal' and empty($story->branch) and $planID != 0)
{
$branchPlanPairs = $this->dao->select('branch, id as plan')->from(TABLE_PRODUCTPLAN)
->where('product')->eq($oldStory->product)
->andWhere('id')->in($oldStory->plan)
->fetchPairs();
if(isset($branchPlanPairs[$plan->branch])) $branchPlanPairs[$plan->branch] = $planID;
$story->plan = $oldStory->plan ? ',' . implode(',', $branchPlanPairs) : ",$planID";
}
/* Change stage. */
if($planID)
+1 -1
View File
@@ -78,7 +78,7 @@ $config->task->datatable->fieldList['status']['width'] = '60';
$config->task->datatable->fieldList['status']['required'] = 'no';
$config->task->datatable->fieldList['estimate']['title'] = 'estimateAB';
$config->task->datatable->fieldList['estimate']['fixed'] = 'right';
$config->task->datatable->fieldList['estimate']['fixed'] = 'no';
$config->task->datatable->fieldList['estimate']['width'] = '60';
$config->task->datatable->fieldList['estimate']['required'] = 'no';
-1
View File
@@ -41,4 +41,3 @@
.pri-selector > .btn {padding: 5px 8px !important; width: 100%;}
.pri-selector > .dropdown-menu {padding: 10px;}
.title-group .has-icon-right {min-width: 600px;}