Merge branch dev/task-144516 of zentao/zentaopms (#9312)
This commit is contained in:
@@ -109,8 +109,6 @@ $config->doc->form->movetemplate['lib'] = array('type' => 'int', 'required
|
||||
$config->doc->form->movetemplate['module'] = array('type' => 'int', 'required' => true, 'default' => '');
|
||||
$config->doc->form->movetemplate['parent'] = array('type' => 'int', 'required' => false, 'default' => 0);
|
||||
$config->doc->form->movetemplate['acl'] = array('type' => 'string', 'required' => true, 'default' => '');
|
||||
$config->doc->form->movetemplate['groups'] = array('type' => 'array', 'required' => false, 'default' => '', 'filter' => 'join');
|
||||
$config->doc->form->movetemplate['users'] = array('type' => 'array', 'required' => false, 'default' => '', 'filter' => 'join');
|
||||
|
||||
$config->doc->form->batchmovedoc['lib'] = array('type' => 'int', 'required' => true, 'default' => 0);
|
||||
$config->doc->form->batchmovedoc['module'] = array('type' => 'int', 'required' => false, 'default' => 0);
|
||||
|
||||
+14
-18
@@ -693,8 +693,6 @@ class doc extends control
|
||||
$docData->module = $parentTemplate->module;
|
||||
$docData->lib = (int)$parentTemplate->lib;
|
||||
$docData->acl = $parentTemplate->acl;
|
||||
$docData->groups = $parentTemplate->groups;
|
||||
$docData->users = $parentTemplate->users;
|
||||
$docData->templateType = $parentTemplate->templateType;
|
||||
}
|
||||
|
||||
@@ -721,14 +719,12 @@ class doc extends control
|
||||
$docData = form::data()
|
||||
->setDefault('editedBy', $this->app->user->account)
|
||||
->setIF(!isset($_POST['parent']), 'parent', $doc->parent)
|
||||
->setIF(!isset($_POST['users']), 'users', $doc->users)
|
||||
->setIF(!isset($_POST['groups']), 'groups', $doc->groups)
|
||||
->setIF(strpos(",$doc->editedList,", ",{$this->app->user->account},") === false, 'editedList', $doc->editedList . ",{$this->app->user->account}")
|
||||
->setIF($this->post->type == 'chapter', 'content', $doc->content)
|
||||
->setIF($this->post->type == 'chapter', 'rawContent', $doc->rawContent)
|
||||
->get();
|
||||
|
||||
$result = $this->doc->update($docID, $docData);
|
||||
$result = $this->doc->update($docID, $docData);
|
||||
if(dao::isError())
|
||||
{
|
||||
if(!empty(dao::$errors['lib']) || !empty(dao::$errors['keywords'])) return $this->send(array('result' => 'fail', 'message' => dao::getError(), 'callback' => "zui.Modal.open({id: 'modalBasicInfo'});"));
|
||||
@@ -1307,11 +1303,6 @@ class doc extends control
|
||||
if(defined('RUN_MODE') && RUN_MODE == 'api') return $this->send(array('status' => 'fail', 'code' => 404, 'message' => '404 Not found'));
|
||||
return $this->sendError($this->lang->notFound, $this->inlink('index'));
|
||||
}
|
||||
if($doc->templateType)
|
||||
{
|
||||
echo $this->fetch('doc', 'browseTemplate', "libID=$doc->lib&type=all&docID=$docID&orderBy=id_desc&recPerPage=20&pageID=1&mode=view");
|
||||
return;
|
||||
}
|
||||
|
||||
$_SESSION["doc_{$doc->id}_nopriv"] = '';
|
||||
if(!$isApi && !$this->doc->checkPrivDoc($doc))
|
||||
@@ -1322,6 +1313,12 @@ class doc extends control
|
||||
}
|
||||
unset($_SESSION["doc_{$doc->id}_nopriv"]);
|
||||
|
||||
if($doc->templateType)
|
||||
{
|
||||
echo $this->fetch('doc', 'browseTemplate', "libID=$doc->lib&type=all&docID=$docID&orderBy=id_desc&recPerPage=20&pageID=1&mode=view");
|
||||
return;
|
||||
}
|
||||
|
||||
$lib = $this->doc->getLibByID((int)$doc->lib);
|
||||
$objectType = isset($lib->type) ? $lib->type : 'custom';
|
||||
if($objectType == 'api')
|
||||
@@ -1937,8 +1934,6 @@ class doc extends control
|
||||
->setIF(!isset($_POST['module']), 'module', $doc->module)
|
||||
->setIF(!isset($_POST['parent']), 'parent', $doc->parent)
|
||||
->setIF(!isset($_POST['acl']), 'acl', $doc->acl)
|
||||
->setIF(!isset($_POST['groups']), 'groups', $doc->groups)
|
||||
->setIF(!isset($_POST['users']), 'users', $doc->users)
|
||||
->get();
|
||||
$changes = common::createChanges($doc, $data);
|
||||
if($changes)
|
||||
@@ -1946,7 +1941,7 @@ class doc extends control
|
||||
$basicInfoChanged = false;
|
||||
foreach($changes as $change)
|
||||
{
|
||||
if(in_array($change['field'], array('module', 'lib', 'acl', 'groups', 'users'))) $basicInfoChanged = true;
|
||||
if(in_array($change['field'], array('module', 'lib', 'acl'))) $basicInfoChanged = true;
|
||||
}
|
||||
$this->doc->doUpdateDoc($docID, $data, $basicInfoChanged);
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
@@ -1987,8 +1982,6 @@ class doc extends control
|
||||
$this->view->doc = $doc;
|
||||
$this->view->docID = $docID;
|
||||
$this->view->modules = $this->loadModel('tree')->getOptionMenu((int)$doc->lib, 'docTemplate', 0, 'all', 'nodeleted', 'all');
|
||||
$this->view->users = $this->loadModel('user')->getPairs('nocode|noclosed|nodeleted');
|
||||
$this->view->groups = $this->loadModel('group')->getPairs();
|
||||
$this->display();
|
||||
}
|
||||
|
||||
@@ -2316,7 +2309,7 @@ class doc extends control
|
||||
$doc = $this->doc->getByID($docID, $version);
|
||||
$doc->lib = (int)$doc->lib;
|
||||
$doc->module = (int)$doc->module;
|
||||
$doc->privs = array('edit' => common::hasPriv('doc', 'edit', $doc));
|
||||
$doc->privs = array('edit' => common::hasPriv('doc', 'edit', $doc) && $doc->acl == 'open');
|
||||
$doc->editors = $this->doc->getEditors($docID);
|
||||
$doc->draft = $this->doc->getDraft($docID);
|
||||
|
||||
@@ -2490,11 +2483,14 @@ class doc extends control
|
||||
$scopeList = $this->doc->getTemplateScopes();
|
||||
$this->view->scopeItems = $this->doc->getScopeItems($scopeList);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->view->users = $this->user->getPairs('nocode|noclosed|nodeleted');
|
||||
$this->view->groups = $this->loadModel('group')->getPairs();
|
||||
}
|
||||
|
||||
$this->view->docID = $docID;
|
||||
$this->view->mode = empty($docID) ? 'create' : 'edit';
|
||||
$this->view->users = $this->user->getPairs('nocode|noclosed|nodeleted');
|
||||
$this->view->groups = $this->loadModel('group')->getPairs();
|
||||
$this->view->libID = $libID;
|
||||
$this->view->moduleID = $moduleID;
|
||||
$this->view->objectID = $objectID;
|
||||
|
||||
@@ -421,7 +421,7 @@ $lang->doc->aclList['open'] = "Public (Access with library permissions)";
|
||||
$lang->doc->aclList['private'] = "Private (Only creators and whitelist users can access)";
|
||||
|
||||
$lang->doc->aclListA['open'] = "Public (Everyone can access it, with permission to edit document templates for access and maintenance.)";
|
||||
$lang->doc->aclListA['private'] = "Private (Only creators and whitelist users can access it, with permission to edit document templates for access and management.)";
|
||||
$lang->doc->aclListA['private'] = "Private (Only creators can edit and use it)";
|
||||
|
||||
$lang->doc->selectSpace = 'Select Space';
|
||||
$lang->doc->space = 'Space';
|
||||
|
||||
@@ -421,7 +421,7 @@ $lang->doc->aclList['open'] = "Public (Access with library permissions)";
|
||||
$lang->doc->aclList['private'] = "Private (Only creators and whitelist users can access)";
|
||||
|
||||
$lang->doc->aclListA['open'] = "Public (Everyone can access it, with permission to edit document templates for access and maintenance)";
|
||||
$lang->doc->aclListA['private'] = "Private (Only creators and whitelist users can access it, with permission to edit document templates for access and management)";
|
||||
$lang->doc->aclListA['private'] = "Private (Only creators can edit and use it)";
|
||||
|
||||
$lang->doc->selectSpace = 'Select Space';
|
||||
$lang->doc->space = 'Space';
|
||||
|
||||
@@ -421,7 +421,7 @@ $lang->doc->aclList['open'] = "Public (Access with library permissions)";
|
||||
$lang->doc->aclList['private'] = "Private (Only creators and whitelist users can access)";
|
||||
|
||||
$lang->doc->aclListA['open'] = "Public (Everyone can access it, with permission to edit document templates for access and maintenance)";
|
||||
$lang->doc->aclListA['private'] = "Private (Only creators and whitelist users can access it, with permission to edit document templates for access and management)";
|
||||
$lang->doc->aclListA['private'] = "Private (Only creators can edit and use it)";
|
||||
|
||||
$lang->doc->selectSpace = 'Select Space';
|
||||
$lang->doc->space = 'Space';
|
||||
|
||||
@@ -421,7 +421,7 @@ $lang->doc->aclList['open'] = "公开(所有人都可查看和编辑)";
|
||||
$lang->doc->aclList['private'] = "私有(仅特定人员可查看和编辑)";
|
||||
|
||||
$lang->doc->aclListA['open'] = "公开(所有人均可访问,有编辑文档模板权限可访问并维护)";
|
||||
$lang->doc->aclListA['private'] = "私有(仅创建者和白名单用户可访问,有编辑文档模板权限可访问并管理)";
|
||||
$lang->doc->aclListA['private'] = "私有(仅创建者自己可以编辑、使用)";
|
||||
|
||||
$lang->doc->selectSpace = '选择空间';
|
||||
$lang->doc->space = '所属空间';
|
||||
|
||||
@@ -1768,14 +1768,14 @@ class docModel extends model
|
||||
if(dao::isError()) return false;
|
||||
if($files) $this->file->updateObjectID($this->post->uid, $docID, 'doc');
|
||||
|
||||
/* 如果修改了父模板,子模板也同步更新相关信息。*/
|
||||
/* If the parent template is modified, the child template will also update the relevant information synchronously. */
|
||||
if(!empty($oldDoc->templateType) && empty($doc->parent) && $basicInfoChanged)
|
||||
{
|
||||
$this->dao->update(TABLE_DOC)
|
||||
->set('module')->eq($doc->module)
|
||||
->set('lib')->eq($doc->lib)
|
||||
->set('acl')->eq($doc->acl)
|
||||
->set('groups')->eq($doc->groups)
|
||||
->set('users')->eq($doc->users)
|
||||
->where("FIND_IN_SET('{$docID}', `path`)")
|
||||
->exec();
|
||||
}
|
||||
|
||||
@@ -50,40 +50,7 @@ formPanel
|
||||
(
|
||||
set::name('acl'),
|
||||
set::items($lang->doc->aclListA),
|
||||
set::value($doc->acl),
|
||||
on::change('toggleWhiteList')
|
||||
)
|
||||
) : null,
|
||||
empty($doc->parent) ? formGroup
|
||||
(
|
||||
setID('whiteListBox'),
|
||||
setClass($whiteListHidden),
|
||||
set::label($lang->doc->whiteList),
|
||||
div
|
||||
(
|
||||
setClass('w-full check-list'),
|
||||
inputGroup
|
||||
(
|
||||
setClass('w-full'),
|
||||
$lang->doc->groupLabel,
|
||||
picker
|
||||
(
|
||||
set::name('groups[]'),
|
||||
set::items($groups),
|
||||
set::value($doc->groups),
|
||||
set::multiple(true)
|
||||
)
|
||||
),
|
||||
div
|
||||
(
|
||||
setClass('w-full'),
|
||||
userPicker
|
||||
(
|
||||
set::label($lang->doc->userLabel),
|
||||
set::items($users),
|
||||
set::value($doc->users)
|
||||
)
|
||||
)
|
||||
set::value($doc->acl)
|
||||
)
|
||||
) : null
|
||||
);
|
||||
|
||||
@@ -70,40 +70,7 @@ formPanel
|
||||
setClass($objectType == 'mine' ? 'pointer-events-none' : ''),
|
||||
set::name('acl'),
|
||||
set::items($lang->doc->aclListA),
|
||||
set::value(isset($doc) ? $doc->acl : 'open'),
|
||||
on::change('toggleWhiteList')
|
||||
)
|
||||
) : null,
|
||||
empty($parentID) ? formGroup
|
||||
(
|
||||
setID('whiteListBox'),
|
||||
setClass((isset($doc) && $libID == $doc->lib && $objectType != 'mine' && $doc->acl == 'private') ? '' : 'hidden'),
|
||||
set::label($lang->doc->whiteList),
|
||||
div
|
||||
(
|
||||
setClass('w-full check-list'),
|
||||
inputGroup
|
||||
(
|
||||
setClass('w-full'),
|
||||
$lang->doc->groupLabel,
|
||||
picker
|
||||
(
|
||||
set::name('groups[]'),
|
||||
set::items($groups),
|
||||
set::value(isset($doc) ? $doc->groups : null),
|
||||
set::multiple(true)
|
||||
)
|
||||
),
|
||||
div
|
||||
(
|
||||
setClass('w-full'),
|
||||
userPicker
|
||||
(
|
||||
set::label($lang->doc->userLabel),
|
||||
set::items($users),
|
||||
set::value(isset($doc) ? $doc->users : null)
|
||||
)
|
||||
)
|
||||
set::value(isset($doc) ? $doc->acl : 'open')
|
||||
)
|
||||
) : null
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user