* Add doc::edit view.
This commit is contained in:
@@ -123,6 +123,8 @@ else
|
||||
(
|
||||
set::name('content'),
|
||||
set::size('full'),
|
||||
set::resizable(false),
|
||||
set::placeholder($lang->noticePasteImg),
|
||||
),
|
||||
formHidden('status', 'normal'),
|
||||
formHidden('contentType', 'html'),
|
||||
@@ -131,6 +133,7 @@ else
|
||||
(
|
||||
modal
|
||||
(
|
||||
set::title($lang->doc->release . $lang->doc->common),
|
||||
set::id('modalBasicInfo'),
|
||||
on::change('#product', "loadObjectModules"),
|
||||
on::change('#project', "loadObjectModules"),
|
||||
|
||||
@@ -0,0 +1,184 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* The edit 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 Sun Guangming<sunguangming@easycorp.ltd>
|
||||
* @package doc
|
||||
* @link https://www.zentao.net
|
||||
*/
|
||||
namespace zin;
|
||||
|
||||
jsVar('titleNotEmpty', sprintf($lang->error->notempty, $lang->doc->title));
|
||||
jsVar('requiredFields', ',' . $config->doc->create->requiredFields . ',');
|
||||
jsVar('libNotEmpty', sprintf($lang->error->notempty, $lang->doc->lib));
|
||||
jsVar('keywordsNotEmpty', sprintf($lang->error->notempty, $lang->doc->keywords));
|
||||
jsVar('contentNotEmpty', sprintf($lang->error->notempty, $lang->doc->content));
|
||||
|
||||
form
|
||||
(
|
||||
set::actions(''),
|
||||
div
|
||||
(
|
||||
setClass('flex titleBox'),
|
||||
backBtn(setClass('btn secondary'), set::icon('back'), $lang->goback),
|
||||
formGroup
|
||||
(
|
||||
set::id('titleBox'),
|
||||
input
|
||||
(
|
||||
set::name('title'),
|
||||
set::value($doc->title),
|
||||
set::placeholder($lang->doc->titlePlaceholder),
|
||||
),
|
||||
),
|
||||
btn
|
||||
(
|
||||
set
|
||||
(
|
||||
array
|
||||
(
|
||||
'class' => 'btn primary',
|
||||
'id' => 'saveBtn',
|
||||
'text' => $lang->doc->release,
|
||||
'btnType' => 'submit',
|
||||
)
|
||||
)
|
||||
),
|
||||
btn
|
||||
(
|
||||
set
|
||||
(
|
||||
array
|
||||
(
|
||||
'class' => 'btn ghost',
|
||||
'icon' => 'cog-outline',
|
||||
'text' => $lang->settings,
|
||||
'data-toggle' => 'modal',
|
||||
'id' => 'basicInfoLink',
|
||||
'url' => '#modalBasicInfo'
|
||||
)
|
||||
)
|
||||
)
|
||||
),
|
||||
editor
|
||||
(
|
||||
set::name('content'),
|
||||
set::size('full'),
|
||||
set::resizable(false),
|
||||
html($doc->content)
|
||||
),
|
||||
formHidden('status', $doc->status),
|
||||
formHidden('contentType', $doc->contentType),
|
||||
formHidden('type', 'text'),
|
||||
modalTrigger
|
||||
(
|
||||
modal
|
||||
(
|
||||
set::title($lang->doc->edit),
|
||||
set::id('modalBasicInfo'),
|
||||
on::change('#product', "loadObjectModules"),
|
||||
on::change('#project', "loadObjectModules"),
|
||||
on::change('#execution', "loadObjectModules"),
|
||||
(strpos('product|project|execution', $type) !== false) ? formGroup
|
||||
(
|
||||
set::width('1/2'),
|
||||
set::label($lang->doc->{$type}),
|
||||
picker
|
||||
(
|
||||
set::name($type),
|
||||
set::id($type),
|
||||
set::items($objects),
|
||||
set::value($objectID)
|
||||
)
|
||||
) : null,
|
||||
formGroup
|
||||
(
|
||||
set::width('1/2'),
|
||||
set::label($lang->doc->lib),
|
||||
picker
|
||||
(
|
||||
set::name('module'),
|
||||
set::items($moduleOptionMenu),
|
||||
set::value($doc->lib . '_' . $doc->module)
|
||||
)
|
||||
),
|
||||
formGroup
|
||||
(
|
||||
set::label($lang->doc->keywords),
|
||||
input
|
||||
(
|
||||
set::name('keywords'),
|
||||
set::value($doc->keywords),
|
||||
)
|
||||
),
|
||||
formGroup
|
||||
(
|
||||
set::label($lang->doc->files),
|
||||
upload()
|
||||
),
|
||||
formGroup
|
||||
(
|
||||
set::label($lang->doc->mailto),
|
||||
picker
|
||||
(
|
||||
set::multiple(true),
|
||||
set::name('mailto[]'),
|
||||
set::items($users),
|
||||
set::value($doc->mailto),
|
||||
)
|
||||
),
|
||||
formGroup
|
||||
(
|
||||
set::label($lang->doclib->control),
|
||||
radioList
|
||||
(
|
||||
set::name('acl'),
|
||||
set::items($lang->doc->aclList),
|
||||
set::value($doc->acl),
|
||||
on::change('toggleWhiteList')
|
||||
)
|
||||
),
|
||||
formGroup
|
||||
(
|
||||
$doc->acl == 'open' ? setClass('hidden') : null,
|
||||
set::label($lang->doc->whiteList),
|
||||
set::id('whitelistBox'),
|
||||
picker
|
||||
(
|
||||
set::name('groups[]'),
|
||||
set::items($groups),
|
||||
set::multiple(true),
|
||||
set::value($doc->groups),
|
||||
),
|
||||
picker
|
||||
(
|
||||
set::name('users[]'),
|
||||
set::items($users),
|
||||
set::multiple(true),
|
||||
set::value($doc->users),
|
||||
)
|
||||
),
|
||||
formRow
|
||||
(
|
||||
div
|
||||
(
|
||||
setClass('form-actions form-group no-label'),
|
||||
btn
|
||||
(
|
||||
set
|
||||
(
|
||||
array
|
||||
(
|
||||
'class' => 'btn primary',
|
||||
'btnType' => 'submit',
|
||||
)
|
||||
),
|
||||
$lang->doc->release
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
Reference in New Issue
Block a user