Merge branch 'sprint/hufangzhou_doc' into 'master'

* Finish task #62132, #62133, #62134, #62135, #62136.

See merge request easycorp/zentaopms!4668
This commit is contained in:
王怡栋
2022-07-27 00:27:50 +00:00
11 changed files with 426 additions and 342 deletions
+1 -1
View File
@@ -164,7 +164,7 @@ class baseHelper
$sign = strpos($link, '?') === false ? "?" : "&";
$appendString = '';
if($onlyBody or self::inOnlyBodyMode()) $appendString = $sign . "onlybody=yes";
if(self::isWithTID()) $appendString .= empty($appendString) ? "{$sign}tid={$_GET['tid']}" : "&tid={$_GET['tid']}";
if(self::isWithTID() and strpos($link, 'tid=') === false) $appendString .= empty($appendString) ? "{$sign}tid={$_GET['tid']}" : "&tid={$_GET['tid']}";
return $link . $appendString;
}
+1
View File
@@ -15,6 +15,7 @@ $config->doc->edit->requiredFields = 'title';
$config->doc->customObjectLibs = 'files,customFiles';
$config->doc->notArticleType = '';
$config->doc->officeTypes = 'word,ppt,excel';
$config->doc->textTypes = 'html,markdown,text';
$config->doc->custom = new stdclass();
$config->doc->custom->objectLibs = $config->doc->customObjectLibs;
+34 -15
View File
@@ -286,15 +286,16 @@ class doc extends control
/**
* Create a doc.
*
* @param string $objectType
* @param int $objectID
* @param int|string $libID
* @param int $moduleID
* @param string $docType
* @param string $objectType
* @param int $objectID
* @param int|string $libID
* @param int $moduleID
* @param string $docType
* @param bool $fromGlobal
* @access public
* @return void
*/
public function create($objectType, $objectID, $libID, $moduleID = 0, $docType = '')
public function create($objectType, $objectID, $libID, $moduleID = 0, $docType = '', $fromGlobal = false)
{
if(!empty($_POST))
{
@@ -318,7 +319,20 @@ class doc extends control
$objectID = zget($lib, $lib->type, '');
$params = "type={$lib->type}&objectID=$objectID&libID={$lib->id}&docID=" . $docResult['id'];
$link = isonlybody() ? 'parent' : $this->createLink('doc', 'objectLibs', $params, 'html') . '#app=' . $this->app->tab;
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $link));
$response = array('result' => 'success', 'message' => $this->lang->saveSuccess);
if(isonlybody() and $docResult['docType'] == 'text')
{
$link = helper::createLink('doc', 'edit', "docID=$docID&comment=false&objectType=$objectType&objectID=$objectID&libID={$docResult['libID']}");
$response['callback'] = "redirect2Edit($docID, \"$objectType\", $objectID, {$docResult['libID']})";
}
else
{
$response['locate'] = "$link";
}
return $this->send($response);
}
unset($_GET['onlybody']);
@@ -347,7 +361,7 @@ class doc extends control
if($this->config->systemMode == 'new') unset($this->lang->doc->menu->project['subMenu']);
}
$this->config->showMainMenu = strpos(',html,markdown,text,', ",$docType,") === false;
$this->config->showMainMenu = strpos($this->config->doc->textTypes, $docType) === false;
/* Get libs and the default lib id. */
$gobackLink = ($objectID == 0 and $libID == 0) ? $this->createLink('doc', 'tableContents', "type=$objectType") : '';
@@ -362,7 +376,7 @@ class doc extends control
$this->view->title = $libName . $this->lang->doc->create;
$this->view->objectType = $objectType;
$this->view->objectID = $objectID;
$this->view->objectID = zget($lib, $lib->type, '');
$this->view->libID = $libID;
$this->view->lib = $lib;
$this->view->libs = $libs;
@@ -373,6 +387,7 @@ class doc extends control
$this->view->docType = $docType;
$this->view->groups = $this->loadModel('group')->getPairs();
$this->view->users = $this->user->getPairs('nocode|noclosed|nodeleted');
$this->view->fromGlobal = $fromGlobal;
$this->display();
}
@@ -380,15 +395,16 @@ class doc extends control
/**
* Edit a doc.
*
* @param int $docID
* @param bool $comment
* @param string $objectType
* @param int $objectID
* @param int $libID
* @param int $docID
* @param bool $comment
* @param string $objectType
* @param int $objectID
* @param int $libID
* @param string $from
* @access public
* @return void
*/
public function edit($docID, $comment = false, $objectType = '', $objectID = 0, $libID = 0)
public function edit($docID, $comment = false, $objectType = '', $objectID = 0, $libID = 0, $from = 'edit')
{
if(!empty($_POST))
{
@@ -490,6 +506,9 @@ class doc extends control
$this->view->lib = $lib;
$this->view->groups = $this->loadModel('group')->getPairs();
$this->view->users = $this->user->getPairs('noletter|noclosed|nodeleted', $doc->users);
$this->view->from = $from;
$this->view->files = $this->loadModel('file')->getByObject('doc', $docID);
$this->view->objectID = zget($lib, $type, '');
$this->display();
}
+15 -1
View File
@@ -87,7 +87,7 @@ function initPage(type)
{
$('#contentBox .contentmarkdown').removeClass('hidden');
$('#contentBox .contenthtml').addClass('hidden');
$('#contentBox #contentType').val(type);
$('#contentType').val(type);
}
}
else if(type == 'url')
@@ -150,3 +150,17 @@ function loadWhitelist(libID)
}
});
}
/**
* Redirect to edit page when create the doc of text type.
*
* @param int docID
* @param string objectType
* @param int objectID
* @param int libID
* @return void
*/
function redirect2Edit(docID, objectType, objectID, libID)
{
parent.location.href = createLink('doc', 'edit', 'docID=' + docID + '&comment=false&objectType=' + objectType + '&objectID=' + objectID + '&libID=' + libID + '&from=create');
}
+1 -1
View File
@@ -16,7 +16,7 @@ function redirectParentWindow(objectType, libID, docType)
}
else
{
var link = createLink('doc', 'create', 'objectType=' + objectType + '&objectID=0&libID=' + libID + '&moduleID=0&docType=' + docType) + '#app=doc';
var link = createLink('doc', 'create', 'objectType=' + objectType + '&objectID=0&libID=' + libID + '&moduleID=0&docType=' + docType + '&fromGlobal=true') + '#app=doc';
}
window.parent.$.apps.open(link);
}
+5 -5
View File
@@ -782,7 +782,7 @@ class docModel extends model
$docContent->files = join(',', array_keys($files));
$this->dao->insert(TABLE_DOCCONTENT)->data($docContent)->exec();
$this->loadModel('score')->create('doc', 'create', $docID);
return array('status' => 'new', 'id' => $docID, 'files' => $files);
return array('status' => 'new', 'id' => $docID, 'files' => $files, 'docType' => $doc->type, 'libID' => $doc->lib);
}
return false;
}
@@ -2126,11 +2126,11 @@ class docModel extends model
{
foreach($this->lang->doc->typeList as $typeKey => $typeName)
{
$class = strpos($this->config->doc->officeTypes, $typeKey) !== false ? 'iframe' : '';
$class = (strpos($this->config->doc->officeTypes, $typeKey) !== false or strpos($this->config->doc->textTypes, $typeKey) !== false) ? 'iframe' : '';
$icon = zget($this->config->doc->iconList, $typeKey);
$html .= "<li>";
$html .= html::a(helper::createLink('doc', 'create', "objectType=$objectType&objectID=$objectID&libID=$libID&moduleID=0&type=$typeKey", '', $class ? true : false), "<i class='icon-$icon icon'></i> " . $typeName, '', "class='$class' data-app='{$this->app->tab}'");
$html .= "</li>";
$html .= "<li>";
$html .= html::a(helper::createLink('doc', 'create', "objectType=$objectType&objectID=$objectID&libID=$libID&moduleID=0&type=$typeKey", '', $class ? true : false), "<i class='icon-$icon icon'></i> " . $typeName, '', "class='$class' data-app='{$this->app->tab}'");
$html .= "</li>";
if($typeKey == 'url') $html .= '<li class="divider"></li>';
}
}
+136 -2
View File
@@ -10,8 +10,142 @@
* @link http://www.zentao.net
*/
?>
<?php if($docType == 'html' or $docType == 'markdown' or $docType == 'text'):?>
<?php if($docType == 'text' and $fromGlobal):?>
<?php include 'createtexttype.html.php';?>
<?php else:?>
<?php include 'createothertype.html.php';?>
<?php if($docType != '' and strpos($config->doc->officeTypes, $docType) !== false):?>
<?php include '../../common/view/header.lite.html.php';?>
<div id="mainContent" class="main-content">
<div class='center-block'>
<div class='main-header'>
<h2><?php echo $lang->doc->create;?></h2>
</div>
<?php if($this->config->edition != 'open'):?>
<div class='alert alert-warning strong'>
<?php printf($lang->doc->notSetOffice, zget($lang->doc->typeList, $docType), common::hasPriv('custom', 'libreoffice') ? $this->createLink('custom', 'libreoffice', '', '', true) : '###');?>
</div>
<?php else:?>
<div class='alert alert-warning strong'><?php printf($lang->doc->cannotCreateOffice, zget($lang->doc->typeList, $docType));?></div>
<?php endif;?>
</div>
</div>
<script>
$("a[href^='###']").click(function()
{
alert('<?php echo $lang->doc->noLibreOffice;?>');
});
</script>
</body>
</html>
<?php else:?>
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/kindeditor.html.php';?>
<?php include '../../common/view/markdown.html.php';?>
<?php js::set('holders', $lang->doc->placeholder);?>
<?php js::set('type', 'doc');?>
<div id="mainContent" class="main-content">
<div class='center-block'>
<div class='main-header'>
<h2><?php echo $lang->doc->create;?></h2>
</div>
<?php if($objectType == 'custom' and empty($libs)):?>
<?php echo html::a(helper::createLink('doc', 'createLib', "type=custom&objectID=$objectID"), '<i class="icon icon-plus"></i> ' . $lang->doc->createLib, '', 'class="iframe hidden createCustomLib"');?>
<?php endif;?>
<form class="load-indicator main-form form-ajax" id="dataform" method='post' enctype='multipart/form-data'>
<table class='table table-form'>
<tbody>
<tr>
<th class='w-110px'><?php echo $lang->doc->lib;?></th>
<td> <?php echo html::select('lib', $libs, $libID, "class='form-control chosen' onchange=loadDocModule(this.value)");?> </td><td></td>
</tr>
<tr>
<th><?php echo $lang->doc->module;?></th>
<td>
<span id='moduleBox'><?php echo html::select('module', $moduleOptionMenu, $moduleID, "class='form-control chosen'");?></span>
</td><td></td>
</tr>
<tr>
<th><?php echo $lang->doc->title;?></th>
<td colspan='2'><?php echo html::input('title', '', "class='form-control' required");?></td>
</tr>
<tr>
<th><?php echo $lang->doc->keywords;?></th>
<td colspan='2'><?php echo html::input('keywords', '', "class='form-control' placeholder='{$lang->doc->keywordsTips}'");?></td>
</tr>
<?php $docContentHidden = strpos($this->config->doc->textTypes, $docType) !== false ? 'hidden' : '';?>
<tr id='contentBox' class="<?php echo $docContentHidden;?>">
<th><?php echo $lang->doc->content;?></th>
<td colspan='2'>
<div class='contenthtml'><?php echo html::textarea('content', '', "style='width:100%;height:200px'");?></div>
<div class='contentmarkdown hidden'><?php echo html::textarea('contentMarkdown', '', "style='width:100%;height:200px'");?></div>
</td>
</tr>
<tr class='hidden'>
<th><?php echo $lang->doc->type;?></th>
<?php
$typeKeyList = array();
foreach($lang->doc->types as $typeKey => $typeName) $typeKeyList[$typeKey] = $typeKey;
?>
<td><?php echo html::radio('type', $lang->doc->types, zget($typeKeyList, $docType, 'text'));?></td>
</tr>
<tr id='urlBox' class='hidden'>
<th><?php echo $lang->doc->url;?></th>
<td colspan='2'><?php echo html::input('url', '', "class='form-control'");?></td>
</tr>
<tr id='fileBox'>
<th><?php echo $lang->doc->files;?></th>
<td colspan='2'><?php echo $this->fetch('file', 'buildform');?></td>
</tr>
<tr>
<th><?php echo $lang->doc->mailto;?></th>
<td colspan="2">
<div class="input-group">
<?php
echo html::select('mailto[]', $users, '', "multiple class='form-control picker-select' data-drop-direction='top'");
echo $this->fetch('my', 'buildContactLists');
?>
</div>
</td>
</tr>
<tr>
<th><?php echo $lang->doclib->control;?></th>
<td colspan='2'>
<?php $acl = $lib->acl == 'default' ? 'open' : $lib->acl;?>
<?php $acl = ($lib->type == 'project' and $acl == 'private') ? 'open' : $acl;?>
<?php echo html::radio('acl', $lang->doc->aclList, $acl, "onchange='toggleAcl(this.value, \"doc\")'");?>
<span class='text-info' id='noticeAcl'><?php echo $lang->doc->noticeAcl['doc'][$acl];?></span>
</td>
</tr>
<tr id='whiteListBox' class='hidden'>
<th><?php echo $lang->doc->whiteList;?></th>
<td colspan='2'>
<div class='input-group'>
<span class='input-group-addon groups-addon'><?php echo $lang->doclib->group?></span>
<?php echo html::select('groups[]', $groups, '', "class='form-control picker-select' multiple data-drop-direction='top'")?>
</div>
<div class='input-group'>
<span class='input-group-addon'><?php echo $lang->doclib->user?></span>
<?php echo html::select('users[]', $users, '', "class='form-control picker-select' multiple data-drop-direction='top'")?>
</div>
</td>
</tr>
<tr>
<td colspan='3' class='text-center form-actions'>
<?php echo html::hidden('contentType', 'html');?>
<?php echo html::submitButton();?>
<?php if(strpos($config->doc->textTypes, $docType) === false):?>
<?php if(empty($gobackLink)) echo html::backButton($lang->goback, "data-app='{$app->tab}'");?>
<?php if(!empty($gobackLink)) echo html::a($gobackLink, $lang->goback, '', "class='btn btn-back btn-wide'");?>
<?php endif;?>
</td>
</tr>
</tbody>
</table>
</form>
</div>
</div>
<?php js::set('docType', $docType);?>
<?php js::set('noticeAcl', $lang->doc->noticeAcl['doc']);?>
<?php include '../../common/view/footer.html.php';?>
<?php endif;?>
<?php endif;?>
-137
View File
@@ -1,137 +0,0 @@
<?php
/**
* The create view of doc module of ZenTaoPMS.
*
* @copyright Copyright 2009-2015 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology 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: create.html.php 975 2010-07-29 03:30:25Z jajacn@126.com $
* @link http://www.zentao.net
*/
?>
<?php if($docType != '' and strpos($config->doc->officeTypes, $docType) !== false):?>
<?php include '../../common/view/header.lite.html.php';?>
<div id="mainContent" class="main-content">
<div class='center-block'>
<div class='main-header'>
<h2><?php echo $lang->doc->create;?></h2>
</div>
<?php if($this->config->edition != 'open'):?>
<div class='alert alert-warning strong'>
<?php printf($lang->doc->notSetOffice, zget($lang->doc->typeList, $docType), common::hasPriv('custom', 'libreoffice') ? $this->createLink('custom', 'libreoffice', '', '', true) : '###');?>
</div>
<?php else:?>
<div class='alert alert-warning strong'><?php printf($lang->doc->cannotCreateOffice, zget($lang->doc->typeList, $docType));?></div>
<?php endif;?>
</div>
</div>
<script>
$("a[href^='###']").click(function()
{
alert('<?php echo $lang->doc->noLibreOffice;?>');
});
</script>
</body>
</html>
<?php else:?>
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/kindeditor.html.php';?>
<?php include '../../common/view/markdown.html.php';?>
<?php js::set('holders', $lang->doc->placeholder);?>
<?php js::set('type', 'doc');?>
<div id="mainContent" class="main-content">
<div class='center-block'>
<div class='main-header'>
<h2><?php echo $lang->doc->create;?></h2>
</div>
<?php if($objectType == 'custom' and empty($libs)):?>
<?php echo html::a(helper::createLink('doc', 'createLib', "type=custom&objectID=$objectID"), '<i class="icon icon-plus"></i> ' . $lang->doc->createLib, '', 'class="iframe hidden createCustomLib"');?>
<?php endif;?>
<form class="load-indicator main-form form-ajax" id="dataform" method='post' enctype='multipart/form-data'>
<table class='table table-form'>
<tbody>
<tr>
<th class='w-110px'><?php echo $lang->doc->lib;?></th>
<td> <?php echo html::select('lib', $libs, $libID, "class='form-control chosen' onchange=loadDocModule(this.value)");?> </td><td></td>
</tr>
<tr>
<th><?php echo $lang->doc->module;?></th>
<td>
<span id='moduleBox'><?php echo html::select('module', $moduleOptionMenu, $moduleID, "class='form-control chosen'");?></span>
</td><td></td>
</tr>
<tr>
<th><?php echo $lang->doc->title;?></th>
<td colspan='2'><?php echo html::input('title', '', "class='form-control' required");?></td>
</tr>
<tr>
<th><?php echo $lang->doc->keywords;?></th>
<td colspan='2'><?php echo html::input('keywords', '', "class='form-control' placeholder='{$lang->doc->keywordsTips}'");?></td>
</tr>
<tr id='contentBox'>
<th><?php echo $lang->doc->content;?></th>
<td colspan='2'>
<div class='contenthtml'><?php echo html::textarea('content', '', "style='width:100%;height:200px'");?></div>
<div class='contentmarkdown hidden'><?php echo html::textarea('contentMarkdown', '', "style='width:100%;height:200px'");?></div>
<?php echo html::hidden('contentType', 'html');?>
<?php echo html::hidden('type', $docType);?>
</td>
</tr>
<tr id='urlBox' class='hidden'>
<th><?php echo $lang->doc->url;?></th>
<td colspan='2'><?php echo html::input('url', '', "class='form-control'");?></td>
</tr>
<tr id='fileBox'>
<th><?php echo $lang->doc->files;?></th>
<td colspan='2'><?php echo $this->fetch('file', 'buildform');?></td>
</tr>
<tr>
<th><?php echo $lang->doc->mailto;?></th>
<td colspan="2">
<div class="input-group">
<?php
echo html::select('mailto[]', $users, '', "multiple class='form-control picker-select' data-drop-direction='top'");
echo $this->fetch('my', 'buildContactLists');
?>
</div>
</td>
</tr>
<tr>
<th><?php echo $lang->doclib->control;?></th>
<td colspan='2'>
<?php $acl = $lib->acl == 'default' ? 'open' : $lib->acl;?>
<?php $acl = ($lib->type == 'project' and $acl == 'private') ? 'open' : $acl;?>
<?php echo html::radio('acl', $lang->doc->aclList, $acl, "onchange='toggleAcl(this.value, \"doc\")'");?>
<span class='text-info' id='noticeAcl'><?php echo $lang->doc->noticeAcl['doc'][$acl];?></span>
</td>
</tr>
<tr id='whiteListBox' class='hidden'>
<th><?php echo $lang->doc->whiteList;?></th>
<td colspan='2'>
<div class='input-group'>
<span class='input-group-addon groups-addon'><?php echo $lang->doclib->group?></span>
<?php echo html::select('groups[]', $groups, '', "class='form-control picker-select' multiple data-drop-direction='top'")?>
</div>
<div class='input-group'>
<span class='input-group-addon'><?php echo $lang->doclib->user?></span>
<?php echo html::select('users[]', $users, '', "class='form-control picker-select' multiple data-drop-direction='top'")?>
</div>
</td>
</tr>
<tr>
<td colspan='3' class='text-center form-actions'>
<?php echo html::submitButton();?>
<?php if(empty($gobackLink)) echo html::backButton($lang->goback, "data-app='{$app->tab}'");?>
<?php if(!empty($gobackLink)) echo html::a($gobackLink, $lang->goback, '', "class='btn btn-back btn-wide'");?>
</td>
</tr>
</tbody>
</table>
</form>
</div>
</div>
<?php js::set('docType', $docType);?>
<?php js::set('noticeAcl', $lang->doc->noticeAcl['doc']);?>
<?php include '../../common/view/footer.html.php';?>
<?php endif;?>
+116 -90
View File
@@ -19,55 +19,64 @@
#main {padding: 0;}
.container {padding: 0 !important;}
#mainContent {padding: 0 !important;}
#dataform {overflow: hidden}
.doc-title input {border: unset; font-size: 18px; font-weight: bold; color: #3c4353; padding-left: 16px;}
.doc-title .form-control:focus {border: unset; box-shadow: unset;}
.doc-title input::-webkit-input-placeholder {color: #D8DBDE;}
.doc-title.required:after {top: 4px; right: 0; left: 12px; display: inline-table;}
#submit {margin-right: 12px;}
#submit {margin-right: 16px;}
#headerBox {border-bottom: 1px solid #e3e3e3;}
#headerBox td:last-child {padding-right: 24px;}
#editorContent {padding: 0;}
#contentBox {padding: 0; width: 100%;}
.ke-container {overflow: visible;}
.ke-container, .contentmarkdown {border: unset; background: #efefef;}
.ke-container, .contenthtml {border: unset; background: #efefef;}
.ke-container.focus {box-shadow: unset; border-color: unset;}
.ke-toolbar {padding-left: 20px; width: 150%; height: 30px; border-bottom: unset;}
.ke-toolbar {padding-left: 20px; width: 100%; height: 30px;}
.ke-edit {border-top: 1px solid rgb(220, 220, 220)}
.ke-edit, .CodeMirror {margin-left: 20px; background: #fff;}
.ke-edit, .CodeMirror {margin: 8px 200px 0 200px; background: #fff;}
.kindeditor-ph {padding-left: 20px !important;}
.editor-toolbar {background: #fff; padding-left: 20px; border-right: unset; border-top: unset; height: 30px;}
.hide-sidebar .ke-edit {padding-right: 20px;}
.hide-sidebar .CodeMirror {padding-right: 50px;}
.CodeMirror.CodeMirror-wrap {border-left: 0; border-right: 0; border-bottom: 0;}
.ke-statusbar {display: none;}
.contentmarkdown {background: #efefef;}
#sidebar {top: 30px;}
#sidebar .sidebar-toggle {right: 0; left: 0px; background: #efefef; border-radius: 0px; width: 20px; border-top: 1px solid rgb(220, 220, 220);}
#sidebar > .sidebar-toggle:hover {background: #efefef;}
#sidebar {width: 500px;}
#sidebar table {margin-top: 5px;}
#sidebar table th {font-weight: 400 !important;}
.hide-sidebar #sidebar > .sidebar-toggle > .icon:before {content: "\e314";}
.hide-sidebar #sidebar > .sidebar-toggle {left: -20px; z-index: 9;}
#sidebar .cell {border-top: 1px solid rgb(220, 220, 220); border-radius: 0px; height: 100%;}
#sidebar > .sidebar-toggle > .icon.icon-angle-right {left: 4px;}
.file-title {max-width: 130px !important;}
.article-content {padding: 8px 20px;}
.th-control {vertical-align: top !important;}
#noticeAcl {margin-left: 10px; vertical-align: middle;}
#noticeAcl {margin: 0;}
#moreList {display: inline-block; padding: 7px;}
#moreList .icon-more-circle {font-size: 20px;}
#moreList ul.dropdown-menu {left: -77px;}
#backBtn {border: unset;}
#backBtn i {font-size: 20px;}
.modal-title {font-size: 14px !important; font-weight: 700 !important;}
#modalBasicInfo .modal-dialog {width: 720px;}
</style>
<?php if($objectType == 'custom' and empty($libs)):?>
<?php echo html::a(helper::createLink('doc', 'createLib', "type=custom&objectID=$objectID"), '<i class="icon icon-plus"></i> ' . $lang->doc->createLib, '', 'class="iframe hidden createCustomLib"');?>
<?php endif;?>
<?php $backLink = $this->createLink('doc', 'tableContents', "type=$objectType&objectID=$objectID&libID=$libID");?>
<div id="mainContent" class="main-content">
<form class="load-indicator main-form form-ajax" id="dataform" method='post' enctype='multipart/form-data'>
<table class='table table-form'>
<tbody>
<tr id='headerBox'>
<td class="doc-title" colspan='4'><?php echo html::input('title', '', "placeholder='{$lang->doc->titlePlaceholder}' class='form-control' required");?></td>
<td class="text-right"><?php echo html::submitButton('', '', 'btn btn-primary') . html::backButton('', '', 'btn');?></td>
<td width='50px'><?php echo html::linkButton("<i class='icon icon-back-circle'></i>", $backLink, 'self', "id='backBtn'");?></td>
<td class="doc-title" colspan='3'><?php echo html::input('title', '', "placeholder='{$lang->doc->titlePlaceholder}' class='form-control' required");?></td>
<td class="text-right">
<?php echo html::submitButton('', "data-placement='bottom'", 'btn btn-primary');?>
<div id="moreList" class="dropdown dropdown-hover">
<?php echo html::a('#', "<i class='icon icon-more-circle'></i>");?>
<ul class="dropdown-menu">
<li><?php echo html::a('#modalBasicInfo', $lang->doc->basicInfo, '', "data-toggle='modal' id='basicInfoLink'");?><li>
</ul>
</div>
</td>
</tr>
<tr>
<td colspan='5' id="editorContent">
@@ -78,90 +87,107 @@
<?php echo html::hidden('contentType', 'html');?>
<?php echo html::hidden('type', 'text');?>
</div>
<div class="basicInfoBox side-col" id="sidebar">
<div class="sidebar-toggle"><i class="icon icon-angle-right"></i></div>
<div class="cell" style="width: 100%">
<div class="detail">
<div class='detail-title'><?php echo $lang->story->legendBasicInfo;?></div>
<table class='table table-form'>
<tr>
<th class='w-100px'><?php echo $lang->doc->lib;?></th>
<td colspan="2"><?php echo html::select('lib', $libs, $libID, "class='form-control chosen' onchange=loadDocModule(this.value)");?></td>
</tr>
<tr>
<th><?php echo $lang->doc->module;?></th>
<td colspan="2">
<span id='moduleBox'><?php echo html::select('module', $moduleOptionMenu, $moduleID, "class='form-control chosen'");?></span>
</td>
</tr>
<tr>
<th><?php echo $lang->doc->keywords;?></th>
<td colspan='2'><?php echo html::input('keywords', '', "class='form-control' placeholder='{$lang->doc->keywordsTips}'");?></td>
</tr>
<tr id='fileBox'>
<th><?php echo $lang->doc->files;?></th>
<td colspan='2'><?php echo $this->fetch('file', 'buildform');?></td>
</tr>
<tr>
<th><?php echo $lang->doc->mailto;?></th>
<td colspan="2">
<div class="input-group">
<?php
echo html::select('mailto[]', $users, '', "multiple class='form-control picker-select' data-drop-direction='top'");
echo $this->fetch('my', 'buildContactLists');
?>
</div>
</td>
</tr>
<tr>
<th class="th-control"><?php echo $lang->doclib->control;?></th>
<td colspan='2'>
<?php $acl = $lib->acl == 'default' ? 'open' : $lib->acl;?>
<?php $acl = ($lib->type == 'project' and $acl == 'private') ? 'open' : $acl;?>
<?php echo html::radio('acl', $lang->doc->aclList, $acl, "onchange='toggleAcl(this.value, \"doc\")'");?>
<p class='text-info' id='noticeAcl'><?php echo $lang->doc->noticeAcl['doc'][$acl];?></p>
</td>
</tr>
<tr id='whiteListBox' class='hidden'>
<th><?php echo $lang->doc->whiteList;?></th>
<td colspan='2'>
<div class='input-group'>
<span class='input-group-addon groups-addon'><?php echo $lang->doclib->group?></span>
<?php echo html::select('groups[]', $groups, '', "class='form-control picker-select' multiple data-drop-direction='top'")?>
</div>
<div class='input-group'>
<span class='input-group-addon'><?php echo $lang->doclib->user?></span>
<?php echo html::select('users[]', $users, '', "class='form-control picker-select' multiple data-drop-direction='top'")?>
</div>
</td>
</tr>
</table>
</div>
</div>
</div>
</div>
</td>
</tr>
</tbody>
</table>
<div class='modal fade modal-basic' id='modalBasicInfo' data-scroll-inside='false'>
<div class='modal-dialog'>
<div class='modal-content with-padding'>
<div class='modal-header'>
<button type='button' class='close' data-dismiss='modal'>
<i class="icon icon-close"></i>
</button>
<h2 class='modal-title'><?php echo $lang->doc->basicInfo;?></h2>
</div>
<div class='modal-body'>
<table class='table table-form' id="basicInfoBox">
<tbody>
<tr>
<th class='w-100px'><?php echo $lang->doc->lib;?></th>
<td colspan="2"><?php echo html::select('lib', $libs, $libID, "class='form-control chosen' onchange=loadDocModule(this.value)");?></td>
</tr>
<tr>
<th><?php echo $lang->doc->module;?></th>
<td colspan="2">
<span id='moduleBox'><?php echo html::select('module', $moduleOptionMenu, $moduleID, "class='form-control chosen'");?></span>
</td>
</tr>
<tr>
<th><?php echo $lang->doc->keywords;?></th>
<td colspan='2'><?php echo html::input('keywords', '', "class='form-control' placeholder='{$lang->doc->keywordsTips}'");?></td>
</tr>
<tr id='fileBox'>
<th><?php echo $lang->doc->files;?></th>
<td colspan='2'><?php echo $this->fetch('file', 'buildform');?></td>
</tr>
<tr>
<th><?php echo $lang->doc->mailto;?></th>
<td colspan="2">
<div class="input-group">
<?php
echo html::select('mailto[]', $users, '', "multiple class='form-control picker-select' data-drop-direction='top'");
echo $this->fetch('my', 'buildContactLists');
?>
</div>
</td>
</tr>
<tr>
<th class="th-control"><?php echo $lang->doclib->control;?></th>
<td colspan='2'>
<?php $acl = $lib->acl == 'default' ? 'open' : $lib->acl;?>
<?php $acl = ($lib->type == 'project' and $acl == 'private') ? 'open' : $acl;?>
<?php echo html::radio('acl', $lang->doc->aclList, $acl, "onchange='toggleAcl(this.value, \"doc\")'");?>
<span class='text-info' id='noticeAcl'><?php echo $lang->doc->noticeAcl['doc'][$acl];?></span>
</td>
</tr>
<tr id='whiteListBox' class='hidden'>
<th><?php echo $lang->doc->whiteList;?></th>
<td colspan='2'>
<div class='input-group'>
<span class='input-group-addon groups-addon'><?php echo $lang->doclib->group?></span>
<?php echo html::select('groups[]', $groups, '', "class='form-control picker-select' multiple data-drop-direction='top'")?>
</div>
<div class='input-group'>
<span class='input-group-addon'><?php echo $lang->doclib->user?></span>
<?php echo html::select('users[]', $users, '', "class='form-control picker-select' multiple data-drop-direction='top'")?>
</div>
</td>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan='3' class='text-center'><?php echo html::a('javascript:void(0)', $lang->save, '', "class='btn btn-primary btn-wide'");?></td>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
</form>
</div>
<script>
$(function()
{
$('.doc-title input').focus();
$('#dataform').submit(function()
{
setTimeout(function(){$('#dataform').scrollTop(0)}, 300);
});
var contentHeight = $(document).height() - 120;
$('#sidebar').height(contentHeight);
setTimeout(function(){$('.ke-edit-iframe, .ke-edit').height(contentHeight);}, 100);
setTimeout(function(){$('.CodeMirror').height(contentHeight);}, 100);
$('#editorContent .icon.icon-angle-right').css('top', '50%');
//basicInfoContent = '';
//$('#basicInfoLink').click(function()
//{
// basicInfoContent = $('#basicInfoBox').html();
//});
//$('#modalBasicInfo .modal-header .close').click(function()
//{
// $('#basicInfoBox').html(basicInfoContent);
//});
$(document).on('click', '#modalBasicInfo tfoot .btn', function() {$('#modalBasicInfo').modal('hide');});
})
</script>
<?php js::set('docType', $docType);?>
+116 -89
View File
@@ -23,22 +23,22 @@
#main {padding: 0;}
.container {padding: 0 !important;}
#mainContent {padding: 0 !important;}
#dataform {overflow: hidden}
.doc-title input {border: unset; font-size: 18px; font-weight: bold; color: #3c4353; padding-left: 16px;}
.doc-title .form-control:focus {border: unset; box-shadow: unset;}
.doc-title input::-webkit-input-placeholder {color: #D8DBDE;}
.doc-title.required:after {top: 4px; right: 0; left: 12px; display: inline-table;}
#submit {margin-right: 12px;}
#submit {margin-right: 16px;}
#headerBox {border-bottom: 1px solid #e3e3e3;}
#headerBox td:last-child {padding-right: 24px;}
#editorContent {padding: 0;}
#contentBox {padding: 0; width: 100%;}
.ke-container {overflow: visible;}
.ke-container, .contenthtml {border: unset; background: #efefef;}
.ke-container.focus {box-shadow: unset; border-color: unset;}
.ke-toolbar {padding-left: 20px; width: 150%; height: 30px; border-bottom: unset;}
.ke-toolbar {padding-left: 20px; width: 100%; height: 30px;}
.ke-edit {border-top: 1px solid rgb(220, 220, 220)}
.ke-edit, .CodeMirror {margin-left: 20px; background: #fff;}
.ke-edit, .CodeMirror {margin: 8px 200px 0 200px; background: #fff;}
.kindeditor-ph {padding-left: 20px !important;}
.editor-toolbar {background: #fff; padding-left: 20px; border-right: unset; border-top: unset; height: 30px;}
.hide-sidebar .ke-edit {padding-right: 20px;}
@@ -46,29 +46,41 @@
.CodeMirror.CodeMirror-wrap {border-left: 0; border-right: 0; border-bottom: 0;}
.ke-statusbar {display: none;}
#sidebar {top: 30px;}
#sidebar .sidebar-toggle {right: 0; left: 0px; background: #efefef; border-radius: 0px; width: 20px; border-top: 1px solid rgb(220, 220, 220);}
#sidebar > .sidebar-toggle:hover {background: #efefef;}
#sidebar {width: 500px;}
#sidebar table {margin-top: 5px;}
#sidebar table th {font-weight: 400 !important;}
.hide-sidebar #sidebar > .sidebar-toggle > .icon:before {content: "\e314";}
.hide-sidebar #sidebar > .sidebar-toggle {left: -20px; z-index: 9;}
#sidebar .cell {border-top: 1px solid rgb(220, 220, 220); border-radius: 0px; height: 100%;}
#sidebar > .sidebar-toggle > .icon.icon-angle-right {left: 4px;}
.file-title {max-width: 130px !important;}
.article-content {padding: 8px 20px;}
.th-control {vertical-align: top !important;}
#noticeAcl {margin-left: 10px; vertical-align: middle;}
#noticeAcl {margin: 0;}
#moreList {display: inline-block; padding: 7px;}
#moreList .icon-more-circle {font-size: 20px;}
#moreList ul.dropdown-menu {left: -77px;}
#backBtn {border: unset;}
#backBtn i {font-size: 20px;}
.modal-title {font-size: 14px !important; font-weight: 700 !important;}
#modalBasicInfo .modal-dialog {width: 720px;}
</style>
<?php $backLink = $this->createLink('doc', 'objectlibs', "type=$type&objectID=$objectID&libID={$lib->id}&docID={$doc->id}");?>
<div id="mainContent" class="main-content">
<form class="load-indicator main-form form-ajax" id="dataform" method='post' enctype='multipart/form-data'>
<table class='table table-form'>
<tbody>
<tr id='headerBox'>
<td class="doc-title" colspan='4'><?php echo html::input('title', $doc->title, "placeholder='{$lang->doc->titlePlaceholder}' class='form-control' required");?></td>
<td class="text-right"><?php echo html::submitButton('', '', 'btn btn-primary') . html::backButton('', '', 'btn');?></td>
<?php if($from == 'create'):?>
<td width='50px'><?php echo html::linkButton("<i class='icon icon-back-circle'></i>", $backLink, 'self', "id='backBtn'");?></td>
<?php else:?>
<td width='50px'><?php echo html::backButton("<i class='icon icon-back-circle'></i>", "id='backBtn'", '');?></td>
<?php endif;?>
<td class="doc-title" colspan='3'><?php echo html::input('title', $doc->title, "placeholder='{$lang->doc->titlePlaceholder}' class='form-control' required");?></td>
<td class="text-right">
<?php echo html::submitButton('', "data-placement='bottom'", 'btn btn-primary');?>
<div id="moreList" class="dropdown dropdown-hover">
<?php echo html::a('#', "<i class='icon icon-more-circle'></i>");?>
<ul class="dropdown-menu">
<li><?php echo html::a('#modalBasicInfo', $lang->doc->basicInfo, '', "data-toggle='modal' id='basicInfoLink'");?><li>
</ul>
</div>
</td>
</tr>
<tr>
<td colspan='5' id="editorContent">
@@ -79,89 +91,104 @@
<?php echo html::hidden('type', 'text');?>
<?php echo html::hidden('editedDate', $doc->editedDate);?>
</div>
<div class="basicInfoBox side-col" id="sidebar">
<div class="sidebar-toggle"><i class="icon icon-angle-right"></i></div>
<div class="cell" style="width: 100%">
<div class="detail">
<div class='detail-title'><?php echo $lang->story->legendBasicInfo;?></div>
<table class='table table-form'>
<tr>
<th class='w-100px'><?php echo $lang->doc->lib;?></th>
<td colspan="2" class="required"><?php echo html::select('lib', $libs, $doc->lib, "class='form-control chosen' onchange=loadDocModule(this.value)");?></td>
</tr>
<tr>
<th><?php echo $lang->doc->module;?></th>
<td colspan="2">
<span id='moduleBox'><?php echo html::select('module', $moduleOptionMenu, $doc->module, "class='form-control chosen'");?></span>
</td>
</tr>
<tr>
<th><?php echo $lang->doc->keywords;?></th>
<td colspan='2'><?php echo html::input('keywords', $doc->keywords, "class='form-control' placeholder='{$lang->doc->keywordsTips}'");?></td>
</tr>
<tr id='fileBox'>
<th><?php echo $lang->doc->files;?></th>
<td colspan='2'><?php echo $this->fetch('file', 'buildform');?></td>
</tr>
<tr>
<th><?php echo $lang->doc->mailto;?></th>
<td colspan="2">
<div class="input-group">
<?php
echo html::select('mailto[]', $users, $doc->mailto, "multiple class='form-control picker-select' data-drop-direction='top'");
echo $this->fetch('my', 'buildContactLists');
?>
</div>
</td>
</tr>
<tr>
<th class="th-control"><?php echo $lang->doclib->control;?></th>
<td colspan='2'>
<?php $acl = $lib->acl == 'private' ? 'private' : $doc->acl;?>
<?php echo html::radio('acl', $lang->doc->aclList, $acl, "onchange='toggleAcl(this.value, \"doc\")'")?>
<p class='text-info' id='noticeAcl'><?php echo $lang->doc->noticeAcl['doc'][$acl];?></p>
</td>
</tr>
<tr id='whiteListBox' class='hidden'>
<th><?php echo $lang->doc->whiteList;?></th>
<td colspan='2'>
<div class='input-group w-p100'>
<span class='input-group-addon groups-addon'><?php echo $lang->doclib->group?></span>
<?php echo html::select('groups[]', $groups, $doc->groups, "class='form-control picker-select' multiple data-drop-direction='top'")?>
</div>
<div class='input-group w-p100'>
<span class='input-group-addon'><?php echo $lang->doclib->user?></span>
<?php echo html::select('users[]', $users, $doc->users, "class='form-control picker-select' multiple data-drop-direction='top'")?>
</div>
</td>
</tr>
</table>
</div>
</div>
</div>
</div>
</td>
</tr>
</tbody>
</table>
<div class='modal fade modal-basic' id='modalBasicInfo' data-scroll-inside='false'>
<div class='modal-dialog'>
<div class='modal-content with-padding'>
<div class='modal-header'>
<button type='button' class='close' data-dismiss='modal'>
<i class="icon icon-close"></i>
</button>
<h2 class='modal-title'><?php echo $lang->doc->basicInfo;?></h2>
</div>
<div class='modal-body'>
<table class='table table-form' id="basicInfoBox">
<tr>
<th class='w-100px'><?php echo $lang->doc->lib;?></th>
<td colspan="2" class="required"><?php echo html::select('lib', $libs, $doc->lib, "class='form-control chosen' onchange=loadDocModule(this.value)");?></td>
</tr>
<tr>
<th><?php echo $lang->doc->module;?></th>
<td colspan="2">
<span id='moduleBox'><?php echo html::select('module', $moduleOptionMenu, $doc->module, "class='form-control chosen'");?></span>
</td>
</tr>
<tr>
<th><?php echo $lang->doc->keywords;?></th>
<td colspan='2'><?php echo html::input('keywords', $doc->keywords, "class='form-control' placeholder='{$lang->doc->keywordsTips}'");?></td>
</tr>
<tr id='fileBox'>
<th><?php echo $lang->doc->files;?></th>
<td colspan='2'><?php echo $this->fetch('file', 'buildform');?></td>
</tr>
<tr>
<th><?php echo $lang->doc->mailto;?></th>
<td colspan="2">
<div class="input-group">
<?php
echo html::select('mailto[]', $users, $doc->mailto, "multiple class='form-control picker-select' data-drop-direction='top'");
echo $this->fetch('my', 'buildContactLists');
?>
</div>
</td>
</tr>
<tr>
<th class="th-control"><?php echo $lang->doclib->control;?></th>
<td colspan='2'>
<?php $acl = $lib->acl == 'private' ? 'private' : $doc->acl;?>
<?php echo html::radio('acl', $lang->doc->aclList, $acl, "onchange='toggleAcl(this.value, \"doc\")'")?>
<span class='text-info' id='noticeAcl'><?php echo $lang->doc->noticeAcl['doc'][$acl];?></span>
</td>
</tr>
<tr id='whiteListBox' class='hidden'>
<th><?php echo $lang->doc->whiteList;?></th>
<td colspan='2'>
<div class='input-group w-p100'>
<span class='input-group-addon groups-addon'><?php echo $lang->doclib->group?></span>
<?php echo html::select('groups[]', $groups, $doc->groups, "class='form-control picker-select' multiple data-drop-direction='top'")?>
</div>
<div class='input-group w-p100'>
<span class='input-group-addon'><?php echo $lang->doclib->user?></span>
<?php echo html::select('users[]', $users, $doc->users, "class='form-control picker-select' multiple data-drop-direction='top'")?>
</div>
</td>
</tr>
<tfoot>
<tr>
<td colspan='3' class='text-center'><?php echo html::a('javascript:void(0)', $lang->save, '', "class='btn btn-primary btn-wide'");?></td>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
</form>
</div>
<script>
$(function()
{
$('.doc-title input').focus();
$('#dataform').submit(function()
{
setTimeout(function(){$('#dataform').scrollTop(0)}, 100);
});
var contentHeight = $(document).height() - 120;
$('#sidebar').height(contentHeight);
var contentHeight = $(document).height() - 100;
setTimeout(function(){$('.ke-edit-iframe, .ke-edit').height(contentHeight);}, 100);
setTimeout(function(){$('.CodeMirror').height(contentHeight);}, 100);
$('#editorContent .icon.icon-angle-right').css('top', '50%');
//basicInfoContent = '';
//$('#basicInfoLink').click(function()
//{
// basicInfoContent = $('#basicInfoBox').html();
//});
//$('#modalBasicInfo .modal-header .close').click(function()
//{
// $('#basicInfoBox').html(basicInfoContent);
//});
$(document).on('click', '#modalBasicInfo tfoot .btn', function() {$('#modalBasicInfo').modal('hide');});
})
</script>
<?php js::set('noticeAcl', $lang->doc->noticeAcl['doc']);?>
+1 -1
View File
@@ -14,7 +14,7 @@
<div id='mainContent' class='main-content'>
<div class='center-block'>
<div class='main-header'>
<h2><?php echo '<span>' . $lang->doc->selectLibType . '</span>';?></h2>
<h2><?php echo '<span>' . $lang->doc->create . '</span>';?></h2>
</div>
</div>
<form method='post' class='form-ajax'>