* code for task #89523.

This commit is contained in:
wangyidong
2023-03-31 16:00:11 +08:00
parent 4368b5ccde
commit 31f4f00d76
7 changed files with 232 additions and 197 deletions
+42 -29
View File
@@ -389,30 +389,24 @@ class doc extends control
$lib = $this->doc->getLibByID($libID);
$objects = array();
if($objectType == 'project')
{
$objects = $this->loadModel('project')->getPairs();
$this->view->executions = array(0 => '') + $this->loadModel('execution')->getPairs($objectID, 'all', 'multiple,leaf,noprefix');
}
elseif($objectType == 'execution')
{
$execution = $this->loadModel('execution')->getById($objectID);
$objects = $this->execution->getPairs($execution->project, 'all', "multiple,leaf,noprefix");
}
elseif($objectType == 'product')
{
$objects = $this->loadModel('product')->getPairs();
}
$moduleOptionMenu = $this->doc->getLibsOptionMenu($libs);
$moduleID = $moduleID ? (int)$moduleID : (int)$this->cookie->lastDocModule;
if($docType == 'html')
{
if($objectType == 'project')
{
$objects = $this->loadModel('project')->getPairs();
$this->view->executions = array(0 => '') + $this->loadModel('execution')->getPairs($objectID, 'all', 'multiple,leaf,noprefix');
}
elseif($objectType == 'execution')
{
$execution = $this->loadModel('execution')->getById($objectID);
$objects = $this->execution->getPairs($execution->project, 'all', "multiple,leaf,noprefix");
}
elseif($objectType == 'product')
{
$objects = $this->loadModel('product')->getPairs();
}
$moduleOptionMenu = $this->doc->getLibsOptionMenu($libs);
$moduleID = $libID . '_' . $moduleID;
}
else
{
$moduleOptionMenu = $this->tree->getOptionMenu($libID, 'doc', $startModuleID = 0);
}
$moduleID = $libID . '_' . $moduleID;
$this->view->title = zget($lib, 'name', '', $lib->name . $this->lang->colon) . $this->lang->doc->create;
$this->view->linkType = $linkType;
@@ -525,8 +519,9 @@ class doc extends control
if($doc->contentType == 'markdown') $this->config->doc->markdown->edit = array('id' => 'content', 'tools' => 'toolbar');
$lib = $this->doc->getLibByID($libID);
$type = $lib->type;
$lib = $this->doc->getLibByID($libID);
$objectType = $lib->type;
$objectID = zget($lib, $objectType, 0);
/* Set menus. */
if($this->app->tab == 'product')
@@ -553,6 +548,23 @@ class doc extends control
$this->app->rawMethod = $objectType == 'execution' ? 'project' : $objectType;
}
$libs = $this->doc->getLibs($objectType, 'withObject', $libID, $objectID);
$objects = array();
if($objectType == 'project')
{
$objects = $this->loadModel('project')->getPairs();
}
elseif($objectType == 'execution')
{
$execution = $this->loadModel('execution')->getById($objectID);
$objects = $this->execution->getPairs($execution->project, 'all', "multiple,leaf,noprefix");
}
elseif($objectType == 'product')
{
$objects = $this->loadModel('product')->getPairs();
}
$moduleOptionMenu = $this->doc->getLibsOptionMenu($libs);
$this->config->showMainMenu = strpos(',html,markdown,text,', ",{$doc->type},") === false;
$this->view->title = $lib->name . $this->lang->colon . $this->lang->doc->edit;
@@ -560,15 +572,16 @@ class doc extends control
$this->view->position[] = $this->lang->doc->edit;
$this->view->doc = $doc;
$this->view->moduleOptionMenu = $this->tree->getOptionMenu($libID, 'doc', $startModuleID = 0);
$this->view->type = $type;
$this->view->libs = $this->doc->getLibs('all', 'withObject', $libID, $objectID, 'book');
$this->view->moduleOptionMenu = $moduleOptionMenu;
$this->view->type = $objectType;
$this->view->libs = $libs;
$this->view->objects = $objects;
$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, 0);
$this->view->objectID = $objectID;
$this->display();
}
+1 -4
View File
@@ -1,6 +1,3 @@
#main {padding: 0;}
.container {padding: 0 !important;}
#mainContent {padding: 0;}
.doc-title {width:400px;}
.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;}
@@ -14,7 +11,7 @@
#contentBox {padding: 0; width: 100%;}
#contentBox .ke-container {overflow: visible;}
#contentBox .ke-container,#contentBox .contenthtml {border: unset; background: #efefef;}
#contentBox .ke-container, #contentBox .contenthtml {border: unset; background: #efefef;}
#contentBox .ke-container.focus {box-shadow: unset; border-color: unset;}
#contentBox .ke-toolbar {padding-left: 20px; width: 100%; height: 30px;}
#contentBox .ke-edit {border-top: 1px solid rgb(220, 220, 220)}
+38
View File
@@ -1,3 +1,41 @@
.doc-title {width:400px;}
.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;}
#savePath {display:inline-block; width:320px; overflow:hidden; white-space: nowrap; height: 19px; padding-top: 4px; padding-right:8px;}
.contenthtml.required:after {right:3px;}
#headerBox {border-bottom: 1px solid #e3e3e3;}
#headerBox td:last-child {padding-right: 24px;}
#editorContent {padding: 0;}
#contentBox {padding: 0; width: 100%;}
#contentBox .ke-container {overflow: visible;}
#contentBox .ke-container, #contentBox .contenthtml {border: unset; background: #efefef;}
#contentBox .ke-container.focus {box-shadow: unset; border-color: unset;}
#contentBox .ke-toolbar {padding-left: 20px; width: 100%; height: 30px;}
#contentBox .ke-edit {border-top: 1px solid rgb(220, 220, 220)}
#contentBox .ke-edit, #contentBox .CodeMirror {margin: 8px 200px 0 200px; background: #fff;}
#contentBox .kindeditor-ph {padding: 20px 20px 0 20px !important;}
#contentBox .editor-toolbar {background: #fff; padding-left: 20px; border-right: unset; border-top: unset; height: 30px;}
#contentBox .CodeMirror {padding: 20px 20px 0 20px;}
#contentBox .CodeMirror.CodeMirror-wrap {border-left: 0; border-right: 0; border-bottom: 0;}
#contentBox .ke-statusbar {display: none;}
.article-content {padding: 8px 20px;}
#noticeAcl {margin-left: 10px; vertical-align: middle;}
#basicInfoLink {border: unset;}
#modalBasicInfo .modal-dialog {width:800px;}
#modalBasicInfo .modal-content {padding:0px;}
#modalBasicInfo .modal-body {padding:10px 30px 10px 10px; overflow-x: hidden !important;}
#basicInfoBox{margin-bottom: 10px;}
#basicInfoBox tfoot td {padding-bottom: 0;}
.aclBox .radio-inline{display:block; padding-bottom:5px;}
.aclBox .radio-inline+.radio-inline {margin-left: 0px !important;}
#whiteListBox .input-group:last-child {margin-top: 10px;}
#mainContent .main-header h2 {width: 90%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}
.fullscreen-save, .markdown-fullscreen-save {position: fixed; top: 10px; right: 30px; z-index: 999999;}
+41 -33
View File
@@ -1,5 +1,31 @@
$(function()
{
/* Set editor content height. */
var contentHeight = $(document).height() - 92;
setTimeout(function(){$('.ke-edit-iframe, .ke-edit, .ke-edit-textarea').height(contentHeight);}, 100);
setTimeout(function(){$('.CodeMirror').height($(document).height() - 112);}, 100);
$('iframe.ke-edit-iframe').contents().find('.article-content').css('padding', '20px 20px 0 20px');
setSavePath();
$('#modalBasicInfo').on('hide.zui.modal', function(){setSavePath();});
$('#saveDraft').click(function()
{
if($('#editorTitle').val() == '')
{
bootbox.alert(titleNotEmpty);
return false;
}
$('#status').val('draft');
submit(this);
});
$('#saveRelease').click(function()
{
$('#status').val('normal');
submit(this);
});
setTimeout(function()
{
if(needUpdateContent && confirm(confirmUpdateContent))
@@ -16,21 +42,6 @@ $(function()
$(this).addClass('disabled');
$('form').submit();
})
toggleAcl($('input[name="acl"]:checked').val(), 'doc');
$('input[name="type"]').change(function()
{
var type = $(this).val();
if(type == 'text')
{
$('#contentBox').removeClass('hidden');
$('#urlBox').addClass('hidden');
}
else if(type == 'url')
{
$('#contentBox').addClass('hidden');
$('#urlBox').removeClass('hidden');
}
});
$('#subNavbar li[data-id="doc"]').addClass('active');
@@ -149,28 +160,25 @@ function loadWhitelist(libID)
$.post(userLink, function(users)
{
if(users == 'private')
if(users != 'private')
{
$('#aclopen').parent('.radio-inline').addClass('hidden');
$('#aclcustom').parent('.radio-inline').addClass('hidden');
$('#whiteListBox').addClass('hidden');
$('#aclprivate').prop('checked', true);
}
else if(users == 'project')
{
$('#aclprivate').parent('.radio-inline').addClass('hidden');
$('#aclcustom').parent('.radio-inline').addClass('hidden');
$('#whiteListBox').addClass('hidden');
$('#aclopen').prop('checked', true);
}
else
{
$('#aclopen').parent('.radio-inline').removeClass('hidden');
$('#aclcustom').parent('.radio-inline').removeClass('hidden');
$('#users').replaceWith(users);
$('#users').next('.picker').remove();
$('#users').picker();
}
});
}
/**
* Submit form.
*
* @param object $object
* @access public
* @return void
*/
function submit(object)
{
$(object).attr('type', 'submit');
$('#dataform').submit();
setTimeout(function(){$(object).attr('type', 'button').removeAttr('disabled')}, 1000);
}
+24 -20
View File
@@ -752,6 +752,7 @@ class docModel extends model
*/
public function create()
{
if(!isset($_POST['lib']) and strpos($_POST['module'], '_') !== false) list($_POST['lib'], $_POST['module']) = explode('_', $_POST['module']);
$now = helper::now();
$doc = fixer::input('post')
->callFunc('title', 'trim')
@@ -763,7 +764,7 @@ class docModel extends model
->add('version', 1)
->setDefault('product,execution,module', 0)
->stripTags($this->config->doc->editor->create['id'], $this->config->allowedTags)
->cleanInt('product,execution')
->cleanInt('product,execution,module,lib')
->join('groups', ',')
->join('users', ',')
->join('mailto', ',')
@@ -843,6 +844,7 @@ class docModel extends model
return false;
}
if(!isset($_POST['lib']) and strpos($_POST['module'], '_') !== false) list($_POST['lib'], $_POST['module']) = explode('_', $_POST['module']);
$doc = fixer::input('post')->setDefault('module', 0)
->callFunc('title', 'trim')
->stripTags($this->config->doc->editor->edit['id'], $this->config->allowedTags)
@@ -853,13 +855,14 @@ class docModel extends model
->setDefault('mailto', '')
->add('editedBy', $this->app->user->account)
->add('editedDate', helper::now())
->cleanInt('module')
->cleanInt('project,product,execution,lib,module')
->join('groups', ',')
->join('users', ',')
->join('mailto', ',')
->remove('comment,files,labels,uid,contactListMenu')
->get();
if($doc->acl == 'open') $doc->users = $doc->groups = '';
if($doc->type == 'chapter' and $doc->parent)
{
$parentDoc = $this->dao->select('*')->from(TABLE_DOC)->where('id')->eq((int)$doc->parent)->fetch();
@@ -870,8 +873,6 @@ class docModel extends model
}
}
if(!empty($doc->acl) and $doc->acl == 'private') $doc->users = $oldDoc->addedBy;
$oldDocContent = $this->dao->select('*')->from(TABLE_DOCCONTENT)->where('doc')->eq($docID)->andWhere('version')->eq($oldDoc->version)->fetch();
if($oldDocContent)
{
@@ -891,8 +892,13 @@ class docModel extends model
$doc->execution = $lib->execution;
}
if(isset($doc->type) and $doc->type == 'url') $doc->content = $doc->url;
unset($doc->url);
$requiredFields = $this->config->doc->edit->requiredFields;
if($doc->status == 'draft') $requiredFields = '';
if(strpos(",$requiredFields,", ',content,') !== false)
{
$requiredFields = trim(str_replace(',content,', ',', ",$requiredFields,"), ',');
if(isset($doc->content) and empty($doc->content)) return dao::$errors['content'] = sprintf($this->lang->error->notempty, $this->lang->doc->content);
}
$files = $this->file->saveUpload('doc', $docID);
$changes = common::createChanges($oldDoc, $doc);
@@ -903,28 +909,26 @@ class docModel extends model
if($change['field'] == 'content' or $change['field'] == 'title') $changed = true;
}
$requiredFields = $this->config->doc->edit->requiredFields;
$checkContent = strpos(",$requiredFields,", ',content,') !== false;
if($checkContent)
{
$requiredFields = trim(str_replace(',content,', ',', ",$requiredFields,"), ',');
if(isset($doc->content) and empty($doc->content)) return dao::$errors['content'] = sprintf($this->lang->error->notempty, $this->lang->doc->content);
}
if($changed)
{
$doc->version = $oldDoc->version + 1;
$docContent = new stdclass();
$docContent->doc = $docID;
$docContent->title = $doc->title;
$docContent->content = isset($doc->content) ? $doc->content : '';
$docContent->version = $doc->version;
$docContent->type = $oldDocContent->type;
$docContent->files = $oldDocContent->files;
if(isset($doc->digest)) $docContent->digest = $doc->digest;
if($files) $docContent->files .= ',' . join(',', array_keys($files));
$docContent->files = trim($docContent->files, ',');
$this->dao->replace(TABLE_DOCCONTENT)->data($docContent)->exec();
if(isset($doc->digest)) $docContent->digest = $doc->digest;
if($doc->status == 'draft')
{
$this->dao->update(TABLE_DOCCONTENT)->data($docContent)->where('id')->eq($oldDocContent->id)->exec();
}
else
{
$doc->version = $oldDoc->version + 1;
$docContent->version = $doc->version;
$docContent->type = $oldDocContent->type;
$this->dao->replace(TABLE_DOCCONTENT)->data($docContent)->exec();
}
}
unset($doc->contentType);
+8 -3
View File
@@ -13,6 +13,11 @@
<?php include '../../common/view/header.lite.html.php';?>
<?php include '../../common/view/kindeditor.html.php';?>
<?php include '../../common/view/markdown.html.php';?>
<style>
#main {padding: 0;}
.container {padding: 0 !important;}
#mainContent {padding: 0 !important;}
</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;?>
@@ -22,7 +27,7 @@
<table class='table table-form'>
<tbody>
<tr id='headerBox'>
<td width='90px'><?php echo html::a($backLink, '<i class="icon icon-back icon-sm"></i> ' . $lang->goback, '', "class='btn btn-secondary' id='backBtn'");?></td>
<td width='90px'><?php echo html::a($backLink, "<i class='icon icon-back icon-sm'></i> " . $lang->goback, '', "id='backBtn' class='btn btn-secondary'");?></td>
<td class="doc-title" colspan='3'><?php echo html::input('title', '', "placeholder='{$lang->doc->titlePlaceholder}' id='editorTitle' class='form-control' required");?></td>
<td class="text-right btn-tools">
<span id='savePath' class='text-gray'></span>
@@ -83,11 +88,11 @@
<?php endif;?>
<tr>
<th class='w-100px'><?php echo $lang->doc->libAndModule?></th>
<td colspan='3'><span id='moduleBox' class='required'><?php echo html::select('module', $moduleOptionMenu, $moduleID, "class='form-control chosen'");?></span></td>
<td colspan='3' class='required'><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='3'><?php echo html::input('keywords', '', "class='form-control' placeholder='{$lang->doc->keywordsTips}'");?></td>
<td colspan='3' class='<?php if(strpos($config->doc->edit->requiredFields, 'keywords') !== false) echo 'required'?>'><?php echo html::input('keywords', '', "id='modalKeywords' class='form-control' placeholder='{$lang->doc->keywordsTips}'");?></td>
</tr>
<tr id='fileBox'>
<th><?php echo $lang->doc->files;?></th>
+78 -108
View File
@@ -13,48 +13,10 @@
<?php include '../../common/view/header.html.php';?>
<?php if($doc->contentType == 'html') include '../../common/view/kindeditor.html.php';?>
<?php if($doc->contentType == 'markdown') include '../../common/view/markdown.html.php';?>
<?php js::set('needUpdateContent', $doc->content != $doc->draft);?>
<?php js::set('confirmUpdateContent', $lang->doc->confirmUpdateContent);?>
<?php js::set('docID', $doc->id);?>
<?php js::set('draft', $doc->draft);?>
<?php js::set('holders', $lang->doc->placeholder);?>
<?php js::set('type', 'doc');?>
<style>
#main {padding: 0;}
.container {padding: 0 !important;}
#mainContent {padding: 0 !important;}
.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: 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: 100%; height: 30px;}
.ke-edit {border-top: 1px solid rgb(220, 220, 220)}
.ke-edit, .CodeMirror {margin: 8px 200px 0 200px; background: #fff;}
.kindeditor-ph {padding: 20px 20px 0 20px !important;}
.editor-toolbar {background: #fff; padding-left: 20px; border-right: unset; border-top: unset; height: 30px;}
.CodeMirror {padding: 20px 20px 0 20px;}
.CodeMirror.CodeMirror-wrap {border-left: 0; border-right: 0; border-bottom: 0;}
.ke-statusbar {display: none;}
.article-content {padding: 8px 20px;}
#noticeAcl {margin-left: 10px; vertical-align: middle;}
#basicInfoLink {border: unset;}
#modalBasicInfo .modal-content {overflow-x: hidden; overflow-y: scroll;}
#modalBasicInfo .modal-body {padding-bottom: 10px;}
.modal-title {font-size: 14px !important; font-weight: 700 !important;}
#basicInfoBox tfoot td {padding-bottom: 0;}
</style>
<?php $backLink = $app->session->docList ? $app->session->docList : $this->createLink('doc', 'objectlibs', "type=$type&objectID=$objectID&libID={$lib->id}&docID={$doc->id}") . "#app={$this->app->tab}";?>
<div id="mainContent" class="main-content">
@@ -63,9 +25,15 @@
<tbody>
<tr id='headerBox'>
<td width='90px'><?php echo html::a($backLink, "<i class='icon icon-back icon-sm'></i> " . $lang->goback, '', "id='backBtn' class='btn btn-secondary'");?></td>
<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');?>
<td class="doc-title" colspan='3'><?php echo html::input('title', $doc->title, "placeholder='{$lang->doc->titlePlaceholder}'' id='editorTitle' class='form-control' required");?></td>
<td class="text-right btn-tools">
<?php if($doc->status == 'draft'):?>
<span id='savePath' class='text-gray'></span>
<?php echo html::commonButton($lang->doc->saveDraft, "id='saveDraft'", "btn btn-secondary");?>
<?php echo html::commonButton($lang->release->common, "id='saveRelease'", "btn btn-primary");?>
<?php else:?>
<?php echo html::submitButton($lang->release->common, "", "btn btn-primary");?>
<?php endif;?>
<?php echo html::a('#modalBasicInfo', "<i class='icon icon-cog-outline'></i> " . $lang->settings, '', "data-toggle='modal' id='basicInfoLink' class='btn'");?>
</td>
</tr>
@@ -77,6 +45,7 @@
<?php echo html::hidden('contentType', $doc->contentType);?>
<?php echo html::hidden('type', 'text');?>
<?php echo html::hidden('editedDate', $doc->editedDate);?>
<?php echo html::hidden('status', $doc->status);?>
</div>
</div>
</td>
@@ -84,67 +53,73 @@
</tbody>
</table>
<div class='modal fade modal-basic' id='modalBasicInfo' data-scroll-inside='true'>
<div class='modal fade modal-basic' id='modalBasicInfo'>
<div class='modal-dialog'>
<div class='modal-content with-padding'>
<div class='modal-content'>
<div class='modal-header'>
<h2 class='modal-title'><?php echo $lang->doc->basicInfo;?></h2>
<h2 class='modal-title'>
<?php echo $lang->doc->basicInfo;?>
<button type='button' class='close' data-dismiss='modal'>
<i class="icon icon-close"></i>
</button>
</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>
<tbody>
<?php if(strpos('product|project|execution', $type) !== false):?>
<tr>
<th><?php echo $lang->doc->project;?></th>
<td class='required'><?php echo html::select($type, $objects, $objectID, "class='form-control chosen' onchange='loadObjectModules(\"{$type}\", this.value)'");?></td>
</tr>
<?php endif;?>
<tr>
<th class='w-100px'><?php echo $lang->doc->libAndModule?></th>
<td colspan='3' class='required'><span id='moduleBox'><?php echo html::select('module', $moduleOptionMenu, $doc->lib . '_' . $doc->module, "class='form-control chosen'");?></span></td>
</tr>
<tr>
<th><?php echo $lang->doc->keywords;?></th>
<td colspan='3' class='<?php if(strpos($config->doc->edit->requiredFields, 'keywords') !== false) echo 'required'?>'><?php echo html::input('keywords', $doc->keywords, "id='modalKeywords' class='form-control' placeholder='{$lang->doc->keywordsTips}'");?></td>
</tr>
<tr id='fileBox'>
<th><?php echo $lang->doc->files;?></th>
<td colspan='3'><?php echo $this->fetch('file', 'buildform');?></td>
</tr>
<tr>
<th><?php echo $lang->doc->mailto;?></th>
<td colspan="3">
<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 text-top"><?php echo $lang->doclib->control;?></th>
<td colspan='3' class='aclBox'>
<?php echo html::radio('acl', $lang->doc->aclList, $doc->acl, "onchange='toggleAcl(this.value, \"doc\")'")?>
</td>
</tr>
<tr id='whiteListBox' class='<?php if($doc->acl == 'open') echo 'hidden';?>'>
<th><?php echo $lang->doc->whiteList;?></th>
<td colspan='3'>
<div class='input-group'>
<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'>
<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'")?>
<?php echo $this->fetch('my', 'buildContactLists', "dropdownName=users");?>
</div>
</td>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan='3' class='text-center'><?php echo html::a('javascript:void(0)', $lang->doc->confirm, '', "class='btn btn-primary btn-wide'");?></td>
<td colspan='4' class='text-center'><?php echo html::commonButton($lang->doc->confirm, "data-dismiss='modal'", "btn btn-primary btn-wide");?></td>
</tr>
</tfoot>
</table>
@@ -154,17 +129,12 @@
</div>
</form>
</div>
<script>
$(function()
{
var contentHeight = $(document).height() - 100;
setTimeout(function(){$('.ke-edit-iframe, .ke-edit, .ke-edit-textarea, .CodeMirror').height(contentHeight);}, 100);
$('#modalBasicInfo .modal-content').css('max-height', contentHeight);
$(document).on('click', '#modalBasicInfo tfoot .btn', function() {$('#modalBasicInfo').modal('hide');});
$('iframe.ke-edit-iframe').contents().find('.article-content').css('padding', '20px 20px 0 20px');
})
</script>
<?php js::set('noticeAcl', $lang->doc->noticeAcl['doc']);?>
<?php js::set('needUpdateContent', $doc->content != $doc->draft);?>
<?php js::set('confirmUpdateContent', $lang->doc->confirmUpdateContent);?>
<?php js::set('docID', $doc->id);?>
<?php js::set('draft', $doc->draft);?>
<?php js::set('holders', $lang->doc->placeholder);?>
<?php js::set('type', 'doc');?>
<?php js::set('defaultSave', $lang->doc->defaultSave);?>
<?php js::set('titleNotEmpty', sprintf($lang->error->notempty, $lang->doc->title));?>
<?php include '../../common/view/footer.html.php';?>