* [refac story #49398] Add space field.

This commit is contained in:
wangyidong
2024-08-09 09:28:52 +08:00
committed by 孙广明
parent 6818703906
commit 7cd5824a0e
3 changed files with 13 additions and 1 deletions
+1
View File
@@ -20,6 +20,7 @@ $config->doc->form->createlib['vision'] = array('type' => 'string', 'requir
$config->doc->form->createlib['addedBy'] = array('type' => 'string', 'required' => false, 'default' => '');
$config->doc->form->createlib['addedDate'] = array('type' => 'datetime', 'required' => false, 'default' => $now);
$config->doc->form->editlib['space'] = array('type' => 'string', 'required' => true, 'default' => '');
$config->doc->form->editlib['name'] = array('type' => 'string', 'required' => true, 'default' => '', 'filter' => 'trim');
$config->doc->form->editlib['acl'] = array('type' => 'string', 'required' => false, 'default' => '');
$config->doc->form->editlib['groups'] = array('type' => 'array', 'required' => false, 'default' => '', 'filter' => 'join');
+9
View File
@@ -1,3 +1,12 @@
window.changeSpace = function(e)
{
let targetSpace = e.target.value;
if((targetSpace == 'mine' && space != 'mine') || (targetSpace != 'mine' && space == 'mine'))
{
loadModal($.createLink('doc', 'editLib', "libID=" + doclibID + "&targetSpace=" + targetSpace));
}
};
$(function()
{
toggleAcl('lib');
+3 -1
View File
@@ -379,11 +379,13 @@ class docModel extends model
$this->checkApiLibName($lib, $type, $libID);
}
$this->dao->update(TABLE_DOCLIB)->data($lib)->autoCheck()
$this->dao->update(TABLE_DOCLIB)->data($lib, 'space')->autoCheck()
->batchCheck($this->config->doc->editlib->requiredFields, 'notempty')
->where('id')->eq($libID)
->exec();
$this->moveLib($libID, $lib);
if(dao::isError()) return false;
return common::createChanges($oldLib, $lib);
}