Merge branch 'release/zentaopms_18.3' of https://gitlab.zcorp.cc/easycorp/zentaopms into release/zentaopms_18.3

This commit is contained in:
caoyanyi
2023-03-31 10:41:51 +08:00
6 changed files with 26 additions and 27 deletions
+11 -4
View File
@@ -446,8 +446,6 @@ class api extends control
*/
public function editLib($id)
{
$lib = $this->doc->getLibById($id);
if(!empty($_POST))
{
$this->doc->updateApiLib($id);
@@ -457,9 +455,18 @@ class api extends control
return $this->sendSuccess(array('message' => $this->lang->saveSuccess, 'closeModal' => true, 'callback' => "redirectParentWindow($id)"));
}
$lib = $this->doc->getLibById($id);
$type = 'nolink';
if(!empty($lib->product)) $type = 'product';
if(!empty($lib->project)) $type = 'project';
if(!empty($lib->product))
{
$type = 'product';
$this->view->object = $this->loadModel('product')->getByID($lib->product);
}
if(!empty($lib->project))
{
$type = 'project';
$this->view->object = $this->loadModel('project')->getById($lib->project);
}
if($type != 'nolink') $this->lang->api->aclList['default'] = sprintf($this->lang->doclib->aclList['default'], $this->lang->{$type}->common);
if($type == 'nolink') unset($this->lang->api->aclList['default']);
+3
View File
@@ -54,6 +54,9 @@ function toggleLibType(libType)
}
else
{
var acl = $("input[name='acl']:checked").val();
if(acl == 'default') $("input[id='aclopen']").prop('checked', true);
$('#projectBox').addClass('hidden');
$('#productBox').addClass('hidden');
$('#acldefault').closest('.radio').hide();
+7 -19
View File
@@ -1,12 +1,12 @@
<?php
/**
* The createlib view of doc module of ZenTaoPMS.
* The createlib view of api module of ZenTaoPMS.
*
* @copyright Copyright 2009-2015 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.cnezsoft.com)
* @license ZPL(http://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
* @author Jia Fu <fujia@cnezsoft.com>
* @package doc
* @version $Id: createlib.html.php 975 2010-07-29 03:30:25Z jajacn@126.com $
* @package api
* @version $Id: editlib.html.php 975 2010-07-29 03:30:25Z jajacn@126.com $
* @link http://www.zentao.net
*/
?>
@@ -22,24 +22,12 @@
</div>
<form class='load-indicator main-form form-ajax' id="apiForm" method='post' enctype='multipart/form-data'>
<table class='table table-form'>
<?php if(in_array($type, array('product', 'project'))):?>
<tr>
<th><?php echo $lang->api->libType;?></th>
<td>
<span><?php echo html::radio('libType', $lang->api->libTypeList, $type, "onchange='toggleLibType(this.value)'")?></span>
</td>
</tr>
<tr id='productBox' class='<?php echo $type != 'product' ? 'hidden' : '';?>'>
<th><?php echo $lang->api->product;?></th>
<td>
<span><?php echo html::select('product', $products, $lib->product, "class='form-control chosen'")?></span>
</td>
</tr>
<tr id='projectBox' class='<?php echo $type != 'project' ? 'hidden' : '';?>'>
<th><?php echo $lang->api->project;?></th>
<td>
<span><?php echo html::select('project', $projects, $lib->project, "class='form-control chosen'")?></span>
</td>
<th class='w-130px'><?php echo $lang->api->{$type};?></th>
<td><?php echo $object->name?></td>
</tr>
<?php endif;?>
<tr>
<th><?php echo $lang->api->name?></th>
<td style="width: 80%"><?php echo html::input('name', $lib->name, "class='form-control'");?></td>