* Code for task #59750.

This commit is contained in:
hufangzhou
2022-07-20 10:13:21 +08:00
parent 70f12a35da
commit 1dcf2dcb2c
15 changed files with 695 additions and 268 deletions
+29 -1
View File
@@ -486,6 +486,7 @@ 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->docType = $doc->type;
$this->display();
}
@@ -782,6 +783,21 @@ class doc extends control
return print(json_encode($this->doc->getAllLibGroups()));
}
/**
* AJAX: Get libs by type.
*
* @param string $type
* @access public
* @return void
*/
public function ajaxGetLibsByType($type)
{
$unclosed = strpos($this->config->doc->custom->showLibs, 'unclosed') !== false ? 'unclosedProject' : '';
$libs = $this->doc->getLibs($type, "withObject,$unclosed");
return print(html::select('lib', $libs, '', 'class="form-control"'));
}
/**
* Ajax get all child module.
*
@@ -1239,11 +1255,23 @@ class doc extends control
$response['message'] = $this->lang->saveSuccess;
$response['result'] = 'success';
$response['closeModal'] = true;
$response['callback'] = "redirectParentWindow(\"{$this->post->objectType}\")";
$response['callback'] = "redirectParentWindow(\"{$this->post->objectType}\", \"{$this->post->lib}\", \"{$this->post->type}\")";
return $this->send($response);
}
unset($this->lang->doc->libTypeList['book']);
$globalTypeList = $this->lang->doc->libTypeList;
$globalTypeList = $this->config->vision == 'lite' ? $globalTypeList : $globalTypeList + $this->lang->doc->libGlobalList;
$defaultType = key($globalTypeList);
$unclosed = strpos($this->config->doc->custom->showLibs, 'unclosed') !== false ? 'unclosedProject' : '';
$libs = $this->doc->getLibs($defaultType, "withObject,$unclosed");
$this->view->globalTypeList = $globalTypeList;
$this->view->defaultType = $defaultType;
$this->view->libs = $libs;
$this->display();
}