From 28feaa2a2cfb19f5f90d59132b1e16a60e81a14e Mon Sep 17 00:00:00 2001 From: wangyidong Date: Mon, 3 Apr 2023 13:41:07 +0800 Subject: [PATCH] * code for task #89524. --- module/doc/model.php | 1 + module/doc/view/content.html.php | 12 ++++- module/doc/view/doclist.html.php | 11 ++++- module/doc/view/editothertype.html.php | 61 +++++++++----------------- 4 files changed, 42 insertions(+), 43 deletions(-) diff --git a/module/doc/model.php b/module/doc/model.php index 11e1b82821..75f0f47109 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -912,6 +912,7 @@ class docModel extends model if($changed) { $docContent = new stdclass(); + $docContent->doc = $oldDoc->id; $docContent->title = $doc->title; $docContent->content = isset($doc->content) ? $doc->content : ''; $docContent->files = $oldDocContent->files; diff --git a/module/doc/view/content.html.php b/module/doc/view/content.html.php index 33d509272f..20e28b2f48 100644 --- a/module/doc/view/content.html.php +++ b/module/doc/view/content.html.php @@ -32,7 +32,17 @@
', '', "title='{$lang->fullscreen}' class='btn btn-link fullscreen-btn'"); - if(common::hasPriv('doc', 'edit')) echo html::a(inlink('edit', "docID=$doc->id&comment=false&objectType=$objectType&objectID=$object->id&libID=$libID"), '', '', "title='{$lang->doc->edit}' class='btn btn-link' data-app='{$this->app->tab}'"); + if(common::hasPriv('doc', 'edit')) + { + $iframe = ''; + $onlybody = false; + if($doc->type != 'text' or isonlybody()) + { + $iframe = 'iframe'; + $onlybody = 'true'; + } + echo html::a(inlink('edit', "docID=$doc->id&comment=false&objectType=$objectType&objectID=$object->id&libID=$libID", '', $onlybody), '', '', "title='{$lang->doc->edit}' class='btn btn-link $iframe' data-app='{$this->app->tab}'"); + } if(common::hasPriv('doc', 'delete')) { $deleteURL = $this->createLink('doc', 'delete', "docID=$doc->id&confirm=yes&from=lib"); diff --git a/module/doc/view/doclist.html.php b/module/doc/view/doclist.html.php index 16586e9ab4..0538457ed6 100644 --- a/module/doc/view/doclist.html.php +++ b/module/doc/view/doclist.html.php @@ -101,7 +101,16 @@ body {margin-bottom: 25px;} editedDate, 'Y-m-d');?> - id&comment=false", "", '', "title='{$lang->edit}' class='btn'", true, false)?> + type != 'text' or isonlybody()) + { + $iframe = 'iframe'; + $onlybody = true; + } + ?> + id&comment=false", "", '', "title='{$lang->edit}' class='btn $iframe'", true, $onlybody);?> id&confirm=no", "", 'hiddenwin', "title='{$lang->delete}' class='btn'")?> diff --git a/module/doc/view/editothertype.html.php b/module/doc/view/editothertype.html.php index 332467034f..0928aff2a6 100644 --- a/module/doc/view/editothertype.html.php +++ b/module/doc/view/editothertype.html.php @@ -25,53 +25,30 @@ createLink('doc', 'view', "docID=$doc->id"), $doc->title, '', "title='$doc->title'");?> arrow . ' ' . $lang->doc->edit;?> -
save, '', 'id="top-submit" class="btn btn-primary"');?>
+ - - + + + - - + + - + - - - - - - - type == 'url') echo "class='hidden'"?>> - - - - type != 'url') echo "class='hidden'"?>> - - - - - - + - - - + - + '> - -
doc->lib;?> lib, "class='form-control chosen' onchange=loadDocModule(this.value)");?> doc->project;?>
doc->module;?> - module, "class='form-control chosen'");?> - doc->libAndModule?>lib . '_' . $doc->module, "class='form-control chosen'");?>
doc->title;?>title, "class='form-control' required");?>title, "class='form-control' required");?>
doc->keywords;?>keywords, "class='form-control' placeholder='{$lang->doc->keywordsTips}'");?>
doc->type;?> - doc->types; - if(!isset($lang->doc->types[$doc->type])) $typeList = $lang->doc->typeList; - echo html::radio('type', array($doc->type => zget($typeList, $doc->type)), $doc->type); - ?> -
doc->content;?>type == 'url' ? '' : htmlSpecialString($doc->content), "style='width:100%; height:200px'") . html::hidden('contentType', $doc->contentType);?>
doc->url;?>type == 'url' ? $doc->content : '', "class='form-control'");?>
doc->files;?>fetch('file', 'buildform');?>keywords, "class='form-control' placeholder='{$lang->doc->keywordsTips}'");?>
doc->mailto;?> +
mailto, "multiple class='form-control picker-select' data-drop-direction='top'"); @@ -81,16 +58,14 @@
doclib->control;?> - acl == 'private' ? 'private' : $doc->acl;?> - doc->aclList, $acl, "onchange='toggleAcl(this.value, \"doc\")'")?> - doc->noticeAcl['doc'][$acl];?> + doclib->control;?> + doc->aclList, $doc->acl, "onchange='toggleAcl(this.value, \"doc\")'")?>
doc->whiteList;?> +
doclib->group?> groups, "class='form-control picker-select' multiple data-drop-direction='top'")?> @@ -98,15 +73,19 @@
doclib->user?> users, "class='form-control picker-select' multiple data-drop-direction='top'")?> + fetch('my', 'buildContactLists', "dropdownName=users");?>
+ contentType); + echo html::hidden('type', $doc->type); echo html::hidden('editedDate', $doc->editedDate); + echo html::hidden('status', $doc->status); + echo html::hidden('parent', $doc->parent); echo html::submitButton(); - echo html::backButton($lang->goback, "data-app='{$app->tab}'"); ?>