* Refactor edit doc lib page.

This commit is contained in:
tianshujie
2023-07-18 15:37:26 +08:00
parent 22148a2687
commit 47dd4370e6
5 changed files with 109 additions and 2 deletions
+2 -1
View File
@@ -262,7 +262,8 @@ class doc extends control
$response['message'] = $this->lang->saveSuccess;
$response['result'] = 'success';
$response['locate'] = 'parent';
$response['closeModal'] = true;
$response['load'] = true;
return $this->send($response);
}
+1
View File
@@ -0,0 +1 @@
.items-center {align-items: center !important;}
+1 -1
View File
@@ -33,7 +33,7 @@ function toggleAcl(type)
let link = $.createLink('doc', 'ajaxGetWhitelist', 'doclibID=' + doclibID + '&acl=' + acl);
$.get(link, function(users)
{
if(users)
if(users != 'private' && users)
{
users = JSON.parse(users);
const $usersPicker = $('select[name^=users]').zui('picker');
+4
View File
@@ -0,0 +1,4 @@
$(function()
{
toggleAcl('lib');
})
+101
View File
@@ -0,0 +1,101 @@
<?php
declare(strict_types=1);
/**
* The editLib view file of doc module of ZenTaoPMS.
* @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
* @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
* @author Shujie Tian<tianshujie@easycorp.ltd>
* @package doc
* @link https://www.zentao.net
*/
namespace zin;
jsVar('doclibID', $lib->id);
jsVar('libType', $lib->type);
modalHeader
(
set::title($lang->doc->editLib),
set::entityID($lib->id),
set::entityText($lib->name),
);
formPanel
(
in_array($lib->type, array('product', 'project', 'execution')) ? formGroup
(
setClass('items-center'),
set::label($lang->doc->{$lib->type}),
$object->name
) : null,
formGroup
(
set::label($lang->doc->libName),
set::name('name'),
set::value($lib->name),
radioList
(
setClass('hidden'),
set::name('acl'),
set::items($lang->doc->libTypeList),
set::value($lib->type),
),
),
formRow
(
setID('aclBox'),
formGroup
(
set::label($lang->doclib->control),
radioList
(
set::name('acl'),
set::items($lib->type == 'api' ? $lang->api->aclList : $lang->doclib->aclList),
set::value(empty($lib->main) ? $lib->acl : 'default'),
on::change("toggleAcl('lib')"),
),
)
),
formRow
(
setID('whiteListBox'),
setClass('hidden'),
formGroup
(
set::label($lang->doc->whiteList),
div
(
setClass('w-full check-list'),
div
(
inputGroup
(
$lang->doclib->group,
picker
(
set::name('groups[]'),
set::items($groups),
set::value($lib->groups),
set::multiple(true),
)
)
),
div
(
inputGroup
(
$lang->doclib->user,
picker
(
set::name('users[]'),
set::items($users),
set::value($lib->users),
set::multiple(true),
)
)
)
)
)
),
);
/* ====== Render page ====== */
render();